Browse Source

修改成品发货数量校验

hella_online_20241128
lijuncheng 2 months ago
parent
commit
7eb3360763
  1. 28
      src/pages/deliver/coms/comScanDeliverPack.vue
  2. 5
      src/pages/deliver/job/deliverDetail.vue

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

@ -814,6 +814,9 @@
"]的父包装已经扫描") "]的父包装已经扫描")
} else { } else {
let record = this.creatRecord(label, balance, packageInfo); let record = this.creatRecord(label, balance, packageInfo);
if(!this.checkHandleQty(batch,record)){
return;
}
batch.Records.push(record); batch.Records.push(record);
this.issueRecord.unshift(record) this.issueRecord.unshift(record)
this.calcBatchHandleQty(batch); this.calcBatchHandleQty(batch);
@ -836,6 +839,9 @@
if (res) { if (res) {
batch.Records = []; batch.Records = [];
let record = this.creatRecord(label, balance, packageInfo); let record = this.creatRecord(label, balance, packageInfo);
if(!this.checkHandleQty(batch,record)){
return;
}
batch.Records.push(record); batch.Records.push(record);
this.issueRecord.unshift(record) this.issueRecord.unshift(record)
this.calcBatchHandleQty(batch); this.calcBatchHandleQty(batch);
@ -846,6 +852,9 @@
console.log("扫描的是父包装,是否移除子包装") console.log("扫描的是父包装,是否移除子包装")
} else { } else {
let record = this.creatRecord(label, balance, packageInfo); let record = this.creatRecord(label, balance, packageInfo);
if(!this.checkHandleQty(batch,record)){
return;
}
batch.Records.push(record); batch.Records.push(record);
this.issueRecord.unshift(record) this.issueRecord.unshift(record)
this.calcBatchHandleQty(batch); this.calcBatchHandleQty(batch);
@ -856,7 +865,24 @@
} }
}, },
checkHandleQty(batch,record){
var isPassed=true;
if(this.jobContent.allowBiggerQty=="FALSE"){
var tempHandleQty=0
batch.Records.forEach(res => {
tempHandleQty = calc.add(tempHandleQty, res.qty)
})
var vailQty =calc.sub(batch.qty,tempHandleQty)
if( record.qty>vailQty){
this.showErrorMessage("扫描标签数量["+record.qty+"]大于剩余推荐数量["+vailQty+"]")
isPassed=false;
}
}
return isPassed
}
,
getfocus() { getfocus() {
if (this.$refs.comscan != undefined) { if (this.$refs.comscan != undefined) {
this.$refs.comscan.getfocus(); this.$refs.comscan.getfocus();

5
src/pages/deliver/job/deliverDetail.vue

@ -283,11 +283,11 @@
// //
this.detailSource.forEach(detail=>{ this.detailSource.forEach(detail=>{
detail.Items.forEach(item=>{ detail.Items.forEach(item=>{
if(this.jobContent.allowPartialComplete=="FALSE"){ // if(this.jobContent.allowPartialComplete=="FALSE"){
if(item.taskQty!=item.totalQty){ if(item.taskQty!=item.totalQty){
str += `物料号【${item.itemCode}】任务数量【${item.taskQty}】与实际提交数量【${item.totalQty}】不一致\n` str += `物料号【${item.itemCode}】任务数量【${item.taskQty}】与实际提交数量【${item.totalQty}】不一致\n`
} }
} // }
}) })
}) })
@ -314,7 +314,6 @@
uni.hideLoading() uni.hideLoading()
return ; return ;
} }
deliverJobSubmit(params).then(res => { deliverJobSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {

Loading…
Cancel
Save