|
|
@ -11,10 +11,18 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="" style="font-size: 35rpx;margin-top: 10rpx;"> |
|
|
|
采购订单 : {{poNumber}} |
|
|
|
<view class="uni-flex space-between u-col-center" |
|
|
|
style="font-size: 33rpx;align-items: center;margin-top: 5rpx;margin-bottom: 5rpx;"> |
|
|
|
<view class=""> |
|
|
|
<text>采购订单 : {{poNumber}}</text> |
|
|
|
</view> |
|
|
|
<view @click="showPopListPopup" class="" |
|
|
|
style="font-size: 33rpx;background-color: #3399FF; padding:10rpx ;border-radius:10rpx;color: #FFFFFF;"> |
|
|
|
查看箱码 |
|
|
|
</view> |
|
|
|
<view class="" style="background-color: black; width: 100%; margin-top:10rpx; height: 1rpx;"> |
|
|
|
|
|
|
|
</view> |
|
|
|
<view class="" style="background-color: black; width: 100%; height: 1rpx;"> |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -54,6 +62,7 @@ |
|
|
|
<win-scan-button @goScan='openScanPopup' v-if="itemList.length>0"></win-scan-button> |
|
|
|
<win-scan-by-pack ref="scanPopup" @getScanResult='getScanResult'></win-scan-by-pack> |
|
|
|
<com-balance ref="balanceItems" @selectedItem='selectedBalanceItem'></com-balance> |
|
|
|
<comList ref="comList"> </comList> |
|
|
|
<com-message ref="comMessage" @afterCloseScanMessage='closeScanMessage' @afterRescanMessage='afterRescan' |
|
|
|
@afterCloseCommitMessage='closeCommitMessage'> |
|
|
|
</com-message> |
|
|
@ -66,6 +75,7 @@ |
|
|
|
getBalancesByFilterAsync, |
|
|
|
getPurchaseDetailAsync, |
|
|
|
purchasePutaway, |
|
|
|
getPurchasePutawayAsyncDetail |
|
|
|
} from '@/api/index.js'; |
|
|
|
|
|
|
|
import { |
|
|
@ -80,6 +90,7 @@ |
|
|
|
import winScanByPack from '@/mycomponents/wincom/winScanByPack.vue' |
|
|
|
import comMessage from '@/mycomponents/common/comMessage.vue' |
|
|
|
import comBalance from '@/mycomponents/common/comBalance.vue' |
|
|
|
import comList from '@/mycomponents/common/comList.vue' |
|
|
|
import winCollapseLocation from '@/mycomponents/wincom/winCollapseLocation.vue' |
|
|
|
import comCollapseItem from '@/mycomponents/common/comCollapseItem.vue' |
|
|
|
|
|
|
@ -93,7 +104,8 @@ |
|
|
|
winScanByPack, |
|
|
|
comBalance, |
|
|
|
winCollapseLocation, |
|
|
|
comCollapseItem |
|
|
|
comCollapseItem, |
|
|
|
comList |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
@ -103,7 +115,8 @@ |
|
|
|
recommendErpLocationCode: '', |
|
|
|
currentLabel: null, |
|
|
|
reScanItem: null, //重复的箱码 |
|
|
|
poNumber: "" |
|
|
|
poNumber: "", |
|
|
|
showPopList: [] |
|
|
|
}; |
|
|
|
}, |
|
|
|
props: { |
|
|
@ -159,6 +172,7 @@ |
|
|
|
} |
|
|
|
if (this.itemList == 0) { |
|
|
|
this.poNumber = "" |
|
|
|
this.showPopList = [] |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
@ -166,49 +180,26 @@ |
|
|
|
let that = this; |
|
|
|
that.currentLabel = result.data; |
|
|
|
let code = result.data.packingCode; |
|
|
|
let itemInfo = that.itemList.find(r => { |
|
|
|
|
|
|
|
let itemInfo = this.itemList.find(r => { |
|
|
|
return r.itemCode == result.data.itemCode |
|
|
|
}) |
|
|
|
|
|
|
|
console.log("采购订单" + this.poNumber) |
|
|
|
if (this.poNumber == "") { |
|
|
|
this.poNumber = that.currentLabel.poNumber |
|
|
|
} else { |
|
|
|
if (this.poNumber != that.currentLabel.poNumber) { |
|
|
|
this.showMessage("当前采购订单是号[" + this.poNumber + "]与扫描的箱码["+code+"]对应的采购订单号[" + that.currentLabel.poNumber + "]不一致") |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
let params = JSON.stringify(that.currentLabel); |
|
|
|
console.log('采购上架', params); |
|
|
|
if (itemInfo == undefined) { |
|
|
|
that.getBalance(); |
|
|
|
this.getBalance(); |
|
|
|
} else { |
|
|
|
let data = itemInfo.labelList.find(r => { |
|
|
|
return r.packingCode == code |
|
|
|
}) |
|
|
|
if (data == undefined) { |
|
|
|
that.getBalance(); |
|
|
|
this.getBalance(); |
|
|
|
} else { |
|
|
|
this.reScanItem = itemInfo; |
|
|
|
this.showRescanMessage('箱码【' + code + '】已经存在,是否要重新扫描?'); |
|
|
|
// showConfirmMsg('箱码【' + code + '】已经存在,是否要重新扫描?', confirm => { |
|
|
|
// if (confirm) { |
|
|
|
// itemInfo.labelList.forEach((r, i) => { |
|
|
|
// if (r.packingCode == code) { |
|
|
|
// itemInfo.labelList.splice(i, 1); |
|
|
|
// return; |
|
|
|
// } |
|
|
|
// }); |
|
|
|
// that.getBalance(); |
|
|
|
// } else { |
|
|
|
// this.scanPopupGetFocus(); |
|
|
|
// } |
|
|
|
// }); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//重新扫描 |
|
|
|
afterRescan(val) { |
|
|
|
let that = this; |
|
|
@ -265,14 +256,50 @@ |
|
|
|
let locationErpCode = purchaseDetail.recommendErpCode; |
|
|
|
if (this.itemList.length == 0) { |
|
|
|
this.recommendErpLocationCode = locationErpCode; |
|
|
|
this.createItem(balanceItem, purchaseDetail); |
|
|
|
this.checkData(balanceItem, purchaseDetail) |
|
|
|
} else { |
|
|
|
if (this.recommendErpLocationCode != locationErpCode) { |
|
|
|
this.showScanMessage('当前零件的ERP储位是【' + locationErpCode + '】与【' + this |
|
|
|
.recommendErpLocationCode + |
|
|
|
'】不是同一ERP储位,请重新扫描'); |
|
|
|
} else { |
|
|
|
this.createItem(balanceItem, purchaseDetail); |
|
|
|
this.checkData(balanceItem, purchaseDetail) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
checkData(balanceItem, purchaseDetail) { |
|
|
|
var that = this; |
|
|
|
var poNumber = purchaseDetail.poNumber; |
|
|
|
var packingCode = purchaseDetail.packingCode |
|
|
|
if (that.poNumber == "" && that.showPopList.length == 0) { |
|
|
|
uni.showLoading({ |
|
|
|
title: "获取采购订单箱码...", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
getPurchasePutawayAsyncDetail(poNumber).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.length > 0) { |
|
|
|
that.poNumber = poNumber |
|
|
|
that.showPopList = res; |
|
|
|
that.createItem(balanceItem, purchaseDetail); |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
that.poNumber = ""; |
|
|
|
that.showPopList = []; |
|
|
|
that.showMessage(err.message); |
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
let item = that.showPopList.find(r => { |
|
|
|
return r == packingCode |
|
|
|
}) |
|
|
|
if (item == undefined) { |
|
|
|
//提示不在采购订单中 |
|
|
|
that.showMessage("扫描的箱码[" + packingCode + "]不在当前采购订单[" + this.poNumber + "]中"); |
|
|
|
return |
|
|
|
} else { |
|
|
|
that.createItem(balanceItem, purchaseDetail); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
@ -445,6 +472,10 @@ |
|
|
|
this.location = null; |
|
|
|
}, |
|
|
|
|
|
|
|
showPopListPopup() { |
|
|
|
this.$refs.comList.openPopup(this.showPopList, this.poNumber); |
|
|
|
}, |
|
|
|
|
|
|
|
submit() { |
|
|
|
let that = this; |
|
|
|
if (that.itemList.length === 0) { |
|
|
@ -477,18 +508,17 @@ |
|
|
|
item.details.push(r); |
|
|
|
}) |
|
|
|
}) |
|
|
|
console.log("采购订单" + this.poNumber) |
|
|
|
let params = JSON.stringify(item); |
|
|
|
// purchasePutaway(params) |
|
|
|
// .then(res => { |
|
|
|
// that.showCommitSuccess(); |
|
|
|
// that.clearInfo(); |
|
|
|
// uni.hideLoading(); |
|
|
|
// }) |
|
|
|
// .catch(err => { |
|
|
|
// that.showMessage(err.message); |
|
|
|
// uni.hideLoading(); |
|
|
|
// }); |
|
|
|
purchasePutaway(params) |
|
|
|
.then(res => { |
|
|
|
that.showCommitSuccess(); |
|
|
|
that.clearInfo(); |
|
|
|
uni.hideLoading(); |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
that.showMessage(err.message); |
|
|
|
uni.hideLoading(); |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
cancel() { |
|
|
@ -505,6 +535,8 @@ |
|
|
|
that.itemList = []; |
|
|
|
that.location = null; |
|
|
|
that.recommendErpLocationCode = ''; |
|
|
|
that.poNumber = ""; |
|
|
|
that.showPopList = []; |
|
|
|
}, |
|
|
|
|
|
|
|
clearPackCode() { |
|
|
|