feat: 修改主要报表

This commit is contained in:
zty 2024-12-25 16:55:17 +08:00
parent e2595bf3c9
commit a0b1659f10
9 changed files with 257 additions and 281 deletions

View File

@ -700,29 +700,42 @@ export default {
that.option.xAxis.data = datelist;
that.xAxisDate = datelist;
that.$nextTick(() => {
//
that.productNum();
that.waterAirData();
that.getMonthData();
//
that.eqRate();
//
that.generation();
//
that.proceElec();
//
that.qualAnalys();
//
that.dataCollect();
that.initDomStyle();
that.initFactory();
this.productNum();
this.waterAirData();
this.getMonthData();
this.eqRate();
this.generation();
this.proceElec();
this.qualAnalys();
this.dataCollect();
that.timerTime = setInterval(() => {
that.showTime();
}, 1000);
that.timerOther = setInterval(() => {
that.initializeData();
}, 180000); // 3
});
},
beforeUnmount() {
//
if (this.timerTime) {
clearInterval(this.timerTime);}
if (this.timerOther) {
clearInterval(this.timerOther);}
},
methods: {
initializeData() {
this.productNum();
this.waterAirData();
this.getMonthData();
this.eqRate();
this.generation();
this.proceElec();
this.qualAnalys();
this.dataCollect();
},
productNum() {
let that = this;
// option1
@ -945,6 +958,7 @@ export default {
return this.$API.mtm.mgroup.list.req({ page: 0, search: "水泥包装" });
}).then((res) => {
that.out_cement = res[0]?.id; //id
let query = {
page: 0,
year_s: that.currentYear,
@ -952,11 +966,11 @@ export default {
type: "month_s",
mgroup: that.out_cement,
};
return that.$API.enm.enstat.req(query);
return that.$API.enm.mpointstat.list.req(query);
}).then((response) => {
response.forEach((item) => {
if (item.month_s == that.currentMonth) {
that.totalData.out_cement = item.total_production; //
if (item.mpoint_name == '出厂水泥') {
that.totalData.out_cement = item.val || 0; //
}
})
})
@ -1281,7 +1295,6 @@ export default {
let query2 = generateQueryMpoint("3631880992400515072");
return this.$API.enm.mpointstat.list.req(query2);
}).then((response) => {
console.log(response,'query2');
let maxId;
response.forEach((item) => {
let ind = item.month - 1;
@ -2027,26 +2040,6 @@ export default {
return JSON.parse(JSON.stringify(obj));
},
},
beforeUnmount() {
let that = this;
this.scene = null;
// clearInterval(that.timerTime);
// clearInterval(that.timerData);
// clearInterval(that.qualityTimer);
that.timerTime = null;
that.timerData = null;
that.qualityTimer = null;
},
beforeDestoryed() {
let that = this;
this.scene = null;
// clearInterval(that.timerTime);
// clearInterval(that.timerData);
// clearInterval(that.qualityTimer);
that.timerTime = null;
that.timerData = null;
that.qualityTimer = null;
},
};
</script>
<style scoped>

View File

@ -29,7 +29,7 @@
</tr>
<tr>
<th colspan="2">参数</th>
<th>上个小时</th>
<th>本日</th>
<th>昨日</th>
<th>本月</th>
<th>本年</th>
@ -123,7 +123,7 @@
</div>
</div>
<div class="chartWrap" v-show="typeRadio == 'day'">
<div class="chartTitle">小时生产参数统计图</div>
<div class="chartTitle">本日生产参数统计图</div>
<scEcharts
height="400px"
width="1033px"
@ -459,14 +459,13 @@ export default {
let year_d = year,
month_d = month,
days_d = days;
if (hours < 21) {
//21
//8
let newDate = timeDate - dayTime;
let lastDate = new Date(newDate);
year_d = lastDate.getFullYear();
month_d = lastDate.getMonth() + 1;
days_d = lastDate.getDate();
}
//
let hourTime = timeDate - 3600000;
let hourDate = new Date(hourTime);
@ -477,7 +476,6 @@ export default {
this.$API.mtm.mgroup.list
.req({ page: 0, search: "煤磨" })
.then((res) => {
console.log("煤磨", res);
that.query.mgroup = res[0].id;
//
let params3 = {};
@ -491,6 +489,11 @@ export default {
if (res3.length > 0) {
let data3 = res3[0];
that.tableDatas[0][3] = data3.total_production;
if(data3.total_production){
that.tableDatas[3][3] = 0;
that.tableDatas[4][3] = 0;
that.tableDatas[5][3] = 0;
}
that.tableDatas[1][3] = data3.production_hour;
that.tableDatas[2][3] = data3.run_hour;
that.tableDatas[3][3] = data3.run_rate;
@ -498,21 +501,34 @@ export default {
that.tableDatas[5][3] = data3.elec_consume;
}
});
//
//
let params4 = {};
params4.page = 0;
params4.year = year_h;
params4.month = month_h;
params4.day = days_h;
params4.hour = hours_h;
params4.type = "hour_s";
params4.year_s = year_h;
params4.month_s = month_h;
params4.day_s = days_h;
params4.type = "day_s";
params4.mgroup = that.query.mgroup;
console.log("本日", params4);
that.$API.enm.enstat.req(params4).then((res4) => {
if (res4.length > 0) {
if (res4) {
let data4 = res4[0];
that.tableDatas[0][2] = data4.total_production;
that.tableDatas[4][2] = data4.elec_consume_unit;
that.tableDatas[5][2] = data4.elec_consume;
if (data4.total_production < 1 ){
that.tableDatas[0][2] = 0;
that.tableDatas[1][2] = 0;
that.tableDatas[2][2] = 0;
that.tableDatas[3][2] = 0;
that.tableDatas[4][2] = 0;
that.tableDatas[5][2] = 0;
}else{
that.tableDatas[1][2] = data4.production_hour;
that.tableDatas[2][2] = data4.run_hour;
that.tableDatas[3][2] = data4.run_rate;
that.tableDatas[4][2] = data4.elec_consume_unit;
that.tableDatas[5][2] = data4.elec_consume;
}
}
});
//

View File

@ -436,7 +436,7 @@ export default {
need_display: 1,
ordering: "report_sortstr",
material__code__in: "elec,elec_0",
query: "{ id, name, nickname, mgroup_name, unit, report_sortstr }",
query: "{ id, name, nickname, mgroup_name, unit, report_sortstr, ep_monitored_name }",
})
.then((res) => {
// that.mpointList = that.mockDatas.filter((item) => {
@ -479,7 +479,7 @@ export default {
let arr = [];
arr[0] =
item.mgroup_name != null ? item.mgroup_name : item.name;
arr[1] = item.nickname != null ? item.nickname : item.name;
arr[1] = item.ep_monitored_name?item.ep_monitored_name:item.nickname?item.nickname:item.name;
arr[2] = item.unit;
for (let i = 0; i < 24; i++) {
arr[i + 3] = 0;
@ -488,10 +488,7 @@ export default {
let obj = {};
obj.mgroupName =
item.mgroup_name != null ? item.mgroup_name : item.name;
obj.nickname =
item.nickname != null && item.nickname != ""
? item.nickname
: item.name;
obj.nickname = item.ep_monitored_name?item.ep_monitored_name:item.nickname?item.nickname:item.name;
obj.unit = item.unit;
that.tableDatas2.push(obj);
that.getData(item.id, index);
@ -554,7 +551,7 @@ export default {
: item.nickname != null
? item.nickname
: item.name;
arr[1] = item.nickname != null ? item.nickname : item.name;
arr[1] = item.ep_monitored_name?item.ep_monitored_name:item.nickname?item.nickname:item.name;
arr[2] = item.unit;
for (let i = 0; i < that.days; i++) {
arr[i + 3] = 0;
@ -563,10 +560,7 @@ export default {
let obj = {};
obj.mgroupName =
item.mgroup_name != null ? item.mgroup_name : item.name;
obj.nickname =
item.nickname != null && item.nickname != ""
? item.nickname
: item.name;
obj.nickname = item.ep_monitored_name?item.ep_monitored_name:item.nickname?item.nickname:item.name;
obj.unit = item.unit;
that.tableDatas_day.push(obj);
@ -626,7 +620,7 @@ export default {
let arr = [];
arr[0] =
item.mgroup_name != null ? item.mgroup_name : item.name;
arr[1] = item.nickname != null ? item.nickname : item.name;
arr[1] = item.ep_monitored_name?item.ep_monitored_name:item.nickname?item.nickname:item.name;
arr[2] = item.unit;
for (let i = 0; i < 12; i++) {
arr[i + 3] = 0;
@ -635,10 +629,7 @@ export default {
let obj = {};
obj.mgroupName =
item.mgroup_name != null ? item.mgroup_name : item.name;
obj.nickname =
item.nickname != null && item.nickname != ""
? item.nickname
: item.name;
obj.nickname = item.ep_monitored_name?item.ep_monitored_name:item.nickname?item.nickname:item.name;
obj.unit = item.unit;
that.tableDatas_month.push(obj);
that.getData_month(item.id, index);

View File

@ -1,6 +1,6 @@
<!-- 全厂水量统计 -->
<template>
<div class="app-container" id="app-container" style="height: 100%">
<div class="app-container" id="app-container" style="height: 50%">
<el-header id="app-header">
<div class="left-panel">
<el-select
@ -202,6 +202,30 @@
</el-table>
</div>
</div>
<div class="chartWrap" v-show="query.type==0">
<div class="chartTitle">本日生产参数统计图</div>
<scEcharts
height="400px"
width="1500px"
:option="optionHour"
></scEcharts>
</div>
<div class="chartWrap" v-show="query.type==1">
<div class="chartTitle">本月生产参数统计图</div>
<scEcharts
height="400px"
width="1500px"
:option="optionDay"
></scEcharts>
</div>
<div class="chartWrap" v-show="query.type==2">
<div class="chartTitle">本年生产参数统计图</div>
<scEcharts
height="400px"
width="1500px"
:option="optionMonth"
></scEcharts>
</div>
</el-card>
</el-main>
<el-dialog v-model="itemVisible" :title="itemChartTitle" width="1100px">
@ -243,6 +267,9 @@ export default {
indexList: [],
mpointList: [],
tableDatas: [],
optionHour: {},
optionDay: {},
optionMonth: {},
options: [
{id:0,name:'日统计'},
{id:1,name:'月统计'},
@ -467,15 +494,6 @@ export default {
that.dataLoop();
});
},
getLengthData() {
let that = this;
let arrs = [];
that.mpointList.forEach((item, index) => {
if (arrs.indexOf(item.mgroup_name) == -1) {
arrs.push(item.mgroup_name);
}
});
},
dataLoop() {
let that = this;
that.tableDatas = [];
@ -531,12 +549,14 @@ export default {
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((res) => {
let sum = 0;
let seriesData = [];
res.forEach((item) => {
let ind = item.hour + 3;
that.tableDatas[index][ind] = item.val;
sum += Number(item.val);
let keyName = item.hour + "时";
that.tableDatas2[index][keyName] = item.val;
seriesData.push({name: item.mpoint_nickname, value: item.val});
});
sum = sum * 100;
sum = Math.round(sum);

View File

@ -29,7 +29,7 @@
</tr>
<tr>
<th colspan="2">参数</th>
<th>上个小时</th>
<th>本日</th>
<th>昨日</th>
<th>本月</th>
<th>本年</th>
@ -141,7 +141,7 @@
</div>
</div>
<div class="chartWrap" v-show="typeRadio == 'day'">
<div class="chartTitle">小时生产参数统计图</div>
<div class="chartTitle">本日生产参数统计图</div>
<scEcharts
height="400px"
width="1033px"
@ -658,14 +658,13 @@ export default {
let year_d = year,
month_d = month,
days_d = days;
if (hours < 21) {
//21
let newDate = timeDate - dayTime;
let lastDate = new Date(newDate);
year_d = lastDate.getFullYear();
month_d = lastDate.getMonth() + 1;
days_d = lastDate.getDate();
}
//8
let newDate = timeDate - dayTime;
let lastDate = new Date(newDate);
year_d = lastDate.getFullYear();
month_d = lastDate.getMonth() + 1;
days_d = lastDate.getDate();
//
let hourTime = timeDate - 3600000;
let hourDate = new Date(hourTime);
@ -703,19 +702,29 @@ export default {
that.tableDatas[11][3] = (data3.ammonia_consume*1000/data3.total_production).toFixed(2);
}
});
//
//
let params4 = {};
params4.page = 0;
params4.year = year_h;
params4.month = month_h;
params4.day = days_h;
params4.hour = hours_h;
params4.type = "hour_s";
params4.year_s = year_h;
params4.month_s = month_h;
params4.day_s = days_h;
params4.type = "day_s";
params4.mgroup = that.query.mgroup;
that.$API.enm.enstat.req(params4).then((res4) => {
if (res4.length > 0) {
let data4 = res4[0];
that.tableDatas[0][2] = data4.total_production;
if (data4.total_production < 1){
that.tableDatas[4][2] = 0;
that.tableDatas[5][2] = 0;
that.tableDatas[6][2] = 0;
that.tableDatas[7][2] = 0;
that.tableDatas[8][2] = 0;
}else{
that.tableDatas[0][2] = data4.total_production;
that.tableDatas[1][2] = data4.production_hour;
that.tableDatas[2][2] = data4.run_hour;
that.tableDatas[3][2] = data4.run_rate;
that.tableDatas[4][2] = data4.elec_consume_unit;
that.tableDatas[5][2] = data4.celec_consume_unit;
that.tableDatas[6][2] = data4.coal_consume_unit;
@ -723,7 +732,9 @@ export default {
that.tableDatas[8][2] = data4.elec_consume;
that.tableDatas[9][2] = data4.production_cost_unit;
that.tableDatas[10][2] = data4.ammonia_consume;
that.tableDatas[11][2] = (data4.ammonia_consume*1000/data4.total_production).toFixed(2);
that.tableDatas[11][2] = (data4.ammonia_consume*1000/data4.total_production).toFixed(2);}
}
});
let params5 = {};

View File

@ -29,7 +29,7 @@
</tr>
<tr>
<th colspan="2">参数</th>
<th>上个小时</th>
<th>本日</th>
<th>昨日</th>
<th>本月</th>
<th>本年</th>
@ -130,7 +130,7 @@
</div>
</div>
<div class="chartWrap" v-show="typeRadio == 'day'">
<div class="chartTitle">小时生产参数统计图</div>
<div class="chartTitle">本日生产参数统计图</div>
<scEcharts
height="400px"
width="1033px"
@ -601,14 +601,14 @@ export default {
let year_d = year,
month_d = month,
days_d = days;
if (hours < 21) {
//21
let newDate = timeDate - dayTime;
let lastDate = new Date(newDate);
year_d = lastDate.getFullYear();
month_d = lastDate.getMonth() + 1;
days_d = lastDate.getDate();
}
//8
let newDate = timeDate - dayTime;
let lastDate = new Date(newDate);
year_d = lastDate.getFullYear();
month_d = lastDate.getMonth() + 1;
days_d = lastDate.getDate();
//
let hourTime = timeDate - 3600000;
let hourDate = new Date(hourTime);
@ -633,32 +633,50 @@ export default {
if (res3.length > 0) {
let data3 = res3[0];
that.tableDatas[0][3] = data3.total_production;
that.tableDatas[1][3] = data3.production_hour;
that.tableDatas[2][3] = data3.run_hour;
that.tableDatas[3][3] = data3.run_rate;
that.tableDatas[4][3] = data3.elec_consume_unit;
that.tableDatas[5][3] = data3.cen_consume_unit;
that.tableDatas[6][3] = data3.elec_consume;
that.tableDatas[7][3] = data3.production_cost_unit;
if (data3.total_production == 0){
that.tableDatas[4][3] = 0;
that.tableDatas[5][3] = 0;
that.tableDatas[6][3] = 0;
that.tableDatas[7][3] = 0;
}else{
that.tableDatas[1][3] = data3.production_hour;
that.tableDatas[2][3] = data3.run_hour;
that.tableDatas[3][3] = data3.run_rate;
that.tableDatas[4][3] = data3.elec_consume_unit;
that.tableDatas[5][3] = data3.cen_consume_unit;
that.tableDatas[6][3] = data3.elec_consume;
that.tableDatas[7][3] = data3.production_cost_unit;}
}
});
//
//
let params4 = {};
params4.page = 0;
params4.year = year_h;
params4.month = month_h;
params4.day = days_h;
params4.hour = hours_h;
params4.type = "hour_s";
params4.year_s = year_h;
params4.month_s = month_h;
params4.day_s = days_h;
params4.type = "day_s";
params4.mgroup = that.query.mgroup;
that.$API.enm.enstat.req(params4).then((res4) => {
if (res4.length > 0) {
let data4 = res4[0];
that.tableDatas[0][2] = data4.total_production;
if (data4.total_production < 1){
that.tableDatas[1][2] = 0;
that.tableDatas[2][2] = 0;
that.tableDatas[3][2] = 0;
that.tableDatas[4][2] = 0;
that.tableDatas[5][2] = 0;
that.tableDatas[6][2] = 0;
that.tableDatas[7][2] = 0;
}else{
that.tableDatas[1][2] = data4.production_hour;
that.tableDatas[2][2] = data4.run_hour;
that.tableDatas[3][2] = data4.run_rate;
that.tableDatas[4][2] = data4.elec_consume_unit;
that.tableDatas[5][2] = data4.cen_consume_unit;
that.tableDatas[6][2] = data4.elec_consume;
that.tableDatas[7][2] = data4.production_cost_unit;
that.tableDatas[7][2] = data4.production_cost_unit;}
}
});
//
@ -732,16 +750,6 @@ export default {
that.tableDatas[1][5],
that.tableDatas[1][8]
);
// that.tableDatas[2][5] = data1.run_hour;
// that.tableDatas[2][9] = precen(
// that.tableDatas[2][5],
// that.tableDatas[2][8]
// );
// that.tableDatas[3][5] = data1.run_rate;
// that.tableDatas[3][9] = precen(
// that.tableDatas[3][5],
// that.tableDatas[3][8]
// );
that.tableDatas[4][5] = data1.elec_consume_unit;
that.tableDatas[4][9] = precen(
that.tableDatas[4][5]-that.tableDatas[4][8],

View File

@ -25,24 +25,20 @@
>
<thead class="myTableHead">
<tr>
<th colspan="9">水泥包装工序生产报告</th>
<th colspan="5">水泥包装工序生产报告</th>
</tr>
<tr>
<th colspan="2">参数</th>
<th>昨日</th>
<th>本月</th>
<th>本年</th>
<th>月目标值</th>
<th>月完成度</th>
<th>年目标值</th>
<th>年完成度</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in tableDatas" :key="item">
<td rowspan="8" v-if="index == 0" class="numCell">{{ item[0] }}</td>
<td v-else-if="index==8" class="numCell">{{ item[0] }}</td>
<td v-else-if="index==9" class="numCell"
<td rowspan="10" v-if="index == 0" class="numCell">{{ item[0] }}</td>
<td v-else-if="index==10" class="numCell">{{ item[0] }}</td>
<td v-else-if="index==11" class="numCell"
rowspan="2"
>{{ item[0] }}</td>
<td class="numCell">{{ item[1] }}</td>
@ -64,10 +60,10 @@
>
{{ item[4] }}
</td>
<td class="numCell">{{ item[5] }}</td>
<!-- <td class="numCell">{{ item[5] }}</td>
<td class="numCell">{{ item[6] }}</td>
<td class="numCell">{{ item[7] }}</td>
<td class="numCell">{{ item[8] }}</td>
<td class="numCell">{{ item[8] }}</td> -->
</tr>
</tbody>
</table>
@ -331,17 +327,19 @@ export default {
mgroup: "",
},
tableDatas: [
["出厂水泥", "P.O42.5R 散装t", 0, 0, 0, "/", "/", "/","/"],
["出厂水泥", "P.O42.5R 袋装t", 0, 0, 0, "/", "/", "/","/"],
["出厂水泥", "P.O42.5 袋装t", 0, 0, 0, "/", "/", "/","/"],
["出厂水泥", "P.O42.5 散装t", 0, 0, 0, "/", "/", "/","/"],
["出厂水泥", "复合硅酸盐水泥;42.5R;袋装水泥(t)", 0, 0, 0, "/", "/", "/","/"],
["出厂水泥", "复合硅酸盐水泥;42.5R;散装水泥(t)", 0, 0, 0, "/", "/", "/","/"],
["出厂水泥", "普通硅酸盐水泥;52.5;散装水泥(t)", 0, 0, 0, "/", "/", "/","/"],
["出厂水泥", "P.O42.5R 散装t", 0, 0, 0],
["出厂水泥", "P.O42.5R 袋装t", 0, 0, 0],
["出厂水泥", "P.O42.5 袋装t", 0, 0, 0],
["出厂水泥", "P.O42.5 散装t", 0, 0, 0],
["出厂水泥", "复合硅酸盐水泥;42.5R;袋装水泥(t)", 0, 0, 0],
["出厂水泥", "复合硅酸盐水泥;42.5R;散装水泥(t)", 0, 0, 0],
["出厂水泥", "普通硅酸盐水泥;52.5;散装水泥(t)", 0, 0, 0],
["出厂水泥", "散装水泥(t)", 0, 0, 0],
["出厂水泥", "袋装水泥(t)", 0, 0, 0],
["出厂水泥", "出厂水泥合计t", 0, 0, 0, 0, 0, 0, 0],
["出厂熟料", "熟料t", 0, 0, 0, "/", "/", "/","/"],
["能耗", "单位产品分布电耗KW·h/t", 0, 0, 0, 0, 0, 0, 0],
["能耗", "总电耗KW·h", 0, 0, 0, "/", "/", "/","/"],
["出厂熟料", "熟料t", 0, 0, 0],
["能耗", "单位产品分布电耗KW·h/t", 0, 0, 0],
["能耗", "总电耗KW·h", 0, 0, 0],
],
tableName: "生产报告",
@ -567,13 +565,18 @@ export default {
that.tableDatas[5][4] = item.val;
}else if (item.mpoint_name == "水泥+P.O52.5 散装") {
that.tableDatas[6][4] = item.val;
}else if (item.mpoint_name == "出厂水泥") {
}else if (item.mpoint_name == "散装水泥总和"){
that.tableDatas[7][4] = item.val;
}else if (item.mpoint_name == "出厂熟料"){
}else if (item.mpoint_name == "袋装水泥总和") {
that.tableDatas[8][4] = item.val;
}else if (item.mpoint_name == "包装进线") {
that.tableDatas[9][4] = item.elec_consume_unit;
}
else if (item.mpoint_name == "出厂水泥") {
that.tableDatas[9][4] = item.val;
}else if (item.mpoint_name == "出厂熟料"){
that.tableDatas[10][4] = item.val;
}else if (item.mpoint_name == "包装进线") {
that.tableDatas[11][4] = item.elec_consume_unit;
that.tableDatas[12][4] = item.val;
}
}
)}
@ -602,64 +605,24 @@ export default {
that.tableDatas[5][3] = item.val;
}else if (item.mpoint_name == "水泥+P.O52.5 散装") {
that.tableDatas[6][3] = item.val;
}else if (item.mpoint_name == "出厂水泥") {
}else if (item.mpoint_name == "散装水泥总和"){
that.tableDatas[7][3] = item.val;
}else if (item.mpoint_name == "出厂熟料"){
}else if (item.mpoint_name == "袋装水泥总和") {
that.tableDatas[8][3] = item.val;
}else if (item.mpoint_name == "包装进线") {
that.tableDatas[9][3] = item.elec_consume_unit;
}
else if (item.mpoint_name == "出厂水泥") {
that.tableDatas[9][3] = item.val;
}else if (item.mpoint_name == "出厂熟料"){
that.tableDatas[10][3] = item.val;
}else if (item.mpoint_name == "包装进线") {
that.tableDatas[11][3] = item.elec_consume_unit;
that.tableDatas[12][3] = item.val;
}
}
)
}
}).then(() => {
//
let params5 = {};
params5.page = 0;
params5.mgroup = that.query.mgroup;
this.$API.mtm.goal.list
.req(params5)
.then((res5) => {
if (res5.length > 0) {
let data5 = res5;
data5.forEach((item5) => {
let str = "goal_val_" + that.month;
if (item5.goal_cate_name == "总产量t") {
that.tableDatas[7][5] = item5[str];
that.tableDatas[7][7] = item5.goal_val;
that.tableDatas[7][8] = precen(
that.tableDatas[7][4],
that.tableDatas[7][7]
);//
that.tableDatas[7][6] = precen(
that.tableDatas[7][3],
that.tableDatas[7][5]
);//
} else if (
item5.goal_cate_name ==
"单位产品分布电耗KW·h/t"
) {
that.tableDatas[9][5] = item5[str];
that.tableDatas[9][7] = item5.goal_val;
//
that.tableDatas[9][8] = precen(
that.tableDatas[9][4],
that.tableDatas[9][7]
);//
that.tableDatas[9][6] = precen(
that.tableDatas[9][3]-that.tableDatas[9][5],
that.tableDatas[9][5]
);//
}
});
}
});
})
});
//
//
let params3 = {};
params3.page = 0;
params3.year_s = year_d;
@ -684,64 +647,30 @@ export default {
that.tableDatas[5][2] = item.val;
}else if (item.mpoint_name == "水泥+P.O52.5 散装") {
that.tableDatas[6][2] = item.val;
}else if (item.mpoint_name == "出厂水泥") {
}else if (item.mpoint_name == "散装水泥总和"){
that.tableDatas[7][2] = item.val;
}else if (item.mpoint_name == "出厂熟料"){
}else if (item.mpoint_name == "袋装水泥总和") {
that.tableDatas[8][2] = item.val;
}else if (item.mpoint_name == "包装进线") {
that.tableDatas[9][2] = item.elec_consume_unit;
}
else if (item.mpoint_name == "出厂水泥") {
that.tableDatas[9][2] = item.val;
}else if (item.mpoint_name == "出厂熟料"){
that.tableDatas[10][2] = item.val;
}else if (item.mpoint_name == "包装进线") {
that.tableDatas[11][2] = item.elec_consume_unit;
that.tableDatas[12][2] = item.val;
}
}
)
}
});
// this.$API.mtm.goal.list
// .then((res) => {
// //
// let params1 = {};
// params1.page = 0;
// params1.year_s = year;
// params1.type = "year_s";
// params1.mgroup = this.query.mgroup;
// this.$API.enm.enstat.req(params1).then((res1) => {
// if (res1.length > 0) {
// let data1 = res1[0];
// that.tableDatas[0][4] = data1.total_production;
// that.tableDatas[0][8] = precen(
// that.tableDatas[0][4],
// that.tableDatas[0][7]
// );
// that.tableDatas[1][4] = data1.elec_consume_unit;
// that.tableDatas[1][8] = precen(
// that.tableDatas[1][4],
// that.tableDatas[1][7]
// );
// }
// });
// //
// let params2 = {};
// params2.page = 0;
// params2.year_s = year;
// params2.month_s = month;
// params2.type = "month_s";
// params2.mgroup = this.query.mgroup;
// this.$API.enm.enstat.req(params2).then((res2) => {
// if (res2.length > 0) {
// let data2 = res2[0];
// that.tableDatas[0][3] = data2.total_production;
// that.tableDatas[0][6] = precen(
// that.tableDatas[0][3],
// that.tableDatas[0][5]
// );
// that.tableDatas[1][3] = data2.elec_consume_unit;
// that.tableDatas[1][6] = precen(
// that.tableDatas[1][3],
// that.tableDatas[1][5]
// );
// }
// });
// });
}
)
}
);
that.getDayData(year, month);
that.getMonthData(year);
});

View File

@ -29,7 +29,7 @@
</tr>
<tr>
<th colspan="2">参数</th>
<th>上个小时</th>
<th>本日</th>
<th>昨日</th>
<th>本月</th>
<th>本年</th>
@ -129,7 +129,7 @@
</div>
<!-- <div id="main" style="width:1200px;height:600px;"></div> -->
<div class="chartWrap" v-show="typeRadio == 'day'">
<div class="chartTitle">小时生产参数统计图</div>
<div class="chartTitle">本日生产参数统计图</div>
<scEcharts
height="400px"
width="1033px"
@ -404,9 +404,9 @@ export default {
},
tableDatas: [
["产量", "总产量t", 0, 0, 0, 0, 0, 0, 0, 0],
["产量", "台时产量t/h", "/", 0, 0, 0, 0, 0, 0, 0],
["运转时间", "运转时间h", "/", 0, 0, "/", 0, 0, "/", "/"],
["运转时间", "运转率(%", "/", 0, 0, "/", 0, 0, "/", "/"],
["产量", "台时产量t/h", 0, 0, 0, 0, 0, 0, 0, 0],
["运转时间", "运转时间h", 0, 0, 0, "/", 0, 0, "/", "/"],
["运转时间", "运转率(%", 0, 0, 0, "/", 0, 0, "/", "/"],
["能耗", "生料分布电耗KW·h/t", 0, 0, 0, 0, 0, 0, 0, 0],
["能耗", "总电耗KW·h", 0, 0, 0, 0, "/", "/", "/","/"],
["成本", "生料成本(元/吨)", 0, 0, 0, 0, 0, 0, 0, 0],
@ -796,14 +796,14 @@ export default {
let year_d = year,
month_d = month,
days_d = days;
if (hours < 21) {
//21
//8
let newDate = timeDate - dayTime;
let lastDate = new Date(newDate);
year_d = lastDate.getFullYear();
month_d = lastDate.getMonth() + 1;
days_d = lastDate.getDate();
}
//
let hourTime = timeDate - 3600000;
let hourDate = new Date(hourTime);
@ -814,7 +814,6 @@ export default {
this.$API.mtm.mgroup.list
.req({ page: 0, search: "原料磨" })
.then((res) => {
console.log("原料磨", res);
that.query.mgroup = res[0].id;
//
let params3 = {};
@ -828,30 +827,42 @@ export default {
if (res3.length > 0) {
let data3 = res3[0];
that.tableDatas[0][3] = data3.total_production;
if (data3.total_production == 0) {
that.tableDatas[4][3] = 0;
that.tableDatas[5][3] = 0;
that.tableDatas[6][3] = 0;
}else {
that.tableDatas[1][3] = data3.production_hour;
that.tableDatas[2][3] = data3.run_hour;
that.tableDatas[3][3] = data3.run_rate;
that.tableDatas[4][3] = data3.elec_consume_unit;
that.tableDatas[5][3] = data3.elec_consume;
that.tableDatas[6][3] = data3.production_cost_unit;
that.tableDatas[6][3] = data3.production_cost_unit;}
}
});
//
//
let params4 = {};
params4.page = 0;
params4.year = year_h;
params4.month = month_h;
params4.day = days_h;
params4.hour = hours_h;
params4.type = "hour_s";
params4.year_s = year_h;
params4.month_s = month_h;
params4.day_s = days_h;
params4.type = "day_s";
params4.mgroup = this.query.mgroup;
this.$API.enm.enstat.req(params4).then((res4) => {
if (res4.length > 0) {
let data4 = res4[0];
that.tableDatas[0][2] = data4.total_production < 1 ? 0 : data4.total_production;
if (data4.total_production == 0) {
that.tableDatas[4][2] = 0;
that.tableDatas[5][2] = 0;
that.tableDatas[6][2] = 0;
}else {
that.tableDatas[1][2] = data4.production_hour;
that.tableDatas[2][2] = data4.run_hour;
that.tableDatas[3][2] = data4.run_rate;
that.tableDatas[4][2] = data4.elec_consume_unit;
that.tableDatas[5][2] = data4.elec_consume;
that.tableDatas[6][2] = data4.production_cost_unit;
that.tableDatas[6][2] = data4.production_cost_unit;}
}
});
//
@ -866,7 +877,6 @@ export default {
data5.forEach((item5) => {
let str = "goal_val_" + that.month;
debugger;
console.log(str, item5[str]);
if (item5.goal_cate_name == "总产量t") {
that.tableDatas[0][6] = item5[str];
@ -1017,7 +1027,6 @@ export default {
},
dateChange(val) {
let that = this;
console.log(val);
if (val !== null) {
if (this.typeRadio == "day") {
let year = val.split("-")[0];
@ -1057,7 +1066,6 @@ export default {
seriesData2 = [],
seriesData3 = [],
seriesData4 = [];
console.log("获取小时数据", response);
let data = response;
data.forEach((item) => {
let ind = item.hour;

View File

@ -25,7 +25,7 @@
>
<thead class="myTableHead">
<tr>
<th colspan="9">电石渣工生产报告</th>
<th colspan="9">电石渣工生产报告</th>
</tr>
<tr>
<th colspan="2">参数</th>
@ -127,7 +127,7 @@
</div>
</div>
</div>
<sc-dialog v-model="chartShow" draggable title="电石渣工">
<sc-dialog v-model="chartShow" draggable title="电石渣工">
<div class="searchHead" v-if="type == 'hours'">
<el-date-picker
v-model="query.start_time"
@ -396,7 +396,7 @@ export default {
mgroup: "3346491835287007232",
},
tableDatas: [
["电石干粉产量", "总产量t", 0, 0, 0, 0, 0, 0, 0, 0],
["产量", "总产量t", 0, 0, 0, 0, 0, 0, 0, 0],
["能耗", "单位产品分布电耗KW·h/t", 0, 0, 0, 0, 0, 0, 0, 0],
["能耗", "总电耗KW·h", 0, 0, 0, "/", "/", "/", "/", "/"],
["成本", "电石渣成本(元/吨)", 0, 0, 0, 0, 0, 0, 0, 0],
@ -408,7 +408,7 @@ export default {
tableName: "生产报告",
modelValue: true,
type: "hour_s",
title: "电石渣工",
title: "电石渣工",
showClose: true,
echartType: "line",
asynDialog: false,