diff --git a/src/config/route.js b/src/config/route.js index 44d8c10a..801e3624 100644 --- a/src/config/route.js +++ b/src/config/route.js @@ -359,7 +359,7 @@ const routes = [ name: "enm_rm", path: "/enm_rm", meta: { - title: "生料工序", + title: "生料辅料工序", icon: "el-icon-menu", type: "menu", perms: ["enm_rm"], diff --git a/src/views/bigScreen/index_enm.vue b/src/views/bigScreen/index_enm.vue index ab027ca6..253eafd7 100644 --- a/src/views/bigScreen/index_enm.vue +++ b/src/views/bigScreen/index_enm.vue @@ -75,14 +75,14 @@
-
产量
+
本月产量
-
本月台时产量
+
本月台时
-
车间用水量
+
本月用水
diff --git a/src/views/enm_coal/report.vue b/src/views/enm_coal/report.vue index 0f6be474..96d9c010 100644 --- a/src/views/enm_coal/report.vue +++ b/src/views/enm_coal/report.vue @@ -509,9 +509,10 @@ export default { params4.day_s = days_h; params4.type = "day_s"; params4.mgroup = that.query.mgroup; - console.log("本日", params4); + console.log("本日----p", params4); that.$API.enm.enstat.req(params4).then((res4) => { - if (res4) { + if (res4) { + console.log("本日", res4); let data4 = res4[0]; that.tableDatas[0][2] = data4.total_production; if (data4.total_production < 1 ){ diff --git a/src/views/enm_energy/electric_total.vue b/src/views/enm_energy/electric_total.vue index bb6eb745..94a8acad 100644 --- a/src/views/enm_energy/electric_total.vue +++ b/src/views/enm_energy/electric_total.vue @@ -266,10 +266,11 @@ export default { let year = nowDate.getFullYear(); let month = nowDate.getMonth() + 1; that.timeStamp = nowDate.getTime(); + let day = nowDate.getDate(); that.days = new Date(year, month, 0).getDate(); that.headerLength = that.days + 4; that.tableWidth = that.headerLength * 100 + ""; - this.getMPoints(); + this.getMPoints(day, month, year); let heightContainer = document.getElementById("app-container").clientHeight; @@ -292,10 +293,8 @@ export default { that.year = Number(arr[0]); that.month = Number(arr[1]); that.day = Number(arr[2]); - that.dataLoop(); + that.dataLoop(that.day, that.month, that.year); } - let nowDate = new Date(); - that.timeStamp = nowDate.getTime(); }, formatArry(){ this.result = this.mpointIdList.join(","); // 将数组转换为字符串 @@ -321,7 +320,7 @@ export default { this.tableDatas_range = res; }); }, - getMPoints() { + getMPoints(day, month, year) { let that = this; that.$API.enm.mpoint.list .req({ @@ -334,14 +333,14 @@ export default { }) .then((res) => { that.mpointList = res.filter((item) => { - // 提取mpointIdList that.mpointIdList.push(item.id); return true; }); - that.dataLoop(); + console.log(day, month, year, "day, month, year"); + that.dataLoop(day, month, year); }); }, - dataLoop() { + dataLoop(day, month, year) { let that = this; that.tableDatas2 = []; that.mpointList.forEach((item, index) => { @@ -352,53 +351,67 @@ export default { ? item.code : None; that.tableDatas2.push(obj); - that.getData(item.id, index); + that.getData(item.id, index, day, month, year); }); }, - getData(id, index) { - let that = this; - let obj = { - query: "{val}" - }; - obj.type = "day"; - obj.year = that.year; - obj.month = that.month; - obj.day = that.day; - obj.mpoint = id; - obj.page = 0; - this.$API.enm.mpoint.stat.req(obj).then((res) => { - res.forEach((item) => { - that.tableDatas2[index]['day'] = item.val; - }); - }); - //月 + getData(id, index, day, month, year) { + let that = this; + + // Object for Day stats request + let obj = { + query: "{val}", + type: "day", + year: year, + month: month, + day: day, + mpoint: id, + page: 0 + }; + this.$API.enm.mpoint.stat.req(obj) + .then((res) => { + res.forEach((item) => { + that.tableDatas2[index]['day'] = item.val; + }); + }) + .then(() => { + // Object for Month stats request let obj_month = { - query: "{val}" - }; - obj_month.type = "month"; - obj_month.year = that.year; - obj_month.month = that.month; - obj_month.mpoint = id; - obj_month.page = 0; - this.$API.enm.mpoint.stat.req(obj_month).then((res) => { - res.forEach((item) => { - that.tableDatas2[index]['month'] = item.val; - }); - }); - //年 + query: "{val}", + type: "month", + year: year, + month: month, + mpoint: id, + page: 0 + }; + console.log('obj_month---------', obj_month); + return this.$API.enm.mpoint.stat.req(obj_month); // Return the promise for chaining + }) + .then((res) => { + res.forEach((item) => { + that.tableDatas2[index]['month'] = item.val; + }); + }) + .then(() => { + // Object for Year stats request let obj_year = { - query: "{val}" - }; - obj_year.type = "year"; - obj_year.year = that.year; - obj_year.mpoint = id; - obj_year.page = 0; - this.$API.enm.mpoint.stat.req(obj_year).then((res) => { - res.forEach((item) => { - that.tableDatas2[index]['year'] = item.val; - }); - }); + query: "{val}", + type: "year", + year: year, + mpoint: id, + page: 0 + }; + return this.$API.enm.mpoint.stat.req(obj_year); // Return the promise for chaining + }) + .then((res) => { + res.forEach((item) => { + that.tableDatas2[index]['year'] = item.val; + }); + }) + .catch((error) => { + console.error("Error fetching data:", error); + }); }, + // handleCellClick(row, column, cell, event) { // let that = this; diff --git a/src/views/enm_rm/report.vue b/src/views/enm_rm/report.vue index 0258cf8b..0961b0e4 100644 --- a/src/views/enm_rm/report.vue +++ b/src/views/enm_rm/report.vue @@ -1066,7 +1066,6 @@ export default { seriesData2 = [], seriesData3 = [], seriesData4 = []; - let data = response; data.forEach((item) => { let ind = item.hour; diff --git a/src/views/enm_slag/report.vue b/src/views/enm_slag/report.vue index 895b900b..15696972 100644 --- a/src/views/enm_slag/report.vue +++ b/src/views/enm_slag/report.vue @@ -25,10 +25,11 @@ > - 电石渣工段生产报告 + 电石渣工段生产报告 参数 + 本日 昨日 本月 本年 @@ -74,6 +75,7 @@ {{ item[6] }} {{ item[7]}} {{ item[8] }} + {{ item[9] }} @@ -113,7 +115,7 @@
本月生产参数统计图
@@ -121,7 +123,7 @@
本年生产参数统计图
@@ -227,6 +229,7 @@ @@ -274,7 +277,7 @@ let toolbox = { }; let legend = { top: "2%", - data: ["总产量", "分布电耗", "总电耗", "成本", "消耗", "进厂"], + data: ["总产量", "分布电耗", "总电量", "成本", "消耗", "进厂"], }; let yAxis = [ { @@ -299,7 +302,7 @@ let yAxis = [ name: "分布电耗(KW.h)", position: "left", alignTicks: true, - offset: 100, + offset: 80, axisLine: { show: true, lineStyle: { @@ -313,7 +316,7 @@ let yAxis = [ { type: "value", nameRotate: 45, - name: "总电耗(KW.h)", + name: "总电量(KW.h)", position: "left", alignTicks: true, offset: 50, @@ -331,7 +334,7 @@ let yAxis = [ { type: "value", nameRotate: 45, - name: "成本(元)", + name: "成本(元/t)", position: "right", alignTicks: true, axisLine: { @@ -405,7 +408,7 @@ export default { tableDatas: [ ["产量", "总产量(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, "/", "/", "/", "/", "/"], + ["能耗", "总电量(KW·h)", 0, 0, 0, "/", "/", "/", "/", "/"], ["成本", "电石渣成本(元/吨)", 0, 0, 0, 0, 0, 0, 0, 0], ["湿电石渣", "消耗", 0, 0, 0, "/", "/", "/", "/", "/"], ["湿电石渣", "进厂", 0, 0, 0, "/", "/", "/", "/", "/"], @@ -448,29 +451,29 @@ export default { data: [], }, { - name: "总电耗", - type: "bar", - yAxisIndex: 5, - data: [], - }, - { - name: "成本", + name: "总电量", type: "bar", yAxisIndex: 2, data: [], }, { - name: "消耗", + name: "成本", type: "bar", yAxisIndex: 3, data: [], }, { - name: "进厂", + name: "消耗", type: "bar", yAxisIndex: 4, data: [], }, + { + name: "进厂", + type: "bar", + yAxisIndex: 5, + data: [], + }, ], }, option2: { @@ -502,7 +505,7 @@ export default { data: [], }, { - name: "总电耗", + name: "总电量", type: "bar", yAxisIndex: 2, data: [], @@ -574,20 +577,53 @@ export default { this.$API.enm.enstat.req(params3).then((res3) => { if (res3.length > 0) { let data3 = res3[0]; - that.tableDatas[0][2] = data3.total_production; - that.tableDatas[1][2] = data3.elec_consume_unit; - that.tableDatas[2][2] = data3.elec_consume; - that.tableDatas[3][2] = data3.production_cost_unit; + that.tableDatas[0][3] = data3.total_production; + that.tableDatas[1][3] = data3.elec_consume_unit; + that.tableDatas[2][3] = data3.elec_consume; + that.tableDatas[3][3] = data3.production_cost_unit; if (data3.imaterial_data.length > 0) { data3.imaterial_data.forEach((item) => { + if (item.material_name == "湿电石渣消耗") { + that.tableDatas[4][3] = item.amount_consume; + }else if(item.material_name == "湿电石渣进厂"){ + that.tableDatas[5][3] = item.amount_consume; + } + }); + } + } + }); + // 本日 + //本日数据 + 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 = this.query.mgroup; + console.log(params4,"params4"); + this.$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 == 0) { + that.tableDatas[1][2] = 0; + that.tableDatas[2][2] = 0; + that.tableDatas[3][2] = 0; + } + that.tableDatas[1][2] = data4.elec_consume_unit; + that.tableDatas[2][2] = data4.elec_consume; + that.tableDatas[3][2] = data4.production_cost_unit; + if (data4.imaterial_data.length > 0) { + data4.imaterial_data.forEach((item) => { if (item.material_name == "湿电石渣消耗") { that.tableDatas[4][2] = item.amount_consume; }else if(item.material_name == "湿电石渣进厂"){ that.tableDatas[5][2] = item.amount_consume; } }); + } } - } }); //月目标 let params5 = {}; @@ -601,20 +637,20 @@ export default { data5.forEach((item5) => { let str = "goal_val_" + that.month; if (item5.goal_cate_name == "总产量(t)") { - that.tableDatas[0][5] = item5[str]; - that.tableDatas[0][7] = item5.goal_val; + that.tableDatas[0][6] = item5[str]; + that.tableDatas[0][8] = item5.goal_val; } else if ( item5.goal_cate_name == "单位产品分布电耗(KW·h/t)" ) { - that.tableDatas[1][5] = item5[str]; - that.tableDatas[1][7] = item5.goal_val; + that.tableDatas[1][6] = item5[str]; + that.tableDatas[1][8] = item5.goal_val; } else if ( item5.goal_cate_name == "单位产品成本(元/吨)" ) { - that.tableDatas[3][5] = item5[str]; - that.tableDatas[3][7] = item5.goal_val; + that.tableDatas[3][6] = item5[str]; + that.tableDatas[3][8] = item5.goal_val; } }); } @@ -629,29 +665,29 @@ export default { 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[0][5] = data1.total_production; + that.tableDatas[0][9] = precen( + that.tableDatas[0][5], + that.tableDatas[0][6] ); - that.tableDatas[1][4] = data1.elec_consume_unit; - that.tableDatas[1][8] = precen( + that.tableDatas[1][5] = data1.elec_consume_unit; + that.tableDatas[1][9] = precen( (that.tableDatas[1][4]-that.tableDatas[1][7]), that.tableDatas[1][7] ); - that.tableDatas[2][4] = data1.elec_consume; - that.tableDatas[3][4] = + that.tableDatas[2][5] = data1.elec_consume; + that.tableDatas[3][5] = data1.production_cost_unit; - that.tableDatas[3][8] = precen( - (that.tableDatas[3][4]-that.tableDatas[3][7]), - that.tableDatas[3][7] + that.tableDatas[3][9] = precen( + (that.tableDatas[3][5]-that.tableDatas[3][8]), + that.tableDatas[3][8] ); if (data1.imaterial_data.length > 0) { data1.imaterial_data.forEach((item) => { if (item.material_name == "湿电石渣消耗") { - that.tableDatas[4][4] = (item.amount_consume).toFixed(2); + that.tableDatas[4][5] = (item.amount_consume).toFixed(2); }else if(item.material_name == "湿电石渣进厂"){ - that.tableDatas[5][4] = (item.amount_consume).toFixed(2); + that.tableDatas[5][5] = (item.amount_consume).toFixed(2); } }); } @@ -668,29 +704,29 @@ export default { 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[0][4] = data2.total_production; + that.tableDatas[0][7] = precen( + that.tableDatas[0][4], + that.tableDatas[0][6] ); - that.tableDatas[1][3] = data2.elec_consume_unit; - that.tableDatas[1][6] = precen( - (that.tableDatas[1][3]-that.tableDatas[1][5]), - that.tableDatas[1][5] + that.tableDatas[1][4] = data2.elec_consume_unit; + that.tableDatas[1][7] = precen( + (that.tableDatas[1][4]-that.tableDatas[1][6]), + that.tableDatas[1][6] ); - that.tableDatas[3][3] = + that.tableDatas[3][4] = data2.production_cost_unit; - that.tableDatas[3][6] = precen( - (that.tableDatas[3][3]-that.tableDatas[3][5]), - that.tableDatas[3][5] + that.tableDatas[3][7] = precen( + (that.tableDatas[3][3]-that.tableDatas[3][6]), + that.tableDatas[3][6] ); - that.tableDatas[2][3] = data2.elec_consume; + that.tableDatas[2][4] = data2.elec_consume; if (data2.imaterial_data.length > 0) { data2.imaterial_data.forEach((item) => { if (item.material_name == "湿电石渣消耗") { - that.tableDatas[4][3] = (item.amount_consume).toFixed(2); + that.tableDatas[4][4] = (item.amount_consume).toFixed(2); }else if(item.material_name == "湿电石渣进厂"){ - that.tableDatas[5][3] = (item.amount_consume).toFixed(2); + that.tableDatas[5][4] = (item.amount_consume).toFixed(2); } }); }