From 3ed81474e2038add9b56e9b15dcb907b114ddd26 Mon Sep 17 00:00:00 2001 From: fengchenchen Date: Mon, 25 Dec 2023 17:11:12 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90update=E3=80=91-=20=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E5=85=A8=E6=89=80=E6=94=B6=E5=85=A5=E7=BB=9F=E8=AE=A12?= =?UTF-8?q?=E4=B8=AA=E7=BB=9F=E8=AE=A1=E5=9B=BE=E5=A2=9E=E5=8A=A0=E9=A2=84?= =?UTF-8?q?=E8=AE=A1=E5=88=B0=E8=B4=A6=E9=87=91=E9=A2=9D=E7=9A=84=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/dashboard/SingleMonthEcharts.vue | 57 ++++++++++++++++--- .../dashboard/SingleMonthTotalEcharts.vue | 52 ++++++++++++++--- 2 files changed, 93 insertions(+), 16 deletions(-) diff --git a/src/views/dashboard/SingleMonthEcharts.vue b/src/views/dashboard/SingleMonthEcharts.vue index 0cb7bc2..d860720 100644 --- a/src/views/dashboard/SingleMonthEcharts.vue +++ b/src/views/dashboard/SingleMonthEcharts.vue @@ -112,7 +112,8 @@ export default { // allMoney:[], confirmAmount:[], billMoney:[], - comeAllMoney:[] + comeAllMoney:[], + estimatedArrivalMoney:[] // 预计到账金额 } } }, @@ -138,25 +139,30 @@ export default { // 树形结构的数据 ,修改成table可以直接展示的数据,默认只有四行数据 let tableData = [ // {indexName: '年度待确收金额'}, + {indexName: '预计到账金额'}, {indexName: '确认收入金额'}, {indexName: '开票金额'}, - {indexName: '到账金额'}, + {indexName: '到账金额'} ] dataSource.map((item, index) => { let keyItem = MonthData.find(ele => Number(ele.value) === (index + 1)) if (keyItem) { 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.confirmAmount // 确认收入金额 - tableData[1][key] = item.billMoney // 开票金额 - tableData[2][key] = item.comeAllMoney // 到账金额 + tableData[1][key] = item.confirmAmount // 确认收入金额 + tableData[2][key] = item.billMoney // 开票金额 + tableData[3][key] = item.comeAllMoney // 到账金额 + } // 单月总数 if(index === 12){ - tableData[0].key12 = item.confirmAmount // 确认收入金额 - tableData[1].key12 = item.billMoney // 开票金额 - tableData[2].key12 = item.comeAllMoney // 到账金额 + tableData[0].key12 = item.estimatedArrivalMoney // 预计到账金额 + tableData[1].key12 = item.confirmAmount // 确认收入金额 + tableData[2].key12 = item.billMoney // 开票金额 + tableData[3].key12 = item.comeAllMoney // 到账金额 } }) @@ -179,6 +185,10 @@ export default { this.echartsData.confirmAmount.push(item.confirmAmount) this.echartsData.billMoney.push(item.billMoney) this.echartsData.comeAllMoney.push(item.comeAllMoney) + // this.echartsData.estimatedArrivalMoney.push(item.estimatedArrivalMoney) + // todo 后端开发完以后替换掉 + this.echartsData.estimatedArrivalMoney.push(Number(item.comeAllMoney) + 100000) + }) }, initEcharts() { @@ -211,7 +221,7 @@ export default { } }, legend: { - data: [ '确认收入金额', '开票金额', '到账金额'], + data: [ '预计到账金额', '确认收入金额', '开票金额', '到账金额'], right: '2%' }, 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: '确认收入金额', type: 'line', diff --git a/src/views/dashboard/SingleMonthTotalEcharts.vue b/src/views/dashboard/SingleMonthTotalEcharts.vue index b420257..51293bf 100644 --- a/src/views/dashboard/SingleMonthTotalEcharts.vue +++ b/src/views/dashboard/SingleMonthTotalEcharts.vue @@ -104,7 +104,8 @@ export default { // allMoney:[], confirmAmount:[], billMoney:[], - comeAllMoney:[] + comeAllMoney:[], + estimatedArrivalMoney:[], // 预计到账金额 } } }, @@ -127,22 +128,27 @@ export default { getAction(this.url.list, params).then((res) => { if (res.success) { let dataSource = res.result + // 树形结构的数据 ,修改成table可以直接展示的数据,默认只有四行数据 let tableData = [ // {indexName: '年度待确收金额'}, + {indexName: '预计到账金额'}, {indexName: '确认收入金额'}, {indexName: '开票金额'}, - {indexName: '到账金额'}, + {indexName: '到账金额'} ] dataSource.map((item, index) => { let keyItem = MonthDataTotal.find(ele => Number(ele.value) === (index + 1)) if (keyItem) { 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.confirmAmount // 确认收入金额 - tableData[1][key] = item.billMoney // 开票金额 - tableData[2][key] = item.comeAllMoney // 到账金额 + tableData[1][key] = item.confirmAmount // 确认收入金额 + tableData[2][key] = item.billMoney // 开票金额 + tableData[3][key] = item.comeAllMoney // 到账金额 + } }) this.initEchartsData(res.result) @@ -165,6 +171,9 @@ export default { this.echartsData.confirmAmount.push(item.confirmAmount) this.echartsData.billMoney.push(item.billMoney) this.echartsData.comeAllMoney.push(item.comeAllMoney) + // this.echartsData.estimatedArrivalMoney.push(item.estimatedArrivalMoney) + // todo 后端开发完以后替换掉 + this.echartsData.estimatedArrivalMoney.push(Number(item.comeAllMoney) + 100000) }) }, initEcharts() { @@ -197,7 +206,7 @@ export default { } }, legend: { - data: ['确认收入金额', '开票金额', '到账金额'], + data: ['预计到账金额', '确认收入金额', '开票金额', '到账金额'], right: '2%' }, 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: '确认收入金额', type: 'line', @@ -361,7 +399,7 @@ export default { ]) }, - }, + } ] }