From 1c09667a27d0a7fb0c78e0032fee594aaf1d2b6c Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Mon, 28 Oct 2024 16:33:15 +0800 Subject: [PATCH] =?UTF-8?q?YT-505=E6=88=90=E5=93=81=E5=8F=91=E8=B4=A7?= =?UTF-8?q?=EF=BC=9A=E6=89=AB=E6=8F=8F=E6=95=B0=E9=87=8F=E5=A4=A7=E4=BA=8E?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=95=B0=E9=87=8F=E6=97=B6=EF=BC=8C=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E9=85=8D=E7=BD=AE=E4=BA=86=E4=B8=8D=E5=85=81=E8=AE=B8?= =?UTF-8?q?=E5=A4=A7=E4=BA=8E=E6=8E=A8=E8=8D=90=E6=95=B0=E9=87=8F=EF=BC=8C?= =?UTF-8?q?=E5=88=99=E4=B8=8D=E5=8F=AF=E6=8F=90=E4=BA=A4=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/deliver/job/deliverDetailBatch.vue | 78 ++++++++++++++++---- 1 file changed, 63 insertions(+), 15 deletions(-) diff --git a/src/pages/deliver/job/deliverDetailBatch.vue b/src/pages/deliver/job/deliverDetailBatch.vue index 17800ee6..4edbeb25 100644 --- a/src/pages/deliver/job/deliverDetailBatch.vue +++ b/src/pages/deliver/job/deliverDetailBatch.vue @@ -224,6 +224,8 @@ getManagementPrecisions(itemCodes, locationCode, res => { if (res.success) { this.managementList = res.list; + this.managementType = this.managementList && this.managementList[0] ? this.managementList[0].ManagementPrecision : 'BY_PACKAGING' + this.submitJob(); } else { uni.hideLoading(); @@ -248,28 +250,67 @@ }, checkCount() { + let str="" + this.detailSource.forEach(detail => { + detail.Items.forEach(item => { + var taskQty =0; + item.taskQty =calc.add(taskQty,item.qty) + var totalQty =0; + item.Locations.forEach(lco => { + lco.Batchs.forEach(batch => { + batch.Records.forEach(record => { + if(record){ + var hanleQty =record.qty?record.qty:0 + totalQty = calc.add(totalQty,hanleQty) + } + + }) + }) + }) + //实际扫描的数量 + item.totalQty =totalQty + + }) + }) + //如果允许部分提交任务有扫描记录就可以直接提交;如果不允许部分执行,任务数量和提交数量不一致给出提示 + this.detailSource.forEach(detail=>{ + detail.Items.forEach(item=>{ + if(this.jobContent.allowPartialComplete=="FALSE"){ + if(item.taskQty!=item.totalQty){ + str += `物料号【${item.itemCode}】任务数量【${item.taskQty}】与实际提交数量【${item.totalQty}】不一致\n` + } + } + }) + }) + + if(str){ + str = '不允许提交\n' + str + this.showErrorMessage(str) + } + + return str?false:true + }, + checkCountBatch() { let str = "" let str1 = "" - var taskQty = 0; - var totalQty = 0; this.detailSource.subList.forEach(item => { + var taskQty = 0; + var totalQty = 0; item.taskQty = calc.add(taskQty, item.qty) - var hanleQty = item.qty ? item.qty : 0 - totalQty = calc.add(totalQty, hanleQty) + totalQty = calc.add(totalQty, item.handleQty) //实际扫描的数量 item.totalQty = totalQty - }) //如果允许部分提交任务有扫描记录就可以直接提交;如果不允许部分执行,任务数量和提交数量不一致给出提示 this.detailSource.subList.forEach(detail => { if (this.jobContent.allowPartialComplete == "FALSE") { - if (taskQty != totalQty) { - str += `物料号【${detail.itemCode}】任务数量【${taskQty}】与实际提交数量【${totalQty}】不一致\n` + if (detail.taskQty != detail.totalQty) { + str += `物料号【${detail.itemCode}】任务数量【${detail.taskQty}】与实际提交数量【${detail.totalQty}】不一致\n` } } if (this.allowBiggerQty == 'FALSE') { - if (taskQty > totalQty) { - str1 += '数量[' + totalQty + ']不允许大于任务数量[' + taskQty + ']' + if ( detail.taskQty < detail.totalQty) { + str1 += '数量[' + detail.totalQty + ']不允许大于任务数量[' + detail.taskQty + ']' } } }) @@ -279,8 +320,8 @@ this.showErrorMessage(str) } if (str1) { - str = '不允许提交\n' + str - this.showErrorMessage(str) + str1 = '不允许提交\n' + str1 + this.showErrorMessage(str1) } return str || str1 ? false : true @@ -295,11 +336,18 @@ this.$refs.comMessage.showConfirmMessageModal('请扫描箱码') return } - - if (!this.checkCount()) { - uni.hideLoading() - return; + if(this.managementType == "BY_BATCH" ||this.managementType == "BY_QUANTITY" ){ + if (!this.checkCountBatch()) { + uni.hideLoading() + return; + } + }else{ + if (!this.checkCount()) { + uni.hideLoading() + return; + } } + deliverJobSubmit(params).then(res => { uni.hideLoading() if (res.data) {