This commit is contained in:
shijing 2025-01-07 16:11:05 +08:00
commit 4b02b7c00f
5 changed files with 109 additions and 53 deletions

View File

@ -39,7 +39,7 @@
<thead class="myTableHead">
<tr>
<th colspan="9">
磨分布电耗月度分析表
磨分布电耗月度分析表
</th>
</tr>
<tr>
@ -135,35 +135,37 @@ export default {
try{
var res = await this.$API.mtm.mgroup.list.req({ page: 0, search: "煤磨" });
that.query.mgroup = res[0].id;
this.getMonthGoal();
}catch(e){
this.$message.error("获取工段失败");
}
//
let paramsGoal = {};
let monthGoal = [];
paramsGoal.page = 0;
paramsGoal.mgroup = that.query.mgroup;
paramsGoal.goal_cate__code = "elec_consume_unit";
var ress = await that.$API.mtm.goal.list.req(paramsGoal);
if (ress.length > 0) {
// let paramsGoal = {};
// let monthGoal = [];
// paramsGoal.page = 0;
// paramsGoal.year_s = that.query.year_s;
// paramsGoal.mgroup = that.query.mgroup;
// paramsGoal.goal_cate__code = "elec_consume_unit";
// var ress = await that.$API.mtm.goal.list.req(paramsGoal);
// if (ress.length > 0) {
ress.forEach((goal) => {
monthGoal[0] = goal.goal_val;
monthGoal[1] = goal.goal_val_1;
monthGoal[2] = goal.goal_val_2;
monthGoal[3] = goal.goal_val_3;
monthGoal[4] = goal.goal_val_4;
monthGoal[5] = goal.goal_val_5;
monthGoal[6] = goal.goal_val_6;
monthGoal[7] = goal.goal_val_7;
monthGoal[8] = goal.goal_val_8;
monthGoal[9] = goal.goal_val_9;
monthGoal[10] = goal.goal_val_10;
monthGoal[11] = goal.goal_val_11;
monthGoal[12] = goal.goal_val_12;
});
}
this.getData(monthGoal);
// ress.forEach((goal) => {
// monthGoal[0] = goal.goal_val;
// monthGoal[1] = goal.goal_val_1;
// monthGoal[2] = goal.goal_val_2;
// monthGoal[3] = goal.goal_val_3;
// monthGoal[4] = goal.goal_val_4;
// monthGoal[5] = goal.goal_val_5;
// monthGoal[6] = goal.goal_val_6;
// monthGoal[7] = goal.goal_val_7;
// monthGoal[8] = goal.goal_val_8;
// monthGoal[9] = goal.goal_val_9;
// monthGoal[10] = goal.goal_val_10;
// monthGoal[11] = goal.goal_val_11;
// monthGoal[12] = goal.goal_val_12;
// });
// }
// this.getData(monthGoal);
},
methods: {
// Class
@ -183,6 +185,41 @@ export default {
}
return classInfo;
},
getMonthGoal() {
//
let that = this;
let paramsGoal = {};
let monthGoal = [];
paramsGoal.page = 0;
paramsGoal.year = that.query.year_s;
paramsGoal.mgroup = that.query.mgroup;
// paramsGoal.goal_cate__code = "elec_consume_unit";
that.$API.mtm.goal.list.req(paramsGoal).then((ress) => {
if (ress.length > 0) {
ress.forEach((goal) => {
if (
goal.goal_cate_name == "单位产品分布电耗kW·h/t"
){
monthGoal[0] = goal.goal_val;
monthGoal[1] = goal.goal_val_1;
monthGoal[2] = goal.goal_val_2;
monthGoal[3] = goal.goal_val_3;
monthGoal[4] = goal.goal_val_4;
monthGoal[5] = goal.goal_val_5;
monthGoal[6] = goal.goal_val_6;
monthGoal[7] = goal.goal_val_7;
monthGoal[8] = goal.goal_val_8;
monthGoal[9] = goal.goal_val_9;
monthGoal[10] = goal.goal_val_10;
monthGoal[11] = goal.goal_val_11;
monthGoal[12] = goal.goal_val_12;}
});
}
this.getData(monthGoal);
})
},
precen(a, b) {
if (b !== 0 && b !== null && a !== null) {
let precen = (a / b)* 100;
@ -336,7 +373,10 @@ export default {
this.$message.success("修改成功");
}
)
}
},
handleQuery() {
this.getMonthGoal();
},
},
};
</script>

View File

