fix:余热发电mgroup根据name获取
This commit is contained in:
parent
93f058997a
commit
4188ad2a8b
|
@ -247,17 +247,17 @@ export default {
|
|||
name: "sflog",
|
||||
data() {
|
||||
return {
|
||||
apiObj: this.$API.wpm.sflog.list,
|
||||
apiObj: null,
|
||||
apiObj2: null,
|
||||
query: {
|
||||
shift: "",
|
||||
team: "",
|
||||
end_time__lt: "",
|
||||
start_time__gte: "",
|
||||
mgroup: "3347217246321065984",
|
||||
mgroup: "",
|
||||
},
|
||||
|
||||
deptId: "3347207082608115712",
|
||||
deptId: "",
|
||||
sflogItem: {},
|
||||
options: [],
|
||||
optionsShift: [],
|
||||
|
@ -267,8 +267,16 @@ export default {
|
|||
};
|
||||
},
|
||||
mounted() {
|
||||
this.$API.mtm.mgroup.list
|
||||
.req({ page: 0, search: "余热发电" })
|
||||
.then((res) => {
|
||||
console.log("余热发电", res);
|
||||
this.query.mgroup = res[0].id;
|
||||
this.apiObj = this.$API.wpm.sflog.list;
|
||||
this.deptId = res[0].belong_dept;
|
||||
this.getTeam();
|
||||
this.getShfit();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
getTeam() {
|
||||
|
|
|
@ -332,7 +332,9 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
timeStamp: null,
|
||||
chartShow: false,
|
||||
exportLoading: false,
|
||||
myOption: null,
|
||||
optionHour: {},
|
||||
optionDay: {},
|
||||
|
@ -536,6 +538,7 @@ export default {
|
|||
let days = (that.days = myDate.getDate());
|
||||
let hours = (that.hours = myDate.getHours());
|
||||
let timeDate = myDate.getTime();
|
||||
that.timeStamp = timeDate;
|
||||
let dayTime = 24 * 60 * 60 * 1000;
|
||||
//昨天的计算
|
||||
let year_d = year,
|
||||
|
@ -556,6 +559,11 @@ export default {
|
|||
let month_h = hourDate.getMonth() + 1;
|
||||
let days_h = hourDate.getDate();
|
||||
let hours_h = hourDate.getHours();
|
||||
this.$API.mtm.mgroup.list
|
||||
.req({ page: 0, search: "余热发电" })
|
||||
.then((res) => {
|
||||
console.log("余热发电", res);
|
||||
that.query.mgroup = res[0].id;
|
||||
//昨日
|
||||
let params3 = {};
|
||||
params3.page = 0;
|
||||
|
@ -571,11 +579,7 @@ export default {
|
|||
that.tableDatas[1][3] = data3.production_hour;
|
||||
that.tableDatas[2][3] = data3.run_hour;
|
||||
that.tableDatas[3][3] = data3.run_rate;
|
||||
that.tableDatas[4][3] = data3.elec_consume_unit;
|
||||
that.tableDatas[5][3] = data3.celec_consume_unit;
|
||||
that.tableDatas[6][3] = data3.coal_consume_unit;
|
||||
that.tableDatas[7][3] = data3.cen_consume_unit;
|
||||
that.tableDatas[8][3] = data3.production_cost_unit;
|
||||
that.tableDatas[4][3] = data3.elec_coast;
|
||||
}
|
||||
});
|
||||
//上小时
|
||||
|
@ -591,16 +595,12 @@ export default {
|
|||
if (res4.length > 0) {
|
||||
let data4 = res4[0];
|
||||
that.tableDatas[0][2] = data4.total_production;
|
||||
that.tableDatas[4][2] = data4.elec_consume_unit;
|
||||
that.tableDatas[5][2] = data4.celec_consume_unit;
|
||||
that.tableDatas[6][2] = data4.coal_consume_unit;
|
||||
that.tableDatas[7][2] = data4.cen_consume_unit;
|
||||
that.tableDatas[8][2] = data4.production_cost_unit;
|
||||
that.tableDatas[4][2] = data4.elec_coast;
|
||||
}
|
||||
});
|
||||
let params5 = {};
|
||||
params5.page = 0;
|
||||
params5.mgroup = "3346520558031773696";
|
||||
params5.mgroup = this.query.mgroup;
|
||||
this.$API.mtm.goal.list
|
||||
.req(params5)
|
||||
.then((res5) => {
|
||||
|
@ -608,43 +608,32 @@ export default {
|
|||
let data5 = res5;
|
||||
data5.forEach((item5) => {
|
||||
let str = "goal_val_" + that.month;
|
||||
if (item5.goal_cate_name == "总产量(t)") {
|
||||
if (
|
||||
item5.goal_cate_name == "总发电量(KW·h/t)"
|
||||
) {
|
||||
that.tableDatas[0][6] = item5[str];
|
||||
that.tableDatas[0][8] = item5.goal_val;
|
||||
} else if (item5.goal_cate_name == "台时产量(t/h)") {
|
||||
} else if (
|
||||
item5.goal_cate_name ==
|
||||
"单位发电量(KW·h/t)"
|
||||
) {
|
||||
that.tableDatas[1][6] = item5[str];
|
||||
that.tableDatas[1][8] = item5.goal_val;
|
||||
} else if (item5.goal_cate_name == "运转时间(h)") {
|
||||
} else if (
|
||||
item5.goal_cate_name == "运转时间(h)"
|
||||
) {
|
||||
that.tableDatas[2][6] = item5[str];
|
||||
that.tableDatas[2][8] = item5.goal_val;
|
||||
} else if (item5.goal_cate_name == "运转率(%)") {
|
||||
} else if (
|
||||
item5.goal_cate_name == "运转率(%)"
|
||||
) {
|
||||
that.tableDatas[3][6] = item5[str];
|
||||
that.tableDatas[3][8] = item5.goal_val;
|
||||
} else if (
|
||||
item5.goal_cate_name == "单位产品分布电耗(KW·h/t)"
|
||||
item5.goal_cate_name == "用电量(KW·h)"
|
||||
) {
|
||||
that.tableDatas[4][6] = item5[str];
|
||||
that.tableDatas[4][8] = item5.goal_val;
|
||||
} else if (
|
||||
item5.goal_cate_name == "单位产品综合电耗(KW·h/t)"
|
||||
) {
|
||||
that.tableDatas[5][6] = item5[str];
|
||||
that.tableDatas[5][8] = item5.goal_val;
|
||||
} else if (
|
||||
item5.goal_cate_name == "单位产品标煤耗(kgce/t)"
|
||||
) {
|
||||
that.tableDatas[6][6] = item5[str];
|
||||
that.tableDatas[6][8] = item5.goal_val;
|
||||
} else if (
|
||||
item5.goal_cate_name == "单位产品综合能耗(kgce/t)"
|
||||
) {
|
||||
that.tableDatas[7][6] = item5[str];
|
||||
that.tableDatas[7][8] = item5.goal_val;
|
||||
} else if (
|
||||
item5.goal_cate_name == "单位产品成本(元/吨)"
|
||||
) {
|
||||
that.tableDatas[8][6] = item5[str];
|
||||
that.tableDatas[8][8] = item5.goal_val;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -679,31 +668,11 @@ export default {
|
|||
that.tableDatas[3][5],
|
||||
that.tableDatas[3][8]
|
||||
);
|
||||
that.tableDatas[4][5] = data1.elec_consume_unit;
|
||||
that.tableDatas[4][5] = data1.elec_coast;
|
||||
that.tableDatas[4][9] = precen(
|
||||
that.tableDatas[4][5],
|
||||
that.tableDatas[4][8]
|
||||
);
|
||||
that.tableDatas[5][5] = data1.celec_consume_unit;
|
||||
that.tableDatas[5][9] = precen(
|
||||
that.tableDatas[5][5],
|
||||
that.tableDatas[5][8]
|
||||
);
|
||||
that.tableDatas[6][5] = data1.coal_consume_unit;
|
||||
that.tableDatas[6][9] = precen(
|
||||
that.tableDatas[6][5],
|
||||
that.tableDatas[6][8]
|
||||
);
|
||||
that.tableDatas[7][5] = data1.cen_consume_unit;
|
||||
that.tableDatas[7][9] = precen(
|
||||
that.tableDatas[7][5],
|
||||
that.tableDatas[7][8]
|
||||
);
|
||||
that.tableDatas[8][5] = data1.production_cost_unit;
|
||||
that.tableDatas[8][9] = precen(
|
||||
that.tableDatas[8][5],
|
||||
that.tableDatas[8][8]
|
||||
);
|
||||
} else {
|
||||
}
|
||||
});
|
||||
|
@ -737,37 +706,18 @@ export default {
|
|||
that.tableDatas[3][4],
|
||||
that.tableDatas[3][6]
|
||||
);
|
||||
that.tableDatas[4][4] = data2.elec_consume_unit;
|
||||
that.tableDatas[4][4] = data2.elec_coast;
|
||||
that.tableDatas[4][7] = precen(
|
||||
that.tableDatas[4][4],
|
||||
that.tableDatas[4][6]
|
||||
);
|
||||
that.tableDatas[5][4] = data2.celec_consume_unit;
|
||||
that.tableDatas[5][7] = precen(
|
||||
that.tableDatas[5][4],
|
||||
that.tableDatas[5][6]
|
||||
);
|
||||
that.tableDatas[6][4] = data2.coal_consume_unit;
|
||||
that.tableDatas[6][7] = precen(
|
||||
that.tableDatas[6][4],
|
||||
that.tableDatas[6][6]
|
||||
);
|
||||
that.tableDatas[7][4] = data2.cen_consume_unit;
|
||||
that.tableDatas[7][7] = precen(
|
||||
that.tableDatas[7][4],
|
||||
that.tableDatas[7][6]
|
||||
);
|
||||
that.tableDatas[8][4] = data2.production_cost_unit;
|
||||
that.tableDatas[8][7] = precen(
|
||||
that.tableDatas[8][4],
|
||||
that.tableDatas[8][6]
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
that.getHourData();
|
||||
that.getDayData();
|
||||
that.getMonthData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
//获取小时数据
|
||||
|
|
|
@ -85,9 +85,10 @@ export default {
|
|||
year_s: "",
|
||||
page: 0,
|
||||
type: "month_st",
|
||||
mgroup: "3347217246321065984",
|
||||
mgroup: "",
|
||||
},
|
||||
tableDatas: [],
|
||||
exportLoading: false,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
@ -95,7 +96,13 @@ export default {
|
|||
var myDate = new Date();
|
||||
let year = myDate.getFullYear();
|
||||
that.query.year_s = year;
|
||||
this.$API.mtm.mgroup.list
|
||||
.req({ page: 0, search: "余热发电" })
|
||||
.then((res) => {
|
||||
console.log("余热发电", res);
|
||||
that.query.mgroup = res[0].id;
|
||||
this.getData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
|
@ -104,7 +111,7 @@ export default {
|
|||
query0.page = 0;
|
||||
query0.type = "month_st";
|
||||
query0.year_s = that.query.year_s - 1;
|
||||
query0.mgroup = "3347217246321065984";
|
||||
query0.mgroup = that.query.mgroup;
|
||||
let wrapArr = [],
|
||||
wrapArr0 = [],
|
||||
wrapArrs = [];
|
||||
|
@ -116,6 +123,7 @@ export default {
|
|||
//先按月份排序,再按班组排序
|
||||
let n0 = item0.month_s;
|
||||
let ind0 = 0;
|
||||
let team_name0 = item0.team_name;
|
||||
if (team_name0.indexOf("甲") > -1) {
|
||||
ind0 = (n0 - 1) * 3;
|
||||
} else if (team_name0.indexOf("乙") > -1) {
|
||||
|
@ -152,7 +160,7 @@ export default {
|
|||
arr.push(item.total_production);
|
||||
arr.push(item.production_hour);
|
||||
arr.push(item.run_rate);
|
||||
//煤耗
|
||||
//发电量
|
||||
arr[5] = item.elec_consume_unit; //当期值(KW·h/t)
|
||||
arr[6] = item.celec_consume_unit; //目标值(KW·h/t)//需要接口获取
|
||||
arr[7] = item.celec_consume_unit; //当期与目标差值(KW·h/t)
|
||||
|
@ -175,51 +183,6 @@ export default {
|
|||
arr[9] = item.celec_consume_unit; //当期与环期差值(KW·h/t)
|
||||
arr[10] = item.celec_consume_unit; //环比增长率(%)
|
||||
arr[11] = item.celec_consume_unit; //同比增长率(%)
|
||||
//电耗
|
||||
//设备
|
||||
arr[12] =
|
||||
item.高温风机_consume_unit != null
|
||||
? item.高温风机_consume_unit
|
||||
: "/";
|
||||
arr[13] =
|
||||
item.篦冷机一室风机_consume_unit != null
|
||||
? item.篦冷机一室风机_consume_unit
|
||||
: "/";
|
||||
arr[14] =
|
||||
item.篦冷机三室风机_consume_unit != null
|
||||
? item.篦冷机三室风机_consume_unit
|
||||
: "/";
|
||||
arr[15] =
|
||||
item.篦冷机二室风机_consume_unit != null
|
||||
? item.篦冷机二室风机_consume_unit
|
||||
: "/";
|
||||
arr[16] =
|
||||
item.窑头排风机_consume_unit != null
|
||||
? item.窑头排风机_consume_unit
|
||||
: "/";
|
||||
arr[17] = item.elec_consume_unit; //当期值(KW·h/t)
|
||||
arr[18] = item.celec_consume_unit; //目标值(KW·h/t)//需要接口获取
|
||||
arr[19] = item.celec_consume_unit; //当期与目标差值(KW·h/t)
|
||||
let ind_pre1 = 0,
|
||||
huanbi1 = 0;
|
||||
if (item.month_s == 1) {
|
||||
ind_pre1 = 12;
|
||||
huanbi1 = wrapArr0[ind_pre]
|
||||
? wrapArr0[ind_pre].elec_consume_unit
|
||||
: "/";
|
||||
} else {
|
||||
ind_pre1 = ind - 1;
|
||||
huanbi1 = wrapArr[ind_pre]
|
||||
? wrapArr[ind_pre].elec_consume_unit
|
||||
? wrapArr[ind_pre].elec_consume_unit
|
||||
: "/"
|
||||
: "/";
|
||||
}
|
||||
arr[20] = huanbi; //环期值(KW·h/t)上个月的值
|
||||
arr[21] = item.celec_consume_unit; //当期与环期差值(KW·h/t)
|
||||
arr[22] = item.celec_consume_unit; //环比增长率(%)
|
||||
arr[23] = item.celec_consume_unit; //同比增长率(%)
|
||||
arr[24] = item.celec_consume_unit; //同比增长率(%)
|
||||
wrapArr[ind] = arr;
|
||||
});
|
||||
console.log(wrapArr);
|
||||
|
|
|
@ -257,12 +257,13 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
exportLoading: false,
|
||||
chartShow: false,
|
||||
myOption: null,
|
||||
query: {
|
||||
type: 1,
|
||||
year_s: "",
|
||||
mgroup: "3347217246321065984",
|
||||
mgroup: "",
|
||||
},
|
||||
monthGoal: [],
|
||||
monthGoal2: [],
|
||||
|
@ -304,7 +305,34 @@ export default {
|
|||
var myDate = new Date();
|
||||
let year = myDate.getFullYear();
|
||||
that.query.year_s = year;
|
||||
that.$API.mtm.mgroup.list
|
||||
.req({ page: 0, search: "余热发电" })
|
||||
.then((res) => {
|
||||
console.log("余热发电", res);
|
||||
that.query.mgroup = res[0].id;
|
||||
that.getMonthGoal();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 动态绑定Class
|
||||
bindClass(item, index) {
|
||||
let classInfo = { redColor: false, greenColor: false };
|
||||
if (index == 3 || index == 5) {
|
||||
if (typeof item == "number") {
|
||||
if (item > 0) {
|
||||
classInfo.greenColor = true;
|
||||
classInfo.redColor = false;
|
||||
} else if (item < 0) {
|
||||
classInfo.redColor = true;
|
||||
classInfo.greenColor = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return classInfo;
|
||||
},
|
||||
//月目标
|
||||
getMonthGoal() {
|
||||
let that = this;
|
||||
let paramsGoal = {};
|
||||
paramsGoal.page = 0;
|
||||
paramsGoal.mgroup = that.query.mgroup;
|
||||
|
@ -315,7 +343,9 @@ export default {
|
|||
monthGoal3 = [],
|
||||
monthGoal4 = [];
|
||||
ress.forEach((goal) => {
|
||||
if (goal.goal_cate_name == "单位产品分布电耗(KW·h/t)") {
|
||||
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;
|
||||
|
@ -331,7 +361,9 @@ export default {
|
|||
monthGoal[12] = goal.goal_val_12;
|
||||
that.monthGoal = monthGoal;
|
||||
}
|
||||
if (goal.goal_cate_name == "单位产品综合电耗(KW·h/t)") {
|
||||
if (
|
||||
goal.goal_cate_name == "单位产品综合电耗(KW·h/t)"
|
||||
) {
|
||||
monthGoal2[0] = goal.goal_val;
|
||||
monthGoal2[1] = goal.goal_val_2;
|
||||
monthGoal2[2] = goal.goal_val_3;
|
||||
|
@ -363,7 +395,9 @@ export default {
|
|||
monthGoal3[12] = goal.goal_val_12;
|
||||
that.monthGoal3 = monthGoal3;
|
||||
}
|
||||
if (goal.goal_cate_name == "单位产品综合能耗(kgce/t)") {
|
||||
if (
|
||||
goal.goal_cate_name == "单位产品综合能耗(kgce/t)"
|
||||
) {
|
||||
monthGoal4[0] = goal.goal_val;
|
||||
monthGoal4[1] = goal.goal_val_2;
|
||||
monthGoal4[2] = goal.goal_val_3;
|
||||
|
@ -380,29 +414,12 @@ export default {
|
|||
that.monthGoal4 = monthGoal4;
|
||||
}
|
||||
});
|
||||
this.getData();
|
||||
that.getData();
|
||||
} else {
|
||||
this.getData();
|
||||
that.getData();
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 动态绑定Class
|
||||
bindClass(item, index) {
|
||||
let classInfo = { redColor: false, greenColor: false };
|
||||
if (index == 3 || index == 5) {
|
||||
if (typeof item == "number") {
|
||||
if (item > 0) {
|
||||
classInfo.greenColor = true;
|
||||
classInfo.redColor = false;
|
||||
} else if (item < 0) {
|
||||
classInfo.redColor = true;
|
||||
classInfo.greenColor = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return classInfo;
|
||||
},
|
||||
getData() {
|
||||
let that = this;
|
||||
let query0 = {};
|
||||
|
@ -893,6 +910,10 @@ export default {
|
|||
this.chartShow = true;
|
||||
});
|
||||
},
|
||||
typeCange() {},
|
||||
handleQuery() {
|
||||
this.getMonthGoal();
|
||||
},
|
||||
handlePrint() {
|
||||
this.$PRINT("#myReport");
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue