fix:报表合计行
This commit is contained in:
parent
224d4e37a8
commit
b73f62b4d2
|
@ -108,7 +108,9 @@
|
|||
>
|
||||
{{ item[2 + day] }}
|
||||
</td>
|
||||
<td class="numCell">{{ item[headerLength] }}</td>
|
||||
<td class="numCell">
|
||||
{{ item[headerLength - 1] }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
@ -317,211 +319,21 @@ export default {
|
|||
obj.page = 0;
|
||||
this.$API.enm.mpoint.stat.req(obj).then((res) => {
|
||||
console.log(res);
|
||||
let sum = 0;
|
||||
res.forEach((item) => {
|
||||
let ind = item.day + 2;
|
||||
that.tableDatas[index][ind] = item.val;
|
||||
sum += Number(item.val);
|
||||
});
|
||||
sum = sum * 100;
|
||||
sum = Math.round(sum);
|
||||
sum = sum / 100;
|
||||
let dayss = 0;
|
||||
dayss = this.days + 3;
|
||||
that.tableDatas[index][dayss] = sum.toFixed(2);
|
||||
that.$forceUpdate();
|
||||
});
|
||||
},
|
||||
// getData() {
|
||||
// let that = this;
|
||||
// function dataPush(name) {
|
||||
// let index = 0;
|
||||
// if (name == "破碎机") {
|
||||
// index = 0;
|
||||
// } else if (name == "堆取料机") {
|
||||
// index = 1;
|
||||
// } else if (name == "低压变压器柜") {
|
||||
// index = 2;
|
||||
// } else if (name == "循环风机") {
|
||||
// index = 4;
|
||||
// } else if (name == "调配变压器") {
|
||||
// index = 6;
|
||||
// } else if (name == "低压变压器柜器") {
|
||||
// index = 7;
|
||||
// } else if (name == "尾排风机") {
|
||||
// index = 9;
|
||||
// } else if (name == "高温风机") {
|
||||
// index = 10;
|
||||
// } else if (name == "头排风机") {
|
||||
// index = 11;
|
||||
// } else if (name == "煤磨主电机") {
|
||||
// index = 14;
|
||||
// } else if (name == "煤磨排风机") {
|
||||
// index = 15;
|
||||
// } else if (name == "低压变压器柜") {
|
||||
// index = 16;
|
||||
// } else if (name == "余热发电量") {
|
||||
// index = 18;
|
||||
// } else if (name == "余热发电自用电量") {
|
||||
// index = 19;
|
||||
// } else if (name == "1#空压机") {
|
||||
// index = 21;
|
||||
// } else if (name == "2#空压机") {
|
||||
// index = 22;
|
||||
// } else if (name == "3#空压机") {
|
||||
// index = 23;
|
||||
// } else if (name == "4#空压机") {
|
||||
// index = 24;
|
||||
// } else if (name == "富氧燃烧耗电设备") {
|
||||
// index = 26;
|
||||
// }
|
||||
// return index;
|
||||
// }
|
||||
// function sumNum(a, b, c, d) {
|
||||
// let sum = 0;
|
||||
// if (typeof a !== "undefined" && a !== "NaN") {
|
||||
// sum = sum + Number(a);
|
||||
// }
|
||||
// if (typeof b !== "undefined" && a !== "NaN") {
|
||||
// sum = sum + Number(b);
|
||||
// }
|
||||
// if (typeof c !== "undefined" && a !== "NaN") {
|
||||
// sum = sum + Number(c);
|
||||
// }
|
||||
// if (typeof d !== "undefined" && a !== "NaN") {
|
||||
// sum = sum + Number(d);
|
||||
// }
|
||||
// return sum;
|
||||
// }
|
||||
// let obj = {};
|
||||
// obj.type = "day_s";
|
||||
// obj.year_s = that.year;
|
||||
// obj.month_s = that.month;
|
||||
// obj.page = 0;
|
||||
// obj.mpoint__ep_monitored__power_kw__gte = 100;
|
||||
// this.$API.enm.mpoint.stat
|
||||
// .req(obj)
|
||||
// .then((res) => {
|
||||
// let wrapArr = [],
|
||||
// innerArr = [];
|
||||
// res.forEach((item) => {
|
||||
// let day = item.day_s;
|
||||
// if (wrapArr[day]) {
|
||||
// wrapArr[day].push(item);
|
||||
// } else {
|
||||
// wrapArr[day] = [];
|
||||
// wrapArr[day].push(item);
|
||||
// }
|
||||
// });
|
||||
// wrapArr.forEach((inner, inde) => {
|
||||
// inner.forEach((item) => {
|
||||
// let i = dataPush(item.mpoint_name);
|
||||
// let k = 0;
|
||||
// if (
|
||||
// i == 0 ||
|
||||
// i == 4 ||
|
||||
// i == 9 ||
|
||||
// i == 14 ||
|
||||
// i == 18 ||
|
||||
// i == 21 ||
|
||||
// i == 26 ||
|
||||
// i == 27 ||
|
||||
// i == 28
|
||||
// ) {
|
||||
// k = 3 + inde;
|
||||
// } else {
|
||||
// k = 2 + inde;
|
||||
// }
|
||||
// that.tableDatas[i][k] = item.val;
|
||||
// });
|
||||
// });
|
||||
// for (let k = 0; k < that.headerLength; k++) {
|
||||
// let m = k + 3;
|
||||
// let n = k + 1;
|
||||
// //石灰石破碎合计
|
||||
|
||||
// that.tableDatas[3][m] = sumNum(
|
||||
// that.tableDatas[0][m],
|
||||
// that.tableDatas[1][m],
|
||||
// that.tableDatas[2][m]
|
||||
// );
|
||||
// //辊压机
|
||||
// // that.tableDatas[5][m] = sumNum();
|
||||
// //原料磨系统合计
|
||||
// that.tableDatas[8][m] =
|
||||
// sumNum(
|
||||
// that.tableDatas[4][m],
|
||||
// // that.tableDatas[5][m],
|
||||
// that.tableDatas[6][m],
|
||||
// that.tableDatas[7][m]
|
||||
// ) -
|
||||
// sumNum(
|
||||
// that.tableDatas[1][m],
|
||||
// that.tableDatas[2][m]
|
||||
// );
|
||||
// //低压变压器柜
|
||||
// // that.tableDatas[12][m] = sumNum(
|
||||
// // that.tableDatas[9][m],
|
||||
// // that.tableDatas[10][m],
|
||||
// // that.tableDatas[11][m]
|
||||
// // );
|
||||
// //回转窑烧成系统合计
|
||||
// that.tableDatas[13][m] =
|
||||
// typeof that.tableDatas[12][m] !== "undefined"
|
||||
// ? sumNum(
|
||||
// that.tableDatas[9][m],
|
||||
// that.tableDatas[10][m],
|
||||
// that.tableDatas[11][m],
|
||||
// that.tableDatas[12][m]
|
||||
// )
|
||||
// : sumNum(
|
||||
// that.tableDatas[9][m],
|
||||
// that.tableDatas[10][m],
|
||||
// that.tableDatas[11][m]
|
||||
// );
|
||||
// //煤磨系统合计
|
||||
// let sum17 = sumNum(
|
||||
// that.tableDatas[14][m],
|
||||
// that.tableDatas[15][m],
|
||||
// that.tableDatas[16][m]
|
||||
// );
|
||||
// that.tableDatas[17][m] =
|
||||
// typeof that.tableDatas[21][m] !== "undefined"
|
||||
// ? sum17 - that.tableDatas[21][m]
|
||||
// : sum17;
|
||||
// //余热供电量
|
||||
// that.tableDatas[20][m] =
|
||||
// typeof that.tableDatas[19][m] !== "undefined"
|
||||
// ? that.tableDatas[18][m] -
|
||||
// that.tableDatas[19][m]
|
||||
// : that.tableDatas[18][m];
|
||||
// //空压机合计
|
||||
// that.tableDatas[25][m] = sumNum(
|
||||
// that.tableDatas[21][m],
|
||||
// that.tableDatas[22][m],
|
||||
// that.tableDatas[23][m],
|
||||
// that.tableDatas[24][m]
|
||||
// );
|
||||
// //生产部分总耗电
|
||||
// that.tableDatas[27][m] = sumNum(
|
||||
// that.tableDatas[3][m],
|
||||
// that.tableDatas[8][m],
|
||||
// that.tableDatas[13][m],
|
||||
// that.tableDatas[17][m],
|
||||
// that.tableDatas[18][m],
|
||||
// that.tableDatas[25][m],
|
||||
// that.tableDatas[26][m]
|
||||
// );
|
||||
// //全厂耗电量
|
||||
// // that.tableDatas[28][m] = sumNum(
|
||||
// // that.tableDatas[27][m],
|
||||
// // that.tableDatas[26][m]
|
||||
// // );
|
||||
// }
|
||||
// that.tableDatas.forEach((inner, inde) => {
|
||||
// let sumlast = 0;
|
||||
// inner.forEach((num, ind) => {
|
||||
// if (ind > 2 && ind < that.headerLength) {
|
||||
// sumlast = sumlast + Number(num);
|
||||
// }
|
||||
// });
|
||||
// inner[that.headerLength] = sumlast;
|
||||
// });
|
||||
// })
|
||||
// .then(() => {});
|
||||
// },
|
||||
itemClick(item, index) {
|
||||
let that = this;
|
||||
let lineData = that.tableDatas[index].slice(3, that.headerLength);
|
||||
|
|
|
@ -384,212 +384,19 @@ export default {
|
|||
obj.page = 0;
|
||||
this.$API.enm.mpoint.stat.req(obj).then((res) => {
|
||||
console.log(res);
|
||||
let sum = 0;
|
||||
res.forEach((item) => {
|
||||
let ind = item.hour + 3;
|
||||
that.tableDatas[index][ind] = item.val;
|
||||
sum += Number(item.val);
|
||||
});
|
||||
sum = sum * 100;
|
||||
sum = Math.round(sum);
|
||||
sum = sum / 100;
|
||||
that.tableDatas[index][27] = sum.toFixed(2);
|
||||
that.$forceUpdate();
|
||||
});
|
||||
},
|
||||
// getData(id) {
|
||||
// let that = this;
|
||||
// function dataPush(name) {
|
||||
// let index = 0;
|
||||
// if (name == "破碎机") {
|
||||
// index = 0;
|
||||
// } else if (name == "堆取料机") {
|
||||
// index = 1;
|
||||
// } else if (name == "低压变压器柜") {
|
||||
// index = 2;
|
||||
// } else if (name == "循环风机") {
|
||||
// index = 4;
|
||||
// } else if (name == "调配变压器") {
|
||||
// index = 6;
|
||||
// } else if (name == "低压变压器柜器") {
|
||||
// index = 7;
|
||||
// } else if (name == "尾排风机") {
|
||||
// index = 9;
|
||||
// } else if (name == "高温风机") {
|
||||
// index = 10;
|
||||
// } else if (name == "头排风机") {
|
||||
// index = 11;
|
||||
// } else if (name == "煤磨主电机") {
|
||||
// index = 14;
|
||||
// } else if (name == "煤磨排风机") {
|
||||
// index = 15;
|
||||
// } else if (name == "低压变压器柜") {
|
||||
// index = 16;
|
||||
// } else if (name == "余热发电量") {
|
||||
// index = 18;
|
||||
// } else if (name == "余热发电自用电量") {
|
||||
// index = 19;
|
||||
// } else if (name == "1#空压机") {
|
||||
// index = 21;
|
||||
// } else if (name == "2#空压机") {
|
||||
// index = 22;
|
||||
// } else if (name == "3#空压机") {
|
||||
// index = 23;
|
||||
// } else if (name == "4#空压机") {
|
||||
// index = 24;
|
||||
// } else if (name == "富氧燃烧耗电设备") {
|
||||
// index = 26;
|
||||
// }
|
||||
// return index;
|
||||
// }
|
||||
// function sumNum(a, b, c, d) {
|
||||
// let sum = 0;
|
||||
// if (typeof a !== "undefined" && a !== "NaN") {
|
||||
// sum = sum + Number(a);
|
||||
// }
|
||||
// if (typeof b !== "undefined" && a !== "NaN") {
|
||||
// sum = sum + Number(b);
|
||||
// }
|
||||
// if (typeof c !== "undefined" && a !== "NaN") {
|
||||
// sum = sum + Number(c);
|
||||
// }
|
||||
// if (typeof d !== "undefined" && a !== "NaN") {
|
||||
// sum = sum + Number(d);
|
||||
// }
|
||||
// return sum;
|
||||
// }
|
||||
// let obj = {};
|
||||
// obj.type = "hour_s";
|
||||
// obj.year_s = that.year;
|
||||
// obj.month_s = that.month;
|
||||
// obj.day_s = that.day;
|
||||
// obj.page = 0;
|
||||
// obj.mpoint__ep_monitored__power_kw__gte = 100;
|
||||
// this.$API.enm.mpoint.stat
|
||||
// .req(obj)
|
||||
// .then((res) => {
|
||||
// let wrapArr = [],
|
||||
// innerArr = [];
|
||||
// res.forEach((item) => {
|
||||
// let hour = item.hour;
|
||||
// if (wrapArr[hour]) {
|
||||
// wrapArr[hour].push(item);
|
||||
// } else {
|
||||
// wrapArr[hour] = [];
|
||||
// wrapArr[hour].push(item);
|
||||
// }
|
||||
// });
|
||||
// wrapArr.forEach((inner, inde) => {
|
||||
// inner.forEach((item) => {
|
||||
// let i = dataPush(item.mpoint_name);
|
||||
// let k = 0;
|
||||
// if (
|
||||
// i == 0 ||
|
||||
// i == 4 ||
|
||||
// i == 9 ||
|
||||
// i == 14 ||
|
||||
// i == 18 ||
|
||||
// i == 21 ||
|
||||
// i == 26 ||
|
||||
// i == 27 ||
|
||||
// i == 28
|
||||
// ) {
|
||||
// k = 3 + inde;
|
||||
// } else {
|
||||
// k = 2 + inde;
|
||||
// }
|
||||
// that.tableDatas[i][k] = item.val;
|
||||
// });
|
||||
// });
|
||||
// for (let k = 0; k < 24; k++) {
|
||||
// let m = k + 3;
|
||||
// let n = k + 1;
|
||||
// //石灰石破碎合计
|
||||
|
||||
// that.tableDatas[3][m] = sumNum(
|
||||
// that.tableDatas[0][m],
|
||||
// that.tableDatas[1][m],
|
||||
// that.tableDatas[2][m]
|
||||
// );
|
||||
// //辊压机
|
||||
// // that.tableDatas[5][m] = sumNum();
|
||||
// //原料磨系统合计
|
||||
// that.tableDatas[8][m] =
|
||||
// sumNum(
|
||||
// that.tableDatas[4][m],
|
||||
// // that.tableDatas[5][m],
|
||||
// that.tableDatas[6][m],
|
||||
// that.tableDatas[7][m]
|
||||
// ) -
|
||||
// sumNum(
|
||||
// that.tableDatas[1][m],
|
||||
// that.tableDatas[2][m]
|
||||
// );
|
||||
// //低压变压器柜
|
||||
// // that.tableDatas[12][m] = sumNum(
|
||||
// // that.tableDatas[9][m],
|
||||
// // that.tableDatas[10][m],
|
||||
// // that.tableDatas[11][m]
|
||||
// // );
|
||||
// //回转窑烧成系统合计
|
||||
// that.tableDatas[13][m] =
|
||||
// typeof that.tableDatas[12][m] !== "undefined"
|
||||
// ? sumNum(
|
||||
// that.tableDatas[9][m],
|
||||
// that.tableDatas[10][m],
|
||||
// that.tableDatas[11][m],
|
||||
// that.tableDatas[12][m]
|
||||
// )
|
||||
// : sumNum(
|
||||
// that.tableDatas[9][m],
|
||||
// that.tableDatas[10][m],
|
||||
// that.tableDatas[11][m]
|
||||
// );
|
||||
// //煤磨系统合计
|
||||
// let sum17 = sumNum(
|
||||
// that.tableDatas[14][m],
|
||||
// that.tableDatas[15][m],
|
||||
// that.tableDatas[16][m]
|
||||
// );
|
||||
// that.tableDatas[17][m] =
|
||||
// typeof that.tableDatas[21][m] !== "undefined"
|
||||
// ? sum17 - that.tableDatas[21][m]
|
||||
// : sum17;
|
||||
// //余热供电量
|
||||
// that.tableDatas[20][m] =
|
||||
// typeof that.tableDatas[19][m] !== "undefined"
|
||||
// ? that.tableDatas[18][m] -
|
||||
// that.tableDatas[19][m]
|
||||
// : that.tableDatas[18][m];
|
||||
// //空压机合计
|
||||
// that.tableDatas[25][m] = sumNum(
|
||||
// that.tableDatas[21][m],
|
||||
// that.tableDatas[22][m],
|
||||
// that.tableDatas[23][m],
|
||||
// that.tableDatas[24][m]
|
||||
// );
|
||||
// //生产部分总耗电
|
||||
// that.tableDatas[27][m] = sumNum(
|
||||
// that.tableDatas[3][m],
|
||||
// that.tableDatas[8][m],
|
||||
// that.tableDatas[13][m],
|
||||
// that.tableDatas[17][m],
|
||||
// that.tableDatas[18][m],
|
||||
// that.tableDatas[25][m],
|
||||
// that.tableDatas[26][m]
|
||||
// );
|
||||
// //全厂耗电量
|
||||
// // that.tableDatas[28][m] = sumNum(
|
||||
// // that.tableDatas[27][m],
|
||||
// // that.tableDatas[26][m]
|
||||
// // );
|
||||
// }
|
||||
// that.tableDatas.forEach((inner, inde) => {
|
||||
// let sum27 = 0;
|
||||
// inner.forEach((num, ind) => {
|
||||
// if (ind > 2 && ind < 27) {
|
||||
// sum27 = sum27 + Number(num);
|
||||
// }
|
||||
// });
|
||||
// inner[27] = sum27;
|
||||
// });
|
||||
// })
|
||||
// .then(() => {});
|
||||
// },
|
||||
getHourData() {
|
||||
let that = this;
|
||||
let m = 0;
|
||||
|
|
|
@ -302,10 +302,16 @@ export default {
|
|||
obj.page = 0;
|
||||
this.$API.enm.mpoint.stat.req(obj).then((res) => {
|
||||
console.log(res);
|
||||
let sum = 0;
|
||||
res.forEach((item) => {
|
||||
let ind = item.month + 2;
|
||||
that.tableDatas[index][ind] = item.val;
|
||||
sum += Number(item.val);
|
||||
});
|
||||
sum = sum * 100;
|
||||
sum = Math.round(sum);
|
||||
sum = sum / 100;
|
||||
that.tableDatas[index][15] = sum.toFixed(2);
|
||||
that.$forceUpdate();
|
||||
});
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue