From c5119de9d9c50fb73ca422e9704c8343097c16ab Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Tue, 22 Oct 2024 16:11:01 +0800 Subject: [PATCH] =?UTF-8?q?YT-448=E5=BA=93=E5=8C=BA=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=92=8C=E7=89=A9=E6=96=99=E5=BA=93=E5=8C=BA=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=AE=A1=E7=90=86=EF=BC=8C=E9=9A=94=E7=A6=BB=E5=8C=BA=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E7=B2=BE=E5=BA=A6=E6=B2=A1=E6=9C=89=E6=8C=89=E6=95=B0?= =?UTF-8?q?=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scan/winScanPackAndLocation.vue | 11 ++++++++--- .../inventoryMove/job/inventoryMoveDetail.vue | 18 +++++++++++++----- .../productReceipt/job/scrapReceiptDetail.vue | 10 ++++++++-- 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/src/mycomponents/scan/winScanPackAndLocation.vue b/src/mycomponents/scan/winScanPackAndLocation.vue index 63055f71..aaebd305 100644 --- a/src/mycomponents/scan/winScanPackAndLocation.vue +++ b/src/mycomponents/scan/winScanPackAndLocation.vue @@ -446,7 +446,12 @@ fromLocationCode: this.fromLocationCode, } // this.packGetFocus(); - this.$emit("getResult", data); + // 如果管理精度是批次或者数量,给父组件多返回一个参数 + if (this.managementPrecision == 'BY_BATCH'||this.managementPrecision == 'BY_QUANTITY') { + this.$emit("getResult", data, this.managementPrecision); + } else { + this.$emit("getResult", data); + } this.$emit("getCountScanResult", data); }, @@ -462,8 +467,8 @@ fromLocationCode: this.fromLocationCode, } this.packGetFocus(); - // 如果管理精度是批次,给父组件多返回一个参数 - if (this.managementPrecision == 'BY_BATCH') { + // 如果管理精度是批次或者数量,给父组件多返回一个参数 + if (this.managementPrecision == 'BY_BATCH'||this.managementPrecision == 'BY_QUANTITY') { this.$emit("getResult", data, this.managementPrecision); } else { this.$emit("getResult", data); diff --git a/src/pages/inventoryMove/job/inventoryMoveDetail.vue b/src/pages/inventoryMove/job/inventoryMoveDetail.vue index 39b037ad..1b3324c1 100644 --- a/src/pages/inventoryMove/job/inventoryMoveDetail.vue +++ b/src/pages/inventoryMove/job/inventoryMoveDetail.vue @@ -315,7 +315,7 @@ }, - getScanResult(result) { + getScanResult(result,managementPrecision) { try { var packingNumber = result.label.packingNumber; var batch = result.label.batch; @@ -325,10 +325,18 @@ if (detail == undefined) { this.showMessage("物料号【" + itemCode + "】不在列表中") } else { - var itemDetail = detail.subList.find(r => { - return r.batch == batch - }) - if (itemDetail == undefined) { + var itemDetail = '' + if(managementPrecision == 'BY_QUANTITY'){ + itemDetail = detail.subList.find(r => { + return r.itemCode == result.label.itemCode + }) + }else{ + itemDetail = detail.subList.find(r => { + return r.batch == batch + }) + } + + if (itemDetail == undefined && managementPrecision != 'BY_QUANTITY') { this.showErrorMessage( "批次[" + batch + "]不在列表中") } else { if (itemDetail.scaned) { diff --git a/src/pages/productReceipt/job/scrapReceiptDetail.vue b/src/pages/productReceipt/job/scrapReceiptDetail.vue index 186b0a6a..1cacee4d 100644 --- a/src/pages/productReceipt/job/scrapReceiptDetail.vue +++ b/src/pages/productReceipt/job/scrapReceiptDetail.vue @@ -226,8 +226,13 @@ if (detail == undefined) { this.showErrorMessage("物料号【" + itemCode + "】不在列表中") } else { - var itemDetail = detail.subList.find(r => - r.batch == batch); + var itemDetail = '' + if(this.managementPrecision == 'BY_QUANTITY'){ + itemDetail = detail.subList.find(r => r.itemCode == result.label.itemCode); + }else{ + itemDetail = detail.subList.find(r => r.batch == batch); + } + if (itemDetail == undefined) { this.showErrorMessage("批次[" + batch + "]不在任务列表中") } else { @@ -368,6 +373,7 @@ getManagementPrecisions(itemCodes, this.toLocationCode, res => { if (res.success) { this.managementList = res.list; + this.managementPrecision = this.managementList[0].ManagementPrecision var params = this.setParams(); console.log("提交参数", JSON.stringify(params)); productReceiptJobsubmit(params).then(res => {