feat: 煤磨获取目标值错误
This commit is contained in:
parent
24e3a51c1f
commit
07b336e0c6
|
|
@ -126,47 +126,42 @@ export default {
|
|||
asynDialog: false,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
async mounted() {
|
||||
let that = this;
|
||||
var myDate = new Date();
|
||||
let year = myDate.getFullYear();
|
||||
that.query.year_s = year;
|
||||
try{
|
||||
var res = await this.$API.mtm.mgroup.list.req({ page: 0, search: "煤磨" });
|
||||
that.query.mgroup = res[0].id;
|
||||
}catch(e){
|
||||
this.$message.error("获取工段失败");
|
||||
}
|
||||
//月目标
|
||||
let paramsGoal = {};
|
||||
paramsGoal.page = 0;
|
||||
paramsGoal.mgroup = that.query.mgroup;
|
||||
that.$API.mtm.goal.list.req(paramsGoal).then((ress) => {
|
||||
if (ress.length > 0) {
|
||||
paramsGoal.goal_cate__code = "elec_consume_unit";
|
||||
var ress = await that.$API.mtm.goal.list.req(paramsGoal);
|
||||
if (ress.length > 0) {
|
||||
let monthGoal = [];
|
||||
ress.forEach((goal) => {
|
||||
if (goal.goal_cate_name == "单位产品分布电耗(kW·h/t)") {
|
||||
monthGoal[0] = goal.goal_val;
|
||||
monthGoal[1] = goal.goal_val_2;
|
||||
monthGoal[2] = goal.goal_val_3;
|
||||
monthGoal[3] = goal.goal_val_4;
|
||||
monthGoal[4] = goal.goal_val_5;
|
||||
monthGoal[5] = goal.goal_val_6;
|
||||
monthGoal[6] = goal.goal_val_7;
|
||||
monthGoal[7] = goal.goal_val_8;
|
||||
monthGoal[8] = goal.goal_val_9;
|
||||
monthGoal[9] = goal.goal_val_10;
|
||||
monthGoal[10] = goal.goal_val_11;
|
||||
monthGoal[11] = goal.goal_val_12;
|
||||
monthGoal[12] = goal.goal_val_12;
|
||||
that.monthGoal = monthGoal;
|
||||
}
|
||||
monthGoal[0] = goal.goal_val;
|
||||
monthGoal[1] = goal.goal_val_2;
|
||||
monthGoal[2] = goal.goal_val_3;
|
||||
monthGoal[3] = goal.goal_val_4;
|
||||
monthGoal[4] = goal.goal_val_5;
|
||||
monthGoal[5] = goal.goal_val_6;
|
||||
monthGoal[6] = goal.goal_val_7;
|
||||
monthGoal[7] = goal.goal_val_8;
|
||||
monthGoal[8] = goal.goal_val_9;
|
||||
monthGoal[9] = goal.goal_val_10;
|
||||
monthGoal[10] = goal.goal_val_11;
|
||||
monthGoal[11] = goal.goal_val_12;
|
||||
monthGoal[12] = goal.goal_val_12;
|
||||
});
|
||||
} else {
|
||||
this.getData();
|
||||
}
|
||||
});
|
||||
this.$API.mtm.mgroup.list
|
||||
.req({ page: 0, search: "煤磨" })
|
||||
.then((res) => {
|
||||
console.log("煤磨", res);
|
||||
that.query.mgroup = res[0].id;
|
||||
this.getData();
|
||||
});
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
// 动态绑定Class
|
||||
|
|
|
|||
Loading…
Reference in New Issue