From 11491e1394bf48bc548dbdae3ff6fd4c579b0726 Mon Sep 17 00:00:00 2001 From: zty Date: Wed, 21 Aug 2024 17:54:28 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=E5=A2=9E=E5=8A=A0=E6=B0=B4=E6=B3=A5?= =?UTF-8?q?=E5=8C=85=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/icons/Elec.vue | 5 ++++ src/assets/icons/index.js | 3 +- src/config/route.js | 12 ++++---- src/views/enm_pack/teamAnalysis.vue | 37 +++++++++++++++++++------ src/views/enm_pack/workshopAnalysis.vue | 4 +-- src/views/enm_rm/logDetail.vue | 7 +++-- src/views/enm_slag/handoverLog.vue | 2 +- src/views/enm_slag/power.vue | 12 ++------ 8 files changed, 52 insertions(+), 30 deletions(-) create mode 100644 src/assets/icons/Elec.vue diff --git a/src/assets/icons/Elec.vue b/src/assets/icons/Elec.vue new file mode 100644 index 00000000..567ddcc8 --- /dev/null +++ b/src/assets/icons/Elec.vue @@ -0,0 +1,5 @@ + diff --git a/src/assets/icons/index.js b/src/assets/icons/index.js index d8fa74ea..fe8a6acb 100644 --- a/src/assets/icons/index.js +++ b/src/assets/icons/index.js @@ -22,4 +22,5 @@ export { default as Shebei } from './Shebei.vue' export { default as Xiaoshou } from './Xiaoshou.vue' export { default as Zhixing } from './Zhixing.vue' export { default as Zhizao } from './Zhizao.vue' -export { default as Env } from './Env.vue' \ No newline at end of file +export { default as Env } from './Env.vue' +export { default as Elec } from './Elec.vue' \ No newline at end of file diff --git a/src/config/route.js b/src/config/route.js index 7b563ac6..0c85fbfa 100644 --- a/src/config/route.js +++ b/src/config/route.js @@ -235,7 +235,7 @@ const routes = [ path: "/enm_slag", meta: { title: "电石渣", - icon: "el-icon-opportunity", + icon: "el-icon-menu", type: "menu", perms: ["enm_slag"], }, @@ -341,7 +341,7 @@ const routes = [ path: "/enm_rm", meta: { title: "原料磨", - icon: "el-icon-list", + icon: "el-icon-menu", type: "menu", perms: ["enm_rm"], }, @@ -404,7 +404,7 @@ const routes = [ path: "/enm_rmbase", meta: { title: "原料磨", - icon: "el-icon-list", + icon: "el-icon-menu", type: "menu", perms: ["enm_rmbase"], }, @@ -467,7 +467,7 @@ const routes = [ path: "/enm_coal", meta: { title: "煤磨", - icon: "el-icon-brush-filled", + icon: "el-icon-menu", type: "menu", perms: ["enm_coal"], }, @@ -530,7 +530,7 @@ const routes = [ path: "/enm_coalbase", meta: { title: "煤磨", - icon: "el-icon-brush-filled", + icon: "el-icon-menu", type: "menu", perms: ["enm_coalbase"], }, @@ -921,7 +921,7 @@ const routes = [ path: "/enm_energy", meta: { title: "电量报表", - icon: "el-icon-share", + icon: "sc-icon-elec", type: "menu", perms: ["enm_energy"], }, diff --git a/src/views/enm_pack/teamAnalysis.vue b/src/views/enm_pack/teamAnalysis.vue index 53ee4bb2..fa5da65a 100644 --- a/src/views/enm_pack/teamAnalysis.vue +++ b/src/views/enm_pack/teamAnalysis.vue @@ -113,13 +113,12 @@ export default { }); }, methods: { - getData() { + getData(goalData) { let that = this; let query0 = {}; query0.page = 0; query0.type = "month_st"; query0.year_s = that.query.year_s - 1; - query0.mgroup = "3346520558031773696"; let wrapArr = [], wrapArr0 = [], wrapArrs = []; @@ -167,7 +166,7 @@ export default { arr[3] = item.elec_consume_unit; //当期值(KW·h/t) let keyVale = "goal_val_" + n; arr[4] = goalData[keyVale]; //目标值(KW·h/t)//需要接口获取 - arr[5] = arr[3] - item.celec_consume_unit; //当期与目标差值(KW·h/t) + arr[5] = arr[3] - arr[4]; //当期与目标差值(KW·h/t) let ind_pre = 0, huanbi = 0; if (item.month_s == 1) { @@ -184,13 +183,35 @@ export default { : "/"; } arr[6] = huanbi; //环期值(KW·h/t)上个月的值 - arr[7] = item.celec_consume_unit; //当期与环期差值(KW·h/t) - arr[8] = item.celec_consume_unit; //环比增长率(%) - arr[9] = item.celec_consume_unit; //同比增长率(%) - arr[10] = item.celec_consume_unit; //同比增长率(%) + let diff = 0; + if (arr[6] == "/"){ + diff == "/"; + }else{ + diff = arr[3] - arr[6]; //当期与环期差值(KW·h/t) + } + arr[7] = diff; + if (arr[7]=="/" || arr[6]=="/" || arr[6]==0){ + arr[8] = "/"; + }else{ + arr[8] = (arr[7]/arr[6])*100 //环比增长率(%)= 当期与环期差值(KW·h/t)/环期值(KW·h/t)*100% + } + let sameRate = 0; + if ( + wrapArr0[ind] && + wrapArr0[ind].elec_consume_unit + ) { + sameRate = + ((arrs[1] - + wrapArr0[ind].elec_consume_unit) / + wrapArr0[ind].elec_consume_unit) * + 100; + } else { + sameRate = "/"; + } + arr[9] = sameRate; ///同比增长率(%)需要当前值/ 上一年同一个月的值即wrapArr0[ind].elec_consume_unit + // arr[10] = item.celec_consume_unit; //同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit wrapArr[ind] = arr; }); - console.log(wrapArr); that.tableDatas = wrapArr; } else { } diff --git a/src/views/enm_pack/workshopAnalysis.vue b/src/views/enm_pack/workshopAnalysis.vue index 55ea4a51..9d129930 100644 --- a/src/views/enm_pack/workshopAnalysis.vue +++ b/src/views/enm_pack/workshopAnalysis.vue @@ -240,9 +240,9 @@ export default { let num = index - 1; if ( wrapArr[num] && - wrapArr[num].elec_consume_unit + wrapArr[num][1] ) { - lastNum = wrapArr[num].elec_consume_unit; + lastNum = wrapArr[num][1]; } else { lastNum = "/"; } diff --git a/src/views/enm_rm/logDetail.vue b/src/views/enm_rm/logDetail.vue index 194a0d47..5f9ae29d 100644 --- a/src/views/enm_rm/logDetail.vue +++ b/src/views/enm_rm/logDetail.vue @@ -22,6 +22,7 @@ type="primary" @click.stop="addStlog" v-if="activeName == 'fourth'" + v-auth="'sflogexp.create'" style=" position: absolute; top: 6px; @@ -129,7 +130,7 @@ 保存 @@ -168,7 +169,7 @@ type="primary" :loading="isSaveing" @click="submit5(item)" - style="margin-left: 20px" + style="margin-left: 20px" v-auth="'mpointstat.create'" >保存 @@ -225,6 +226,7 @@ size="small" @click="mpointStat_del(scope.row)" type="danger" + v-auth="'mpointstat.delete'" >删除 @@ -539,6 +541,7 @@ @click=" sflogexp_edit(scope.row) " + v-auth="'sflogexp.update'" type="primary" >编辑 diff --git a/src/views/enm_slag/handoverLog.vue b/src/views/enm_slag/handoverLog.vue index 12e404a9..009fb214 100644 --- a/src/views/enm_slag/handoverLog.vue +++ b/src/views/enm_slag/handoverLog.vue @@ -104,7 +104,7 @@ size="small" @click="sflog_edit(scope.row)" type="primary" - >编辑详情 Date: Fri, 23 Aug 2024 17:20:22 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E6=B0=B4=E6=B3=A5=E7=A3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/enm_coal/workshopAnalysis.vue | 12 +- src/views/enm_kiln/teamAnalysis.vue | 100 ++++-- src/views/enm_pack/report.vue | 450 +++++++++++++++++++----- src/views/enm_pack/teamAnalysis.vue | 4 +- src/views/enm_pack/workshopAnalysis.vue | 2 +- 5 files changed, 439 insertions(+), 129 deletions(-) diff --git a/src/views/enm_coal/workshopAnalysis.vue b/src/views/enm_coal/workshopAnalysis.vue index 0941abcd..aab4a16d 100644 --- a/src/views/enm_coal/workshopAnalysis.vue +++ b/src/views/enm_coal/workshopAnalysis.vue @@ -171,6 +171,14 @@ export default { } return classInfo; }, + precen(a, b) { + if (b !== 0 && b !== null && a !== null) { + let precen = (a / b)* 100; + return precen.toFixed(2) + "%"; + } else { + return "/"; + } + }, getData() { let that = this; let query0 = {}; @@ -255,11 +263,11 @@ export default { //环比增长率(%) let lastRate = 0; if ( - lastDiff == "/" && + lastDiff !== "/" && lastNum !== "/" && lastNum !== 0 ) { - lastRate = (lastDiff / lastNum) * 100; + lastRate = this.precen(lastDiff, lastNum); } else { lastRate = "/"; } diff --git a/src/views/enm_kiln/teamAnalysis.vue b/src/views/enm_kiln/teamAnalysis.vue index 863c7897..0ee2adcf 100644 --- a/src/views/enm_kiln/teamAnalysis.vue +++ b/src/views/enm_kiln/teamAnalysis.vue @@ -136,11 +136,11 @@ export default { params.year = that.query.year_s; params.mgroup = that.query.mgroup; this.$API.mtm.goal.list.req(params).then((res) => { - let data = []; - if (res.length > 0) { - data = res[0]; - } - that.getData(data); + // let data = []; + // if (res.length > 0) { + // this.data = res; + // } + that.getData(res); }); }, getData(goalData) { @@ -215,46 +215,81 @@ export default { ? item.入窑生料_Fe2O3_rate_pass : "/"; arr[8] = - item.入窑生料_细度_rate_pass != null - ? item.入窑生料_细度_rate_pass + item.出磨煤粉_细度_rate_pass != null + ? item.出磨煤粉_细度_rate_pass : "/"; arr[9] = - item.入窑生料_水分_rate_pass != null - ? item.入窑生料_水分_rate_pass + item.出磨煤粉_水分_rate_pass != null + ? item.出磨煤粉_水分_rate_pass : "/"; arr[10] = - item.熟料_立升重_rate_pass != null - ? item.熟料_立升重_rate_pass + item.出窑熟料_立升重_rate_pass != null + ? item.出窑熟料_立升重_rate_pass : "/"; arr[11] = - item.熟料_fCaO_rate_pass != null - ? item.熟料_fCaO_rate_pass + item.出窑熟料_fCaO_rate_pass != null + ? item.出窑熟料_fCaO_rate_pass : "/"; //煤耗 - arr[12] = item.elec_consume_unit; //当期值(KW·h/t) - let keyVale = "goal_val_" + n; - arr[5] = goalData[keyVale]; //目标值(KW·h/t)//需要接口获取 - arr[6] = arr[4] - item.celec_consume_unit; //当期与目标差值(KW·h/t) + arr[12] = item.coal_consume_unit; //当期值(KW·h/t) + let keyValue = "goal_val_" + n; + if (goalData.length > 0){ + goalData.forEach((item) => { + if (item.id == "3638341891940192256") { + arr[13] = item[keyValue]; //目标值(KW·h/t)//需要接口获取 + }else if (item.id == "3637651365016526848"){ + arr[25] = item[keyValue]; //目标值(KW·h/t)//需要接口获取 + } + }); + }; + let dq = 0 + if (arr[13] !== null && arr[13] !== undefined){ + dq = arr[12] - arr[13]; //当期与目标差值(KW·h/t) + }else{ + dq == "/" + }; + arr[14] = dq; //当期与目标差值 let ind_pre = 0, huanbi = 0; if (item.month_s == 1) { ind_pre = 12; huanbi = wrapArr0[ind_pre] - ? wrapArr0[ind_pre].elec_consume_unit + ? wrapArr0[ind_pre].coal_consume_unit : "/"; } else { ind_pre = ind - 1; huanbi = wrapArr[ind_pre] - ? wrapArr[ind_pre].elec_consume_unit - ? wrapArr[ind_pre].elec_consume_unit + ? wrapArr[ind_pre].coal_consume_unit + ? wrapArr[ind_pre].coal_consume_unit : "/" : "/"; } arr[15] = huanbi; //环期值(KW·h/t)上个月的值 - arr[16] = item.celec_consume_unit; //当期与环期差值(KW·h/t) - arr[17] = item.celec_consume_unit; //环比增长率(%) - arr[18] = item.celec_consume_unit; //同比增长率(%) + if(huanbi !=="/"){ + arr[16] = arr[12] - huanbi; //当期与环期差值(KW·h/t) + }else{ + arr[16] = "/" + }; + if (arr[15] !== "/"&& arr[15]!== 0 && arr[16]!=="/") { + arr[17] = (arr[16] / arr[15]) * 100; //环比增长率(%) + } else{ + arr[17] = "/" + }; + let sameRate = 0; + if ( + wrapArr0[ind] && + wrapArr0[ind].coal_consume_unit + ) { + sameRate = + ((arrs[1] - + wrapArr0[ind].coal_consume_unit) / + wrapArr0[ind].coal_consume_unit) * + 100; + } else { + sameRate = "/"; + } + arr[18] = sameRate; ///同比增长率(%)需要当前值/ 上一年同一个月的值即wrapArr0[ind].elec_consume_unit //电耗 //设备 arr[19] = @@ -278,8 +313,10 @@ export default { ? item.窑头排风机_consume_unit : "/"; arr[24] = item.elec_consume_unit; //当期值(KW·h/t) - arr[25] = item.celec_consume_unit; //目标值(KW·h/t)//需要接口获取 - arr[26] = 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 !== "/"){ + arr[26] = arr[24]-arr[25] //当期与目标差值(KW·h/t) + } let ind_pre1 = 0, huanbi1 = 0; if (item.month_s == 1) { @@ -296,13 +333,18 @@ export default { : "/"; } arr[27] = huanbi; //环期值(KW·h/t)上个月的值 - arr[28] = item.celec_consume_unit; //当期与环期差值(KW·h/t) - arr[29] = item.celec_consume_unit; //环比增长率(%) + if(arr[27]!=="/" && huanbi1!=="/"){ + arr[28] = arr[24] - huanbi1; //当期与环期差值(KW·h/t) + }else{ + arr[28] = "/" + } + if(arr[28]!=="/" && huanbi1!=="/"){ + arr[29] = (arr[28] / huanbi1) * 100; //环比增长率(%) + }else{ + arr[29] = "/"}; //环比增长率(%) arr[30] = item.celec_consume_unit; //同比增长率(%) - arr[31] = item.celec_consume_unit; //同比增长率(%) wrapArr[ind] = arr; }); - console.log(wrapArr); that.tableDatas = wrapArr; } else { } diff --git a/src/views/enm_pack/report.vue b/src/views/enm_pack/report.vue index e04dc87c..625bd68c 100644 --- a/src/views/enm_pack/report.vue +++ b/src/views/enm_pack/report.vue @@ -38,8 +38,9 @@ - - {{ item[0] }} + + {{ item[0] }} + {{ item[0] }} {{ item[1] }} {{ item[4] }} - {{ item[5].toFixed(2) }} + {{ item[5] }} {{ item[6] }} - {{ item[7].toFixed(2) }} + {{ item[7] }} {{ item[8] }} @@ -326,8 +327,18 @@ export default { mgroup: "", }, tableDatas: [ - ["产量", "总产量(t)", 0, 0, 0, 0, 0, 0, 0, 0], - ["能耗", "单位产品分布电耗(KW·h/t)", 0, 0, 0, 0, 0, 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, "/", "/", "/","/"], + ["出厂水泥", "P.C42.5 袋装(t)", 0, 0, 0, "/", "/", "/","/"], + ["出厂水泥", "P.C42.5 散装(t)", 0, 0, 0, "/", "/", "/","/"], + ["出厂水泥", "P.O52.5 散装(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], + ], tableName: "生产报告", modelValue: true, @@ -360,6 +371,54 @@ export default { yAxisIndex: 0, data: [], }, + { + name: "P.O42.5R 散装", + type: "bar", + yAxisIndex: 0, + data: [], + }, + { + name: "P.O42.5R 袋装", + type: "bar", + yAxisIndex: 0, + data: [], + }, + { + name: "P.O42.5 袋装", + type: "bar", + yAxisIndex: 0, + data: [], + }, + { + name: "P.O42.5 散装", + type: "bar", + yAxisIndex: 0, + data: [], + }, + { + name: "P.C42.5 袋装", + type: "bar", + yAxisIndex: 0, + data: [], + }, + { + name: "P.C42.5 散装", + type: "bar", + yAxisIndex: 0, + data: [], + }, + { + name: "P.O52.5 散装", + type: "bar", + yAxisIndex: 0, + data: [], + }, + { + name: "熟料", + type: "bar", + yAxisIndex: 0, + data: [], + }, { name: "分布电耗", type: "bar", @@ -384,12 +443,60 @@ export default { }, yAxis: yAxis, series: [ - { + { name: "总产量", type: "bar", yAxisIndex: 0, data: [], }, + { + name: "P.O42.5R 散装", + type: "bar", + yAxisIndex: 0, + data: [], + }, + { + name: "P.O42.5R 袋装", + type: "bar", + yAxisIndex: 0, + data: [], + }, + { + name: "P.O42.5 袋装", + type: "bar", + yAxisIndex: 0, + data: [], + }, + { + name: "P.O42.5 散装", + type: "bar", + yAxisIndex: 0, + data: [], + }, + { + name: "P.C42.5 袋装", + type: "bar", + yAxisIndex: 0, + data: [], + }, + { + name: "P.C42.5 散装", + type: "bar", + yAxisIndex: 0, + data: [], + }, + { + name: "P.O52.5 散装", + type: "bar", + yAxisIndex: 0, + data: [], + }, + { + name: "熟料", + type: "bar", + yAxisIndex: 0, + data: [], + }, { name: "分布电耗", type: "bar", @@ -440,43 +547,69 @@ export default { params1.year_s = year; params1.type = "year_s"; params1.mgroup = that.query.mgroup; - this.$API.enm.enstat.req(params1).then((res1) => { + this.$API.enm.mpointstat.list.req(params1).then((res1) => { if (res1.length > 0) { - let data1 = res1[0]; - that.tableDatas[0][4] = data1.total_production; - that.tableDatas[1][4] = data1.elec_consume_unit; - } - }); - //月 + res1.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 == "水泥+P.C42.5 袋装") { + 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; + } + } + )} + }).then(()=>{ + //月 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.enstat.req(params2).then((res2) => { + this.$API.enm.mpointstat.list.req(params2).then((res2) => { if (res2.length > 0) { - let data2 = res2[0]; - that.tableDatas[0][3] = data2.total_production; - that.tableDatas[1][3] = data2.elec_consume_unit; + res2.forEach((item) => { + if (item.mpoint_name == "水泥+P.O42.5R 散装") { + that.tableDatas[0][3] = item.val; + }else if (item.mpoint_name == "水泥+P.O42.5R 袋装"){ + that.tableDatas[1][3] = item.val; + }else if (item.mpoint_name == "水泥+P.O42.5 袋装") { + that.tableDatas[2][3] = item.val; + }else if (item.mpoint_name == "水泥+P.O42.5 散装") { + that.tableDatas[3][3] = item.val; + }else if (item.mpoint_name == "水泥+P.C42.5 袋装") { + that.tableDatas[4][3] = item.val; + }else if (item.mpoint_name == "水泥+P.C42.5 散装") { + 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 == "出厂批次水泥合计") { + that.tableDatas[7][3] = item.val; + }else if (item.mpoint_name == "出厂熟料"){ + that.tableDatas[8][3] = item.val; + }else if (item.mpoint_name == "包装进线") { + that.tableDatas[9][3] = item.val; + } + } + ) } - }); - //昨日 - let params3 = {}; - params3.page = 0; - params3.year_s = year_d; - params3.month_s = month_d; - params3.day_s = days_d; - params3.type = "day_s"; - params3.mgroup = that.query.mgroup; - 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; - } - }); - //月目标 + }).then(() => { + //月年目标 let params5 = {}; params5.page = 0; params5.mgroup = that.query.mgroup; @@ -488,63 +621,121 @@ 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[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[1][5] = item5[str]; - that.tableDatas[1][7] = item5.goal_val; + 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] + );// 计算月完成度 + } }); } - }) - .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] - ); - } - }); }); + }) + }); + //昨日 + let params3 = {}; + params3.page = 0; + params3.year_s = year_d; + params3.month_s = month_d; + params3.day_s = days_d; + params3.type = "day_s"; + params3.mgroup = that.query.mgroup; + this.$API.enm.mpointstat.list.req(params3).then((res3) => { + if (res3.length > 0) { + res3.forEach((item) => { + if (item.mpoint_name == "水泥+P.O42.5R 散装") { + that.tableDatas[0][2] = item.val; + }else if (item.mpoint_name == "水泥+P.O42.5R 袋装"){ + that.tableDatas[1][2] = item.val; + }else if (item.mpoint_name == "水泥+P.O42.5 袋装") { + that.tableDatas[2][2] = item.val; + }else if (item.mpoint_name == "水泥+P.O42.5 散装") { + that.tableDatas[3][2] = item.val; + }else if (item.mpoint_name == "水泥+P.C42.5 袋装") { + that.tableDatas[4][2] = item.val; + }else if (item.mpoint_name == "水泥+P.C42.5 散装") { + 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 == "出厂批次水泥合计") { + that.tableDatas[7][2] = item.val; + }else if (item.mpoint_name == "出厂熟料"){ + that.tableDatas[8][2] = item.val; + }else if (item.mpoint_name == "包装进线") { + that.tableDatas[9][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); }); @@ -572,7 +763,7 @@ export default { } } }, - //获取天数据 + //获取天数据-图表 getDayData(year, month) { let that = this; let query1 = {}; @@ -581,19 +772,53 @@ export default { query1.month_s = month; query1.type = "day_s"; query1.mgroup = this.query.mgroup; - this.$API.enm.enstat.req(query1).then((response) => { + this.$API.enm.mpointstat.list.req(query1).then((response) => { let seriesData0 = [], - seriesData1 = []; - + seriesData1 = [], + seriesData2 = [], + seriesData3 = [], + seriesData4 = [], + seriesData5 = [], + seriesData6 = [], + seriesData7 = [], + seriesData8 = [], + seriesData9 = []; let data = response; data.forEach((item) => { let ind = item.day_s - 1; - seriesData0[ind] = item.total_production; - seriesData1[ind] = item.elec_consume_unit; + if (item.mpoint_name == "水泥+P.O42.5R 散装") { + seriesData1[ind] = item.val; + }else if (item.mpoint_name == "水泥+P.O42.5R 袋装"){ + seriesData2[ind] = item.val; + }else if (item.mpoint_name == "水泥+P.O42.5 袋装") { + seriesData3[ind] = item.val; + }else if (item.mpoint_name == "水泥+P.O42.5 散装") { + seriesData4[ind] = item.val; + }else if (item.mpoint_name == "水泥+P.C42.5 袋装") { + seriesData5[ind] = item.val; + }else if (item.mpoint_name == "水泥+P.C42.5 散装") { + seriesData6[ind] = item.val; + }else if (item.mpoint_name == "水泥+P.O52.5 散装") { + seriesData7[ind] = item.val; + }else if (item.mpoint_name == "出厂批次水泥合计") { + seriesData0[ind] = item.val; + }else if (item.mpoint_name == "出厂熟料"){ + seriesData8[ind] = item.val; + }else if (item.mpoint_name == "包装进线") { + seriesData9[ind] = item.val; + } }); let options = { ...that.option1 }; options.series[0].data = seriesData0; options.series[1].data = seriesData1; + options.series[2].data = seriesData2; + options.series[3].data = seriesData3; + options.series[4].data = seriesData4; + options.series[5].data = seriesData5; + options.series[6].data = seriesData6; + options.series[7].data = seriesData7; + options.series[8].data = seriesData8; + options.series[9].data = seriesData9; let dayXAxis = []; for (let i = 1; i <= that.days; i++) { let item = i + "日"; @@ -603,7 +828,7 @@ export default { that.optionDay = options; }); }, - //获取月数据 + //获取月数据-图表 getMonthData(year) { let that = this; let query2 = {}; @@ -611,18 +836,53 @@ export default { query2.year_s = year; query2.type = "month_s"; query2.mgroup = that.query.mgroup; - this.$API.enm.enstat.req(query2).then((response) => { + this.$API.enm.mpointstat.list.req(query2).then((response) => { let seriesData0 = [], - seriesData1 = []; + seriesData1 = [], + seriesData2 = [], + seriesData3 = [], + seriesData4 = [], + seriesData5 = [], + seriesData6 = [], + seriesData7 = [], + seriesData8 = [], + seriesData9 = []; let data = response; data.forEach((item) => { let ind = item.month_s - 1; - seriesData0[ind] = item.total_production; - seriesData1[ind] = item.elec_consume_unit; + if (item.mpoint_name == "水泥+P.O42.5R 散装") { + seriesData1[ind] = item.val; + }else if (item.mpoint_name == "水泥+P.O42.5R 袋装"){ + seriesData2[ind] = item.val; + }else if (item.mpoint_name == "水泥+P.O42.5 袋装") { + seriesData3[ind] = item.val; + }else if (item.mpoint_name == "水泥+P.O42.5 散装") { + seriesData4[ind] = item.val; + }else if (item.mpoint_name == "水泥+P.C42.5 袋装") { + seriesData5[ind] = item.val; + }else if (item.mpoint_name == "水泥+P.C42.5 散装") { + seriesData6[ind] = item.val; + }else if (item.mpoint_name == "水泥+P.O52.5 散装") { + seriesData7[ind] = item.val; + }else if (item.mpoint_name == "出厂批次水泥合计") { + seriesData0[ind] = item.val; + }else if (item.mpoint_name == "出厂熟料"){ + seriesData8[ind] = item.val; + }else if (item.mpoint_name == "包装进线") { + seriesData9[ind] = item.val; + } }); let options = { ...that.option2 }; options.series[0].data = seriesData0; options.series[1].data = seriesData1; + options.series[2].data = seriesData2; + options.series[3].data = seriesData3; + options.series[4].data = seriesData4; + options.series[5].data = seriesData5; + options.series[6].data = seriesData6; + options.series[7].data = seriesData7; + options.series[8].data = seriesData8; + options.series[9].data = seriesData9; let monthXAxis = []; for (let i = 1; i <= that.month; i++) { let item = i + "月"; diff --git a/src/views/enm_pack/teamAnalysis.vue b/src/views/enm_pack/teamAnalysis.vue index fa5da65a..19e40fd5 100644 --- a/src/views/enm_pack/teamAnalysis.vue +++ b/src/views/enm_pack/teamAnalysis.vue @@ -182,7 +182,7 @@ export default { : "/" : "/"; } - arr[6] = huanbi; //环期值(KW·h/t)上个月的值 + arr[6] = huanbi; //环期值(KW·h/t)上个月的值\ let diff = 0; if (arr[6] == "/"){ diff == "/"; @@ -191,7 +191,7 @@ export default { } arr[7] = diff; if (arr[7]=="/" || arr[6]=="/" || arr[6]==0){ - arr[8] = "/"; + arr[8] == "/"; }else{ arr[8] = (arr[7]/arr[6])*100 //环比增长率(%)= 当期与环期差值(KW·h/t)/环期值(KW·h/t)*100% } diff --git a/src/views/enm_pack/workshopAnalysis.vue b/src/views/enm_pack/workshopAnalysis.vue index 9d129930..d2e65acb 100644 --- a/src/views/enm_pack/workshopAnalysis.vue +++ b/src/views/enm_pack/workshopAnalysis.vue @@ -229,7 +229,7 @@ export default { //当期与目标差值(KW·h/t) let diff = 0; if (item[2] !== "/") { - diff = item[1] - item[2]; + diff = (item[1] - item[2]).toFixed(2); } else { diff = "/"; }