@ -244,7 +244,7 @@
</div>
</template>
<script>
const colors = ["#5b9bd5", "#cbd3fe", "#91CC75", "#EE6666", "#CC00CC", "#7DDA58"];
const colors = ["#5b9bd5", "#cbd3fe", "#91CC75", "#EE6666", "#CC00CC", "#7DDA58", "#BCB69D"];
let tooltip = {
show: true,
trigger: "axis",
@ -434,7 +434,7 @@ export default {
option2: {
color: colors,
tooltip: tooltip,
legend: Object.assign(legend, {data:["袋装合计", "散装合计", "熟料出厂合计", "出厂水泥合计", "复合水泥合计", "分布电耗目标值"]}),
legend: Object.assign(legend, {data:["袋装合计", "散装合计", "熟料出厂合计", "出厂水泥合计", "复合水泥合计", "分布电耗目标值","分布电耗"]}),
grid: grid,
toolbox: toolbox,
xAxis: {
@ -496,6 +496,12 @@ export default {
yAxisIndex: 0,
data: [],
},
{
name: "分布电耗",
type: "bar",
yAxisIndex: 0,
data: [],
},
],
},
};
@ -808,7 +814,8 @@ export default {
seriesData3 = [],
seriesData4 = [],
seriesData5 = [],
seriesData6 = [];
seriesData6 = [],
seriesData7 = [];
let data = response;
data.forEach((item) => {
@ -825,6 +832,8 @@ export default {
}else if (item.mpoint_name == "复合水泥合计" || item.mpoint_name == "复合硅酸盐水泥;42.5R;袋装水泥") {
console.log(item.mpoint_name, item.val);
seriesData5[ind] = item.val;
}else if(item.mpoint_name == "包装进线"){
seriesData7[ind] = item.elec_consume_unit;
}
seriesData6[ind] = that.goal_list[0][goal_index];
});
@ -835,6 +844,7 @@ export default {
options.series[3].data = seriesData4;
options.series[4].data = seriesData5;
options.series[5].data = seriesData6;
options.series[6].data = seriesData7;
let monthXAxis = [];
if (year < that.year){

View File

@ -115,6 +115,7 @@ export default {
// self.data = res[1];
// console.log("", self.data);
// }
console.log(res,'----------res');
self.getData(res[1]);
})
.catch((error) => {
@ -143,9 +144,8 @@ export default {
wrapArr0[month].push(item0);
});
} else {}
});
this.$API.enm.enstat.req(that.query).then((res) => {
}).then(() => {
this.$API.enm.enstat.req(that.query).then((res) => {
let data = res;
if (data.length > 0) {
data.forEach((item) => {
@ -178,13 +178,17 @@ export default {
arr.push(item.total_production);
arr[3] = item.elec_consume_unit; //kW·h/t
let keyVale = "goal_val_" + n;
let keyVale = '';
if (n==1){
keyVale = "goal_val_" + 12;
}else{
keyVale = "goal_val_" + n;
}
if (goalData && goalData[keyVale]){
arr[4] = goalData[keyVale].goal_val_1;
}else{arr[4] = 0; //
}
arr[4] = goalData[keyVale];
}else{
arr[4] = 0; //
}
arr[5] = (arr[3] - arr[4]).toFixed(2); //kW·h/t
let ind_pre = 0,
huanbi = 0;
@ -267,6 +271,8 @@ export default {
} else {
}
});
});
},
handleQuery() {
this.tableDatas = [];

View File

@ -141,7 +141,7 @@ export default {
that.query.mgroup = res[0].id;
//
that.getMonthGoal();
that.getData();
});
},
methods: {
@ -166,8 +166,11 @@ export default {
getMonthGoal() {
let that = this;
let paramsGoal = {};
let monthGoal = [];
paramsGoal.page = 0;
paramsGoal.year = that.query.year_s;
paramsGoal.mgroup = that.query.mgroup;
console.log("paramsGoal", paramsGoal);
that.$API.mtm.goal.list.req(paramsGoal).then((ress) => {
if (ress.length > 0) {
let monthGoal = [];
@ -188,15 +191,14 @@ export default {
monthGoal[10] = goal.goal_val_10;
monthGoal[11] = goal.goal_val_11;
monthGoal[12] = goal.goal_val_12;
that.monthGoal = monthGoal;
}
that.getData(monthGoal);
});
} else {
this.getData();
}
});
},
getData() {
getData(monthGoal) {
let that = this;
let query0 = {};
query0.page = 0;
@ -231,8 +233,8 @@ export default {
arr.push(time);
arr.push(item.elec_consume_unit); //kW·h/t
arr[2] =
that.monthGoal[ind] !== undefined
? that.monthGoal[ind]
monthGoal[ind] !== undefined
? monthGoal[ind]
: "/";
arr[3] = item.note;
arr[4] = item.id;

View File

@ -136,7 +136,6 @@ export default {
that.$API.mtm.mgroup.list
.req({ page: 0, name: "生料工序(二次配料)" })
.then((res) => {
console.log("原料磨", res);
that.query.mgroup = res[0].id;
//
that.getMonthGoal();
@ -167,6 +166,7 @@ export default {
let paramsGoal = {};
paramsGoal.page = 0;
paramsGoal.mgroup = that.query.mgroup;
paramsGoal.year = that.query.year_s;
that.$API.mtm.goal.list.req(paramsGoal).then((ress) => {
if (ress.length > 0) {
let monthGoal = [];
@ -187,20 +187,18 @@ export default {
monthGoal[10] = goal.goal_val_10;
monthGoal[11] = goal.goal_val_11;
monthGoal[12] = goal.goal_val_12;
that.monthGoal = monthGoal;
}
this.getData(monthGoal);
});
} else {
this.getData();
}
});
},
getData() {
getData(monthGoal) {
let that = this;
let query0 = {};
query0.page = 0;
query0.type = "month_s";
query0.year_s = that.query.year_s - 1;
query0.year = that.query.year_s - 1;
query0.mgroup = that.query.mgroup;
let wrapArr = [],
wrapArr0 = [],
@ -230,8 +228,8 @@ export default {
arr.push(time);
arr.push(item.elec_consume_unit); //kW·h/t
arr[2] =
that.monthGoal[ind] !== undefined
? that.monthGoal[ind]
monthGoal[ind] !== undefined
? monthGoal[ind]
: "/";
arr[3] = item.note;
arr[4] = item.id;