From 4099231d7b6b736c82c78e7a1421e4f34cc1d366 Mon Sep 17 00:00:00 2001 From: wws <18630710203@163.com> Date: Thu, 2 Nov 2023 09:56:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A1=E5=88=92=E6=88=90=E5=93=81=E6=8B=86?= =?UTF-8?q?=E5=88=86BUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/plan/order/index.vue | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/views/plan/order/index.vue b/src/views/plan/order/index.vue index 3422b205..f43d67ff 100644 --- a/src/views/plan/order/index.vue +++ b/src/views/plan/order/index.vue @@ -932,7 +932,7 @@ export default { } } - this.productData[0].atrr1 = this.splitForm.splitNum + this.productData[0].atrr1 = this.splitForm.splitNum; setAtrr1(this.productData[0], this.splitForm.splitNum) this.refreshProTable = false // 先将refreshProTable设置为false,隐藏表格 @@ -1112,6 +1112,25 @@ export default { //整理订单传入到后端 this.splitForm.formFields = this.formFields //整理数据往后端发送 + // 递归操作处理已拆分信息 + function setQuantitySplit(data) { + if (data.children !== undefined) { + for (let i = 0; i < data.children.length; i++) { + if (data.children[i].quantitySplit == null) { + data.children[i].quantitySplit = 0; + } + data.children[i].quantitySplit = Number(data.children[i].quantitySplit) + Number(data.children[i].atrr1) + setQuantitySplit(data.children[i]); + } + } + } + + if (this.productData[0].quantitySplit == null) { + this.productData[0].quantitySplit = 0; + } + this.productData[0].quantitySplit = Number(this.splitForm.splitNum) + Number(this.productData[0].quantitySplit); + setQuantitySplit(this.productData[0]) + //下面是请求处理 const data = { formFields: this.formFields,