From 08f64925811724e4e6564e43ca4b24e55858bb89 Mon Sep 17 00:00:00 2001 From: yunuo970428 <405378304@qq.com> Date: Mon, 17 Mar 2025 15:32:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=AE=A2=E6=88=B7=E6=9C=88?= =?UTF-8?q?=E8=BF=98=E8=BF=98=E6=AC=BE=E7=BB=9F=E8=AE=A1=E8=A1=A8--?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=90=88=E8=AE=A1=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../customerrepayment/customerrepayment.vue | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/anrui-riskcenter-ui/src/views/customerrepayment/customerrepayment.vue b/anrui-riskcenter-ui/src/views/customerrepayment/customerrepayment.vue index 36416356ff..ade052a44c 100644 --- a/anrui-riskcenter-ui/src/views/customerrepayment/customerrepayment.vue +++ b/anrui-riskcenter-ui/src/views/customerrepayment/customerrepayment.vue @@ -78,7 +78,7 @@
- + @@ -533,6 +533,33 @@ export default { loading.close() }) }, + // 合计 + getSummaries(param) { + param.data = this.listAll + 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 === 'dueMoney' || column.property === 'repaidMoney' || column.property === 'repaidMoney' || column.property === 'outstandingMoney' || column.property === 'paymentMoney' || column.property === 'bankBeInter' || column.property === 'fund') { + 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] += '' + } else { + sums[index] = '' + } + }) + return sums + }, doClose() { this.$store.dispatch('tagsView/delView', this.$route) this.$router.go(-1)