From 45e6d26019c823cfe93b766abe8bae7b98c44e52 Mon Sep 17 00:00:00 2001 From: yunuo970428 <405378304@qq.com> Date: Thu, 28 Nov 2024 14:16:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E7=BB=B4=E4=BF=AE=E5=8D=95?= =?UTF-8?q?=E7=B4=A2=E8=B5=94=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../claimadjustment/claimadjustmentInfo.vue | 36 +++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/yxt-as-ui/src/views/operation/claimadjustment/claimadjustmentInfo.vue b/yxt-as-ui/src/views/operation/claimadjustment/claimadjustmentInfo.vue index 62b86d1611..059d9d6baa 100644 --- a/yxt-as-ui/src/views/operation/claimadjustment/claimadjustmentInfo.vue +++ b/yxt-as-ui/src/views/operation/claimadjustment/claimadjustmentInfo.vue @@ -35,18 +35,18 @@ - + - + - + - + @@ -55,7 +55,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -133,6 +133,30 @@ export default { } }) }, + // 合计 + getSummaries(param) { + const { columns, data } = param + const sums = [] + columns.forEach((column, index) => { + if (index === 0) { + sums[index] = '' + return + } + const values = data.map(item => Number(item[column.property])) + if (column.property === 'hourAmount1' || column.property === 'goodsAmount1') { + sums[index] = values.reduce((prev, curr) => { + const value = Number(curr) + if (!isNaN(value)) { + return Math.round((parseFloat(prev) + parseFloat(curr)) * 100) / 100 + } else { + return Math.round((parseFloat(prev)) * 100) / 100 + } + }, 0) + sums[index] += '' + } + }) + return sums + }, handleReturn() { this.formobj = { sid: '',