fix:全场报表生产日报表、生产月报表表格改动

This commit is contained in:
shijing 2024-12-13 17:01:53 +08:00
parent 55f99058cf
commit 9b4bdd2f96
2 changed files with 148 additions and 97 deletions

View File

@ -1,6 +1,6 @@
<!-- 全厂电量统计 -->
<template>
<div class="app-container">
<el-container>
<el-header>
<div class="left-panel">
<!-- <el-select
@ -45,38 +45,55 @@
</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>
<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">
<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="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>
<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="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>
</table>
</div>
</el-card>
</div>
</table>
</div>
</el-card>
</el-main>
</el-container>
</template>
<script>
export default {
@ -174,6 +191,8 @@
let month0 = that.month>9?that.month :'0'+that.month ;
that.search_day = that.year+'-'+month0+'-'+day;
this.getData();
let heights = document.getElementsByClassName('el-main')[0].clientHeight-30;
document.getElementById('myReport').style.height = heights+'px';
},
methods: {
// test(index){
@ -329,5 +348,11 @@
}
};
</script>
<style>
<style scoped>
.topTableDiv{
position: absolute;
}
#myReport{
overflow-y: scroll;
}
</style>

View File

@ -1,6 +1,6 @@
<!-- 全厂电量统计 -->
<template>
<div class="app-container">
<el-container>
<el-header>
<div class="left-panel">
<el-date-picker
@ -31,38 +31,56 @@
</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">生产月报</th>
<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 style="width:100px">月数据</th>
<th style="width:100px">环比增长</th>
<th 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">
<thead class="myTableHead">
<tr>
<th colspan="6">生产月报</th>
</tr>
<tr>
<th>序号</th>
<th colspan="2">项目</th>
<th >月数据</th>
<th>环比增长</th>
<th>同比增长</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">{{item[4]}}</td>
<td class="numCell">{{item[5]}}</td>
</tr>
<tr>
<th>序号</th>
<th colspan="2">项目</th>
<th >月数据</th>
<th>环比增长</th>
<th>同比增长</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">{{item[4]}}</td>
<td class="numCell">{{item[5]}}</td>
</tr>
</table>
</div>
</el-card>
</div>
</table>
</div>
</el-card>
</el-main>
</el-container>
</template>
<script>
export default {
@ -103,14 +121,14 @@
[27,'成本','月生料成本(元/吨)'],
[28,'成本','月熟料成本(元/吨)'],
[29,'成本','月水泥粉磨成本(元/吨)'],
[30,'成本','月水泥包装成本(元/吨)'],
// [30,'','(/)'],
[31,'耗电量','月电石渣耗电量kw.h'],
[32,'耗电量','月生料耗电量kw.h'],
[33,'耗电量','月熟料耗电量kw.h'],
[34,'耗电量','月水泥粉磨耗电量kw.h'],
[35,'耗电量','月水泥包装耗电量kw.h'],
[36,'耗电量','月生活区耗电量kw.h'],
[30,'耗电量','月电石渣耗电量kw.h'],
[31,'耗电量','月生料耗电量kw.h'],
[32,'耗电量','月熟料耗电量kw.h'],
[33,'耗电量','月水泥粉磨耗电量kw.h'],
[34,'耗电量','月水泥包装耗电量kw.h'],
[35,'耗电量','月生活区耗电量kw.h'],
],
year:'',
month:'',
@ -142,6 +160,8 @@
let month0 = that.month>9?that.month :'0'+that.month ;
that.search_month = that.year+'-'+month0;
this.getNowData();
let heights = document.getElementsByClassName('el-main')[0].clientHeight-30;
document.getElementById('myReport').style.height = heights+'px';
},
methods: {
monthChange(e){
@ -220,20 +240,20 @@
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[31] = dataList.原料磨.elec_consume;
that.tableDatas[31][3] = dataList.原料磨.elec_consume;
that.nowData[32] = dataList.回转窑.elec_consume;
that.tableDatas[32][3] = dataList.回转窑.elec_consume;
// 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[33] = dataList.水泥磨.elec_consume;
that.tableDatas[33][3] = dataList.水泥磨.elec_consume;
that.nowData[34] = dataList.水泥包装.elec_consume;
that.tableDatas[34][3] = dataList.水泥包装.elec_consume;
that.nowData[35] = dataList.生活区.elec_consume;
that.tableDatas[35][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 = {};
@ -333,12 +353,12 @@
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[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[35][4] = this.canCompute(that.nowData[35],dataList.生活区.elec_consume);
// 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=>{
//
@ -416,12 +436,12 @@
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[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[35][5] = this.canCompute(that.nowData[35],dataList.生活区.elec_consume);
// 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=>{
@ -474,5 +494,11 @@
}
};
</script>
<style>
<style scoped>
.topTableDiv{
position: absolute;
}
#myReport{
overflow-y: scroll;
}
</style>