This commit is contained in:
shijing 2025-02-08 16:47:32 +08:00
commit 89b64277f9
3 changed files with 246 additions and 521 deletions

View File

@ -58,8 +58,8 @@
</el-table-column>
<el-table-column label="购置日期" prop="buy_date">
</el-table-column>
<!-- <el-table-column label="工段运行" prop="indicate_mgroup_running">
</el-table-column> -->
<el-table-column label="工段运行的方式" prop="indicate_mgroup_running">
</el-table-column>
<el-table-column label="设备负责人" prop="device_people" show-overflow-tooltip>
</el-table-column>

View File

@ -19,9 +19,9 @@
</el-select> -->
<el-date-picker
v-model="search_day"
type="date"
value-format="YYYY-MM-DD"
format="YYYY-MM-DD"
type="month"
value-format="YYYY-MM"
format="YYYY-MM"
placeholder="天"
style="margin-right: 6px;"
@change="dayChange"
@ -47,48 +47,33 @@
</el-header>
<el-main>
<el-card shadow="never">
<div class="topTableDiv">
<table border="1" cellspacing="0" class="myTable">
<thead class="myTableHead">
<tr>
<th colspan="6" v-if="type=='day'">生产日报</th>
<th colspan="6" v-else>生产月报</th>
</tr>
<tr>
<th style="width:100px">序号</th>
<th colspan="2" style="width:280px">项目</th>
<th colspan="3" style="width:100px">日数据</th>
</tr>
</thead>
</table>
</div>
<div ref="print" id="myReport" class="printContainer" style="width: 100%;">
<table border="1" cellspacing="0" :key="timeStamp" id="numTable" class="myTable">
<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>
<th :colspan="tableDatas.length > 0 ? tableDatas[0].length : 3" v-if="type == 'day'">生产日报</th>
<th :colspan="tableDatas.length > 0 ? tableDatas[0].length : 3" v-else>生产月报</th>
</tr>
<tr>
<th>序号</th>
<th colspan="2">项目</th>
<th colspan="3">日数据</th>
<th v-for="(day, i) in tableHeaders" :key="i" style="width:100px">
{{ day }}
</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="4">{{item[1]}}</td>
<td class="numCell" v-else-if="index==32" 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>
<tbody>
<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="5">{{ item[1] }}</td>
<td class="numCell" v-else-if="index == 19" rowspan="4">{{ item[1] }}</td>
<td class="numCell" v-else-if="index == 23" rowspan="6">{{ item[1] }}</td>
<td class="numCell" style="width: 180px !important;">{{ item[2] }}</td>
<td class="numCell" v-for="(value, i) in item.slice(3)" :key="i">{{ value }}</td>
</tr>
</tbody>
</table>
</div>
</el-card>
@ -108,6 +93,7 @@
id:'month'
}],
search_day:'',
tableHeaders:[],
tableDatas:[
[1,'主机设备台产','立磨台产t/h',''],
[2,'主机设备台产','烘干破台产t/h'],
@ -124,38 +110,24 @@
[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)'],
[16,'产量','日生料产量(t)'],
[17,'产量','日熟料产量(t)'],
[18,'产量','日水泥磨产量(t)'],
[19,'产量','日出厂水泥产量(t)'],
// [20,'','(t)'],
// [21,'','(t)'],
[20,'成本','日电石渣成本(元/吨)'],
[21,'成本','日生料成本(元/吨)'],
[22,'成本','日熟料成本(元/吨)'],
[23,'成本','日水泥粉磨成本(元/吨)'],
[29,'成本','日电石渣成本(元/吨)'],
[30,'成本','日生料成本(元/吨)'],
[31,'成本','日熟料成本(元/吨)'],
[32,'成本','日水泥粉磨成本(元/吨)'],
// [33,'','(/)'],
[33,'耗电量','日电石渣耗电量kW·h'],
[34,'耗电量','日生料耗电量kW·h'],
[35,'耗电量','日熟料耗电量kW·h'],
[36,'耗电量','日水泥粉磨耗电量kW·h'],
[37,'耗电量','日水泥包装耗电量kW·h'],
[38,'耗电量','日生活区耗电量kW·h'],
[24,'耗电量','日电石渣耗电量kW·h'],
[25,'耗电量','日生料耗电量kW·h'],
[26,'耗电量','日熟料耗电量kW·h'],
[27,'耗电量','日水泥粉磨耗电量kW·h'],
[28,'耗电量','日水泥包装耗电量kW·h'],
[29,'耗电量','日生活区耗电量kW·h'],
],
year:'',
@ -190,23 +162,17 @@
that.day = day;
let month0 = that.month>9?that.month :'0'+that.month ;
that.search_day = that.year+'-'+month0+'-'+day;
this.getData();
that.getData();
let heights = document.getElementsByClassName('el-main')[0].clientHeight-30;
document.getElementById('myReport').style.height = heights+'px';
},
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;
if(e){
let arr = e.split('-')
that.year = Number(arr[0]);
that.month = Number(arr[1]);
that.day = Number(arr[2]);
}
},
getData(){
@ -220,126 +186,84 @@
that.tableName = that.year+'-'+that.month+'-'+that.day+'-生产日报表';
this.$API.enm.enstat.req(params).then((res) => {
let dataList = {};
if(res.length <= 0){
return;
}
res.forEach(item => {
let label = item.mgroup_name;
dataList[label] = item;
if(!dataList[label]){
dataList[label] = [];
}
dataList[label].push(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.电石渣.total_production;
that.tableDatas[16][3] = dataList.原料磨.total_production;
that.tableDatas[18][3] = dataList.回转窑.total_production;
that.tableDatas[20][3] = dataList.水泥磨.total_production;
//(/)
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[32][3] = dataList.电石渣.elec_consume;
that.tableDatas[33][3] = dataList.原料磨.elec_consume;
that.tableDatas[34][3] = dataList.回转窑.elec_consume;
// that.tableDatas[35][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;
}).then(res=>{
//
let params2 = {};
params2.page = 0;
params2.year_s = that.year;
params2.month_s = that.month;
params2.type = 'month_s';
this.$API.enm.enstat.req(params2).then((res3) => {
;//
let dataList3 = {};
if (res3.length > 0){
res3.forEach(item3 => {
let label = item3.mgroup_name;
dataList3[label] = item3;
});
}
that.dataList3 = dataList3;
}).then(res=>{
let params1 = {};
let that = this;
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.dataList3.电石渣.total_production!==''?((that.dataList3.电石渣.total_production /dataList1.电石渣[ind])*100).toFixed(2):'/';
that.tableDatas[17][3] = dataList1.原料磨&&dataList1.原料磨[ind]!==0&&dataList1.原料磨[ind]!==''&&that.dataList3.原料磨.total_production!==''?((that.dataList3.原料磨.total_production /dataList1.原料磨[ind])*100).toFixed(2):'/';
that.tableDatas[19][3] = dataList1.回转窑&&dataList1.回转窑[ind]!==0&&dataList1.回转窑[ind]!==''&&that.dataList3.回转窑.total_production!==''?((that.dataList3.回转窑.total_production /dataList1.回转窑[ind])*100).toFixed(2):'/';
that.tableDatas[21][3] = dataList1.水泥磨&&dataList1.水泥磨[ind]!==0&&dataList1.水泥磨[ind]!==''&&that.dataList3.水泥磨.total_production!==''?((that.dataList3.水泥磨.total_production /dataList1.水泥磨[ind])*100).toFixed(2):'/';
})
})
}).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].bulk_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].bulk_clinker_val;
that.tableDatas[25][3] = res2[0].bulk_cement_val;
that.tableDatas[27][3] = res2[0].bag_cement_val;
}
})
});
let dataList2 = dataList.回转窑;
//
dataList2.forEach((item,index) => {
that.tableHeaders.push(item.day_s);
let colIndex = index+3;
that.tableDatas[0][colIndex] = dataList['原料磨'][index].production_hour;
that.tableDatas[1][colIndex] = dataList['电石渣'][index].production_hour;
that.tableDatas[2][colIndex] = dataList['煤磨'][index].production_hour;
that.tableDatas[3][colIndex] = dataList['回转窑'][index].production_hour;
that.tableDatas[4][colIndex] = dataList['水泥磨'][index].production_hour;
//kW·h/t
that.tableDatas[5][colIndex] = dataList['回转窑'][index].celec_consume_unit;
that.tableDatas[6][colIndex] = dataList['回转窑'][index].coal_consume_unit;
that.tableDatas[7][colIndex] = dataList['回转窑'][index].cen_consume_unit;
that.tableDatas[8][colIndex] = dataList['水泥磨'][index].cen_consume_unit;
that.tableDatas[9][colIndex] = dataList['电石渣'][index].elec_consume_unit;
that.tableDatas[10][colIndex] = dataList['原料磨'][index].elec_consume_unit;
that.tableDatas[11][colIndex] = dataList['回转窑'][index].elec_consume_unit;
that.tableDatas[12][colIndex] = dataList['水泥磨'][index].elec_consume_unit;
that.tableDatas[13][colIndex] = dataList['水泥包装'][index].elec_consume_unit;
//(t)
that.tableDatas[14][colIndex] = dataList['电石渣'][index].total_production;
that.tableDatas[15][colIndex] = dataList['生料工序(二次配料)'][index].total_production;
that.tableDatas[16][colIndex] = dataList['回转窑'][index].total_production;
that.tableDatas[17][colIndex] = dataList['水泥磨'][index].total_production;
that.tableDatas[18][colIndex] = dataList['水泥包装'][index].total_production;
//(/)
that.tableDatas[19][colIndex] = dataList['电石渣'][index].production_cost_unit;
that.tableDatas[20][colIndex] = dataList['原料磨'][index].production_cost_unit;
that.tableDatas[21][colIndex] = dataList['回转窑'][index].production_cost_unit;
that.tableDatas[22][colIndex] = dataList['水泥磨'][index].production_cost_unit;
// that.tableDatas[32][3] = dataList..production_cost_unit;
//kW·h
that.tableDatas[23][colIndex] = dataList['电石渣'][index].elec_consume;
that.tableDatas[24][colIndex] = dataList['生料工序(二次配料)'][index].elec_consume;
that.tableDatas[25][colIndex] = dataList['回转窑'][index].elec_consume;
that.tableDatas[26][colIndex] = dataList['水泥磨'][index].elec_consume;
that.tableDatas[27][colIndex] = dataList['水泥包装'][index].elec_consume;
that.tableDatas[28][colIndex] = dataList['生活区'][index].elec_consume;
})
// this.updateTableHeaders();
}
);
},
getTableData(){
// for(let i=0;i<39;i++){
// this.tableDatas[i][3] = '';
// }
// table item2
this.tableDatas.forEach((item,index) => {
item.length = 3;
});
this.tableHeaders = [];
this.getData();
},
handlePrint() {
this.$PRINT('#myReport');
},
// updateTableHeaders() {
// let that = this;
// // tableDatas >= 3
// if (this.tableDatas.length > 0) {
// let columnCount = this.tableDatas[0].length - 3; //
// this.tableHeaders = Array.from({ length: columnCount }, (_, i) => i + 1);
// } else {
// this.tableHeaders = [];
// }
// },
exportExcel() {
this.exportLoading = true;
this.$XLSX('#myReport', this.tableName)
@ -355,4 +279,21 @@
#myReport{
overflow-y: scroll;
}
.myTable thead {
position: sticky;
top: 0; /* 固定表头在顶部 */
background-color: #008080; /* 设置表头的背景颜色 */
z-index: 1; /* 保证表头在内容之上 */
}
.myTable th {
padding: 8px;
text-align: center;
background-color: #008080; /* 设置表头的背景色 */
}
.myTable td {
padding: 8px;
text-align: center;
}
</style>

