|
@@ -762,16 +762,14 @@
|
|
this.http.post(url, param,
|
|
this.http.post(url, param,
|
|
res => {
|
|
res => {
|
|
if (res.code == "ok") {
|
|
if (res.code == "ok") {
|
|
|
|
+ // 更具数据的长度去加每个柱子的间距
|
|
for(var i in res.data.costList) {
|
|
for(var i in res.data.costList) {
|
|
if(i>20) {
|
|
if(i>20) {
|
|
- // this.widthHtval = +this.widthHtval + 2
|
|
|
|
this.widthHtval = +this.widthHtval + 40
|
|
this.widthHtval = +this.widthHtval + 40
|
|
} else {
|
|
} else {
|
|
this.widthHtval = document.body.clientWidth - 230
|
|
this.widthHtval = document.body.clientWidth - 230
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
- // 测试写的
|
|
|
|
var xList = []
|
|
var xList = []
|
|
var yList = []
|
|
var yList = []
|
|
var list
|
|
var list
|
|
@@ -785,11 +783,12 @@
|
|
if(this.radio=='项目') {
|
|
if(this.radio=='项目') {
|
|
xList.push(list[i].project);
|
|
xList.push(list[i].project);
|
|
let item = {
|
|
let item = {
|
|
- "value": this.yAxisValue==0?list[i].costMoney.toFixed(2) || list[i].costMoney:list[i].cost.toFixed(1),
|
|
|
|
|
|
+ "value": this.yAxisValue==0?(list[i].costMoney ? list[i].costMoney.toFixed(2) : 0) || list[i].costMoney:(list[i].cost ? list[i].cost.toFixed(1) : 0),
|
|
"id": list[i].id || i,
|
|
"id": list[i].id || i,
|
|
}
|
|
}
|
|
if(this.permissions.countCost){
|
|
if(this.permissions.countCost){
|
|
- item.money = list[i].costMoney.toFixed(2)
|
|
|
|
|
|
+ // item.money = list[i].costMoney.toFixed(2)
|
|
|
|
+ item.money = (list[i].costMoney ? list[i].costMoney.toFixed(2) : 0)
|
|
}
|
|
}
|
|
if(this.permissions.countHours){
|
|
if(this.permissions.countHours){
|
|
item.cost = list[i].cost
|
|
item.cost = list[i].cost
|
|
@@ -800,12 +799,14 @@
|
|
} else if(this.radio == '部门'){
|
|
} else if(this.radio == '部门'){
|
|
xList.push(list[i].departmentName);
|
|
xList.push(list[i].departmentName);
|
|
let item = {
|
|
let item = {
|
|
- "value": this.yAxisValue==0 ? list[i].costMoney.toFixed(2) || list[i].costMoney: list[i].costTime.toFixed(1),
|
|
|
|
|
|
+ // "value": this.yAxisValue==0 ? list[i].costMoney.toFixed(2) || list[i].costMoney: list[i].costTime.toFixed(1),
|
|
|
|
+ "value": this.yAxisValue==0 ? (list[i].costMoney ? list[i].costMoney.toFixed(2) : 0) || list[i].costMoney: (list[i].costTime ? list[i].costTime.toFixed(1) : 0),
|
|
"id": list[i].departmentId,
|
|
"id": list[i].departmentId,
|
|
"hasSubDept": list[i].hasSubDept
|
|
"hasSubDept": list[i].hasSubDept
|
|
}
|
|
}
|
|
if(this.permissions.countCost){
|
|
if(this.permissions.countCost){
|
|
- item.money = list[i].costMoney.toFixed(2)
|
|
|
|
|
|
+ // item.money = list[i].costMoney.toFixed(2)
|
|
|
|
+ item.money = (list[i].costMoney ? list[i].costMoney.toFixed(2) : 0)
|
|
}
|
|
}
|
|
if(this.permissions.countHours){
|
|
if(this.permissions.countHours){
|
|
item.cost = list[i].costTime
|
|
item.cost = list[i].costTime
|
|
@@ -816,11 +817,13 @@
|
|
}else {
|
|
}else {
|
|
xList.push(list[i].categoryName);
|
|
xList.push(list[i].categoryName);
|
|
let item = {
|
|
let item = {
|
|
- "value": this.yAxisValue==0?list[i].costMoney.toFixed(2) || list[i].costMoney:list[i].cost.toFixed(1),
|
|
|
|
|
|
+ // "value": this.yAxisValue==0?list[i].costMoney.toFixed(2) || list[i].costMoney:list[i].cost.toFixed(1),
|
|
|
|
+ "value": this.yAxisValue==0?(list[i].costMoney ? list[i].costMoney.toFixed(2) : 0) || list[i].costMoney:(list[i].cost ? list[i].cost.toFixed(1) : 0),
|
|
"id": list[i].id || i,
|
|
"id": list[i].id || i,
|
|
}
|
|
}
|
|
if(this.permissions.countCost){
|
|
if(this.permissions.countCost){
|
|
- item.money = list[i].costMoney.toFixed(2)
|
|
|
|
|
|
+ // item.money = list[i].costMoney.toFixed(2)
|
|
|
|
+ item.money = (list[i].costMoney ? list[i].costMoney.toFixed(2) : 0)
|
|
}
|
|
}
|
|
if(this.permissions.countHours){
|
|
if(this.permissions.countHours){
|
|
item.cost = list[i].cost
|
|
item.cost = list[i].cost
|
|
@@ -840,7 +843,8 @@
|
|
"id": list[i].id || i,
|
|
"id": list[i].id || i,
|
|
}
|
|
}
|
|
if(this.permissions.countCost){
|
|
if(this.permissions.countCost){
|
|
- item.money = list[i].costMoney.toFixed(2)
|
|
|
|
|
|
+ // item.money = list[i].costMoney.toFixed(2)
|
|
|
|
+ item.money = list[i].costMoney ? list[i].costMoney.toFixed(2) : 0
|
|
totalMoneyCost += parseFloat(list[i].costMoney);
|
|
totalMoneyCost += parseFloat(list[i].costMoney);
|
|
}
|
|
}
|
|
if(this.permissions.countHours){
|
|
if(this.permissions.countHours){
|