|
|
|
|
@ -594,21 +594,33 @@ export default {
|
|
|
|
|
let curPlan = res?.map(i => {
|
|
|
|
|
const { use_money_total,paid_plan_total,money_total_2,money_total_1 } = i
|
|
|
|
|
let curPlan_total = Math.round(Number(paid_plan_total||0)) + Math.round(Number(use_money_total||0))
|
|
|
|
|
return Number(money_total_2) ? ((( curPlan_total / Number(money_total_2 ||0)) * 10000) / 100).toFixed(2) :
|
|
|
|
|
((( curPlan_total / Number(money_total_1 ||0)) * 10000) / 100).toFixed(2)
|
|
|
|
|
return {
|
|
|
|
|
value:Number(money_total_2) ? ((( curPlan_total / Number(money_total_2 ||0)) * 10000) / 100).toFixed(2) :
|
|
|
|
|
((( curPlan_total / Number(money_total_1 ||0)) * 10000) / 100).toFixed(2),
|
|
|
|
|
money:paid_plan_total
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
let curAct = res?.map(i => {
|
|
|
|
|
const { use_money_total,money_total_2,money_total_1 } = i
|
|
|
|
|
return Number(money_total_2) ? (Math.round((Number(use_money_total||0) / Number(money_total_2||0)) * 10000) / 100).toFixed(2) :
|
|
|
|
|
(Math.round((Number(use_money_total||0) / Number(money_total_1||0)) * 10000) / 100).toFixed(2);
|
|
|
|
|
return {
|
|
|
|
|
value:Number(money_total_2) ? (Math.round((Number(use_money_total||0) / Number(money_total_2||0)) * 10000) / 100).toFixed(2) :
|
|
|
|
|
(Math.round((Number(use_money_total||0) / Number(money_total_1||0)) * 10000) / 100).toFixed(2),
|
|
|
|
|
money:use_money_total
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
let nextPlan = res?.map(i => {
|
|
|
|
|
const { use_money_total,use_money_total_next,paid_plan_total_next,money_total_2,money_total_1 } = i
|
|
|
|
|
if(Number(paid_plan_total_next)===0){
|
|
|
|
|
return 0
|
|
|
|
|
}
|
|
|
|
|
let nextPlan_total = Math.round(Number(paid_plan_total_next||0)) + Math.round(Number(use_money_total||0))
|
|
|
|
|
return Number(money_total_2) ? (((nextPlan_total / Number(money_total_2||0)) * 10000) / 100).toFixed(2) :
|
|
|
|
|
(((nextPlan_total / Number(money_total_1||0)) * 10000) / 100).toFixed(2);
|
|
|
|
|
return {
|
|
|
|
|
value:Number(money_total_2) ? (((nextPlan_total / Number(money_total_2||0)) * 10000) / 100).toFixed(2) :
|
|
|
|
|
(((nextPlan_total / Number(money_total_1||0)) * 10000) / 100).toFixed(2),
|
|
|
|
|
money:paid_plan_total_next
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
let barWidth = 23;
|
|
|
|
|
@ -626,6 +638,7 @@ export default {
|
|
|
|
|
let colorArr1 = ["#345A8B", "#387ABD", "#398ac4"];
|
|
|
|
|
let colorArr2 = ["#51C0DB", "#42D9D6", "#45F5F1"];
|
|
|
|
|
let colorArr3 = ['#559372','#7ab798','#9edebc']
|
|
|
|
|
let spanColor = ["#345A8B","#51C0DB",'#559372']
|
|
|
|
|
|
|
|
|
|
let color1 = setColor(colorArr1)
|
|
|
|
|
let color2 = setColor(colorArr2)
|
|
|
|
|
@ -634,6 +647,28 @@ export default {
|
|
|
|
|
this.lineChartData = {
|
|
|
|
|
rotate: 54,
|
|
|
|
|
xArr: res?.map(i => i.plan_department?.name),
|
|
|
|
|
tooltip: {
|
|
|
|
|
show:true,
|
|
|
|
|
trigger: 'axis', // 触发方式为鼠标悬浮在图形上
|
|
|
|
|
formatter: function (params) {
|
|
|
|
|
// 自定义悬浮窗的内容和样式
|
|
|
|
|
let result = `<div style=" padding: 10px;">`;
|
|
|
|
|
// 获取当前悬浮的部门名称
|
|
|
|
|
const departmentName = params[0].name;
|
|
|
|
|
result += `<div style="font-weight: bold; margin-bottom: 5px;">${departmentName}</div>`;
|
|
|
|
|
|
|
|
|
|
// 遍历所有参数,找到三个主要柱状图的数据
|
|
|
|
|
params.forEach((param,index) => {
|
|
|
|
|
// 只处理主要的柱状图数据(z值为1、4、7的系列)
|
|
|
|
|
result += `<div style="margin: 3px 0;">
|
|
|
|
|
<span style="display: inline-block; width: 10px; height: 10px; background-color: ${spanColor[index]}; margin-right: 5px;"></span>
|
|
|
|
|
<span>${param.seriesName}: ${param.value}%-${param.data.money?param.data.money+'元':0+'元'}</span>
|
|
|
|
|
</div>`;
|
|
|
|
|
});
|
|
|
|
|
result += `</div>`;
|
|
|
|
|
return result
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
series: [
|
|
|
|
|
{
|
|
|
|
|
z: 1,
|
|
|
|
|
@ -654,7 +689,7 @@ export default {
|
|
|
|
|
color: '#4d8bdc',
|
|
|
|
|
},
|
|
|
|
|
formatter: params => `${params.value}%`
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
z: 2,
|
|
|
|
|
@ -704,11 +739,12 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
data: curAct,
|
|
|
|
|
label: {
|
|
|
|
|
offset:[0,-15],
|
|
|
|
|
show: true,
|
|
|
|
|
position: 'top',
|
|
|
|
|
textStyle: {//数值样式
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
color: '#4d8bdc',
|
|
|
|
|
// color: 'red',
|
|
|
|
|
},
|
|
|
|
|
formatter: params => `${params.value}%`
|
|
|
|
|
}
|
|
|
|
|
|