From 864173480d50600dede9c58b84f045f2f1fcf6a4 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Wed, 20 Nov 2024 11:46:01 +0800 Subject: [PATCH] =?UTF-8?q?YT-1073=E8=AE=A1=E5=88=92=E5=A4=96=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E4=BB=BB=E5=8A=A1PDA=E6=89=AB=E6=8F=8F=E7=9A=84?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=B8=8E=E9=9C=80=E6=B1=82=E4=B8=8D=E7=AC=A6?= =?UTF-8?q?=EF=BC=88=E8=AF=A6=E8=A7=81=E6=88=AA=E5=9B=BE=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/detail.js | 20 ++++++++++++++++++- src/pages/unPlanned/job/receiptJobDetail.vue | 21 ++++++++------------ 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/src/common/detail.js b/src/common/detail.js index 3171ca38..ad26df7b 100644 --- a/src/common/detail.js +++ b/src/common/detail.js @@ -155,7 +155,25 @@ export function calcHandleQty(detailSource) { } } } - +//计算计划外入库实际数量和任务数量 +export function calcHandleQtyPlanOut(detailSource) { + console.log(999,detailSource) + for (let item of 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(item.handleQty, detail.handleQty); + } + console.log(detail.isRecommend) + if(detail.isRecommend){ + item.qty = calc.add(item.qty, detail.qty); + } + } + } + } +} //计算推荐和扫描的不是用一个的数量 export function calcHandleNewQty(detailSource) { for (let item of detailSource) { diff --git a/src/pages/unPlanned/job/receiptJobDetail.vue b/src/pages/unPlanned/job/receiptJobDetail.vue index 7bfddc96..0d5c7806 100644 --- a/src/pages/unPlanned/job/receiptJobDetail.vue +++ b/src/pages/unPlanned/job/receiptJobDetail.vue @@ -68,7 +68,8 @@ getDataSource, createRecordInfo, calcHandleQty, - getScanCount + getScanCount, + calcHandleQtyPlanOut } from '@/common/detail.js'; import { @@ -242,7 +243,7 @@ } } } - calcHandleQty(this.detailSource); + calcHandleQtyPlanOut(this.detailSource); this.$forceUpdate() }, @@ -289,7 +290,7 @@ batch:batch, handleQty:Number(result.label.qty), qty:detail.qty, - toLocationCode:locationCode, + // toLocationCode:locationCode, // inventoryStatus:inventoryStatus, // toInventoryStatus:inventoryStatus, balance:{}, @@ -308,20 +309,14 @@ } else { itemDetail.scaned = true; itemDetail.handleQty = Number(result.label.qty); - itemDetail.toLocationCode = this.toLocationCode ? this.toLocationCode : itemDetail - .toLocationCode; + // itemDetail.toLocationCode = this.toLocationCode ? this.toLocationCode : itemDetail + // .toLocationCode; itemDetail.packQty = result.package.packQty itemDetail.labelQty = Number(result.label.qty); this.continueScan() } } - let array = [] - this.detailSource.forEach((item=>{ - let obj = {...item} - obj.subList=item.subList.filter(cur=>cur.isRecommend == true) - array.push(obj) - })) - calcHandleQty(array); + calcHandleQtyPlanOut(this.detailSource); } } catch (e) { @@ -352,7 +347,7 @@ .toLocationCode; itemDetail.packQty = result.package.packQty itemDetail.labelQty = Number(result.label.qty); - calcHandleQty(this.detailSource); + calcHandleQtyPlanOut(this.detailSource); this.continueScan() } }