|
@@ -120,7 +120,7 @@
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
|
- <el-table v-loading="loading" :data="whgenlegList">
|
|
|
+ <el-table v-loading="loading" :data="whgenlegList" show-summary :summary-method="getSum">
|
|
|
<!-- <el-table-column type="selection" width="55" align="center" /> -->
|
|
|
<el-table-column type="index" label="行号" align="center" width="120"/>
|
|
|
<el-table-column label="客户" align="center" prop="fCorpid" show-overflow-tooltip width="120"/>
|
|
@@ -346,6 +346,29 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
+ //合计
|
|
|
+ getSum(param){
|
|
|
+ const { columns, data } = param
|
|
|
+ const sums = []
|
|
|
+ columns.forEach((column, index) => {
|
|
|
+ if (index === 0) {
|
|
|
+ sums[index] = '总计'
|
|
|
+ } else if (index ===13 || index ===10 || index ===11 || index ===12 || index ===14 || index ===15 || index ===16 || index ===17 || index ===18) {
|
|
|
+ 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 prev + curr
|
|
|
+ } else {
|
|
|
+ return prev
|
|
|
+ }
|
|
|
+ }, 0)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return sums
|
|
|
+ },
|
|
|
treeseLect(tree){
|
|
|
this.queryParams.fWarehouseLocationid = tree.id
|
|
|
},
|