This commit is contained in:
zty 2024-12-06 15:06:41 +08:00
commit eca678139b
1 changed files with 47 additions and 5 deletions

View File

@ -107,6 +107,7 @@
{id:1,name:'月统计'},
{id:2,name:'年统计'},
],
mgroups:['电石渣','原料磨','煤磨','回转窑','水泥磨','水泥包装'],
headers:['','时间','电石渣','原料磨','生料工段','煤磨','熟料工段','水泥粉磨','水泥包装'],
tableDatas:[
['产量(t)'],
@ -129,7 +130,9 @@
},
mounted() {
var myDate = new Date();
this.query.searchDay =this.currentDay = this.$TOOL.dateFormat2(myDate);
// this.query.searchDay =this.currentDay = this.$TOOL.dateFormat2(myDate);
this.query.searchDay =this.currentDay = '2024-10-04';
this.query.searchDay ='2024-10-04';
this.getData();
},
methods: {
@ -153,26 +156,65 @@
},
getData(){
let that = this;
let params = {};
let arr = [],type='',year_s = 2024,month_s = 1,day_s = 1;
let params = {page:0};
let arr = [],type='',year_s = 2024,month_s = 1,day_s = 1,search_time = '';
if(that.query.type==0){//
params.type='day_s';
search_time = that.query.searchDay;
let arr = that.query.searchDay.split('-');
params.year_s = Number(arr[0]);
params.month_s = Number(arr[1]);
params.day_s = Number(arr[2]);
}else if(that.query.type==1){//
params.type='month_s';
search_time = that.query.searchMonth;
let arr = that.query.searchMonth.split('-');
params.year_s = Number(arr[0]);
params.month_s = Number(arr[1]);
}else if (that.query.type==2){
params.type='year_s';
search_time = that.query.searchYear;
params.year_s = Number(that.query.searchYear);
}
//
that.tableDatas.forEach((item) => {
item[1] = search_time;
})
this.$API.enm.enstat.req(params).then((res) => {
let dataList = {};
if(res.length <= 0){
return;
}
res.forEach(item => {
let index = that.mgroups.indexOf(item.mgroup_name);
if(index>-1){
index = index+2;
that.tableDatas[0][index] = item.total_production;
that.tableDatas[1][index] = item.production_hour;
let str = '';
item.qua_data.forEach((item) => {
str = str+item.testitem_name+":"+(item.rate_pass).toFixed(2)+"%\n";
})
that.tableDatas[2][index] = str;//
that.tableDatas[3][index] = item.yield;//
that.tableDatas[4][index] = item.elec_consume;//
that.tableDatas[5][index] = item.imaterial_data_dict?item.imaterial_data_dict.柴油?(item.imaterial_data_dict.柴油.cost).toFixed(2):'':'';//
that.tableDatas[6][index] = item.yield;//绿
that.tableDatas[7][index] = item.yield;//
that.tableDatas[8][index] = item.imaterial_data_dict?item.imaterial_data_dict.工业水?(item.imaterial_data_dict.工业水.cost).toFixed(2) :'':''; //
that.tableDatas[12][index] = item.imaterial_data_dict?item.imaterial_data_dict.蒸汽?(item.imaterial_data_dict.蒸汽.cost).toFixed(2):'':'';//
that.tableDatas[13][index] = item.yield;//
}
if(item.mgroup_name=='原料压缩空气'){
that.tableDatas[9][3] = item.cair_consume;
}else if(item.mgroup_name=='水泥压缩空气'){
that.tableDatas[10][7] = item.cair_consume;
}else if(item.mgroup_name=='烧成压缩空气'){
that.tableDatas[11][6] = item.cair_consume;
}
});
})
},
getTableData(){
this.getData();
},