From e8f0bd6cd845358cb586934e5dc87d5ac9d475df Mon Sep 17 00:00:00 2001 From: tk Date: Mon, 8 Jul 2024 16:51:02 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=B1=BB=09=E5=9E=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9Afix=20=E3=80=90=E4=B8=BB=09=E9=A2=98=E3=80=91=EF=BC=9A?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC=20=E3=80=90=E6=8F=8F=09=E8=BF=B0=E3=80=91?= =?UTF-8?q?=EF=BC=9A=20=09[=E5=8E=9F=E5=9B=A0]=EF=BC=9A=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E6=98=BE=E7=A4=BA=E5=AD=97=E6=AE=B5=20=09[?= =?UTF-8?q?=E8=BF=87=E7=A8=8B]=EF=BC=9A1.=E8=A1=A8=E6=A0=BC=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=AD=97=E6=AE=B5=20id=20=E8=AE=A2=E5=8D=95=E5=8F=B7?= =?UTF-8?q?=20=E7=94=B5=E8=AF=9D=20=E4=B8=8B=E5=8D=95=E6=97=B6=E9=97=B4=20?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=20=202.=E6=9C=80=E5=90=8E=E5=8A=A0=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E5=90=88=E8=AE=A1=E8=A1=8C=20=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=80=BB=E6=95=B0=20=E5=92=8C=20=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E6=80=BB=E9=A2=9D=20=09[=E5=BD=B1=E5=93=8D]=EF=BC=9A?= =?UTF-8?q?=20=E3=80=90=E7=BB=93=09=E6=9D=9F=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动 --- .../layout/components/main/order/index.vue | 36 ++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/src/views/layout/components/main/order/index.vue b/src/views/layout/components/main/order/index.vue index 85f8459..7deb4c7 100644 --- a/src/views/layout/components/main/order/index.vue +++ b/src/views/layout/components/main/order/index.vue @@ -24,27 +24,30 @@ - - + - + - + - + - + @@ -103,14 +106,23 @@ export default { async getOrderList (orderSerch) { const res = await getOrderList(orderSerch) this.orderList = res.data.orderList - console.log(res.data.orderList) }, /** * @description: 表单提交 加入防抖 */ debouncedGetOrderList: debounce(function (val) { this.getOrderList(val) - }, 500) + }, 500), + /** + * @description: 表格求和 + */ + getSummaries () { + const sum = this.orderList.reduce((acc, order) => { + return acc + (order.total_price - order.refund_price) + }, 0) + const total = this.orderList.length + return ['合计', '', '', '', '', `共 ${total}单 ${sum}元`] + } }, watch: { shop_id (val) {