【update】-企业来款分类统计
This commit is contained in:
+20
-25
@@ -200,8 +200,8 @@ export default {
|
||||
sm: { span: 10 }
|
||||
},
|
||||
url: {
|
||||
list: '/statistics/companyComeMoney/list',
|
||||
exportXlsUrl: '/statistics/companyComeMoney/excel'
|
||||
list: '/statistics/companyComeMoney/classification',
|
||||
exportXlsUrl: '/statistics/companyComeMoney/classificationExcel'
|
||||
},
|
||||
columns: [firstColumnTop, ...defaultTableColumns],
|
||||
// 总计表头,与主表表头一致
|
||||
@@ -268,35 +268,30 @@ export default {
|
||||
// 将企业信息对象从查询参数中去掉
|
||||
delete param.chargeCompany
|
||||
}
|
||||
// param.year = param.year_begin + ',' + param.year_end
|
||||
|
||||
return filterObj(param)
|
||||
},
|
||||
// 获取查询的列数
|
||||
getColumnsData() {
|
||||
let keys = [], columnsObj = []
|
||||
for(let i = this.lastQueryParam.year_begin; i <= this.lastQueryParam.year_end; i++) {
|
||||
keys.push(i)
|
||||
/*
|
||||
* {
|
||||
"name": "企业名称",
|
||||
"key": "name"
|
||||
},
|
||||
* */
|
||||
getColumnsData(titleList) {
|
||||
let columnsObj = []
|
||||
titleList.map(title => {
|
||||
let item = {
|
||||
title: i + '年度待确收金额',
|
||||
title: title.name,
|
||||
align: 'center',
|
||||
width: 160,
|
||||
// sorter: true,
|
||||
dataIndex: i + '_' + 'allMoney',
|
||||
dataIndex: title.key,
|
||||
scopedSlots: { customRender: 'allMoney' }
|
||||
}
|
||||
columnsObj.push(item)
|
||||
}
|
||||
keys.map(year => {
|
||||
projectCategory.map(cate => {
|
||||
let item = {
|
||||
title: `${year}年度-${cate.name}-待确收金额`,
|
||||
align: 'center',
|
||||
width: 160,
|
||||
// sorter: true,
|
||||
dataIndex: year + '_' + cate.key + '_' + 'allMoney',
|
||||
scopedSlots: { customRender: 'allMoney' }
|
||||
}
|
||||
columnsObj.push(item)
|
||||
})
|
||||
|
||||
})
|
||||
return columnsObj
|
||||
},
|
||||
@@ -316,19 +311,19 @@ export default {
|
||||
if (res.success) {
|
||||
// todo 处理TableColumns 的数据 先本地生成
|
||||
// let columnsKeys = res.result.columns || []
|
||||
let syncColumns = this.getColumnsData()
|
||||
let syncColumns = this.getColumnsData(res.result.titleList || [])
|
||||
this.columns = [firstColumnTop, ...defaultTableColumns, ...syncColumns]
|
||||
this.columnsFooter = [firstColumnFooter, ...defaultTableColumns, ...syncColumns]
|
||||
// this.dataSource = res.result.pageList.records
|
||||
// 表格数据
|
||||
this.dataSource = res.result.pageList.records || []
|
||||
this.dataSource = res.result.valList || []
|
||||
this.dataSource.map(data => {
|
||||
syncColumns.map(col => {
|
||||
data[col.dataIndex] = data.allMoney || '0.00' + ''
|
||||
})
|
||||
})
|
||||
// todo 操作汇总表格的数据
|
||||
let footerData = res.result.footerData || res.result || {}
|
||||
// 操作汇总表格的数据
|
||||
let footerData = res.result.allMap || {}
|
||||
let obj = {
|
||||
id: '1',
|
||||
title: '总计'
|
||||
|
||||
Reference in New Issue
Block a user