From 20466936cebd6a3f848423da1505daae7ce84752 Mon Sep 17 00:00:00 2001 From: huangdeliang Date: Tue, 30 Mar 2021 13:45:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B0=94=E8=A1=80=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/OrderDrawer/index.vue | 14 +- .../components/PhysicalSignsEdit/index.vue | 191 +++++++++++------- 2 files changed, 130 insertions(+), 75 deletions(-) diff --git a/stdiet-ui/src/components/OrderDrawer/index.vue b/stdiet-ui/src/components/OrderDrawer/index.vue index 6ed487979..3ba615c2b 100644 --- a/stdiet-ui/src/components/OrderDrawer/index.vue +++ b/stdiet-ui/src/components/OrderDrawer/index.vue @@ -180,16 +180,20 @@ export default { cur.type = "main"; arr.push(cur); } - if (idx === res.rows.length - 1 && arr.children) { + if (idx === res.rows.length - 1) { arr.forEach((obj) => { - obj.amount = arr.children.reduce((a, c) => { - return a + c.afterSaleCommissOrder === 0 ? c.amount : 0; - }, 0); + console.log({ obj }); + if (obj.children) { + obj.amount = obj.children.reduce( + (a, c) => a + (c.afterSaleCommissOrder === 0 ? c.amount : 0), + 0 + ); + } }); } return arr; }, []); - // console.log(this.orderList); + console.log(this.orderList); this.loading = false; }); }, diff --git a/stdiet-ui/src/components/PhysicalSignsEdit/index.vue b/stdiet-ui/src/components/PhysicalSignsEdit/index.vue index 9750fe118..e0e2d7073 100644 --- a/stdiet-ui/src/components/PhysicalSignsEdit/index.vue +++ b/stdiet-ui/src/components/PhysicalSignsEdit/index.vue @@ -1,35 +1,77 @@