Browse Source

完善客户月还还款统计表--增加合计功能

master
yunuo970428 1 month ago
parent
commit
08f6492581
  1. 29
      anrui-riskcenter-ui/src/views/customerrepayment/customerrepayment.vue

29
anrui-riskcenter-ui/src/views/customerrepayment/customerrepayment.vue

@ -78,7 +78,7 @@
</div>
<!--Start 主页面主要部分 -->
<div class="">
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;" @selection-change="handleSelectionChange">
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;" @selection-change="handleSelectionChange" show-summary :summary-method="getSummaries">
<el-table-column fixed type="selection" align="center" width="50"/>
<el-table-column fixed label="序号" type="index" width="80" :index="indexMethod" align="center"/>
<el-table-column fixed prop="useOrgName" label="分公司" width="130" align="center" />
@ -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)

Loading…
Cancel
Save