fix:coding#658能源监察报表填数
This commit is contained in:
parent
4909cadf77
commit
520004edb9
|
@ -17,29 +17,29 @@
|
|||
></el-option>
|
||||
</el-select>
|
||||
<el-date-picker
|
||||
v-model="query.month"
|
||||
type="month"
|
||||
value-format="YYYY-MM"
|
||||
format="YYYY-MM"
|
||||
placeholder="查询月份"
|
||||
v-model="query.searchDay"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
format="YYYY-MM-DD"
|
||||
placeholder="查询日期"
|
||||
v-if="query.type==0"
|
||||
class="headerSearch"
|
||||
/>
|
||||
<el-date-picker
|
||||
v-model="query.year"
|
||||
type="year"
|
||||
value-format="YYYY"
|
||||
format="YYYY"
|
||||
placeholder="查询年份"
|
||||
v-model="query.searchMonth"
|
||||
type="month"
|
||||
value-format="YYYY-MM"
|
||||
format="YYYY-MM"
|
||||
placeholder="查询月份"
|
||||
v-if="query.type==1"
|
||||
class="headerSearch"
|
||||
/>
|
||||
<el-date-picker
|
||||
v-model="query.yearStart"
|
||||
v-model="query.searchYear"
|
||||
type="year"
|
||||
value-format="YYYY"
|
||||
format="YYYY"
|
||||
placeholder="起始年份"
|
||||
placeholder="查询年份"
|
||||
v-if="query.type==2"
|
||||
class="headerSearch"
|
||||
/>
|
||||
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue