【update】-企业来款分类统计-联调2

This commit is contained in:
fengchenchen
2024-07-19 20:05:55 +08:00
parent 23b9383c4f
commit 9fc68a598a
@@ -41,7 +41,7 @@
</div> </div>
<!-- 操作按钮区域-end--> <!-- 操作按钮区域-end-->
<!-- table表格区域--> <!-- table表格区域 :pagination="ipagination" -->
<div> <div>
<a-table <a-table
size="middle" size="middle"
@@ -50,7 +50,7 @@
rowKey="chargeCompanyId" rowKey="chargeCompanyId"
:columns="columns" :columns="columns"
:dataSource="dataSource" :dataSource="dataSource"
:pagination="ipagination" :pagination="false"
:loading="loading" :loading="loading"
:scroll="{x: 1000}" :scroll="{x: 1000}"
@change="handleTableChange" @change="handleTableChange"
@@ -138,7 +138,7 @@ const defaultTableColumns = [
title: '来款企业', title: '来款企业',
align: 'center', align: 'center',
width: 160, width: 160,
dataIndex: 'chargeCompanyName', dataIndex: 'name',
scopedSlots: { customRender: 'text' } scopedSlots: { customRender: 'text' }
}, },
// { // {
@@ -175,13 +175,13 @@ const firstColumnFooter = {
align: 'center', align: 'center',
width: 60 width: 60
} }
// 统计的项目分类 // // 统计的项目分类
const projectCategory = [ // const projectCategory = [
{ name: '工作组', key: 'workGroup' }, // { name: '工作组', key: 'workGroup' },
{ name: '项目合作', key: 'generalProject' }, // { name: '项目合作', key: 'generalProject' },
{ name: '会议费', key: 'meeting' }, // { name: '会议费', key: 'meeting' },
{ name: '会员费', key: 'member' } // { name: '会员费', key: 'member' }
] // ]
export default { export default {
name: 'EnterprisePaymentStatisticsList', name: 'EnterprisePaymentStatisticsList',
@@ -225,7 +225,8 @@ export default {
rangeDateFormat: { rangeDateFormat: {
begin: 'YYYY', begin: 'YYYY',
end: 'YYYY' end: 'YYYY'
} },
disableMixinCreated: true // 不调用混用的created方法
} }
}, },
mounted() { mounted() {
@@ -268,16 +269,15 @@ export default {
// 将企业信息对象从查询参数中去掉 // 将企业信息对象从查询参数中去掉
delete param.chargeCompany delete param.chargeCompany
} }
// param.year = param.year_begin + ',' + param.year_end
return filterObj(param) return filterObj(param)
}, },
// 获取查询的列数
/* /*
* { * 获取查询的列数
"name": "企业名称", * titleList: item数组
"key": "name" * item 信息
}, * item."name": "企业名称",
* item."key": "name"
* */ * */
getColumnsData(titleList) { getColumnsData(titleList) {
let columnsObj = [] let columnsObj = []
@@ -291,7 +291,6 @@ export default {
scopedSlots: { customRender: 'allMoney' } scopedSlots: { customRender: 'allMoney' }
} }
columnsObj.push(item) columnsObj.push(item)
}) })
return columnsObj return columnsObj
}, },
@@ -309,9 +308,10 @@ export default {
this.loading = true this.loading = true
getAction(this.url.list, params).then((res) => { getAction(this.url.list, params).then((res) => {
if (res.success) { if (res.success) {
// todo 处理TableColumns 的数据 先本地生成 // 处理TableColumns 的数据
// let columnsKeys = res.result.columns || [] // let columnsKeys = res.result.columns || []
let syncColumns = this.getColumnsData(res.result.titleList || []) let syncColumns = this.getColumnsData(res.result.titleList || [])
console.log("-------syncColumns----", syncColumns)
this.columns = [firstColumnTop, ...defaultTableColumns, ...syncColumns] this.columns = [firstColumnTop, ...defaultTableColumns, ...syncColumns]
this.columnsFooter = [firstColumnFooter, ...defaultTableColumns, ...syncColumns] this.columnsFooter = [firstColumnFooter, ...defaultTableColumns, ...syncColumns]
// this.dataSource = res.result.pageList.records // this.dataSource = res.result.pageList.records
@@ -319,7 +319,7 @@ export default {
this.dataSource = res.result.valList || [] this.dataSource = res.result.valList || []
this.dataSource.map(data => { this.dataSource.map(data => {
syncColumns.map(col => { syncColumns.map(col => {
data[col.dataIndex] = data.allMoney || '0.00' + '' data[col.dataIndex] = data[col.dataIndex] || '0.00' + ''
}) })
}) })
// 操作汇总表格的数据 // 操作汇总表格的数据
@@ -336,11 +336,11 @@ export default {
obj[col.dataIndex] = footerData[col.dataIndex] || '0.00' + '' obj[col.dataIndex] = footerData[col.dataIndex] || '0.00' + ''
}) })
this.footerDataSource = [obj] this.footerDataSource = [obj]
if (res.result.pageList.total) { // if (res.result.pageList.total) {
this.ipagination.total = res.result.pageList.total // this.ipagination.total = res.result.pageList.total
} else { // } else {
this.ipagination.total = 0 // this.ipagination.total = 0
} // }
} }
if (this.dataSource.length > 0) { if (this.dataSource.length > 0) {
this.$nextTick(() => { this.$nextTick(() => {
@@ -360,6 +360,10 @@ export default {
this.$message.warning('请选择项目年份时间段') this.$message.warning('请选择项目年份时间段')
return return
} }
if(!this.queryParam.chargeCompany) {
this.$message.warning('请选择来款企业进行查询')
return
}
this.lastQueryParam = {...this.queryParam} this.lastQueryParam = {...this.queryParam}
this.loadData(1) this.loadData(1)
}, },
@@ -372,7 +376,7 @@ export default {
year_begin: new Date().getFullYear().toString(), year_begin: new Date().getFullYear().toString(),
year_end: new Date().getFullYear().toString() year_end: new Date().getFullYear().toString()
} }
this.loadData(1) // this.loadData(1)
} }
} }
} }