|
|
@ -46,7 +46,7 @@ |
|
|
|
<div class="title"> |
|
|
|
<div>当月还款记录</div> |
|
|
|
</div> |
|
|
|
<el-table :key="tableKey" :data="formobj.records" :index="index" border style="width: 100%"> |
|
|
|
<el-table :key="tableKey" :data="formobj.records" :index="index" border style="width: 100%" show-summary :summary-method="getSummaries"> |
|
|
|
<el-table-column fixed width="80" label="序号" type="index" :index="index + 1" align="center"/> |
|
|
|
<el-table-column prop="loanContractNo" label="贷款合同编号" align="center" width="160" /> |
|
|
|
<el-table-column prop="vinNo" label="车架号" align="center" width="120"/> |
|
|
@ -151,6 +151,32 @@ 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 === 'actualMoney') { |
|
|
|
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 |
|
|
|
}, |
|
|
|
/** 确认撤回任务 */ |
|
|
|
openRevoke() { |
|
|
|
this.$confirm('是否确认执行撤回操作', '提示', { |
|
|
|