From d46613c38435a7aff35060a2778900368613cf4c Mon Sep 17 00:00:00 2001
From: zhang_li <2235006734@qqq.com>
Date: Thu, 11 Jul 2024 19:39:44 +0800
Subject: [PATCH] =?UTF-8?q?SCP=20=E4=BE=9B=E5=BA=94=E5=95=86=E5=8F=91?=
=?UTF-8?q?=E7=A5=A8=E7=94=B3=E8=AF=B7=20=E7=94=9F=E6=88=90=E6=A0=87?=
=?UTF-8?q?=E7=AD=BE=E6=97=B6=20=E6=97=A2=E6=9C=89=E7=AE=B1=E8=A7=84?=
=?UTF-8?q?=E6=A0=BC=EF=BC=8C=E4=B9=9F=E6=9C=89=E6=89=98=E8=A7=84=E6=A0=BC?=
=?UTF-8?q?=E3=80=82=E8=AE=A1=E7=AE=97=E7=BB=93=E6=9E=9C=E4=B8=8D=E5=AF=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../supplierdeliverRequestMain/labelForm.vue | 58 +++++++++++--------
1 file changed, 34 insertions(+), 24 deletions(-)
diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/labelForm.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/labelForm.vue
index ee81020ce..64ecf869f 100644
--- a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/labelForm.vue
+++ b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/labelForm.vue
@@ -69,7 +69,7 @@
-
+
@@ -205,12 +205,22 @@ const intData =async () => {
const expandChange = (row: any, expandedRows: any[]) => {
// 判断托信息是否存在
if (row.secondPackUnit && row.secondPackQty) {
- // 数量除以托数量获取余数
- row.lastNumber = parseFloat(row.qty) % parseFloat(row.secondPackQty)
+ // // 托数量/箱数量 一托可以放几箱
+ // row.otherNumber =Math.floor(parseFloat(row.secondPackQty) / parseFloat(row.packQty))
+ // // 数量除以托数量获取余数
+ // row.lastNumber = parseFloat(row.qty) % parseFloat(row.secondPackQty)
+ // // 数量%托数量 获取总共几托
+ // row.allTuoQty = Math.ceil(parseFloat(row.qty) / parseFloat(row.secondPackQty))
+
+ // 总共需要多少箱
+ row.allXiangQty = Math.ceil(parseFloat(row.qty) / parseFloat(row.packQty))
// 托数量/箱数量 一托可以放几箱
- row.otherNumber = parseFloat(row.secondPackQty) / parseFloat(row.packQty)
- // 数量%托数量 获取总共几托
- row.allTuoQty = Math.ceil(parseFloat(row.qty) / parseFloat(row.secondPackQty))
+ row.otherNumber =Math.floor(parseFloat(row.secondPackQty) / parseFloat(row.packQty))
+ // 数量%托数量 获取总共几托
+ row.allTuoQty = Math.ceil(parseFloat(row.allXiangQty) / parseFloat(row.otherNumber))
+ // 数量除以托数量获取余数
+ row.lastNumber = parseFloat(row.allXiangQty) % parseFloat(row.otherNumber)
+
row.packageList = []
// 循环托
for (let i = 0; i < row.allTuoQty; i++) {
@@ -232,12 +242,12 @@ const expandChange = (row: any, expandedRows: any[]) => {
} else {
// 其他数据展示一托的全部箱数和全部数量
row.packageList[i].xNumber = row.otherNumber
- row.packageList[i].qtyOne = row.secondPackQty
+ row.packageList[i].qtyOne = parseFloat(row.otherNumber) * parseFloat(row.packQty)
}
} else {
// 如果沒有余数,直接展示一托的全部箱数和全部数量
row.packageList[i].xNumber = row.otherNumber
- row.packageList[i].qtyOne = row.secondPackQty
+ row.packageList[i].qtyOne = parseFloat(row.otherNumber) * parseFloat(row.packQty)
}
}
// 判断箱信息是否存在
@@ -418,23 +428,23 @@ const blurOne = (oneRow, twoRow) => {
if (!twoRow.xNumber) {
twoRow.qtyOne = ''
}
- if (parseFloat(twoRow.xNumber) > parseFloat(oneRow.otherNumber)) {
- message.warning('每托箱个数最多' + oneRow.otherNumber + '箱')
- twoRow.xNumber = oneRow.otherNumber
- twoRow.children = []
- twoRow.qtyOne = parseFloat(twoRow.xNumber) * parseFloat(oneRow.packQty)
- }
+ // if (parseFloat(twoRow.xNumber) > parseFloat(oneRow.otherNumber)) {
+ // message.warning('每托箱个数最多' + oneRow.otherNumber + '箱')
+ // twoRow.xNumber = oneRow.otherNumber
+ // twoRow.children = []
+ // twoRow.qtyOne = parseFloat(twoRow.xNumber) * parseFloat(oneRow.packQty)
+ // }
twoRow.qtyOne = parseFloat(twoRow.xNumber) * parseFloat(oneRow.packQty)
- let num = 0
- oneRow.packageList.forEach((item) => {
- num += parseFloat(item.xNumber) || 0
- })
- if (num > oneRow.allPackQty) {
- message.warning('总箱数不可以大于' + oneRow.allPackQty)
- twoRow.xNumber = ''
- twoRow.qtyOne = ''
- return
- }
+ // let num = 0
+ // oneRow.packageList.forEach((item) => {
+ // num += parseFloat(item.xNumber) || 0
+ // })
+ // if (num > oneRow.allPackQty) {
+ // message.warning('总箱数不可以大于' + oneRow.allPackQty)
+ // twoRow.xNumber = ''
+ // twoRow.qtyOne = ''
+ // return
+ // }
// 托信息修改的時候箱数据自动排列
// 判断箱信息是否存在
if (oneRow.packUnit && oneRow.packQty) {