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)