fix:coding#674页面数据

This commit is contained in:
shijing 2024-12-06 15:34:03 +08:00
parent 3a59765b26
commit 8f35a7f6b5
1 changed files with 42 additions and 22 deletions

View File

@ -68,7 +68,7 @@
<table border="1" cellspacing="0" :key="timeStamp" id="myTable" class="myTable">
<thead class="myTableHead">
<tr>
<th colspan="9">绿色建材生产质量消耗报表</th>
<th colspan="8">绿色建材生产质量消耗报表</th>
</tr>
<tr>
<th v-for="item in headers" :key="item">{{item}}</th>
@ -77,13 +77,13 @@
<tr v-for="(item,index) in tableDatas" :key="index">
<td class="numCell">{{item[0]}}</td>
<td class="numCell">{{item[1]}}</td>
<td class="numCell">{{item[2]}}</td>
<td class="numCell">{{item[3]}}</td>
<td class="numCell">{{item[4]}}</td>
<td class="numCell">{{item[5]}}</td>
<td class="numCell">{{item[6]}}</td>
<td class="numCell">{{item[7]}}</td>
<td class="numCell">{{item[8]}}</td>
<td class="numCell" v-if="index==6||index==7||index==8" colspan="6">{{item[2]}}</td>
<td class="numCell" v-else>{{item[2]}}</td>
<td class="numCell" v-if="index!==6&&index!==7&&index!==8">{{item[3]}}</td>
<td class="numCell" v-if="index!==6&&index!==7&&index!==8">{{item[4]}}</td>
<td class="numCell" v-if="index!==6&&index!==7&&index!==8">{{item[5]}}</td>
<td class="numCell" v-if="index!==6&&index!==7&&index!==8">{{item[6]}}</td>
<td class="numCell" v-if="index!==6&&index!==7&&index!==8">{{item[7]}}</td>
</tr>
</table>
</div>
@ -108,7 +108,7 @@
{id:2,name:'年统计'},
],
mgroups:['电石渣','原料磨','煤磨','回转窑','水泥磨','水泥包装'],
headers:['','时间','电石渣','原料磨','生料工段','煤磨','熟料工段','水泥粉磨','水泥包装'],
headers:['','时间','电石渣','原料磨','煤磨','熟料工段','水泥粉磨','水泥包装'],
tableDatas:[
['产量(t)'],
['台产(t/h)'],
@ -124,16 +124,16 @@
['水泥压缩空气流量(m³/h)'],
['产生蒸汽量(t)'],
['成本(元/t)'],
['生产动态']
],
};
},
mounted() {
var myDate = new Date();
// this.query.searchDay =this.currentDay = this.$TOOL.dateFormat2(myDate);
this.query.searchDay =this.currentDay = '2024-10-04';
this.query.searchDay ='2024-10-04';
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: {
typeCange(value){
@ -176,6 +176,7 @@
search_time = that.query.searchYear;
params.year_s = Number(that.query.searchYear);
}
that.getWaterData(params);
that.tableDatas.forEach((item) => {
item[1] = search_time;
})
@ -186,6 +187,7 @@
}
res.forEach(item => {
let index = that.mgroups.indexOf(item.mgroup_name);
console.log(item.mgroup_name,index)
if(index>-1){
index = index+2;
that.tableDatas[0][index] = item.total_production;
@ -195,26 +197,44 @@
str = str+item.testitem_name+":"+(item.rate_pass).toFixed(2)+"%\n";
})
that.tableDatas[2][index] = str;//
that.tableDatas[3][index] = item.yield;//
that.tableDatas[3][index] = item.pcoal_consume;//
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;//
that.tableDatas[12][index] = item.out_steam;//
that.tableDatas[13][index] = item.production_cost_unit;//
}
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[10][5] = item.cair_consume;
}else if(item.mgroup_name=='水泥压缩空气'){
that.tableDatas[11][6] = item.cair_consume;
}
});
})
},
getWaterData(par){
let obj = {page:0};
obj.type = par.type.split("_")[0];
obj.year = par.year_s;
obj.month = par.month_s;
obj.day = par.day_s;
obj.mpoint__in = "3631858394648182784,3631858982832218112,3631858687335112704";
let that = this;
this.$API.enm.mpointstat.list.req(obj).then(res=>{
if(res.length>0){
res.forEach((item)=>{
if(item.mpoint_nickname=='绿化水'){
that.tableDatas[6][2] = item.val;
}else if(item.mpoint_nickname=='生活水'){
that.tableDatas[7][2] = item.val;
}else if(item.mpoint_nickname=='工业水'){
that.tableDatas[8][2] = item.val;
}
})
}
})
},
getTableData(){
this.getData();
},