diff --git a/src/views/enm_kiln/workshopAnalysis.vue b/src/views/enm_kiln/workshopAnalysis.vue
index 0b8f69ae..b231088f 100644
--- a/src/views/enm_kiln/workshopAnalysis.vue
+++ b/src/views/enm_kiln/workshopAnalysis.vue
@@ -480,7 +480,8 @@ export default {
//当期与目标差值(KW·h/t)
let diff = 0;
if (arrs[2] !== "/") {
- diff = arrs[1] - arrs[2];
+ diff = (arrs[1] - arrs[2]).toFixed(2)
+ ;
} else {
diff = "/";
}
@@ -507,7 +508,7 @@ export default {
let lastDiff = 0;
if (arrs[1] !== "/" && arrs[4] !== "/") {
- lastDiff = arrs[1] - arrs[4];
+ lastDiff = (arrs[1] - arrs[4]).toFixed(2);
} else {
lastDiff = "/";
}
@@ -519,7 +520,7 @@ export default {
lastNum !== "/" &&
lastNum !== 0
) {
- lastRate = (lastDiff / lastNum) * 100;
+ lastRate = ((lastDiff / lastNum) * 100).toFixed(2);
} else {
lastRate = "/";
}
@@ -628,7 +629,7 @@ export default {
: "/";
}
if (arrs3[1] !== "/" && lastNum3 !== "/") {
- lastDiff3 = arrs3[1] - lastNum3;
+ lastDiff3 = (arrs3[1] - lastNum3).toFixed(2);
} else {
lastDiff3 = "/";
}
diff --git a/src/views/enm_mill/workshopAnalysis.vue b/src/views/enm_mill/workshopAnalysis.vue
index 9b3cc020..695e0197 100644
--- a/src/views/enm_mill/workshopAnalysis.vue
+++ b/src/views/enm_mill/workshopAnalysis.vue
@@ -197,11 +197,12 @@ export default {
this.$API.mtm.mgroup.list
.req({ page: 0, search: "水泥磨" })
.then((res) => {
- console.log("水泥磨", res);
that.query.mgroup = res[0].id;
//月目标
this.getMonthGoal();
+ this.getData();
});
+
},
methods: {
// 动态绑定Class
@@ -229,6 +230,7 @@ export default {
that.$API.mtm.goal.list.req(paramsGoal).then((ress) => {
if (ress.length > 0) {
let monthGoal = [];
+ let monthGoal2 = [];
ress.forEach((goal) => {
if (
goal.goal_cate_name == "单位产品分布电耗(KW·h/t)"
@@ -266,8 +268,7 @@ export default {
monthGoal2[12] = goal.goal_val_12;
that.monthGoal2 = monthGoal2;
}
- });
- this.getData();
+ })
} else {
this.getData();
}
@@ -312,7 +313,7 @@ export default {
that.monthGoal[ind] !== undefined
? that.monthGoal[ind]
: "/";
- wrapArr[ind] = arr;
+ wrapArr.push(arr);
});
wrapArr.forEach((item, index) => {
let ind = item.month_s;
@@ -327,13 +328,14 @@ export default {
//当期与环期差值(KW·h/t)
let lastNum = 0,
lastDiff = 0;
- if (index > 1) {
+ if (index > 0) {
let num = index - 1;
if (
wrapArr[num] &&
- wrapArr[num].elec_consume_unit
+ wrapArr[num][1]
) {
- lastNum = wrapArr[num].elec_consume_unit;
+ lastNum = wrapArr[num][1];
+
} else {
lastNum = "/";
}
@@ -351,7 +353,7 @@ export default {
//环比增长率(%)
let lastRate = 0;
if (
- lastDiff == "/" &&
+ lastDiff !== "/" &&
lastNum !== "/" &&
lastNum !== 0
) {
@@ -360,7 +362,7 @@ export default {
lastRate = "/";
}
arrs[7] = lastRate;
- //同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
+ // 同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
let sameRate = 0;
if (
wrapArr0[index] &&
diff --git a/src/views/enm_rm/workshopAnalysis.vue b/src/views/enm_rm/workshopAnalysis.vue
index 1d3e09cb..472d9595 100644
--- a/src/views/enm_rm/workshopAnalysis.vue
+++ b/src/views/enm_rm/workshopAnalysis.vue
@@ -126,6 +126,7 @@ export default {
that.query.mgroup = res[0].id;
//月目标
that.getMonthGoal();
+ that.getData();
});
},
methods: {
@@ -174,7 +175,6 @@ export default {
that.monthGoal = monthGoal;
}
});
- this.getData();
} else {
this.getData();
}
@@ -218,7 +218,7 @@ export default {
that.monthGoal[ind] !== undefined
? that.monthGoal[ind]
: "/";
- wrapArr[ind] = arr;
+ wrapArr.push(arr);
});
wrapArr.forEach((item, index) => {
let arrs = [];
@@ -236,13 +236,13 @@ export default {
arrs[3] = diff;
//环期值(KW·h/t)上个月的值
let lastNum = 0;
- if (index > 1) {
+ if (index > 0) {
let num = index - 1;
if (
wrapArr[num] &&
- wrapArr[num].elec_consume_unit
+ wrapArr[num][1]
) {
- lastNum = wrapArr[num].elec_consume_unit;
+ lastNum = wrapArr[num][1];
} else {
lastNum = "/";
}
diff --git a/src/views/enm_slag/workshopAnalysis.vue b/src/views/enm_slag/workshopAnalysis.vue
index bdc3f527..26cc28a8 100644
--- a/src/views/enm_slag/workshopAnalysis.vue
+++ b/src/views/enm_slag/workshopAnalysis.vue
@@ -238,9 +238,9 @@ export default {
let num = index - 1;
if (
wrapArr[num] &&
- wrapArr[num].elec_consume_unit
+ wrapArr[num][1]
) {
- lastNum = wrapArr[num].elec_consume_unit;
+ lastNum = wrapArr[num][1];
} else {
lastNum = "/";
}