|
@@ -100,7 +100,9 @@
|
|
|
widthHtval: document.body.clientWidth - 230,
|
|
|
users: [],
|
|
|
jichu: [],
|
|
|
- namess: ''
|
|
|
+ namess: '',
|
|
|
+ timers: null, // 点击的时间
|
|
|
+ zhishin: 0
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -395,7 +397,17 @@
|
|
|
console.log('触发')
|
|
|
},
|
|
|
getEchart(){
|
|
|
- console.log(this.radio, this.namess)
|
|
|
+ var that = this
|
|
|
+ that.timers = setTimeout(()=>{
|
|
|
+ clearTimeout(that.timers)
|
|
|
+ console.log(that.timers)
|
|
|
+ that.jieliu()
|
|
|
+ },800);
|
|
|
+ // this.jieliu()
|
|
|
+ },
|
|
|
+ // 脱离出来的方法
|
|
|
+ jieliu() {
|
|
|
+ console.log('触发了')
|
|
|
sessionStorage.radio = this.radio;
|
|
|
var _this = this;
|
|
|
var param = {};
|
|
@@ -439,21 +451,22 @@
|
|
|
var xList = []
|
|
|
var yList = []
|
|
|
var list
|
|
|
+ var totalMoneyCost
|
|
|
if(this.radio == '项目' || this.radio == '人员' || this.radio=='部门') {
|
|
|
list = res.data.costList
|
|
|
- var totalMoneyCost = ((this.radio=='项目' || this.radio=='人员')?res.data.totalMoneyCost:res.data.totalCostMoney);
|
|
|
+ totalMoneyCost = ((this.radio=='项目' || this.radio=='人员')?res.data.totalMoneyCost:res.data.totalCostMoney);
|
|
|
for(var i in list) {
|
|
|
if(this.radio=='项目' || this.radio == '人员') {
|
|
|
xList.push(this.radio=='项目'?list[i].project:list[i].name);
|
|
|
yList.push({
|
|
|
- "value": list[i].costMoney.toFixed(2),
|
|
|
+ "value": list[i].costMoney.toFixed(2) || list[i].costMoney,
|
|
|
"id": list[i].id || i,
|
|
|
"cost": list[i].cost
|
|
|
});
|
|
|
} else {
|
|
|
xList.push(list[i].departmentName);
|
|
|
yList.push({
|
|
|
- "value": list[i].costMoney.toFixed(2),
|
|
|
+ "value": list[i].costMoney.toFixed(2) || list[i].costMoney,
|
|
|
"id": list[i].departmentId,
|
|
|
"cost": list[i].costTime
|
|
|
});
|
|
@@ -466,7 +479,7 @@
|
|
|
console.log(list[i].name, list[i].costMoney, list[i].cost)
|
|
|
xList.push(list[i].name);
|
|
|
yList.push({
|
|
|
- "value": list[i].costMoney.toFixed(2),
|
|
|
+ "value": list[i].costMoney.toFixed(2) || list[i].costMoney,
|
|
|
"id": list[i].id || i,
|
|
|
"cost": list[i].cost
|
|
|
});
|
|
@@ -507,10 +520,15 @@
|
|
|
width: this.widthHtval
|
|
|
})
|
|
|
_this.myChart = myChart;
|
|
|
+ // console.log(totalMoneyCost.toFixed(2), '看看', totalMoneyCost)
|
|
|
+ // var chengbentongji = totalMoneyCost.toFixed(2) || totalMoneyCost
|
|
|
+ if(totalMoneyCost) {
|
|
|
+ this.zhishin = totalMoneyCost.toFixed(2)
|
|
|
+ }
|
|
|
if(this.radio == '项目' || this.radio == '人员' || this.radio=='部门') {
|
|
|
var option = {
|
|
|
title: {
|
|
|
- text: '工时成本总计' + totalMoneyCost.toFixed(2) + '元',
|
|
|
+ text: '工时成本总计' + this.zhishin + '元',
|
|
|
left:'left',
|
|
|
},
|
|
|
// 工具箱
|
|
@@ -719,7 +737,7 @@
|
|
|
type: "error"
|
|
|
});
|
|
|
});
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
created() {
|
|
|
},
|