View File

@ -5,10 +5,10 @@
<div class="left-panel">
<el-date-picker
v-model="search_month"
type="month"
value-format="YYYY-MM"
format="YYYY-MM"
placeholder="份"
type="year"
value-format="YYYY"
format="YYYY"
placeholder="份"
style="margin-right: 6px;"
@change="monthChange"
/>
@ -33,45 +33,33 @@
</el-header>
<el-main>
<el-card shadow="never">
<div class="topTableDiv">
<table border="1" cellspacing="0" :key="timeStamp" id="numTable" class="myTable">
<thead class="myTableHead">
<tr>
<th colspan="6">生产月报</th>
</tr>
<tr>
<th style="width:100px">序号</th>
<th colspan="2" style="width:280px">项目</th>
<th colspan="3" style="width:100px">月数据</th>
</tr>
</thead>
</table>
</div>
<div ref="print" id="myReport" class="printContainer" style="width: 100%;">
<table border="1" cellspacing="0" :key="timeStamp" id="numTable" class="myTable">
<table border="1" cellspacing="0" :key="timeStamp" id="numTable" class="myTable">
<thead class="myTableHead">
<tr>
<th colspan="4">生产月报</th>
<th :colspan="tableDatas.length > 0 ? tableDatas[0].length : 3" v-if="type == 'day'">生产月报</th>
<th :colspan="tableDatas.length > 0 ? tableDatas[0].length : 3" v-else>生产月报</th>
</tr>
<tr>
<th>序号</th>
<th colspan="2">项目</th>
<th colspan="3">月数据</th>
<th v-for="(day, i) in tableHeaders" :key="i" style="width:100px">
{{ day }}
</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="11">{{item[1]}}</td>
<td class="numCell" v-else-if="index==25" rowspan="5">{{item[1]}}</td>
<td class="numCell" v-else-if="index==30" rowspan="6">{{item[1]}}</td>
<td class="numCell" v-else-if="index>35">{{item[1]}}</td>
<td class="numCell" style="width: 180px !important;">{{item[2]}}</td>
<td class="numCell" >{{item[3]}}</td>
<td class="numCell" v-if="index>38">{{item[4]}}</td>
<td class="numCell" v-if="index>38">{{item[5]}}</td>
</tr>
<tbody>
<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="5">{{ item[1] }}</td>
<td class="numCell" v-else-if="index == 19" rowspan="4">{{ item[1] }}</td>
<td class="numCell" v-else-if="index == 23" rowspan="6">{{ item[1] }}</td>
<td class="numCell" style="width: 180px !important;">{{ item[2] }}</td>
<td class="numCell" v-for="(value, i) in item.slice(3)" :key="i">{{ value }}</td>
</tr>
</tbody>
</table>
</div>
</el-card>
@ -83,6 +71,7 @@
data() {
return {
search_month:'',
tableHeaders:[],
tableDatas:[
[1,'主机设备台产','立磨台产t/h',''],
[2,'主机设备台产','烘干破台产t/h'],
@ -102,29 +91,23 @@
[15,'产量','月电石渣产量(t)'],
[16,'产量','月电石渣产量完成率(%)'],
[17,'产量','月生料产量(t)'],
[18,'产量','月生料产量完成率(%)'],
[19,'产量','月熟料产量(t)'],
[20,'产量','月熟料产量完成率(%)'],
[21,'产量','月水泥产量(t)'],
[22,'产量','月水泥产量完成率(%)'],
[23,'产量','月熟料出厂量(t)'],
[24,'产量','月散装水泥出厂量(t)'],
[25,'产量','月袋装水泥出厂量(t)'],
[16,'产量','月生料产量(t)'],
[17,'产量','月熟料产量(t)'],
[18,'产量','月水泥磨产量(t)'],
[19,'产量','月出厂水泥产量(t)'],
[26,'成本','月电石渣成本(元/吨)'],
[27,'成本','月生料成本(元/吨)'],
[28,'成本','月熟料成本(元/吨)'],
[29,'成本','月水泥粉磨成本(元/吨)'],
[20,'成本','月电石渣成本(元/吨)'],
[21,'成本','月生料成本(元/吨)'],
[22,'成本','月熟料成本(元/吨)'],
[23,'成本','月水泥粉磨成本(元/吨)'],
// [30,'','(/)'],
[30,'耗电量','月电石渣耗电量kW·h'],
[31,'耗电量','月生料耗电量kW·h'],
[32,'耗电量','月熟料耗电量kW·h'],
[33,'耗电量','月水泥粉磨耗电量kW·h'],
[34,'耗电量','月水泥包装耗电量kW·h'],
[35,'耗电量','月生活区耗电量kW·h'],
[24,'耗电量','月电石渣耗电量kW·h'],
[25,'耗电量','月生料耗电量kW·h'],
[26,'耗电量','月熟料耗电量kW·h'],
[27,'耗电量','月水泥粉磨耗电量kW·h'],
[28,'耗电量','月水泥包装耗电量kW·h'],
[29,'耗电量','月生活区耗电量kW·h'],
],
year:'',
month:'',
@ -153,19 +136,17 @@
that.year_h = year
that.month_h = month-1;
}
let month0 = that.month>9?that.month :'0'+that.month ;
that.search_month = that.year+'-'+month0;
that.search_month = that.year;
this.getNowData();
let heights = document.getElementsByClassName('el-main')[0].clientHeight-30;
document.getElementById('myReport').style.height = heights+'px';
},
methods: {
monthChange(e){
let that = this;
if(e){
let that = this;
let arr = e.split('-')
that.year = Number(arr[0]);
that.month = Number(arr[1]);
console.log('e',e);
that.year = Number(e);
}
},
@ -174,124 +155,64 @@
let params = {};
params.page = 0;
params.year_s = that.year;
params.month_s = that.month;
that.tableName = that.year + '_' + that.month+'-生产月报表';
params.type = 'month_s';
let m_goal_val = "goal_val_" + that.month
this.$API.enm.enstat.req(params).then((res) => {
let dataList = {};
if(res.length <= 0){
return;
}
res.forEach(item => {
let label = item.mgroup_name;
dataList[label] = item;
if(!dataList[label]){
dataList[label] = [];
}
dataList[label].push(item);
});
//
that.nowData[0] = dataList.原料磨.production_hour;
that.tableDatas[0][3] = dataList.原料磨.production_hour;
that.nowData[1] = dataList.电石渣.production_hour;
that.tableDatas[1][3] = dataList.电石渣.production_hour;
that.nowData[2] = dataList.煤磨.production_hour;
that.tableDatas[2][3] = dataList.煤磨.production_hour;
that.nowData[3] = dataList.回转窑.production_hour;
that.tableDatas[3][3] = dataList.回转窑.production_hour;
that.nowData[4] = dataList.水泥磨.production_hour;
that.tableDatas[4][3] = dataList.水泥磨.production_hour;
//kW·h/t
that.nowData[5] = dataList.回转窑.celec_consume_unit;
that.tableDatas[5][3] = dataList.回转窑.celec_consume_unit;
that.nowData[6] = dataList.回转窑.coal_consume_unit;
that.tableDatas[6][3] = dataList.回转窑.coal_consume_unit;
that.nowData[7] = dataList.回转窑.cen_consume_unit;
that.tableDatas[7][3] = dataList.回转窑.cen_consume_unit;
that.nowData[8] = dataList.水泥磨.cen_consume_unit;
that.tableDatas[8][3] = dataList.水泥磨.cen_consume_unit;
that.nowData[9] = dataList.电石渣.elec_consume_unit;
that.tableDatas[9][3] = dataList.电石渣.elec_consume_unit;
that.nowData[10] = dataList.原料磨.elec_consume_unit;
that.tableDatas[10][3] = dataList.原料磨.elec_consume_unit;
that.nowData[11] = dataList.回转窑.elec_consume_unit;
that.tableDatas[11][3] = dataList.回转窑.elec_consume_unit;
that.nowData[12] = dataList.水泥磨.elec_consume_unit;
that.tableDatas[12][3] = dataList.水泥磨.elec_consume_unit;
that.nowData[13] = dataList.水泥包装.elec_consume_unit;
that.tableDatas[13][3] = dataList.水泥磨.elec_consume_unit;
//(t)
that.nowData[14] = dataList.电石渣.total_production;
that.tableDatas[14][3] = dataList.电石渣.total_production;
that.nowData[16] = dataList.原料磨.total_production;
that.tableDatas[16][3] = dataList.原料磨.total_production;
that.nowData[18] = dataList.回转窑.total_production;
that.tableDatas[18][3] = dataList.回转窑.total_production;
that.nowData[20] = dataList.水泥磨.total_production;
that.tableDatas[20][3] = dataList.水泥磨.total_production;
//(/)
that.nowData[25] = dataList.电石渣.production_cost_unit;
that.tableDatas[25][3] = dataList.电石渣.production_cost_unit;
that.nowData[26] = dataList.原料磨.production_cost_unit;
that.tableDatas[26][3] = dataList.原料磨.production_cost_unit;
that.nowData[27] = dataList.回转窑.production_cost_unit;
that.tableDatas[27][3] = dataList.回转窑.production_cost_unit;
that.nowData[28] = dataList.水泥磨.production_cost_unit;
that.tableDatas[28][3] = dataList.水泥磨.production_cost_unit;
that.nowData[29] = dataList.水泥包装.production_cost_unit;
that.tableDatas[29][3] = dataList.水泥包装.production_cost_unit;
//kW·h
// that.nowData[30] = dataList..elec_consume;
// that.tableDatas[30][3] = dataList..elec_consume;
that.nowData[30] = dataList.原料磨.elec_consume;
that.tableDatas[30][3] = dataList.原料磨.elec_consume;
that.nowData[31] = dataList.回转窑.elec_consume;
that.tableDatas[31][3] = dataList.回转窑.elec_consume;
// that.nowData[36] = dataList..elec_consume;
// that.tableDatas[36][3] = dataList..elec_consume;
that.nowData[32] = dataList.水泥磨.elec_consume;
that.tableDatas[32][3] = dataList.水泥磨.elec_consume;
that.nowData[33] = dataList.水泥包装.elec_consume;
that.tableDatas[33][3] = dataList.水泥包装.elec_consume;
that.nowData[34] = dataList.生活区.elec_consume;
that.tableDatas[34][3] = dataList.生活区.elec_consume;
}).then(res=>{
//
let params1 = {};
params1.page = 0;
params1.goal_cate__code = 'total_production';
params1.year = that.year;
console.log('m_goal_val', m_goal_val)
this.$API.mtm.goal.list.req(params1).then((res1) => {
let dataList1 = {};//
res1.forEach(item1 => {
let label = item1.mgroup_name;
dataList1[label] = item1;
});
that.nowData[15] = dataList1.电石渣&&dataList1.电石渣[m_goal_val]!==0&&dataList1.电石渣[m_goal_val]!==''&&that.nowData[14]!==''?(that.nowData[14] /dataList1.电石渣[m_goal_val])*100:'/';
that.tableDatas[15][3] = dataList1.电石渣&&dataList1.电石渣[m_goal_val]!==0&&dataList1.电石渣[m_goal_val]!==''&&that.nowData[14]!==''?((that.nowData[14] /dataList1.电石渣[m_goal_val])*100).toFixed(2):'/';
that.nowData[17] = dataList1.原料磨&&dataList1.原料磨[m_goal_val]!==0&&dataList1.原料磨[m_goal_val]!==''&&that.nowData[14]!==''?(that.nowData[16] /dataList1.原料磨[m_goal_val])*100:'/';
that.tableDatas[17][3] = dataList1.原料磨&&dataList1.原料磨[m_goal_val]!==0&&dataList1.原料磨[m_goal_val]!==''&&that.nowData[14]!==''?((that.nowData[16] /dataList1.原料磨[m_goal_val])*100).toFixed(2):'/';
that.nowData[19] = dataList1.回转窑&&dataList1.回转窑[m_goal_val]!==0&&dataList1.回转窑[m_goal_val]!==''&&that.nowData[14]!==''?(that.nowData[18] /dataList1.回转窑[m_goal_val])*100:'/';
that.tableDatas[19][3] = dataList1.回转窑&&dataList1.回转窑[m_goal_val]!==0&&dataList1.回转窑[m_goal_val]!==''&&that.nowData[14]!==''?((that.nowData[18] /dataList1.回转窑[m_goal_val])*100).toFixed(2):'/';
that.nowData[21] = dataList1.水泥磨&&dataList1.水泥磨[m_goal_val]!==0&&dataList1.水泥磨[m_goal_val]!==''&&that.nowData[14]!==''?(that.nowData[20] /dataList1.水泥磨[m_goal_val])*100:'/';
that.tableDatas[21][3] = dataList1.水泥磨&&dataList1.水泥磨[m_goal_val]!==0&&dataList1.水泥磨[m_goal_val]!==''&&that.nowData[14]!==''?((that.nowData[20] /dataList1.水泥磨[m_goal_val])*100).toFixed(2):'/';
})
}).then(res=>{
let obj1 = {};
obj1.page = 0;
obj1.year_s = this.year;
obj1.month_s = this.month;
obj1.type = 'month_s';
that.$API.enm.enstat2.req(obj1).then((res1) => {
if(res1.length>0){
that.nowData[22]=res1[0].bulk_clinker_val;
that.tableDatas[22][3]=res1[0].bulk_clinker_val;
that.nowData[23] = res1[0].bulk_cement_val;
that.tableDatas[23][3] = res1[0].bulk_cement_val;
that.nowData[24] = res1[0].bag_cement_val;
that.tableDatas[24][3] = res1[0].bag_cement_val;
}
}).then(res=>{
// this.getHuanbiData();
})});
let dataList2 = dataList.回转窑;
console.log('dataList2',dataList2);
//
dataList2.forEach((item,index) => {
that.tableHeaders.push(item.month_s);
let colIndex = index+3;
that.tableDatas[0][colIndex] = dataList['原料磨'][index].production_hour;
that.tableDatas[1][colIndex] = dataList['电石渣'][index].production_hour;
that.tableDatas[2][colIndex] = dataList['煤磨'][index].production_hour;
that.tableDatas[3][colIndex] = dataList['回转窑'][index].production_hour;
that.tableDatas[4][colIndex] = dataList['水泥磨'][index].production_hour;
//kW·h/t
that.tableDatas[5][colIndex] = dataList['回转窑'][index].celec_consume_unit;
that.tableDatas[6][colIndex] = dataList['回转窑'][index].coal_consume_unit;
that.tableDatas[7][colIndex] = dataList['回转窑'][index].cen_consume_unit;
that.tableDatas[8][colIndex] = dataList['水泥磨'][index].cen_consume_unit;
that.tableDatas[9][colIndex] = dataList['电石渣'][index].elec_consume_unit;
that.tableDatas[10][colIndex] = dataList['原料磨'][index].elec_consume_unit;
that.tableDatas[11][colIndex] = dataList['回转窑'][index].elec_consume_unit;
that.tableDatas[12][colIndex] = dataList['水泥磨'][index].elec_consume_unit;
that.tableDatas[13][colIndex] = dataList['水泥包装'][index].elec_consume_unit;
//(t)
that.tableDatas[14][colIndex] = dataList['电石渣'][index].total_production;
that.tableDatas[15][colIndex] = dataList['生料工序(二次配料)'][index].total_production;
that.tableDatas[16][colIndex] = dataList['回转窑'][index].total_production;
that.tableDatas[17][colIndex] = dataList['水泥磨'][index].total_production;
that.tableDatas[18][colIndex] = dataList['水泥包装'][index].total_production;
//(/)
that.tableDatas[19][colIndex] = dataList['电石渣'][index].production_cost_unit;
that.tableDatas[20][colIndex] = dataList['原料磨'][index].production_cost_unit;
that.tableDatas[21][colIndex] = dataList['回转窑'][index].production_cost_unit;
that.tableDatas[22][colIndex] = dataList['水泥磨'][index].production_cost_unit;
// that.tableDatas[32][3] = dataList..production_cost_unit;
//kW·h
that.tableDatas[23][colIndex] = dataList['电石渣'][index].elec_consume;
that.tableDatas[24][colIndex] = dataList['生料工序(二次配料)'][index].elec_consume;
that.tableDatas[25][colIndex] = dataList['回转窑'][index].elec_consume;
that.tableDatas[26][colIndex] = dataList['水泥磨'][index].elec_consume;
that.tableDatas[27][colIndex] = dataList['水泥包装'][index].elec_consume;
that.tableDatas[28][colIndex] = dataList['生活区'][index].elec_consume;
})
// this.updateTableHeaders();
});
},
canCompute(a,b){
debugger;
@ -306,179 +227,25 @@
return 0
}
},
// getHuanbiData(){
// let that = this;
// let params = {};
// params.page = 0;
// params.year_s = that.year_h;
// params.month_s = that.month_h;
// let m_goal_val = "goal_val_" + that.month
// params.type = 'month_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][4] = this.canCompute(that.nowData[0],dataList..production_hour);
// that.tableDatas[1][4] = this.canCompute(that.nowData[1],dataList..production_hour);
// that.tableDatas[2][4] = this.canCompute(that.nowData[2],dataList..production_hour);
// that.tableDatas[3][4] = this.canCompute(that.nowData[3],dataList..production_hour);
// that.tableDatas[4][4] = this.canCompute(that.nowData[4],dataList..production_hour);
// //kW·h/t
// that.tableDatas[5][4] = this.canCompute(that.nowData[5],dataList..celec_consume_unit);
// that.tableDatas[6][4] = this.canCompute(that.nowData[6],dataList..coal_consume_unit);
// that.tableDatas[7][4] = this.canCompute(that.nowData[7],dataList..cen_consume_unit);
// that.tableDatas[8][4] = this.canCompute(that.nowData[8],dataList..cen_consume_unit);
// that.tableDatas[9][4] = this.canCompute(that.nowData[9],dataList..elec_consume_unit);
// that.tableDatas[10][4] = this.canCompute(that.nowData[10],dataList..elec_consume_unit);
// that.tableDatas[11][4] = this.canCompute(that.nowData[11],dataList..elec_consume_unit);
// that.tableDatas[12][4] = this.canCompute(that.nowData[12],dataList..elec_consume_unit);
// that.tableDatas[13][4] = this.canCompute(that.nowData[13], dataList..elec_consume_unit);
// //(t)
// that.tableDatas[14][4] = this.canCompute(that.nowData[14],dataList..total_production);
// that.tableDatas[16][4] = this.canCompute(that.nowData[16],dataList..total_production);
// that.tableDatas[18][4] = this.canCompute(that.nowData[18],dataList..total_production);
// that.tableDatas[20][4] = this.canCompute(that.nowData[20],dataList..total_production);
// //(/)
// that.tableDatas[25][4] = this.canCompute(that.nowData[25],dataList..production_cost_unit);
// that.tableDatas[26][4] = this.canCompute(that.nowData[26],dataList..production_cost_unit);
// that.tableDatas[27][4] = this.canCompute(that.nowData[27],dataList..production_cost_unit);
// that.tableDatas[28][4] = this.canCompute(that.nowData[28],dataList..production_cost_unit);
// that.tableDatas[29][4] = this.canCompute(that.nowData[29],dataList..production_cost_unit);
// //kW·h
// // that.tableDatas[30][4] = this.canCompute(that.nowData[30],dataList..elec_consume);
// that.tableDatas[30][4] = this.canCompute(that.nowData[30],dataList..elec_consume);
// that.tableDatas[31][4] = this.canCompute(that.nowData[31],dataList..elec_consume);
// that.tableDatas[32][4] = this.canCompute(that.nowData[32],dataList..elec_consume);
// that.tableDatas[33][4] = this.canCompute(that.nowData[33],dataList..elec_consume);
// that.tableDatas[34][4] = this.canCompute(that.nowData[34],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_h;
// this.$API.mtm.goal.list.req(params1).then((res1) => {
// let dataList1 = {};//
// res1.forEach(item1 => {
// let label = item1.mgroup_name;
// dataList1[label] = item1;
// });
// that.tableDatas[15][4] = dataList1.&&dataList1.[m_goal_val]!==0&&dataList1.[m_goal_val]!==''&&that.tableDatas[14][4]!==''?((that.tableDatas[14][4] /dataList1.[m_goal_val])*100).toFixed(2):'/';
// that.tableDatas[17][4] = dataList1.&&dataList1.[m_goal_val]!==0&&dataList1.[m_goal_val]!==''&&that.tableDatas[14][4]!==''?((that.tableDatas[16][4] /dataList1.[m_goal_val])*100).toFixed(5):'/';
// that.tableDatas[19][4] = dataList1.&&dataList1.[m_goal_val]!==0&&dataList1.[m_goal_val]!==''&&that.tableDatas[14][4]!==''?((that.tableDatas[18][4] /dataList1.[m_goal_val])*100).toFixed(2):'/';
// that.tableDatas[21][4] = dataList1.&&dataList1.[m_goal_val]!==0&&dataList1.[m_goal_val]!==''&&that.tableDatas[14][4]!==''?((that.tableDatas[20][4] /dataList1.[m_goal_val])*100).toFixed(2):'/';
// })
// }).then(res=>{
// let obj1 = {};
// obj1.page = 0;
// obj1.year_s = this.year_h;
// obj1.month_s = this.month_h;
// obj1.type = 'month_s';
// that.$API.enm.enstat2.req(obj1).then((res1) => {
// if(res1.length>0){
// that.tableDatas[22][4]= this.canCompute(that.nowData[22],res1[0].clinker_val);
// that.tableDatas[23][4] = this.canCompute(that.nowData[23],res1[0].bulk_cement_val);
// that.tableDatas[24][4] = this.canCompute(that.nowData[24],res1[0].bag_cement_val);
// }
// }).then(res=>{
// this.getTongbiData();
// })});
// },
// getTongbiData(){
// let that = this;
// let params = {};
// params.page = 0;
// params.year_s = that.year_t;
// params.month_s = that.month_t;
// let m_goal_val = "goal_val_" + that.month
// params.type = 'month_s';
// this.$API.enm.enstat.req(params).then((res) => {
// if (res.length>0){
// let dataList = {};
// res.forEach(item => {
// let label = item.mgroup_name;
// dataList[label] = item;
// });
// //
// that.tableDatas[0][5] = this.canCompute(that.nowData[0],dataList..production_hour);
// that.tableDatas[1][5] = this.canCompute(that.nowData[1],dataList..production_hour);
// that.tableDatas[2][5] = this.canCompute(that.nowData[2],dataList..production_hour);
// that.tableDatas[3][5] = this.canCompute(that.nowData[3],dataList..production_hour);
// that.tableDatas[4][5] = this.canCompute(that.nowData[4],dataList..production_hour);
// //kW·h/t
// that.tableDatas[5][5] = this.canCompute(that.nowData[5],dataList..celec_consume_unit);
// that.tableDatas[6][5] = this.canCompute(that.nowData[6],dataList..coal_consume_unit);
// that.tableDatas[7][5] = this.canCompute(that.nowData[7],dataList..cen_consume_unit);
// that.tableDatas[8][5] = this.canCompute(that.nowData[8],dataList..cen_consume_unit);
// that.tableDatas[9][5] = this.canCompute(that.nowData[9],dataList..elec_consume_unit);
// that.tableDatas[10][5] = this.canCompute(that.nowData[10],dataList..elec_consume_unit);
// that.tableDatas[11][5] = this.canCompute(that.nowData[11],dataList..elec_consume_unit);
// that.tableDatas[12][5] = this.canCompute(that.nowData[12],dataList..elec_consume_unit);
// that.tableDatas[13][5] = this.canCompute(that.nowData[13], dataList..elec_consume_unit);
// //(t)
// that.tableDatas[14][5] = this.canCompute(that.nowData[14],dataList..total_production);
// that.tableDatas[16][5] = this.canCompute(that.nowData[16],dataList..total_production);
// that.tableDatas[18][5] = this.canCompute(that.nowData[18],dataList..total_production);
// that.tableDatas[20][5] = this.canCompute(that.nowData[20],dataList..total_production);
// //(/)
// that.tableDatas[25][5] = this.canCompute(that.nowData[25],dataList..production_cost_unit);
// that.tableDatas[26][5] = this.canCompute(that.nowData[26],dataList..production_cost_unit);
// that.tableDatas[27][5] = this.canCompute(that.nowData[27],dataList..production_cost_unit);
// that.tableDatas[28][5] = this.canCompute(that.nowData[28],dataList..production_cost_unit);
// that.tableDatas[29][5] = this.canCompute(that.nowData[29],dataList..production_cost_unit);
// //kW·h
// // that.tableDatas[30][5] = this.canCompute(that.nowData[30],dataList..elec_consume);
// that.tableDatas[30][5] = this.canCompute(that.nowData[30],dataList..elec_consume);
// that.tableDatas[31][5] = this.canCompute(that.nowData[31],dataList..elec_consume);
// that.tableDatas[32][5] = this.canCompute(that.nowData[32],dataList..elec_consume);
// that.tableDatas[33][5] = this.canCompute(that.nowData[33],dataList..elec_consume);
// that.tableDatas[34][5] = this.canCompute(that.nowData[34],dataList..elec_consume);
// }
// // that.tableDatas[39][4] = dataList..elec_consume;
// }).then(res=>{
// //
// let params1 = {};
// params1.page = 0;
// params1.goal_cate__code = 'total_production';
// params1.year = that.year_h;
// this.$API.mtm.goal.list.req(params1).then((res1) => {
// let dataList1 = {};//
// res1.forEach(item1 => {
// let label = item1.mgroup_name;
// dataList1[label] = item1;
// });
// that.tableDatas[15][5] = dataList1.&&dataList1.[m_goal_val]!==0&&dataList1.[m_goal_val]!==''&&that.tableDatas[14][5]!==''&&that.tableDatas[14][5]!==undefined?(that.tableDatas[14][5] /dataList1.[m_goal_val])*100:'';
// that.tableDatas[17][5] = dataList1.&&dataList1.[m_goal_val]!==0&&dataList1.[m_goal_val]!==''&&that.tableDatas[14][5]!==''&&that.tableDatas[14][5]!==undefined?(that.tableDatas[16][5] /dataList1.[m_goal_val])*100:'';
// that.tableDatas[19][5] = dataList1.&&dataList1.[m_goal_val]!==0&&dataList1.[m_goal_val]!==''&&that.tableDatas[14][5]!==''&&that.tableDatas[14][5]!==undefined?(that.tableDatas[18][5] /dataList1.[m_goal_val])*100:'';
// that.tableDatas[21][5] = dataList1.&&dataList1.[m_goal_val]!==0&&dataList1.[m_goal_val]!==''&&that.tableDatas[14][5]!==''&&that.tableDatas[14][5]!==undefined?(that.tableDatas[20][5] /dataList1.[m_goal_val])*100:'';
// })
// }).then(res=>{
// let obj1 = {};
// obj1.page = 0;
// obj1.year_s = this.year_t;
// obj1.month_s = this.month_h;
// obj1.type = 'month_s';
// that.$API.enm.enstat2.req(obj1).then((res1) => {
// if(res1.length>0){
// that.tableDatas[22][5]= this.canCompute(that.nowData[22],res1[0].clinker_val);
// that.tableDatas[23][5] = this.canCompute(that.nowData[23],res1[0].bulk_cement_val);
// that.tableDatas[24][5] = this.canCompute(that.nowData[24],res1[0].bag_cement_val);
// }
// })
// })
// },
getTableData(){
// for(let i=0;i<39;i++){
// this.tableDatas[i][3] = '';
// this.tableDatas[i][4] = '';
// }
// table item2
this.tableDatas.forEach((item,index) => {
item.length = 3;
});
this.tableHeaders = [];
this.getNowData();
},
// updateTableHeaders() {
// let that = this;
// // tableDatas >= 3
// if (this.tableDatas.length > 0) {
// let columnCount = this.tableDatas[0].length - 3; //
// this.tableHeaders = Array.from({ length: columnCount }, (_, i) => i + 1);
// } else {
// this.tableHeaders = [];
// }
// },
handlePrint() {
this.$PRINT('#myReport');
},
@ -497,4 +264,21 @@
#myReport{
overflow-y: scroll;
}
.myTable thead {
position: sticky;
top: 0; /* 固定表头在顶部 */
background-color: #008080; /* 设置表头的背景颜色 */
z-index: 1; /* 保证表头在内容之上 */
}
.myTable th {
padding: 8px;
text-align: center;
background-color: #008080; /* 设置表头的背景色 */
}
.myTable td {
padding: 8px;
text-align: center;
}
</style>