From 29f7d0ecc4bf4eba12cf2f286b28fa47cb06ee5d Mon Sep 17 00:00:00 2001 From: zty Date: Fri, 17 Jan 2025 17:32:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=20enm/report?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/enm_coal/report.vue | 273 +++++++++++++-- src/views/enm_coal/teamAnalysis.vue | 1 + src/views/enm_coal/workshopAnalysis.vue | 1 + src/views/enm_energy/electric_peak.vue | 19 +- src/views/enm_energy/value.vue | 1 + src/views/enm_kiln/report.vue | 380 +++++++++++++++++++-- src/views/enm_kiln/teamAnalysis.vue | 1 + src/views/enm_kiln/workshopAnalysis.vue | 1 + src/views/enm_mill/report.vue | 310 +++++++++++++++-- src/views/enm_mill/teamAnalysis.vue | 1 + src/views/enm_mill/workshopAnalysis.vue | 1 + src/views/enm_pack/report.vue | 177 ++++++++-- src/views/enm_pack/teamAnalysis.vue | 1 + src/views/enm_pack/workshopAnalysis.vue | 1 + src/views/enm_report/quality.vue | 85 ++++- src/views/enm_report/reportDay.vue | 2 +- src/views/enm_report/teamAnalysisLog.vue | 10 +- src/views/enm_rm/report.vue | 104 +++--- src/views/enm_rm/teamAnalysis.vue | 1 + src/views/enm_rm/workshopAnalysis.vue | 1 + src/views/enm_rm_copy/report.vue | 309 +++++++++++++++-- src/views/enm_rm_copy/teamAnalysis.vue | 1 + src/views/enm_rm_copy/workshopAnalysis.vue | 1 + src/views/enm_slag/report.vue | 119 +++++-- src/views/enm_slag/teamAnalysis.vue | 1 + src/views/enm_slag/workshopAnalysis.vue | 1 + 26 files changed, 1568 insertions(+), 235 deletions(-) diff --git a/src/views/enm_coal/report.vue b/src/views/enm_coal/report.vue index bbf206d4..15f07a45 100644 --- a/src/views/enm_coal/report.vue +++ b/src/views/enm_coal/report.vue @@ -2,6 +2,52 @@
+ + + + + + + -
+ +
本日生产参数统计图
-
+
本月生产参数统计图
-
+
本年生产参数统计图
{ @@ -682,7 +733,6 @@ export default { params4.day_s = days_h; params4.type = "day_s"; params4.mgroup = that.query.mgroup; - console.log("本日----p", params4); that.$API.enm.enstat.req(params4).then((res4) => { if (res4) { console.log("本日", res4); @@ -852,33 +902,194 @@ export default { }, }) }, - dateChange(val) { + dateChange() { let that = this; - console.log(val); - if (val !== null) { - if (this.typeRadio == "day") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - let days = val.split("-")[2]; - this.getHourData(year, month, days); - } else if (this.typeRadio == "month") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - this.getDayData(year, month); - } else { - this.getMonthData(val); - } - } else { - if (this.typeRadio == "day") { - that.getHourData(that.year, that.month, that.days); - } else if (this.typeRadio == "month") { - this.getDayData(that.year, that.month); - } else { - this.getMonthData(that.year); - } + let arr = []; + if(that.query.type==0 && that.query.day) { + arr = that.query.day.split('-'); + that.year = Number(arr[0]); + that.month = Number(arr[1]); + that.days = Number(arr[2]); + this.getHourData(that.year, that.month, that.days); + this.get_days(that.year, that.month, that.days); + } + else if(that.query.type==1 && that.query.month) { + let year = that.query.month.split("-")[0]; + let month = that.query.month.split("-")[1]; + month = Number(month); + this.getDayData(year, month); + this.get_months(year, month); + this.get_month_year_goal(year, month); + }else if (that.query.type==2 && that.query.year ) { + let year = that.query.year; + this.getMonthData(year); + this.get_years(year); + this.get_month_year_goal(year , 1); } }, + get_days(year_d, month_d, days){ + let that = this; + let params4 = {}; + params4.page = 0; + params4.year_s = year_d; + params4.month_s = month_d; + params4.day_s = days; + params4.type = "day_s"; + params4.mgroup = that.query.mgroup; + that.$API.enm.enstat.req(params4).then((res4) => { + if (res4) { + let data4 = res4[0]; + that.tableDatas[0][2] = data4.total_production; + 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; + } + } + }); + }, //获取小时数据 + get_months(year_d, month_d){ + let that = this; + let params2 = {}; + params2.page = 0; + params2.year_s = year_d; + params2.month_s = month_d; + params2.type = "month_s"; + params2.mgroup = that.query.mgroup; + that.$API.enm.enstat.req(params2).then((res2) => { + if (res2.length > 0) { + let data2 = res2[0]; + that.tableDatas[0][4] = data2.total_production; + that.tableDatas[0][7] = precen( + that.tableDatas[0][4], + that.tableDatas[0][6] + ); + that.tableDatas[1][4] = data2.production_hour; + that.tableDatas[1][7] = precen( + that.tableDatas[1][4], + that.tableDatas[1][6] + ); + that.tableDatas[2][4] = data2.run_hour; + that.tableDatas[2][7] = precen( + that.tableDatas[2][4], + that.tableDatas[2][6] + ); + that.tableDatas[3][4] = data2.run_rate; + that.tableDatas[3][7] = precen( + that.tableDatas[3][4], + that.tableDatas[3][6] + ); + that.tableDatas[4][4] = data2.elec_consume_unit; + that.tableDatas[4][7] = consume_precen( + (that.tableDatas[4][6]-that.tableDatas[4][4]), + that.tableDatas[4][6] + ); + that.tableDatas[5][4] = data2.elec_consume; + that.tableDatas[5][7] = consume_precen( + (that.tableDatas[5][6]-that.tableDatas[5][4]), + that.tableDatas[5][6] + ); + } + }); + }, + get_years(year){ + let that = this; + let params1 = {}; + params1.page = 0; + params1.year_s = year; + params1.type = "year_s"; + params1.mgroup = that.query.mgroup; + that.$API.enm.enstat.req(params1).then((res1) => { + if (res1.length > 0) { + let data1 = res1[0]; + that.tableDatas[0][5] = data1.total_production; + that.tableDatas[0][9] = precen( + that.tableDatas[0][5], + that.tableDatas[0][8] + ); + that.tableDatas[1][5] = data1.production_hour; + that.tableDatas[1][9] = precen( + 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] = consume_precen( + that.tableDatas[4][8] - that.tableDatas[4][5], + that.tableDatas[4][8] + ); + that.tableDatas[5][5] = data1.elec_consume; + that.tableDatas[5][9] = consume_precen( + (that.tableDatas[5][8]-that.tableDatas[5][5]), + that.tableDatas[5][8] + ); + } + }); + }, + get_month_year_goal(year, month){ + let that = this; + let params5 = {}; + params5.page = 0; + params5.year = year; + 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_" + month; + if (item5.goal_cate_name == "总产量(t)") { + that.tableDatas[0][6] = item5[str]; + that.tableDatas[0][8] = item5.goal_val; + } else if ( + item5.goal_cate_name == "台时产量(t/h)" + ) { + that.tableDatas[1][6] = item5[str]; + that.tableDatas[1][8] = item5.goal_val; + } else if ( + item5.goal_cate_name == "运转时间(h)" + ) { + that.tableDatas[2][6] = item5[str]; + that.tableDatas[2][8] = item5.goal_val; + } else if ( + item5.goal_cate_name == "运转率(%)" + ) { + that.tableDatas[3][6] = item5[str]; + that.tableDatas[3][8] = item5.goal_val; + } else if ( + item5.goal_cate_name == + "单位产品分布电耗(kW·h/t)" + ) { + that.tableDatas[4][6] = item5[str]; + that.tableDatas[4][8] = item5.goal_val; + }else if (item5.goal_cate_name == "总电量(kW·h)") { + that.tableDatas[5][6] = item5[str]; + that.tableDatas[5][8] = item5.goal_val; + } + }); + } + }) + }, getHourData(year, month, days) { let that = this; let query = {}; diff --git a/src/views/enm_coal/teamAnalysis.vue b/src/views/enm_coal/teamAnalysis.vue index c0a34fd0..17314be0 100644 --- a/src/views/enm_coal/teamAnalysis.vue +++ b/src/views/enm_coal/teamAnalysis.vue @@ -92,6 +92,7 @@ export default { }, tableDatas: [], goalDatas: [], + tableName:'煤磨工序生产报告', }; }, mounted() { diff --git a/src/views/enm_coal/workshopAnalysis.vue b/src/views/enm_coal/workshopAnalysis.vue index c5677197..621ced59 100644 --- a/src/views/enm_coal/workshopAnalysis.vue +++ b/src/views/enm_coal/workshopAnalysis.vue @@ -125,6 +125,7 @@ export default { showClose: true, echartType: "line", asynDialog: false, + tableName:'煤磨工序生产报告' }; }, async mounted() { diff --git a/src/views/enm_energy/electric_peak.vue b/src/views/enm_energy/electric_peak.vue index 2f5876d7..c2f8b28b 100644 --- a/src/views/enm_energy/electric_peak.vue +++ b/src/views/enm_energy/electric_peak.vue @@ -97,7 +97,12 @@ style="width: 70%" border :height="tableHeight" - > + @selection-change="handleSelectionChange" + > + + @@ -177,6 +182,7 @@ import * as echarts from 'echarts'; { label: '深谷', prop: 'deep' }, ], tableData:[], + selectedRows: [], tableDatas2: [ { type: "波峰", time: "8:00--11:00 19:00-24:00" }, { type: "尖峰", time: "7月 21:00--23:00, 1、11、12月19:00--21:00" }, @@ -257,13 +263,11 @@ import * as echarts from 'echarts'; this.tableDatas_range = res; }); }, - dateChange() { let that = this; that.mpointList = []; // 清空数组 let arr = [], obj = {}; - console.log(that.query.mgroupName, 'that.query.mgroupName') that.$API.enm.mpoint.list .req({ page: 0, @@ -279,7 +283,6 @@ import * as echarts from 'echarts'; if (res.length === 0) { return; } - console.log(res, 'res-----------') that.mpointList = res .filter((item) => item.report_sortstr !== "" && item.mgroup_name !== '生活区') .map((item) => item.id); // 提取 id @@ -301,7 +304,6 @@ import * as echarts from 'echarts'; obj.start_time = that.daterange[0]; obj.end_time = that.daterange[1]; } - console.log(that.mpointList.length, 'that.mpointList') let mpointID = that.mpointList.join(','); obj.page = 0; obj.type = 'hour'; @@ -331,7 +333,6 @@ import * as echarts from 'echarts'; return acc; }, []); this.tableData = groupedData; - console.log("groupedData",groupedData) }) .catch((error) => { console.error("API 请求错误: ", error); @@ -339,6 +340,10 @@ import * as echarts from 'echarts'; }); }, + handleSelectionChange(val) { + this.selectedRows = val; + console.log("选中的行数据:", this.selectedRows); + }, // 显示图表 showBarChart(){ this.isChartDialogVisible = true; @@ -368,7 +373,7 @@ import * as echarts from 'echarts'; { name: '尖峰', data: [] }, { name: '深谷', data: [] } ]; - let categories = this.tableData.map(item => item.mpoint__name); // 横轴设备名称 + const categories = this.selectedRows.map(item => item.mpoint__name); // 横轴设备名称 this.tableData.forEach(item => { seriesData[0].data.push(item.flat ? parseFloat(item.flat) : 0); // 平谷 seriesData[1].data.push(item.high ? parseFloat(item.high) : 0); // 波峰 diff --git a/src/views/enm_energy/value.vue b/src/views/enm_energy/value.vue index aadf5819..e017370c 100644 --- a/src/views/enm_energy/value.vue +++ b/src/views/enm_energy/value.vue @@ -137,6 +137,7 @@ export default { timeStamp: 0, year_s: "", tableDatas: [], + tableName:'全厂能源统计', optionMonth:{}, query: {"year_s":""}, option1: { diff --git a/src/views/enm_kiln/report.vue b/src/views/enm_kiln/report.vue index 51b0a55f..5a58ac90 100644 --- a/src/views/enm_kiln/report.vue +++ b/src/views/enm_kiln/report.vue @@ -2,6 +2,52 @@
+ + + + + + + 打印
-
+
@@ -102,7 +148,7 @@ -
+ -
+
本日生产参数统计图
-
+
本月生产参数统计图
-
+
本年生产参数统计图
- + { + 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; + that.tableDatas[7][2] = data4.cen_consume_unit; + 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);} + + + } + }); + }, + get_months(year, month){ + let that = this; + 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][4] = data2.total_production; + that.tableDatas[0][7] = precen( + that.tableDatas[0][4], + that.tableDatas[0][6] + ); + that.tableDatas[1][4] = data2.production_hour; + that.tableDatas[1][7] = precen( + that.tableDatas[1][4], + that.tableDatas[1][6] + ); + that.tableDatas[2][4] = data2.run_hour; + that.tableDatas[2][7] = precen( + that.tableDatas[2][4], + that.tableDatas[2][6] + ); + that.tableDatas[3][4] = data2.run_rate; + that.tableDatas[3][7] = precen( + that.tableDatas[3][4], + that.tableDatas[3][6] + ); + that.tableDatas[4][4] = data2.elec_consume_unit; + that.tableDatas[4][7] = consume_precen( + that.tableDatas[4][6] - that.tableDatas[4][4], + that.tableDatas[4][6] + ); + that.tableDatas[5][4] = + data2.celec_consume_unit; + that.tableDatas[5][7] = consume_precen( + that.tableDatas[5][6] - that.tableDatas[5][4], + that.tableDatas[5][6] + ); + that.tableDatas[6][4] = data2.coal_consume_unit; + that.tableDatas[6][7] = consume_precen( + that.tableDatas[6][6]-that.tableDatas[6][4], + that.tableDatas[6][6] + ); + that.tableDatas[7][4] = data2.cen_consume_unit; + that.tableDatas[7][7] = consume_precen( + that.tableDatas[7][6]-that.tableDatas[7][4], + that.tableDatas[7][6] + ); + that.tableDatas[8][4] = data2.elec_consume; + that.tableDatas[8][7] = consume_precen( + that.tableDatas[8][6]-that.tableDatas[8][4], + that.tableDatas[8][6] + ); + that.tableDatas[9][4] = + data2.production_cost_unit; + that.tableDatas[9][7] = consume_precen( + that.tableDatas[9][6]-that.tableDatas[9][4], + that.tableDatas[9][6] + ); + that.tableDatas[10][4] = data2.ammonia_consume; + that.tableDatas[10][7] = consume_precen( + that.tableDatas[10][6] - that.tableDatas[10][4], + that.tableDatas[10][6] + ) + that.tableDatas[11][4] = (data2.ammonia_consume*1000/data2.total_production).toFixed(2); + that.tableDatas[11][7] = consume_precen( + that.tableDatas[11][6] - that.tableDatas[11][4], + that.tableDatas[11][6] + ) + } + }); + }, + get_years(year){ + let that = this; + 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][5] = data1.total_production; + that.tableDatas[0][9] = precen( + that.tableDatas[0][5], + that.tableDatas[0][8] + ); + that.tableDatas[1][5] = data1.production_hour; + that.tableDatas[1][9] = precen( + 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] = consume_precen( + (that.tableDatas[4][8]-that.tableDatas[4][5]), + that.tableDatas[4][8] + ); + that.tableDatas[5][5] = + data1.celec_consume_unit; + that.tableDatas[5][9] = consume_precen( + (that.tableDatas[5][8]-that.tableDatas[5][5]), + that.tableDatas[5][8] + ); + that.tableDatas[6][5] = data1.coal_consume_unit; + that.tableDatas[6][9] = consume_precen( + (that.tableDatas[6][8]-that.tableDatas[6][5]), + that.tableDatas[6][8] + ); + that.tableDatas[7][5] = data1.cen_consume_unit; + that.tableDatas[7][9] = consume_precen( + (that.tableDatas[7][8]-that.tableDatas[7][5]), + that.tableDatas[7][8] + ); + that.tableDatas[8][5] = data1.elec_consume; + that.tableDatas[8][9] = consume_precen( + (that.tableDatas[8][8]-that.tableDatas[8][5]), + that.tableDatas[8][8] + ); + that.tableDatas[9][5] = + data1.production_cost_unit; + that.tableDatas[9][9] = consume_precen( + (that.tableDatas[9][8]-that.tableDatas[9][5]), + that.tableDatas[9][8] + ); + that.tableDatas[10][5] = data1.ammonia_consume; + that.tableDatas[10][9] = consume_precen( + that.tableDatas[10][8] - that.tableDatas[10][5], + that.tableDatas[10][8] + ); + that.tableDatas[11][5] = (data1.ammonia_consume*1000/data1.total_production).toFixed(2); + that.tableDatas[11][9] = consume_precen( + that.tableDatas[11][8] - that.tableDatas[11][5], + that.tableDatas[11][8] + ); + } else { + } + }); + }, + get_month_year_goal(year , month){ + let that = this; + let params5 = {}; + params5.page = 0; + params5.year = year; + params5.mgroup = that.query.mgroup; + that.$API.mtm.goal.list + .req(params5) + .then((res5) => { + if (res5.length > 0) { + let data5 = res5; + data5.forEach((item5) => { + let str = "goal_val_" + month; + if (item5.goal_cate_name == "总产量(t)") { + that.tableDatas[0][6] = item5[str]; + that.tableDatas[0][8] = item5.goal_val; + } else if ( + item5.goal_cate_name == "台时产量(t/h)" + ) { + that.tableDatas[1][6] = item5[str]; + that.tableDatas[1][8] = item5.goal_val; + } else if ( + item5.goal_cate_name == "运转时间(h)" + ) { + that.tableDatas[2][6] = item5[str]; + that.tableDatas[2][8] = item5.goal_val; + } else if ( + item5.goal_cate_name == "运转率(%)" + ) { + that.tableDatas[3][6] = item5[str]; + that.tableDatas[3][8] = item5.goal_val; + } else if ( + item5.goal_cate_name == + "单位产品分布电耗(kW·h/t)" + ) { + that.tableDatas[4][6] = item5[str]; + that.tableDatas[4][8] = item5.goal_val; + } else if ( + item5.goal_cate_name == + "单位产品综合电耗(KW·h/t)" + ) { + that.tableDatas[5][6] = item5[str]; + that.tableDatas[5][8] = item5.goal_val; + } else if ( + item5.goal_cate_name == + "单位产品标煤耗(kgce/t)" + ) { + that.tableDatas[6][6] = item5[str]; + that.tableDatas[6][8] = item5.goal_val; + } else if ( + item5.goal_cate_name == + "单位产品综合能耗(kgce/t)" + ) { + that.tableDatas[7][6] = item5[str]; + that.tableDatas[7][8] = item5.goal_val; + } else if ( + item5.goal_cate_name == + "单位产品成本(元/吨)" + ) { + that.tableDatas[9][6] = item5[str]; + that.tableDatas[9][8] = item5.goal_val; + }else if(item5.goal_cate_name == "总电量(kW·h)"){ + that.tableDatas[8][6] = item5[str]; + that.tableDatas[8][8] = item5.goal_val; + }else if(item5.goal_cate_name == "氨水消耗量(t)"){ + that.tableDatas[10][6] = item5[str]; + that.tableDatas[10][8] = item5.goal_val; + }else if (item5.goal_cate_name == "熟料单位氨水消耗量(kg/t)"){ + that.tableDatas[11][6] = item5[str]; + that.tableDatas[11][8] = item5.goal_val; + } + }); + } + }) }, //获取小时数据 getHourData(year, month, days) { diff --git a/src/views/enm_kiln/teamAnalysis.vue b/src/views/enm_kiln/teamAnalysis.vue index 8975712a..206776dd 100644 --- a/src/views/enm_kiln/teamAnalysis.vue +++ b/src/views/enm_kiln/teamAnalysis.vue @@ -112,6 +112,7 @@ export default { }, tableDatas: [], exportLoading: false, + tableName:'烧成工序班组月度对比分析', }; }, mounted() { diff --git a/src/views/enm_kiln/workshopAnalysis.vue b/src/views/enm_kiln/workshopAnalysis.vue index 30d1fa7f..8bf598ea 100644 --- a/src/views/enm_kiln/workshopAnalysis.vue +++ b/src/views/enm_kiln/workshopAnalysis.vue @@ -371,6 +371,7 @@ export default { showClose: true, echartType: "line", asynDialog: false, + tableName:'熟料分布电耗月度分析表', }; }, mounted() { diff --git a/src/views/enm_mill/report.vue b/src/views/enm_mill/report.vue index 77175498..3f491e56 100644 --- a/src/views/enm_mill/report.vue +++ b/src/views/enm_mill/report.vue @@ -2,6 +2,52 @@
+ + + + + + + -
+ +
本日生产参数统计图
-
+
本月生产参数统计图
-
+
本年生产参数统计图
- + { + 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;} + } + }); + }, + get_months(year, month){ + let that = this; + 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][4] = data2.total_production; + that.tableDatas[0][7] = precen( + that.tableDatas[0][4], + that.tableDatas[0][6] + ); + that.tableDatas[1][4] = data2.production_hour; + that.tableDatas[1][7] = precen( + that.tableDatas[1][4], + that.tableDatas[1][6] + ); + that.tableDatas[2][4] = data2.run_hour; + that.tableDatas[2][7] = precen( + that.tableDatas[2][4], + that.tableDatas[2][6] + ); + that.tableDatas[3][4] = data2.run_rate; + that.tableDatas[3][7] = precen( + that.tableDatas[3][4], + that.tableDatas[3][6] + ); + that.tableDatas[4][4] = data2.elec_consume_unit; + that.tableDatas[4][7] = consume_precen( + that.tableDatas[4][6]-that.tableDatas[4][4], + that.tableDatas[4][6] + ); + that.tableDatas[5][4] = data2.cen_consume_unit; + that.tableDatas[5][7] = consume_precen( + that.tableDatas[5][6]-that.tableDatas[5][4], + that.tableDatas[5][6] + ); + that.tableDatas[7][4] = + data2.production_cost_unit; + that.tableDatas[6][4] = data2.elec_consume; + that.tableDatas[6][7] = consume_precen( + that.tableDatas[6][6]-that.tableDatas[6][4], + that.tableDatas[6][6] + ); + that.tableDatas[7][7] = consume_precen( + that.tableDatas[7][6]-that.tableDatas[7][4], + that.tableDatas[7][6] + ); + } + }); + }, + get_years(year){ + let that = this; + 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][5] = data1.total_production; + that.tableDatas[0][9] = precen( + that.tableDatas[0][5], + that.tableDatas[0][8] + ); + that.tableDatas[1][5] = data1.production_hour; + that.tableDatas[1][9] = precen( + 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] = consume_precen( + that.tableDatas[4][8]-that.tableDatas[4][5], + that.tableDatas[4][8] + ); + that.tableDatas[5][5] = data1.cen_consume_unit; + that.tableDatas[5][9] = consume_precen( + that.tableDatas[5][8]-that.tableDatas[5][5], + that.tableDatas[5][8] + ); + that.tableDatas[6][5] = data1.elec_consume; + that.tableDatas[6][9] = consume_precen( + that.tableDatas[6][8]-that.tableDatas[6][5], + that.tableDatas[6][8] + ); + that.tableDatas[7][5] = + data1.production_cost_unit; + that.tableDatas[7][9] = consume_precen( + that.tableDatas[7][8]-that.tableDatas[7][5], + that.tableDatas[7][8] + ); + } + }); + }, + get_month_year_goal(year, month) { + let that = this; + let params5 = {}; + params5.page = 0; + params5.year = year; + 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_" + month; + if (item5.goal_cate_name == "总产量(t)") { + that.tableDatas[0][6] = item5[str]; + that.tableDatas[0][8] = item5.goal_val; + } else if ( + item5.goal_cate_name == "台时产量(t/h)" + ) { + that.tableDatas[1][6] = item5[str]; + that.tableDatas[1][8] = item5.goal_val; + } else if ( + item5.goal_cate_name == "运转时间(h)" + ) { + that.tableDatas[2][6] = item5[str]; + that.tableDatas[2][8] = item5.goal_val; + } else if ( + item5.goal_cate_name == "运转率(%)" + ) { + that.tableDatas[3][6] = item5[str]; + that.tableDatas[3][8] = item5.goal_val; + } else if ( + item5.goal_cate_name == + "单位产品分布电耗(kW·h/t)" + ) { + that.tableDatas[4][6] = item5[str]; + that.tableDatas[4][8] = item5.goal_val; + } else if ( + item5.goal_cate_name == + "单位产品综合能耗(kgce/t)" + ) { + that.tableDatas[5][6] = item5[str]; + that.tableDatas[5][8] = item5.goal_val; + } else if ( + item5.goal_cate_name == + "单位产品成本(元/吨)" + ) { + that.tableDatas[7][6] = item5[str]; + that.tableDatas[7][8] = item5.goal_val; + } else if( + item5.goal_cate_name == + "总电量(kW·h)"){ + that.tableDatas[6][6] = item5[str]; + that.tableDatas[6][8] = item5.goal_val; + } + }); + } + }) }, //获取小时数据 getHourData(year, month, days) { diff --git a/src/views/enm_mill/teamAnalysis.vue b/src/views/enm_mill/teamAnalysis.vue index 1dec1b39..fe7ccd7c 100644 --- a/src/views/enm_mill/teamAnalysis.vue +++ b/src/views/enm_mill/teamAnalysis.vue @@ -99,6 +99,7 @@ export default { }, tableDatas: [], exportLoading: false, + tableName: "水泥粉磨工序班组月度对比分析", }; }, mounted() { diff --git a/src/views/enm_mill/workshopAnalysis.vue b/src/views/enm_mill/workshopAnalysis.vue index 82b8612c..6a482b8a 100644 --- a/src/views/enm_mill/workshopAnalysis.vue +++ b/src/views/enm_mill/workshopAnalysis.vue @@ -196,6 +196,7 @@ export default { monthGoal2: [], tableDatas: [], tableDatas2: [], + tableName:'水泥分布电耗月度分析表', options: [ { name: "电耗", diff --git a/src/views/enm_pack/report.vue b/src/views/enm_pack/report.vue index 75cec810..e1fcd9f9 100644 --- a/src/views/enm_pack/report.vue +++ b/src/views/enm_pack/report.vue @@ -2,6 +2,52 @@
+ + + + + + + -
+ + +
本月生产参数统计图
-
+
本年生产参数统计图
- + { + if (res1.length > 0) { + res1.forEach((item) => { + if (item.mpoint_name == "水泥+P.O42.5R 散装") { + that.tableDatas[0][5] = item.val; + }else if (item.mpoint_name == "水泥+P.O42.5R 袋装"){ + that.tableDatas[1][5] = item.val; + }else if (item.mpoint_name == "水泥+P.O42.5 袋装") { + that.tableDatas[2][5] = item.val; + }else if (item.mpoint_name == "水泥+P.O42.5 散装") { + that.tableDatas[3][5] = item.val; + }else if (item.mpoint_name == "复合硅酸盐水泥;42.5R;袋装水泥") { + that.tableDatas[4][5] = item.val; + }else if (item.mpoint_name == "水泥+P.C42.5 散装") { + that.tableDatas[5][5] = item.val; + }else if (item.mpoint_name == "水泥+P.O52.5 散装") { + that.tableDatas[6][5] = item.val; + }else if (item.mpoint_name == "散装水泥总和"){ + that.tableDatas[7][5] = item.val; + }else if (item.mpoint_name == "袋装水泥总和") { + that.tableDatas[8][5] = item.val; + } + else if (item.mpoint_name == "出厂水泥") { + that.tableDatas[9][5] = item.val; + }else if (item.mpoint_name == "出厂熟料"){ + that.tableDatas[10][5] = item.val; + }else if (item.mpoint_name == "包装进线") { + that.tableDatas[11][5] = item.elec_consume_unit; + that.tableDatas[12][5] = item.val; + } + })} + }) + }, + + get_months(year, month){ + let that = this; + let params2 = {}; + params2.page = 0; + params2.year_s = year; + params2.month_s = month; + params2.type = "month_s"; + params2.mgroup = that.query.mgroup; + this.$API.enm.mpointstat.list.req(params2).then((res2) => { + if (res2.length > 0) { + res2.forEach((item) => { + if (item.mpoint_name == "水泥+P.O42.5R 散装") { + that.tableDatas[0][4] = item.val; + }else if (item.mpoint_name == "水泥+P.O42.5R 袋装"){ + that.tableDatas[1][4] = item.val; + }else if (item.mpoint_name == "水泥+P.O42.5 袋装") { + that.tableDatas[2][4] = item.val; + }else if (item.mpoint_name == "水泥+P.O42.5 散装") { + that.tableDatas[3][4] = item.val; + }else if (item.mpoint_name == "复合硅酸盐水泥;42.5R;袋装水泥") { + that.tableDatas[4][4] = item.val; + }else if (item.mpoint_name == "水泥+P.C42.5 散装") { + 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 == "散装水泥总和"){ + that.tableDatas[7][4] = item.val; + }else if (item.mpoint_name == "袋装水泥总和") { + that.tableDatas[8][4] = item.val; + } + 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; + } + }) + } + }) + }, //获取天数据-图表 getDayData(year, month) { let that = this; @@ -742,6 +872,7 @@ export default { query1.month_s = month; query1.type = "day_s"; query1.mgroup = this.query.mgroup; + this.$API.enm.mpointstat.list.req(query1).then((response) => { let seriesData1 = [], seriesData2 = [], diff --git a/src/views/enm_pack/teamAnalysis.vue b/src/views/enm_pack/teamAnalysis.vue index e4ecef51..72d48c73 100644 --- a/src/views/enm_pack/teamAnalysis.vue +++ b/src/views/enm_pack/teamAnalysis.vue @@ -88,6 +88,7 @@ export default { mgroup: "", }, tableDatas: [], + tableName:'水泥分布电耗月度分析表', }; }, mounted() { diff --git a/src/views/enm_pack/workshopAnalysis.vue b/src/views/enm_pack/workshopAnalysis.vue index abc482c6..253de634 100644 --- a/src/views/enm_pack/workshopAnalysis.vue +++ b/src/views/enm_pack/workshopAnalysis.vue @@ -126,6 +126,7 @@ export default { showClose: true, echartType: "line", asynDialog: false, + tableName:'水泥分布电耗月度分析表' }; }, mounted() { diff --git a/src/views/enm_report/quality.vue b/src/views/enm_report/quality.vue index 92a8e18e..b987c244 100644 --- a/src/views/enm_report/quality.vue +++ b/src/views/enm_report/quality.vue @@ -70,6 +70,16 @@
+ @@ -86,11 +96,34 @@ - - + +
{{item4}}
{{item1}}
+ {{ cell }} +
+ +
+ + +
+ +
@@ -111,6 +144,8 @@ ], titleLength:1, mgroupOptions:[], + threshold: 80, // 数值类型的阈值 + currentThreshold: "80%", // 当前编辑的阈值 tableTime:'', deptName:'', typeName:'质检日报表', @@ -145,6 +180,9 @@ tableData:[], header2Obj:[], deptOptions:[], + dialogVisible: false, // 控制对话框显示 + currentColumnIndex: null, // 当前编辑的列索引 + thresholds: {}, // 存储每列的阈值,key 为列索引 }; }, watch: { @@ -178,6 +216,34 @@ } that.tableName = that.deptName+that.typeName; }, + updateThreshold() { + const num = parseFloat(this.currentThreshold.replace("%", "")); + if (!isNaN(num)) { + // 保存阈值 + this.thresholds[this.currentColumnIndex] = num; + this.dialogVisible = false; // 关闭对话框 + } else { + this.$message.error("请输入有效的阈值,例如:80%"); + } + }, + // 关闭对话框时重置状态 + resetDialog() { + this.currentColumnIndex = null; + this.currentThreshold = ""; + }, + // 动态样式计算 + getCellClass(cell, cellIndex) { + if (cellIndex > 0 && ((cellIndex - 1) % 4 === 3)) { + // 假设合格率在每组数据的第四列 + const cellValue = String(cell); + const value = parseFloat(cellValue.replace("%", "")); + const threshold = this.thresholds[cellIndex] || 0; // 获取对应列的阈值 + if (!isNaN(value)) { + return value > threshold ? "green-text" : "red-text"; + } + } + return ""; + }, deptChange(e){ let that = this; that.deptOptions.forEach(item=>{ @@ -197,6 +263,13 @@ this.getTableData(); }); }, + handleCellClick(cell, rowIndex, cellIndex){ + if ((cellIndex - 1) % 4 === 3) { //合格率列 + this.currentColumnIndex = cellIndex; // 记录列索引 + this.currentThreshold = this.thresholds[cellIndex] || ""; // 获取当前阈值 + this.dialogVisible = true; // 显示对话框 + } + }, getTableData(){ let that = this; that.tableDatas3 = []; @@ -263,7 +336,6 @@ wrapArr = wrapArr.filter(item=>{ return item }) - console.log(wrapArr,'warpArr') wrapArr.forEach((item1,index1)=>{ if(item1!=undefined){//一天的数据 let itemArr = []; @@ -271,7 +343,6 @@ let time =item1[0].day_s!=null? item1[0].year_s+'.'+item1[0].month_s+'.'+item1[0].day_s:item1[0].year_s+'.'+item1[0].month_s; itemArr.push(time) //遍历每个工段 - console.log(itemArr, 'itemArr--') item1.forEach(item2=>{ let data2 =item2.qua_data; //遍历一个工段的物料检验数据 @@ -371,5 +442,11 @@ .tableContainer{ overflow-x: scroll; } + .red-text { + color: red; + } + .green-text { + color: green; + } \ No newline at end of file diff --git a/src/views/enm_report/reportDay.vue b/src/views/enm_report/reportDay.vue index 12fda1fd..f6eb52e2 100644 --- a/src/views/enm_report/reportDay.vue +++ b/src/views/enm_report/reportDay.vue @@ -215,7 +215,7 @@ params.page = 0; params.year_s = that.year; params.month_s = that.month; - params.day_s = that.day; + // params.day_s = that.day; params.type = 'day_s'; that.tableName = that.year+'-'+that.month+'-'+that.day+'-生产日报表'; this.$API.enm.enstat.req(params).then((res) => { diff --git a/src/views/enm_report/teamAnalysisLog.vue b/src/views/enm_report/teamAnalysisLog.vue index 174d144a..8f37f2a5 100644 --- a/src/views/enm_report/teamAnalysisLog.vue +++ b/src/views/enm_report/teamAnalysisLog.vue @@ -48,6 +48,7 @@ end-placeholder="结束日期" v-if="query.type == 1" style="width: 300px;" + @change = getTableData /> @@ -298,10 +300,14 @@ export default { getTableData() { let that = this; let arr = []; - if (that.query.type == 1) { + this.query.start_time__gte = null; + this.query.end_time__lt = null; + this.query.end_time__year = null; + this.query.end_time__month = null; + if (that.query.type == 1 && this.value1 && this.value1.length > 0) { this.query.start_time__gte = this.value1[0]; this.query.end_time__lt = this.value1[1];} - else if (that.query.type == 2) { + else if (that.query.type == 2 && that.query.month) { this.query.start_time__gte = '', this.query.end_time__lt = '', arr = that.query.month.split('-'); diff --git a/src/views/enm_rm/report.vue b/src/views/enm_rm/report.vue index a1555a16..1cdddfc0 100644 --- a/src/views/enm_rm/report.vue +++ b/src/views/enm_rm/report.vue @@ -459,7 +459,7 @@ let yAxis_hour = [ axisLine: { show: true, lineStyle: { - color: colors[3], + color: colors[1], }, }, axisLabel: { @@ -1190,7 +1190,7 @@ export default { dateChange() { let that = this; let arr = []; - if(that.query.type==0) { + if(that.query.type==0 && that.query.day) { arr = that.query.day.split('-'); that.year = Number(arr[0]); that.month = Number(arr[1]); @@ -1198,14 +1198,14 @@ export default { this.getHourData(that.year, that.month, that.days); this.get_days(that.year, that.month, that.days); } - else if(that.query.type==1) { + else if(that.query.type==1 && that.query.month) { let year = that.query.month.split("-")[0]; let month = that.query.month.split("-")[1]; month = Number(month); this.getDayData(year, month); this.get_months(year, month); this.get_month_year_goal(year, month); - }else if (that.query.type==2) { + }else if (that.query.type==2 && that.query.year) { let year = that.query.year; this.getMonthData(year); this.get_years(year); @@ -1250,54 +1250,54 @@ export default { get_months(year, month){ let that = this; 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][4] = data2.total_production; - that.tableDatas[0][7] = precen( - that.tableDatas[0][4], - that.tableDatas[0][6] - ); - that.tableDatas[1][4] = data2.elec_consume_unit; - that.tableDatas[1][7] = consume_precen( - that.tableDatas[1][4], - that.tableDatas[1][6] - ); - that.tableDatas[2][4] = data2.elec_consume; - that.tableDatas[3][4] = - data2.production_cost_unit; - that.tableDatas[3][7] = consume_precen( - that.tableDatas[3][3], - that.tableDatas[3][6] - ); - that.tableDatas[2][7] = consume_precen( - that.tableDatas[2][4], - that.tableDatas[2][6] - ); - if (data2.imaterial_data.length > 0) { - data2.imaterial_data.forEach((item) => { - if (item.material_name == "湿电石渣消耗") { - that.tableDatas[4][4] = (item.amount_consume).toFixed(2); - that.tableDatas[4][7] = precen( - that.tableDatas[4][4], - that.tableDatas[4][6] - ); - }else if(item.material_name == "湿电石渣进厂"){ - that.tableDatas[5][4] = (item.amount_consume).toFixed(2); - that.tableDatas[5][7] = precen( - that.tableDatas[5][4], - that.tableDatas[5][6] - ); - } - }); - } - } - }); + 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][4] = data2.total_production; + that.tableDatas[0][7] = precen( + that.tableDatas[0][4], + that.tableDatas[0][6] + ); + that.tableDatas[1][4] = data2.elec_consume_unit; + that.tableDatas[1][7] = consume_precen( + that.tableDatas[1][4], + that.tableDatas[1][6] + ); + that.tableDatas[2][4] = data2.elec_consume; + that.tableDatas[3][4] = + data2.production_cost_unit; + that.tableDatas[3][7] = consume_precen( + that.tableDatas[3][3], + that.tableDatas[3][6] + ); + that.tableDatas[2][7] = consume_precen( + that.tableDatas[2][4], + that.tableDatas[2][6] + ); + if (data2.imaterial_data.length > 0) { + data2.imaterial_data.forEach((item) => { + if (item.material_name == "湿电石渣消耗") { + that.tableDatas[4][4] = (item.amount_consume).toFixed(2); + that.tableDatas[4][7] = precen( + that.tableDatas[4][4], + that.tableDatas[4][6] + ); + }else if(item.material_name == "湿电石渣进厂"){ + that.tableDatas[5][4] = (item.amount_consume).toFixed(2); + that.tableDatas[5][7] = precen( + that.tableDatas[5][4], + that.tableDatas[5][6] + ); + } + }); + } + } + }); }, get_month_year_goal(year, month){ let that = this; diff --git a/src/views/enm_rm/teamAnalysis.vue b/src/views/enm_rm/teamAnalysis.vue index d833d86f..4a2b18b3 100644 --- a/src/views/enm_rm/teamAnalysis.vue +++ b/src/views/enm_rm/teamAnalysis.vue @@ -98,6 +98,7 @@ export default { tableDatas: [], goalDatas: [], exportLoading: false, + tableName : '生料辅料工序班组月度对比分析', }; }, mounted() { diff --git a/src/views/enm_rm/workshopAnalysis.vue b/src/views/enm_rm/workshopAnalysis.vue index fe70447d..aa327496 100644 --- a/src/views/enm_rm/workshopAnalysis.vue +++ b/src/views/enm_rm/workshopAnalysis.vue @@ -126,6 +126,7 @@ export default { echartType: "line", asynDialog: false, monthGoal: [], + tableName:'生料辅料工序班组月度对比分析', }; }, mounted() { diff --git a/src/views/enm_rm_copy/report.vue b/src/views/enm_rm_copy/report.vue index deb6eb2b..cd88c26d 100644 --- a/src/views/enm_rm_copy/report.vue +++ b/src/views/enm_rm_copy/report.vue @@ -2,6 +2,52 @@
+ + + + + + + -
+ -
+
本日生产参数统计图
-
+
本月生产参数统计图
-
+
本年生产参数统计图
- + { + 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;} + } + }); + }, + get_months(year, month){ + let that = this; + 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][4] = + data2.total_production; + if ( + that.tableDatas[0][4] > + that.tableDatas[0][6] + ) { + that.wraning = true; + } + that.tableDatas[0][7] = precen( + that.tableDatas[0][4], + that.tableDatas[0][6] + ); + that.tableDatas[1][4] = + data2.production_hour; + that.tableDatas[1][7] = precen( + that.tableDatas[1][4], + that.tableDatas[1][6] + ); + that.tableDatas[2][4] = data2.run_hour; + that.tableDatas[2][7] = precen( + that.tableDatas[2][4], + that.tableDatas[2][6] + ); + that.tableDatas[3][4] = data2.run_rate; + that.tableDatas[3][7] = precen( + that.tableDatas[3][4], + that.tableDatas[3][6] + ); + that.tableDatas[4][4] = + data2.elec_consume_unit; + that.tableDatas[4][7] = consume_precen( + (that.tableDatas[4][6]-that.tableDatas[4][4]), + that.tableDatas[4][6] + ); + that.tableDatas[5][4] = data2.elec_consume; + that.tableDatas[5][7] = consume_precen( + (that.tableDatas[5][6]-that.tableDatas[5][4]), + that.tableDatas[5][6] + ); + that.tableDatas[6][4] = + data2.production_cost_unit; + that.tableDatas[6][7] = consume_precen( + (that.tableDatas[6][6] - that.tableDatas[6][4]), + that.tableDatas[6][6] + ); + } + }); + }, + get_month_year_goal(year, month){ + let that = this; + let params5 = {}; + params5.page = 0; + params5.year = year; + 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_" + month; + debugger; + console.log(str, item5[str]); + + if (item5.goal_cate_name == "总产量(t)") { + that.tableDatas[0][6] = item5[str]; + that.tableDatas[0][8] = item5.goal_val; + } else if ( + item5.goal_cate_name == + "台时产量(t/h)" + ) { + that.tableDatas[1][6] = item5[str]; + that.tableDatas[1][8] = item5.goal_val; + } else if ( + item5.goal_cate_name == "运转时间(h)" + ) { + that.tableDatas[2][6] = item5[str]; + that.tableDatas[2][8] = item5.goal_val; + } else if ( + item5.goal_cate_name == "运转率(%)" + ) { + that.tableDatas[3][6] = item5[str]; + that.tableDatas[3][8] = item5.goal_val; + } else if ( + item5.goal_cate_name == + "单位产品分布电耗(kW·h/t)" + ) { + that.tableDatas[4][6] = item5[str]; + that.tableDatas[4][8] = item5.goal_val; + } else if (item5.goal_cate_name == + "总电量(kW·h)"){ + that.tableDatas[5][6] = item5[str]; + that.tableDatas[5][8] = item5.goal_val; + } + else if ( + item5.goal_cate_name == + "单位产品成本(元/吨)" + ) { + that.tableDatas[6][6] = item5[str]; + that.tableDatas[6][8] = item5.goal_val; + } + }); + } + }) + }, + get_years(year){ + 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][5] = + data1.total_production; + that.tableDatas[0][9] = precen( + that.tableDatas[0][5], + that.tableDatas[0][8] + ); + that.tableDatas[1][5] = + data1.production_hour; + that.tableDatas[1][9] = precen( + 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] = consume_precen( + (that.tableDatas[4][8] - that.tableDatas[4][5]), + that.tableDatas[4][8] + ); + that.tableDatas[5][5] = data1.elec_consume; + that.tableDatas[5][9] = consume_precen( + (that.tableDatas[5][8] - that.tableDatas[5][5]), + that.tableDatas[5][8] + ); + that.tableDatas[6][5] = + data1.production_cost_unit; + that.tableDatas[6][9] = precen( + (that.tableDatas[6][8] - that.tableDatas[6][5]), + that.tableDatas[6][8] + ); + } else { + } + }); }, //获取小时数据 getHourData(year, month, days) { diff --git a/src/views/enm_rm_copy/teamAnalysis.vue b/src/views/enm_rm_copy/teamAnalysis.vue index bfee9335..166695eb 100644 --- a/src/views/enm_rm_copy/teamAnalysis.vue +++ b/src/views/enm_rm_copy/teamAnalysis.vue @@ -100,6 +100,7 @@ export default { tableDatas: [], goalDatas: [], exportLoading: false, + tableName:'生料工序班组月度对比分析', }; }, mounted() { diff --git a/src/views/enm_rm_copy/workshopAnalysis.vue b/src/views/enm_rm_copy/workshopAnalysis.vue index c85dce3b..250120ec 100644 --- a/src/views/enm_rm_copy/workshopAnalysis.vue +++ b/src/views/enm_rm_copy/workshopAnalysis.vue @@ -125,6 +125,7 @@ export default { echartType: "line", asynDialog: false, monthGoal: [], + tableName:'生料分布电耗月度分析表' }; }, mounted() { diff --git a/src/views/enm_slag/report.vue b/src/views/enm_slag/report.vue index bedaebca..3a7910b6 100644 --- a/src/views/enm_slag/report.vue +++ b/src/views/enm_slag/report.vue @@ -479,8 +479,7 @@ let yAxis = [ }, ]; - -let yAxis_hour = [ +let yAxis_day = [ { type: "value", name: "电石渣干粉总产量 (t)", @@ -584,6 +583,75 @@ let yAxis_hour = [ } ]; +let yAxis_hour = [ + { + type: "value", + name: "电石渣干粉总产量 (t)", + position: "left", + alignTicks: true, + nameRotate: 50, + axisLine: { + show: true, + lineStyle: { + color: colors[0], + }, + }, + axisLabel: { + formatter: "{value}", + }, + }, + { + type: "value", + nameRotate: 50, + name: "电石渣干粉分布电耗(kW·h/t)", + position: "right", + alignTicks: true, + offset: 50, + axisLine: { + show: true, + lineStyle: { + color: colors[1], + }, + }, + axisLabel: { + formatter: "{value}", + }, + }, + { + type: "value", + nameRotate: 50, + name: "电石渣工段总电量(kW·h)", + position: "left", + alignTicks: true, + offset: 50, + axisLine: { + show: true, + lineStyle: { + color: colors[2], + }, + }, + axisLabel: { + formatter: "{value}", + }, + }, + + { + type: "value", + nameRotate: 50, + name: "成本(元/t)", + position: "right", + alignTicks: true, + axisLine: { + show: true, + lineStyle: { + color: colors[3], + }, + }, + axisLabel: { + formatter: "{value}", + }, + } +]; export default { components: { scEcharts, @@ -645,7 +713,7 @@ export default { }, data: [], }, - yAxis: yAxis_hour, + yAxis: yAxis_day, series: [ { name: "电石渣干粉总产量", @@ -750,7 +818,24 @@ export default { tooltip: tooltip, grid: grid, toolbox: toolbox, - legend: legend, + legend: { + selector: [ + { + type: 'all', + title: '全选' + }, + { + type: 'inverse', + title: '反选' + } + ], + orient: 'horizontal', // 'vertical' + // top: "2%", + width: "500px", + x: 'center', + y:'top', + data: ["电石渣干粉总产量", "电石渣干粉分布电耗", "电石渣工段总电量", "成本"], + }, xAxis: { axisTick: { show: true, @@ -784,19 +869,7 @@ export default { type: "bar", yAxisIndex: 3, data: [], - }, - { - name: "湿电石渣消耗", - type: "bar", - yAxisIndex: 4, - data: [], - }, - { - name: "湿电石渣进厂", - type: "bar", - yAxisIndex: 5, - data: [], - }, + } ], }, }; @@ -1022,7 +1095,7 @@ export default { that.tableDatas[3][4] = data2.production_cost_unit; that.tableDatas[3][7] = consume_precen( - that.tableDatas[3][3], + that.tableDatas[3][6]-that.tableDatas[3][4], that.tableDatas[3][6] ); that.tableDatas[2][7] = consume_precen( @@ -1254,7 +1327,7 @@ export default { dateChange() { let that = this; let arr = []; - if(that.query.type==0) { + if(that.query.type==0 && that.query.day) { arr = that.query.day.split('-'); that.year = Number(arr[0]); that.month = Number(arr[1]); @@ -1262,14 +1335,14 @@ export default { this.getHourData(that.year, that.month, that.days); this.get_days(that.year, that.month, that.days); } - else if(that.query.type==1) { + else if(that.query.type==1 && that.query.month) { let year = that.query.month.split("-")[0]; let month = that.query.month.split("-")[1]; month = Number(month); this.getDayData(year, month); this.get_months(year, month); this.get_month_year_goal(year, month); - } else if (that.query.type==2) { + } else if (that.query.type==2 && that.query.year) { let year = that.query.year; this.getMonthData(year); this.get_years(year); @@ -1316,8 +1389,8 @@ export default { options.series[1].data = seriesData2; options.series[2].data = seriesData5; options.series[3].data = seriesData1; - options.series[4].data = seriesData3; - options.series[5].data = seriesData4; + // options.series[4].data = seriesData3; + // options.series[5].data = seriesData4; let hourXAxis = []; for (let i = 0; i < 24; i++) { let item = i + "时"; diff --git a/src/views/enm_slag/teamAnalysis.vue b/src/views/enm_slag/teamAnalysis.vue index ec3582de..1ca30413 100644 --- a/src/views/enm_slag/teamAnalysis.vue +++ b/src/views/enm_slag/teamAnalysis.vue @@ -88,6 +88,7 @@ export default { exportLoading: false, tableDatas: [], goalDatas: [], + tableName:'电石渣工序班组月度对比分析', }; }, mounted() { diff --git a/src/views/enm_slag/workshopAnalysis.vue b/src/views/enm_slag/workshopAnalysis.vue index 982d2885..c8f0413b 100644 --- a/src/views/enm_slag/workshopAnalysis.vue +++ b/src/views/enm_slag/workshopAnalysis.vue @@ -121,6 +121,7 @@ export default { modelValue: true, type: "hours", title: "title", + tableName : '电石渣干粉单位电耗月度分析表', apiObj: "", showClose: true, echartType: "line",