fix:coding#674页面
This commit is contained in:
parent
3049f491a8
commit
cde58ee08f
|
@ -1078,6 +1078,16 @@ const routes = [
|
|||
perms: ["enm_report"],
|
||||
},
|
||||
children: [
|
||||
{
|
||||
name: "reportFactory",
|
||||
path: "/enm_report/reportFactory",
|
||||
meta: {
|
||||
title: "厂级单耗",
|
||||
// icon: "el-icon-grid",
|
||||
perms: ["enm_reportFactory"],
|
||||
},
|
||||
component: "enm_report/reportFactory",
|
||||
},
|
||||
{
|
||||
name: "costing",
|
||||
path: "/enm_report/costing",
|
||||
|
|
|
@ -0,0 +1,191 @@
|
|||
<!-- 厂级报表 -->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-select
|
||||
v-model="query.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="query.searchDay"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
format="YYYY-MM-DD"
|
||||
placeholder="查询日期"
|
||||
v-if="query.type==0"
|
||||
class="headerSearch"
|
||||
/>
|
||||
<el-date-picker
|
||||
v-model="query.searchMonth"
|
||||
type="month"
|
||||
value-format="YYYY-MM"
|
||||
format="YYYY-MM"
|
||||
placeholder="查询月份"
|
||||
v-if="query.type==1"
|
||||
class="headerSearch"
|
||||
/>
|
||||
<el-date-picker
|
||||
v-model="query.searchYear"
|
||||
type="year"
|
||||
value-format="YYYY"
|
||||
format="YYYY"
|
||||
placeholder="查询年份"
|
||||
v-if="query.type==2"
|
||||
class="headerSearch"
|
||||
/>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="getTableData"
|
||||
></el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="exportExcel()"
|
||||
:loading = "exportLoading"
|
||||
v-auth="'export_excel'"
|
||||
>导出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="myTable" class="myTable">
|
||||
<thead class="myTableHead">
|
||||
<tr>
|
||||
<th colspan="9">绿色建材生产质量消耗报表</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th v-for="item in headers" :key="item">{{item}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<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>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
query:{
|
||||
type:0,
|
||||
year:'',
|
||||
month:'',
|
||||
yearStart:'',
|
||||
},
|
||||
currentDay:'',
|
||||
tableName:'绿色建材生产质量消耗日报表',
|
||||
options:[
|
||||
{id:0,name:'日统计'},
|
||||
{id:1,name:'月统计'},
|
||||
{id:2,name:'年统计'},
|
||||
],
|
||||
headers:['','时间','电石渣','原料磨','生料工段','煤磨','熟料工段','水泥粉磨','水泥包装'],
|
||||
tableDatas:[
|
||||
['产量(t)'],
|
||||
['台产(t/h)'],
|
||||
['质量'],
|
||||
['煤耗(t)'],
|
||||
['电耗(kw.h/t)'],
|
||||
['柴油消耗(t)'],
|
||||
['绿化水耗(m³)'],
|
||||
['生活水耗(m³)'],
|
||||
['工业水耗(m³)'],
|
||||
['原料压缩空气流量(m³/h)'],
|
||||
['烧成压缩空气流量(m³/h)'],
|
||||
['水泥压缩空气流量(m³/h)'],
|
||||
['产生蒸汽量(t)'],
|
||||
['成本(元/t)'],
|
||||
['生产动态']
|
||||
],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
var myDate = new Date();
|
||||
this.query.searchDay =this.currentDay = this.$TOOL.dateFormat2(myDate);
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
typeCange(value){
|
||||
if(value==1){
|
||||
this.tableName = '绿色建材生产质量消耗日报表'
|
||||
}else if(value==1){
|
||||
this.tableName = '绿色建材生产质量消耗月报表'
|
||||
}else{
|
||||
this.tableName = '绿色建材生产质量消耗年报表'
|
||||
}
|
||||
},
|
||||
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(){
|
||||
let that = this;
|
||||
let params = {};
|
||||
let arr = [],type='',year_s = 2024,month_s = 1,day_s = 1;
|
||||
if(that.query.type==0){//日
|
||||
params.type='day_s';
|
||||
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';
|
||||
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';
|
||||
params.year_s = Number(that.query.searchYear);
|
||||
}
|
||||
//接口请求数据
|
||||
},
|
||||
|
||||
getTableData(){
|
||||
this.getData();
|
||||
},
|
||||
handlePrint() {
|
||||
this.$PRINT('#myReport');
|
||||
},
|
||||
exportExcel() {
|
||||
this.exportLoading = true;
|
||||
this.$XLSX('#myTable', this.tableName)
|
||||
this.exportLoading = false;
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
Loading…
Reference in New Issue