From d62e577a849a2b1624aa3d5b948065bfa450a459 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Fri, 1 Nov 2024 11:53:23 +0800 Subject: [PATCH] =?UTF-8?q?YT-585=E8=AE=A1=E5=88=92=E5=A4=96=E5=85=A5?= =?UTF-8?q?=E5=BA=93=EF=BC=8Cpda=E6=89=AB=E7=AE=B1=E7=AD=BE=EF=BC=8C?= =?UTF-8?q?=E5=B8=A6=E5=87=BA=E6=89=80=E6=9C=89=E5=BA=93=E5=AD=98=E6=95=B0?= =?UTF-8?q?=E9=87=8F=EF=BC=8C=E4=B8=8D=E6=98=AF=E7=AE=B1=E7=AD=BE=E6=95=B0?= =?UTF-8?q?=E9=87=8F=EF=BC=8C=E5=BA=94=E5=B8=A6=E5=87=BA=E7=AE=B1=E7=AD=BE?= =?UTF-8?q?=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/unPlanned/job/receiptJobDetail.vue | 61 ++++++++++++++++---- 1 file changed, 51 insertions(+), 10 deletions(-) diff --git a/src/pages/unPlanned/job/receiptJobDetail.vue b/src/pages/unPlanned/job/receiptJobDetail.vue index c2396f7b..a5b94d1e 100644 --- a/src/pages/unPlanned/job/receiptJobDetail.vue +++ b/src/pages/unPlanned/job/receiptJobDetail.vue @@ -12,13 +12,9 @@ - - + :locationAreaTypeList='toLocationAreaTypeList'> @@ -70,12 +66,15 @@ calcHandleQty, getScanCount } from '@/common/detail.js'; + + import { + calc + } from '@/common/calc.js'; import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue' import locationCompare from '@/mycomponents/location/locationCompare.vue' import comReceiptDetailCard from '@/pages/unPlanned/coms/comReceiptDetailCard.vue' - import comReceiptDetailCardBatch from '@/pages/unPlanned/coms/comReceiptDetailCardBatch.vue' import jobTop from '@/mycomponents/job/jobTop.vue' export default { @@ -84,7 +83,6 @@ winScanButton, winScanPack, comReceiptDetailCard, - comReceiptDetailCardBatch, locationCompare, jobTop }, @@ -229,6 +227,14 @@ getScanResult(result) { + if(import.meta.env.VITE_MANAGE_MODEL == 'BY_BATCH'){ + this.setDataBatch(result) + }else{ + this.setData(result) + } + + }, + setDataBatch(result){ try { var packingNumber = result.label.packingNumber; var batch = result.label.batch; @@ -238,7 +244,42 @@ if (detail == undefined) { this.showErrorMessage("物料号【" + itemCode + "】不在列表中") } else { - + + var itemDetail = detail.subList.find(r => r.batch == batch); + if (itemDetail == undefined) { + this.showErrorMessage("批次【" + batch + "】" + "不在列表中") + } else { + if (itemDetail.scaned) { + // this.showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】" + "已经扫描") + itemDetail.handleQty = calc.add(itemDetail.handleQty ,Number(result.label.qty)); + } else { + itemDetail.scaned = true; + itemDetail.handleQty = Number(result.label.qty); + itemDetail.toLocationCode = this.toLocationCode ? this.toLocationCode : itemDetail + .toLocationCode; + itemDetail.packQty = result.package.packQty + itemDetail.labelQty = Number(result.label.qty); + this.continueScan() + } + } + calcHandleQty(this.detailSource); + } + + } catch (e) { + this.showErrorMessage(e.message) + } + }, + setData(result){ + try { + var packingNumber = result.label.packingNumber; + var batch = result.label.batch; + var qty = result.label.qty; + var itemCode = result.label.itemCode; + var detail = this.detailSource.find(r => r.itemCode == itemCode); + if (detail == undefined) { + this.showErrorMessage("物料号【" + itemCode + "】不在列表中") + } else { + var itemDetail = detail.subList.find(r => r.packingNumber == packingNumber && r.batch == batch); if (itemDetail == undefined) { this.showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】" + "不在列表中") @@ -257,12 +298,11 @@ } } } - + } catch (e) { this.showErrorMessage(e.message) } }, - commit() { this.scanCount = getScanCount(this.subList); if (this.scanCount == 0) { @@ -326,6 +366,7 @@ this.detailSource.forEach(item => { itemCodes.push(item.itemCode) }) + return getManagementPrecisions(itemCodes, this.toLocationCode, res => { if (res.success) {