Browse Source

完善月还计提申请 -- 新增、编辑、详情页面列表增加合计功能

master
yunuo970428 2 months ago
parent
commit
8e68379e88
  1. 28
      anrui-riskcenter-ui/src/views/monthlyallowance/monthlyallowanceAdd.vue
  2. 28
      anrui-riskcenter-ui/src/views/monthlyallowance/monthlyallowanceInfo.vue
  3. 29
      anrui-riskcenter-ui/src/views/workFlow/yuehuanjitiFlow/monthlyallowanceDaiBan.vue
  4. 29
      anrui-riskcenter-ui/src/views/workFlow/yuehuanjitiFlow/monthlyallowanceEdit.vue
  5. 29
      anrui-riskcenter-ui/src/views/workFlow/yuehuanjitiFlow/monthlyallowanceYiBan.vue

28
anrui-riskcenter-ui/src/views/monthlyallowance/monthlyallowanceAdd.vue

@ -42,7 +42,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="100" />
@ -153,6 +153,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 === 'dueMoney') {
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
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.formobj = {

28
anrui-riskcenter-ui/src/views/monthlyallowance/monthlyallowanceInfo.vue

@ -41,7 +41,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="100" />
@ -132,6 +132,32 @@ export default {
}
}).catch(() => {})
},
//
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 === 'dueMoney') {
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
},
handleReturn() {
this.formobj = {
sid: '',

29
anrui-riskcenter-ui/src/views/workFlow/yuehuanjitiFlow/monthlyallowanceDaiBan.vue

@ -40,7 +40,7 @@
</el-form-item>
</el-col>
</el-row>
<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="100" />
@ -212,6 +212,33 @@ export default {
}
})
},
//
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') {
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
},
//
openCountersign(val) {
this.operation = val

29
anrui-riskcenter-ui/src/views/workFlow/yuehuanjitiFlow/monthlyallowanceEdit.vue

@ -38,7 +38,7 @@
</el-form-item>
</el-col>
</el-row>
<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="100" />
@ -167,6 +167,33 @@ export default {
})
}
})
},
//
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') {
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
}
}
}

29
anrui-riskcenter-ui/src/views/workFlow/yuehuanjitiFlow/monthlyallowanceYiBan.vue

@ -38,7 +38,7 @@
</el-form-item>
</el-col>
</el-row>
<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="100" />
@ -137,6 +137,33 @@ export default {
}
})
},
//
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') {
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('是否确认执行撤回操作', '提示', {

Loading…
Cancel
Save