308 lines
15 KiB
Vue
308 lines
15 KiB
Vue
<!-- 全厂电量统计 -->
|
||
<template>
|
||
<div class="app-container">
|
||
<el-header>
|
||
<div class="left-panel">
|
||
<!-- <el-select
|
||
v-model="type"
|
||
placeholder="查询类型"
|
||
clearable
|
||
class="headerSearch"
|
||
@change="typeCange"
|
||
>
|
||
<el-option
|
||
v-for="item in options"
|
||
:key="item.id"
|
||
:label="item.name"
|
||
:value="item.id"
|
||
></el-option>
|
||
</el-select> -->
|
||
<el-date-picker
|
||
v-model="search_day"
|
||
type="date"
|
||
value-format="YYYY-MM-DD"
|
||
format="YYYY-MM-DD"
|
||
placeholder="天"
|
||
style="margin-right: 6px;"
|
||
@change="dayChange"
|
||
/>
|
||
<el-button
|
||
type="primary"
|
||
icon="el-icon-search"
|
||
@click="getTableData"
|
||
></el-button>
|
||
<el-button
|
||
type="primary"
|
||
@click="exportExcel()"
|
||
:loading = "exportLoading"
|
||
>导出xlsx
|
||
</el-button>
|
||
<el-button
|
||
type="primary"
|
||
@click="handlePrint"
|
||
>打印
|
||
</el-button>
|
||
</div>
|
||
</el-header>
|
||
<el-card style="margin-top:5px">
|
||
<div ref="print" id="myReport" class="printContainer">
|
||
<table border="1" cellspacing="0" :key="timeStamp" id="numTable" class="myTable">
|
||
<thead class="myTableHead">
|
||
<tr>
|
||
<th colspan="6" v-if="type=='day'">生产日报</th>
|
||
<th colspan="6" v-else>生产月报</th>
|
||
</tr>
|
||
<tr>
|
||
<th>序号</th>
|
||
<th colspan="2">项目</th>
|
||
<th colspan="3">日数据</th>
|
||
</tr>
|
||
</thead>
|
||
<tr v-for="(item,index) in tableDatas" :key="index">
|
||
<td class="numCell">{{item[0]}}</td>
|
||
<td class="numCell" v-if="index==0" rowspan="5">{{item[1]}}</td>
|
||
<td class="numCell" v-else-if="index==5" rowspan="9">{{item[1]}}</td>
|
||
<td class="numCell" v-else-if="index==14" rowspan="14">{{item[1]}}</td>
|
||
<td class="numCell" v-else-if="index==28" rowspan="5">{{item[1]}}</td>
|
||
<td class="numCell" v-else-if="index==33" rowspan="6">{{item[1]}}</td>
|
||
<td class="numCell" v-else-if="index>38">{{item[1]}}</td>
|
||
<td class="numCell" style="width: 180px !important;">{{item[2]}}</td>
|
||
<td class="numCell" v-if="index<39" colspan="3">{{item[3]}}</td>
|
||
<td class="numCell" v-else>{{item[3]}}</td>
|
||
<td class="numCell" v-if="index>38">{{item[4]}}</td>
|
||
<td class="numCell" v-if="index>38">{{item[5]}}</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
</el-card>
|
||
</div>
|
||
</template>
|
||
<script>
|
||
export default {
|
||
data() {
|
||
return {
|
||
type:'day',
|
||
options:[{
|
||
name:'生产日报',
|
||
id:'day'
|
||
},{
|
||
name:'生产月报',
|
||
id:'month'
|
||
}],
|
||
search_day:'',
|
||
tableDatas:[
|
||
[1,'主机设备台产','立磨台产(t/h)',''],
|
||
[2,'主机设备台产','烘干破台产(t/h)'],
|
||
[3,'主机设备台产','煤磨台产(t/h)'],
|
||
[4,'主机设备台产','回转窑台产(t/h)'],
|
||
[5,'主机设备台产','水泥磨台产(t/h)'],
|
||
|
||
[6,'能耗','熟料日综合电耗(kw.h/t)'],
|
||
[7,'能耗','熟料日单位标煤耗(kgce/t)'],
|
||
[8,'能耗','熟料日综合能耗(kgce/t)'],
|
||
[9,'能耗','水泥日综合能耗(kgce/t)'],
|
||
[10,'能耗','日电石渣分布电耗(kw.h/t)'],
|
||
[11,'能耗','日生料分布电耗(kw.h/t)'],
|
||
[12,'能耗','日熟料分布电耗(kw.h/t)'],
|
||
[13,'能耗','日水泥粉磨分布电耗(kw.h/t)'],
|
||
[14,'能耗','日水泥包装分布电耗(kw.h/t)'],
|
||
|
||
|
||
[15,'产量','日电石渣产量(t)'],
|
||
[16,'产量','月电石渣产量完成率(%)'],
|
||
[17,'产量','日生料产量(t)'],
|
||
[18,'产量','月生料产量完成率(%)'],
|
||
[19,'产量','日熟料产量(t)'],
|
||
[20,'产量','月熟料产量完成率(%)'],
|
||
[21,'产量','日水泥产量(t)'],
|
||
[22,'产量','月水泥产量完成率(%)'],
|
||
[23,'产量','日熟料出厂量(t)'],
|
||
[24,'产量','月熟料累计出厂量(t)'],
|
||
[25,'产量','日散装水泥出厂量(t)'],
|
||
[26,'产量','月散装水泥出厂量(t)'],
|
||
[27,'产量','日袋装水泥出厂量(t)'],
|
||
[28,'产量','月袋装水泥出厂量(t)'],
|
||
|
||
|
||
|
||
[29,'成本','日电石渣成本(元/吨)'],
|
||
[30,'成本','日生料成本(元/吨)'],
|
||
[31,'成本','日熟料成本(元/吨)'],
|
||
[32,'成本','日水泥粉磨成本(元/吨)'],
|
||
[33,'成本','日水泥包装成本(元/吨)'],
|
||
|
||
|
||
[34,'耗电量','日电石渣耗电量(kw.h)'],
|
||
[35,'耗电量','日生料耗电量(kw.h)'],
|
||
[36,'耗电量','日熟料耗电量(kw.h)'],
|
||
[37,'耗电量','日水泥粉磨耗电量(kw.h)'],
|
||
[38,'耗电量','日水泥包装耗电量(kw.h)'],
|
||
[39,'耗电量','日生活区耗电量(kw.h)'],
|
||
|
||
|
||
['生产异常动态','工段','类别','原因','处置措施','处置人'],
|
||
['生产异常动态','电石渣'],
|
||
['生产异常动态','原料磨'],
|
||
['生产异常动态','回转窑'],
|
||
['生产异常动态','煤磨'],
|
||
['生产异常动态','水泥磨'],
|
||
],
|
||
year:'',
|
||
month:'',
|
||
day:'',
|
||
hours:'',
|
||
timeDate:'',
|
||
dataList:{},
|
||
};
|
||
},
|
||
mounted() {
|
||
let that = this;
|
||
var myDate = new Date();
|
||
that.timeDate = myDate.getTime();
|
||
let hours = myDate.getHours();
|
||
let year = myDate.getFullYear();
|
||
let month = myDate.getMonth()+1;
|
||
let day = myDate.getDate();
|
||
|
||
if(hours<21){//21点前,查找昨日数据为前一天数据
|
||
let dayTime = 24 * 60 * 60 * 1000;
|
||
let newDate = that.timeDate- dayTime;
|
||
let lastDate = new Date(newDate);
|
||
year = lastDate.getFullYear();
|
||
month = lastDate.getMonth()+1;
|
||
day = lastDate.getDate();
|
||
}
|
||
that.year = year;
|
||
that.month = month;
|
||
that.day = day;
|
||
let month0 = that.month>9?that.month :'0'+that.month ;
|
||
that.search_day = that.year+'-'+month0+'-'+day;
|
||
this.getData();
|
||
},
|
||
methods: {
|
||
// test(index){
|
||
// if(index!==8&&index==!22&&index==!26&&index==!37&&index==!38&&index!==48&&index!==49){
|
||
// console.log(index)
|
||
// }
|
||
// },
|
||
dayChange(e){
|
||
let that = this;
|
||
let arr = e.split('-')
|
||
that.year = Number(arr[0]);
|
||
that.month = Number(arr[1]);
|
||
that.day = Number(arr[2]);
|
||
},
|
||
getData(){
|
||
let that = this;
|
||
let params = {};
|
||
params.page = 0;
|
||
params.year_s = that.year;
|
||
params.month_s = that.month;
|
||
params.day_s = that.day;
|
||
params.type = 'day_s';
|
||
this.$API.enm.enstat.req(params).then((res) => {
|
||
let dataList = {};
|
||
res.forEach(item => {
|
||
let label = item.mgroup_name;
|
||
dataList[label] = item;
|
||
});
|
||
//台产
|
||
that.tableDatas[0][3] = dataList.原料磨.production_hour;
|
||
that.tableDatas[1][3] = dataList.电石渣.production_hour;
|
||
that.tableDatas[2][3] = dataList.煤磨.production_hour;
|
||
that.tableDatas[3][3] = dataList.回转窑.production_hour;
|
||
that.tableDatas[4][3] = dataList.水泥磨.production_hour;
|
||
//能耗(kw.h/t)
|
||
that.tableDatas[5][3] = dataList.回转窑.celec_consume_unit;
|
||
that.tableDatas[6][3] = dataList.回转窑.coal_consume_unit;
|
||
that.tableDatas[7][3] = dataList.回转窑.cen_consume_unit;
|
||
that.tableDatas[8][3] = dataList.水泥磨.cen_consume_unit;
|
||
that.tableDatas[9][3] = dataList.电石渣.elec_consume_unit;
|
||
that.tableDatas[10][3] = dataList.原料磨.elec_consume_unit;
|
||
that.tableDatas[11][3] = dataList.回转窑.elec_consume_unit;
|
||
that.tableDatas[12][3] = dataList.水泥磨.elec_consume_unit;
|
||
that.tableDatas[13][3] = dataList.水泥包装.elec_consume_unit;
|
||
//产量(t)
|
||
that.tableDatas[14][3] = dataList.电石渣.production_hour;
|
||
that.tableDatas[16][3] = dataList.原料磨.production_hour;
|
||
that.tableDatas[18][3] = dataList.回转窑.production_hour;
|
||
that.tableDatas[20][3] = dataList.水泥磨.production_hour;
|
||
//成本(元/吨)
|
||
that.tableDatas[28][3] = dataList.电石渣.production_cost_unit;
|
||
that.tableDatas[29][3] = dataList.原料磨.production_cost_unit;
|
||
that.tableDatas[30][3] = dataList.回转窑.production_cost_unit;
|
||
that.tableDatas[31][3] = dataList.水泥磨.production_cost_unit;
|
||
that.tableDatas[32][3] = dataList.水泥包装.production_cost_unit;
|
||
//耗电量(kw.h)
|
||
that.tableDatas[33][3] = dataList.电石渣.elec_consume;
|
||
that.tableDatas[34][3] = dataList.原料磨.elec_consume;
|
||
that.tableDatas[35][3] = dataList.回转窑.elec_consume;
|
||
that.tableDatas[36][3] = dataList.煤磨.elec_consume;
|
||
that.tableDatas[37][3] = dataList.水泥磨.elec_consume;
|
||
that.tableDatas[38][3] = dataList.水泥包装.elec_consume;
|
||
// that.tableDatas[39][3] = dataList.生活区.elec_consume;
|
||
}).then(res=>{
|
||
//获取月和年目标
|
||
let params1 = {};
|
||
params1.page = 0;
|
||
params1.goal_cate__code = 'total_production';
|
||
params1.year = that.year;
|
||
this.$API.mtm.goal.list.req(params1).then((res1) => {
|
||
let dataList1 = {};//目标
|
||
res1.forEach(item1 => {
|
||
let label = item1.mgroup_name;
|
||
dataList1[label] = item1;
|
||
});
|
||
let ind = 'goal_val';
|
||
if(this.type=='day'){
|
||
ind = 'goal_val_'+that.month;
|
||
}
|
||
that.tableDatas[15][3] = dataList1.电石渣&&dataList1.电石渣[ind]!==0&&dataList1.电石渣[ind]!==''&&that.tableDatas[14][3]!==''?(that.tableDatas[14][3] /dataList1.电石渣[ind])*100:'/';
|
||
that.tableDatas[17][3] = dataList1.原料磨&&dataList1.原料磨[ind]!==0&&dataList1.原料磨[ind]!==''&&that.tableDatas[14][3]!==''?(that.tableDatas[16][3] /dataList1.原料磨[ind])*100:'/';
|
||
that.tableDatas[19][3] = dataList1.回转窑&&dataList1.回转窑[ind]!==0&&dataList1.回转窑[ind]!==''&&that.tableDatas[14][3]!==''?(that.tableDatas[18][3] /dataList1.回转窑[ind])*100:'/';
|
||
that.tableDatas[21][3] = dataList1.水泥磨&&dataList1.水泥磨[ind]!==0&&dataList1.水泥磨[ind]!==''&&that.tableDatas[14][3]!==''?(that.tableDatas[20][3] /dataList1.水泥磨[ind])*100:'/';
|
||
})
|
||
}).then(res=>{
|
||
let obj1 = {};
|
||
obj1.page = 0;
|
||
obj1.type = 'day_s';
|
||
obj1.year_s = this.year;
|
||
obj1.month_s = this.month;
|
||
obj1.day_s = this.day;
|
||
that.$API.enm.enstat2.req(obj1).then((res1) => {
|
||
if(res1.length>0){
|
||
that.tableDatas[22][3]=res1[0].clinker_val;
|
||
that.tableDatas[24][3] = res1[0].bulk_cement_val;
|
||
that.tableDatas[26][3] = res1[0].bag_cement_val;
|
||
}
|
||
})
|
||
let obj2 = {};
|
||
obj2.year_s = this.year;
|
||
obj2.month_s = this.month;
|
||
obj2.type = 'month_s';
|
||
obj2.page = 0;
|
||
that.$API.enm.enstat2.req(obj2).then((res2) => {
|
||
if(res2.length>0){
|
||
that.tableDatas[23][3] = res2[0].clinker_val;
|
||
that.tableDatas[25][3] = res2[0].bulk_cement_val;
|
||
that.tableDatas[27][3] = res2[0].bag_cement_val;
|
||
}
|
||
})
|
||
|
||
});
|
||
},
|
||
|
||
getTableData(){
|
||
for(let i=0;i<39;i++){
|
||
this.tableDatas[i][3] = '';
|
||
}
|
||
this.getData();
|
||
},
|
||
handlePrint() {
|
||
this.$PRINT('#myReport');
|
||
},
|
||
}
|
||
};
|
||
</script>
|
||
<style>
|
||
</style> |