Browse Source

完善专项返利管理

master
yunuo970428 5 months ago
parent
commit
fbdacede35
  1. 28
      anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatemanagement/specialrebatemanagement.vue

28
anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatemanagement/specialrebatemanagement.vue

@ -47,7 +47,7 @@
<pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
</div>
<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="50px"/>
<el-table-column fixed label="序号" type="index" :index="indexMethod" align="center" width="80px"/>
<el-table-column fixed label="操作" align="center" width="180px" >
@ -350,6 +350,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 (!values.every(value => isNaN(value))) {
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
},
resetState() {
this.viewState = 1
},

Loading…
Cancel
Save