fix bug
This commit is contained in:
parent
70b7427044
commit
ba5c1b2129
|
@ -18,7 +18,7 @@ VUE_APP_PJ = ''
|
||||||
#测试环境
|
#测试环境
|
||||||
VUE_APP_API_BASEURL = http://10.50.211.228:2250/api
|
VUE_APP_API_BASEURL = http://10.50.211.228:2250/api
|
||||||
#VUE_APP_API_BASEURL = http://127.0.0.1:2226/api
|
#VUE_APP_API_BASEURL = http://127.0.0.1:2226/api
|
||||||
VUE_APP_BASEURL = http://10.50.211.228:2250
|
VUE_APP_BASEURL = http://10.50.211.228:2250/
|
||||||
#VUE_APP_BASEURL = http://127.0.0.1:2226
|
#VUE_APP_BASEURL = http://127.0.0.1:2226
|
||||||
|
|
||||||
# #光子
|
# #光子
|
||||||
|
|
|
@ -1088,6 +1088,15 @@ const routes = [
|
||||||
perms: ["enm_report"],
|
perms: ["enm_report"],
|
||||||
},
|
},
|
||||||
component: "enm_report/reportMonth",
|
component: "enm_report/reportMonth",
|
||||||
|
},{
|
||||||
|
name: "exception",
|
||||||
|
path: "/enm_report/exception",
|
||||||
|
meta: {
|
||||||
|
title: "异常动态表",
|
||||||
|
// icon: "el-icon-grid",
|
||||||
|
perms: ["enm_report"],
|
||||||
|
},
|
||||||
|
component: "enm_report/exception",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
|
@ -246,7 +246,7 @@
|
||||||
<td class="numCell">处置人</td>
|
<td class="numCell">处置人</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-for="item in sflogexpList" :key="item.id">
|
<tr v-for="item in sflogexpList" :key="item.id">
|
||||||
<td class="numCell">{{ item.happen_time }}</td>
|
<td class="numCell">{{ item.stlog_.start_time }}</td>
|
||||||
<td class="numCell">{{ item.stlog_.cate }}</td>
|
<td class="numCell">{{ item.stlog_.cate }}</td>
|
||||||
<td class="numCell">{{ item.stlog_.reason }}</td>
|
<td class="numCell">{{ item.stlog_.reason }}</td>
|
||||||
<td class="numCell">{{ item.stlog_.measure }}</td>
|
<td class="numCell">{{ item.stlog_.measure }}</td>
|
||||||
|
|
|
@ -89,6 +89,7 @@ export default {
|
||||||
mgroup: "",
|
mgroup: "",
|
||||||
},
|
},
|
||||||
tableDatas: [],
|
tableDatas: [],
|
||||||
|
goalDatas: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -108,12 +109,11 @@ export default {
|
||||||
params.year = year;
|
params.year = year;
|
||||||
params.mgroup = that.query.mgroup;
|
params.mgroup = that.query.mgroup;
|
||||||
this.$API.mtm.goal.list.req(params).then((res) => {
|
this.$API.mtm.goal.list.req(params).then((res) => {
|
||||||
let data = [];
|
// let data = [];
|
||||||
if (res.length > 0) {
|
if (res.length > 0) {
|
||||||
data = res[0];
|
this.goalDatas = res[0];
|
||||||
}
|
}
|
||||||
console.log(data);
|
that.getData(this.goalDatas);
|
||||||
that.getData(data);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -127,43 +127,32 @@ export default {
|
||||||
query0.mgroup = that.query.mgroup;
|
query0.mgroup = that.query.mgroup;
|
||||||
let wrapArr = [],
|
let wrapArr = [],
|
||||||
wrapArr0 = [],
|
wrapArr0 = [],
|
||||||
|
compareArr0 = [],
|
||||||
wrapArrs = [];
|
wrapArrs = [];
|
||||||
this.$API.enm.enstat.req(query0).then((res0) => {
|
this.$API.enm.enstat.req(query0).then((res0) => {
|
||||||
let data0 = res0;
|
let data0 = res0;
|
||||||
if (data0.length > 0) {
|
if (data0.length > 0) {
|
||||||
data0.forEach((item0) => {
|
data0.forEach((item0) => {
|
||||||
//先按月份排序,再按班组排序
|
//先按月份排序,再按班组排序
|
||||||
let n0 = item0.month_s;
|
|
||||||
let ind0 = 0;
|
|
||||||
if (team_name0.indexOf("甲") > -1) {
|
|
||||||
ind0 = (n0 - 1) * 3;
|
|
||||||
} else if (team_name0.indexOf("乙") > -1) {
|
|
||||||
ind0 = (n0 - 1) * 3 + 1;
|
|
||||||
} else if (team_name0.indexOf("丙") > -1) {
|
|
||||||
ind0 = (n0 - 1) * 3 + 2;
|
|
||||||
}
|
|
||||||
wrapArr0[ind0] = item0;
|
wrapArr0[ind0] = item0;
|
||||||
});
|
});
|
||||||
console.log(wrapArr0);
|
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
this.$API.enm.enstat.req(that.query).then((res) => {
|
this.$API.enm.enstat.req(that.query).then((res) => {
|
||||||
//今年的值
|
//今年的值
|
||||||
let data = res;
|
let data = res;
|
||||||
if (data.length > 0) {
|
if (data.length > 0) {
|
||||||
|
data.forEach((item) => {
|
||||||
|
//先按月份排序,再按班组排序
|
||||||
|
let compareArr = [];
|
||||||
|
compareArr.push(item.month_s);
|
||||||
|
compareArr.push(item.team_name);
|
||||||
|
compareArr.push(item.elec_consume_unit);
|
||||||
|
compareArr0.push(compareArr);
|
||||||
|
});
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
//先按月份排序,再按班组排序
|
//先按月份排序,再按班组排序
|
||||||
let n = item.month_s;
|
let n = item.month_s;
|
||||||
let team_name = item.team_name;
|
|
||||||
let ind = 0;
|
|
||||||
if (team_name.indexOf("甲") > -1) {
|
|
||||||
ind = (n - 1) * 3;
|
|
||||||
} else if (team_name.indexOf("乙") > -1) {
|
|
||||||
ind = (n - 1) * 3 + 1;
|
|
||||||
} else if (team_name.indexOf("丙") > -1) {
|
|
||||||
ind = (n - 1) * 3 + 2;
|
|
||||||
}
|
|
||||||
wrapArrs[ind] = item;
|
|
||||||
let arr = [];
|
let arr = [];
|
||||||
let time = "" + item.year_s + "." + item.month_s;
|
let time = "" + item.year_s + "." + item.month_s;
|
||||||
arr.push(time);
|
arr.push(time);
|
||||||
|
@ -201,12 +190,12 @@ export default {
|
||||||
? wrapArr0[ind_pre].elec_consume_unit
|
? wrapArr0[ind_pre].elec_consume_unit
|
||||||
: "/";
|
: "/";
|
||||||
} else {
|
} else {
|
||||||
ind_pre = n - 1;
|
// 如果 wrapArr数组长度大于0,那么循环遍历wrapArr数组,找到与item.month_s相差1的元素 而 item.name相同,并赋值给huanbi
|
||||||
huanqi = wrapArr[ind_pre]
|
compareArr0.forEach((item0) => {
|
||||||
? wrapArr[ind_pre].elec_consume_unit>=0
|
if (item0[0] == item.month_s - 1 && item0[1] == item.team_name) {
|
||||||
? wrapArr[ind_pre].elec_consume_unit
|
huanqi = item0[2];
|
||||||
: "/"
|
}
|
||||||
: "/";
|
})
|
||||||
}
|
}
|
||||||
arr[11] = huanqi; //环期值(KW·h/t)上个月的值
|
arr[11] = huanqi; //环期值(KW·h/t)上个月的值
|
||||||
if (huanqi !== "/") {
|
if (huanqi !== "/") {
|
||||||
|
@ -215,22 +204,16 @@ export default {
|
||||||
huanqicha = item.celec_consume_unit;
|
huanqicha = item.celec_consume_unit;
|
||||||
}
|
}
|
||||||
arr[12] = huanqicha; //当期与环期差值(KW·h/t)
|
arr[12] = huanqicha; //当期与环期差值(KW·h/t)
|
||||||
arr[13] =
|
// arr[13] =
|
||||||
huanqi != "/" ? (huanqicha / huanqi) * 100 : 0; //环比增长率(%)
|
if (arr[11] !=="/" && arr[11]!==0 && arr[11] !==0 && arr[12] !== "undefined"){
|
||||||
if (wrapArr0[n]) {
|
arr[13] = ((arr[11]/arr[12])*100).toFixed(2);
|
||||||
tongqicha =
|
}else{
|
||||||
item.celec_consume_unit -
|
arr[13] = "/"; //环比增长率(%)= 当期与环期差值(KW·h/t)/环期值(KW·h/t)*100%
|
||||||
wrapArr0[n].celec_consume_unit;
|
|
||||||
tongqi = tongqicha / tongqi;
|
|
||||||
} else {
|
|
||||||
tongqicha = item.celec_consume_unit;
|
|
||||||
tongqi = 0;
|
|
||||||
}
|
}
|
||||||
arr[14] = tongqi; //同比增长率(%)
|
arr[14] = tongqi; //同比增长率(%)
|
||||||
arr[15] = 0.0; //得分
|
arr[15] = 0.0; //得分
|
||||||
wrapArr[ind] = arr;
|
wrapArr.push(arr);
|
||||||
});
|
});
|
||||||
console.log(wrapArr);
|
|
||||||
that.tableDatas = wrapArr;
|
that.tableDatas = wrapArr;
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
|
@ -239,7 +222,7 @@ export default {
|
||||||
},
|
},
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.tableDatas = [];
|
this.tableDatas = [];
|
||||||
this.getData();
|
this.getData(this.goalDatas);
|
||||||
},
|
},
|
||||||
itemClick(type, item) {
|
itemClick(type, item) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
|
|
@ -93,7 +93,7 @@
|
||||||
<th rowspan="2">车间用水(t)</th>
|
<th rowspan="2">车间用水(t)</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-if="deptName=='烧成车间'">
|
<tr v-if="deptName=='烧成车间'">
|
||||||
<th colspan="10">回转窑</th>
|
<th colspan="11">回转窑</th>
|
||||||
<th colspan="3">煤磨</th>
|
<th colspan="3">煤磨</th>
|
||||||
<th rowspan="2">压缩空气(m3)</th>
|
<th rowspan="2">压缩空气(m3)</th>
|
||||||
<th rowspan="2">车间用水(t)</th>
|
<th rowspan="2">车间用水(t)</th>
|
||||||
|
@ -110,7 +110,7 @@
|
||||||
<th v-if="deptName=='烧成车间'">煤粉(t)</th>
|
<th v-if="deptName=='烧成车间'">煤粉(t)</th>
|
||||||
<th v-if="deptName=='烧成车间'">煤粉折标煤(tce)</th>
|
<th v-if="deptName=='烧成车间'">煤粉折标煤(tce)</th>
|
||||||
<!-- <th v-if="deptName!='原料车间'">水(t)</th> -->
|
<!-- <th v-if="deptName!='原料车间'">水(t)</th> -->
|
||||||
<!-- <th v-if="deptName=='烧成车间'">柴油(t)</th> -->
|
<th v-if="deptName=='烧成车间'">柴油(t)</th>
|
||||||
<th v-if="deptName=='烧成车间'">柴油折标煤(tce)</th>
|
<th v-if="deptName=='烧成车间'">柴油折标煤(tce)</th>
|
||||||
<th v-if="deptName=='烧成车间'">余热锅炉外送蒸汽(t)</th>
|
<th v-if="deptName=='烧成车间'">余热锅炉外送蒸汽(t)</th>
|
||||||
<th v-if="deptName=='烧成车间'">余热锅炉外送蒸汽折标煤(tce)</th>
|
<th v-if="deptName=='烧成车间'">余热锅炉外送蒸汽折标煤(tce)</th>
|
||||||
|
@ -282,8 +282,15 @@
|
||||||
itemArr.push( item1[0].pcoal_consume)//煤粉(t)
|
itemArr.push( item1[0].pcoal_consume)//煤粉(t)
|
||||||
itemArr.push( item1[0].pcoal_coal_consume)//煤粉折标煤(tce)
|
itemArr.push( item1[0].pcoal_coal_consume)//煤粉折标煤(tce)
|
||||||
// itemArr.push( item1[0].water_consume)//水(t)
|
// itemArr.push( item1[0].water_consume)//水(t)
|
||||||
// itemArr.push( item1[0].pcoal_consume)//柴油(t)
|
// console.log(item1[0].imaterial_data_dict)
|
||||||
itemArr.push( item1[0].pcoal_coal_consume)//柴油折标煤(tce)
|
if (item1[0].imaterial_data_dict.length>0 || item1[0].imaterial_data_dict.柴油){
|
||||||
|
// console.log(item1[0].imaterial_data_dict.柴油.amount_consume)
|
||||||
|
itemArr.push( item1[0].imaterial_data_dict.柴油.amount_consume)//柴油(t)
|
||||||
|
itemArr.push( (item1[0].imaterial_data_dict.柴油.amount_consume*1.4571).toFixed(2))//柴油折标煤(tce)
|
||||||
|
}else{
|
||||||
|
itemArr.push(0)//柴油(t)
|
||||||
|
itemArr.push(0)//柴油折标煤(tce)
|
||||||
|
}
|
||||||
itemArr.push( item1[0].out_steam)//余热锅炉外送蒸汽(t)
|
itemArr.push( item1[0].out_steam)//余热锅炉外送蒸汽(t)
|
||||||
itemArr.push( item1[0].out_steam_coal)//余热锅炉外送蒸汽折标煤(tce)
|
itemArr.push( item1[0].out_steam_coal)//余热锅炉外送蒸汽折标煤(tce)
|
||||||
}
|
}
|
||||||
|
|
|
@ -203,7 +203,7 @@
|
||||||
<td class="numCell">
|
<td class="numCell">
|
||||||
{{ reportItem.run_rate }}
|
{{ reportItem.run_rate }}
|
||||||
</td>
|
</td>
|
||||||
<td class="numCell">停机时长(h)</td>
|
<td class="numCell">停机时长(s)</td>
|
||||||
<td class="numCell">
|
<td class="numCell">
|
||||||
{{ reportItem.shut_sec }}
|
{{ reportItem.shut_sec }}
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -152,7 +152,9 @@ export default {
|
||||||
query0.mgroup = that.query.mgroup;
|
query0.mgroup = that.query.mgroup;
|
||||||
let wrapArr = [],
|
let wrapArr = [],
|
||||||
wrapArr0 = [],
|
wrapArr0 = [],
|
||||||
wrapArrs = [];
|
wrapArrs = [],
|
||||||
|
comparEarr = [], //班组对比
|
||||||
|
compareArr0 = [];
|
||||||
this.$API.enm.enstat.req(query0).then((res0) => {
|
this.$API.enm.enstat.req(query0).then((res0) => {
|
||||||
let data0 = res0;
|
let data0 = res0;
|
||||||
debugger;
|
debugger;
|
||||||
|
@ -168,35 +170,30 @@ export default {
|
||||||
arr0[2] = item0.total_output_unit;
|
arr0[2] = item0.total_output_unit;
|
||||||
arr0[3] = item0.total_output_unit;
|
arr0[3] = item0.total_output_unit;
|
||||||
arr0[4] = item0.run_rate_unit;
|
arr0[4] = item0.run_rate_unit;
|
||||||
if (team_name0.indexOf("甲") > -1) {
|
|
||||||
ind0 = (n0 - 1) * 3;
|
|
||||||
} else if (team_name0.indexOf("乙") > -1) {
|
|
||||||
ind0 = (n0 - 1) * 3 + 1;
|
|
||||||
} else if (team_name0.indexOf("丙") > -1) {
|
|
||||||
ind0 = (n0 - 1) * 3 + 2;
|
|
||||||
}
|
|
||||||
wrapArr0[ind0] = item0;
|
wrapArr0[ind0] = item0;
|
||||||
});
|
});
|
||||||
debugger;
|
|
||||||
console.log(wrapArr0);
|
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
this.$API.enm.enstat.req(that.query).then((res) => {
|
this.$API.enm.enstat.req(that.query).then((res) => {
|
||||||
let data = res;
|
let data = res;
|
||||||
if (data.length > 0) {
|
if (data.length > 0) {
|
||||||
|
data.forEach((item) => {
|
||||||
|
//先按月份排序,再按班组排序
|
||||||
|
let compareArr = [];
|
||||||
|
let elecArr = [];
|
||||||
|
compareArr.push(item.month_s);
|
||||||
|
elecArr.push(item.month_s);
|
||||||
|
compareArr.push(item.team_name);
|
||||||
|
elecArr.push(item.team_name);
|
||||||
|
compareArr.push(item.coal_consume_unit);
|
||||||
|
elecArr.push(item.elec_consume_unit);
|
||||||
|
compareArr0.push(compareArr);
|
||||||
|
comparEarr.push(elecArr);
|
||||||
|
});
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
//先按月份排序,再按班组排序
|
//先按月份排序,再按班组排序
|
||||||
let n = item.month_s;
|
let n = item.month_s;
|
||||||
let team_name = item.team_name;
|
|
||||||
let ind = 0;
|
let ind = 0;
|
||||||
if (team_name.indexOf("甲") > -1) {
|
|
||||||
ind = (n - 1) * 3;
|
|
||||||
} else if (team_name.indexOf("乙") > -1) {
|
|
||||||
ind = (n - 1) * 3 + 1;
|
|
||||||
} else if (team_name.indexOf("丙") > -1) {
|
|
||||||
ind = (n - 1) * 3 + 2;
|
|
||||||
}
|
|
||||||
wrapArrs[ind] = item;
|
|
||||||
let arr = [];
|
let arr = [];
|
||||||
let time = "" + item.year_s + "." + item.month_s;
|
let time = "" + item.year_s + "." + item.month_s;
|
||||||
arr.push(time);
|
arr.push(time);
|
||||||
|
@ -245,7 +242,7 @@ export default {
|
||||||
};
|
};
|
||||||
let dq = 0
|
let dq = 0
|
||||||
if (arr[13] !== null && arr[13] !== undefined){
|
if (arr[13] !== null && arr[13] !== undefined){
|
||||||
dq = arr[12] - arr[13]; //当期与目标差值(KW·h/t)
|
dq = (arr[12] - arr[13]).toFixed(2); //当期与目标差值(KW·h/t)
|
||||||
}else{
|
}else{
|
||||||
dq == "/"
|
dq == "/"
|
||||||
};
|
};
|
||||||
|
@ -258,21 +255,21 @@ export default {
|
||||||
? wrapArr0[ind_pre].coal_consume_unit
|
? wrapArr0[ind_pre].coal_consume_unit
|
||||||
: "/";
|
: "/";
|
||||||
} else {
|
} else {
|
||||||
ind_pre = ind - 1;
|
// 如果 wrapArr数组长度大于0,那么循环遍历wrapArr数组,找到与item.month_s相差1的元素 而 item.name相同,并赋值给huanbi
|
||||||
huanbi = wrapArr[ind_pre]
|
compareArr0.forEach((item0) => {
|
||||||
? wrapArr[ind_pre].coal_consume_unit
|
if (item0[0] == item.month_s - 1 && item0[1] == item.team_name) {
|
||||||
? wrapArr[ind_pre].coal_consume_unit
|
huanbi = item0[2];
|
||||||
: "/"
|
}
|
||||||
: "/";
|
})
|
||||||
}
|
}
|
||||||
arr[15] = huanbi; //环期值(KW·h/t)上个月的值
|
arr[15] = huanbi; //环期值(KW·h/t)上个月的值
|
||||||
if(huanbi !=="/"){
|
if(huanbi !=="/"){
|
||||||
arr[16] = arr[12] - huanbi; //当期与环期差值(KW·h/t)
|
arr[16] = (arr[12] - arr[15]).toFixed(2); //当期与环期差值(KW·h/t)
|
||||||
}else{
|
}else{
|
||||||
arr[16] = "/"
|
arr[16] = "/"
|
||||||
};
|
};
|
||||||
if (arr[15] !== "/"&& arr[15]!== 0 && arr[16]!=="/") {
|
if (arr[15] !== "/"&& arr[15]!== 0 && arr[16]!=="/") {
|
||||||
arr[17] = (arr[16] / arr[15]) * 100; //环比增长率(%)
|
arr[17] = ((arr[16] / arr[15]) * 100).toFixed(2); //环比增长率(%)
|
||||||
} else{
|
} else{
|
||||||
arr[17] = "/"
|
arr[17] = "/"
|
||||||
};
|
};
|
||||||
|
@ -315,35 +312,34 @@ export default {
|
||||||
arr[24] = item.elec_consume_unit; //当期值(KW·h/t)
|
arr[24] = item.elec_consume_unit; //当期值(KW·h/t)
|
||||||
// arr[25] = item.celec_consume_unit; //目标值(KW·h/t)//需要接口获取
|
// arr[25] = item.celec_consume_unit; //目标值(KW·h/t)//需要接口获取
|
||||||
if (item.elec_consume_unit != null &&item.elec_consume_unit !== "/"){
|
if (item.elec_consume_unit != null &&item.elec_consume_unit !== "/"){
|
||||||
arr[26] = arr[24]-arr[25] //当期与目标差值(KW·h/t)
|
arr[26] = (arr[24]-arr[25]).toFixed(2); //当期与目标差值(KW·h/t)
|
||||||
}
|
}
|
||||||
let ind_pre1 = 0,
|
let huanbiec = 0;
|
||||||
huanbi1 = 0;
|
|
||||||
if (item.month_s == 1) {
|
if (item.month_s == 1) {
|
||||||
ind_pre1 = 12;
|
ind_pre1 = 12;
|
||||||
huanbi1 = wrapArr0[ind_pre]
|
huanbiec = wrapArr0[ind_pre]
|
||||||
? wrapArr0[ind_pre].elec_consume_unit
|
? wrapArr0[ind_pre].elec_consume_unit
|
||||||
: "/";
|
: "/";
|
||||||
} else {
|
} else {
|
||||||
ind_pre1 = ind - 1;
|
// 如果 wrapArr数组长度大于0,那么循环遍历wrapArr数组,找到与item.month_s相差1的元素 而 item.name相同,并赋值给huanbi
|
||||||
huanbi1 = wrapArr[ind_pre]
|
comparEarr.forEach((item0) => {
|
||||||
? wrapArr[ind_pre].elec_consume_unit
|
if (item0[0] == item.month_s - 1 && item0[1] == item.team_name) {
|
||||||
? wrapArr[ind_pre].elec_consume_unit
|
huanbiec = item0[2];
|
||||||
: "/"
|
|
||||||
: "/";
|
|
||||||
}
|
}
|
||||||
arr[27] = huanbi; //环期值(KW·h/t)上个月的值
|
})
|
||||||
if(arr[27]!=="/" && huanbi1!=="/"){
|
}
|
||||||
arr[28] = arr[24] - huanbi1; //当期与环期差值(KW·h/t)
|
arr[27] = huanbiec; //环期值(KW·h/t)上个月的值
|
||||||
|
if(arr[27]!=="/" && huanbiec!=="/"){
|
||||||
|
arr[28] = (arr[24] - huanbiec).toFixed(2); //当期与环期差值(KW·h/t)
|
||||||
}else{
|
}else{
|
||||||
arr[28] = "/"
|
arr[28] = "/"
|
||||||
}
|
}
|
||||||
if(arr[28]!=="/" && huanbi1!=="/"){
|
if(arr[28]!=="/" && huanbiec!=="/"&&huanbiec!==0){
|
||||||
arr[29] = (arr[28] / huanbi1) * 100; //环比增长率(%)
|
arr[29] = ((arr[28] / huanbiec) * 100).toFixed(2); //环比增长率(%)
|
||||||
}else{
|
}else{
|
||||||
arr[29] = "/"}; //环比增长率(%)
|
arr[29] = 0}; //环比增长率(%)
|
||||||
arr[30] = item.celec_consume_unit; //同比增长率(%)
|
arr[30] = item.celec_consume_unit; //同比增长率(%)
|
||||||
wrapArr[ind] = arr;
|
wrapArr.push(arr);
|
||||||
});
|
});
|
||||||
that.tableDatas = wrapArr;
|
that.tableDatas = wrapArr;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -191,7 +191,7 @@
|
||||||
<td class="numCell">
|
<td class="numCell">
|
||||||
{{ reportItem.run_rate }}
|
{{ reportItem.run_rate }}
|
||||||
</td>
|
</td>
|
||||||
<td class="numCell">停机时长(h)</td>
|
<td class="numCell">停机时长(s)</td>
|
||||||
<td class="numCell">
|
<td class="numCell">
|
||||||
{{ reportItem.shut_hour }}
|
{{ reportItem.shut_hour }}
|
||||||
</td>
|
</td>
|
||||||
|
@ -239,7 +239,7 @@
|
||||||
<td class="numCell">处置人</td>
|
<td class="numCell">处置人</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-for="item in sflogexpList" :key="item.id">
|
<tr v-for="item in sflogexpList" :key="item.id">
|
||||||
<td class="numCell">{{ item.happen_time }}</td>
|
<td class="numCell">{{ item.create_time }}</td>
|
||||||
<td class="numCell">{{ item.cate }}</td>
|
<td class="numCell">{{ item.cate }}</td>
|
||||||
<td class="numCell">{{ item.reason }}</td>
|
<td class="numCell">{{ item.reason }}</td>
|
||||||
<td class="numCell">{{ item.measure }}</td>
|
<td class="numCell">{{ item.measure }}</td>
|
||||||
|
|
|
@ -193,7 +193,7 @@
|
||||||
<td class="numCell">处置人</td>
|
<td class="numCell">处置人</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-for="item in sflogexpList" :key="item.id">
|
<tr v-for="item in sflogexpList" :key="item.id">
|
||||||
<td class="numCell">{{ item.happen_time }}</td>
|
<td class="numCell">{{ item.stlog_.start_time }}</td>
|
||||||
<td class="numCell">{{ item.cate }}</td>
|
<td class="numCell">{{ item.cate }}</td>
|
||||||
<td class="numCell">{{ item.reason }}</td>
|
<td class="numCell">{{ item.reason }}</td>
|
||||||
<td class="numCell">{{ item.measure }}</td>
|
<td class="numCell">{{ item.measure }}</td>
|
||||||
|
|
|
@ -204,7 +204,7 @@
|
||||||
<td class="numCell">
|
<td class="numCell">
|
||||||
{{ reportItem.run_rate }}
|
{{ reportItem.run_rate }}
|
||||||
</td>
|
</td>
|
||||||
<td class="numCell">停机时长(h)</td>
|
<td class="numCell">停机时长(s)</td>
|
||||||
<td class="numCell">
|
<td class="numCell">
|
||||||
{{ reportItem.shut_sec }}
|
{{ reportItem.shut_sec }}
|
||||||
</td>
|
</td>
|
||||||
|
@ -263,7 +263,7 @@
|
||||||
<td class="numCell">处置人</td>
|
<td class="numCell">处置人</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-for="item in sflogexpList" :key="item.id">
|
<tr v-for="item in sflogexpList" :key="item.id">
|
||||||
<td class="numCell">{{ item.happen_time }}</td>
|
<td class="numCell">{{ item.stlog_.start_time }}</td>
|
||||||
<td class="numCell">{{ item.stlog_.cate }}</td>
|
<td class="numCell">{{ item.stlog_.cate }}</td>
|
||||||
<td class="numCell">{{ item.stlog_.reason }}</td>
|
<td class="numCell">{{ item.stlog_.reason }}</td>
|
||||||
<td class="numCell">{{ item.stlog_.measure }}</td>
|
<td class="numCell">{{ item.stlog_.measure }}</td>
|
||||||
|
|
|
@ -143,6 +143,7 @@ export default {
|
||||||
query0.mgroup = that.query.mgroup;
|
query0.mgroup = that.query.mgroup;
|
||||||
let wrapArr = [],
|
let wrapArr = [],
|
||||||
wrapArr0 = [],
|
wrapArr0 = [],
|
||||||
|
compareArr0 = [],
|
||||||
wrapArrs = [];
|
wrapArrs = [];
|
||||||
this.$API.enm.enstat.req(query0).then((res0) => {
|
this.$API.enm.enstat.req(query0).then((res0) => {
|
||||||
let data0 = []; //去年的值
|
let data0 = []; //去年的值
|
||||||
|
@ -150,38 +151,27 @@ export default {
|
||||||
if (data0.length > 0) {
|
if (data0.length > 0) {
|
||||||
data0.forEach((item0) => {
|
data0.forEach((item0) => {
|
||||||
//先按月份排序,再按班组排序
|
//先按月份排序,再按班组排序
|
||||||
let n0 = item0.month_s;
|
|
||||||
let ind0 = 0;
|
let ind0 = 0;
|
||||||
let team_name0 = item0.team_name;
|
|
||||||
if (team_name0.indexOf("甲") > -1) {
|
|
||||||
ind0 = (n0 - 1) * 3;
|
|
||||||
} else if (team_name0.indexOf("乙") > -1) {
|
|
||||||
ind0 = (n0 - 1) * 3 + 1;
|
|
||||||
} else if (team_name0.indexOf("丙") > -1) {
|
|
||||||
ind0 = (n0 - 1) * 3 + 2;
|
|
||||||
}
|
|
||||||
wrapArr0[ind0] = item0;
|
wrapArr0[ind0] = item0;
|
||||||
});
|
});
|
||||||
console.log(wrapArr0);
|
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
this.$API.enm.enstat.req(that.query).then((res) => {
|
this.$API.enm.enstat.req(that.query).then((res) => {
|
||||||
//今年的值
|
//今年的值
|
||||||
let data = res;
|
let data = res;
|
||||||
if (data.length > 0) {
|
if (data.length > 0) {
|
||||||
|
data.forEach((item) => {
|
||||||
|
//先按月份排序,再按班组排序
|
||||||
|
let compareArr = [];
|
||||||
|
compareArr.push(item.month_s);
|
||||||
|
compareArr.push(item.team_name);
|
||||||
|
compareArr.push(item.elec_consume_unit);
|
||||||
|
compareArr0.push(compareArr);
|
||||||
|
});
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
//先按月份排序,再按班组排序
|
//先按月份排序,再按班组排序
|
||||||
let n = item.month_s;
|
let n = item.month_s;
|
||||||
let team_name = item.team_name;
|
|
||||||
let ind = 0;
|
let ind = 0;
|
||||||
if (team_name.indexOf("甲") > -1) {
|
|
||||||
ind = (n - 1) * 3;
|
|
||||||
} else if (team_name.indexOf("乙") > -1) {
|
|
||||||
ind = (n - 1) * 3 + 1;
|
|
||||||
} else if (team_name.indexOf("丙") > -1) {
|
|
||||||
ind = (n - 1) * 3 + 2;
|
|
||||||
}
|
|
||||||
wrapArrs[ind] = item;
|
|
||||||
let arr = [];
|
let arr = [];
|
||||||
let time = "" + item.year_s + "." + item.month_s;
|
let time = "" + item.year_s + "." + item.month_s;
|
||||||
arr.push(time);
|
arr.push(time);
|
||||||
|
@ -233,12 +223,12 @@ export default {
|
||||||
? wrapArr0[ind_pre].elec_consume_unit
|
? wrapArr0[ind_pre].elec_consume_unit
|
||||||
: "/";
|
: "/";
|
||||||
} else {
|
} else {
|
||||||
ind_pre = n - 1;
|
// 如果 wrapArr数组长度大于0,那么循环遍历wrapArr数组,找到与item.month_s相差1的元素 而 item.name相同,并赋值给huanbi
|
||||||
huanqi = wrapArr[ind_pre]
|
compareArr0.forEach((item0) => {
|
||||||
? wrapArr[ind_pre].elec_consume_unit
|
if (item0[0] == item.month_s - 1 && item0[1] == item.team_name) {
|
||||||
? wrapArr[ind_pre].elec_consume_unit
|
huanqi = item0[2];
|
||||||
: "/"
|
}
|
||||||
: "/";
|
})
|
||||||
}
|
}
|
||||||
arr[14] = huanqi; //环期值(KW·h/t)上个月的值
|
arr[14] = huanqi; //环期值(KW·h/t)上个月的值
|
||||||
if (huanqi !== "/") {
|
if (huanqi !== "/") {
|
||||||
|
@ -261,7 +251,7 @@ export default {
|
||||||
|
|
||||||
arr[17] = tongqi; //同比增长率(%):本月-去年本月/去年
|
arr[17] = tongqi; //同比增长率(%):本月-去年本月/去年
|
||||||
arr[18] = 0.0; //同比增长率(%)
|
arr[18] = 0.0; //同比增长率(%)
|
||||||
wrapArr[ind] = arr;
|
wrapArr.push(arr);
|
||||||
});
|
});
|
||||||
let newArr = [];
|
let newArr = [];
|
||||||
for (let i = 0; i < wrapArr.length; i++) {
|
for (let i = 0; i < wrapArr.length; i++) {
|
||||||
|
|
|
@ -50,17 +50,17 @@
|
||||||
@click="handleQuery"
|
@click="handleQuery"
|
||||||
></el-button>
|
></el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="right-panel">
|
<!-- <div class="right-panel">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
@click="table_add"
|
@click="table_add"
|
||||||
v-auth="'feeset.create'"
|
v-auth="'feeset.create'"
|
||||||
></el-button>
|
></el-button>
|
||||||
</div>
|
</div> -->
|
||||||
</el-header>
|
</el-header>
|
||||||
<el-main class="nopadding">
|
<el-main class="nopadding">
|
||||||
<scTable ref="table" :apiObj="apiObj" row-key="id">
|
<scTable ref="table" :apiObj="apiObj" :params="params" row-key="id">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="#"
|
label="#"
|
||||||
type="index"
|
type="index"
|
||||||
|
@ -148,6 +148,9 @@ export default {
|
||||||
fee: "",
|
fee: "",
|
||||||
mgroup: "",
|
mgroup: "",
|
||||||
},
|
},
|
||||||
|
params:{
|
||||||
|
mgroup__cate:"section"
|
||||||
|
},
|
||||||
dialog: {
|
dialog: {
|
||||||
save: false,
|
save: false,
|
||||||
},
|
},
|
||||||
|
@ -163,7 +166,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
//获取集合列表
|
//获取集合列表
|
||||||
getMgroup() {
|
getMgroup() {
|
||||||
this.$API.mtm.mgroup.list.req({ page: 0 }).then((res) => {
|
this.$API.mtm.mgroup.list.req({ page: 0, cate:"section"}).then((res) => {
|
||||||
this.options = res;
|
this.options = res;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -42,14 +42,14 @@
|
||||||
@click="handleQuery"
|
@click="handleQuery"
|
||||||
></el-button>
|
></el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="right-panel">
|
<!-- <div class="right-panel">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
@click="roleAdd"
|
@click="roleAdd"
|
||||||
v-auth="'goal.create'"
|
v-auth="'goal.create'"
|
||||||
></el-button>
|
></el-button>
|
||||||
</div>
|
</div> -->
|
||||||
</el-header>
|
</el-header>
|
||||||
<el-main class="nopadding">
|
<el-main class="nopadding">
|
||||||
<scTable
|
<scTable
|
||||||
|
@ -204,6 +204,7 @@
|
||||||
<el-col :md="12" :sm="24">
|
<el-col :md="12" :sm="24">
|
||||||
<el-form-item label="目标种类" prop="goal_cate">
|
<el-form-item label="目标种类" prop="goal_cate">
|
||||||
<el-select
|
<el-select
|
||||||
|
:disabled="type == 'edit'"
|
||||||
v-model="form.goal_cate"
|
v-model="form.goal_cate"
|
||||||
placeholder="目标种类"
|
placeholder="目标种类"
|
||||||
clearable
|
clearable
|
||||||
|
|
|
@ -29,14 +29,14 @@
|
||||||
@click="handleQuery"
|
@click="handleQuery"
|
||||||
></el-button>
|
></el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="right-panel">
|
<!-- <div class="right-panel">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
@click="table_add"
|
@click="table_add"
|
||||||
v-auth="'priceset.create'"
|
v-auth="'priceset.create'"
|
||||||
></el-button>
|
></el-button>
|
||||||
</div>
|
</div> -->
|
||||||
</el-header>
|
</el-header>
|
||||||
<el-main class="nopadding">
|
<el-main class="nopadding">
|
||||||
<scTable ref="table" :apiObj="apiObj" row-key="id">
|
<scTable ref="table" :apiObj="apiObj" row-key="id">
|
||||||
|
|
|
@ -213,7 +213,7 @@
|
||||||
<td class="numCell">处置人</td>
|
<td class="numCell">处置人</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-for="item in sflogexpList" :key="item.id">
|
<tr v-for="item in sflogexpList" :key="item.id">
|
||||||
<td class="numCell">{{ item.happen_time }}</td>
|
<td class="numCell">{{ item.stlog_.start_time }}</td>
|
||||||
<td class="numCell">{{ item.stlog_.cate }}</td>
|
<td class="numCell">{{ item.stlog_.cate }}</td>
|
||||||
<td class="numCell">{{ item.stlog_.reason }}</td>
|
<td class="numCell">{{ item.stlog_.reason }}</td>
|
||||||
<td class="numCell">{{ item.stlog_.measure }}</td>
|
<td class="numCell">{{ item.stlog_.measure }}</td>
|
||||||
|
|
|
@ -128,7 +128,7 @@ export default {
|
||||||
query0.year_s = that.query.year_s - 1;
|
query0.year_s = that.query.year_s - 1;
|
||||||
let wrapArr = [],
|
let wrapArr = [],
|
||||||
wrapArr0 = [],
|
wrapArr0 = [],
|
||||||
wrapArrs = [];
|
compareArr0 = [];
|
||||||
this.$API.enm.enstat.req(query0).then((res0) => {
|
this.$API.enm.enstat.req(query0).then((res0) => {
|
||||||
let data0 = res0;
|
let data0 = res0;
|
||||||
if (data0.length > 0) {
|
if (data0.length > 0) {
|
||||||
|
@ -136,41 +136,36 @@ export default {
|
||||||
//先按月份排序,再按班组排序
|
//先按月份排序,再按班组排序
|
||||||
let n0 = item0.month_s;
|
let n0 = item0.month_s;
|
||||||
let ind0 = 0;
|
let ind0 = 0;
|
||||||
let team_name0 = item0.team_name;
|
|
||||||
if (team_name0.indexOf("甲") > -1) {
|
|
||||||
ind0 = (n0 - 1) * 3;
|
|
||||||
} else if (team_name0.indexOf("乙") > -1) {
|
|
||||||
ind0 = (n0 - 1) * 3 + 1;
|
|
||||||
} else if (team_name0.indexOf("丙") > -1) {
|
|
||||||
ind0 = (n0 - 1) * 3 + 2;
|
|
||||||
}
|
|
||||||
wrapArr0[ind0] = item0;
|
wrapArr0[ind0] = item0;
|
||||||
});
|
});
|
||||||
// console.log(wrapArr0);
|
} else {}
|
||||||
} else {
|
|
||||||
}
|
});
|
||||||
this.$API.enm.enstat.req(that.query).then((res) => {
|
this.$API.enm.enstat.req(that.query).then((res) => {
|
||||||
let data = res;
|
let data = res;
|
||||||
if (data.length > 0) {
|
if (data.length > 0) {
|
||||||
|
data.forEach((item) => {
|
||||||
|
//先按月份排序,再按班组排序
|
||||||
|
let compareArr = [];
|
||||||
|
compareArr.push(item.month_s);
|
||||||
|
compareArr.push(item.team_name);
|
||||||
|
compareArr.push(item.elec_consume_unit);
|
||||||
|
compareArr0.push(compareArr);
|
||||||
|
});
|
||||||
|
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
//先按月份排序,再按班组排序
|
//先按月份排序,再按班组排序
|
||||||
let n = item.month_s;
|
let n = item.month_s;
|
||||||
let team_name = item.team_name;
|
|
||||||
let ind = 0;
|
|
||||||
if (team_name.indexOf("甲") > -1) {
|
|
||||||
ind = (n - 1) * 3;
|
|
||||||
} else if (team_name.indexOf("乙") > -1) {
|
|
||||||
ind = (n - 1) * 3 + 1;
|
|
||||||
} else if (team_name.indexOf("丙") > -1) {
|
|
||||||
ind = (n - 1) * 3 + 2;
|
|
||||||
}
|
|
||||||
wrapArrs[ind] = item;
|
|
||||||
let arr = [];
|
let arr = [];
|
||||||
|
let ind = 0;
|
||||||
let time = "" + item.year_s + "." + item.month_s;
|
let time = "" + item.year_s + "." + item.month_s;
|
||||||
arr.push(time);
|
arr.push(time);
|
||||||
|
|
||||||
arr.push(item.team_name);
|
arr.push(item.team_name);
|
||||||
|
|
||||||
arr.push(item.total_production);
|
arr.push(item.total_production);
|
||||||
arr[3] = item.elec_consume_unit; //当期值(KW·h/t)
|
arr[3] = item.elec_consume_unit; //当期值(KW·h/t)
|
||||||
|
|
||||||
let keyVale = "goal_val_" + n;
|
let keyVale = "goal_val_" + n;
|
||||||
arr[4] = goalData[keyVale]; //目标值(KW·h/t)//需要接口获取
|
arr[4] = goalData[keyVale]; //目标值(KW·h/t)//需要接口获取
|
||||||
arr[5] = (arr[3] - arr[4]).toFixed(2); //当期与目标差值(KW·h/t)
|
arr[5] = (arr[3] - arr[4]).toFixed(2); //当期与目标差值(KW·h/t)
|
||||||
|
@ -182,12 +177,12 @@ export default {
|
||||||
? wrapArr0[ind_pre].elec_consume_unit
|
? wrapArr0[ind_pre].elec_consume_unit
|
||||||
: "/";
|
: "/";
|
||||||
} else {
|
} else {
|
||||||
ind_pre = ind - 1;
|
// 如果 wrapArr数组长度大于0,那么循环遍历wrapArr数组,找到与item.month_s相差1的元素 而 item.name相同,并赋值给huanbi
|
||||||
huanbi = wrapArr[ind_pre]
|
compareArr0.forEach((item0) => {
|
||||||
? wrapArr[ind_pre].elec_consume_unit
|
if (item0[0] == item.month_s - 1 && item0[1] == item.team_name) {
|
||||||
? wrapArr[ind_pre].elec_consume_unit
|
huanbi = item0[2];
|
||||||
: "/"
|
}
|
||||||
: "/";
|
})
|
||||||
}
|
}
|
||||||
arr[6] = huanbi; //环期值(KW·h/t)上个月的值\
|
arr[6] = huanbi; //环期值(KW·h/t)上个月的值\
|
||||||
if (arr[6] !== "/"){
|
if (arr[6] !== "/"){
|
||||||
|
@ -195,7 +190,7 @@ export default {
|
||||||
}else{
|
}else{
|
||||||
arr[7] = "/"; //当期与环期差值(KW·h/t)
|
arr[7] = "/"; //当期与环期差值(KW·h/t)
|
||||||
}
|
}
|
||||||
console.log(arr[7], arr[6])
|
// console.log(arr[7], arr[6])
|
||||||
if (arr[7] !=="/" && arr[6] !==0 && arr[7] !== "undefined"){
|
if (arr[7] !=="/" && arr[6] !==0 && arr[7] !== "undefined"){
|
||||||
arr[8] = ((arr[7]/arr[6])*100).toFixed(2);
|
arr[8] = ((arr[7]/arr[6])*100).toFixed(2);
|
||||||
}else{
|
}else{
|
||||||
|
@ -216,13 +211,13 @@ export default {
|
||||||
}
|
}
|
||||||
arr[9] = sameRate; ///同比增长率(%)需要当前值/ 上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
arr[9] = sameRate; ///同比增长率(%)需要当前值/ 上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
||||||
// arr[10] = item.celec_consume_unit; //同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
// arr[10] = item.celec_consume_unit; //同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
||||||
wrapArr[ind] = arr;
|
wrapArr.push(arr);
|
||||||
|
// console.log(wrapArr);
|
||||||
});
|
});
|
||||||
that.tableDatas = wrapArr;
|
that.tableDatas = wrapArr;
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
|
||||||
},
|
},
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.tableDatas = [];
|
this.tableDatas = [];
|
||||||
|
|
|
@ -0,0 +1,224 @@
|
||||||
|
<!-- 成本分析 -->
|
||||||
|
<template>
|
||||||
|
<el-container class="app-container">
|
||||||
|
<el-header>
|
||||||
|
<div>
|
||||||
|
<el-select v-model="query.mgroup" placeholder="工段" clearable @change="mgroupChange" class="headerSearch">
|
||||||
|
<el-option v-for="item in mgroupOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||||
|
</el-select>
|
||||||
|
<el-select v-model="query.type" placeholder="查询类型" clearable class="headerSearch" @change="typeCange">
|
||||||
|
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||||
|
</el-select>
|
||||||
|
<el-date-picker
|
||||||
|
v-model="query.shift"
|
||||||
|
type="datetime"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
placeholder="班次"
|
||||||
|
class="headerSearch"
|
||||||
|
v-if="query.type == 0"
|
||||||
|
/>
|
||||||
|
<el-date-picker
|
||||||
|
v-model="value1"
|
||||||
|
type="datetimerange"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
placeholder="日"
|
||||||
|
range-separator="至"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
v-if="query.type == 1"
|
||||||
|
style="width: 300px;"
|
||||||
|
/>
|
||||||
|
<el-date-picker
|
||||||
|
v-model="query.month"
|
||||||
|
type="month"
|
||||||
|
value-format="YYYY-MM"
|
||||||
|
format="YYYY-MM"
|
||||||
|
placeholder="月"
|
||||||
|
v-if="query.type == 2"
|
||||||
|
/>
|
||||||
|
<el-button type="primary" icon="el-icon-search"
|
||||||
|
@click="getTableData">
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary" @click="exportExcel()" :loading="exportLoading">导出xlsx
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary" @click="handlePrint">打印
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</el-header>
|
||||||
|
<el-main>
|
||||||
|
<scTable
|
||||||
|
ref="stlogTable"
|
||||||
|
:apiObj="apiObjStlog"
|
||||||
|
:query="query"
|
||||||
|
:params="params"
|
||||||
|
row-key="id"
|
||||||
|
>
|
||||||
|
<el-table-column type="index" width="100" />
|
||||||
|
<el-table-column
|
||||||
|
label="异常类别"
|
||||||
|
prop="duration"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span v-if="scope.row.is_shutdown"
|
||||||
|
>停机</span
|
||||||
|
>
|
||||||
|
<span v-else>其他</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="发生时间"
|
||||||
|
prop="start_time"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="结束时间"
|
||||||
|
prop="end_time"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="原因类别"
|
||||||
|
prop="cate"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="异常名称"
|
||||||
|
prop="title"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="事件原因"
|
||||||
|
prop="reason"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="处置措施"
|
||||||
|
prop="measure"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="停机时长"
|
||||||
|
prop="duration"
|
||||||
|
></el-table-column>
|
||||||
|
</scTable>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
query: {
|
||||||
|
type: 1,
|
||||||
|
month: '',
|
||||||
|
year: '',
|
||||||
|
mgroup: '',
|
||||||
|
start_time__gt: '',
|
||||||
|
start_time__lt: '',
|
||||||
|
shift: '',
|
||||||
|
},
|
||||||
|
params:{
|
||||||
|
mgroup: "",
|
||||||
|
start_time__gt: '',
|
||||||
|
start_time__lt: '',
|
||||||
|
},
|
||||||
|
value1:[],
|
||||||
|
materialList: [],
|
||||||
|
mgroupOptions: [],
|
||||||
|
tableName: '班组成本计算',
|
||||||
|
options: [
|
||||||
|
// { id: 0, name: '班统计' },
|
||||||
|
{ id: 1, name: '日统计' },
|
||||||
|
{ id: 2, name: '月统计' },
|
||||||
|
],
|
||||||
|
tableNmae: '',
|
||||||
|
tableData1: [],
|
||||||
|
apiObjStlog: null,
|
||||||
|
sourceData: {}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
var myDate = new Date();
|
||||||
|
let month = myDate.getMonth() + 1;
|
||||||
|
if (month < 10) {
|
||||||
|
month = '0' + month;
|
||||||
|
}
|
||||||
|
this.getShift();
|
||||||
|
this.getMgroup();
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
//获取工段列表
|
||||||
|
getMgroup() {
|
||||||
|
this.$API.mtm.mgroup.list.req({ page: 0, cate: 'section' }).then(res => {
|
||||||
|
res.forEach(item => {
|
||||||
|
this.mgroupOptions.push(item);
|
||||||
|
})
|
||||||
|
this.mgroupOptions = this.mgroupOptions.reverse();
|
||||||
|
this.query.mgroup = this.mgroupOptions[0].id;
|
||||||
|
this.params.mgroup = this.mgroupOptions[0].id;
|
||||||
|
this.apiObjStlog = this.$API.wpm.stlog.list;
|
||||||
|
this.tableName = this.mgroupOptions[0].name;
|
||||||
|
this.getTableData();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//班组列表
|
||||||
|
getShift() {
|
||||||
|
this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
|
||||||
|
this.optionsShift = res;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//查询类型
|
||||||
|
// getData() {
|
||||||
|
// let that = this;
|
||||||
|
// that.tableData1 = [];
|
||||||
|
// let params = {};
|
||||||
|
// params.mgroup = that.query.mgroup;
|
||||||
|
// // if (that.query.type == 0) {//班
|
||||||
|
// // arr = that.query.day.split('-');
|
||||||
|
// // params.year_s = Number(arr[0]);
|
||||||
|
// // params.month_s = Number(arr[1]);
|
||||||
|
// // params.day_s = Number(arr[2]);
|
||||||
|
// // params.type = "day_s"
|
||||||
|
// // } else if (that.query.type == 1) {//日
|
||||||
|
// // arr = that.query.month.split('-');
|
||||||
|
// // params.start_time__year = Number(arr[0]);
|
||||||
|
// // params.start_time__month = Number(arr[1]);
|
||||||
|
// // params.start_time__day = Number(arr[2]);
|
||||||
|
// // } else {//月
|
||||||
|
// // params.start_time__year = Number(that.query.year);
|
||||||
|
// // params.start_time__month = Number(that.query.month);
|
||||||
|
// // }
|
||||||
|
// params.start_time__gt = that.query[0];
|
||||||
|
// params.start_time__lt = that.query[1];
|
||||||
|
// this.$API.wpm.stlog.list.req(params).then(res => {
|
||||||
|
// that.apiObjStlog = res;
|
||||||
|
// })
|
||||||
|
// },
|
||||||
|
getTableData() {
|
||||||
|
let that = this;
|
||||||
|
let arr = [];
|
||||||
|
if (that.query.type == 1) {
|
||||||
|
this.query.start_time__gt = this.value1[0];
|
||||||
|
this.query.start_time__lt = this.value1[1];}
|
||||||
|
else if (that.query.type == 2) {
|
||||||
|
console.log(this.query.month);
|
||||||
|
arr = that.query.month.split('-');
|
||||||
|
this.query.start_time__year = Number(arr[0]);
|
||||||
|
this.query.start_time__month = Number(arr[1]);
|
||||||
|
}
|
||||||
|
this.$refs.stlogTable.queryData(this.query);
|
||||||
|
},
|
||||||
|
|
||||||
|
handlePrint() {
|
||||||
|
this.$PRINT('#myReport');
|
||||||
|
},
|
||||||
|
exportExcel() {
|
||||||
|
this.exportLoading = true;
|
||||||
|
this.$XLSX('#myTable', this.tableName)
|
||||||
|
this.exportLoading = false;
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.printContainer {
|
||||||
|
width: 100%;
|
||||||
|
overflow-x: scroll;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -291,17 +291,17 @@
|
||||||
if(indexObj>0&&index3==0){
|
if(indexObj>0&&index3==0){
|
||||||
let inde = indexObj-1;
|
let inde = indexObj-1;
|
||||||
let ind =header2Objtem[inde].lengths*4+1;
|
let ind =header2Objtem[inde].lengths*4+1;
|
||||||
itemArr[ind] = item3.val_avg.toFixed(2);
|
itemArr[ind] = (item3.val_avg).toFixed(2);
|
||||||
itemArr.push(item3.num_test)
|
itemArr.push(item3.num_test)
|
||||||
itemArr.push(item3.num_ok)
|
itemArr.push(item3.num_ok)
|
||||||
let pass = (item3.rate_pass).toFixed(2);
|
let pass = (item3.rate_pass).toFixed(2);
|
||||||
pass= pass+'%';
|
pass= pass+'%';
|
||||||
itemArr.push(pass)
|
itemArr.push(pass)
|
||||||
}else{
|
}else{
|
||||||
itemArr.push(item3.val_avg.toFixed(2))
|
itemArr.push(Number(item3.val_avg).toFixed(2));
|
||||||
itemArr.push(item3.num_test)
|
itemArr.push(item3.num_test);
|
||||||
itemArr.push(item3.num_ok)
|
itemArr.push(item3.num_ok)
|
||||||
let pass = (item3.rate_pass).toFixed(2);
|
let pass = Number(item3.rate_pass).toFixed(2);
|
||||||
pass= pass+'%';
|
pass= pass+'%';
|
||||||
itemArr.push(pass)
|
itemArr.push(pass)
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,13 +139,6 @@
|
||||||
[37,'耗电量','日水泥包装耗电量(kw.h)'],
|
[37,'耗电量','日水泥包装耗电量(kw.h)'],
|
||||||
[38,'耗电量','日生活区耗电量(kw.h)'],
|
[38,'耗电量','日生活区耗电量(kw.h)'],
|
||||||
|
|
||||||
|
|
||||||
['生产异常动态','工段','类别','原因','处置措施','处置人'],
|
|
||||||
['生产异常动态','电石渣'],
|
|
||||||
['生产异常动态','原料磨'],
|
|
||||||
['生产异常动态','回转窑'],
|
|
||||||
['生产异常动态','煤磨'],
|
|
||||||
['生产异常动态','水泥磨'],
|
|
||||||
],
|
],
|
||||||
year:'',
|
year:'',
|
||||||
month:'',
|
month:'',
|
||||||
|
|
|
@ -103,27 +103,19 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[29,'成本','日电石渣成本(元/吨)'],
|
[29,'成本','月电石渣成本(元/吨)'],
|
||||||
[30,'成本','日生料成本(元/吨)'],
|
[30,'成本','月生料成本(元/吨)'],
|
||||||
[31,'成本','日熟料成本(元/吨)'],
|
[31,'成本','月熟料成本(元/吨)'],
|
||||||
[32,'成本','日水泥粉磨成本(元/吨)'],
|
[32,'成本','月水泥粉磨成本(元/吨)'],
|
||||||
[33,'成本','日水泥包装成本(元/吨)'],
|
[33,'成本','月水泥包装成本(元/吨)'],
|
||||||
|
|
||||||
|
|
||||||
[34,'耗电量','日电石渣耗电量(kw.h)'],
|
[34,'耗电量','月电石渣耗电量(kw.h)'],
|
||||||
[35,'耗电量','日生料耗电量(kw.h)'],
|
[35,'耗电量','月生料耗电量(kw.h)'],
|
||||||
[36,'耗电量','日熟料耗电量(kw.h)'],
|
[36,'耗电量','月熟料耗电量(kw.h)'],
|
||||||
[37,'耗电量','日水泥粉磨耗电量(kw.h)'],
|
[37,'耗电量','月水泥粉磨耗电量(kw.h)'],
|
||||||
[38,'耗电量','日水泥包装耗电量(kw.h)'],
|
[38,'耗电量','月水泥包装耗电量(kw.h)'],
|
||||||
[39,'耗电量','日生活区耗电量(kw.h)'],
|
[39,'耗电量','月生活区耗电量(kw.h)'],
|
||||||
|
|
||||||
|
|
||||||
['生产异常动态','工段','类别','原因','处置措施','处置人'],
|
|
||||||
['生产异常动态','电石渣'],
|
|
||||||
['生产异常动态','原料磨'],
|
|
||||||
['生产异常动态','回转窑'],
|
|
||||||
['生产异常动态','煤磨'],
|
|
||||||
['生产异常动态','水泥磨'],
|
|
||||||
],
|
],
|
||||||
year:'',
|
year:'',
|
||||||
month:'',
|
month:'',
|
||||||
|
@ -233,13 +225,14 @@
|
||||||
that.tableDatas[34][3] = dataList.原料磨.elec_consume;
|
that.tableDatas[34][3] = dataList.原料磨.elec_consume;
|
||||||
that.nowData[35] = dataList.回转窑.elec_consume;
|
that.nowData[35] = dataList.回转窑.elec_consume;
|
||||||
that.tableDatas[35][3] = dataList.回转窑.elec_consume;
|
that.tableDatas[35][3] = dataList.回转窑.elec_consume;
|
||||||
that.nowData[36] = dataList.煤磨.elec_consume;
|
// that.nowData[36] = dataList.煤磨.elec_consume;
|
||||||
that.tableDatas[36][3] = dataList.煤磨.elec_consume;
|
// that.tableDatas[36][3] = dataList.煤磨.elec_consume;
|
||||||
that.nowData[37] = dataList.水泥磨.elec_consume;
|
that.nowData[36] = dataList.水泥磨.elec_consume;
|
||||||
that.tableDatas[37][3] = dataList.水泥磨.elec_consume;
|
that.tableDatas[36][3] = dataList.水泥磨.elec_consume;
|
||||||
that.nowData[38] = dataList.水泥包装.elec_consume;
|
that.nowData[37] = dataList.水泥包装.elec_consume;
|
||||||
that.tableDatas[38][3] = dataList.水泥包装.elec_consume;
|
that.tableDatas[37][3] = dataList.水泥包装.elec_consume;
|
||||||
// that.nowData[39] = dataList.生活区.elec_consume;
|
that.nowData[38] = dataList.生活区.elec_consume;
|
||||||
|
that.tableDatas[38][3] = dataList.生活区.elec_consume;
|
||||||
}).then(res=>{
|
}).then(res=>{
|
||||||
//获取月和年目标
|
//获取月和年目标
|
||||||
let params1 = {};
|
let params1 = {};
|
||||||
|
@ -369,7 +362,7 @@
|
||||||
let label = item1.mgroup_name;
|
let label = item1.mgroup_name;
|
||||||
dataList1[label] = item1;
|
dataList1[label] = item1;
|
||||||
});
|
});
|
||||||
that.tableDatas[15][4] = dataList1.电石渣&&dataList1.电石渣.goal_val!==0&&dataList1.电石渣.goal_val!==''&&that.tableDatas[14][4]!==''?(that.tableDatas[14][4] /dataList1.电石渣.goal_val)*100:'/';
|
that.tableDatas[15][4] = dataList1.电石渣&&dataList1.电石渣.goal_val!==0&&dataList1.电石渣.goal_val!==''&&that.tableDatas[14][4]!==''?((that.tableDatas[14][4] /dataList1.电石渣.goal_val)*100).toFixed(2):'/';
|
||||||
that.tableDatas[17][4] = dataList1.原料磨&&dataList1.原料磨.goal_val!==0&&dataList1.原料磨.goal_val!==''&&that.tableDatas[14][4]!==''?((that.tableDatas[16][4] /dataList1.原料磨.goal_val)*100).toFixed(5):'/';
|
that.tableDatas[17][4] = dataList1.原料磨&&dataList1.原料磨.goal_val!==0&&dataList1.原料磨.goal_val!==''&&that.tableDatas[14][4]!==''?((that.tableDatas[16][4] /dataList1.原料磨.goal_val)*100).toFixed(5):'/';
|
||||||
that.tableDatas[19][4] = dataList1.回转窑&&dataList1.回转窑.goal_val!==0&&dataList1.回转窑.goal_val!==''&&that.tableDatas[14][4]!==''?((that.tableDatas[18][4] /dataList1.回转窑.goal_val)*100).toFixed(2):'/';
|
that.tableDatas[19][4] = dataList1.回转窑&&dataList1.回转窑.goal_val!==0&&dataList1.回转窑.goal_val!==''&&that.tableDatas[14][4]!==''?((that.tableDatas[18][4] /dataList1.回转窑.goal_val)*100).toFixed(2):'/';
|
||||||
that.tableDatas[21][4] = dataList1.水泥磨&&dataList1.水泥磨.goal_val!==0&&dataList1.水泥磨.goal_val!==''&&that.tableDatas[14][4]!==''?((that.tableDatas[20][4] /dataList1.水泥磨.goal_val)*100).toFixed(2):'/';
|
that.tableDatas[21][4] = dataList1.水泥磨&&dataList1.水泥磨.goal_val!==0&&dataList1.水泥磨.goal_val!==''&&that.tableDatas[14][4]!==''?((that.tableDatas[20][4] /dataList1.水泥磨.goal_val)*100).toFixed(2):'/';
|
||||||
|
|
|
@ -202,7 +202,7 @@
|
||||||
<td class="numCell">
|
<td class="numCell">
|
||||||
{{ reportItem.run_rate }}
|
{{ reportItem.run_rate }}
|
||||||
</td>
|
</td>
|
||||||
<td class="numCell">停机时长(h)</td>
|
<td class="numCell">停机时长(s)</td>
|
||||||
<td class="numCell">
|
<td class="numCell">
|
||||||
{{ reportItem.shut_sec }}
|
{{ reportItem.shut_sec }}
|
||||||
</td>
|
</td>
|
||||||
|
@ -306,7 +306,7 @@
|
||||||
<td class="numCell">处置人</td>
|
<td class="numCell">处置人</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-for="item in sflogexpList" :key="item.id">
|
<tr v-for="item in sflogexpList" :key="item.id">
|
||||||
<td class="numCell">{{ item.happen_time }}</td>
|
<td class="numCell">{{ item.stlog_.start_time }}</td>
|
||||||
<td class="numCell">{{ item.stlog_.cate }}</td>
|
<td class="numCell">{{ item.stlog_.cate }}</td>
|
||||||
<td class="numCell">{{ item.stlog_.reason }}</td>
|
<td class="numCell">{{ item.stlog_.reason }}</td>
|
||||||
<td class="numCell">{{ item.stlog_.measure }}</td>
|
<td class="numCell">{{ item.stlog_.measure }}</td>
|
||||||
|
@ -415,6 +415,7 @@ export default {
|
||||||
that.$API.wpm.sflogexp.list
|
that.$API.wpm.sflogexp.list
|
||||||
.req({ page: 0, sflog: id })
|
.req({ page: 0, sflog: id })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
console.log("sflogexp", res);
|
||||||
that.sflogexpList = res;
|
that.sflogexpList = res;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -101,6 +101,7 @@ export default {
|
||||||
mgroup: "",
|
mgroup: "",
|
||||||
},
|
},
|
||||||
tableDatas: [],
|
tableDatas: [],
|
||||||
|
goalDatas: [],
|
||||||
exportLoading: false,
|
exportLoading: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -119,11 +120,10 @@ export default {
|
||||||
params.year = year;
|
params.year = year;
|
||||||
params.mgroup = that.query.mgroup;
|
params.mgroup = that.query.mgroup;
|
||||||
this.$API.mtm.goal.list.req(params).then((res) => {
|
this.$API.mtm.goal.list.req(params).then((res) => {
|
||||||
let data = [];
|
|
||||||
if (res.length > 0) {
|
if (res.length > 0) {
|
||||||
data = res[0];
|
that.goalDatas = res[0];
|
||||||
}
|
}
|
||||||
that.getData(data);
|
that.getData(that.goalDatas);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -137,23 +137,13 @@ export default {
|
||||||
query0.mgroup = that.query.mgroup;
|
query0.mgroup = that.query.mgroup;
|
||||||
let wrapArr = [],
|
let wrapArr = [],
|
||||||
wrapArr0 = [],
|
wrapArr0 = [],
|
||||||
wrapArrs = [];
|
wrapArrs = [],
|
||||||
|
compareArr0 = [];
|
||||||
this.$API.enm.enstat.req(query0).then((res0) => {
|
this.$API.enm.enstat.req(query0).then((res0) => {
|
||||||
let data0 = res0;
|
let data0 = res0;
|
||||||
debugger;
|
|
||||||
if (data0.length > 0) {
|
if (data0.length > 0) {
|
||||||
data0.forEach((item0) => {
|
data0.forEach((item0) => {
|
||||||
//先按月份排序,再按班组排序
|
//先按月份排序,再按班组排序
|
||||||
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) {
|
|
||||||
ind0 = (n0 - 1) * 3 + 1;
|
|
||||||
} else if (team_name0.indexOf("丙") > -1) {
|
|
||||||
ind0 = (n0 - 1) * 3 + 2;
|
|
||||||
}
|
|
||||||
wrapArr0[ind0] = item0;
|
wrapArr0[ind0] = item0;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -161,19 +151,18 @@ export default {
|
||||||
this.$API.enm.enstat.req(that.query).then((res) => {
|
this.$API.enm.enstat.req(that.query).then((res) => {
|
||||||
let data = res;
|
let data = res;
|
||||||
if (data.length > 0) {
|
if (data.length > 0) {
|
||||||
|
data.forEach((item) => {
|
||||||
|
//先按月份排序,再按班组排序
|
||||||
|
let compareArr = [];
|
||||||
|
compareArr.push(item.month_s);
|
||||||
|
compareArr.push(item.team_name);
|
||||||
|
compareArr.push(item.elec_consume_unit);
|
||||||
|
compareArr0.push(compareArr);
|
||||||
|
});
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
//先按月份排序,再按班组排序
|
//先按月份排序,再按班组排序
|
||||||
let n = item.month_s;
|
let n = item.month_s;
|
||||||
let team_name = item.team_name;
|
|
||||||
let ind = 0;
|
let ind = 0;
|
||||||
if (team_name.indexOf("甲") > -1) {
|
|
||||||
ind = (n - 1) * 3;
|
|
||||||
} else if (team_name.indexOf("乙") > -1) {
|
|
||||||
ind = (n - 1) * 3 + 1;
|
|
||||||
} else if (team_name.indexOf("丙") > -1) {
|
|
||||||
ind = (n - 1) * 3 + 2;
|
|
||||||
}
|
|
||||||
wrapArrs[ind] = item;
|
|
||||||
let arr = [];
|
let arr = [];
|
||||||
let time = "" + item.year_s + "." + item.month_s;
|
let time = "" + item.year_s + "." + item.month_s;
|
||||||
arr.push(time);
|
arr.push(time);
|
||||||
|
@ -237,21 +226,30 @@ export default {
|
||||||
? wrapArr0[ind_pre].elec_consume_unit
|
? wrapArr0[ind_pre].elec_consume_unit
|
||||||
: "/";
|
: "/";
|
||||||
} else {
|
} else {
|
||||||
ind_pre = ind - 1;
|
// 如果 wrapArr数组长度大于0,那么循环遍历wrapArr数组,找到与item.month_s相差1的元素 而 item.name相同,并赋值给huanbi
|
||||||
huanbi = wrapArr[ind_pre]
|
compareArr0.forEach((item0) => {
|
||||||
? wrapArr[ind_pre].elec_consume_unit
|
if (item0[0] == item.month_s - 1 && item0[1] == item.team_name) {
|
||||||
? wrapArr[ind_pre].elec_consume_unit
|
huanbi = item0[2];
|
||||||
: "/"
|
}
|
||||||
: "/";
|
})
|
||||||
}
|
}
|
||||||
arr[19] = huanbi; //环期值(KW·h/t)上个月的值
|
arr[19] = huanbi; //环期值(KW·h/t)上个月的值
|
||||||
arr[20] = item.celec_consume_unit; //当期与环期差值(KW·h/t)
|
//当期与环期差值(KW·h/t)
|
||||||
|
if (arr[19] !== "/"){
|
||||||
|
arr[20] = (arr[16] - arr[19]).toFixed(2); //当期与环期差值(KW·h/t)
|
||||||
|
}else{
|
||||||
|
arr[20] = "/"; //当期与环期差值(KW·h/t)
|
||||||
|
}
|
||||||
arr[21] = item.celec_consume_unit; //环比增长率(%)
|
arr[21] = item.celec_consume_unit; //环比增长率(%)
|
||||||
|
if (arr[19] !=="/" && arr[20] !==0 && arr[20] !== "undefined"){
|
||||||
|
arr[21] = ((arr[19]/arr[20])*100).toFixed(2);
|
||||||
|
}else{
|
||||||
|
arr[21] = "/"; //环比增长率(%)= 当期与环期差值(KW·h/t)/环期值(KW·h/t)*100%
|
||||||
|
}
|
||||||
arr[22] = item.celec_consume_unit; //同比增长率(%)
|
arr[22] = item.celec_consume_unit; //同比增长率(%)
|
||||||
arr[23] = item.celec_consume_unit; //同比增长率(%)
|
arr[23] = item.celec_consume_unit; //同比增长率(%)
|
||||||
wrapArr[ind] = arr;
|
wrapArr.push(arr);
|
||||||
});
|
});
|
||||||
console.log(wrapArr);
|
|
||||||
that.tableDatas = wrapArr;
|
that.tableDatas = wrapArr;
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
|
@ -260,7 +258,7 @@ export default {
|
||||||
},
|
},
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.tableDatas = [];
|
this.tableDatas = [];
|
||||||
this.getData();
|
this.getData(this.goalDatas);
|
||||||
},
|
},
|
||||||
itemClick(type, item) {
|
itemClick(type, item) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
|
|
@ -231,7 +231,7 @@
|
||||||
<td class="numCell">处置人</td>
|
<td class="numCell">处置人</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-for="item in sflogexpList" :key="item.id">
|
<tr v-for="item in sflogexpList" :key="item.id">
|
||||||
<td class="numCell">{{ item.happen_time }}</td>
|
<td class="numCell">{{ item.stlog_.start_time }}</td>
|
||||||
<td class="numCell">{{ item.cate }}</td>
|
<td class="numCell">{{ item.cate }}</td>
|
||||||
<td class="numCell">{{ item.reason }}</td>
|
<td class="numCell">{{ item.reason }}</td>
|
||||||
<td class="numCell">{{ item.measure }}</td>
|
<td class="numCell">{{ item.measure }}</td>
|
||||||
|
|
|
@ -211,7 +211,7 @@
|
||||||
<td class="numCell">处置人</td>
|
<td class="numCell">处置人</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-for="item in sflogexpList" :key="item.id">
|
<tr v-for="item in sflogexpList" :key="item.id">
|
||||||
<td class="numCell">{{ item.happen_time }}</td>
|
<td class="numCell">{{ item.stlog_.start_time }}</td>
|
||||||
<td class="numCell">{{ item.stlog_.cate }}</td>
|
<td class="numCell">{{ item.stlog_.cate }}</td>
|
||||||
<td class="numCell">{{ item.stlog_.reason }}</td>
|
<td class="numCell">{{ item.stlog_.reason }}</td>
|
||||||
<td class="numCell">{{ item.stlog_.measure }}</td>
|
<td class="numCell">{{ item.stlog_.measure }}</td>
|
||||||
|
|
|
@ -85,6 +85,7 @@ export default {
|
||||||
timeStamp: null,
|
timeStamp: null,
|
||||||
exportLoading: false,
|
exportLoading: false,
|
||||||
tableDatas: [],
|
tableDatas: [],
|
||||||
|
goalDatas: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -105,9 +106,9 @@ export default {
|
||||||
this.$API.mtm.goal.list.req(params).then((res) => {
|
this.$API.mtm.goal.list.req(params).then((res) => {
|
||||||
let data = [];
|
let data = [];
|
||||||
if (res.length > 0) {
|
if (res.length > 0) {
|
||||||
data = res[0];
|
this.goalDatas = res[0];
|
||||||
}
|
}
|
||||||
that.getData(data);
|
that.getData(this.goalDatas);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -121,42 +122,31 @@ export default {
|
||||||
query0.mgroup = that.query.mgroup;
|
query0.mgroup = that.query.mgroup;
|
||||||
let wrapArr = [],
|
let wrapArr = [],
|
||||||
wrapArr0 = [],
|
wrapArr0 = [],
|
||||||
|
compareArr0 = [],
|
||||||
wrapArrs = [];
|
wrapArrs = [];
|
||||||
this.$API.enm.enstat.req(query0).then((res0) => {
|
this.$API.enm.enstat.req(query0).then((res0) => {
|
||||||
let data0 = res0;
|
let data0 = res0;
|
||||||
if (data0.length > 0) {
|
if (data0.length > 0) {
|
||||||
data0.forEach((item0) => {
|
data0.forEach((item0) => {
|
||||||
//先按月份排序,再按班组排序
|
//先按月份排序,再按班组排序
|
||||||
let n0 = item0.month_s;
|
|
||||||
let ind0 = 0;
|
|
||||||
if (item0.team_name.indexOf("甲") > -1) {
|
|
||||||
ind0 = (n0 - 1) * 3;
|
|
||||||
} else if (item0.team_name.indexOf("乙") > -1) {
|
|
||||||
ind0 = (n0 - 1) * 3 + 1;
|
|
||||||
} else if (item0.team_name.indexOf("丙") > -1) {
|
|
||||||
ind0 = (n0 - 1) * 3 + 2;
|
|
||||||
}
|
|
||||||
wrapArr0[ind0] = item0;
|
wrapArr0[ind0] = item0;
|
||||||
});
|
});
|
||||||
console.log(wrapArr0);
|
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
this.$API.enm.enstat.req(that.query).then((res) => {
|
this.$API.enm.enstat.req(that.query).then((res) => {
|
||||||
let data = res;
|
let data = res;
|
||||||
if (data.length > 0) {
|
if (data.length > 0) {
|
||||||
|
data.forEach((item) => {
|
||||||
|
//先按月份排序,再按班组排序
|
||||||
|
let compareArr = [];
|
||||||
|
compareArr.push(item.month_s);
|
||||||
|
compareArr.push(item.team_name);
|
||||||
|
compareArr.push(item.elec_consume_unit);
|
||||||
|
compareArr0.push(compareArr);
|
||||||
|
});
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
//先按月份排序,再按班组排序
|
//先按月份排序,再按班组排序
|
||||||
let n = item.month_s;
|
let n = item.month_s;
|
||||||
let team_name = item.team_name;
|
|
||||||
let ind = 0;
|
|
||||||
if (team_name.indexOf("甲") > -1) {
|
|
||||||
ind = (n - 1) * 3;
|
|
||||||
} else if (team_name.indexOf("乙") > -1) {
|
|
||||||
ind = (n - 1) * 3 + 1;
|
|
||||||
} else if (team_name.indexOf("丙") > -1) {
|
|
||||||
ind = (n - 1) * 3 + 2;
|
|
||||||
}
|
|
||||||
wrapArrs[ind] = item;
|
|
||||||
let arr = [];
|
let arr = [];
|
||||||
let time = "" + item.year_s + "." + item.month_s;
|
let time = "" + item.year_s + "." + item.month_s;
|
||||||
arr.push(time);
|
arr.push(time);
|
||||||
|
@ -179,22 +169,21 @@ export default {
|
||||||
? wrapArr0[ind_pre].elec_consume_unit
|
? wrapArr0[ind_pre].elec_consume_unit
|
||||||
: "/";
|
: "/";
|
||||||
} else {
|
} else {
|
||||||
ind_pre = n - 1;
|
// 如果 wrapArr数组长度大于0,那么循环遍历wrapArr数组,找到与item.month_s相差1的元素 而 item.name相同,并赋值给huanbi
|
||||||
huanqi = wrapArr[ind_pre]
|
compareArr0.forEach((item0) => {
|
||||||
? wrapArr[ind_pre].elec_consume_unit
|
if (item0[0] == item.month_s - 1 && item0[1] == item.team_name) {
|
||||||
? wrapArr[ind_pre].elec_consume_unit
|
huanqi = item0[2];
|
||||||
: "/"
|
}
|
||||||
: "/";
|
})
|
||||||
}
|
}
|
||||||
arr[7] = huanqi; //环期值(KW·h/t)上个月的值
|
arr[7] = huanqi; //环期值(KW·h/t)上个月的值
|
||||||
if (huanqi !== "/") {
|
if (arr[6] !== "/"){
|
||||||
huanqicha = item.celec_consume_unit - huanqi;
|
arr[8] = (arr[4] - arr[7]).toFixed(2); //当期与环期差值(KW·h/t)
|
||||||
} else {
|
}else{
|
||||||
huanqicha = item.celec_consume_unit;
|
arr[8] = "/"; //当期与环期差值(KW·h/t)
|
||||||
}
|
}
|
||||||
arr[8] = huanqicha; //当期与环期差值(KW·h/t)
|
// arr[8] = huanqicha; //当期与环期差值(KW·h/t)
|
||||||
arr[9] =
|
arr[9] = arr[8] != "/" ? ((arr[7] / arr[8]) * 100).toFixed(2) : 0; //环比增长率(%)
|
||||||
huanqi != "/" ? (huanqicha / huanqi) * 100 : 0; //环比增长率(%)
|
|
||||||
if (wrapArr0[n]) {
|
if (wrapArr0[n]) {
|
||||||
tongqicha =
|
tongqicha =
|
||||||
item.celec_consume_unit -
|
item.celec_consume_unit -
|
||||||
|
@ -206,8 +195,10 @@ export default {
|
||||||
}
|
}
|
||||||
arr[10] = tongqi; //同比增长率(%)
|
arr[10] = tongqi; //同比增长率(%)
|
||||||
arr[11] = 0; //得分
|
arr[11] = 0; //得分
|
||||||
wrapArr[ind] = arr;
|
wrapArr.push(arr);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
console.log(wrapArr);
|
||||||
that.tableDatas = wrapArr;
|
that.tableDatas = wrapArr;
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
|
@ -216,7 +207,7 @@ export default {
|
||||||
},
|
},
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.tableDatas = [];
|
this.tableDatas = [];
|
||||||
this.getData();
|
this.getData(this.goalDatas);
|
||||||
},
|
},
|
||||||
itemClick(type, item) {
|
itemClick(type, item) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
|
|
@ -1,40 +0,0 @@
|
||||||
<template>
|
|
||||||
<el-container>
|
|
||||||
<el-header>
|
|
||||||
<div class="left-panel">
|
|
||||||
<el-segmented v-model="value" :options="options" size="large" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</el-header>
|
|
||||||
<el-main class="nopadding">
|
|
||||||
<TaskResult v-if="value == 0" />
|
|
||||||
<Xscript v-if="value == 1" />
|
|
||||||
</el-main>
|
|
||||||
</el-container>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import Xscript from './xscript.vue'
|
|
||||||
import TaskResult from './taskresult.vue'
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
Xscript, TaskResult
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
value: 0,
|
|
||||||
options: [{
|
|
||||||
label: '任务执行',
|
|
||||||
value: 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '数据转储',
|
|
||||||
value: 1
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
|
@ -1,222 +0,0 @@
|
||||||
<template>
|
|
||||||
<el-container>
|
|
||||||
<el-header>
|
|
||||||
<div class="left-panel">
|
|
||||||
<el-select
|
|
||||||
v-model="query.mpoint"
|
|
||||||
placeholder="测点"
|
|
||||||
clearable
|
|
||||||
style="margin: 0 6px; width: 300px"
|
|
||||||
@change="handleQuery"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in mpoints"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.id"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
|
||||||
<el-select
|
|
||||||
v-model="query.type"
|
|
||||||
placeholder="类型"
|
|
||||||
style="margin: 0 6px; width: 120px"
|
|
||||||
@change="handleQuery"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in options"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
|
||||||
<el-date-picker v-model="timeRange" type="datetimerange" range-separator="至"
|
|
||||||
start-placeholder="开始时间" end-placeholder="结束时间" @change="handleQuery"
|
|
||||||
style="width: 100%" />
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
icon="el-icon-search"
|
|
||||||
style="margin-left: 6px"
|
|
||||||
@click="handleQuery"
|
|
||||||
></el-button>
|
|
||||||
</div>
|
|
||||||
</el-header>
|
|
||||||
<el-main class="nopadding">
|
|
||||||
<scTable
|
|
||||||
ref="table"
|
|
||||||
:apiObj="apiObj"
|
|
||||||
row-key="id"
|
|
||||||
stripe
|
|
||||||
:params="params"
|
|
||||||
:query="query"
|
|
||||||
highlightCurrentRow
|
|
||||||
@row-click="rowClick"
|
|
||||||
>
|
|
||||||
<el-table-column type="index" width="50" />
|
|
||||||
<el-table-column label="测点" prop="mpoint_name">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="所属集合" prop="mgroup_name">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="类型" prop="type" width="80"> </el-table-column>
|
|
||||||
<el-table-column label="年" prop="year" width="80"> </el-table-column>
|
|
||||||
<el-table-column label="班年" prop="year_s" width="80"> </el-table-column>
|
|
||||||
<el-table-column label="月" prop="month" width="50"> </el-table-column>
|
|
||||||
<el-table-column label="班月" prop="month_s" width="50"> </el-table-column>
|
|
||||||
<el-table-column label="日" prop="day" width="50"> </el-table-column>
|
|
||||||
<el-table-column label="班日" prop="day_s" width="50"> </el-table-column>
|
|
||||||
<el-table-column label="时" prop="hour" width="50"> </el-table-column>
|
|
||||||
<el-table-column label="当前值" prop="val"></el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
label="校正值"
|
|
||||||
prop="val_correct"
|
|
||||||
></el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
label="原始计算值"
|
|
||||||
prop="val_origin"
|
|
||||||
></el-table-column>
|
|
||||||
<!-- <el-table-column
|
|
||||||
label="操作"
|
|
||||||
fixed="right"
|
|
||||||
align="center"
|
|
||||||
width="140"
|
|
||||||
>
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button
|
|
||||||
link
|
|
||||||
size="small"
|
|
||||||
@click="handle_edit(scope.row)"
|
|
||||||
type="primary"
|
|
||||||
>校正</el-button
|
|
||||||
>
|
|
||||||
</template>
|
|
||||||
</el-table-column> -->
|
|
||||||
</scTable>
|
|
||||||
</el-main>
|
|
||||||
<el-dialog title="校正" v-model="visible">
|
|
||||||
<el-main style="padding: 0 20px 20px 20px">
|
|
||||||
<el-form
|
|
||||||
ref="dialogForm"
|
|
||||||
:model="form"
|
|
||||||
label-position="right"
|
|
||||||
label-width="80px"
|
|
||||||
style="padding: 0 10px"
|
|
||||||
>
|
|
||||||
<el-row>
|
|
||||||
<el-col :md="12" :sm="24">
|
|
||||||
<el-form-item label="所属部门">
|
|
||||||
<span>{{ form.belong_dept_name }}</span>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :md="12" :sm="24">
|
|
||||||
<el-form-item label="工段名称">
|
|
||||||
<span>{{ form.mgroup_name }}</span>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :md="12" :sm="24">
|
|
||||||
<el-form-item label="校正值">
|
|
||||||
<el-input-number
|
|
||||||
v-model="form.val_correct"
|
|
||||||
:min="0"
|
|
||||||
controls-position="right"
|
|
||||||
></el-input-number>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
</el-main>
|
|
||||||
<el-footer>
|
|
||||||
<el-button type="primary" :loading="isSaveing" @click="submit"
|
|
||||||
>保存</el-button
|
|
||||||
>
|
|
||||||
<el-button @click="visible = false">取消</el-button>
|
|
||||||
</el-footer>
|
|
||||||
</el-dialog>
|
|
||||||
</el-container>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: "sflog",
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
apiObj: this.$API.enm.mpoint.stat,
|
|
||||||
params: {},
|
|
||||||
query: {
|
|
||||||
mpoint: null,
|
|
||||||
type: "hour",
|
|
||||||
start_time: null,
|
|
||||||
end_time: null
|
|
||||||
},
|
|
||||||
options: [
|
|
||||||
{ label: "小时", value: "hour"},
|
|
||||||
{ label: "天", value: "day" },
|
|
||||||
{ label: "月", value: "month"},
|
|
||||||
{ label: "班天", value: "day_s" },
|
|
||||||
{ label: "班月", value: "month_s" },
|
|
||||||
],
|
|
||||||
form: {
|
|
||||||
id: "",
|
|
||||||
val_correct: "",
|
|
||||||
},
|
|
||||||
visible: false,
|
|
||||||
mpoints: [],
|
|
||||||
timeRange: []
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.getMpoints();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getMpoints() {
|
|
||||||
let that = this;
|
|
||||||
this.$API.enm.mpoint.list
|
|
||||||
.req({ page: 0})
|
|
||||||
.then((res) => {
|
|
||||||
that.mpoints = res;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
handle_add() {},
|
|
||||||
handleQuery() {
|
|
||||||
console.log(this.query)
|
|
||||||
if (this.timeRange) {
|
|
||||||
this.query.start_time = this.timeRange[0]
|
|
||||||
this.query.end_time = this.timeRange[1]
|
|
||||||
} else {
|
|
||||||
this.query.start_time = null
|
|
||||||
this.query.end_time = null
|
|
||||||
}
|
|
||||||
this.$refs.table.queryData(this.query);
|
|
||||||
},
|
|
||||||
//编辑
|
|
||||||
handle_edit(row) {
|
|
||||||
this.form = { ...row };
|
|
||||||
this.form.val_correct = row.val;
|
|
||||||
this.visible = true;
|
|
||||||
},
|
|
||||||
//提交
|
|
||||||
submit() {
|
|
||||||
this.$refs.dialogForm.validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
this.isSaveing = true;
|
|
||||||
let obj = {};
|
|
||||||
obj.val_correct = this.form.val_correct;
|
|
||||||
this.$API.enm.mpointstat.correct
|
|
||||||
.req(this.form.id, obj)
|
|
||||||
.then((res) => {
|
|
||||||
this.isSaveing = false;
|
|
||||||
this.visible = false;
|
|
||||||
this.$refs.table.queryData(this.query);
|
|
||||||
})
|
|
||||||
.catch((e) => {
|
|
||||||
this.isSaveing = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.searchBtn {
|
|
||||||
margin-left: 5px;
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,75 +0,0 @@
|
||||||
<template>
|
|
||||||
<el-container>
|
|
||||||
<el-header>
|
|
||||||
<div class="right-panel">
|
|
||||||
<el-select v-model="query.status" placeholder="执行状态" clearable @change="handleQuery">
|
|
||||||
<el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
<el-date-picker v-model="timeRange" type="datetimerange" range-separator="至"
|
|
||||||
start-placeholder="开始时间" end-placeholder="结束时间" clearable @change="handleQuery"/>
|
|
||||||
</div>
|
|
||||||
</el-header>
|
|
||||||
<el-main>
|
|
||||||
<scTable ref="table" :apiObj="apiObj" :params="params" @row-click="itemDetail">
|
|
||||||
<el-table-column label="执行ID" prop="task_id" width="280" :show-overflow-tooltip="true"></el-table-column>
|
|
||||||
<el-table-column label="名称" prop="periodic_task_name" width="240" :show-overflow-tooltip="true"></el-table-column>
|
|
||||||
<el-table-column label="执行方法" prop="task_name" width="260" :show-overflow-tooltip="true"></el-table-column>
|
|
||||||
<el-table-column label="状态" prop="status" width="80" :show-overflow-tooltip="true"></el-table-column>
|
|
||||||
<el-table-column label="执行返回" prop="result" width="180" :show-overflow-tooltip="true"></el-table-column>
|
|
||||||
<el-table-column label="开始时间" prop="date_created" width="160" :show-overflow-tooltip="true"></el-table-column>
|
|
||||||
<el-table-column label="结束时间" prop="date_done" width="160" :show-overflow-tooltip="true"></el-table-column>
|
|
||||||
<el-table-column label="错误信息" prop="traceback" min-width="80" :show-overflow-tooltip="true"></el-table-column>
|
|
||||||
</scTable>
|
|
||||||
</el-main>
|
|
||||||
<el-dialog v-model="dVisible" title="详情">
|
|
||||||
<el-descriptions :column="1" border>
|
|
||||||
<el-descriptions-item label="开始执行" width="80">{{ current_tr.date_created }}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="结束执行">{{ current_tr.date_created }}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="执行状态">{{ current_tr.status }}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="返回结果">{{ current_tr.result }}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="错误信息">{{ current_tr.traceback }}</el-descriptions-item>
|
|
||||||
</el-descriptions>
|
|
||||||
</el-dialog>
|
|
||||||
</el-container>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
apiObj: this.$API.system.task.result,
|
|
||||||
params: {
|
|
||||||
task_name__in: "apps.enm.tasks.cal_mpointstats"
|
|
||||||
},
|
|
||||||
timeRange:[],
|
|
||||||
query: {},
|
|
||||||
statusOptions: [
|
|
||||||
{label: 'SUCCESS', value: 'SUCCESS'},
|
|
||||||
{label: 'FAILURE', value: 'FAILURE'},
|
|
||||||
{label: 'REVOKED', value: 'REVOKED'},
|
|
||||||
{label: 'PENDING', value: 'PENDING'},
|
|
||||||
{label: 'RETRY', value: 'RETRY'},
|
|
||||||
],
|
|
||||||
dVisible: false,
|
|
||||||
current_tr: {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
itemDetail(row){
|
|
||||||
this.dVisible = true;
|
|
||||||
this.current_tr = row;
|
|
||||||
},
|
|
||||||
handleQuery(){
|
|
||||||
if(this.timeRange){
|
|
||||||
this.query.date_created__gte = this.timeRange[0]
|
|
||||||
this.query.date_created__lte = this.timeRange[1]
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
this.query.date_created__gte = null
|
|
||||||
this.query.date_created__lte = null
|
|
||||||
}
|
|
||||||
this.$refs.table.queryData(this.query)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
|
@ -1,224 +0,0 @@
|
||||||
<template>
|
|
||||||
<el-container>
|
|
||||||
<el-header>
|
|
||||||
<div class="left-panel">
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
icon="el-icon-plus"
|
|
||||||
@click="add"
|
|
||||||
v-auth="'xscript.create'"
|
|
||||||
></el-button>
|
|
||||||
</div>
|
|
||||||
</el-header>
|
|
||||||
<el-main class="nopadding">
|
|
||||||
<scTable ref="table" :apiObj="apiObj" hidePagination>
|
|
||||||
<el-table-column label="#" type="index" width="50">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-link type="primary" @click="lastDetail(scope.row)">{{ scope.$index + 1 }}</el-link>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="名称" prop="name" min-width="240" :show-overflow-tooltip="true"></el-table-column>
|
|
||||||
<el-table-column label="时间策略" prop="myschedule_name" min-width="300" :show-overflow-tooltip="true"></el-table-column>
|
|
||||||
<el-table-column label="是否启用" width="80" :show-overflow-tooltip="true">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-icon v-if="scope.row.enabled" color="green"
|
|
||||||
><CircleCheckFilled
|
|
||||||
/></el-icon>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="运行次数" prop="total_run_count" width="80" :show-overflow-tooltip="true"></el-table-column>
|
|
||||||
<el-table-column label="最后运行时间" prop="last_run_at" width="160" :show-overflow-tooltip="true"></el-table-column>
|
|
||||||
<el-table-column label="操作" fixed="right" align="left" width="200">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button plain type="warning" size="small" @click="table_toggle(scope.row, scope.$index)"
|
|
||||||
v-auth="'xscript.update'">开/停</el-button>
|
|
||||||
<el-button plain type="warning" size="small" @click="table_edit(scope.row, scope.$index)"
|
|
||||||
v-auth="'xscript.update'">编辑</el-button>
|
|
||||||
<el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)">
|
|
||||||
<template #reference>
|
|
||||||
<el-button plain type="danger" size="small" v-auth="'xscript.delete'">删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-popconfirm>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</scTable>
|
|
||||||
</el-main>
|
|
||||||
<el-drawer
|
|
||||||
title="新增/编辑"
|
|
||||||
v-model="visible"
|
|
||||||
:size="1000"
|
|
||||||
destroy-on-close
|
|
||||||
>
|
|
||||||
<el-container>
|
|
||||||
<el-main style="padding: 0 20px 20px 20px">
|
|
||||||
<el-form ref="rForm" :model="form">
|
|
||||||
<el-form-item label="脚本名称" required>
|
|
||||||
<el-input v-model="form.name"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="脚本内容" required>
|
|
||||||
<Codemirror
|
|
||||||
v-model:value="form.code"
|
|
||||||
:options="cmOptions"
|
|
||||||
border
|
|
||||||
ref="cmRef"
|
|
||||||
height="300"
|
|
||||||
width="100%"
|
|
||||||
style="line-height: 180%"
|
|
||||||
>
|
|
||||||
</Codemirror>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="基础数据">
|
|
||||||
<JsonEditorVue
|
|
||||||
style="width: 100%"
|
|
||||||
v-model="form.base_data"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="变动数据">
|
|
||||||
<el-button type="warning" @click="openCdg" size="small">变更</el-button><span> ------ {{ form.change_data }}</span>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="时间策略" required>
|
|
||||||
<el-select
|
|
||||||
v-model="form.myschedule"
|
|
||||||
style="width: 100%"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in schOptions"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.id"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</el-main>
|
|
||||||
<el-footer>
|
|
||||||
<el-button type="primary" @click="submit">提交</el-button>
|
|
||||||
</el-footer>
|
|
||||||
</el-container>
|
|
||||||
</el-drawer>
|
|
||||||
<el-dialog title="最后执行" v-model="detailVisible">
|
|
||||||
<el-descriptions :column="1" border v-if="detailForm.last_run_data != null">
|
|
||||||
<el-descriptions-item label="开始执行">{{ detailForm.last_run_data.date_created }}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="结束执行">{{ detailForm.last_run_data.date_created }}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="执行状态">{{ detailForm.last_run_data.status }}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="返回结果">{{ detailForm.last_run_data.result }}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="错误信息">{{ detailForm.last_run_data.traceback }}</el-descriptions-item>
|
|
||||||
</el-descriptions>
|
|
||||||
</el-dialog>
|
|
||||||
<el-dialog title="变更数据" v-model="cDgVisible">
|
|
||||||
<JsonEditorVue
|
|
||||||
style="width: 100%"
|
|
||||||
v-model="xdata"
|
|
||||||
/>
|
|
||||||
<el-footer>
|
|
||||||
<el-button type="primary" @click="submit2">提交</el-button>
|
|
||||||
</el-footer>
|
|
||||||
</el-dialog>
|
|
||||||
</el-container>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import JsonEditorVue from "json-editor-vue3";
|
|
||||||
import "codemirror/mode/python/python.js";
|
|
||||||
import 'codemirror/lib/codemirror.css'
|
|
||||||
import Codemirror from "codemirror-editor-vue3";
|
|
||||||
const dForm = {
|
|
||||||
base_data: {},
|
|
||||||
};
|
|
||||||
export default {
|
|
||||||
components: { JsonEditorVue, Codemirror },
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
apiObj: this.$API.enm.xscript.list,
|
|
||||||
visible: false,
|
|
||||||
form: {},
|
|
||||||
detailForm: {},
|
|
||||||
detailVisible: false,
|
|
||||||
schOptions: [],
|
|
||||||
cmOptions: {
|
|
||||||
mode: "text/x-python",
|
|
||||||
theme: "default",
|
|
||||||
readOnly: false,
|
|
||||||
lineNumbers: true,
|
|
||||||
lineWiseCopyCut: true,
|
|
||||||
// gutters: ["CodeMirror-lint-markers"],
|
|
||||||
lint: true,
|
|
||||||
autoRefresh: true
|
|
||||||
},
|
|
||||||
cDgVisible: false,
|
|
||||||
xdata: {}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.getSchOptions();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
openCdg(){
|
|
||||||
this.xdata = Object.assign({}, this.form.change_data)
|
|
||||||
this.cDgVisible = true;
|
|
||||||
},
|
|
||||||
lastDetail(row) {
|
|
||||||
this.$API.enm.xscript.item.req(row.id).then(res=>{
|
|
||||||
this.detailForm = res
|
|
||||||
this.detailVisible = true
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getSchOptions() {
|
|
||||||
this.$API.system.myschedule.list.req({ page: 0 }).then((res) => {
|
|
||||||
this.schOptions = res;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
add() {
|
|
||||||
this.form = Object.assign({}, dForm);
|
|
||||||
this.visible = true;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.cmRef.refresh()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
table_edit(row) {
|
|
||||||
this.$API.enm.xscript.item.req(row.id).then(res=>{
|
|
||||||
this.form = res
|
|
||||||
this.visible = true
|
|
||||||
})
|
|
||||||
},
|
|
||||||
table_del(row) {
|
|
||||||
this.$API.enm.xscript.delete.req(row.id).then(()=>{
|
|
||||||
this.$message.success('删除成功')
|
|
||||||
this.$refs.table.refresh()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
table_toggle(row) {
|
|
||||||
this.$API.enm.xscript.toggle.req(row.id).then(() => {
|
|
||||||
this.$message.success("操作成功");
|
|
||||||
this.$refs.table.refresh();
|
|
||||||
})
|
|
||||||
},
|
|
||||||
submit2() {
|
|
||||||
this.$API.enm.xscript.change_data.req(this.form.id, {change_data: this.xdata}).then(() => {
|
|
||||||
this.$message.success("操作成功");
|
|
||||||
this.form.change_data = this.xdata;
|
|
||||||
this.cDgVisible = false;
|
|
||||||
})
|
|
||||||
},
|
|
||||||
submit() {
|
|
||||||
this.$refs.rForm.validate(async (valid)=>{
|
|
||||||
if(valid){
|
|
||||||
if(this.form.id){
|
|
||||||
this.$API.enm.xscript.update.req(this.form.id, this.form).then(()=>{
|
|
||||||
this.$message.success('更新成功')
|
|
||||||
this.visible = false
|
|
||||||
this.$refs.table.refresh()
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
this.$API.enm.xscript.create.req(this.form).then(()=>{
|
|
||||||
this.$message.success('添加成功')
|
|
||||||
this.visible = false
|
|
||||||
this.$refs.table.refresh()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
Loading…
Reference in New Issue