From 3cdee248c92c0565fe5d47decced0bacf8c7580a Mon Sep 17 00:00:00 2001 From: shijing Date: Thu, 17 Aug 2023 09:36:51 +0800 Subject: [PATCH] fixd:8.17 --- src/views/enm_coal/teamAnalysis.vue | 188 +++++++++--------- src/views/enm_coal/workshopAnalysis.vue | 20 +- src/views/enm_kiln/handoverLog.vue | 1 + src/views/enm_kiln/teamAnalysis.vue | 240 ++++++++++++----------- src/views/enm_kiln/workshopAnalysis.vue | 24 +-- src/views/enm_mill/teamAnalysis.vue | 194 +++++++++--------- src/views/enm_mill/workshopAnalysis.vue | 30 +-- src/views/enm_pack/teamAnalysis.vue | 170 ++++++++-------- src/views/enm_pack/workshopAnalysis.vue | 13 +- src/views/enm_rm/handoverLog.vue | 9 + src/views/enm_rm/handover_form.vue | 15 +- src/views/enm_rm/logDetail.vue | 249 ++++++++++++++++++++++++ src/views/enm_rm/report.vue | 240 ++++++++++++++++++++++- src/views/enm_rm/teamAnalysis.vue | 201 ++++++++++--------- src/views/enm_rm/workshopAnalysis.vue | 15 +- src/views/enm_slag/teamAnalysis.vue | 172 ++++++++-------- src/views/enm_slag/workshopAnalysis.vue | 15 +- src/views/ungrouped/quality.vue | 209 ++++++-------------- 18 files changed, 1220 insertions(+), 785 deletions(-) create mode 100644 src/views/enm_rm/logDetail.vue diff --git a/src/views/enm_coal/teamAnalysis.vue b/src/views/enm_coal/teamAnalysis.vue index 59e53a75..74b519ee 100644 --- a/src/views/enm_coal/teamAnalysis.vue +++ b/src/views/enm_coal/teamAnalysis.vue @@ -3,18 +3,12 @@
- { - let data0 = res0; - debugger; - if(data0.length>0){ - data0.forEach(item0 => { - //先按月份排序,再按班组排序 - let n0 = item0.month_s; - let ind0 = 0; - if(team_name0.indexOf('甲')>-1){ - ind0 = (n0-1)*3; - }else if(team_name0.indexOf('乙')>-1){ - ind0 = (n0-1)*3+1; - }else if(team_name0.indexOf('丙')>-1){ - ind0 = (n0-1)*3+2; - } - wrapArr0[ind0] = item0; - }); - debugger; - console.log(wrapArr0) - }else{ - } - this.$API.enm.enstat.req(that.query).then((res) => { - let data = res; - if(data.length>0){ - data.forEach(item => { - //先按月份排序,再按班组排序 - let n = item.month_s; - let team_name = item.team_name; - let ind = 0; - if(team_name.indexOf('甲')>-1){ - ind = (n-1)*3; - }else if(team_name.indexOf('乙')>-1){ - ind = (n-1)*3+1; - }else if(team_name.indexOf('丙')>-1){ - ind = (n-1)*3+2; - } - wrapArrs[ind] = item; - let arr = []; - let time = ''+item.year_s+'.'+item.month_s; - arr.push(time); - arr.push(item.team_name); - arr.push(item.total_production); - arr.push(item.production_hour); - arr.push(item.run_rate); - arr.push(item.production_cost_unit); - //质量 - arr[6]=item.煤粉_细度_rate_pass!=null?item.煤粉_细度_rate_pass:'/'; - arr[7]=item.煤粉_水分_rate_pass!=null?item.煤粉_水分_rate_pass:'/'; - //设备 - arr[8]=item.煤磨排风机_consume_unit!=null?item.煤磨排风机_consume_unit:'/'; - - arr[9]=item.elec_consume_unit//当期值(KW·h/t) - arr[10]=item.celec_consume_unit;//目标值(KW·h/t)//需要接口获取 - arr[11]=item.celec_consume_unit;//当期与目标差值(KW·h/t) - let ind_pre = 0,huanbi = 0; - if(item.month_s==1){ - ind_pre = 12; - huanbi = wrapArr0[ind_pre]?wrapArr0[ind_pre].elec_consume_unit:'/'; - }else{ - ind_pre=ind-1; - huanbi = wrapArr[ind_pre]?wrapArr[ind_pre].elec_consume_unit?wrapArr[ind_pre].elec_consume_unit:'/':'/' - } - arr[12]=huanbi;//环期值(KW·h/t)上个月的值 - arr[13]=item.celec_consume_unit;//当期与环期差值(KW·h/t) - arr[14]=item.celec_consume_unit;//环比增长率(%) - arr[15]=item.celec_consume_unit;//同比增长率(%) - arr[16]=item.celec_consume_unit;//同比增长率(%) - wrapArr[ind] = arr; - }); - console.log(wrapArr) - that.tableDatas = wrapArr; - }else{ - } - }) - }) + this.getData(); }, methods: { + getData(){ + let that = this; + let query0={}; + query0.page = 0; + query0.type='month_st'; + query0.year_s = that.query.year_s-1; + query0.mgroup=that.query.mgroup; + let wrapArr = [],wrapArr0 = [] ,wrapArrs = []; + this.$API.enm.enstat.req(query0).then((res0) => { + let data0 = res0; + debugger; + if(data0.length>0){ + data0.forEach(item0 => { + //先按月份排序,再按班组排序 + let n0 = item0.month_s; + let ind0 = 0; + if(team_name0.indexOf('甲')>-1){ + ind0 = (n0-1)*3; + }else if(team_name0.indexOf('乙')>-1){ + ind0 = (n0-1)*3+1; + }else if(team_name0.indexOf('丙')>-1){ + ind0 = (n0-1)*3+2; + } + wrapArr0[ind0] = item0; + }); + debugger; + console.log(wrapArr0) + }else{ + } + this.$API.enm.enstat.req(that.query).then((res) => { + let data = res; + if(data.length>0){ + data.forEach(item => { + //先按月份排序,再按班组排序 + let n = item.month_s; + let team_name = item.team_name; + let ind = 0; + if(team_name.indexOf('甲')>-1){ + ind = (n-1)*3; + }else if(team_name.indexOf('乙')>-1){ + ind = (n-1)*3+1; + }else if(team_name.indexOf('丙')>-1){ + ind = (n-1)*3+2; + } + wrapArrs[ind] = item; + let arr = []; + let time = ''+item.year_s+'.'+item.month_s; + arr.push(time); + arr.push(item.team_name); + arr.push(item.total_production); + arr.push(item.production_hour); + arr.push(item.run_rate); + arr.push(item.production_cost_unit); + //质量 + arr[6]=item.煤粉_细度_rate_pass!=null?item.煤粉_细度_rate_pass:'/'; + arr[7]=item.煤粉_水分_rate_pass!=null?item.煤粉_水分_rate_pass:'/'; + //设备 + arr[8]=item.煤磨排风机_consume_unit!=null?item.煤磨排风机_consume_unit:'/'; + + arr[9]=item.elec_consume_unit//当期值(KW·h/t) + arr[10]=item.celec_consume_unit;//目标值(KW·h/t)//需要接口获取 + arr[11]=item.celec_consume_unit;//当期与目标差值(KW·h/t) + let ind_pre = 0,huanbi = 0; + if(item.month_s==1){ + ind_pre = 12; + huanbi = wrapArr0[ind_pre]?wrapArr0[ind_pre].elec_consume_unit:'/'; + }else{ + ind_pre=ind-1; + huanbi = wrapArr[ind_pre]?wrapArr[ind_pre].elec_consume_unit?wrapArr[ind_pre].elec_consume_unit:'/':'/' + } + arr[12]=huanbi;//环期值(KW·h/t)上个月的值 + arr[13]=item.celec_consume_unit;//当期与环期差值(KW·h/t) + arr[14]=item.celec_consume_unit;//环比增长率(%) + arr[15]=item.celec_consume_unit;//同比增长率(%) + arr[16]=item.celec_consume_unit;//同比增长率(%) + wrapArr[ind] = arr; + }); + console.log(wrapArr) + that.tableDatas = wrapArr; + }else{ + } + }) + }) + }, + handleQuery(){ + this.tableDatas = []; + this.getData(); + }, itemClick(type,item){ this.type=type; this.asynDialog = true; diff --git a/src/views/enm_coal/workshopAnalysis.vue b/src/views/enm_coal/workshopAnalysis.vue index 8d844532..291cacbe 100644 --- a/src/views/enm_coal/workshopAnalysis.vue +++ b/src/views/enm_coal/workshopAnalysis.vue @@ -3,18 +3,17 @@
diff --git a/src/views/enm_kiln/teamAnalysis.vue b/src/views/enm_kiln/teamAnalysis.vue index 06da8d4c..fedab934 100644 --- a/src/views/enm_kiln/teamAnalysis.vue +++ b/src/views/enm_kiln/teamAnalysis.vue @@ -3,18 +3,12 @@
- { - let data0 = res0; - debugger; - if(data0.length>0){ - data0.forEach(item0 => { - //先按月份排序,再按班组排序 - let n0 = item0.month_s; - let ind0 = 0; - if(team_name0.indexOf('甲')>-1){ - ind0 = (n0-1)*3; - }else if(team_name0.indexOf('乙')>-1){ - ind0 = (n0-1)*3+1; - }else if(team_name0.indexOf('丙')>-1){ - ind0 = (n0-1)*3+2; - } - wrapArr0[ind0] = item0; - }); - debugger; - console.log(wrapArr0) - }else{ - } - this.$API.enm.enstat.req(that.query).then((res) => { - let data = res; - if(data.length>0){ - data.forEach(item => { - //先按月份排序,再按班组排序 - let n = item.month_s; - let team_name = item.team_name; - let ind = 0; - if(team_name.indexOf('甲')>-1){ - ind = (n-1)*3; - }else if(team_name.indexOf('乙')>-1){ - ind = (n-1)*3+1; - }else if(team_name.indexOf('丙')>-1){ - ind = (n-1)*3+2; - } - wrapArrs[ind] = item; - let arr = []; - let time = ''+item.year_s+'.'+item.month_s; - arr.push(time); - arr.push(item.team_name); - arr.push(item.total_production); - arr.push(item.production_hour); - arr.push(item.run_rate); - arr.push(item.production_cost_unit); - //质量 - arr[6]=item.入窑生料_CaO_rate_pass!=null?item.入窑生料_CaO_rate_pass:'/'; - arr[7]=item.入窑生料_Fe2O3_rate_pass!=null?item.入窑生料_Fe2O3_rate_pass:'/'; - arr[8]=item.入窑生料_细度_rate_pass!=null?item.入窑生料_细度_rate_pass:'/'; - arr[9]=item.入窑生料_水分_rate_pass!=null?item.入窑生料_水分_rate_pass:'/'; - arr[10]=item.熟料_立升重_rate_pass!=null?item.熟料_立升重_rate_pass:'/'; - arr[11]=item.熟料_fCaO_rate_pass!=null?item.熟料_fCaO_rate_pass:'/'; - //设备 - arr[12]=item.高温风机_consume_unit!=null?item.高温风机_consume_unit:'/'; - arr[13]=item.篦冷机一室风机_consume_unit!=null?item.篦冷机一室风机_consume_unit:'/'; - arr[14]=item.篦冷机三室风机_consume_unit!=null?item.篦冷机三室风机_consume_unit:'/'; - arr[15]=item.篦冷机二室风机_consume_unit!=null?item.篦冷机二室风机_consume_unit:'/'; - arr[16]=item.窑头排风机_consume_unit!=null?item.窑头排风机_consume_unit:'/'; - - //煤耗 - arr[17]=item.elec_consume_unit//当期值(KW·h/t) - arr[18]=item.celec_consume_unit;//目标值(KW·h/t)//需要接口获取 - arr[19]=item.celec_consume_unit;//当期与目标差值(KW·h/t) - let ind_pre = 0,huanbi = 0; - if(item.month_s==1){ - ind_pre = 12; - huanbi = wrapArr0[ind_pre]?wrapArr0[ind_pre].elec_consume_unit:'/'; - }else{ - ind_pre=ind-1; - huanbi = wrapArr[ind_pre]?wrapArr[ind_pre].elec_consume_unit?wrapArr[ind_pre].elec_consume_unit:'/':'/' - } - arr[20]=huanbi;//环期值(KW·h/t)上个月的值 - arr[21]=item.celec_consume_unit;//当期与环期差值(KW·h/t) - arr[22]=item.celec_consume_unit;//环比增长率(%) - arr[23]=item.celec_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) - let ind_pre1 = 0,huanbi1 = 0; - if(item.month_s==1){ - ind_pre1 = 12; - huanbi1 = wrapArr0[ind_pre]?wrapArr0[ind_pre].elec_consume_unit:'/'; - }else{ - ind_pre1=ind-1; - huanbi1 = wrapArr[ind_pre]?wrapArr[ind_pre].elec_consume_unit?wrapArr[ind_pre].elec_consume_unit:'/':'/' - } - arr[27]=huanbi;//环期值(KW·h/t)上个月的值 - arr[28]=item.celec_consume_unit;//当期与环期差值(KW·h/t) - arr[29]=item.celec_consume_unit;//环比增长率(%) - arr[30]=item.celec_consume_unit;//同比增长率(%) - arr[31]=item.celec_consume_unit;//同比增长率(%) - wrapArr[ind] = arr; - }); - console.log(wrapArr) - that.tableDatas = wrapArr; - }else{ - } - }) - }) + this.getData(); + }, methods: { - + getData(){ + let that = this; + let query0={}; + query0.page = 0; + query0.type='month_st'; + query0.year_s = that.query.year_s-1; + query0.mgroup='3347217246321065984'; + let wrapArr = [],wrapArr0 = [] ,wrapArrs = []; + this.$API.enm.enstat.req(query0).then((res0) => { + let data0 = res0; + debugger; + if(data0.length>0){ + data0.forEach(item0 => { + //先按月份排序,再按班组排序 + let n0 = item0.month_s; + let ind0 = 0; + if(team_name0.indexOf('甲')>-1){ + ind0 = (n0-1)*3; + }else if(team_name0.indexOf('乙')>-1){ + ind0 = (n0-1)*3+1; + }else if(team_name0.indexOf('丙')>-1){ + ind0 = (n0-1)*3+2; + } + wrapArr0[ind0] = item0; + }); + debugger; + console.log(wrapArr0) + }else{ + } + this.$API.enm.enstat.req(that.query).then((res) => { + let data = res; + if(data.length>0){ + data.forEach(item => { + //先按月份排序,再按班组排序 + let n = item.month_s; + let team_name = item.team_name; + let ind = 0; + if(team_name.indexOf('甲')>-1){ + ind = (n-1)*3; + }else if(team_name.indexOf('乙')>-1){ + ind = (n-1)*3+1; + }else if(team_name.indexOf('丙')>-1){ + ind = (n-1)*3+2; + } + wrapArrs[ind] = item; + let arr = []; + let time = ''+item.year_s+'.'+item.month_s; + arr.push(time); + arr.push(item.team_name); + arr.push(item.total_production); + arr.push(item.production_hour); + arr.push(item.run_rate); + arr.push(item.production_cost_unit); + //质量 + arr[6]=item.入窑生料_CaO_rate_pass!=null?item.入窑生料_CaO_rate_pass:'/'; + arr[7]=item.入窑生料_Fe2O3_rate_pass!=null?item.入窑生料_Fe2O3_rate_pass:'/'; + arr[8]=item.入窑生料_细度_rate_pass!=null?item.入窑生料_细度_rate_pass:'/'; + arr[9]=item.入窑生料_水分_rate_pass!=null?item.入窑生料_水分_rate_pass:'/'; + arr[10]=item.熟料_立升重_rate_pass!=null?item.熟料_立升重_rate_pass:'/'; + arr[11]=item.熟料_fCaO_rate_pass!=null?item.熟料_fCaO_rate_pass:'/'; + //设备 + arr[12]=item.高温风机_consume_unit!=null?item.高温风机_consume_unit:'/'; + arr[13]=item.篦冷机一室风机_consume_unit!=null?item.篦冷机一室风机_consume_unit:'/'; + arr[14]=item.篦冷机三室风机_consume_unit!=null?item.篦冷机三室风机_consume_unit:'/'; + arr[15]=item.篦冷机二室风机_consume_unit!=null?item.篦冷机二室风机_consume_unit:'/'; + arr[16]=item.窑头排风机_consume_unit!=null?item.窑头排风机_consume_unit:'/'; + + //煤耗 + arr[17]=item.elec_consume_unit//当期值(KW·h/t) + arr[18]=item.celec_consume_unit;//目标值(KW·h/t)//需要接口获取 + arr[19]=item.celec_consume_unit;//当期与目标差值(KW·h/t) + let ind_pre = 0,huanbi = 0; + if(item.month_s==1){ + ind_pre = 12; + huanbi = wrapArr0[ind_pre]?wrapArr0[ind_pre].elec_consume_unit:'/'; + }else{ + ind_pre=ind-1; + huanbi = wrapArr[ind_pre]?wrapArr[ind_pre].elec_consume_unit?wrapArr[ind_pre].elec_consume_unit:'/':'/' + } + arr[20]=huanbi;//环期值(KW·h/t)上个月的值 + arr[21]=item.celec_consume_unit;//当期与环期差值(KW·h/t) + arr[22]=item.celec_consume_unit;//环比增长率(%) + arr[23]=item.celec_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) + let ind_pre1 = 0,huanbi1 = 0; + if(item.month_s==1){ + ind_pre1 = 12; + huanbi1 = wrapArr0[ind_pre]?wrapArr0[ind_pre].elec_consume_unit:'/'; + }else{ + ind_pre1=ind-1; + huanbi1 = wrapArr[ind_pre]?wrapArr[ind_pre].elec_consume_unit?wrapArr[ind_pre].elec_consume_unit:'/':'/' + } + arr[27]=huanbi;//环期值(KW·h/t)上个月的值 + arr[28]=item.celec_consume_unit;//当期与环期差值(KW·h/t) + arr[29]=item.celec_consume_unit;//环比增长率(%) + arr[30]=item.celec_consume_unit;//同比增长率(%) + arr[31]=item.celec_consume_unit;//同比增长率(%) + wrapArr[ind] = arr; + }); + console.log(wrapArr) + that.tableDatas = wrapArr; + }else{ + } + }) + }) + }, + handleQuery(){ + this.tableDatas = []; + this.getData(); + }, itemClick(type,item){ this.type=type; this.asynDialog = true; diff --git a/src/views/enm_kiln/workshopAnalysis.vue b/src/views/enm_kiln/workshopAnalysis.vue index 8d295779..1d46e5f8 100644 --- a/src/views/enm_kiln/workshopAnalysis.vue +++ b/src/views/enm_kiln/workshopAnalysis.vue @@ -2,20 +2,19 @@
- + type="primary" + icon="el-icon-search" + @click="handleQuery" + >
- { - let data0 = res0; - debugger; - if(data0.length>0){ - data0.forEach(item0 => { - //先按月份排序,再按班组排序 - let n0 = item0.month_s; - let ind0 = 0; - if(team_name0.indexOf('甲')>-1){ - ind0 = (n0-1)*3; - }else if(team_name0.indexOf('乙')>-1){ - ind0 = (n0-1)*3+1; - }else if(team_name0.indexOf('丙')>-1){ - ind0 = (n0-1)*3+2; - } - wrapArr0[ind0] = item0; - }); - console.log(wrapArr0) - }else{ - } - this.$API.enm.enstat.req(that.query).then((res) => { - let data = res; - if(data.length>0){ - data.forEach(item => { - //先按月份排序,再按班组排序 - let n = item.month_s; - let team_name = item.team_name; - let ind = 0; - if(team_name.indexOf('甲')>-1){ - ind = (n-1)*3; - }else if(team_name.indexOf('乙')>-1){ - ind = (n-1)*3+1; - }else if(team_name.indexOf('丙')>-1){ - ind = (n-1)*3+2; - } - wrapArrs[ind] = item; - let arr = []; - let time = ''+item.year_s+'.'+item.month_s; - arr.push(time); - arr.push(item.team_name); - arr.push(item.total_production); - arr.push(item.production_hour); - arr.push(item.run_rate); - arr.push(item.production_cost_unit); - //质量 - arr[6]=item.出磨水泥_比表面积_rate_pass!=null?item.出磨水泥_比表面积_rate_pass:'/'; - arr[7]=item.出磨水泥_SO3_rate_pass!=null?item.出磨水泥_SO3_rate_pass:'/'; - arr[8]=item.出磨水泥_掺量_rate_pass!=null?item.出磨水泥_掺量_rate_pass:'/'; - //设备 - arr[9]=item.循环风机1906_consume_unit!=null?item.循环风机1906_consume_unit:'/'; - arr[10]=item.系统风机_consume_unit!=null?item.系统风机_consume_unit:'/'; - arr[11]=item.水平涡流选粉机1915_consume_unit!=null?item.水平涡流选粉机1915_consume_unit:'/'; - arr[12]=item.新增磨尾风机_consume_unit!=null?item.新增磨尾风机_consume_unit:'/'; - - arr[13]=item.elec_consume_unit//当期值(KW·h/t) - arr[14]=item.celec_consume_unit;//目标值(KW·h/t)//需要接口获取 - arr[15]=item.celec_consume_unit;//当期与目标差值(KW·h/t) - let ind_pre = 0,huanbi = 0; - if(item.month_s==1){ - ind_pre = 12; - huanbi = wrapArr0[ind_pre]?wrapArr0[ind_pre].elec_consume_unit:'/'; - }else{ - ind_pre=ind-1; - huanbi = wrapArr[ind_pre]?wrapArr[ind_pre].elec_consume_unit?wrapArr[ind_pre].elec_consume_unit:'/':'/' - } - arr[16]=huanbi;//环期值(KW·h/t)上个月的值 - arr[17]=item.celec_consume_unit;//当期与环期差值(KW·h/t) - arr[18]=item.celec_consume_unit;//环比增长率(%) - arr[19]=item.celec_consume_unit;//同比增长率(%) - arr[20]=item.celec_consume_unit;//同比增长率(%) - wrapArr[ind] = arr; - }); - that.tableDatas = wrapArr; - }else{ - } - }) - }) + that.getData(); + }, methods: { - + getData(){ + 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 = []; + this.$API.enm.enstat.req(query0).then((res0) => { + let data0 = res0; + debugger; + if(data0.length>0){ + data0.forEach(item0 => { + //先按月份排序,再按班组排序 + let n0 = item0.month_s; + let ind0 = 0; + if(team_name0.indexOf('甲')>-1){ + ind0 = (n0-1)*3; + }else if(team_name0.indexOf('乙')>-1){ + ind0 = (n0-1)*3+1; + }else if(team_name0.indexOf('丙')>-1){ + ind0 = (n0-1)*3+2; + } + wrapArr0[ind0] = item0; + }); + console.log(wrapArr0) + }else{ + } + this.$API.enm.enstat.req(that.query).then((res) => { + let data = res; + if(data.length>0){ + data.forEach(item => { + //先按月份排序,再按班组排序 + let n = item.month_s; + let team_name = item.team_name; + let ind = 0; + if(team_name.indexOf('甲')>-1){ + ind = (n-1)*3; + }else if(team_name.indexOf('乙')>-1){ + ind = (n-1)*3+1; + }else if(team_name.indexOf('丙')>-1){ + ind = (n-1)*3+2; + } + wrapArrs[ind] = item; + let arr = []; + let time = ''+item.year_s+'.'+item.month_s; + arr.push(time); + arr.push(item.team_name); + arr.push(item.total_production); + arr.push(item.production_hour); + arr.push(item.run_rate); + arr.push(item.production_cost_unit); + //质量 + arr[6]=item.出磨水泥_比表面积_rate_pass!=null?item.出磨水泥_比表面积_rate_pass:'/'; + arr[7]=item.出磨水泥_SO3_rate_pass!=null?item.出磨水泥_SO3_rate_pass:'/'; + arr[8]=item.出磨水泥_掺量_rate_pass!=null?item.出磨水泥_掺量_rate_pass:'/'; + //设备 + arr[9]=item.循环风机1906_consume_unit!=null?item.循环风机1906_consume_unit:'/'; + arr[10]=item.系统风机_consume_unit!=null?item.系统风机_consume_unit:'/'; + arr[11]=item.水平涡流选粉机1915_consume_unit!=null?item.水平涡流选粉机1915_consume_unit:'/'; + arr[12]=item.新增磨尾风机_consume_unit!=null?item.新增磨尾风机_consume_unit:'/'; + + arr[13]=item.elec_consume_unit//当期值(KW·h/t) + arr[14]=item.celec_consume_unit;//目标值(KW·h/t)//需要接口获取 + arr[15]=item.celec_consume_unit;//当期与目标差值(KW·h/t) + let ind_pre = 0,huanbi = 0; + if(item.month_s==1){ + ind_pre = 12; + huanbi = wrapArr0[ind_pre]?wrapArr0[ind_pre].elec_consume_unit:'/'; + }else{ + ind_pre=ind-1; + huanbi = wrapArr[ind_pre]?wrapArr[ind_pre].elec_consume_unit?wrapArr[ind_pre].elec_consume_unit:'/':'/' + } + arr[16]=huanbi;//环期值(KW·h/t)上个月的值 + arr[17]=item.celec_consume_unit;//当期与环期差值(KW·h/t) + arr[18]=item.celec_consume_unit;//环比增长率(%) + arr[19]=item.celec_consume_unit;//同比增长率(%) + arr[20]=item.celec_consume_unit;//同比增长率(%) + wrapArr[ind] = arr; + }); + that.tableDatas = wrapArr; + }else{ + } + }) + }) + }, + handleQuery(){ + this.tableDatas = []; + this.getData(); + }, itemClick(type,item){ this.type=type; this.asynDialog = true; diff --git a/src/views/enm_mill/workshopAnalysis.vue b/src/views/enm_mill/workshopAnalysis.vue index f481bfe2..53eeb10d 100644 --- a/src/views/enm_mill/workshopAnalysis.vue +++ b/src/views/enm_mill/workshopAnalysis.vue @@ -2,7 +2,15 @@
- + - - +
- { - let data0 = res0; - if(data0.length>0){ - data0.forEach(item0 => { - //先按月份排序,再按班组排序 - let n0 = item0.month_s; - let ind0 = 0; - if(team_name0.indexOf('甲')>-1){ - ind0 = (n0-1)*3; - }else if(team_name0.indexOf('乙')>-1){ - ind0 = (n0-1)*3+1; - }else if(team_name0.indexOf('丙')>-1){ - ind0 = (n0-1)*3+2; - } - wrapArr0[ind0] = item0; - }); - console.log(wrapArr0) - }else{ - } - this.$API.enm.enstat.req(that.query).then((res) => { - let data = res; - if(data.length>0){ - data.forEach(item => { - //先按月份排序,再按班组排序 - let n = item.month_s; - let team_name = item.team_name; - let ind = 0; - if(team_name.indexOf('甲')>-1){ - ind = (n-1)*3; - }else if(team_name.indexOf('乙')>-1){ - ind = (n-1)*3+1; - }else if(team_name.indexOf('丙')>-1){ - ind = (n-1)*3+2; - } - wrapArrs[ind] = item; - let arr = []; - let time = ''+item.year_s+'.'+item.month_s; - arr.push(time); - arr.push(item.team_name); - arr.push(item.total_production); - - arr[3]=item.elec_consume_unit//当期值(KW·h/t) - arr[4]=item.celec_consume_unit;//目标值(KW·h/t)//需要接口获取 - arr[5]=item.celec_consume_unit;//当期与目标差值(KW·h/t) - let ind_pre = 0,huanbi = 0; - if(item.month_s==1){ - ind_pre = 12; - huanbi = wrapArr0[ind_pre]?wrapArr0[ind_pre].elec_consume_unit:'/'; - }else{ - ind_pre=ind-1; - huanbi = wrapArr[ind_pre]?wrapArr[ind_pre].elec_consume_unit?wrapArr[ind_pre].elec_consume_unit:'/':'/' - } - 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;//同比增长率(%) - wrapArr[ind] = arr; - }); - console.log(wrapArr) - that.tableDatas = wrapArr; - }else{ - } - }) - }) + that.getData(); + }, methods: { - + getData(){ + 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 = []; + this.$API.enm.enstat.req(query0).then((res0) => { + let data0 = res0; + if(data0.length>0){ + data0.forEach(item0 => { + //先按月份排序,再按班组排序 + let n0 = item0.month_s; + let ind0 = 0; + if(team_name0.indexOf('甲')>-1){ + ind0 = (n0-1)*3; + }else if(team_name0.indexOf('乙')>-1){ + ind0 = (n0-1)*3+1; + }else if(team_name0.indexOf('丙')>-1){ + ind0 = (n0-1)*3+2; + } + wrapArr0[ind0] = item0; + }); + console.log(wrapArr0) + }else{ + } + this.$API.enm.enstat.req(that.query).then((res) => { + let data = res; + if(data.length>0){ + data.forEach(item => { + //先按月份排序,再按班组排序 + let n = item.month_s; + let team_name = item.team_name; + let ind = 0; + if(team_name.indexOf('甲')>-1){ + ind = (n-1)*3; + }else if(team_name.indexOf('乙')>-1){ + ind = (n-1)*3+1; + }else if(team_name.indexOf('丙')>-1){ + ind = (n-1)*3+2; + } + wrapArrs[ind] = item; + let arr = []; + let time = ''+item.year_s+'.'+item.month_s; + arr.push(time); + arr.push(item.team_name); + arr.push(item.total_production); + + arr[3]=item.elec_consume_unit//当期值(KW·h/t) + arr[4]=item.celec_consume_unit;//目标值(KW·h/t)//需要接口获取 + arr[5]=item.celec_consume_unit;//当期与目标差值(KW·h/t) + let ind_pre = 0,huanbi = 0; + if(item.month_s==1){ + ind_pre = 12; + huanbi = wrapArr0[ind_pre]?wrapArr0[ind_pre].elec_consume_unit:'/'; + }else{ + ind_pre=ind-1; + huanbi = wrapArr[ind_pre]?wrapArr[ind_pre].elec_consume_unit?wrapArr[ind_pre].elec_consume_unit:'/':'/' + } + 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;//同比增长率(%) + wrapArr[ind] = arr; + }); + console.log(wrapArr) + that.tableDatas = wrapArr; + }else{ + } + }) + }) + }, + handleQuery(){ + this.tableDatas = []; + this.getData(); + }, itemClick(type,item){ this.type=type; this.asynDialog = true; diff --git a/src/views/enm_pack/workshopAnalysis.vue b/src/views/enm_pack/workshopAnalysis.vue index 0a99866a..b9a7761d 100644 --- a/src/views/enm_pack/workshopAnalysis.vue +++ b/src/views/enm_pack/workshopAnalysis.vue @@ -3,13 +3,12 @@
{ this.$refs.saveDialog.open("edit").setData(row); diff --git a/src/views/enm_rm/handover_form.vue b/src/views/enm_rm/handover_form.vue index 0a4afb28..902e71f4 100644 --- a/src/views/enm_rm/handover_form.vue +++ b/src/views/enm_rm/handover_form.vue @@ -33,7 +33,7 @@ v-model="form.start_time" type="datetime" format="YYYY-MM-DD HH:mm" - placeholder="基础月份" + placeholder="开始时间" style="width: 100%;" /> @@ -45,7 +45,7 @@ v-model="form.end_time" type="datetime" format="YYYY-MM-DD HH:mm" - placeholder="对比月份" + placeholder="结束时间" style="width: 100%;" /> @@ -73,7 +73,7 @@ - + @@ -107,6 +107,11 @@ type: [String], default: "", }, + mgroupId: { + // 接受外部v-model传入的值 + type: [String], + default: "", + }, }, data() { return { @@ -137,6 +142,10 @@ }; }, mounted() { + this.mgroup = this.mgroupId; + debugger; + console.log(this.deptId) + console.log(this.mgroupId) //获取班组 this.getTeam(); this.getShfit(); diff --git a/src/views/enm_rm/logDetail.vue b/src/views/enm_rm/logDetail.vue new file mode 100644 index 00000000..5259ea9e --- /dev/null +++ b/src/views/enm_rm/logDetail.vue @@ -0,0 +1,249 @@ + + + + + \ No newline at end of file diff --git a/src/views/enm_rm/report.vue b/src/views/enm_rm/report.vue index 757ef8eb..d5984815 100644 --- a/src/views/enm_rm/report.vue +++ b/src/views/enm_rm/report.vue @@ -50,6 +50,7 @@ +
@@ -243,6 +244,7 @@ }, ]; + import * as echarts from 'echarts'; import scEcharts from "@/components/scEcharts"; import { defineAsyncComponent } from 'vue' export default { @@ -427,6 +429,202 @@ data: [] } ] + }, + list: [ + { + x: 1, + y: 1, + z: 99, + k: 11 + }, + { + x: 2, + y: 2, + z: 70, + k: 11 + }, + { + x: 3, + y: 3, + z: 1, + k: 11 + }, + { + x: 4, + y: 4, + z: 30, + k: 11 + }, + { + x: 5, + y: 1, + z: 20, + k: 11 + }, + { + x: 6, + y: 0, + z: 18, + k: 11 + }, + { + x: 7, + y: 10, + z: 12, + k: 11 + } + ], + dataX: [], + dataY: [], + dataY2: [], + option : { + color: [ '#647bfe', '#8698fe', '#a9b6fe','#cbd3fe','#91CC75', '#EE6666'], + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'cross' + } + }, + grid: { + right: '20%', + left:'20%' + }, + toolbox: { + feature: { + dataView: { show: true, readOnly: false }, + restore: { show: true }, + saveAsImage: { show: true } + } + }, + legend: { + data: ['总产量', '台时产量', '运转率', '分布电耗', '单位产品标煤耗', '成本'] + }, + xAxis: [ + { + type: 'category', + axisTick: { + alignWithLabel: true + }, + // prettier-ignore + data: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'] + } + ], + yAxis: [ + { + type: 'value', + name: '产量 (t)', + position: 'right', + alignTicks: true, + axisLine: { + show: true, + lineStyle: { + color: colors[0] + } + }, + axisLabel: { + formatter: '{value}' + } + }, + { + type: 'value', + name: '运转率 (%)', + position: 'right', + alignTicks: true, + offset: 80, + axisLine: { + show: true, + lineStyle: { + color: colors[1] + } + }, + axisLabel: { + formatter: '{value}' + } + }, + { + type: 'value', + name: '成本(元)', + position: 'right', + alignTicks: true, + offset: 160, + axisLine: { + show: true, + lineStyle: { + color: colors[2] + } + }, + axisLabel: { + formatter: '{value}' + } + }, + { + type: 'value', + name: '分布电耗(KW.h)', + position: 'left', + alignTicks: true, + axisLine: { + show: true, + lineStyle: { + color: colors[3] + } + }, + axisLabel: { + formatter: '{value} ' + } + }, + { + type: 'value', + name: '标煤耗 (t)', + position: 'left', + alignTicks: true, + offset: 80, + min:0,max:180, + axisLine: { + show: true, + lineStyle: { + color: colors[4] + } + }, + axisLabel: { + formatter: '{value}' + } + } + ], + series: [ + { + name: '总产量', + type: 'bar', + yAxisIndex:0, + data: [100, 120, 110, 130, 140, 120, 110, 120, 100,150, 120, 160] + }, + { + name: '台时产量', + type: 'bar', + data: [ + 2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3 + ] + }, + { + name: '运转率', + type: 'bar', + yAxisIndex: 1, + data: [ + 2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3 + ] + }, + { + name: '分布电耗', + type: 'line', + yAxisIndex: 2, + data: [2.0, 2.2, 3.3, 4.5, 6.3, 10.2, 20.3, 23.4, 23.0, 16.5, 12.0, 6.2] + }, + { + name: '单位产品标煤耗', + type: 'bar', + yAxisIndex: 2, + data: [2.0, 2.2, 3.3, 4.5, 6.3, 10.2, 20.3, 23.4, 23.0, 16.5, 12.0, 6.2] + } + ] } }; }, @@ -441,6 +639,34 @@ } } let that = this; + this.$nextTick(() => { + this.dataX = this.list.map(item => item.x); + // 第1个Y轴 + this.dataY.push({ + name: "AA", + type: "line", // 直线 + yAxisIndex: 0, // 第几个Y轴 索引值 + symbolSize: '10', + // lineStyle: { color: '#4485f4' }, + data: this.list.map(item => item.y) + }); + // 第2个Y轴 + this.dataY.push({ + name: "BB", + type: "line", + yAxisIndex: 1, // 第几个Y轴 索引值 + data: this.list.map(item => item.z) + }); + // 第3个Y轴 + this.dataY.push({ + name: "CC", + type: "line", + yAxisIndex: 2, // 第几个Y轴 索引值 + data: this.list.map(item => item.k) + }); + + this.init(this.dataX, this.dataY); + }); this.$nextTick(() => { var myDate = new Date(); let year =that.year = myDate.getFullYear(); @@ -597,6 +823,11 @@ }) }, methods: { + init(dataX, dataY) { + this.myChart = echarts.init(document.getElementById("main")); + // 使用刚指定的配置项和数据显示图表。 + this.myChart.setOption(this.option); + }, //获取小时数据 getHourData(){ let that = this; @@ -607,15 +838,14 @@ query.day_s = that.days; query.type = 'hour_s'; query.mgroup = that.query.mgroup; - this.$API.enm.enstat.req(query).then((response) => { - // debugger; + this.$API.enm.enstat.req(query).then((response) => { let seriesData0 = [],seriesData1 = [], seriesData2 = [],seriesData3 = [],seriesData4 = []; console.log(response) let data = response; data.forEach(item => { let ind = item.hour; seriesData0[ind] = item.total_production; - seriesData1[ind] = item.production_hour; + seriesData1[ind] = item.production_hour.toFixed(2); seriesData2[ind] = item.run_rate; seriesData3[ind] = item.production_cost_unit; seriesData4[ind] = item.elec_consume_unit; @@ -653,7 +883,7 @@ // debugger; let ind = item.day_s; seriesData0[ind] = item.total_production; - seriesData1[ind] = item.production_hour; + seriesData1[ind] = item.production_hour.toFixed(2); seriesData2[ind] = item.run_rate; seriesData3[ind] = item.production_cost_unit; seriesData4[ind] = item.elec_consume_unit; @@ -689,7 +919,7 @@ data.forEach(item => { let ind = item.month_s; seriesData0[ind] = item.total_production; - seriesData1[ind] = item.production_hour; + seriesData1[ind] = item.production_hour.toFixed(2); seriesData2[ind] = item.run_rate; seriesData3[ind] = item.production_cost_unit; seriesData4[ind] = item.elec_consume_unit; diff --git a/src/views/enm_rm/teamAnalysis.vue b/src/views/enm_rm/teamAnalysis.vue index 1979333c..111a6f05 100644 --- a/src/views/enm_rm/teamAnalysis.vue +++ b/src/views/enm_rm/teamAnalysis.vue @@ -2,6 +2,19 @@
+ + { - let data0 = res0; - debugger; - if(data0.length>0){ - data0.forEach(item0 => { - //先按月份排序,再按班组排序 - let n0 = item0.month_s; - let ind0 = 0; - if(team_name0.indexOf('甲')>-1){ - ind0 = (n0-1)*3; - }else if(team_name0.indexOf('乙')>-1){ - ind0 = (n0-1)*3+1; - }else if(team_name0.indexOf('丙')>-1){ - ind0 = (n0-1)*3+2; - } - wrapArr0[ind0] = item0; - }); - debugger; - console.log(wrapArr0) - }else{ - } - this.$API.enm.enstat.req(that.query).then((res) => { - let data = res; - if(data.length>0){ - data.forEach(item => { - //先按月份排序,再按班组排序 - let n = item.month_s; - let team_name = item.team_name; - let ind = 0; - if(team_name.indexOf('甲')>-1){ - ind = (n-1)*3; - }else if(team_name.indexOf('乙')>-1){ - ind = (n-1)*3+1; - }else if(team_name.indexOf('丙')>-1){ - ind = (n-1)*3+2; - } - wrapArrs[ind] = item; - let arr = []; - let time = ''+item.year_s+'.'+item.month_s; - arr.push(time); - arr.push(item.team_name); - arr.push(item.total_production); - arr.push(item.production_hour); - arr.push(item.run_rate); - arr.push(item.production_cost_unit); - //质量 - arr[6]=item.辅料_细度_rate_pass!=null?item.辅料_细度_rate_pass:'/'; - arr[7]=item.辅料_Fe2O3_rate_pass!=null?item.辅料_Fe2O3_rate_pass:'/'; - arr[8]=item.辅料_水分_rate_pass!=null?item.辅料_水分_rate_pass:'/'; - arr[9]=item.干混生料_细度_rate_pass!=null?item.干混生料_细度_rate_pass:'/'; - arr[10]=item.干混生料_Fe2O3_rate_pass!=null?item.干混生料_Fe2O3_rate_pass:'/'; - arr[11]=item.干混生料_水分_rate_pass!=null?item.干混生料_水分_rate_pass:'/'; - arr[12]=item.干混生料_CaO_rate_pass!=null?item.干混生料_CaO_rate_pass:'/'; - //设备 - arr[13]=item.循环风机_consume_unit!=null?item.循环风机_consume_unit:'/'; - arr[13]=item.尾排风机_consume_unit!=null?item.尾排风机_consume_unit:'/'; - arr[13]=item.废气风机_consume_unit!=null?item.废气风机_consume_unit:'/'; - // - arr[16]=item.elec_consume_unit//当期值(KW·h/t) - arr[17]=item.celec_consume_unit;//目标值(KW·h/t)//需要接口获取 - arr[18]=item.celec_consume_unit;//当期与目标差值(KW·h/t) - let ind_pre = 0,huanbi = 0; - if(item.month_s==1){ - ind_pre = 12; - huanbi = wrapArr0[ind_pre]?wrapArr0[ind_pre].elec_consume_unit:'/'; - }else{ - ind_pre=ind-1; - huanbi = wrapArr[ind_pre]?wrapArr[ind_pre].elec_consume_unit?wrapArr[ind_pre].elec_consume_unit:'/':'/' - } - arr[19]=huanbi;//环期值(KW·h/t)上个月的值 - arr[20]=item.celec_consume_unit;//当期与环期差值(KW·h/t) - arr[21]=item.celec_consume_unit;//环比增长率(%) - arr[22]=item.celec_consume_unit;//同比增长率(%) - arr[23]=item.celec_consume_unit;//同比增长率(%) - wrapArr[ind] = arr; - }); - console.log(wrapArr) - that.tableDatas = wrapArr; - }else{ - } - }) - }) - + this.getData(); + + }, methods: { - + getData(){ + 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 = []; + this.$API.enm.enstat.req(query0).then((res0) => { + let data0 = res0; + debugger; + if(data0.length>0){ + data0.forEach(item0 => { + //先按月份排序,再按班组排序 + let n0 = item0.month_s; + let ind0 = 0; + if(team_name0.indexOf('甲')>-1){ + ind0 = (n0-1)*3; + }else if(team_name0.indexOf('乙')>-1){ + ind0 = (n0-1)*3+1; + }else if(team_name0.indexOf('丙')>-1){ + ind0 = (n0-1)*3+2; + } + wrapArr0[ind0] = item0; + }); + debugger; + console.log(wrapArr0) + }else{ + } + this.$API.enm.enstat.req(that.query).then((res) => { + let data = res; + if(data.length>0){ + data.forEach(item => { + //先按月份排序,再按班组排序 + let n = item.month_s; + let team_name = item.team_name; + let ind = 0; + if(team_name.indexOf('甲')>-1){ + ind = (n-1)*3; + }else if(team_name.indexOf('乙')>-1){ + ind = (n-1)*3+1; + }else if(team_name.indexOf('丙')>-1){ + ind = (n-1)*3+2; + } + wrapArrs[ind] = item; + let arr = []; + let time = ''+item.year_s+'.'+item.month_s; + arr.push(time); + arr.push(item.team_name); + arr.push(item.total_production); + arr.push(item.production_hour); + arr.push(item.run_rate); + arr.push(item.production_cost_unit); + //质量 + arr[6]=item.辅料_细度_rate_pass!=null?item.辅料_细度_rate_pass:'/'; + arr[7]=item.辅料_Fe2O3_rate_pass!=null?item.辅料_Fe2O3_rate_pass:'/'; + arr[8]=item.辅料_水分_rate_pass!=null?item.辅料_水分_rate_pass:'/'; + arr[9]=item.干混生料_细度_rate_pass!=null?item.干混生料_细度_rate_pass:'/'; + arr[10]=item.干混生料_Fe2O3_rate_pass!=null?item.干混生料_Fe2O3_rate_pass:'/'; + arr[11]=item.干混生料_水分_rate_pass!=null?item.干混生料_水分_rate_pass:'/'; + arr[12]=item.干混生料_CaO_rate_pass!=null?item.干混生料_CaO_rate_pass:'/'; + //设备 + arr[13]=item.循环风机_consume_unit!=null?item.循环风机_consume_unit:'/'; + arr[13]=item.尾排风机_consume_unit!=null?item.尾排风机_consume_unit:'/'; + arr[13]=item.废气风机_consume_unit!=null?item.废气风机_consume_unit:'/'; + // + arr[16]=item.elec_consume_unit//当期值(KW·h/t) + arr[17]=item.celec_consume_unit;//目标值(KW·h/t)//需要接口获取 + arr[18]=item.celec_consume_unit;//当期与目标差值(KW·h/t) + let ind_pre = 0,huanbi = 0; + if(item.month_s==1){ + ind_pre = 12; + huanbi = wrapArr0[ind_pre]?wrapArr0[ind_pre].elec_consume_unit:'/'; + }else{ + ind_pre=ind-1; + huanbi = wrapArr[ind_pre]?wrapArr[ind_pre].elec_consume_unit?wrapArr[ind_pre].elec_consume_unit:'/':'/' + } + arr[19]=huanbi;//环期值(KW·h/t)上个月的值 + arr[20]=item.celec_consume_unit;//当期与环期差值(KW·h/t) + arr[21]=item.celec_consume_unit;//环比增长率(%) + arr[22]=item.celec_consume_unit;//同比增长率(%) + arr[23]=item.celec_consume_unit;//同比增长率(%) + wrapArr[ind] = arr; + }); + console.log(wrapArr) + that.tableDatas = wrapArr; + }else{ + } + }) + }) + }, + handleQuery(){ + this.tableDatas = []; + this.getData(); + }, itemClick(type,item){ this.type=type; this.asynDialog = true; diff --git a/src/views/enm_rm/workshopAnalysis.vue b/src/views/enm_rm/workshopAnalysis.vue index 580fb57e..a4354d6b 100644 --- a/src/views/enm_rm/workshopAnalysis.vue +++ b/src/views/enm_rm/workshopAnalysis.vue @@ -3,14 +3,13 @@
+ v-model="query.year_s" + type="year" + value-format="YYYY" + format="YYYY" + placeholder="查询年份" + style="margin-right: 6px;" + />
- { - let data0 = res0; - if(data0.length>0){ - data0.forEach(item0 => { - //先按月份排序,再按班组排序 - let n0 = item0.month_s; - let ind0 = 0; - if(team_name0.indexOf('甲')>-1){ - ind0 = (n0-1)*3; - }else if(team_name0.indexOf('乙')>-1){ - ind0 = (n0-1)*3+1; - }else if(team_name0.indexOf('丙')>-1){ - ind0 = (n0-1)*3+2; - } - wrapArr0[ind0] = item0; - }); - console.log(wrapArr0) - }else{ - } - this.$API.enm.enstat.req(that.query).then((res) => { - let data = res; - if(data.length>0){ - data.forEach(item => { - //先按月份排序,再按班组排序 - let n = item.month_s; - let team_name = item.team_name; - let ind = 0; - if(team_name.indexOf('甲')>-1){ - ind = (n-1)*3; - }else if(team_name.indexOf('乙')>-1){ - ind = (n-1)*3+1; - }else if(team_name.indexOf('丙')>-1){ - ind = (n-1)*3+2; - } - wrapArrs[ind] = item; - let arr = []; - let time = ''+item.year_s+'.'+item.month_s; - arr.push(time); - arr.push(item.team_name); - arr.push(item.total_production); - arr.push(item.production_hour); - - arr[4]=item.elec_consume_unit//当期值(KW·h/t) - arr[5]=item.celec_consume_unit;//目标值(KW·h/t)//需要接口获取 - arr[6]=item.celec_consume_unit;//当期与目标差值(KW·h/t) - let ind_pre = 0,huanbi = 0; - if(item.month_s==1){ - ind_pre = 12; - huanbi = wrapArr0[ind_pre]?wrapArr0[ind_pre].elec_consume_unit:'/'; - }else{ - ind_pre=ind-1; - huanbi = wrapArr[ind_pre]?wrapArr[ind_pre].elec_consume_unit?wrapArr[ind_pre].elec_consume_unit:'/':'/' - } - arr[7]=huanbi;//环期值(KW·h/t)上个月的值 - arr[8]=item.celec_consume_unit;//当期与环期差值(KW·h/t) - arr[9]=item.celec_consume_unit;//环比增长率(%) - arr[10]=item.celec_consume_unit;//同比增长率(%) - arr[11]=0;//同比增长率(%) - wrapArr[ind] = arr; - }); - console.log(wrapArr) - that.tableDatas = wrapArr; - }else{ - } - }) - }) + this.getData(); + }, methods: { - + getData(){ + let that = this; + let query0={}; + query0.page = 0; + query0.type='month_st'; + query0.year_s = that.query.year_s-1; + query0.mgroup='3346491835287007232'; + let wrapArr = [],wrapArr0 = [] ,wrapArrs = []; + this.$API.enm.enstat.req(query0).then((res0) => { + let data0 = res0; + if(data0.length>0){ + data0.forEach(item0 => { + //先按月份排序,再按班组排序 + let n0 = item0.month_s; + let ind0 = 0; + if(team_name0.indexOf('甲')>-1){ + ind0 = (n0-1)*3; + }else if(team_name0.indexOf('乙')>-1){ + ind0 = (n0-1)*3+1; + }else if(team_name0.indexOf('丙')>-1){ + ind0 = (n0-1)*3+2; + } + wrapArr0[ind0] = item0; + }); + console.log(wrapArr0) + }else{ + } + this.$API.enm.enstat.req(that.query).then((res) => { + let data = res; + if(data.length>0){ + data.forEach(item => { + //先按月份排序,再按班组排序 + let n = item.month_s; + let team_name = item.team_name; + let ind = 0; + if(team_name.indexOf('甲')>-1){ + ind = (n-1)*3; + }else if(team_name.indexOf('乙')>-1){ + ind = (n-1)*3+1; + }else if(team_name.indexOf('丙')>-1){ + ind = (n-1)*3+2; + } + wrapArrs[ind] = item; + let arr = []; + let time = ''+item.year_s+'.'+item.month_s; + arr.push(time); + arr.push(item.team_name); + arr.push(item.total_production); + arr.push(item.production_hour); + + arr[4]=item.elec_consume_unit//当期值(KW·h/t) + arr[5]=item.celec_consume_unit;//目标值(KW·h/t)//需要接口获取 + arr[6]=item.celec_consume_unit;//当期与目标差值(KW·h/t) + let ind_pre = 0,huanbi = 0; + if(item.month_s==1){ + ind_pre = 12; + huanbi = wrapArr0[ind_pre]?wrapArr0[ind_pre].elec_consume_unit:'/'; + }else{ + ind_pre=ind-1; + huanbi = wrapArr[ind_pre]?wrapArr[ind_pre].elec_consume_unit?wrapArr[ind_pre].elec_consume_unit:'/':'/' + } + arr[7]=huanbi;//环期值(KW·h/t)上个月的值 + arr[8]=item.celec_consume_unit;//当期与环期差值(KW·h/t) + arr[9]=item.celec_consume_unit;//环比增长率(%) + arr[10]=item.celec_consume_unit;//同比增长率(%) + arr[11]=0;//同比增长率(%) + wrapArr[ind] = arr; + }); + console.log(wrapArr) + that.tableDatas = wrapArr; + }else{ + } + }) + }) + }, + handleQuery(){ + this.tableDatas = []; + this.getData(); + }, itemClick(type,item){ this.type=type; this.asynDialog = true; diff --git a/src/views/enm_slag/workshopAnalysis.vue b/src/views/enm_slag/workshopAnalysis.vue index 8b951f17..c08ccdd1 100644 --- a/src/views/enm_slag/workshopAnalysis.vue +++ b/src/views/enm_slag/workshopAnalysis.vue @@ -3,14 +3,13 @@
+ v-model="query.year_s" + type="year" + value-format="YYYY" + format="YYYY" + placeholder="查询年份" + style="margin-right: 6px;" + /> -
- - - - + - + - + - + @@ -146,8 +117,9 @@ titleLength:1, mgroupOptions:[], tableTime:'', - tableName:'质检日报表', - tableHead:['车间','物料','检验项目','平均值','检次','合次','合格率'], + deptName:'', + typeName:'质检日报表', + tableName:'', tableDatas:[ ['原料车间','辅料','细度', , , , , , ], ['原料车间','辅料','Fe2O3', , , , , , ], @@ -170,6 +142,7 @@ ['水泥车间','出磨水泥','SO3'], ['水泥车间','出磨水泥','掺量'], ], + tableDatas3:[], exportLoading:false, header2:[], header3:[], @@ -177,9 +150,15 @@ tableData:[], header2Obj:[], deptOptions:[], - arrLength:[0,0,0], }; }, + watch: { + header3: { + handler(newV, OldV) { + this.header3 = newV; + } + } + }, mounted() { var myDate = new Date(); let month = myDate.getMonth()+1; @@ -195,19 +174,20 @@ }, methods: { typeCange(value){ + let that = this; if(value==1){ - this.tableName = '质检日报表' + this.typeName = '质检日报表' }else if(value==1){ - this.tableName = '质检月报表' - }else{ - this.tableName = '质检年报表' + this.typeName = '质检月报表' } + that.tableName = that.deptName+that.typeName; }, deptChange(e){ let that = this; that.deptOptions.forEach(item=>{ if(item.id==e){ that.deptName = item.name; + that.tableName = item.name+that.typeName; } }) }, @@ -216,6 +196,7 @@ that.$API.system.dept.list.req({ page_size: 3 , type:'dept'}).then(res=>{ that.deptOptions = res.results; that.deptName = res.results[0].name; + that.tableName =that.deptName+that.typeName; that.query.belong_dept = res.results[0].id; this.getTableData(); }); @@ -223,10 +204,24 @@ getTableData(){ let that = this; that.tableDatas3 = []; - that.header2Obj=[]; - that.header2 = [];//物料 - that.header3 = [];//检测项 - that.header4 = [];//检测项 + + that.header3 = []; + if(that.deptName=='原料车间'){ + that.header2Obj=[{name:'辅料',lengths:3},{name:'干混生料',lengths:4}]; + that.header2 = ['辅料','干混生料'];//物料 + that.header3 = ['细度','Fe2O3','水分','细度','Fe2O3','水分','CaO'];//检测项 + that.header4 = ['平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率'];//检测项 + }else if(that.deptName=='烧成车间'){ + that.header2Obj=[{name:'入窑生料',lengths:4},{name:'熟料',lengths:4}]; + that.header2 = ['入窑生料','熟料'];//物料 + that.header3 = ['CaO','Fe2O3','细度','水分','立升重','f-CaO','细度','水分'];//检测项 + that.header4 = ['平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率'];//检测项 + }else{ + that.header2Obj=[{name:'出磨水泥',lengths:3}]; + that.header2 = ['出磨水泥'];//物料 + that.header3 = ['比表面积','SO3','掺量'];//检测项 + that.header4 = ['平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率'];//检测项 + } let params = {}; let arr = []; if(that.query.type==0){//日 @@ -239,96 +234,6 @@ params.year_s = that.query.year; } params.mgroup__belong_dept = that.query.belong_dept; - // that.$API.enm.enstat.req(params).then(res=>{ - // let data = res.results; - // let list = []; - // data.forEach(item => { - // let index = item.day_s; - // if(list[index]){}else{ - // list[index] = []; - // } - // list[index].push(item); - // }) - // let header2=[],header2Obj=[],header3=[],header4=[]; - // list = list.filter(item=>{ - // return item - // }) - // console.log(list) - // console.log('000000000000000') - // //list按天分好的数组 - // list.forEach((item0,index0)=>{ - // //data1某一天的数据 - // let data1 = item0; - // let dayData=[],wrapData = [[],[],[]]; - // dayData[0]= data1[0].day_s!=null?data1[0].year_s+'.'+data1[0].month_s+'.'+data1[0].day_s:data1[0].year_s+'.'+data1[0].month_s; - // data1.forEach(item1 => { - // if(item1.belong_dept_name=='原料车间'){ - // wrapData[0].push(item1) - // }else if(item1.belong_dept_name=='烧成车间'){ - // wrapData[1].push(item1) - // }else if(item1.belong_dept_name=='水泥车间'){ - // wrapData[2].push(item1) - // } - // }); - // //wrapData按车间分的数组 - // for(let i=0;i{ - // if(index0==0){ - // header3.push(item3.testitem_name) - // if(header2.indexOf(item3.material_name)>-1){ - // let indexObj = header2.indexOf(item3.material_name); - // header2Obj[indexObj].length = header2Obj[indexObj].length+1; - // }else{ - // header2.push(item3.material_name); - // header2Obj.push({name:item3.material_name,length:1}) - // } - // console.log(header2) - // console.log(header2Obj) - // header4.push('平均值') - // header4.push('检次') - // header4.push('合次') - // header4.push('及格率') - // } - // dayData.push(item3.val_avg) - // dayData.push(item3.num_test) - // dayData.push(item3.num_ok) - // let pass = item3.rate_pass*100+'%' - // dayData.push(pass) - // }) - // } - // } - // if(index0==0){ - // that.header2Obj=header2Obj; - // that.header2 = header2;//物料 - // that.header3 = header3;//检测项 - // that.header4 = header4;//检测项 - // console.log(header2) - // console.log(header3) - // console.log(header4) - // } - // that.tableData.push(dayData) - // }) - // // debugger; - // // console.log(that.tableData) - // // that.time = - // // that.tableName = res.name; - // // let data = res.data.ds0; - // // that.tableHead = data[0]; - // // that.tableDatas = data.slice(1,data.length); - // // for(let i=0;i { let data = res.results; let wrapArr = []; @@ -358,12 +263,12 @@ wrapArr[ind].push(item) } }); + wrapArr = wrapArr.filter(item=>{ return item }) wrapArr.forEach((item1,index1)=>{ - if(item1!=undefined){ - console.log(item1)//一天的数据 + if(item1!=undefined){//一天的数据 let itemArr = []; let header2tem=[],header2Objtem=[],header3tem=[],header4tem=[]; 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; @@ -387,7 +292,6 @@ header4tem.push('合次') header4tem.push('及格率') let indexObj = header2tem.indexOf(item3.material_name); - debugger; if(indexObj>0&&index3==0){ let inde = indexObj-1; let ind =header2Objtem[inde].lengths*4+1; @@ -409,13 +313,6 @@ }) }) innerArr.push(itemArr) - console.log('0000000000000'); - console.log(itemArr); - console.log(header2tem); - console.log(header2Objtem); - console.log(header3tem); - console.log(header4tem); - console.log('1111111111111'); if(header2tem.length>header2.length){ header2 = header2tem; } @@ -430,11 +327,23 @@ } } }) - that.tableDatas3 = innerArr; - that.header2Obj=header2Obj; - that.header2 = header2;//物料 - that.header3 = header3;//检测项 - that.header4 = header4;//检测项 + if(header2Obj.length>0){ + that.header2Obj=header2Obj; + } + that.header2 = header2.length>0?header2:that.header2;//物料 + if(header3.length>0){ + that.header3 =header3;//检测项 + } + if(header4.length>0){ + that.header4 = header4; + } + console.log(innerArr) + this.$forceUpdate(); + innerArr.forEach(item=>{ + if(item.length>1){ + that.tableDatas3.push(item) + } + }) }); }, handlePrint() {
{{ tableName }}
日期{{deptName}}{{tableName}}
{{ item.name }}{{ item2.name }}
{{item}}{{item3}}
{{item}}{{item4}}