From 520004edb93f9efaeb221bece9c5dc103c22aecd Mon Sep 17 00:00:00 2001 From: shijing Date: Thu, 5 Dec 2024 17:48:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:coding#658=E8=83=BD=E6=BA=90=E7=9B=91?= =?UTF-8?q?=E5=AF=9F=E6=8A=A5=E8=A1=A8=E5=A1=AB=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/enm_energy/energyFactory.vue | 91 ++++++++++++++++---------- 1 file changed, 57 insertions(+), 34 deletions(-) diff --git a/src/views/enm_energy/energyFactory.vue b/src/views/enm_energy/energyFactory.vue index 998e930e..34f1a2f5 100644 --- a/src/views/enm_energy/energyFactory.vue +++ b/src/views/enm_energy/energyFactory.vue @@ -17,29 +17,29 @@ > @@ -95,6 +95,7 @@ month:'', yearStart:'', }, + currentDay:'', tableName:'能源监察日报表', options:[ {id:0,name:'日统计'}, @@ -103,21 +104,17 @@ ], tableDatas:[ {index:1,name:'水泥单位产品综合能耗(kgce/t)',value:0,note:''}, - {index:1,name:'熟料单位产品综合能耗(kgce/t)',value:0,note:''}, - {index:1,name:'熟料单位产品综合电耗(kw.h/t)',value:0,note:''}, - {index:1,name:'熟料单位产品综合煤耗(kgce/t)',value:0,note:''}, - {index:1,name:'水泥单位产品综合电耗(kw.h/t)',value:0,note:''}, + {index:2,name:'熟料单位产品综合能耗(kgce/t)',value:0,note:''}, + {index:3,name:'熟料单位产品综合电耗(kw.h/t)',value:0,note:''}, + {index:4,name:'熟料单位产品综合煤耗(kgce/t)',value:0,note:''}, + {index:5,name:'水泥单位产品综合电耗(kw.h/t)',value:0,note:''}, ], }; }, mounted() { var myDate = new Date(); - let month = myDate.getMonth()+1; - if(month<10){ - month = '0'+month; - } - this.query.month = myDate.getFullYear()+'-'+month; + this.query.searchDay =this.currentDay = this.$TOOL.dateFormat2(myDate); this.getData(); }, methods: { @@ -132,24 +129,50 @@ }, getData(){ let that = this; - let params = {page:0}; - let arr = []; + let arr = [],type='',year_s = 2024,month_s = 1,day_s = 1; if(that.query.type==0){//日 - params.type='day_s'; - arr = that.query.month.split('-'); - params.year_s = Number(arr[0]); - params.month_s = Number(arr[1]); + type='day_s'; + arr = that.query.searchDay.split('-'); + year_s = Number(arr[0]); + month_s = Number(arr[1]); + day_s = Number(arr[2]); }else if(that.query.type==1){//月 - params.type='month_s'; - params.year_s = Number(that.query.year); + type='month_s'; + arr = that.query.searchMonth.split('-'); + year_s = Number(arr[0]); + month_s = Number(arr[1]); }else if (that.query.type==2){ - params.type='year_s'; - params.year_s = Number(that.query.yearStart); + type='year_s'; + year_s = Number(that.query.searchYear); } - params.mgroup__belong_dept = that.query.belong_dept; - this.$API.enm.enstat.req(params).then((res) => { - + let params1 = { + page:0, + type:type, + year_s:year_s, + month_s:month_s, + day_s:day_s, + mgroup__name:'水泥磨' + } + that.$API.enm.enstat.req(params1).then((res) => { + console.log(res[0]); + that.tableDatas[0].value = res[0].cen_consume_unit; + that.tableDatas[4].value = res[0].celec_consume_unit; }); + let params2 = { + page:0, + type:type, + year_s:year_s, + month_s:month_s, + day_s:day_s, + mgroup__name:'回转窑' + } + that.$API.enm.enstat.req(params2).then((res2) => { + that.tableDatas[1].value = res2[0].cen_consume_unit; + that.tableDatas[2].value = res2[0].celec_consume_unit; + that.tableDatas[3].value = res2[0].coal_consume_unit; + console.log(res2[0]); + }); + }, getTableData(){ this.getData();