fix:tkx电石渣工序班组月度对比修改

This commit is contained in:
shijing 2024-12-30 09:59:16 +08:00
parent 4bad854f10
commit 11d38f5508
1 changed files with 123 additions and 145 deletions

View File

@ -95,23 +95,10 @@ export default {
let year = myDate.getFullYear(); let year = myDate.getFullYear();
this.timeStamp = myDate.getTime(); this.timeStamp = myDate.getTime();
that.query.year_s = year; that.query.year_s = year;
this.$API.mtm.mgroup.list this.$API.mtm.mgroup.list.req({ page: 0, search: "电石渣" }).then((res) => {
.req({ page: 0, search: "电石渣" }) console.log("工段数据:", res);
.then((res) => {
that.query.mgroup = res[0].id; that.query.mgroup = res[0].id;
let params = {}; that.getGoalData();
params.page = 0;
params.year = year;
params.mgroup = that.query.mgroup;
this.$API.mtm.goal.list.req(params).then((res) => {
if (res.length > 0) {
res.forEach((item) => {
if (item.goal_cate_name == "单位产品分布电耗KW·h/t") {
that.getData(item);
}
})
}
});
}); });
}, },
methods: { methods: {
@ -121,16 +108,16 @@ export default {
params.page = 0; params.page = 0;
params.year = self.query.year_s; params.year = self.query.year_s;
params.mgroup = self.query.mgroup; params.mgroup = self.query.mgroup;
this.$API.mtm.goal.list.req(params).then((res) => { self.$API.mtm.goal.list.req(params).then((res) => {
if (res.length > 0) { if (res.length > 0) {
res.forEach((item) => { res.forEach((item) => {
if (item.goal_cate_name == "单位产品分布电耗KW·h/t") { if (item.goal_cate_name == "单位产品分布电耗kW·h/t") {
this.getData(item); console.log("目标数据:", item);
self.getData(item);
} }
}) })
} }
}) }).catch((error) => {
.catch((error) => {
console.error('获取目标数据失败:', error); console.error('获取目标数据失败:', error);
}); });
}, },
@ -193,7 +180,6 @@ export default {
arr[6] = (arr[4] - arr[5]).toFixed(2); //KW·h/t arr[6] = (arr[4] - arr[5]).toFixed(2); //KW·h/t
let ind_pre = 0, let ind_pre = 0,
huanqi = 0, huanqi = 0,
huanqicha = 0,
tongqi = 0, tongqi = 0,
tongqicha = 0; tongqicha = 0;
if (n == 1) { if (n == 1) {
@ -209,16 +195,15 @@ export default {
} }
}) })
} }
arr[7] = huanqi; //KW·h/t arr[7] = Number(huanqi); //KW·h/t
if (arr[6] !== "/"){ if (arr[6] !== "/"){
arr[8] = (arr[4] - arr[7]).toFixed(2); //KW·h/t arr[8] = (Number(arr[4]) - arr[7]).toFixed(2); //KW·h/t
}else{ }else{
arr[8] = "/"; //KW·h/t arr[8] = "/"; //KW·h/t
} }
// arr[8] = huanqicha; //KW·h/t
let growthRate = 0; let growthRate = 0;
if (arr[8]!== "/" && arr[7]!== 0 && arr[8]!== 0 ) { if (arr[8]!== "/" && arr[7]!== 0 && arr[8]!== 0 ) {
growthRate = ((arr[8] / arr[7]) * 100).toFixed(2); growthRate = ((Number(arr[8]) /arr[7]) * 100).toFixed(2);
} else{ } else{
growthRate = "/"; growthRate = "/";
} }
@ -278,13 +263,6 @@ export default {
this.type = type; this.type = type;
this.asynDialog = true; this.asynDialog = true;
}, },
itemClick1(type, item) {
this.chartShow = false;
this.$API.bi.dataset.exec.req("3322567213885833216").then((res) => {
this.myOption = JSON.parse(res.echart_options);
this.chartShow = true;
});
},
handlePrint() { handlePrint() {
this.$PRINT("#myReport"); this.$PRINT("#myReport");
}, },