From 7eb33607633bfe0e07bc3ac05664472533a67374 Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Tue, 26 Nov 2024 09:55:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=88=90=E5=93=81=E5=8F=91?= =?UTF-8?q?=E8=B4=A7=E6=95=B0=E9=87=8F=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/deliver/coms/comScanDeliverPack.vue | 28 ++++++++++++++++++- src/pages/deliver/job/deliverDetail.vue | 5 ++-- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/pages/deliver/coms/comScanDeliverPack.vue b/src/pages/deliver/coms/comScanDeliverPack.vue index 1793b008..0434fbb3 100644 --- a/src/pages/deliver/coms/comScanDeliverPack.vue +++ b/src/pages/deliver/coms/comScanDeliverPack.vue @@ -814,6 +814,9 @@ "]的父包装已经扫描") } else { let record = this.creatRecord(label, balance, packageInfo); + if(!this.checkHandleQty(batch,record)){ + return; + } batch.Records.push(record); this.issueRecord.unshift(record) this.calcBatchHandleQty(batch); @@ -836,6 +839,9 @@ if (res) { batch.Records = []; let record = this.creatRecord(label, balance, packageInfo); + if(!this.checkHandleQty(batch,record)){ + return; + } batch.Records.push(record); this.issueRecord.unshift(record) this.calcBatchHandleQty(batch); @@ -846,6 +852,9 @@ console.log("扫描的是父包装,是否移除子包装") } else { let record = this.creatRecord(label, balance, packageInfo); + if(!this.checkHandleQty(batch,record)){ + return; + } batch.Records.push(record); this.issueRecord.unshift(record) 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() { if (this.$refs.comscan != undefined) { this.$refs.comscan.getfocus(); diff --git a/src/pages/deliver/job/deliverDetail.vue b/src/pages/deliver/job/deliverDetail.vue index c43b5792..26bb47a2 100644 --- a/src/pages/deliver/job/deliverDetail.vue +++ b/src/pages/deliver/job/deliverDetail.vue @@ -283,11 +283,11 @@ //如果允许部分提交任务有扫描记录就可以直接提交;如果不允许部分执行,任务数量和提交数量不一致给出提示 this.detailSource.forEach(detail=>{ detail.Items.forEach(item=>{ - if(this.jobContent.allowPartialComplete=="FALSE"){ + // if(this.jobContent.allowPartialComplete=="FALSE"){ if(item.taskQty!=item.totalQty){ str += `物料号【${item.itemCode}】任务数量【${item.taskQty}】与实际提交数量【${item.totalQty}】不一致\n` } - } + // } }) }) @@ -314,7 +314,6 @@ uni.hideLoading() return ; } - deliverJobSubmit(params).then(res => { uni.hideLoading() if (res.data) {