【修改】增加百分比 总数

This commit is contained in:
fengachen
2022-10-24 10:27:40 +08:00
parent 4ab91f1708
commit 5e925b1743
3 changed files with 24 additions and 9 deletions
+2 -2
View File
@@ -128,7 +128,7 @@ export default {
}
// 未收入账款统计
.not-receiced {
width: 49%;
width: 49.6%;
min-width: 480px;
height: auto;
background: #fff;
@@ -137,7 +137,7 @@ export default {
// 分类统计
.income-sort {
margin-left: 8px;
width: 49%;
width: 49.6%;
min-width: 480px;
height: auto;
background: #fff;
+3 -3
View File
@@ -1,7 +1,7 @@
<!-- 未收账款统计-->
<template>
<div class="container">
<div class="title">收账款
<div class="title">收账款
<a-tree-select
:multiple="false"
show-search
@@ -162,12 +162,12 @@ export default {
// 将接口数据 转化成表格数据形式
let tableData = [
{indexName: '金额'},
// {indexName: '百分比'}
{indexName: '百分比'}
]
dataSource.map((item, index) => {
let dataIndex = 'key' + index
tableData[0][dataIndex] = item.money
// tableData[1][dataIndex] = item.value + '%'
tableData[1][dataIndex] = item.value ? item.value + '%' :''
})
this.dataSource = tableData
}
+19 -4
View File
@@ -74,7 +74,7 @@ const columns = [
{
title: '',
align: 'center',
width: 90,
width: 110,
dataIndex: 'indexName',
scopedSlots: {customRender: 'text'}
},
@@ -83,12 +83,20 @@ MonthData.map(tt => {
columns.push({
title: tt.name,
align: 'center',
width: 100,
width: 115,
dataIndex: tt.key,
scopedSlots: {customRender: 'allMoney'}
})
})
columns.push({
title: '总数',
align: 'center',
width: 100,
dataIndex: 'key12',
scopedSlots: {customRender: 'allMoney'}
})
export default {
name: 'SingleMonthEcharts',
@@ -144,7 +152,14 @@ export default {
tableData[1][key] = item.billMoney // 开票金额
tableData[2][key] = item.comeAllMoney // 到账金额
}
// 单月总数
if(index === 12){
tableData[0].key12 = item.confirmAmount // 确认收入金额
tableData[1].key12 = item.billMoney // 开票金额
tableData[2].key12 = item.comeAllMoney // 到账金额
}
})
this.initEchartsData(res.result)
// 初始化 echarts
this.initEcharts()
@@ -159,7 +174,7 @@ export default {
},
// 将后端返回的数据 处理成 echarts需要的数据 格式
initEchartsData(data) {
data.map(item =>{
data.slice(0,12).map(item =>{
// this.echartsData.allMoney.push(item.allMoney)
this.echartsData.confirmAmount.push(item.confirmAmount)
this.echartsData.billMoney.push(item.billMoney)
@@ -201,7 +216,7 @@ export default {
},
grid: {
left: '2.4%',
right: '0%',
right: '5%',
bottom: '3%',
containLabel: true
},