From 70fce459b78e1c926935ec3b1f5f2cadebc519ac Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Wed, 6 Nov 2024 10:33:15 +0800 Subject: [PATCH] =?UTF-8?q?YT-704=E9=A2=84=E7=94=9F=E4=BA=A7=E6=94=B6?= =?UTF-8?q?=E8=B4=A7=EF=BC=8Cpda=E6=8F=90=E4=BA=A4=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E4=B8=8E=E4=BB=BB=E5=8A=A1=E4=B8=8D=E4=B8=80=E8=87=B4=EF=BC=8C?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E5=8E=BB=E6=8E=89=E5=8C=85=E8=A3=85=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../job/productReceiptDetail.vue | 64 +++++++++++++++++-- 1 file changed, 57 insertions(+), 7 deletions(-) diff --git a/src/pages/productReceipt/job/productReceiptDetail.vue b/src/pages/productReceipt/job/productReceiptDetail.vue index 2a34cef8..d6e62376 100644 --- a/src/pages/productReceipt/job/productReceiptDetail.vue +++ b/src/pages/productReceipt/job/productReceiptDetail.vue @@ -361,7 +361,7 @@ }); }, - commit() { + async commit() { this.scanCount = getScanCount(this.subList); if (this.scanCount == 0) { this.showErrorMessage("扫描数为0,请先扫描") @@ -376,18 +376,40 @@ }else{ this.toLocationCode = this.jobToLocationCode } + //获取管理模式,封装参数 + var itemCodes = [] + this.detailSource.forEach(item => { + itemCodes.push(item.itemCode) + }) + await getManagementPrecisions(itemCodes, this.toLocationCode, res => { + if (res.success) { + this.managementList = res.list; + this.managementType = this.managementList&& this.managementList[0]&& this.managementList[0].ManagementPrecision ? this.managementList[0].ManagementPrecision : 'BY_PACKAGING' + } + }) //扫描数量和任务数量相等,直接提交 if (this.scanCount == this.subList.length) { - if (this.checkCount()) { - this.submitJob(); + if(this.managementType == 'BY_BATCH' || this.managementType == 'BY_QUANTITY'){ + if (this.checkCountBatch()) { + this.submitJob(); + } + }else{ + if (this.checkCount()) { + this.submitJob(); + } } - } else if (this.scanCount < this.subList.length) { //扫描数量小于任务数量,判断是否允许部分提交 if (this.jobContent.allowPartialComplete == "TRUE") { //提交 - if (this.checkCount()) { - this.submitJob(); + if(this.managementType == 'BY_BATCH' || this.managementType == 'BY_QUANTITY'){ + if (this.checkCountBatch()) { + this.submitJob(); + } + }else{ + if (this.checkCount()) { + this.submitJob(); + } } } else { //不允许部分提交,提示 @@ -425,7 +447,34 @@ return isCheck; }, - + checkCountBatch(){ + var isCheck = true; + var hint = "" + for (var i = 0; i < this.detailSource.length; i++) { + var item = this.detailSource[i]; + for (var j = 0; j < item.subList.length; j++) { + var subItem = item.subList[i] + console.log(calc.sub(subItem.handleQty, subItem.qty) ) + if (calc.sub(subItem.handleQty, subItem.qty) < 0 || calc.sub(subItem.handleQty, subItem.qty) > 0) { + isCheck = false; + hint = "批次【" + subItem.batch + "】实际收货数量:[" + subItem.handleQty + "]与包装数量[" + subItem.qty + + "]不相等,是否继续收货?" + break + } + + } + } + console.log(isCheck) + if (!isCheck) { + this.showQuestMessage(hint, res => { + if (res) { + this.submitJob(); + } + }) + } + + return isCheck; + }, submitJob() { uni.showLoading({ title: "提交中....", @@ -435,6 +484,7 @@ this.detailSource.forEach(item => { itemCodes.push(item.itemCode) }) + return getManagementPrecisions(itemCodes, this.toLocationCode, res => { if (res.success) { this.managementList = res.list;