【update】- 首页全所收入统计2个统计图增加预计到账金额的统计

This commit is contained in:
fengchenchen
2023-12-25 17:11:12 +08:00
parent e9ef50c9e0
commit 3ed81474e2
2 changed files with 93 additions and 16 deletions
+48 -9
View File
@@ -112,7 +112,8 @@ export default {
// allMoney:[], // allMoney:[],
confirmAmount:[], confirmAmount:[],
billMoney:[], billMoney:[],
comeAllMoney:[] comeAllMoney:[],
estimatedArrivalMoney:[] // 预计到账金额
} }
} }
}, },
@@ -138,25 +139,30 @@ export default {
// 树形结构的数据 ,修改成table可以直接展示的数据,默认只有四行数据 // 树形结构的数据 ,修改成table可以直接展示的数据,默认只有四行数据
let tableData = [ let tableData = [
// {indexName: '年度待确收金额'}, // {indexName: '年度待确收金额'},
{indexName: '预计到账金额'},
{indexName: '确认收入金额'}, {indexName: '确认收入金额'},
{indexName: '开票金额'}, {indexName: '开票金额'},
{indexName: '到账金额'}, {indexName: '到账金额'}
] ]
dataSource.map((item, index) => { dataSource.map((item, index) => {
let keyItem = MonthData.find(ele => Number(ele.value) === (index + 1)) let keyItem = MonthData.find(ele => Number(ele.value) === (index + 1))
if (keyItem) { if (keyItem) {
let key = keyItem.key let key = keyItem.key
// tableData[3][key] = item.estimatedArrivalMoney // todo 需要替换字段 预计到账金额--也可能放在第一条
tableData[0][key] = Number(item.comeAllMoney) + 100000 // todo 需要替换字段 预计到账金额--也可能放在第一条
// tableData[0][key] = item.allMoney // 年度待确收金额 // tableData[0][key] = item.allMoney // 年度待确收金额
tableData[0][key] = item.confirmAmount // 确认收入金额 tableData[1][key] = item.confirmAmount // 确认收入金额
tableData[1][key] = item.billMoney // 开票金额 tableData[2][key] = item.billMoney // 开票金额
tableData[2][key] = item.comeAllMoney // 到账金额 tableData[3][key] = item.comeAllMoney // 到账金额
} }
// 单月总数 // 单月总数
if(index === 12){ if(index === 12){
tableData[0].key12 = item.confirmAmount // 确认收入金额 tableData[0].key12 = item.estimatedArrivalMoney // 预计到账金额
tableData[1].key12 = item.billMoney // 开票金额 tableData[1].key12 = item.confirmAmount // 确认收入金额
tableData[2].key12 = item.comeAllMoney // 到账金额 tableData[2].key12 = item.billMoney // 开票金额
tableData[3].key12 = item.comeAllMoney // 到账金额
} }
}) })
@@ -179,6 +185,10 @@ export default {
this.echartsData.confirmAmount.push(item.confirmAmount) this.echartsData.confirmAmount.push(item.confirmAmount)
this.echartsData.billMoney.push(item.billMoney) this.echartsData.billMoney.push(item.billMoney)
this.echartsData.comeAllMoney.push(item.comeAllMoney) this.echartsData.comeAllMoney.push(item.comeAllMoney)
// this.echartsData.estimatedArrivalMoney.push(item.estimatedArrivalMoney)
// todo 后端开发完以后替换掉
this.echartsData.estimatedArrivalMoney.push(Number(item.comeAllMoney) + 100000)
}) })
}, },
initEcharts() { initEcharts() {
@@ -211,7 +221,7 @@ export default {
} }
}, },
legend: { legend: {
data: [ '确认收入金额', '开票金额', '到账金额'], data: [ '预计到账金额', '确认收入金额', '开票金额', '到账金额'],
right: '2%' right: '2%'
}, },
grid: { grid: {
@@ -291,6 +301,35 @@ export default {
// ]) // ])
// }, // },
// }, // },
{
name: '预计到账金额',
type: 'line',
showSymbol: false,
symbol: 'circle',
symbolSize: 8,
data: this.echartsData.estimatedArrivalMoney,
itemStyle: {
normal: {lineStyle:{type: 'dashed'}},
emphasis: {
color: '#fff',//拐点颜色
borderColor: '#1BCDC6',//拐点边框颜色
borderWidth: 2//拐点边框大小
}
},
areaStyle: {
opacity: 0.2,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#1BCDC6'
},
{
offset: 1,
color: '#ffffff'
}
])
},
},
{ {
name: '确认收入金额', name: '确认收入金额',
type: 'line', type: 'line',
@@ -104,7 +104,8 @@ export default {
// allMoney:[], // allMoney:[],
confirmAmount:[], confirmAmount:[],
billMoney:[], billMoney:[],
comeAllMoney:[] comeAllMoney:[],
estimatedArrivalMoney:[], // 预计到账金额
} }
} }
}, },
@@ -127,22 +128,27 @@ export default {
getAction(this.url.list, params).then((res) => { getAction(this.url.list, params).then((res) => {
if (res.success) { if (res.success) {
let dataSource = res.result let dataSource = res.result
// 树形结构的数据 ,修改成table可以直接展示的数据,默认只有四行数据 // 树形结构的数据 ,修改成table可以直接展示的数据,默认只有四行数据
let tableData = [ let tableData = [
// {indexName: '年度待确收金额'}, // {indexName: '年度待确收金额'},
{indexName: '预计到账金额'},
{indexName: '确认收入金额'}, {indexName: '确认收入金额'},
{indexName: '开票金额'}, {indexName: '开票金额'},
{indexName: '到账金额'}, {indexName: '到账金额'}
] ]
dataSource.map((item, index) => { dataSource.map((item, index) => {
let keyItem = MonthDataTotal.find(ele => Number(ele.value) === (index + 1)) let keyItem = MonthDataTotal.find(ele => Number(ele.value) === (index + 1))
if (keyItem) { if (keyItem) {
let key = keyItem.key let key = keyItem.key
// tableData[0][key] = item.estimatedArrivalMoney // todo 需要替换字段 预计到账金额--也可能放在第一条
tableData[0][key] = Number(item.comeAllMoney) + 100000 // todo 需要替换字段 预计到账金额--也可能放在第一条
// tableData[0][key] = item.allMoney // 年度待确收金额 // tableData[0][key] = item.allMoney // 年度待确收金额
tableData[0][key] = item.confirmAmount // 确认收入金额 tableData[1][key] = item.confirmAmount // 确认收入金额
tableData[1][key] = item.billMoney // 开票金额 tableData[2][key] = item.billMoney // 开票金额
tableData[2][key] = item.comeAllMoney // 到账金额 tableData[3][key] = item.comeAllMoney // 到账金额
} }
}) })
this.initEchartsData(res.result) this.initEchartsData(res.result)
@@ -165,6 +171,9 @@ export default {
this.echartsData.confirmAmount.push(item.confirmAmount) this.echartsData.confirmAmount.push(item.confirmAmount)
this.echartsData.billMoney.push(item.billMoney) this.echartsData.billMoney.push(item.billMoney)
this.echartsData.comeAllMoney.push(item.comeAllMoney) this.echartsData.comeAllMoney.push(item.comeAllMoney)
// this.echartsData.estimatedArrivalMoney.push(item.estimatedArrivalMoney)
// todo 后端开发完以后替换掉
this.echartsData.estimatedArrivalMoney.push(Number(item.comeAllMoney) + 100000)
}) })
}, },
initEcharts() { initEcharts() {
@@ -197,7 +206,7 @@ export default {
} }
}, },
legend: { legend: {
data: ['确认收入金额', '开票金额', '到账金额'], data: ['预计到账金额', '确认收入金额', '开票金额', '到账金额'],
right: '2%' right: '2%'
}, },
grid: { grid: {
@@ -277,6 +286,35 @@ export default {
// ]) // ])
// }, // },
// }, // },
{
name: '预计到账金额',
type: 'line',
showSymbol: false,
symbol: 'circle',
symbolSize: 8,
data: this.echartsData.estimatedArrivalMoney,
itemStyle: {
normal: {lineStyle:{type: 'dashed'}},
emphasis: {
color: '#fff',//拐点颜色
borderColor: '#1BCDC6',//拐点边框颜色
borderWidth: 2//拐点边框大小
}
},
areaStyle: {
opacity: 0.2,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#1BCDC6'
},
{
offset: 1,
color: '#ffffff'
}
])
},
},
{ {
name: '确认收入金额', name: '确认收入金额',
type: 'line', type: 'line',
@@ -361,7 +399,7 @@ export default {
]) ])
}, },
}, }
] ]
} }