From 492940bbe8ebbecf9a1d34e508002e405ecd1827 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Tue, 29 Oct 2024 09:27:22 +0800 Subject: [PATCH] =?UTF-8?q?YT-499=E5=88=B6=E5=93=81=E5=9B=9E=E6=94=B6?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=89=AB=E6=8F=8F=E7=AE=B1=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E6=97=B6=E6=8A=A5=E9=94=99=EF=BC=9B=E8=A6=81=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E6=9D=A5=E6=BA=90=E5=BA=93=E4=BD=8D=E6=89=80=E5=9C=A8=E5=BA=93?= =?UTF-8?q?=E5=8C=BA=E6=9F=A5=E8=AF=A2=E7=AE=A1=E7=90=86=E7=B2=BE=E5=BA=A6?= =?UTF-8?q?=EF=BC=8C=E6=A0=B9=E6=8D=AE=E7=AE=A1=E7=90=86=E7=B2=BE=E5=BA=A6?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=BA=93=E5=AD=98=E4=BD=99=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../job/productRecycleJobDetail.vue | 140 +++++++++++++++++- 1 file changed, 133 insertions(+), 7 deletions(-) diff --git a/src/pages/productRecycle/job/productRecycleJobDetail.vue b/src/pages/productRecycle/job/productRecycleJobDetail.vue index 9507254e..9cbf5393 100644 --- a/src/pages/productRecycle/job/productRecycleJobDetail.vue +++ b/src/pages/productRecycle/job/productRecycleJobDetail.vue @@ -201,8 +201,7 @@ getManagementPrecisions(itemCodes, that.fromLocationCode, res => { if (res.success) { this.managementList = res.list; - this.managementType = this.managementList.some(item => item.ManagementPrecision == - 'BY_BATCH') ? 'BY_BATCH' : '' + this.managementType = this.managementList&&this.managementList[0]&&this.managementList[0].ManagementPrecision?this.managementList[0].ManagementPrecision:'BY_PACKAGING' } }) } else { @@ -248,6 +247,14 @@ }, getScanResult(result) { + if(this.managementType == 'BY_BATCH' ||this.managementType == "BY_QUANTITY" ){ + this.getScanResultAfterBatch(result) + }else{ + this.getScanResultAfter(result) + } + + }, + getScanResultAfter(result){ try { var packingNumber = result.label.packingNumber; var batch = result.label.batch; @@ -266,7 +273,7 @@ r.batch == batch && r.fromLocationCode == result.fromLocationCode && r.inventoryStatus == result.balance.inventoryStatus - + }) if (itemDetail) { // 箱码、批次、库位、状态一致 @@ -292,7 +299,7 @@ r.batch == batch && r.fromLocationCode == result.fromLocationCode }) - + if (itemDetail) { let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus); //箱码、批次、库位相等,状态不相等 @@ -324,16 +331,100 @@ this.showErrorMessage("箱码【" + packingNumber + "】\n批次【" + batch + "】\n库位【" + result .fromLocationCode + "】\n状态【" + balanceStatus + "】\n不在任务列表中") } - + } - + + } + this.scanPopupGetFocus(); + } catch (e) { + this.showErrorMessage(e.message); + } + }, + getScanResultAfterBatch(result){ + try { + var packingNumber = result.label.packingNumber; + var batch = result.label.batch; + var qty = result.label.qty; + var itemCode = result.label.itemCode; + var itemDetail = undefined; + var detail = this.detailSource.find(r => r.itemCode == itemCode); + if (detail == undefined) { + this.showMessage("物料号【" + itemCode + "】不在列表中") + } else { + detail.scaned = true + let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus); + //箱码、批次、库位、状态 都相等 + itemDetail = detail.subList.find(r => { + return + r.batch == batch && + r.fromLocationCode == result.fromLocationCode && + r.inventoryStatus == result.balance.inventoryStatus + + }) + if (itemDetail) { + // 箱码、批次、库位、状态一致 + if (itemDetail.scaned) { + this.showErrorMessage("\n批次【" + batch + "】\n库位【" + result + .fromLocationCode + "】\n状态【" + balanceStatus + "】\n已经扫描") + return; + } else { + itemDetail.scaned = true; + itemDetail.handleQty = Number(result.balance.qty); + itemDetail.toInventoryStatus = result.balance.inventoryStatus; + itemDetail.inventoryStatus = result.balance.inventoryStatus; + itemDetail.balance = result.balance; + itemDetail.balance.balanceQty = Number(result.balance.qty); + itemDetail.balance.packQty = Number(result.package.packQty) + itemDetail.balance.packUnit = result.package.packUnit + this.calcHandleQty(); + } + } else { + //箱码、批次、库位相等 + itemDetail = detail.subList.find(r => { + return r.batch == batch && + r.fromLocationCode == result.fromLocationCode + }) + + if (itemDetail) { + let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus); + //箱码、批次、库位相等,状态不相等 + if (this.jobContent.allowModifyInventoryStatus == "TRUE") { + this.showQuestionMessage('实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus + + ']不一致,是否继续回收?', res => { + if (res) { + itemDetail.scaned = true; + itemDetail.handleQty = Number(result.balance.qty); + itemDetail.toInventoryStatus = result.balance.inventoryStatus; + itemDetail.inventoryStatus = result.balance.inventoryStatus; + itemDetail.balance = result.balance; + itemDetail.balance.balanceQty = result.balance.qty; + itemDetail.balance.packQty = result.package.packQty + itemDetail.balance.packUnit = result.package.packUnit + this.calcHandleQty(); + } else { + this.scanPopupGetFocus(); + } + }); + } else { + this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + + itemStatus + + ']不一致,不允许回收!', res => { + this.scanPopupGetFocus(); + }); + } + } else { + this.showErrorMessage("\n批次【" + batch + "】\n库位【" + result + .fromLocationCode + "】\n状态【" + balanceStatus + "】\n不在任务列表中") + } + + } + } this.scanPopupGetFocus(); } catch (e) { this.showErrorMessage(e.message); } }, - commit() { this.scanCount = getScanCount(this.subList); if (this.scanCount == 0) { @@ -344,12 +435,20 @@ // //允许部分提交 // //扫描数量和任务数量相等,直接提交 if (this.scanCount == this.subList.length) { + if(this.managementType == 'BY_BATCH' ||this.managementType == "BY_QUANTITY" ){ + this.checkCountBatch() + }else{ this.checkCount(); + } } else if (this.scanCount < this.subList.length) { //扫描数量小于任务数量,判断是否允许部分提交 if (this.jobContent.allowPartialComplete == "TRUE") { //提交 + if(this.managementType == 'BY_BATCH' ||this.managementType == "BY_QUANTITY" ){ + this.checkCountBatch() + }else{ this.checkCount(); + } } else { //不允许部分提交,提示 this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => { @@ -388,6 +487,33 @@ this.submitJob() } }, + checkCountBatch(){ + // 提交的数量和任务数量不一致提示 + let str = '' + this.detailSource.forEach((item) => { + item.subList.forEach(cur => { + if (cur.qty != cur.handleQty) { + var tempHandleQty =0 + if(cur.handleQty){ + tempHandleQty=cur.handleQty + }else { + tempHandleQty =0 + } + str += `物料号【${item.itemCode}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致` + } + }) + }) + if (str) { + str = '任务明细未全部完成,是否提交?\n'+str + this.$refs.comMessage.showQuestionMessage1(str, 'red', res => { + if (res) { + this.submitJob() + } + }); + } else { + this.submitJob() + } + }, submitJob() { uni.showLoading({