From 42afc864d21bcadcf1a3c1d40f6b877d2613b47f Mon Sep 17 00:00:00 2001 From: "han\\hanst" Date: Mon, 13 Oct 2025 14:32:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/ecss/codelnotifyConfirm.vue | 38 +++++++++-- .../ecss/components/PackingDetailTab.vue | 66 ++++++++++++++++++- 2 files changed, 98 insertions(+), 6 deletions(-) diff --git a/src/views/modules/ecss/codelnotifyConfirm.vue b/src/views/modules/ecss/codelnotifyConfirm.vue index 5a19bf8..0943add 100644 --- a/src/views/modules/ecss/codelnotifyConfirm.vue +++ b/src/views/modules/ecss/codelnotifyConfirm.vue @@ -113,8 +113,8 @@ this.$refs.detailTable.doLayout());// 强制刷新布局, 否则会被表格覆盖 return sums; }, - + getDetailSummaries(param) { + const { columns } = param; + const sums = []; + columns.forEach((column, index) => { + if (index === 0) { + sums[index] = '合计'; + return; + } + let sumDataList = this.dataList2.filter(item => item.qty>0); + const values = sumDataList.map(item => Number(item[column.property])); + if (!values.every(value => isNaN(value))) { + switch(column.property) { + case 'qty': + sums[index] = `${values.reduce((a, b) => a + b, 0)}`; + break; + case 'ttlAmount': + sums[index] = `${values.reduce((a, b) => a + b, 0).toFixed(2)}`; + break; + case 'sumPrice': + sums[index] = `${values.reduce((a, b) => a + b, 0).toFixed(2)}`; + break; + default: + sums[index] = ''; + } + } else { + sums[index] = ''; + } + }); + this.$nextTick(() => this.$refs.cloDetailTable.doLayout());// 强制刷新布局, 否则会被表格覆盖 + return sums; + }, /** * 保存选中行到本地存储 * 使用页面路径和用户名作为存储键的一部分,确保不同页面和用户的选择互不影响 diff --git a/src/views/modules/ecss/components/PackingDetailTab.vue b/src/views/modules/ecss/components/PackingDetailTab.vue index 239f5c0..cba24bf 100644 --- a/src/views/modules/ecss/components/PackingDetailTab.vue +++ b/src/views/modules/ecss/components/PackingDetailTab.vue @@ -2,13 +2,15 @@
+ @expand-change="handleBoxExpand" + show-summary + :summary-method="getSummaries">