From 89fed1d271053cde889e883535069cfb001bf6b3 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Tue, 29 Oct 2024 15:03:11 +0800 Subject: [PATCH] =?UTF-8?q?YT-483=E7=9B=B4=E6=8E=A5=E5=8F=91=E6=96=99?= =?UTF-8?q?=E6=8C=89=E7=85=A7=E6=89=B9=E6=AC=A1=E7=AE=A1=E7=90=86=E7=B2=BE?= =?UTF-8?q?=E5=BA=A6=EF=BC=8C=E9=87=8D=E5=A4=8D=E6=89=AB=E6=8F=8F=E7=AE=B1?= =?UTF-8?q?=E7=AD=BE=E5=BA=94=E8=AF=A5=E7=B4=AF=E5=8A=A0=E6=95=B0=E9=87=8F?= =?UTF-8?q?=EF=BC=8C=E8=80=8C=E4=B8=8D=E4=BC=9A=E6=8F=90=E7=A4=BA=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E6=89=AB=E6=8F=8F=E3=80=82=E4=B8=8D=E5=BA=94=E8=AF=A5?= =?UTF-8?q?=E6=9F=A5=E5=BA=93=E5=AD=98=E6=95=B0=E9=87=8F=EF=BC=8C=E5=BA=94?= =?UTF-8?q?=E8=AF=A5=E6=89=AB=E6=8F=8F=E6=8F=90=E4=BA=A4=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E7=AE=B1=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/issue/record/directIssue.vue | 68 +++++++++++++++------- src/pages/putaway/record/putawayRecord.vue | 4 +- 2 files changed, 49 insertions(+), 23 deletions(-) diff --git a/src/pages/issue/record/directIssue.vue b/src/pages/issue/record/directIssue.vue index 92624f75..fffd929f 100644 --- a/src/pages/issue/record/directIssue.vue +++ b/src/pages/issue/record/directIssue.vue @@ -9,10 +9,18 @@ + + + @removePack="removePack" v-else> @@ -77,7 +85,8 @@ getBusinessType, createItemInfo, createDetailInfo, - calcHandleQty + calcHandleQty, + calcHandleQtyAdd } from '@/common/record.js'; import { @@ -97,6 +106,7 @@ import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' + import recordComDetailCardBatch from '@/mycomponents/record/recordComDetailCardBatch.vue' import recordDetailCard from '@/mycomponents/record/recordDetailCard.vue' import balanceSelect from '@/mycomponents/balance/balanceSelect.vue' import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' @@ -112,6 +122,7 @@ winScanLocation, winScanPackAndLocation, recordComDetailCard, + recordComDetailCardBatch, recordDetailCard, balanceSelect, winComScanBalance, @@ -137,7 +148,8 @@ show: false, positionInfo: "请选择生产线", resultData: {}, - itemCode: "" + itemCode: "", + managementType:'' }; }, onLoad(option) { @@ -192,8 +204,9 @@ }); }, - async getScanResult(result,managementType) { - if(managementType == "BY_BATCH" ||managementType == "BY_QUANTITY" ){ + async getScanResult(result,managementTypeParams) { + this.managementType = managementTypeParams + if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){ this.setDataBatch(result); }else{ this.setData(result); @@ -356,11 +369,12 @@ newDetail.packUnit = pack.packUnit; newDetail.packQty = pack.packQty; newDetail.handleQty = 0 + newDetail.balanceQty =result.balance.qty; itemp.subList.push(newDetail); this.detailSource.push(itemp) this.itemCode = balance.itemCode; this.fromLocationCode = balance.locationCode - this.scanPopupGetFocus() + // this.scanPopupGetFocus() } else { var detail = item.subList.find(r => { @@ -418,6 +432,7 @@ newDetail.packQty = pack.packQty; newDetail.fromLocationCode=balance.locationCode newDetail.handleQty = 0 + newDetail.balanceQty =result.balance.qty; item.subList.push(newDetail); } }) @@ -430,32 +445,35 @@ newDetail.packUnit = pack.packUnit; newDetail.packQty = pack.packQty; newDetail.handleQty = 0 + newDetail.balanceQty =result.balance.qty; item.subList.push(newDetail); } } - this.scanPopupGetFocus() + // this.scanPopupGetFocus() } else { if (detail.scaned == true) { // this.showErrorMessage("箱码[" + detail.packingNumber + "批次[" + balance.batch + "]重复扫描") } } } - // calcHandleQty(this.detailSource); console.log(this.detailSource) - for (let item of this.detailSource) { - item.handleQty = new Decimal(0).toNumber(); - item.qty = new Decimal(0).toNumber(); - for (let detail of item.subList) { - if (detail != undefined) { - if (detail.scaned) { - item.handleQty = calc.add(result.label.qty, detail.handleQty) - detail.handleQty = calc.add(result.label.qty, detail.handleQty); - } - item.qty = calc.add(item.qty, detail.qty); - } - } - } + console.log(result.label) + calcHandleQtyAdd(this.detailSource, result.label); + // console.log(this.detailSource) + // for (let item of this.detailSource) { + // item.handleQty = new Decimal(0).toNumber(); + // item.qty = new Decimal(0).toNumber(); + // for (let detail of item.subList) { + // if (detail != undefined) { + // if (detail.scaned) { + // item.handleQty = calc.add(result.label.qty, detail.handleQty) + // detail.handleQty = calc.add(result.label.qty, detail.handleQty); + // } + // item.qty = calc.add(item.qty, detail.qty); + // } + // } + // } }, showErrorMessage(message) { @@ -595,6 +613,13 @@ ...this.setRecordParams() } console.log("提交参数", JSON.stringify(params)); + const isHaveItem =params.subList.find(item=>item.handleQty > item.balanceQty) + if(isHaveItem){ + this.showErrorMessage(`物料号${isHaveItem.itemCode}`) + this.$refs.comMessage.showConfirmWarningModal('物料号'+isHaveItem.itemCode+'数量[' + isHaveItem.handleQty + ']不允许大于库存数量[' + isHaveItem.balanceQty + ']') + uni.hideLoading() + return + } issueRecordSubmit(params).then(res => { uni.hideLoading() if (res.data) { @@ -637,6 +662,7 @@ // detail.toLocationCode = detail.toLocationCode submitItem.qty = detail.handleQty; submitItem.package = ""; + submitItem.balanceQty = detail.balanceQty; submitItem.recordList = [{ toInventoryStatus: detail.inventoryStatus, fromParentPackingNumber: detail.parentNumber, diff --git a/src/pages/putaway/record/putawayRecord.vue b/src/pages/putaway/record/putawayRecord.vue index ab989921..69841f91 100644 --- a/src/pages/putaway/record/putawayRecord.vue +++ b/src/pages/putaway/record/putawayRecord.vue @@ -171,8 +171,8 @@ methods: { getScanResult(result,managementType) { - this.managementType = managementType - if(managementType == "BY_BATCH" ||managementType == "BY_QUANTITY" ){ + this.managementType = managementTypeParams + if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){ this. getScanResultAfterBatch(result) }else{ this. getScanResultAfter(result)