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

Loading…
Cancel
Save