fix: tkx/修改 环期值不显示问题
This commit is contained in:
parent
1666728e9e
commit
3324330799
|
@ -946,16 +946,16 @@ const routes = [
|
||||||
},
|
},
|
||||||
component: "enm_energy/value",
|
component: "enm_energy/value",
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
name: "electric",
|
// name: "electric",
|
||||||
path: "/enm_energy/electric",
|
// path: "/enm_energy/electric",
|
||||||
meta: {
|
// meta: {
|
||||||
title: "全厂电量统计",
|
// title: "全厂电量统计",
|
||||||
// icon: "el-icon-grid",
|
// // icon: "el-icon-grid",
|
||||||
perms: ["enm_energy_electric"],
|
// perms: ["enm_energy_electric"],
|
||||||
},
|
// },
|
||||||
component: "enm_energy/electric",
|
// component: "enm_energy/electric",
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
name: "electricHour",
|
name: "electricHour",
|
||||||
path: "/enm_energy/electricHour",
|
path: "/enm_energy/electricHour",
|
||||||
|
|
|
@ -149,6 +149,13 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="计算系数" label-width="90">
|
||||||
|
<el-input-number
|
||||||
|
v-model="form.coefficient"
|
||||||
|
></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
<el-col :md="24" :sm="24">
|
<el-col :md="24" :sm="24">
|
||||||
<el-form-item label="计算公式">
|
<el-form-item label="计算公式">
|
||||||
<el-input
|
<el-input
|
||||||
|
|
|
@ -99,32 +99,22 @@ export default {
|
||||||
//月目标
|
//月目标
|
||||||
let paramsGoal = {};
|
let paramsGoal = {};
|
||||||
paramsGoal.page = 0;
|
paramsGoal.page = 0;
|
||||||
paramsGoal.mgroup = that.query.mgroup;
|
this.$API.mtm.mgroup.list
|
||||||
that.$API.mtm.goal.list.req(paramsGoal).then((ress) => {
|
.req({page:0, search:"煤磨"})
|
||||||
if (ress.length > 0) {
|
.then((res) =>{
|
||||||
let monthGoal = [];
|
that.query.mgroup = res[0].id;
|
||||||
ress.forEach((goal) => {
|
let params = {};
|
||||||
if (goal.goal_cate_name == "单位产品分布电耗(KW·h/t)") {
|
params.page = 0;
|
||||||
monthGoal[0] = goal.goal_val;
|
params.year = year;
|
||||||
monthGoal[1] = goal.goal_val_2;
|
params.mgroup = that.query.mgroup;
|
||||||
monthGoal[2] = goal.goal_val_3;
|
this.$API.mtm.goal.list.req(params).then((res) => {
|
||||||
monthGoal[3] = goal.goal_val_4;
|
let data = [];
|
||||||
monthGoal[4] = goal.goal_val_5;
|
if (res.length > 0) {
|
||||||
monthGoal[5] = goal.goal_val_6;
|
data = res[0];
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
console.log(data);
|
||||||
|
that.getData(data);
|
||||||
});
|
});
|
||||||
this.getData();
|
|
||||||
} else {
|
|
||||||
this.getData();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -181,25 +171,25 @@ export default {
|
||||||
arr.push(item.total_production);
|
arr.push(item.total_production);
|
||||||
arr.push(item.production_hour);
|
arr.push(item.production_hour);
|
||||||
arr.push(item.run_rate);
|
arr.push(item.run_rate);
|
||||||
arr.push(item.production_cost_unit);
|
|
||||||
//质量
|
//质量
|
||||||
arr[6] =
|
arr[5] =
|
||||||
item.煤粉_细度_rate_pass != null
|
item.出磨煤粉_细度_rate_pass !== undefined && item.出磨煤粉_细度_rate_pass !== null
|
||||||
? item.煤粉_细度_rate_pass
|
? item.出磨煤粉_细度_rate_pass
|
||||||
: "/";
|
: "/";
|
||||||
arr[7] =
|
|
||||||
item.煤粉_水分_rate_pass != null
|
arr[6] =
|
||||||
? item.煤粉_水分_rate_pass
|
item.出磨煤粉_水分_rate_pass !== undefined && item.出磨煤粉_水分_rate_pass !== null
|
||||||
|
? item.出磨煤粉_水分_rate_pass
|
||||||
: "/";
|
: "/";
|
||||||
//设备
|
//设备
|
||||||
arr[8] =
|
arr[7] =
|
||||||
item.煤磨排风机_consume_unit != null
|
item.煤磨排风机_consume_unit !== undefined && item.煤磨排风机_consume_unit !== null
|
||||||
? item.煤磨排风机_consume_unit
|
? item.煤磨排风机_consume_unit
|
||||||
: "/";
|
: "/";
|
||||||
let keyVale = "goal_val_" + n;
|
let keyVale = "goal_val_" + n;
|
||||||
arr[9] = item.elec_consume_unit; //当期值(KW·h/t)
|
arr[8] = item.elec_consume_unit; //当期值(KW·h/t)
|
||||||
arr[10] = goalData[keyVale]; //目标值(KW·h/t)//需要接口获取
|
arr[9] = goalData[keyVale]; //目标值(KW·h/t)//需要接口获取
|
||||||
arr[11] = item.celec_consume_unit - arr[10]; //当期与目标差值(KW·h/t)
|
arr[10] = item.celec_consume_unit - arr[9]; //当期与目标差值(KW·h/t)
|
||||||
let ind_pre = 0,
|
let ind_pre = 0,
|
||||||
huanqi = 0,
|
huanqi = 0,
|
||||||
huanqicha = 0,
|
huanqicha = 0,
|
||||||
|
@ -213,19 +203,19 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
ind_pre = n - 1;
|
ind_pre = n - 1;
|
||||||
huanqi = wrapArr[ind_pre]
|
huanqi = wrapArr[ind_pre]
|
||||||
? wrapArr[ind_pre].elec_consume_unit
|
? wrapArr[ind_pre].elec_consume_unit>=0
|
||||||
? wrapArr[ind_pre].elec_consume_unit
|
? wrapArr[ind_pre].elec_consume_unit
|
||||||
: "/"
|
: "/"
|
||||||
: "/";
|
: "/";
|
||||||
}
|
}
|
||||||
arr[12] = huanqi; //环期值(KW·h/t)上个月的值
|
arr[11] = huanqi; //环期值(KW·h/t)上个月的值
|
||||||
if (huanqi !== "/") {
|
if (huanqi !== "/") {
|
||||||
huanqicha = item.celec_consume_unit - huanqi;
|
huanqicha = item.celec_consume_unit - huanqi;
|
||||||
} else {
|
} else {
|
||||||
huanqicha = item.celec_consume_unit;
|
huanqicha = item.celec_consume_unit;
|
||||||
}
|
}
|
||||||
arr[13] = huanqicha; //当期与环期差值(KW·h/t)
|
arr[12] = huanqicha; //当期与环期差值(KW·h/t)
|
||||||
arr[14] =
|
arr[13] =
|
||||||
huanqi != "/" ? (huanqicha / huanqi) * 100 : 0; //环比增长率(%)
|
huanqi != "/" ? (huanqicha / huanqi) * 100 : 0; //环比增长率(%)
|
||||||
if (wrapArr0[n]) {
|
if (wrapArr0[n]) {
|
||||||
tongqicha =
|
tongqicha =
|
||||||
|
@ -236,8 +226,8 @@ export default {
|
||||||
tongqicha = item.celec_consume_unit;
|
tongqicha = item.celec_consume_unit;
|
||||||
tongqi = 0;
|
tongqi = 0;
|
||||||
}
|
}
|
||||||
arr[15] = tongqi; //同比增长率(%)
|
arr[14] = tongqi; //同比增长率(%)
|
||||||
arr[16] = 0; //同比增长率(%)
|
arr[15] = 0.0; //得分
|
||||||
wrapArr[ind] = arr;
|
wrapArr[ind] = arr;
|
||||||
});
|
});
|
||||||
console.log(wrapArr);
|
console.log(wrapArr);
|
||||||
|
|
|
@ -142,11 +142,17 @@ export default {
|
||||||
that.monthGoal = monthGoal;
|
that.monthGoal = monthGoal;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.getData();
|
|
||||||
} else {
|
} else {
|
||||||
this.getData();
|
this.getData();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
this.$API.mtm.mgroup.list
|
||||||
|
.req({ page: 0, search: "煤磨" })
|
||||||
|
.then((res) => {
|
||||||
|
console.log("煤磨", res);
|
||||||
|
that.query.mgroup = res[0].id;
|
||||||
|
this.getData();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 动态绑定Class
|
// 动态绑定Class
|
||||||
|
@ -203,7 +209,7 @@ export default {
|
||||||
that.monthGoal[ind] !== undefined
|
that.monthGoal[ind] !== undefined
|
||||||
? that.monthGoal[ind]
|
? that.monthGoal[ind]
|
||||||
: "/";
|
: "/";
|
||||||
wrapArr[ind] = arr;
|
wrapArr.push(arr);
|
||||||
});
|
});
|
||||||
wrapArr.forEach((item, index) => {
|
wrapArr.forEach((item, index) => {
|
||||||
let arrs = [];
|
let arrs = [];
|
||||||
|
@ -214,20 +220,20 @@ export default {
|
||||||
//当期与目标差值(KW·h/t)
|
//当期与目标差值(KW·h/t)
|
||||||
let diff = 0;
|
let diff = 0;
|
||||||
if (item[2] !== "/") {
|
if (item[2] !== "/") {
|
||||||
diff = item[1] - item[2];
|
diff = (item[1] - item[2]).toFixed(2);
|
||||||
} else {
|
} else {
|
||||||
diff = "/";
|
diff = "/";
|
||||||
}
|
}
|
||||||
arrs[3] = diff;
|
arrs[3] = diff;
|
||||||
//环期值(KW·h/t)上个月的值
|
//环期值(KW·h/t)上个月的值
|
||||||
let lastNum = 0;
|
let lastNum = 0;
|
||||||
if (index > 1) {
|
if (index > 0) {
|
||||||
let num = index - 1;
|
let num = index - 1;
|
||||||
if (
|
if (
|
||||||
wrapArr[num] &&
|
wrapArr[num] &&
|
||||||
wrapArr[num].elec_consume_unit
|
wrapArr[num][1]
|
||||||
) {
|
) {
|
||||||
lastNum = wrapArr[num].elec_consume_unit;
|
lastNum = wrapArr[num][1];
|
||||||
} else {
|
} else {
|
||||||
lastNum = "/";
|
lastNum = "/";
|
||||||
}
|
}
|
||||||
|
@ -241,7 +247,7 @@ export default {
|
||||||
let lastDiff = 0;
|
let lastDiff = 0;
|
||||||
|
|
||||||
if (arrs[1] !== "/" && arrs[4] !== "/") {
|
if (arrs[1] !== "/" && arrs[4] !== "/") {
|
||||||
lastDiff = arrs[1] - arrs[4];
|
lastDiff = (arrs[1] - arrs[4]).toFixed(2);
|
||||||
} else {
|
} else {
|
||||||
lastDiff = "/";
|
lastDiff = "/";
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
<!-- 全厂电量统计 -->
|
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-header>
|
<el-header>
|
||||||
|
|
|
@ -480,7 +480,8 @@ export default {
|
||||||
//当期与目标差值(KW·h/t)
|
//当期与目标差值(KW·h/t)
|
||||||
let diff = 0;
|
let diff = 0;
|
||||||
if (arrs[2] !== "/") {
|
if (arrs[2] !== "/") {
|
||||||
diff = arrs[1] - arrs[2];
|
diff = (arrs[1] - arrs[2]).toFixed(2)
|
||||||
|
;
|
||||||
} else {
|
} else {
|
||||||
diff = "/";
|
diff = "/";
|
||||||
}
|
}
|
||||||
|
@ -507,7 +508,7 @@ export default {
|
||||||
let lastDiff = 0;
|
let lastDiff = 0;
|
||||||
|
|
||||||
if (arrs[1] !== "/" && arrs[4] !== "/") {
|
if (arrs[1] !== "/" && arrs[4] !== "/") {
|
||||||
lastDiff = arrs[1] - arrs[4];
|
lastDiff = (arrs[1] - arrs[4]).toFixed(2);
|
||||||
} else {
|
} else {
|
||||||
lastDiff = "/";
|
lastDiff = "/";
|
||||||
}
|
}
|
||||||
|
@ -519,7 +520,7 @@ export default {
|
||||||
lastNum !== "/" &&
|
lastNum !== "/" &&
|
||||||
lastNum !== 0
|
lastNum !== 0
|
||||||
) {
|
) {
|
||||||
lastRate = (lastDiff / lastNum) * 100;
|
lastRate = ((lastDiff / lastNum) * 100).toFixed(2);
|
||||||
} else {
|
} else {
|
||||||
lastRate = "/";
|
lastRate = "/";
|
||||||
}
|
}
|
||||||
|
@ -628,7 +629,7 @@ export default {
|
||||||
: "/";
|
: "/";
|
||||||
}
|
}
|
||||||
if (arrs3[1] !== "/" && lastNum3 !== "/") {
|
if (arrs3[1] !== "/" && lastNum3 !== "/") {
|
||||||
lastDiff3 = arrs3[1] - lastNum3;
|
lastDiff3 = (arrs3[1] - lastNum3).toFixed(2);
|
||||||
} else {
|
} else {
|
||||||
lastDiff3 = "/";
|
lastDiff3 = "/";
|
||||||
}
|
}
|
||||||
|
|
|
@ -197,11 +197,12 @@ export default {
|
||||||
this.$API.mtm.mgroup.list
|
this.$API.mtm.mgroup.list
|
||||||
.req({ page: 0, search: "水泥磨" })
|
.req({ page: 0, search: "水泥磨" })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log("水泥磨", res);
|
|
||||||
that.query.mgroup = res[0].id;
|
that.query.mgroup = res[0].id;
|
||||||
//月目标
|
//月目标
|
||||||
this.getMonthGoal();
|
this.getMonthGoal();
|
||||||
|
this.getData();
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 动态绑定Class
|
// 动态绑定Class
|
||||||
|
@ -229,6 +230,7 @@ export default {
|
||||||
that.$API.mtm.goal.list.req(paramsGoal).then((ress) => {
|
that.$API.mtm.goal.list.req(paramsGoal).then((ress) => {
|
||||||
if (ress.length > 0) {
|
if (ress.length > 0) {
|
||||||
let monthGoal = [];
|
let monthGoal = [];
|
||||||
|
let monthGoal2 = [];
|
||||||
ress.forEach((goal) => {
|
ress.forEach((goal) => {
|
||||||
if (
|
if (
|
||||||
goal.goal_cate_name == "单位产品分布电耗(KW·h/t)"
|
goal.goal_cate_name == "单位产品分布电耗(KW·h/t)"
|
||||||
|
@ -266,8 +268,7 @@ export default {
|
||||||
monthGoal2[12] = goal.goal_val_12;
|
monthGoal2[12] = goal.goal_val_12;
|
||||||
that.monthGoal2 = monthGoal2;
|
that.monthGoal2 = monthGoal2;
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
this.getData();
|
|
||||||
} else {
|
} else {
|
||||||
this.getData();
|
this.getData();
|
||||||
}
|
}
|
||||||
|
@ -312,7 +313,7 @@ export default {
|
||||||
that.monthGoal[ind] !== undefined
|
that.monthGoal[ind] !== undefined
|
||||||
? that.monthGoal[ind]
|
? that.monthGoal[ind]
|
||||||
: "/";
|
: "/";
|
||||||
wrapArr[ind] = arr;
|
wrapArr.push(arr);
|
||||||
});
|
});
|
||||||
wrapArr.forEach((item, index) => {
|
wrapArr.forEach((item, index) => {
|
||||||
let ind = item.month_s;
|
let ind = item.month_s;
|
||||||
|
@ -327,13 +328,14 @@ export default {
|
||||||
//当期与环期差值(KW·h/t)
|
//当期与环期差值(KW·h/t)
|
||||||
let lastNum = 0,
|
let lastNum = 0,
|
||||||
lastDiff = 0;
|
lastDiff = 0;
|
||||||
if (index > 1) {
|
if (index > 0) {
|
||||||
let num = index - 1;
|
let num = index - 1;
|
||||||
if (
|
if (
|
||||||
wrapArr[num] &&
|
wrapArr[num] &&
|
||||||
wrapArr[num].elec_consume_unit
|
wrapArr[num][1]
|
||||||
) {
|
) {
|
||||||
lastNum = wrapArr[num].elec_consume_unit;
|
lastNum = wrapArr[num][1];
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
lastNum = "/";
|
lastNum = "/";
|
||||||
}
|
}
|
||||||
|
@ -351,7 +353,7 @@ export default {
|
||||||
//环比增长率(%)
|
//环比增长率(%)
|
||||||
let lastRate = 0;
|
let lastRate = 0;
|
||||||
if (
|
if (
|
||||||
lastDiff == "/" &&
|
lastDiff !== "/" &&
|
||||||
lastNum !== "/" &&
|
lastNum !== "/" &&
|
||||||
lastNum !== 0
|
lastNum !== 0
|
||||||
) {
|
) {
|
||||||
|
@ -360,7 +362,7 @@ export default {
|
||||||
lastRate = "/";
|
lastRate = "/";
|
||||||
}
|
}
|
||||||
arrs[7] = lastRate;
|
arrs[7] = lastRate;
|
||||||
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
// 同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
||||||
let sameRate = 0;
|
let sameRate = 0;
|
||||||
if (
|
if (
|
||||||
wrapArr0[index] &&
|
wrapArr0[index] &&
|
||||||
|
|
|
@ -126,6 +126,7 @@ export default {
|
||||||
that.query.mgroup = res[0].id;
|
that.query.mgroup = res[0].id;
|
||||||
//月目标
|
//月目标
|
||||||
that.getMonthGoal();
|
that.getMonthGoal();
|
||||||
|
that.getData();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -174,7 +175,6 @@ export default {
|
||||||
that.monthGoal = monthGoal;
|
that.monthGoal = monthGoal;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.getData();
|
|
||||||
} else {
|
} else {
|
||||||
this.getData();
|
this.getData();
|
||||||
}
|
}
|
||||||
|
@ -218,7 +218,7 @@ export default {
|
||||||
that.monthGoal[ind] !== undefined
|
that.monthGoal[ind] !== undefined
|
||||||
? that.monthGoal[ind]
|
? that.monthGoal[ind]
|
||||||
: "/";
|
: "/";
|
||||||
wrapArr[ind] = arr;
|
wrapArr.push(arr);
|
||||||
});
|
});
|
||||||
wrapArr.forEach((item, index) => {
|
wrapArr.forEach((item, index) => {
|
||||||
let arrs = [];
|
let arrs = [];
|
||||||
|
@ -236,13 +236,13 @@ export default {
|
||||||
arrs[3] = diff;
|
arrs[3] = diff;
|
||||||
//环期值(KW·h/t)上个月的值
|
//环期值(KW·h/t)上个月的值
|
||||||
let lastNum = 0;
|
let lastNum = 0;
|
||||||
if (index > 1) {
|
if (index > 0) {
|
||||||
let num = index - 1;
|
let num = index - 1;
|
||||||
if (
|
if (
|
||||||
wrapArr[num] &&
|
wrapArr[num] &&
|
||||||
wrapArr[num].elec_consume_unit
|
wrapArr[num][1]
|
||||||
) {
|
) {
|
||||||
lastNum = wrapArr[num].elec_consume_unit;
|
lastNum = wrapArr[num][1];
|
||||||
} else {
|
} else {
|
||||||
lastNum = "/";
|
lastNum = "/";
|
||||||
}
|
}
|
||||||
|
|
|
@ -238,9 +238,9 @@ export default {
|
||||||
let num = index - 1;
|
let num = index - 1;
|
||||||
if (
|
if (
|
||||||
wrapArr[num] &&
|
wrapArr[num] &&
|
||||||
wrapArr[num].elec_consume_unit
|
wrapArr[num][1]
|
||||||
) {
|
) {
|
||||||
lastNum = wrapArr[num].elec_consume_unit;
|
lastNum = wrapArr[num][1];
|
||||||
} else {
|
} else {
|
||||||
lastNum = "/";
|
lastNum = "/";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue