Browse Source

修改发货校验

hella_online_20241128
lijuncheng 2 months ago
parent
commit
7335112fce
  1. 30
      src/pages/deliver/coms/comScanDeliverPack.vue

30
src/pages/deliver/coms/comScanDeliverPack.vue

@ -179,7 +179,8 @@
fontSize: "100rpx" fontSize: "100rpx"
}, },
bussinessCode: 'Issue', bussinessCode: 'Issue',
toLocationAreaTypeList: [] toLocationAreaTypeList: [],
itemInfo:null
} }
}, },
created() { created() {
@ -292,7 +293,7 @@
) )
return; return;
} else { } else {
this.itemInfo=item
var params = { var params = {
itemCode: result.package.itemCode, itemCode: result.package.itemCode,
batch: result.label.batch, batch: result.label.batch,
@ -572,7 +573,7 @@
this.showQuestionMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode + this.showQuestionMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode +
"】与推荐的库位不一致,是否要继续发货?", res => { "】与推荐的库位不一致,是否要继续发货?", res => {
if (res) { if (res) {
let locaion = that.createLocationInfo(label, balance, packageInfo, item.qty); let locaion = that.createLocationInfo(label, balance, packageInfo);
if(locaion){ if(locaion){
item.Locations.push(locaion); item.Locations.push(locaion);
this.getfocus(); this.getfocus();
@ -740,7 +741,7 @@
}, },
// //
createLocationInfo(label, balance, packageInfo, itemCodeQty) { createLocationInfo(label, balance, packageInfo) {
let location = { let location = {
fromLocationCode: balance.locationCode, fromLocationCode: balance.locationCode,
qty: balance.qty, qty: balance.qty,
@ -749,7 +750,7 @@
isNewAdd: true, isNewAdd: true,
Batchs: [] Batchs: []
} }
let batch = this.createBatchInfo(label, balance, packageInfo, itemCodeQty); let batch = this.createBatchInfo(label, balance, packageInfo);
if(batch){ if(batch){
batch.detail = balance; batch.detail = balance;
batch.detail.fromLocationCode = balance.locationCode; batch.detail.fromLocationCode = balance.locationCode;
@ -762,7 +763,7 @@
}, },
createBatchInfo(data, balance, packageInfo, itemCodeQty) { createBatchInfo(data, balance, packageInfo) {
let batch = { let batch = {
isNewAdd: true, isNewAdd: true,
batch: data.batch, batch: data.batch,
@ -772,7 +773,7 @@
Records: [] Records: []
} }
let record = this.creatRecord(data, balance, packageInfo); let record = this.creatRecord(data, balance, packageInfo);
if (!this.checkQty(batch, record,itemCodeQty)) { if (!this.checkHandleQty(record)) {
return; return;
} }
@ -897,14 +898,19 @@
}, },
checkHandleQty(batch, record) { checkHandleQty(record) {
var isPassed = true; var isPassed = true;
if (this.jobContent.allowBiggerQty == "FALSE") { if (this.jobContent.allowBiggerQty == "FALSE") {
var tempHandleQty = 0 var scanQty=0
batch.Records.forEach(res => { var recommendQty =this.itemInfo.qty
tempHandleQty = calc.add(tempHandleQty, res.qty) this.itemInfo.Locations.forEach(location=>{
location.Batchs.forEach(batch=>{
batch.Records.forEach(record=>{
scanQty= calc.add(scanQty, record.qty)
})
})
}) })
var vailQty = calc.sub(batch.qty, tempHandleQty) var vailQty = calc.sub(recommendQty, scanQty)
if (record.qty > vailQty) { if (record.qty > vailQty) {
this.showErrorMessage("扫描标签数量[" + record.qty + "]大于剩余推荐数量[" + vailQty + "]") this.showErrorMessage("扫描标签数量[" + record.qty + "]大于剩余推荐数量[" + vailQty + "]")
isPassed = false; isPassed = false;

Loading…
Cancel
Save