fixd:提交8.10问题修改(还差最后一条)
This commit is contained in:
parent
ce43a1165f
commit
9c6fa00272
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<link rel="icon" href="<%= BASE_URL %>enm.ico">
|
||||
<title><%= VUE_APP_TITLE %></title>
|
||||
<!-- <script src="./jsmap/jsmap.js"> </script> -->
|
||||
<link type="text/css" href="./jsmap/jsmap.css" rel="stylesheet"/>
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
<div id="app" class="aminui">
|
||||
<div class="app-loading">
|
||||
<div class="app-loading__logo">
|
||||
<img src="img/bbmg.jpg"/>
|
||||
<!-- <img src="img/bbmg.jpg"/> -->
|
||||
</div>
|
||||
<div class="app-loading__loader"></div>
|
||||
<div class="app-loading__title"><%= VUE_APP_TITLE %></div>
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@
|
|||
color:#ffffff;
|
||||
}
|
||||
.myTable th{
|
||||
width: 80px;
|
||||
height: 40px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1107,7 +1107,7 @@ const routes = [
|
|||
"path": "/base",
|
||||
"meta": {
|
||||
"title": "基础配置",
|
||||
"icon": "el-icon-question-filled",
|
||||
"icon": "el-icon-management",
|
||||
"type": "menu",
|
||||
"perms": ["bi"]
|
||||
},
|
||||
|
|
@ -1160,7 +1160,7 @@ const routes = [
|
|||
"path": "/month",
|
||||
"meta": {
|
||||
"title": "每月配置",
|
||||
"icon": "el-icon-question-filled",
|
||||
"icon": "el-icon-checked",
|
||||
"type": "menu",
|
||||
"perms": ["bi"]
|
||||
},
|
||||
|
|
@ -1202,7 +1202,7 @@ const routes = [
|
|||
"path": "/energy",
|
||||
"meta": {
|
||||
"title": "全厂能源",
|
||||
"icon": "el-icon-question-filled",
|
||||
"icon": "el-icon-share",
|
||||
"type": "menu",
|
||||
"perms": ["bi"]
|
||||
},
|
||||
|
|
@ -1245,7 +1245,7 @@ const routes = [
|
|||
"path": "/rforms",
|
||||
"meta": {
|
||||
"title": "全厂报表",
|
||||
"icon": "el-icon-question-filled",
|
||||
"icon": "el-icon-histogram",
|
||||
"type": "menu",
|
||||
"perms": ["bi"]
|
||||
},
|
||||
|
|
@ -1274,22 +1274,22 @@ const routes = [
|
|||
"name": "reportAll",
|
||||
"path": "/ungrouped/report",
|
||||
"meta": {
|
||||
"title": "全厂报表",
|
||||
"title": "生产报表",
|
||||
"icon": "el-icon-grid",
|
||||
"perms": ["dataset"]
|
||||
},
|
||||
"component": "ungrouped/report"
|
||||
}
|
||||
,{
|
||||
"name": "echart",
|
||||
"path": "/ungrouped/echart",
|
||||
"meta": {
|
||||
"title": "图表",
|
||||
"icon": "el-icon-grid",
|
||||
"perms": ["dataset"]
|
||||
},
|
||||
"component": "ungrouped/echart"
|
||||
}
|
||||
// ,{
|
||||
// "name": "echart",
|
||||
// "path": "/ungrouped/echart",
|
||||
// "meta": {
|
||||
// "title": "图表",
|
||||
// "icon": "el-icon-grid",
|
||||
// "perms": ["dataset"]
|
||||
// },
|
||||
// "component": "ungrouped/echart"
|
||||
// }
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -141,6 +141,7 @@
|
|||
<save-dialog
|
||||
v-if="dialog.save"
|
||||
ref="saveDialog"
|
||||
:deptId ="deptId"
|
||||
@success="handleSaveSuccess"
|
||||
@closed="dialog.save = false"
|
||||
></save-dialog>
|
||||
|
|
@ -175,6 +176,7 @@
|
|||
query: {
|
||||
mgroup:'3347217512021835776',
|
||||
},
|
||||
deptId :'3347207082608115712',
|
||||
query2: {},
|
||||
dialog: {
|
||||
save: false,
|
||||
|
|
|
|||
|
|
@ -392,7 +392,8 @@ const colors =['#647bfe','#8698fe','#a9b6fe','#91CC75','#EE6666'];
|
|||
mounted() {
|
||||
function precen(a,b){
|
||||
if(b!==0&&b!==null&&a!==null){
|
||||
return a/b
|
||||
let precen = (a/b).toFixed(2)
|
||||
return precen*100+'%'
|
||||
}else{
|
||||
return '/'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -199,8 +199,8 @@
|
|||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
<style scoped>
|
||||
.printContainer{
|
||||
width: 1075px;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -48,15 +48,16 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(item) in tableDatas" :key="item">
|
||||
<td class="numCell">{{item.month}}</td>
|
||||
<td class="numCell">{{item.value1}}</td>
|
||||
<td class="numCell">{{item.value2}}</td>
|
||||
<td class="numCell">{{item.value3}}</td>
|
||||
<td class="numCell">{{item.value4}}</td>
|
||||
<td class="numCell">{{item.value5}}</td>
|
||||
<td class="numCell">{{item.value6}}</td>
|
||||
<td class="numCell">{{item.value7}}</td>
|
||||
<tr v-for="item in tableDatas" :key="item">
|
||||
<td v-for="(item1,ind) in item" :key="ind" class="numCell">
|
||||
<div :class="bindClass(item1,ind)">
|
||||
<span v-if="item1>0&&ind==3">↑</span>
|
||||
<span v-if="item1<0&&ind==3">↓</span>
|
||||
<span v-if="item1<0&&ind==5">▲</span>
|
||||
<span v-if="item1<0&&ind==5">▼</span>
|
||||
{{item1}}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
@ -76,20 +77,11 @@
|
|||
return {
|
||||
chartShow: false,
|
||||
myOption: null,
|
||||
timeStamp:0,
|
||||
listQuery:{
|
||||
belong_dept:'',
|
||||
task2__year:'',
|
||||
page:0
|
||||
},
|
||||
query:{
|
||||
time:''
|
||||
mgroup:'3347217512021835776',
|
||||
},
|
||||
tableDatas:[
|
||||
{month:'2023-05',value1:'1203',value2:'1200',value3:'3',value4:'1150',value5:'50',value6:'0.4',value7:'0.4'},
|
||||
{month:'2023-06',value1:'1203',value2:'1200',value3:'3',value4:'1150',value5:'50',value6:'0.4',value7:'0.4'},
|
||||
{month:'2023-07',value1:'1203',value2:'1200',value3:'3',value4:'1150',value5:'50',value6:'0.4',value7:'0.4'},
|
||||
],
|
||||
monthGoal:[],
|
||||
tableDatas:[],
|
||||
modelValue:true,
|
||||
type:'hours',
|
||||
title:'title',
|
||||
|
|
@ -100,9 +92,153 @@
|
|||
};
|
||||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
var myDate = new Date();
|
||||
let year = myDate.getFullYear();
|
||||
that.query.year_s = year;
|
||||
//月目标
|
||||
let paramsGoal = {};
|
||||
paramsGoal.page=0;
|
||||
paramsGoal.mgroup=that.query.mgroup;
|
||||
that.$API.mtm.goal.list.req(paramsGoal).then((ress) => {
|
||||
if(ress.length>0){
|
||||
let monthGoal = [];
|
||||
ress.forEach(goal=>{
|
||||
if(goal.goal_cate_name=='单位产品分布电耗(KW·h/t)'){
|
||||
monthGoal[0]=goal.goal_val;
|
||||
monthGoal[1]=goal.goal_val_2;
|
||||
monthGoal[2]=goal.goal_val_3;
|
||||
monthGoal[3]=goal.goal_val_4;
|
||||
monthGoal[4]=goal.goal_val_5;
|
||||
monthGoal[5]=goal.goal_val_6;
|
||||
monthGoal[6]=goal.goal_val_7;
|
||||
monthGoal[7]=goal.goal_val_8;
|
||||
monthGoal[8]=goal.goal_val_9;
|
||||
monthGoal[9]=goal.goal_val_10;
|
||||
monthGoal[10]=goal.goal_val_11;
|
||||
monthGoal[11]=goal.goal_val_12;
|
||||
monthGoal[12]=goal.goal_val_12;
|
||||
that.monthGoal = monthGoal;
|
||||
}
|
||||
})
|
||||
this.getData();
|
||||
}else{
|
||||
this.getData();
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 动态绑定Class
|
||||
bindClass(item,index){
|
||||
let classInfo = { redColor: false, greenColor: false }
|
||||
if(index==3||index==5){
|
||||
if( typeof(item)=='number'){
|
||||
if(item>0){
|
||||
classInfo.greenColor = true;
|
||||
classInfo.redColor = false;
|
||||
}else if(item<0){
|
||||
classInfo.redColor = true;
|
||||
classInfo.greenColor = false
|
||||
}
|
||||
}
|
||||
}
|
||||
return classInfo
|
||||
},
|
||||
getData(){
|
||||
let that = this;
|
||||
let query0={};
|
||||
query0.page = 0;
|
||||
query0.type='month_s';
|
||||
query0.year_s = that.query.year_s-1;
|
||||
query0.mgroup=that.query.mgroup;
|
||||
let wrapArr = [],wrapArr0 = [] ,wrapArrs = [];
|
||||
this.$API.enm.enstat.req(query0).then((res0) => {
|
||||
let data0 = res0;
|
||||
if(data0.length>0){
|
||||
data0.forEach(item0 => {
|
||||
//先按月份排序,再按班组排序
|
||||
let ind0 = item0.month_s;
|
||||
wrapArr0[ind0] = item0;
|
||||
});
|
||||
}
|
||||
let query={};
|
||||
query.page = 0;
|
||||
query.type='month_s';
|
||||
query.year_s = that.query.year_s;
|
||||
query.mgroup=that.query.mgroup;
|
||||
that.$API.enm.enstat.req(query).then((res) => {
|
||||
let data = res;
|
||||
if(data.length>0){
|
||||
data.forEach(item => {
|
||||
//先按月份排序,再按班组排序
|
||||
let ind = item.month_s;
|
||||
let arr = [];
|
||||
let time = ''+item.year_s+'.'+item.month_s;
|
||||
arr.push(time);
|
||||
arr.push(item.elec_consume_unit);//当期值(KW·h/t)
|
||||
arr[2] = that.monthGoal[ind]!==undefined?that.monthGoal[ind]:'/';
|
||||
wrapArr[ind] = arr;
|
||||
});
|
||||
wrapArr.forEach((item,index)=>{
|
||||
let arrs = [];
|
||||
arrs[0]=item[0];
|
||||
arrs[1]=item[1];
|
||||
arrs[2]=item[2];
|
||||
//目标值(KW·h/t)//需要接口获取
|
||||
//当期与目标差值(KW·h/t)
|
||||
let diff = 0;
|
||||
if(item[2]!=='/'){
|
||||
diff = item[1]-item[2];
|
||||
}else{
|
||||
diff = '/';
|
||||
}
|
||||
arrs[3]=diff;
|
||||
//环期值(KW·h/t)上个月的值
|
||||
let lastNum = 0;
|
||||
if(index>1){
|
||||
let num = index-1;
|
||||
if(wrapArr[num]&&wrapArr[num].elec_consume_unit){
|
||||
lastNum = wrapArr[num].elec_consume_unit;
|
||||
}else{
|
||||
lastNum='/'
|
||||
}
|
||||
}else{
|
||||
lastNum = wrapArr0[12]?wrapArr0[12].elec_consume_unit:'/';
|
||||
}
|
||||
arrs[4]=lastNum;
|
||||
//当期与环期差值(KW·h/t)
|
||||
let lastDiff = 0;
|
||||
|
||||
if(arrs[1]!=='/'&&arrs[4]!=='/'){
|
||||
lastDiff =arrs[1]- arrs[4];
|
||||
}else{
|
||||
lastDiff = '/';
|
||||
}
|
||||
arrs[5]=lastDiff;
|
||||
//环比增长率(%)
|
||||
let lastRate = 0;
|
||||
if(lastDiff=='/'&&lastNum!=='/'&&lastNum!==0){
|
||||
lastRate = (lastDiff/lastNum)*100;
|
||||
}else{
|
||||
lastRate = '/'
|
||||
}
|
||||
arrs[6]=lastRate;
|
||||
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
||||
let sameRate =0;
|
||||
if(wrapArr0[index]&&wrapArr0[index].elec_consume_unit){
|
||||
sameRate =((arrs[1]- wrapArr0[index].elec_consume_unit)/wrapArr0[index].elec_consume_unit)*100
|
||||
}else{
|
||||
sameRate='/';
|
||||
}
|
||||
arrs[7]=sameRate;
|
||||
wrapArrs.push(arrs);
|
||||
})
|
||||
that.tableDatas = wrapArrs;
|
||||
}else{
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
itemClick(type,item){
|
||||
this.type=type;
|
||||
this.asynDialog = true;
|
||||
|
|
@ -133,4 +269,12 @@
|
|||
.printContainer{
|
||||
width: 1075px;
|
||||
}
|
||||
.redColor{
|
||||
font-weight: bold;
|
||||
color: #ff0000;
|
||||
}
|
||||
.greenColor{
|
||||
font-weight: bold;
|
||||
color: #008000;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -159,6 +159,7 @@
|
|||
<save-dialog
|
||||
v-if="dialog.save"
|
||||
ref="saveDialog"
|
||||
:deptId ="deptId"
|
||||
@success="handleSaveSuccess"
|
||||
@closed="dialog.save = false"
|
||||
></save-dialog>
|
||||
|
|
@ -193,6 +194,8 @@ import otherDialog from "./../enm_rm/other_form.vue";
|
|||
query: {
|
||||
mgroup:'3347217246321065984',
|
||||
},
|
||||
|
||||
deptId :'3347207082608115712',
|
||||
query2: {},
|
||||
dialog: {
|
||||
save: false,
|
||||
|
|
|
|||
|
|
@ -465,7 +465,8 @@ const colors =['#647bfe','#8698fe','#a9b6fe','#cbd3fe','#91CC75','#EE6666'];
|
|||
mounted() {
|
||||
function precen(a,b){
|
||||
if(b!==0&&b!==null&&a!==null){
|
||||
return a/b
|
||||
let precen = (a/b).toFixed(2)
|
||||
return precen*100+'%'
|
||||
}else{
|
||||
return '/'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@
|
|||
<th>运转率</th>
|
||||
<th>成本</th>
|
||||
<th colspan="8">质量</th>
|
||||
<th colspan="19">产品单位能耗</th>
|
||||
<th colspan="17">产品单位能耗</th>
|
||||
<th rowspan="2">得分</th>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
@ -245,8 +245,8 @@
|
|||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
<style scoped>
|
||||
.printContainer{
|
||||
/* width: 1075px; */
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
<div class="app-container">
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-date-picker
|
||||
<!-- <el-date-picker
|
||||
v-model="monthrange"
|
||||
type="monthrange"
|
||||
range-separator="至"
|
||||
|
|
@ -15,7 +15,20 @@
|
|||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="handleQuery"
|
||||
></el-button>
|
||||
></el-button> -->
|
||||
<el-select
|
||||
v-model="query.type"
|
||||
placeholder="查询类型"
|
||||
clearable
|
||||
@change="typeCange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="exportExcel()"
|
||||
|
|
@ -31,7 +44,7 @@
|
|||
</el-header>
|
||||
<el-card style="margin-top:5px">
|
||||
<div ref="print" id="myReport" class="printContainer">
|
||||
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable" class="myTable">
|
||||
<table border="1" width="1000" cellspacing="0" :key="1" id="myTable" class="myTable" v-if="query.type==1">
|
||||
<thead class="myTableHead">
|
||||
<tr>
|
||||
<th colspan="8">车间单位产品电耗月度分析表</th>
|
||||
|
|
@ -48,19 +61,20 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(item) in tableDatas" :key="item">
|
||||
<td class="numCell">{{item.month}}</td>
|
||||
<td class="numCell">{{item.value1}}</td>
|
||||
<td class="numCell">{{item.value2}}</td>
|
||||
<td class="numCell">{{item.value3}}</td>
|
||||
<td class="numCell">{{item.value4}}</td>
|
||||
<td class="numCell">{{item.value5}}</td>
|
||||
<td class="numCell">{{item.value6}}</td>
|
||||
<td class="numCell">{{item.value7}}</td>
|
||||
<tr v-for="item in tableDatas" :key="item">
|
||||
<td v-for="(item1,ind) in item" :key="ind" class="numCell">
|
||||
<div :class="bindClass(item1,ind)">
|
||||
<span v-if="item1>0&&ind==3">↑</span>
|
||||
<span v-if="item1<0&&ind==3">↓</span>
|
||||
<span v-if="item1<0&&ind==5">▲</span>
|
||||
<span v-if="item1<0&&ind==5">▼</span>
|
||||
{{item1}}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable1" class="myTable">
|
||||
<table border="1" width="1000" cellspacing="0" :key="2" id="myTable1" class="myTable" v-else-if="query.type==2">
|
||||
<thead class="myTableHead">
|
||||
<tr>
|
||||
<th colspan="9">车间单位产品综合电耗月度分析表</th>
|
||||
|
|
@ -81,20 +95,18 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(item) in tableDatas" :key="item">
|
||||
<td class="numCell">{{item.month}}</td>
|
||||
<td class="numCell">{{item.value1}}</td>
|
||||
<td class="numCell">{{item.value2}}</td>
|
||||
<td class="numCell">{{item.value3}}</td>
|
||||
<td class="numCell">{{item.value4}}</td>
|
||||
<td class="numCell">{{item.value5}}</td>
|
||||
<td class="numCell">{{item.value6}}</td>
|
||||
<td class="numCell">{{item.value7}}</td>
|
||||
<td class="numCell">{{item.value7}}</td>
|
||||
<tr v-for="item in tableDatas2" :key="item">
|
||||
<td v-for="(item1,ind) in item" :key="ind" class="numCell">
|
||||
<div :class="bindClass(item1,ind)">
|
||||
<span v-if="item1<0&&ind==6">▲</span>
|
||||
<span v-if="item1<0&&ind==6">▼</span>
|
||||
{{item1}}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable1" class="myTable">
|
||||
<table border="1" width="1000" cellspacing="0" :key="3" id="myTable1" class="myTable" v-else-if="query.type==3">
|
||||
<thead class="myTableHead">
|
||||
<tr>
|
||||
<th colspan="9">车间单位产品标煤耗月度分析表</th>
|
||||
|
|
@ -115,20 +127,18 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(item) in tableDatas" :key="item">
|
||||
<td class="numCell">{{item.month}}</td>
|
||||
<td class="numCell">{{item.value1}}</td>
|
||||
<td class="numCell">{{item.value2}}</td>
|
||||
<td class="numCell">{{item.value3}}</td>
|
||||
<td class="numCell">{{item.value4}}</td>
|
||||
<td class="numCell">{{item.value5}}</td>
|
||||
<td class="numCell">{{item.value6}}</td>
|
||||
<td class="numCell">{{item.value7}}</td>
|
||||
<td class="numCell">{{item.value7}}</td>
|
||||
<tr v-for="item in tableDatas3" :key="item">
|
||||
<td v-for="(item1,ind) in item" :key="ind" class="numCell">
|
||||
<div :class="bindClass(item1,ind)">
|
||||
<span v-if="item1<0&&ind==6">▲</span>
|
||||
<span v-if="item1<0&&ind==6">▼</span>
|
||||
{{item1}}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable1" class="myTable">
|
||||
<table border="1" width="1000" cellspacing="0" :key="4" id="myTable1" class="myTable" v-else-if="query.type==4">
|
||||
<thead class="myTableHead">
|
||||
<tr>
|
||||
<th colspan="9">车间单位产品综合能耗月度分析表</th>
|
||||
|
|
@ -149,16 +159,14 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(item) in tableDatas" :key="item">
|
||||
<td class="numCell">{{item.month}}</td>
|
||||
<td class="numCell">{{item.value1}}</td>
|
||||
<td class="numCell">{{item.value2}}</td>
|
||||
<td class="numCell">{{item.value3}}</td>
|
||||
<td class="numCell">{{item.value4}}</td>
|
||||
<td class="numCell">{{item.value5}}</td>
|
||||
<td class="numCell">{{item.value6}}</td>
|
||||
<td class="numCell">{{item.value7}}</td>
|
||||
<td class="numCell">{{item.value7}}</td>
|
||||
<tr v-for="item in tableDatas4" :key="item">
|
||||
<td v-for="(item1,ind) in item" :key="ind" class="numCell">
|
||||
<div :class="bindClass(item1,ind)">
|
||||
<span v-if="item1<0&&ind==6">▲</span>
|
||||
<span v-if="item1<0&&ind==6">▼</span>
|
||||
{{item1}}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
@ -178,20 +186,27 @@
|
|||
return {
|
||||
chartShow: false,
|
||||
myOption: null,
|
||||
timeStamp:0,
|
||||
listQuery:{
|
||||
belong_dept:'',
|
||||
task2__year:'',
|
||||
page:0
|
||||
query: {
|
||||
type:1,
|
||||
mgroup:'3347217246321065984',
|
||||
},
|
||||
query:{
|
||||
time:''
|
||||
},
|
||||
tableDatas:[
|
||||
{month:'2023-05',value1:'1203',value2:'1200',value3:'3',value4:'1150',value5:'50',value6:'0.4',value7:'0.4'},
|
||||
{month:'2023-06',value1:'1203',value2:'1200',value3:'3',value4:'1150',value5:'50',value6:'0.4',value7:'0.4'},
|
||||
{month:'2023-07',value1:'1203',value2:'1200',value3:'3',value4:'1150',value5:'50',value6:'0.4',value7:'0.4'},
|
||||
],
|
||||
monthGoal:[],
|
||||
monthGoal2:[],
|
||||
monthGoal3:[],
|
||||
monthGoal4:[],
|
||||
tableDatas:[],
|
||||
tableDatas2:[],
|
||||
tableDatas3:[],
|
||||
tableDatas4:[],
|
||||
options:[{
|
||||
name:'电耗',id:1,
|
||||
},{
|
||||
name:'综合电耗',id:2,
|
||||
},{
|
||||
name:'标煤耗',id:3,
|
||||
},{
|
||||
name:'综合能耗',id:4,
|
||||
}],
|
||||
modelValue:true,
|
||||
type:'hours',
|
||||
title:'title',
|
||||
|
|
@ -202,9 +217,497 @@
|
|||
};
|
||||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
var myDate = new Date();
|
||||
let year = myDate.getFullYear();
|
||||
that.query.year_s = year;
|
||||
//月目标
|
||||
let paramsGoal = {};
|
||||
paramsGoal.page=0;
|
||||
paramsGoal.mgroup=that.query.mgroup;
|
||||
that.$API.mtm.goal.list.req(paramsGoal).then((ress) => {
|
||||
if(ress.length>0){
|
||||
let monthGoal = [],monthGoal2 = [],monthGoal3 = [],monthGoal4 = [];
|
||||
ress.forEach(goal=>{
|
||||
if(goal.goal_cate_name=='单位产品分布电耗(KW·h/t)'){
|
||||
monthGoal[0]=goal.goal_val;
|
||||
monthGoal[1]=goal.goal_val_2;
|
||||
monthGoal[2]=goal.goal_val_3;
|
||||
monthGoal[3]=goal.goal_val_4;
|
||||
monthGoal[4]=goal.goal_val_5;
|
||||
monthGoal[5]=goal.goal_val_6;
|
||||
monthGoal[6]=goal.goal_val_7;
|
||||
monthGoal[7]=goal.goal_val_8;
|
||||
monthGoal[8]=goal.goal_val_9;
|
||||
monthGoal[9]=goal.goal_val_10;
|
||||
monthGoal[10]=goal.goal_val_11;
|
||||
monthGoal[11]=goal.goal_val_12;
|
||||
monthGoal[12]=goal.goal_val_12;
|
||||
that.monthGoal = monthGoal;
|
||||
}
|
||||
if(goal.goal_cate_name=='单位产品综合电耗(KW·h/t)'){
|
||||
monthGoal2[0]=goal.goal_val;
|
||||
monthGoal2[1]=goal.goal_val_2;
|
||||
monthGoal2[2]=goal.goal_val_3;
|
||||
monthGoal2[3]=goal.goal_val_4;
|
||||
monthGoal2[4]=goal.goal_val_5;
|
||||
monthGoal2[5]=goal.goal_val_6;
|
||||
monthGoal2[6]=goal.goal_val_7;
|
||||
monthGoal2[7]=goal.goal_val_8;
|
||||
monthGoal2[8]=goal.goal_val_9;
|
||||
monthGoal2[9]=goal.goal_val_10;
|
||||
monthGoal2[10]=goal.goal_val_11;
|
||||
monthGoal2[11]=goal.goal_val_12;
|
||||
monthGoal2[12]=goal.goal_val_12;
|
||||
that.monthGoal2 = monthGoal2;
|
||||
}
|
||||
if(goal.goal_cate_name=='单位产品标煤耗(kgce/t)'){
|
||||
monthGoal3[0]=goal.goal_val;
|
||||
monthGoal3[1]=goal.goal_val_2;
|
||||
monthGoal3[2]=goal.goal_val_3;
|
||||
monthGoal3[3]=goal.goal_val_4;
|
||||
monthGoal3[4]=goal.goal_val_5;
|
||||
monthGoal3[5]=goal.goal_val_6;
|
||||
monthGoal3[6]=goal.goal_val_7;
|
||||
monthGoal3[7]=goal.goal_val_8;
|
||||
monthGoal3[8]=goal.goal_val_9;
|
||||
monthGoal3[9]=goal.goal_val_10;
|
||||
monthGoal3[10]=goal.goal_val_11;
|
||||
monthGoal3[11]=goal.goal_val_12;
|
||||
monthGoal3[12]=goal.goal_val_12;
|
||||
that.monthGoal3 = monthGoal3;
|
||||
}
|
||||
if(goal.goal_cate_name=='单位产品综合能耗(kgce/t)'){
|
||||
monthGoal4[0]=goal.goal_val;
|
||||
monthGoal4[1]=goal.goal_val_2;
|
||||
monthGoal4[2]=goal.goal_val_3;
|
||||
monthGoal4[3]=goal.goal_val_4;
|
||||
monthGoal4[4]=goal.goal_val_5;
|
||||
monthGoal4[5]=goal.goal_val_6;
|
||||
monthGoal4[6]=goal.goal_val_7;
|
||||
monthGoal4[7]=goal.goal_val_8;
|
||||
monthGoal4[8]=goal.goal_val_9;
|
||||
monthGoal4[9]=goal.goal_val_10;
|
||||
monthGoal4[10]=goal.goal_val_11;
|
||||
monthGoal4[11]=goal.goal_val_12;
|
||||
monthGoal4[12]=goal.goal_val_12;
|
||||
that.monthGoal4 = monthGoal4;
|
||||
}
|
||||
})
|
||||
this.getData();
|
||||
}else{
|
||||
this.getData();
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 动态绑定Class
|
||||
bindClass(item,index){
|
||||
let classInfo = { redColor: false, greenColor: false }
|
||||
if(index==3||index==5){
|
||||
if( typeof(item)=='number'){
|
||||
if(item>0){
|
||||
classInfo.greenColor = true;
|
||||
classInfo.redColor = false;
|
||||
}else if(item<0){
|
||||
classInfo.redColor = true;
|
||||
classInfo.greenColor = false
|
||||
}
|
||||
}
|
||||
}
|
||||
return classInfo
|
||||
},
|
||||
getData(){
|
||||
let that = this;
|
||||
let query0={};
|
||||
query0.page = 0;
|
||||
query0.type='month_s';
|
||||
query0.year_s = that.query.year_s-1;
|
||||
query0.mgroup=that.query.mgroup;
|
||||
let wrapArr = [],wrapArr0 = [] ,wrapArrs = [],wrapArrs2=[],wrapArrs3=[],wrapArrs4=[];
|
||||
this.$API.enm.enstat.req(query0).then((res0) => {
|
||||
let data0 = res0;
|
||||
if(data0.length>0){
|
||||
data0.forEach(item0 => {
|
||||
//先按月份排序,再按班组排序
|
||||
let ind0 = item0.month_s;
|
||||
wrapArr0[ind0] = item0;
|
||||
});
|
||||
}
|
||||
let query={};
|
||||
query.page = 0;
|
||||
query.type='month_s';
|
||||
query.year_s = that.query.year_s;
|
||||
query.mgroup=that.query.mgroup;
|
||||
that.$API.enm.enstat.req(query).then((res) => {
|
||||
let data = res;
|
||||
if(data.length>0){
|
||||
data.forEach(item => {
|
||||
//先按月份排序,再按班组排序
|
||||
let ind = item.month_s;
|
||||
let arr = item;
|
||||
let time = ''+item.year_s+'.'+item.month_s;
|
||||
arr.time=time;
|
||||
wrapArr[ind] = arr;
|
||||
});
|
||||
//type==1
|
||||
wrapArr.forEach((item,index)=>{
|
||||
let ind = item.month_s;
|
||||
let arrs = [],arrs2 = [],arrs3 = [],arrs4 = [];
|
||||
arrs[0]=item.time;
|
||||
arrs2[0]=item.time;
|
||||
arrs3[0]=item.time;
|
||||
arrs4[0]=item.time;
|
||||
arrs[1]=item.elec_consume_unit;
|
||||
arrs[2]=that.monthGoal[ind]!==undefined?that.monthGoal[ind]:'/';
|
||||
//当期与目标差值(KW·h/t)
|
||||
let diff = 0;
|
||||
if(arrs[2]!=='/'){
|
||||
diff = arrs[1]-arrs[2];
|
||||
}else{
|
||||
diff = '/';
|
||||
}
|
||||
arrs[3]=diff;
|
||||
//环期值(KW·h/t)上个月的值
|
||||
let lastNum = 0;
|
||||
if(index>1){
|
||||
let num = index-1;
|
||||
if(wrapArr[num]&&wrapArr[num].elec_consume_unit){
|
||||
lastNum = wrapArr[num].elec_consume_unit;
|
||||
}else{
|
||||
lastNum='/'
|
||||
}
|
||||
}else{
|
||||
lastNum = wrapArr0[12]?wrapArr0[12].elec_consume_unit:'/';
|
||||
}
|
||||
arrs[4]=lastNum;
|
||||
//当期与环期差值(KW·h/t)
|
||||
let lastDiff = 0;
|
||||
|
||||
if(arrs[1]!=='/'&&arrs[4]!=='/'){
|
||||
lastDiff =arrs[1]- arrs[4];
|
||||
}else{
|
||||
lastDiff = '/';
|
||||
}
|
||||
arrs[5]=lastDiff;
|
||||
//环比增长率(%)
|
||||
let lastRate = 0;
|
||||
if(lastDiff=='/'&&lastNum!=='/'&&lastNum!==0){
|
||||
lastRate = (lastDiff/lastNum)*100;
|
||||
}else{
|
||||
lastRate = '/'
|
||||
}
|
||||
arrs[6]=lastRate;
|
||||
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
||||
let sameRate =0;
|
||||
if(wrapArr0[index]&&wrapArr0[index].elec_consume_unit){
|
||||
sameRate =((arrs[1]- wrapArr0[index].elec_consume_unit)/wrapArr0[index].elec_consume_unit)*100
|
||||
}else{
|
||||
sameRate='/';
|
||||
}
|
||||
arrs[7]=sameRate;
|
||||
wrapArrs.push(arrs);
|
||||
arrs2[1]=item.celec_consume_unit;
|
||||
arrs2[2]=that.monthGoal2[ind]!==undefined?that.monthGoal2[ind]:'/';
|
||||
arrs2[3]=48;
|
||||
arrs2[4]=57;
|
||||
arrs2[5]=61;
|
||||
//当期与环期差值(KW·h/t)
|
||||
let lastNum2 = 0,lastDiff2 = 0;
|
||||
if(index>1){
|
||||
let num = index-1;
|
||||
if(wrapArr[num]&&wrapArr[num].celec_consume_unit){
|
||||
lastNum2 = wrapArr[num].celec_consume_unit;
|
||||
}else{
|
||||
lastNum2='/'
|
||||
}
|
||||
}else{
|
||||
lastNum2 = wrapArr0[12]?wrapArr0[12].celec_consume_unit:'/';
|
||||
}
|
||||
if(arrs2[1]!=='/'&&lastNum2!=='/'){
|
||||
lastDiff2 =arrs2[1]- lastNum2;
|
||||
}else{
|
||||
lastDiff2 = '/';
|
||||
}
|
||||
arrs2[6]=lastDiff2;
|
||||
//环比增长率(%)
|
||||
let lastRate2 = 0;
|
||||
if(lastDiff2=='/'&&lastNum2!=='/'&&lastNum2!==0){
|
||||
lastRate2 = (lastDiff2/lastNum2)*100;
|
||||
}else{
|
||||
lastRate2 = '/'
|
||||
}
|
||||
arrs2[7]=lastRate2;
|
||||
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
||||
let sameRate2 =0;
|
||||
if(wrapArr0[index]&&wrapArr0[index].celec_consume_unit){
|
||||
sameRate2 =((arrs[1]- wrapArr0[index].celec_consume_unit)/wrapArr0[index].celec_consume_unit)*100
|
||||
}else{
|
||||
sameRate2='/';
|
||||
}
|
||||
arrs2[8]=sameRate2;
|
||||
wrapArrs2.push(arrs2);
|
||||
|
||||
arrs3[1]=item.coal_consume_unit;
|
||||
arrs3[2]=that.monthGoal3[ind]!==undefined?that.monthGoal3[ind]:'/';
|
||||
arrs3[3]=94;
|
||||
arrs3[4]=100;
|
||||
arrs3[5]=109;
|
||||
//当期与环期差值(KW·h/t)
|
||||
let lastNum3 = 0,lastDiff3 = 0;
|
||||
if(index>1){
|
||||
let num = index-1;
|
||||
if(wrapArr[num]&&wrapArr[num].coal_consume_unit){
|
||||
lastNum3 = wrapArr[num].coal_consume_unit;
|
||||
}else{
|
||||
lastNum3='/'
|
||||
}
|
||||
}else{
|
||||
lastNum3 = wrapArr0[12]?wrapArr0[12].coal_consume_unit:'/';
|
||||
}
|
||||
if(arrs3[1]!=='/'&&lastNum3!=='/'){
|
||||
lastDiff3 =arrs3[1]- lastNum3;
|
||||
}else{
|
||||
lastDiff3 = '/';
|
||||
}
|
||||
arrs3[6]=lastDiff3;
|
||||
//环比增长率(%)
|
||||
let lastRate3 = 0;
|
||||
if(lastDiff3=='/'&&lastNum3!=='/'&&lastNum3!==0){
|
||||
lastRate3 = (lastDiff3/lastNum3)*100;
|
||||
}else{
|
||||
lastRate3 = '/'
|
||||
}
|
||||
arrs3[7]=lastRate3;
|
||||
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
||||
let sameRate3 =0;
|
||||
if(wrapArr0[index]&&wrapArr0[index].coal_consume_unit){
|
||||
sameRate3 =((arrs[1]- wrapArr0[index].coal_consume_unit)/wrapArr0[index].coal_consume_unit)*100
|
||||
}else{
|
||||
sameRate3='/';
|
||||
}
|
||||
arrs3[8]=sameRate3;
|
||||
wrapArrs3.push(arrs3);
|
||||
|
||||
|
||||
arrs4[1]=item.cen_consume_unit;
|
||||
arrs4[2]=that.monthGoal4[ind]!==undefined?that.monthGoal4[ind]:'/';
|
||||
arrs4[3]=100;
|
||||
arrs4[4]=107;
|
||||
arrs4[5]=117;
|
||||
//当期与环期差值(KW·h/t)
|
||||
let lastNum4 = 0,lastDiff4 = 0;
|
||||
if(index>1){
|
||||
let num = index-1;
|
||||
if(wrapArr[num]&&wrapArr[num].cen_consume_unit){
|
||||
lastNum4 = wrapArr[num].cen_consume_unit;
|
||||
}else{
|
||||
lastNum4='/'
|
||||
}
|
||||
}else{
|
||||
lastNum4 = wrapArr0[12]?wrapArr0[12].cen_consume_unit:'/';
|
||||
}
|
||||
if(arrs4[1]!=='/'&&lastNum4!=='/'){
|
||||
lastDiff4 =arrs4[1]- lastNum4;
|
||||
}else{
|
||||
lastDiff4 = '/';
|
||||
}
|
||||
arrs4[6]=lastDiff4;
|
||||
//环比增长率(%)
|
||||
let lastRate4 = 0;
|
||||
if(lastDiff4=='/'&&lastNum4!=='/'&&lastNum4!==0){
|
||||
lastRate4 = (lastDiff4/lastNum4)*100;
|
||||
}else{
|
||||
lastRate4 = '/'
|
||||
}
|
||||
arrs4[7]=lastRate4;
|
||||
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
||||
let sameRate4 =0;
|
||||
if(wrapArr0[index]&&wrapArr0[index].cen_consume_unit){
|
||||
sameRate4 =((arrs[1]- wrapArr0[index].cen_consume_unit)/wrapArr0[index].cen_consume_unit)*100
|
||||
}else{
|
||||
sameRate4='/';
|
||||
}
|
||||
arrs4[8]=sameRate4;
|
||||
wrapArrs4.push(arrs4);
|
||||
})
|
||||
that.tableDatas = wrapArrs;
|
||||
that.tableDatas2 = wrapArrs2;
|
||||
that.tableDatas3 = wrapArrs3;
|
||||
that.tableDatas4 = wrapArrs4;
|
||||
// //type==2
|
||||
// wrapArr.forEach((item,index)=>{
|
||||
// let arrs = [];
|
||||
// arrs[0]=item[0];
|
||||
// arrs[1]=item[1];
|
||||
// arrs[2]=item[2];
|
||||
// //目标值(KW·h/t)//需要接口获取
|
||||
// //当期与目标差值(KW·h/t)
|
||||
// let diff = 0;
|
||||
// if(item[2]!=='/'){
|
||||
// diff = item[1]-item[2];
|
||||
// }else{
|
||||
// diff = '/';
|
||||
// }
|
||||
// arrs[3]=diff;
|
||||
// //环期值(KW·h/t)上个月的值
|
||||
// let lastNum = 0;
|
||||
// if(index>1){
|
||||
// let num = index-1;
|
||||
// if(wrapArr[num]&&wrapArr[num].elec_consume_unit){
|
||||
// lastNum = wrapArr[num].elec_consume_unit;
|
||||
// }else{
|
||||
// lastNum='/'
|
||||
// }
|
||||
// }else{
|
||||
// lastNum = wrapArr0[12]?wrapArr0[12].elec_consume_unit:'/';
|
||||
// }
|
||||
// arrs[4]=lastNum;
|
||||
// //当期与环期差值(KW·h/t)
|
||||
// let lastDiff = 0;
|
||||
|
||||
// if(arrs[1]!=='/'&&arrs[4]!=='/'){
|
||||
// lastDiff =arrs[1]- arrs[4];
|
||||
// }else{
|
||||
// lastDiff = '/';
|
||||
// }
|
||||
// arrs[5]=lastDiff;
|
||||
// //环比增长率(%)
|
||||
// let lastRate = 0;
|
||||
// if(lastDiff=='/'&&lastNum!=='/'&&lastNum!==0){
|
||||
// lastRate = (lastDiff/lastNum)*100;
|
||||
// }else{
|
||||
// lastRate = '/'
|
||||
// }
|
||||
// arrs[6]=lastRate;
|
||||
// //同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
||||
// let sameRate =0;
|
||||
// if(wrapArr0[index]&&wrapArr0[index].elec_consume_unit){
|
||||
// sameRate =((arrs[1]- wrapArr0[index].elec_consume_unit)/wrapArr0[index].elec_consume_unit)*100
|
||||
// }else{
|
||||
// sameRate='/';
|
||||
// }
|
||||
// arrs[7]=sameRate;
|
||||
// wrapArrs.push(arrs);
|
||||
// })
|
||||
// that.tableDatas2 = wrapArrs2;
|
||||
// //type==3
|
||||
// wrapArr.forEach((item,index)=>{
|
||||
// let arrs = [];
|
||||
// arrs[0]=item[0];
|
||||
// arrs[1]=item[1];
|
||||
// arrs[2]=item[2];
|
||||
// //目标值(KW·h/t)//需要接口获取
|
||||
// //当期与目标差值(KW·h/t)
|
||||
// let diff = 0;
|
||||
// if(item[2]!=='/'){
|
||||
// diff = item[1]-item[2];
|
||||
// }else{
|
||||
// diff = '/';
|
||||
// }
|
||||
// arrs[3]=diff;
|
||||
// //环期值(KW·h/t)上个月的值
|
||||
// let lastNum = 0;
|
||||
// if(index>1){
|
||||
// let num = index-1;
|
||||
// if(wrapArr[num]&&wrapArr[num].elec_consume_unit){
|
||||
// lastNum = wrapArr[num].elec_consume_unit;
|
||||
// }else{
|
||||
// lastNum='/'
|
||||
// }
|
||||
// }else{
|
||||
// lastNum = wrapArr0[12]?wrapArr0[12].elec_consume_unit:'/';
|
||||
// }
|
||||
// arrs[4]=lastNum;
|
||||
// //当期与环期差值(KW·h/t)
|
||||
// let lastDiff = 0;
|
||||
|
||||
// if(arrs[1]!=='/'&&arrs[4]!=='/'){
|
||||
// lastDiff =arrs[1]- arrs[4];
|
||||
// }else{
|
||||
// lastDiff = '/';
|
||||
// }
|
||||
// arrs[5]=lastDiff;
|
||||
// //环比增长率(%)
|
||||
// let lastRate = 0;
|
||||
// if(lastDiff=='/'&&lastNum!=='/'&&lastNum!==0){
|
||||
// lastRate = (lastDiff/lastNum)*100;
|
||||
// }else{
|
||||
// lastRate = '/'
|
||||
// }
|
||||
// arrs[6]=lastRate;
|
||||
// //同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
||||
// let sameRate =0;
|
||||
// if(wrapArr0[index]&&wrapArr0[index].elec_consume_unit){
|
||||
// sameRate =((arrs[1]- wrapArr0[index].elec_consume_unit)/wrapArr0[index].elec_consume_unit)*100
|
||||
// }else{
|
||||
// sameRate='/';
|
||||
// }
|
||||
// arrs[7]=sameRate;
|
||||
// wrapArrs.push(arrs);
|
||||
// })
|
||||
// that.tableDatas3 = wrapArrs3;
|
||||
// //type==3
|
||||
// wrapArr.forEach((item,index)=>{
|
||||
// let arrs = [];
|
||||
// arrs[0]=item[0];
|
||||
// arrs[1]=item[1];
|
||||
// arrs[2]=item[2];
|
||||
// //目标值(KW·h/t)//需要接口获取
|
||||
// //当期与目标差值(KW·h/t)
|
||||
// let diff = 0;
|
||||
// if(item[2]!=='/'){
|
||||
// diff = item[1]-item[2];
|
||||
// }else{
|
||||
// diff = '/';
|
||||
// }
|
||||
// arrs[3]=diff;
|
||||
// //环期值(KW·h/t)上个月的值
|
||||
// let lastNum = 0;
|
||||
// if(index>1){
|
||||
// let num = index-1;
|
||||
// if(wrapArr[num]&&wrapArr[num].elec_consume_unit){
|
||||
// lastNum = wrapArr[num].elec_consume_unit;
|
||||
// }else{
|
||||
// lastNum='/'
|
||||
// }
|
||||
// }else{
|
||||
// lastNum = wrapArr0[12]?wrapArr0[12].elec_consume_unit:'/';
|
||||
// }
|
||||
// arrs[4]=lastNum;
|
||||
// //当期与环期差值(KW·h/t)
|
||||
// let lastDiff = 0;
|
||||
|
||||
// if(arrs[1]!=='/'&&arrs[4]!=='/'){
|
||||
// lastDiff =arrs[1]- arrs[4];
|
||||
// }else{
|
||||
// lastDiff = '/';
|
||||
// }
|
||||
// arrs[5]=lastDiff;
|
||||
// //环比增长率(%)
|
||||
// let lastRate = 0;
|
||||
// if(lastDiff=='/'&&lastNum!=='/'&&lastNum!==0){
|
||||
// lastRate = (lastDiff/lastNum)*100;
|
||||
// }else{
|
||||
// lastRate = '/'
|
||||
// }
|
||||
// arrs[6]=lastRate;
|
||||
// //同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
||||
// let sameRate =0;
|
||||
// if(wrapArr0[index]&&wrapArr0[index].elec_consume_unit){
|
||||
// sameRate =((arrs[1]- wrapArr0[index].elec_consume_unit)/wrapArr0[index].elec_consume_unit)*100
|
||||
// }else{
|
||||
// sameRate='/';
|
||||
// }
|
||||
// arrs[7]=sameRate;
|
||||
// wrapArrs.push(arrs);
|
||||
// })
|
||||
// that.tableDatas3 = wrapArrs3;
|
||||
}else{
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
itemClick(type,item){
|
||||
this.type=type;
|
||||
this.asynDialog = true;
|
||||
|
|
@ -235,4 +738,12 @@
|
|||
.printContainer{
|
||||
width: 1075px;
|
||||
}
|
||||
.redColor{
|
||||
font-weight: bold;
|
||||
color: #ff0000;
|
||||
}
|
||||
.greenColor{
|
||||
font-weight: bold;
|
||||
color: #008000;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -141,6 +141,7 @@
|
|||
<save-dialog
|
||||
v-if="dialog.save"
|
||||
ref="saveDialog"
|
||||
:deptId ="deptId"
|
||||
@success="handleSaveSuccess"
|
||||
@closed="dialog.save = false"
|
||||
></save-dialog>
|
||||
|
|
@ -175,6 +176,7 @@
|
|||
query: {
|
||||
mgroup:'3347217651339837440',
|
||||
},
|
||||
deptId:'3347207316583170048',
|
||||
query2: {},
|
||||
dialog: {
|
||||
save: false,
|
||||
|
|
|
|||
|
|
@ -427,7 +427,8 @@ const colors =['#647bfe','#8698fe','#a9b6fe','#cbd3fe','#91CC75','#EE6666'];
|
|||
mounted() {
|
||||
function precen(a,b){
|
||||
if(b!==0&&b!==null&&a!==null){
|
||||
return a/b
|
||||
let precen = (a/b).toFixed(2)
|
||||
return precen*100+'%'
|
||||
}else{
|
||||
return '/'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,20 @@
|
|||
<div class="app-container">
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-date-picker
|
||||
<el-select
|
||||
v-model="query.type"
|
||||
placeholder="查询类型"
|
||||
clearable
|
||||
@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="monthrange"
|
||||
type="monthrange"
|
||||
range-separator="至"
|
||||
|
|
@ -10,12 +23,12 @@
|
|||
end-placeholder="结束月份"
|
||||
value-format="YYYY-MM"
|
||||
format="YYYY-MM"
|
||||
/>
|
||||
<el-button
|
||||
/> -->
|
||||
<!-- <el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="handleQuery"
|
||||
></el-button>
|
||||
></el-button> -->
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="exportExcel()"
|
||||
|
|
@ -31,7 +44,7 @@
|
|||
</el-header>
|
||||
<el-card style="margin-top:5px">
|
||||
<div ref="print" id="myReport" class="printContainer">
|
||||
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable" class="myTable">
|
||||
<table border="1" width="1000" cellspacing="0" :key="0" id="myTable" class="myTable" v-if="query.type==1">
|
||||
<thead class="myTableHead">
|
||||
<tr>
|
||||
<th colspan="9">水泥磨工段车间单位产品电耗月度分析表</th>
|
||||
|
|
@ -52,20 +65,18 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(item) in tableDatas" :key="item">
|
||||
<td class="numCell">{{item.month}}</td>
|
||||
<td class="numCell">{{item.value1}}</td>
|
||||
<td class="numCell">{{item.value2}}</td>
|
||||
<td class="numCell">{{item.value3}}</td>
|
||||
<td class="numCell">{{item.value4}}</td>
|
||||
<td class="numCell">{{item.value5}}</td>
|
||||
<td class="numCell">{{item.value6}}</td>
|
||||
<td class="numCell">{{item.value7}}</td>
|
||||
<td class="numCell">{{item.value7}}</td>
|
||||
<tr v-for="item in tableDatas" :key="item">
|
||||
<td v-for="(item1,ind) in item" :key="ind" class="numCell">
|
||||
<div :class="bindClass(item1,ind)">
|
||||
<span v-if="item1<0&&ind==6">▲</span>
|
||||
<span v-if="item1<0&&ind==6">▼</span>
|
||||
{{item1}}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable1" class="myTable">
|
||||
<table border="1" width="1000" cellspacing="0" :key="1" id="myTable1" class="myTable" v-else>
|
||||
<thead class="myTableHead">
|
||||
<tr>
|
||||
<th colspan="9">水泥磨工段车间单位产品综合能耗月度分析表</th>
|
||||
|
|
@ -86,16 +97,14 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(item) in tableDatas" :key="item">
|
||||
<td class="numCell">{{item.month}}</td>
|
||||
<td class="numCell">{{item.value1}}</td>
|
||||
<td class="numCell">{{item.value2}}</td>
|
||||
<td class="numCell">{{item.value3}}</td>
|
||||
<td class="numCell">{{item.value4}}</td>
|
||||
<td class="numCell">{{item.value5}}</td>
|
||||
<td class="numCell">{{item.value6}}</td>
|
||||
<td class="numCell">{{item.value7}}</td>
|
||||
<td class="numCell">{{item.value7}}</td>
|
||||
<tr v-for="item in tableDatas2" :key="item">
|
||||
<td v-for="(item1,ind) in item" :key="ind" class="numCell">
|
||||
<div :class="bindClass(item1,ind)">
|
||||
<span v-if="item1<0&&ind==6">▲</span>
|
||||
<span v-if="item1<0&&ind==6">▼</span>
|
||||
{{item1}}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
@ -115,20 +124,19 @@
|
|||
return {
|
||||
chartShow: false,
|
||||
myOption: null,
|
||||
timeStamp:0,
|
||||
listQuery:{
|
||||
belong_dept:'',
|
||||
task2__year:'',
|
||||
page:0
|
||||
query: {
|
||||
type:1,
|
||||
mgroup:'3347217651339837440',
|
||||
},
|
||||
query:{
|
||||
time:''
|
||||
},
|
||||
tableDatas:[
|
||||
{month:'2023-05',value1:'1203',value2:'1200',value3:'3',value4:'1150',value5:'50',value6:'0.4',value7:'0.4'},
|
||||
{month:'2023-06',value1:'1203',value2:'1200',value3:'3',value4:'1150',value5:'50',value6:'0.4',value7:'0.4'},
|
||||
{month:'2023-07',value1:'1203',value2:'1200',value3:'3',value4:'1150',value5:'50',value6:'0.4',value7:'0.4'},
|
||||
],
|
||||
monthGoal:[],
|
||||
monthGoal2:[],
|
||||
tableDatas:[],
|
||||
tableDatas2:[],
|
||||
options:[{
|
||||
name:'电耗',id:1,
|
||||
},{
|
||||
name:'综合能耗',id:2,
|
||||
}],
|
||||
modelValue:true,
|
||||
type:'hours',
|
||||
title:'title',
|
||||
|
|
@ -139,9 +147,203 @@
|
|||
};
|
||||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
var myDate = new Date();
|
||||
let year = myDate.getFullYear();
|
||||
that.query.year_s = year;
|
||||
//月目标
|
||||
let paramsGoal = {};
|
||||
paramsGoal.page=0;
|
||||
paramsGoal.mgroup=that.query.mgroup;
|
||||
that.$API.mtm.goal.list.req(paramsGoal).then((ress) => {
|
||||
if(ress.length>0){
|
||||
let monthGoal = [];
|
||||
ress.forEach(goal=>{
|
||||
if(goal.goal_cate_name=='单位产品分布电耗(KW·h/t)'){
|
||||
monthGoal[0]=goal.goal_val;
|
||||
monthGoal[1]=goal.goal_val_2;
|
||||
monthGoal[2]=goal.goal_val_3;
|
||||
monthGoal[3]=goal.goal_val_4;
|
||||
monthGoal[4]=goal.goal_val_5;
|
||||
monthGoal[5]=goal.goal_val_6;
|
||||
monthGoal[6]=goal.goal_val_7;
|
||||
monthGoal[7]=goal.goal_val_8;
|
||||
monthGoal[8]=goal.goal_val_9;
|
||||
monthGoal[9]=goal.goal_val_10;
|
||||
monthGoal[10]=goal.goal_val_11;
|
||||
monthGoal[11]=goal.goal_val_12;
|
||||
monthGoal[12]=goal.goal_val_12;
|
||||
that.monthGoal = monthGoal;
|
||||
}
|
||||
if(goal.goal_cate_name=='单位产品综合能耗(kgce/t)'){
|
||||
monthGoal2[0]=goal.goal_val;
|
||||
monthGoal2[1]=goal.goal_val_2;
|
||||
monthGoal2[2]=goal.goal_val_3;
|
||||
monthGoal2[3]=goal.goal_val_4;
|
||||
monthGoal2[4]=goal.goal_val_5;
|
||||
monthGoal2[5]=goal.goal_val_6;
|
||||
monthGoal2[6]=goal.goal_val_7;
|
||||
monthGoal2[7]=goal.goal_val_8;
|
||||
monthGoal2[8]=goal.goal_val_9;
|
||||
monthGoal2[9]=goal.goal_val_10;
|
||||
monthGoal2[10]=goal.goal_val_11;
|
||||
monthGoal2[11]=goal.goal_val_12;
|
||||
monthGoal2[12]=goal.goal_val_12;
|
||||
that.monthGoal2 = monthGoal2;
|
||||
}
|
||||
})
|
||||
this.getData();
|
||||
}else{
|
||||
this.getData();
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 动态绑定Class
|
||||
bindClass(item,index){
|
||||
let classInfo = { redColor: false, greenColor: false }
|
||||
if(index==6){
|
||||
if( typeof(item)=='number'){
|
||||
if(item>0){
|
||||
classInfo.greenColor = true;
|
||||
classInfo.redColor = false;
|
||||
}else if(item<0){
|
||||
classInfo.redColor = true;
|
||||
classInfo.greenColor = false
|
||||
}
|
||||
}
|
||||
}
|
||||
return classInfo
|
||||
},
|
||||
getData(){
|
||||
let that = this;
|
||||
let query0={};
|
||||
query0.page = 0;
|
||||
query0.type='month_s';
|
||||
query0.year_s = that.query.year_s-1;
|
||||
query0.mgroup=that.query.mgroup;
|
||||
let wrapArr = [],wrapArr0 = [] ,wrapArrs = [],wrapArrs2 = [];
|
||||
this.$API.enm.enstat.req(query0).then((res0) => {
|
||||
let data0 = res0;
|
||||
if(data0.length>0){
|
||||
data0.forEach(item0 => {
|
||||
//先按月份排序,再按班组排序
|
||||
let ind0 = item0.month_s;
|
||||
wrapArr0[ind0] = item0;
|
||||
});
|
||||
}
|
||||
let query={};
|
||||
query.page = 0;
|
||||
query.type='month_s';
|
||||
query.year_s = that.query.year_s;
|
||||
query.mgroup=that.query.mgroup;
|
||||
that.$API.enm.enstat.req(query).then((res) => {
|
||||
let data = res;
|
||||
if(data.length>0){
|
||||
data.forEach(item => {
|
||||
//先按月份排序,再按班组排序
|
||||
let ind = item.month_s;
|
||||
let arr = [];
|
||||
let time = ''+item.year_s+'.'+item.month_s;
|
||||
arr.push(time);
|
||||
arr.push(item.elec_consume_unit);//当期值(KW·h/t)
|
||||
arr[2] = that.monthGoal[ind]!==undefined?that.monthGoal[ind]:'/';
|
||||
wrapArr[ind] = arr;
|
||||
});
|
||||
wrapArr.forEach((item,index)=>{
|
||||
let ind = item.month_s;
|
||||
let arrs = [],arrs2=[];
|
||||
arrs[0]=item[0];
|
||||
arrs[1]=item[1];
|
||||
arrs[2]=item[2];
|
||||
arrs[3]=26;
|
||||
arrs[4]=29;
|
||||
arrs[5]=34;
|
||||
//当期与环期差值(KW·h/t)
|
||||
let lastNum = 0,lastDiff = 0;
|
||||
if(index>1){
|
||||
let num = index-1;
|
||||
if(wrapArr[num]&&wrapArr[num].elec_consume_unit){
|
||||
lastNum = wrapArr[num].elec_consume_unit;
|
||||
}else{
|
||||
lastNum='/'
|
||||
}
|
||||
}else{
|
||||
lastNum = wrapArr0[12]?wrapArr0[12].elec_consume_unit:'/';
|
||||
}
|
||||
if(arrs[1]!=='/'&&lastNum!=='/'){
|
||||
lastDiff =arrs[1]- lastNum;
|
||||
}else{
|
||||
lastDiff = '/';
|
||||
}
|
||||
arrs[6]=lastDiff;
|
||||
//环比增长率(%)
|
||||
let lastRate = 0;
|
||||
if(lastDiff=='/'&&lastNum!=='/'&&lastNum!==0){
|
||||
lastRate = (lastDiff/lastNum)*100;
|
||||
}else{
|
||||
lastRate = '/'
|
||||
}
|
||||
arrs[7]=lastRate;
|
||||
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
||||
let sameRate =0;
|
||||
if(wrapArr0[index]&&wrapArr0[index].elec_consume_unit){
|
||||
sameRate =((arrs[1]- wrapArr0[index].elec_consume_unit)/wrapArr0[index].elec_consume_unit)*100
|
||||
}else{
|
||||
sameRate='/';
|
||||
}
|
||||
arrs[8]=sameRate;
|
||||
wrapArrs.push(arrs);
|
||||
|
||||
arrs2[0]=item[0];
|
||||
arrs2[1]=item.cen_consume_unit;
|
||||
arrs2[2]=that.monthGoal2[ind]!==undefined?that.monthGoal2[ind]:'/';
|
||||
arrs2[3]=80;
|
||||
arrs2[4]=87;
|
||||
arrs2[5]=94;
|
||||
//当期与环期差值(KW·h/t)
|
||||
let lastNum2 = 0,lastDiff2 = 0;
|
||||
if(index>1){
|
||||
let num = index-1;
|
||||
if(wrapArr[num]&&wrapArr[num].cen_consume_unit){
|
||||
lastNum2 = wrapArr[num].cen_consume_unit;
|
||||
}else{
|
||||
lastNum2='/'
|
||||
}
|
||||
}else{
|
||||
lastNum2 = wrapArr0[12]?wrapArr0[12].cen_consume_unit:'/';
|
||||
}
|
||||
if(arrs2[1]!=='/'&&lastNum2!=='/'){
|
||||
lastDiff2 =arrs2[1]- lastNum2;
|
||||
}else{
|
||||
lastDiff2 = '/';
|
||||
}
|
||||
arrs2[6]=lastDiff2;
|
||||
//环比增长率(%)
|
||||
let lastRate2 = 0;
|
||||
if(lastDiff2=='/'&&lastNum2!=='/'&&lastNum2!==0){
|
||||
lastRate2 = (lastDiff2/lastNum2)*100;
|
||||
}else{
|
||||
lastRate2 = '/'
|
||||
}
|
||||
arrs2[7]=lastRate2;
|
||||
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
||||
let sameRate2 =0;
|
||||
if(wrapArr0[index]&&wrapArr0[index].cen_consume_unit){
|
||||
sameRate2 =((arrs[1]- wrapArr0[index].cen_consume_unit)/wrapArr0[index].cen_consume_unit)*100
|
||||
}else{
|
||||
sameRate2='/';
|
||||
}
|
||||
arrs2[8]=sameRate2;
|
||||
wrapArrs2.push(arrs2);
|
||||
})
|
||||
that.tableDatas = wrapArrs;
|
||||
that.tableDatas2 = wrapArrs2;
|
||||
}else{
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
itemClick(type,item){
|
||||
this.type=type;
|
||||
this.asynDialog = true;
|
||||
|
|
@ -172,4 +374,12 @@
|
|||
.printContainer{
|
||||
width: 1075px;
|
||||
}
|
||||
.redColor{
|
||||
font-weight: bold;
|
||||
color: #ff0000;
|
||||
}
|
||||
.greenColor{
|
||||
font-weight: bold;
|
||||
color: #008000;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -125,6 +125,7 @@
|
|||
<save-dialog
|
||||
v-if="dialog.save"
|
||||
ref="saveDialog"
|
||||
:deptId ="deptId"
|
||||
@success="handleSaveSuccess"
|
||||
@closed="dialog.save = false"
|
||||
></save-dialog>
|
||||
|
|
@ -148,8 +149,9 @@ import saveDialog from "./../enm_rm/handover_form.vue";
|
|||
apiObj: this.$API.wpm.sflog.list,
|
||||
apiObj2: null,
|
||||
query: {
|
||||
mgroup:'3346491835287007232',
|
||||
mgroup:'3347217757455728640',
|
||||
},
|
||||
deptId:'3347207316583170048',
|
||||
query2: {},
|
||||
dialog: {
|
||||
save: false,
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@
|
|||
page:0
|
||||
},
|
||||
query: {
|
||||
mgroup:'3346491835287007232',
|
||||
mgroup:'3347217757455728640',
|
||||
},
|
||||
tableDatas:[
|
||||
['产量','总产量(t)',0,0,0,0,0,0,0,0],
|
||||
|
|
@ -304,7 +304,8 @@
|
|||
mounted() {
|
||||
function precen(a,b){
|
||||
if(b!==0&&b!==null&&a!==null){
|
||||
return a/b
|
||||
let precen = (a/b).toFixed(2)
|
||||
return precen*100+'%'
|
||||
}else{
|
||||
return '/'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@
|
|||
year_s:'',
|
||||
page : 0,
|
||||
type : 'month_st',
|
||||
mgroup:'3346491835287007232',
|
||||
mgroup:'3347217757455728640',
|
||||
},
|
||||
tableDatas:[],
|
||||
};
|
||||
|
|
|
|||
|
|
@ -48,15 +48,16 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(item) in tableDatas" :key="item">
|
||||
<td class="numCell">{{item.month}}</td>
|
||||
<td class="numCell">{{item.value1}}</td>
|
||||
<td class="numCell">{{item.value2}}</td>
|
||||
<td class="numCell">{{item.value3}}</td>
|
||||
<td class="numCell">{{item.value4}}</td>
|
||||
<td class="numCell">{{item.value5}}</td>
|
||||
<td class="numCell">{{item.value6}}</td>
|
||||
<td class="numCell">{{item.value7}}</td>
|
||||
<tr v-for="item in tableDatas" :key="item">
|
||||
<td v-for="(item1,ind) in item" :key="ind" class="numCell">
|
||||
<div :class="bindClass(item1,ind)">
|
||||
<span v-if="item1>0&&ind==3">↑</span>
|
||||
<span v-if="item1<0&&ind==3">↓</span>
|
||||
<span v-if="item1<0&&ind==5">▲</span>
|
||||
<span v-if="item1<0&&ind==5">▼</span>
|
||||
{{item1}}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
@ -76,20 +77,11 @@
|
|||
return {
|
||||
chartShow: false,
|
||||
myOption: null,
|
||||
timeStamp:0,
|
||||
listQuery:{
|
||||
belong_dept:'',
|
||||
task2__year:'',
|
||||
page:0
|
||||
},
|
||||
query:{
|
||||
time:''
|
||||
mgroup:'3347217757455728640',
|
||||
},
|
||||
tableDatas:[
|
||||
{month:'2023-05',value1:'1203',value2:'1200',value3:'3',value4:'1150',value5:'50',value6:'0.4',value7:'0.4'},
|
||||
{month:'2023-06',value1:'1203',value2:'1200',value3:'3',value4:'1150',value5:'50',value6:'0.4',value7:'0.4'},
|
||||
{month:'2023-07',value1:'1203',value2:'1200',value3:'3',value4:'1150',value5:'50',value6:'0.4',value7:'0.4'},
|
||||
],
|
||||
monthGoal:[],
|
||||
tableDatas:[],
|
||||
modelValue:true,
|
||||
type:'hours',
|
||||
title:'title',
|
||||
|
|
@ -100,9 +92,153 @@
|
|||
};
|
||||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
var myDate = new Date();
|
||||
let year = myDate.getFullYear();
|
||||
that.query.year_s = year;
|
||||
//月目标
|
||||
let paramsGoal = {};
|
||||
paramsGoal.page=0;
|
||||
paramsGoal.mgroup=that.query.mgroup;
|
||||
that.$API.mtm.goal.list.req(paramsGoal).then((ress) => {
|
||||
if(ress.length>0){
|
||||
let monthGoal = [];
|
||||
ress.forEach(goal=>{
|
||||
if(goal.goal_cate_name=='单位产品分布电耗(KW·h/t)'){
|
||||
monthGoal[0]=goal.goal_val;
|
||||
monthGoal[1]=goal.goal_val_2;
|
||||
monthGoal[2]=goal.goal_val_3;
|
||||
monthGoal[3]=goal.goal_val_4;
|
||||
monthGoal[4]=goal.goal_val_5;
|
||||
monthGoal[5]=goal.goal_val_6;
|
||||
monthGoal[6]=goal.goal_val_7;
|
||||
monthGoal[7]=goal.goal_val_8;
|
||||
monthGoal[8]=goal.goal_val_9;
|
||||
monthGoal[9]=goal.goal_val_10;
|
||||
monthGoal[10]=goal.goal_val_11;
|
||||
monthGoal[11]=goal.goal_val_12;
|
||||
monthGoal[12]=goal.goal_val_12;
|
||||
that.monthGoal = monthGoal;
|
||||
}
|
||||
})
|
||||
this.getData();
|
||||
}else{
|
||||
this.getData();
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 动态绑定Class
|
||||
bindClass(item,index){
|
||||
let classInfo = { redColor: false, greenColor: false }
|
||||
if(index==3||index==5){
|
||||
if( typeof(item)=='number'){
|
||||
if(item>0){
|
||||
classInfo.greenColor = true;
|
||||
classInfo.redColor = false;
|
||||
}else if(item<0){
|
||||
classInfo.redColor = true;
|
||||
classInfo.greenColor = false
|
||||
}
|
||||
}
|
||||
}
|
||||
return classInfo
|
||||
},
|
||||
getData(){
|
||||
let that = this;
|
||||
let query0={};
|
||||
query0.page = 0;
|
||||
query0.type='month_s';
|
||||
query0.year_s = that.query.year_s-1;
|
||||
query0.mgroup=that.query.mgroup;
|
||||
let wrapArr = [],wrapArr0 = [] ,wrapArrs = [];
|
||||
this.$API.enm.enstat.req(query0).then((res0) => {
|
||||
let data0 = res0;
|
||||
if(data0.length>0){
|
||||
data0.forEach(item0 => {
|
||||
//先按月份排序,再按班组排序
|
||||
let ind0 = item0.month_s;
|
||||
wrapArr0[ind0] = item0;
|
||||
});
|
||||
}
|
||||
let query={};
|
||||
query.page = 0;
|
||||
query.type='month_s';
|
||||
query.year_s = that.query.year_s;
|
||||
query.mgroup=that.query.mgroup;
|
||||
that.$API.enm.enstat.req(query).then((res) => {
|
||||
let data = res;
|
||||
if(data.length>0){
|
||||
data.forEach(item => {
|
||||
//先按月份排序,再按班组排序
|
||||
let ind = item.month_s;
|
||||
let arr = [];
|
||||
let time = ''+item.year_s+'.'+item.month_s;
|
||||
arr.push(time);
|
||||
arr.push(item.elec_consume_unit);//当期值(KW·h/t)
|
||||
arr[2] = that.monthGoal[ind]!==undefined?that.monthGoal[ind]:'/';
|
||||
wrapArr[ind] = arr;
|
||||
});
|
||||
wrapArr.forEach((item,index)=>{
|
||||
let arrs = [];
|
||||
arrs[0]=item[0];
|
||||
arrs[1]=item[1];
|
||||
arrs[2]=item[2];
|
||||
//目标值(KW·h/t)//需要接口获取
|
||||
//当期与目标差值(KW·h/t)
|
||||
let diff = 0;
|
||||
if(item[2]!=='/'){
|
||||
diff = item[1]-item[2];
|
||||
}else{
|
||||
diff = '/';
|
||||
}
|
||||
arrs[3]=diff;
|
||||
//环期值(KW·h/t)上个月的值
|
||||
let lastNum = 0;
|
||||
if(index>1){
|
||||
let num = index-1;
|
||||
if(wrapArr[num]&&wrapArr[num].elec_consume_unit){
|
||||
lastNum = wrapArr[num].elec_consume_unit;
|
||||
}else{
|
||||
lastNum='/'
|
||||
}
|
||||
}else{
|
||||
lastNum = wrapArr0[12]?wrapArr0[12].elec_consume_unit:'/';
|
||||
}
|
||||
arrs[4]=lastNum;
|
||||
//当期与环期差值(KW·h/t)
|
||||
let lastDiff = 0;
|
||||
|
||||
if(arrs[1]!=='/'&&arrs[4]!=='/'){
|
||||
lastDiff =arrs[1]- arrs[4];
|
||||
}else{
|
||||
lastDiff = '/';
|
||||
}
|
||||
arrs[5]=lastDiff;
|
||||
//环比增长率(%)
|
||||
let lastRate = 0;
|
||||
if(lastDiff=='/'&&lastNum!=='/'&&lastNum!==0){
|
||||
lastRate = (lastDiff/lastNum)*100;
|
||||
}else{
|
||||
lastRate = '/'
|
||||
}
|
||||
arrs[6]=lastRate;
|
||||
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
||||
let sameRate =0;
|
||||
if(wrapArr0[index]&&wrapArr0[index].elec_consume_unit){
|
||||
sameRate =((arrs[1]- wrapArr0[index].elec_consume_unit)/wrapArr0[index].elec_consume_unit)*100
|
||||
}else{
|
||||
sameRate='/';
|
||||
}
|
||||
arrs[7]=sameRate;
|
||||
wrapArrs.push(arrs);
|
||||
})
|
||||
that.tableDatas = wrapArrs;
|
||||
}else{
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
itemClick(type,item){
|
||||
this.type=type;
|
||||
this.asynDialog = true;
|
||||
|
|
@ -133,4 +269,12 @@
|
|||
.printContainer{
|
||||
width: 1075px;
|
||||
}
|
||||
.redColor{
|
||||
font-weight: bold;
|
||||
color: #ff0000;
|
||||
}
|
||||
.greenColor{
|
||||
font-weight: bold;
|
||||
color: #008000;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -434,7 +434,8 @@
|
|||
mounted() {
|
||||
function precen(a,b){
|
||||
if(b!==0&&b!==null&&a!==null){
|
||||
return a/b
|
||||
let precen = (a/b).toFixed(2)
|
||||
return precen*100+'%'
|
||||
}else{
|
||||
return '/'
|
||||
}
|
||||
|
|
@ -573,6 +574,9 @@
|
|||
if(res2.length>0){
|
||||
let data2 = res2[0];
|
||||
that.tableDatas[0][4]=data2.total_production;
|
||||
if(that.tableDatas[0][4]>that.tableDatas[0][6]){
|
||||
that.wraning = true;
|
||||
}
|
||||
that.tableDatas[0][7]=precen(that.tableDatas[0][4],that.tableDatas[0][6])
|
||||
that.tableDatas[1][4]=data2.production_hour;
|
||||
that.tableDatas[1][7]=precen(that.tableDatas[1][4],that.tableDatas[1][6])
|
||||
|
|
|
|||
|
|
@ -2,12 +2,6 @@
|
|||
<div class="app-container">
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
|
||||
<!-- <el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="handleQuery"
|
||||
></el-button> -->
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="exportExcel()"
|
||||
|
|
@ -208,8 +202,8 @@
|
|||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
<style scoped>
|
||||
.printContainer{
|
||||
width: 1075px;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -48,15 +48,16 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(item) in tableDatas" :key="item">
|
||||
<td class="numCell">{{item.month}}</td>
|
||||
<td class="numCell">{{item.value1}}</td>
|
||||
<td class="numCell">{{item.value2}}</td>
|
||||
<td class="numCell">{{item.value3}}</td>
|
||||
<td class="numCell">{{item.value4}}</td>
|
||||
<td class="numCell">{{item.value5}}</td>
|
||||
<td class="numCell">{{item.value6}}</td>
|
||||
<td class="numCell">{{item.value7}}</td>
|
||||
<tr v-for="item in tableDatas" :key="item">
|
||||
<td v-for="(item1,ind) in item" :key="ind" class="numCell">
|
||||
<div :class="bindClass(item1,ind)">
|
||||
<span v-if="item1>0&&ind==3">↑</span>
|
||||
<span v-if="item1<0&&ind==3">↓</span>
|
||||
<span v-if="item1<0&&ind==5">▲</span>
|
||||
<span v-if="item1<0&&ind==5">▼</span>
|
||||
{{item1}}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
@ -76,20 +77,10 @@
|
|||
return {
|
||||
chartShow: false,
|
||||
myOption: null,
|
||||
timeStamp:0,
|
||||
listQuery:{
|
||||
belong_dept:'',
|
||||
task2__year:'',
|
||||
page:0
|
||||
},
|
||||
query:{
|
||||
time:''
|
||||
mgroup:'3346520558031773696',
|
||||
},
|
||||
tableDatas:[
|
||||
{month:'2023-05',value1:'1203',value2:'1200',value3:'3',value4:'1150',value5:'50',value6:'0.4',value7:'0.4'},
|
||||
{month:'2023-06',value1:'1203',value2:'1200',value3:'3',value4:'1150',value5:'50',value6:'0.4',value7:'0.4'},
|
||||
{month:'2023-07',value1:'1203',value2:'1200',value3:'3',value4:'1150',value5:'50',value6:'0.4',value7:'0.4'},
|
||||
],
|
||||
tableDatas:[],
|
||||
modelValue:true,
|
||||
type:'hours',
|
||||
title:'title',
|
||||
|
|
@ -97,12 +88,157 @@
|
|||
showClose:true,
|
||||
echartType:'line',
|
||||
asynDialog:false,
|
||||
monthGoal:[],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
var myDate = new Date();
|
||||
let year = myDate.getFullYear();
|
||||
that.query.year_s = year;
|
||||
//月目标
|
||||
let paramsGoal = {};
|
||||
paramsGoal.page=0;
|
||||
paramsGoal.mgroup=that.query.mgroup;
|
||||
that.$API.mtm.goal.list.req(paramsGoal).then((ress) => {
|
||||
if(ress.length>0){
|
||||
let monthGoal = [];
|
||||
ress.forEach(goal=>{
|
||||
if(goal.goal_cate_name=='单位产品分布电耗(KW·h/t)'){
|
||||
monthGoal[0]=goal.goal_val;
|
||||
monthGoal[1]=goal.goal_val_2;
|
||||
monthGoal[2]=goal.goal_val_3;
|
||||
monthGoal[3]=goal.goal_val_4;
|
||||
monthGoal[4]=goal.goal_val_5;
|
||||
monthGoal[5]=goal.goal_val_6;
|
||||
monthGoal[6]=goal.goal_val_7;
|
||||
monthGoal[7]=goal.goal_val_8;
|
||||
monthGoal[8]=goal.goal_val_9;
|
||||
monthGoal[9]=goal.goal_val_10;
|
||||
monthGoal[10]=goal.goal_val_11;
|
||||
monthGoal[11]=goal.goal_val_12;
|
||||
monthGoal[12]=goal.goal_val_12;
|
||||
that.monthGoal = monthGoal;
|
||||
}
|
||||
})
|
||||
this.getData();
|
||||
}else{
|
||||
this.getData();
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 动态绑定Class
|
||||
bindClass(item,index){
|
||||
let classInfo = { redColor: false, greenColor: false }
|
||||
if(index==3||index==5){
|
||||
if( typeof(item)=='number'){
|
||||
if(item>0){
|
||||
classInfo.greenColor = true;
|
||||
classInfo.redColor = false;
|
||||
}else if(item<0){
|
||||
classInfo.redColor = true;
|
||||
classInfo.greenColor = false
|
||||
}
|
||||
}
|
||||
}
|
||||
return classInfo
|
||||
},
|
||||
getData(){
|
||||
let that = this;
|
||||
let query0={};
|
||||
query0.page = 0;
|
||||
query0.type='month_s';
|
||||
query0.year_s = that.query.year_s-1;
|
||||
query0.mgroup=that.query.mgroup;
|
||||
let wrapArr = [],wrapArr0 = [] ,wrapArrs = [];
|
||||
this.$API.enm.enstat.req(query0).then((res0) => {
|
||||
let data0 = res0;
|
||||
if(data0.length>0){
|
||||
data0.forEach(item0 => {
|
||||
//先按月份排序,再按班组排序
|
||||
let ind0 = item0.month_s;
|
||||
wrapArr0[ind0] = item0;
|
||||
});
|
||||
}
|
||||
let query={};
|
||||
query.page = 0;
|
||||
query.type='month_s';
|
||||
query.year_s = that.query.year_s;
|
||||
query.mgroup=that.query.mgroup;
|
||||
that.$API.enm.enstat.req(query).then((res) => {
|
||||
let data = res;
|
||||
if(data.length>0){
|
||||
data.forEach(item => {
|
||||
//先按月份排序,再按班组排序
|
||||
let ind = item.month_s;
|
||||
let arr = [];
|
||||
let time = ''+item.year_s+'.'+item.month_s;
|
||||
arr.push(time);
|
||||
arr.push(item.elec_consume_unit);//当期值(KW·h/t)
|
||||
arr[2] = that.monthGoal[ind]!==undefined?that.monthGoal[ind]:'/';
|
||||
wrapArr[ind] = arr;
|
||||
});
|
||||
wrapArr.forEach((item,index)=>{
|
||||
let arrs = [];
|
||||
arrs[0]=item[0];
|
||||
arrs[1]=item[1];
|
||||
arrs[2]=item[2];
|
||||
//目标值(KW·h/t)//需要接口获取
|
||||
//当期与目标差值(KW·h/t)
|
||||
let diff = 0;
|
||||
if(item[2]!=='/'){
|
||||
diff = item[1]-item[2];
|
||||
}else{
|
||||
diff = '/';
|
||||
}
|
||||
arrs[3]=diff;
|
||||
//环期值(KW·h/t)上个月的值
|
||||
let lastNum = 0;
|
||||
if(index>1){
|
||||
let num = index-1;
|
||||
if(wrapArr[num]&&wrapArr[num].elec_consume_unit){
|
||||
lastNum = wrapArr[num].elec_consume_unit;
|
||||
}else{
|
||||
lastNum='/'
|
||||
}
|
||||
}else{
|
||||
lastNum = wrapArr0[12]?wrapArr0[12].elec_consume_unit:'/';
|
||||
}
|
||||
arrs[4]=lastNum;
|
||||
//当期与环期差值(KW·h/t)
|
||||
let lastDiff = 0;
|
||||
|
||||
if(arrs[1]!=='/'&&arrs[4]!=='/'){
|
||||
lastDiff =arrs[1]- arrs[4];
|
||||
}else{
|
||||
lastDiff = '/';
|
||||
}
|
||||
arrs[5]=lastDiff;
|
||||
//环比增长率(%)
|
||||
let lastRate = 0;
|
||||
if(lastDiff=='/'&&lastNum!=='/'&&lastNum!==0){
|
||||
lastRate = (lastDiff/lastNum)*100;
|
||||
}else{
|
||||
lastRate = '/'
|
||||
}
|
||||
arrs[6]=lastRate;
|
||||
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
||||
let sameRate =0;
|
||||
if(wrapArr0[index]&&wrapArr0[index].elec_consume_unit){
|
||||
sameRate =((arrs[1]- wrapArr0[index].elec_consume_unit)/wrapArr0[index].elec_consume_unit)*100
|
||||
}else{
|
||||
sameRate='/';
|
||||
}
|
||||
arrs[7]=sameRate;
|
||||
wrapArrs.push(arrs);
|
||||
})
|
||||
that.tableDatas = wrapArrs;
|
||||
}else{
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
itemClick(type,item){
|
||||
this.type=type;
|
||||
this.asynDialog = true;
|
||||
|
|
@ -133,4 +269,12 @@
|
|||
.printContainer{
|
||||
width: 1075px;
|
||||
}
|
||||
.redColor{
|
||||
font-weight: bold;
|
||||
color: #ff0000;
|
||||
}
|
||||
.greenColor{
|
||||
font-weight: bold;
|
||||
color: #008000;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -127,6 +127,7 @@
|
|||
<save-dialog
|
||||
v-if="dialog.save"
|
||||
ref="saveDialog"
|
||||
:deptId ="deptId"
|
||||
@success="handleSaveSuccess"
|
||||
@closed="dialog.save = false"
|
||||
></save-dialog>
|
||||
|
|
@ -152,6 +153,7 @@
|
|||
query: {
|
||||
mgroup:'3346491835287007232',
|
||||
},
|
||||
deptId:'3345780809943797760',
|
||||
query2: {},
|
||||
dialog: {
|
||||
save: false,
|
||||
|
|
|
|||
|
|
@ -330,7 +330,8 @@
|
|||
mounted() {
|
||||
function precen(a,b){
|
||||
if(b!==0&&b!==null&&a!==null){
|
||||
return a/b
|
||||
let precen = (a/b).toFixed(2)
|
||||
return precen*100+'%'
|
||||
}else{
|
||||
return '/'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,15 +48,16 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(item) in tableDatas" :key="item">
|
||||
<td class="numCell">{{item.month}}</td>
|
||||
<td class="numCell">{{item.value1}}</td>
|
||||
<td class="numCell">{{item.value2}}</td>
|
||||
<td class="numCell">{{item.value3}}</td>
|
||||
<td class="numCell">{{item.value4}}</td>
|
||||
<td class="numCell">{{item.value5}}</td>
|
||||
<td class="numCell">{{item.value6}}</td>
|
||||
<td class="numCell">{{item.value7}}</td>
|
||||
<tr v-for="item in tableDatas" :key="item">
|
||||
<td v-for="(item1,ind) in item" :key="ind" class="numCell">
|
||||
<div :class="bindClass(item1,ind)">
|
||||
<span v-if="item1>0&&ind==3">↑</span>
|
||||
<span v-if="item1<0&&ind==3">↓</span>
|
||||
<span v-if="item1<0&&ind==5">▲</span>
|
||||
<span v-if="item1<0&&ind==5">▼</span>
|
||||
{{item1}}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
@ -76,20 +77,11 @@
|
|||
return {
|
||||
chartShow: false,
|
||||
myOption: null,
|
||||
timeStamp:0,
|
||||
listQuery:{
|
||||
belong_dept:'',
|
||||
task2__year:'',
|
||||
page:0
|
||||
},
|
||||
query:{
|
||||
time:''
|
||||
mgroup:'3346491835287007232',
|
||||
},
|
||||
tableDatas:[
|
||||
{month:'2023-05',value1:'1203',value2:'1200',value3:'3',value4:'1150',value5:'50',value6:'0.4',value7:'0.4'},
|
||||
{month:'2023-06',value1:'1203',value2:'1200',value3:'3',value4:'1150',value5:'50',value6:'0.4',value7:'0.4'},
|
||||
{month:'2023-07',value1:'1203',value2:'1200',value3:'3',value4:'1150',value5:'50',value6:'0.4',value7:'0.4'},
|
||||
],
|
||||
monthGoal:[],
|
||||
tableDatas:[],
|
||||
modelValue:true,
|
||||
type:'hours',
|
||||
title:'title',
|
||||
|
|
@ -100,9 +92,153 @@
|
|||
};
|
||||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
var myDate = new Date();
|
||||
let year = myDate.getFullYear();
|
||||
that.query.year_s = year;
|
||||
//月目标
|
||||
let paramsGoal = {};
|
||||
paramsGoal.page=0;
|
||||
paramsGoal.mgroup=that.query.mgroup;
|
||||
that.$API.mtm.goal.list.req(paramsGoal).then((ress) => {
|
||||
if(ress.length>0){
|
||||
let monthGoal = [];
|
||||
ress.forEach(goal=>{
|
||||
if(goal.goal_cate_name=='单位产品分布电耗(KW·h/t)'){
|
||||
monthGoal[0]=goal.goal_val;
|
||||
monthGoal[1]=goal.goal_val_2;
|
||||
monthGoal[2]=goal.goal_val_3;
|
||||
monthGoal[3]=goal.goal_val_4;
|
||||
monthGoal[4]=goal.goal_val_5;
|
||||
monthGoal[5]=goal.goal_val_6;
|
||||
monthGoal[6]=goal.goal_val_7;
|
||||
monthGoal[7]=goal.goal_val_8;
|
||||
monthGoal[8]=goal.goal_val_9;
|
||||
monthGoal[9]=goal.goal_val_10;
|
||||
monthGoal[10]=goal.goal_val_11;
|
||||
monthGoal[11]=goal.goal_val_12;
|
||||
monthGoal[12]=goal.goal_val_12;
|
||||
that.monthGoal = monthGoal;
|
||||
}
|
||||
})
|
||||
this.getData();
|
||||
}else{
|
||||
this.getData();
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 动态绑定Class
|
||||
bindClass(item,index){
|
||||
let classInfo = { redColor: false, greenColor: false }
|
||||
if(index==3||index==5){
|
||||
if( typeof(item)=='number'){
|
||||
if(item>0){
|
||||
classInfo.greenColor = true;
|
||||
classInfo.redColor = false;
|
||||
}else if(item<0){
|
||||
classInfo.redColor = true;
|
||||
classInfo.greenColor = false
|
||||
}
|
||||
}
|
||||
}
|
||||
return classInfo
|
||||
},
|
||||
getData(){
|
||||
let that = this;
|
||||
let query0={};
|
||||
query0.page = 0;
|
||||
query0.type='month_s';
|
||||
query0.year_s = that.query.year_s-1;
|
||||
query0.mgroup=that.query.mgroup;
|
||||
let wrapArr = [],wrapArr0 = [] ,wrapArrs = [];
|
||||
this.$API.enm.enstat.req(query0).then((res0) => {
|
||||
let data0 = res0;
|
||||
if(data0.length>0){
|
||||
data0.forEach(item0 => {
|
||||
//先按月份排序,再按班组排序
|
||||
let ind0 = item0.month_s;
|
||||
wrapArr0[ind0] = item0;
|
||||
});
|
||||
}
|
||||
let query={};
|
||||
query.page = 0;
|
||||
query.type='month_s';
|
||||
query.year_s = that.query.year_s;
|
||||
query.mgroup=that.query.mgroup;
|
||||
that.$API.enm.enstat.req(query).then((res) => {
|
||||
let data = res;
|
||||
if(data.length>0){
|
||||
data.forEach(item => {
|
||||
//先按月份排序,再按班组排序
|
||||
let ind = item.month_s;
|
||||
let arr = [];
|
||||
let time = ''+item.year_s+'.'+item.month_s;
|
||||
arr.push(time);
|
||||
arr.push(item.elec_consume_unit);//当期值(KW·h/t)
|
||||
arr[2] = that.monthGoal[ind]!==undefined?that.monthGoal[ind]:'/';
|
||||
wrapArr[ind] = arr;
|
||||
});
|
||||
wrapArr.forEach((item,index)=>{
|
||||
let arrs = [];
|
||||
arrs[0]=item[0];
|
||||
arrs[1]=item[1];
|
||||
arrs[2]=item[2];
|
||||
//目标值(KW·h/t)//需要接口获取
|
||||
//当期与目标差值(KW·h/t)
|
||||
let diff = 0;
|
||||
if(item[2]!=='/'){
|
||||
diff = item[1]-item[2];
|
||||
}else{
|
||||
diff = '/';
|
||||
}
|
||||
arrs[3]=diff;
|
||||
//环期值(KW·h/t)上个月的值
|
||||
let lastNum = 0;
|
||||
if(index>1){
|
||||
let num = index-1;
|
||||
if(wrapArr[num]&&wrapArr[num].elec_consume_unit){
|
||||
lastNum = wrapArr[num].elec_consume_unit;
|
||||
}else{
|
||||
lastNum='/'
|
||||
}
|
||||
}else{
|
||||
lastNum = wrapArr0[12]?wrapArr0[12].elec_consume_unit:'/';
|
||||
}
|
||||
arrs[4]=lastNum;
|
||||
//当期与环期差值(KW·h/t)
|
||||
let lastDiff = 0;
|
||||
|
||||
if(arrs[1]!=='/'&&arrs[4]!=='/'){
|
||||
lastDiff =arrs[1]- arrs[4];
|
||||
}else{
|
||||
lastDiff = '/';
|
||||
}
|
||||
arrs[5]=lastDiff;
|
||||
//环比增长率(%)
|
||||
let lastRate = 0;
|
||||
if(lastDiff=='/'&&lastNum!=='/'&&lastNum!==0){
|
||||
lastRate = (lastDiff/lastNum)*100;
|
||||
}else{
|
||||
lastRate = '/'
|
||||
}
|
||||
arrs[6]=lastRate;
|
||||
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
||||
let sameRate =0;
|
||||
if(wrapArr0[index]&&wrapArr0[index].elec_consume_unit){
|
||||
sameRate =((arrs[1]- wrapArr0[index].elec_consume_unit)/wrapArr0[index].elec_consume_unit)*100
|
||||
}else{
|
||||
sameRate='/';
|
||||
}
|
||||
arrs[7]=sameRate;
|
||||
wrapArrs.push(arrs);
|
||||
})
|
||||
that.tableDatas = wrapArrs;
|
||||
}else{
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
itemClick(type,item){
|
||||
this.type=type;
|
||||
this.asynDialog = true;
|
||||
|
|
@ -133,4 +269,12 @@
|
|||
.printContainer{
|
||||
width: 1075px;
|
||||
}
|
||||
.redColor{
|
||||
font-weight: bold;
|
||||
color: #ff0000;
|
||||
}
|
||||
.greenColor{
|
||||
font-weight: bold;
|
||||
color: #008000;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -168,7 +168,7 @@ export default {
|
|||
that.$TOOL.data.set("PERMISSIONS", Object.keys(res1.perms));
|
||||
debugger;
|
||||
console.log(this.$TOOL.data.get('BASE_INFO').base.base_name)
|
||||
if(this.$TOOL.data.get('BASE_INFO').base.base_name=='托克逊能源管理平台'){//托克逊
|
||||
if(this.$TOOL.data.get('BASE_INFO').base.base_name_short=='托克逊能管'){//托克逊
|
||||
this.$router.replace({
|
||||
path: "/dashboard_enm",
|
||||
});
|
||||
|
|
|
|||
|
|
@ -187,8 +187,13 @@
|
|||
//获取工段列表
|
||||
getMgroup(){
|
||||
this.$API.mtm.mgroup.list.req({page:0}).then(res=>{
|
||||
this.mgroupOptions = res;
|
||||
this.query.mgroup = res[8].id;
|
||||
res.forEach(item=>{
|
||||
if(item.name!=='煤磨'&&item.name!=='水泥包装'){
|
||||
this.mgroupOptions.push(item);
|
||||
}
|
||||
})
|
||||
this.mgroupOptions = this.mgroupOptions.reverse();
|
||||
this.query.mgroup = this.mgroupOptions[0].id;
|
||||
this.tableName = '电石渣干粉核算'
|
||||
})
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,6 +1,21 @@
|
|||
<!-- 全厂电量统计 -->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<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">
|
||||
|
|
@ -127,7 +142,11 @@
|
|||
})
|
||||
},
|
||||
|
||||
|
||||
exportExcel() {
|
||||
this.exportLoading = true;
|
||||
this.$XLSX('#myTable', this.tableName)
|
||||
this.exportLoading = false;
|
||||
},
|
||||
handlePrint() {
|
||||
this.$PRINT('#myReport');
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,12 +1,46 @@
|
|||
<!-- 全厂电量统计 -->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-select
|
||||
v-model="type"
|
||||
placeholder="查询类型"
|
||||
clearable
|
||||
@change="typeCange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<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">全厂报表</th>
|
||||
<th colspan="6" v-if="type=='day'">生产日报</th>
|
||||
<th colspan="6" v-else>生产月报</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>序号</th>
|
||||
|
|
@ -37,11 +71,14 @@
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
query:{
|
||||
year:'',
|
||||
month:'',
|
||||
days:'',
|
||||
},
|
||||
type:'day',
|
||||
options:[{
|
||||
name:'生产日报',
|
||||
id:'day'
|
||||
},{
|
||||
name:'生产月报',
|
||||
id:'month'
|
||||
}],
|
||||
tableDatas:[
|
||||
[1,'主机设备台产','立磨台产(t/h)',''],
|
||||
[2,'主机设备台产','烘干破台产(t/h)'],
|
||||
|
|
|
|||
|
|
@ -1,6 +1,20 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<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="myTable" class="myTable">
|
||||
|
|
@ -61,6 +75,14 @@
|
|||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
exportExcel() {
|
||||
this.exportLoading = true;
|
||||
this.$XLSX('#myTable', this.tableName)
|
||||
this.exportLoading = false;
|
||||
},
|
||||
handlePrint() {
|
||||
this.$PRINT('#myReport');
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue