fix:enm_kiln回转窑mgroup根据名称获取id
This commit is contained in:
parent
d392d7f012
commit
25e2a1e9d6
|
@ -3,21 +3,65 @@
|
||||||
<el-header>
|
<el-header>
|
||||||
<div class="left-panel">
|
<div class="left-panel">
|
||||||
<div style="margin-right: 20px">交接班日志</div>
|
<div style="margin-right: 20px">交接班日志</div>
|
||||||
<el-date-picker v-model="query.start_time__gte" type="date" value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD"
|
<el-date-picker
|
||||||
placeholder="开始时间" style=" width: 120px" />
|
v-model="query.start_time__gte"
|
||||||
<el-date-picker v-model="query.end_time__lt" type="date" value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD"
|
type="date"
|
||||||
placeholder="结束时间" style="margin-left: 2px; width: 120px" />
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
<el-select v-model="query.shift" placeholder="班次" clearable style="margin-left: 2px; width: 120px">
|
format="YYYY-MM-DD"
|
||||||
<el-option v-for="item in optionsShift" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
placeholder="开始时间"
|
||||||
|
style="width: 120px"
|
||||||
|
/>
|
||||||
|
<el-date-picker
|
||||||
|
v-model="query.end_time__lt"
|
||||||
|
type="date"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
placeholder="结束时间"
|
||||||
|
style="margin-left: 2px; width: 120px"
|
||||||
|
/>
|
||||||
|
<el-select
|
||||||
|
v-model="query.shift"
|
||||||
|
placeholder="班次"
|
||||||
|
clearable
|
||||||
|
style="margin-left: 2px; width: 120px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in optionsShift"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-select v-model="query.team" placeholder="班组" clearable style="margin-left: 2px; width: 120px">
|
<el-select
|
||||||
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
v-model="query.team"
|
||||||
|
placeholder="班组"
|
||||||
|
clearable
|
||||||
|
style="margin-left: 2px; width: 120px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-search"
|
||||||
|
@click="handleQuery"
|
||||||
|
></el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-header>
|
</el-header>
|
||||||
<el-main class="nopadding">
|
<el-main class="nopadding">
|
||||||
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query" highlightCurrentRow @row-click="rowClick">
|
<scTable
|
||||||
|
ref="table"
|
||||||
|
:apiObj="apiObj"
|
||||||
|
row-key="id"
|
||||||
|
stripe
|
||||||
|
:params="query"
|
||||||
|
highlightCurrentRow
|
||||||
|
@row-click="rowClick"
|
||||||
|
>
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
<!-- <el-table-column label="关联工段" prop="mgroup_name"></el-table-column> -->
|
<!-- <el-table-column label="关联工段" prop="mgroup_name"></el-table-column> -->
|
||||||
<el-table-column label="开始时间" prop="start_time">
|
<el-table-column label="开始时间" prop="start_time">
|
||||||
|
@ -30,21 +74,49 @@
|
||||||
<span>{{ scope.row.end_time.slice(0, 16) }}</span>
|
<span>{{ scope.row.end_time.slice(0, 16) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="班组名称" prop="team_name"></el-table-column>
|
<el-table-column
|
||||||
<el-table-column label="当前班次" prop="shift_name"></el-table-column>
|
label="班组名称"
|
||||||
<el-table-column label="班长" prop="leader_name"></el-table-column>
|
prop="team_name"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="当前班次"
|
||||||
|
prop="shift_name"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="班长"
|
||||||
|
prop="leader_name"
|
||||||
|
></el-table-column>
|
||||||
<el-table-column label="检验时间">
|
<el-table-column label="检验时间">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="scope.row.last_test_time">{{ scope.row.last_test_time.slice(0, 16) }}</span>
|
<span v-if="scope.row.last_test_time">{{
|
||||||
|
scope.row.last_test_time.slice(0, 16)
|
||||||
|
}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" fixed="right" align="center" width="140">
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
fixed="right"
|
||||||
|
align="center"
|
||||||
|
width="140"
|
||||||
|
>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button link size="small" @click="sflog_edit(scope.row)" type="primary">操作</el-button>
|
<el-button
|
||||||
|
link
|
||||||
|
size="small"
|
||||||
|
@click="sflog_edit(scope.row)"
|
||||||
|
type="primary"
|
||||||
|
>操作</el-button
|
||||||
|
>
|
||||||
<!-- <el-button link size="small" @click="sflog_check(scope.row)" type="primary">质量检验</el-button> -->
|
<!-- <el-button link size="small" @click="sflog_check(scope.row)" type="primary">质量检验</el-button> -->
|
||||||
<!-- <el-button link size="small" @click="sflog_other(scope.row)" type="primary">其他能源</el-button> -->
|
<!-- <el-button link size="small" @click="sflog_other(scope.row)" type="primary">其他能源</el-button> -->
|
||||||
<el-divider direction="vertical"></el-divider>
|
<el-divider direction="vertical"></el-divider>
|
||||||
<el-button link size="small" @click="sflog_export(scope.row)" type="success">报表</el-button>
|
<el-button
|
||||||
|
link
|
||||||
|
size="small"
|
||||||
|
@click="sflog_export(scope.row)"
|
||||||
|
type="success"
|
||||||
|
>报表</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</scTable>
|
</scTable>
|
||||||
|
@ -60,77 +132,180 @@
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<div class="left-panel">
|
<div class="left-panel">
|
||||||
<el-button type="primary" @click="exportExcel()" :loading="exportLoading">导出xlsx
|
<el-button
|
||||||
</el-button>
|
type="primary"
|
||||||
<el-button type="primary" @click="handlePrint">打印
|
@click="exportExcel()"
|
||||||
|
:loading="exportLoading"
|
||||||
|
>导出xlsx
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button type="primary" @click="handlePrint">打印 </el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-main class="nopadding">
|
<el-main class="nopadding">
|
||||||
<div ref="print" id="myReport" class="printContainer">
|
<div ref="print" id="myReport" class="printContainer">
|
||||||
<div style="margin-right: 20px;text-align: center;font-size: 16px;font-weight: bold;margin-bottom: 20px;">
|
<div
|
||||||
<span v-if="sflogItem.end_time">{{ sflogItem.end_time.slice(0, 10) }}{{ sflogItem.shift_name }}</span>
|
style="
|
||||||
<span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span>
|
margin-right: 20px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<span v-if="sflogItem.end_time"
|
||||||
|
>{{ sflogItem.end_time.slice(0, 10)
|
||||||
|
}}{{ sflogItem.shift_name }}</span
|
||||||
|
>
|
||||||
|
<span v-if="sflogItem.team_name">{{
|
||||||
|
sflogItem.team_name
|
||||||
|
}}</span>
|
||||||
交接班记录
|
交接班记录
|
||||||
</div>
|
</div>
|
||||||
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable">
|
<table
|
||||||
|
border="1"
|
||||||
|
width="1000"
|
||||||
|
cellspacing="0"
|
||||||
|
:key="timeStamp"
|
||||||
|
id="myTable"
|
||||||
|
>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="numCell">日期</td>
|
<td class="numCell">日期</td>
|
||||||
<td class="numCell" v-if="sflogItem.end_time">{{ sflogItem.end_time.slice(0, 10) }}</td>
|
<td class="numCell" v-if="sflogItem.end_time">
|
||||||
|
{{ sflogItem.end_time.slice(0, 10) }}
|
||||||
|
</td>
|
||||||
<td class="numCell">班次</td>
|
<td class="numCell">班次</td>
|
||||||
<td class="numCell">{{ sflogItem.shift_name }}</td>
|
<td class="numCell">
|
||||||
|
{{ sflogItem.shift_name }}
|
||||||
|
</td>
|
||||||
<td class="numCell">班组</td>
|
<td class="numCell">班组</td>
|
||||||
<td class="numCell"><span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span></td>
|
<td class="numCell">
|
||||||
|
<span v-if="sflogItem.team_name">{{
|
||||||
|
sflogItem.team_name
|
||||||
|
}}</span>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="numCell">产量(t)</td>
|
<td class="numCell">产量(t)</td>
|
||||||
<td class="numCell">{{ reportItem.total_production }}</td>
|
<td class="numCell">
|
||||||
|
{{ reportItem.total_production }}
|
||||||
|
</td>
|
||||||
<td class="numCell">台时(t/h)</td>
|
<td class="numCell">台时(t/h)</td>
|
||||||
<td class="numCell">{{ reportItem.production_hour }}</td>
|
<td class="numCell">
|
||||||
|
{{ reportItem.production_hour }}
|
||||||
|
</td>
|
||||||
<td class="numCell">运转时间(h)</td>
|
<td class="numCell">运转时间(h)</td>
|
||||||
<td class="numCell">{{ reportItem.run_hour }}</td>
|
<td class="numCell">
|
||||||
|
{{ reportItem.run_hour }}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="numCell">运转率(%)</td>
|
<td class="numCell">运转率(%)</td>
|
||||||
<td class="numCell">{{ reportItem.run_rate * 100 }}</td>
|
<td class="numCell">
|
||||||
|
{{ reportItem.run_rate * 100 }}
|
||||||
|
</td>
|
||||||
<td class="numCell">停机时长(h)</td>
|
<td class="numCell">停机时长(h)</td>
|
||||||
<td class="numCell">{{ reportItem.shut_hour }}</td>
|
<td class="numCell">
|
||||||
<td class="numCell">单位产品分布电耗(KW·h/t)</td>
|
{{ reportItem.shut_hour }}
|
||||||
<td class="numCell">{{ reportItem.elec_consume_unit }}</td>
|
</td>
|
||||||
|
<td class="numCell">
|
||||||
|
单位产品分布电耗(KW·h/t)
|
||||||
|
</td>
|
||||||
|
<td class="numCell">
|
||||||
|
{{ reportItem.elec_consume_unit }}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="numCell">单位产品标煤耗(kgce/t)</td>
|
<td class="numCell">
|
||||||
<td class="numCell">{{ reportItem.coal_consume_unit }}</td>
|
单位产品标煤耗(kgce/t)
|
||||||
|
</td>
|
||||||
|
<td class="numCell">
|
||||||
|
{{ reportItem.coal_consume_unit }}
|
||||||
|
</td>
|
||||||
<td class="numCell">熟料立升重合格率(%)</td>
|
<td class="numCell">熟料立升重合格率(%)</td>
|
||||||
<td class="numCell" v-if="reportItem.入磨熟料_立升重_rate_pass">{{ reportItem.入磨熟料_立升重_rate_pass * 100 }}</td>
|
<td
|
||||||
|
class="numCell"
|
||||||
|
v-if="reportItem.入磨熟料_立升重_rate_pass"
|
||||||
|
>
|
||||||
|
{{
|
||||||
|
reportItem.入磨熟料_立升重_rate_pass *
|
||||||
|
100
|
||||||
|
}}
|
||||||
|
</td>
|
||||||
<td class="numCell" v-else>0</td>
|
<td class="numCell" v-else>0</td>
|
||||||
<td class="numCell">熟料f-CaO合格率(%)</td>
|
<td class="numCell">熟料f-CaO合格率(%)</td>
|
||||||
<td class="numCell" v-if="reportItem['入磨熟料_f-CaO_rate_pass']">{{ reportItem['入磨熟料_f-CaO_rate_pass'] * 100 }}
|
<td
|
||||||
|
class="numCell"
|
||||||
|
v-if="
|
||||||
|
reportItem['入磨熟料_f-CaO_rate_pass']
|
||||||
|
"
|
||||||
|
>
|
||||||
|
{{
|
||||||
|
reportItem["入磨熟料_f-CaO_rate_pass"] *
|
||||||
|
100
|
||||||
|
}}
|
||||||
</td>
|
</td>
|
||||||
<td class="numCell" v-else>0</td>
|
<td class="numCell" v-else>0</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="numCell">入窑生料细度合格率(%)</td>
|
<td class="numCell">入窑生料细度合格率(%)</td>
|
||||||
<td class="numCell" v-if="reportItem.入窑生料_细度_rate_pass">{{ reportItem.入窑生料_细度_rate_pass * 100 }}</td>
|
<td
|
||||||
|
class="numCell"
|
||||||
|
v-if="reportItem.入窑生料_细度_rate_pass"
|
||||||
|
>
|
||||||
|
{{
|
||||||
|
reportItem.入窑生料_细度_rate_pass * 100
|
||||||
|
}}
|
||||||
|
</td>
|
||||||
<td class="numCell" v-else>0</td>
|
<td class="numCell" v-else>0</td>
|
||||||
<td class="numCell">入窑生料CaO合格率(%)</td>
|
<td class="numCell">入窑生料CaO合格率(%)</td>
|
||||||
<td class="numCell" v-if="reportItem.入窑生料_CaO_rate_pass">{{ reportItem.入窑生料_CaO_rate_pass * 100 }}</td>
|
<td
|
||||||
|
class="numCell"
|
||||||
|
v-if="reportItem.入窑生料_CaO_rate_pass"
|
||||||
|
>
|
||||||
|
{{
|
||||||
|
reportItem.入窑生料_CaO_rate_pass * 100
|
||||||
|
}}
|
||||||
|
</td>
|
||||||
<td class="numCell" v-else>0</td>
|
<td class="numCell" v-else>0</td>
|
||||||
<td class="numCell">入窑生料Fe₂O₃合格率(%)</td>
|
<td class="numCell">
|
||||||
<td class="numCell" v-if="reportItem.入窑生料_Fe2O3_rate_pass">{{ reportItem.入窑生料_Fe2O3_rate_pass * 100 }}</td>
|
入窑生料Fe₂O₃合格率(%)
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
class="numCell"
|
||||||
|
v-if="reportItem.入窑生料_Fe2O3_rate_pass"
|
||||||
|
>
|
||||||
|
{{
|
||||||
|
reportItem.入窑生料_Fe2O3_rate_pass *
|
||||||
|
100
|
||||||
|
}}
|
||||||
|
</td>
|
||||||
<td class="numCell" v-else>0</td>
|
<td class="numCell" v-else>0</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="numCell">入窑生料水分合格率(%)</td>
|
<td class="numCell">入窑生料水分合格率(%)</td>
|
||||||
<td class="numCell" v-if="reportItem.入窑生料_水分_rate_pass">{{ reportItem.入窑生料_水分_rate_pass * 100 }}</td>
|
<td
|
||||||
|
class="numCell"
|
||||||
|
v-if="reportItem.入窑生料_水分_rate_pass"
|
||||||
|
>
|
||||||
|
{{
|
||||||
|
reportItem.入窑生料_水分_rate_pass * 100
|
||||||
|
}}
|
||||||
|
</td>
|
||||||
<td class="numCell" v-else>0</td>
|
<td class="numCell" v-else>0</td>
|
||||||
<td class="numCell">单位成本(元/吨)</td>
|
<td class="numCell">单位成本(元/吨)</td>
|
||||||
<td class="numCell">{{ reportItem.production_cost_unit }}</td>
|
<td class="numCell">
|
||||||
|
{{ reportItem.production_cost_unit }}
|
||||||
|
</td>
|
||||||
<td class="numCell"></td>
|
<td class="numCell"></td>
|
||||||
<td class="numCell"></td>
|
<td class="numCell"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-if="sflogexpList.length > 0">
|
<tr v-if="sflogexpList.length > 0">
|
||||||
<td class="numCell" :rowspan="sflogexpList.length + 1">生产情况记录</td>
|
<td
|
||||||
|
class="numCell"
|
||||||
|
:rowspan="sflogexpList.length + 1"
|
||||||
|
>
|
||||||
|
生产情况记录
|
||||||
|
</td>
|
||||||
<td class="numCell">时间</td>
|
<td class="numCell">时间</td>
|
||||||
<td class="numCell">类别</td>
|
<td class="numCell">类别</td>
|
||||||
<td class="numCell">原因</td>
|
<td class="numCell">原因</td>
|
||||||
|
@ -156,17 +331,17 @@ export default {
|
||||||
name: "sflog",
|
name: "sflog",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
apiObj: this.$API.wpm.sflog.list,
|
apiObj: null,
|
||||||
apiObj2: null,
|
apiObj2: null,
|
||||||
query: {
|
query: {
|
||||||
shift: '',
|
shift: "",
|
||||||
team: '',
|
team: "",
|
||||||
end_time__lt: '',
|
end_time__lt: "",
|
||||||
start_time__gte: '',
|
start_time__gte: "",
|
||||||
mgroup: '3347217246321065984',
|
mgroup: "",
|
||||||
},
|
},
|
||||||
|
|
||||||
deptId: '3347207082608115712',
|
deptId: "",
|
||||||
sflogItem: {},
|
sflogItem: {},
|
||||||
options: [],
|
options: [],
|
||||||
optionsShift: [],
|
optionsShift: [],
|
||||||
|
@ -176,22 +351,30 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.$API.mtm.mgroup.list
|
||||||
|
.req({ page: 0, search: "回转窑" })
|
||||||
|
.then((res) => {
|
||||||
|
console.log("回转窑", res);
|
||||||
|
this.query.mgroup = res[0].id;
|
||||||
|
this.apiObj = this.$API.wpm.sflog.list;
|
||||||
|
this.deptId = res[0].belong_dept;
|
||||||
this.getTeam();
|
this.getTeam();
|
||||||
this.getShfit();
|
this.getShfit();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getTeam() {
|
getTeam() {
|
||||||
let form = {};
|
let form = {};
|
||||||
form.page = 0;
|
form.page = 0;
|
||||||
form.belong_dept = this.deptId;
|
form.belong_dept = this.deptId;
|
||||||
this.$API.mtm.team.list.req(form).then(res => {
|
this.$API.mtm.team.list.req(form).then((res) => {
|
||||||
this.options = res;
|
this.options = res;
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
getShfit() {
|
getShfit() {
|
||||||
this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
|
this.$API.mtm.shift.list.req({ page: 0 }).then((res) => {
|
||||||
this.optionsShift = res;
|
this.optionsShift = res;
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.$refs.table.queryData(this.query);
|
this.$refs.table.queryData(this.query);
|
||||||
|
@ -207,38 +390,42 @@ export default {
|
||||||
},
|
},
|
||||||
getSflogexp(id) {
|
getSflogexp(id) {
|
||||||
let that = this;
|
let that = this;
|
||||||
that.$API.wpm.sflogexp.list.req({ page: 0, sflog: id }).then(res => {
|
that.$API.wpm.sflogexp.list
|
||||||
|
.req({ page: 0, sflog: id })
|
||||||
|
.then((res) => {
|
||||||
that.sflogexpList = res;
|
that.sflogexpList = res;
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
getSflogItem(id) {
|
getSflogItem(id) {
|
||||||
let that = this;
|
let that = this;
|
||||||
that.$API.enm.enstat.req({ type: 'sflog', sflog: id, page: 0 }).then(res => {
|
that.$API.enm.enstat
|
||||||
|
.req({ type: "sflog", sflog: id, page: 0 })
|
||||||
|
.then((res) => {
|
||||||
if (res.length > 0) {
|
if (res.length > 0) {
|
||||||
that.reportItem = res[0];
|
that.reportItem = res[0];
|
||||||
}
|
}
|
||||||
console.log(res[0])
|
console.log(res[0]);
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
//编辑
|
//编辑
|
||||||
sflog_edit(row) {
|
sflog_edit(row) {
|
||||||
let jsonStr = JSON.stringify(row);
|
let jsonStr = JSON.stringify(row);
|
||||||
this.$TOOL.data.remove("sflogItem")
|
this.$TOOL.data.remove("sflogItem");
|
||||||
this.$TOOL.data.set('sflogItem', jsonStr)
|
this.$TOOL.data.set("sflogItem", jsonStr);
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: "logDetail",
|
name: "logDetail",
|
||||||
query: {
|
query: {
|
||||||
mgroupId: row.mgroup,
|
mgroupId: row.mgroup,
|
||||||
deptId: this.deptId
|
deptId: this.deptId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handlePrint() {
|
handlePrint() {
|
||||||
this.$PRINT('#myReport');
|
this.$PRINT("#myReport");
|
||||||
},
|
},
|
||||||
exportExcel() {
|
exportExcel() {
|
||||||
this.exportLoading = true;
|
this.exportLoading = true;
|
||||||
this.$XLSX('#myTable', this.tableName)
|
this.$XLSX("#myTable", this.tableName);
|
||||||
this.exportLoading = false;
|
this.exportLoading = false;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -265,7 +452,7 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
.searchHead {
|
.searchHead {
|
||||||
display: flex
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.middleText {
|
.middleText {
|
||||||
|
@ -279,4 +466,3 @@ export default {
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -8,20 +8,25 @@
|
||||||
:loading="exportLoading"
|
:loading="exportLoading"
|
||||||
>导出xlsx
|
>导出xlsx
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button type="primary" @click="handlePrint">打印 </el-button>
|
||||||
type="primary"
|
|
||||||
@click="handlePrint"
|
|
||||||
>打印
|
|
||||||
</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
</el-header>
|
</el-header>
|
||||||
<el-card style="margin-top: 5px">
|
<el-card style="margin-top: 5px">
|
||||||
<div class="printWrap">
|
<div class="printWrap">
|
||||||
<div ref="print" id="myReport" class="printContainer">
|
<div ref="print" id="myReport" class="printContainer">
|
||||||
<table border="1" width="1035" cellspacing="0" :key="timeStamp" class="myTable" id="myTable">
|
<table
|
||||||
|
border="1"
|
||||||
|
width="1035"
|
||||||
|
cellspacing="0"
|
||||||
|
:key="timeStamp"
|
||||||
|
class="myTable"
|
||||||
|
id="myTable"
|
||||||
|
>
|
||||||
<thead class="myTableHead">
|
<thead class="myTableHead">
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="6">回转窑工段主要设备(100KW以上)单位产品电耗数据表</th>
|
<th colspan="6">
|
||||||
|
回转窑工段主要设备(100KW以上)单位产品电耗数据表
|
||||||
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>设备名称</th>
|
<th>设备名称</th>
|
||||||
|
@ -34,26 +39,64 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="item in tableDatas" :key="item">
|
<tr v-for="item in tableDatas" :key="item">
|
||||||
<template v-for="(item1,ind) in item" :key="item1">
|
<template
|
||||||
<td v-if="ind==0||ind==1||ind==2" class="numCell">{{item1}}</td>
|
v-for="(item1, ind) in item"
|
||||||
<td v-if="ind==3" class="numCell" @click="itemClick('hour_s',item)">{{item1}}</td>
|
:key="item1"
|
||||||
<td v-if="ind==4" class="numCell" @click="itemClick('day_s',item)">{{item1}}</td>
|
>
|
||||||
<td v-if="ind==5" class="numCell" @click="itemClick('month_s',item)">{{item1}}</td>
|
<td
|
||||||
|
v-if="ind == 0 || ind == 1 || ind == 2"
|
||||||
|
class="numCell"
|
||||||
|
>
|
||||||
|
{{ item1 }}
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
v-if="ind == 3"
|
||||||
|
class="numCell"
|
||||||
|
@click="itemClick('hour_s', item)"
|
||||||
|
>
|
||||||
|
{{ item1 }}
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
v-if="ind == 4"
|
||||||
|
class="numCell"
|
||||||
|
@click="itemClick('day_s', item)"
|
||||||
|
>
|
||||||
|
{{ item1 }}
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
v-if="ind == 5"
|
||||||
|
class="numCell"
|
||||||
|
@click="itemClick('month_s', item)"
|
||||||
|
>
|
||||||
|
{{ item1 }}
|
||||||
|
</td>
|
||||||
</template>
|
</template>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div class="chartWrap">
|
<div class="chartWrap">
|
||||||
<div class="chartTitle">小时生产参数统计图</div>
|
<div class="chartTitle">小时生产参数统计图</div>
|
||||||
<scEcharts height="400px" width="1033px" :option="optionHour"></scEcharts>
|
<scEcharts
|
||||||
|
height="400px"
|
||||||
|
width="1033px"
|
||||||
|
:option="optionHour"
|
||||||
|
></scEcharts>
|
||||||
</div>
|
</div>
|
||||||
<div class="chartWrap">
|
<div class="chartWrap">
|
||||||
<div class="chartTitle">本月生产参数统计图</div>
|
<div class="chartTitle">本月生产参数统计图</div>
|
||||||
<scEcharts height="400px" width="1033px" :option="optionDay"></scEcharts>
|
<scEcharts
|
||||||
|
height="400px"
|
||||||
|
width="1033px"
|
||||||
|
:option="optionDay"
|
||||||
|
></scEcharts>
|
||||||
</div>
|
</div>
|
||||||
<div class="chartWrap">
|
<div class="chartWrap">
|
||||||
<div class="chartTitle">本年生产参数统计图</div>
|
<div class="chartTitle">本年生产参数统计图</div>
|
||||||
<scEcharts height="400px" width="1033px" :option="optionMonth"></scEcharts>
|
<scEcharts
|
||||||
|
height="400px"
|
||||||
|
width="1033px"
|
||||||
|
:option="optionMonth"
|
||||||
|
></scEcharts>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -66,67 +109,87 @@
|
||||||
:mgroup="query.mgroup"
|
:mgroup="query.mgroup"
|
||||||
:modelValue="modelValue"
|
:modelValue="modelValue"
|
||||||
:showClose="showClose"
|
:showClose="showClose"
|
||||||
:echartType='echartType'
|
:echartType="echartType"
|
||||||
@closed="asynDialog = false"
|
@closed="asynDialog = false"
|
||||||
></charts>
|
></charts>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
const colors =['#647bfe','#8698fe','#a9b6fe','#cbd3fe','#91CC75','#EE6666'];
|
const colors = [
|
||||||
|
"#647bfe",
|
||||||
|
"#8698fe",
|
||||||
|
"#a9b6fe",
|
||||||
|
"#cbd3fe",
|
||||||
|
"#91CC75",
|
||||||
|
"#EE6666",
|
||||||
|
];
|
||||||
let tooltip = {
|
let tooltip = {
|
||||||
show: true,
|
show: true,
|
||||||
trigger: 'axis',
|
trigger: "axis",
|
||||||
axisPointer: {
|
axisPointer: {
|
||||||
type: 'cross'
|
type: "cross",
|
||||||
},
|
},
|
||||||
confine: false,
|
confine: false,
|
||||||
showContent: true,
|
showContent: true,
|
||||||
triggerOn: "mousemove",
|
triggerOn: "mousemove",
|
||||||
};
|
};
|
||||||
let grid = {
|
let grid = {
|
||||||
right: '3%',
|
right: "3%",
|
||||||
left:'7%',
|
left: "7%",
|
||||||
top:'15%'
|
top: "15%",
|
||||||
};
|
};
|
||||||
let toolbox = {
|
let toolbox = {
|
||||||
right:'2%',
|
right: "2%",
|
||||||
feature: {
|
feature: {
|
||||||
dataView: { show: true, readOnly: false },
|
dataView: { show: true, readOnly: false },
|
||||||
saveAsImage: { show: true }
|
saveAsImage: { show: true },
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
let legend = {
|
let legend = {
|
||||||
top:'2%',
|
top: "2%",
|
||||||
left:'30',
|
left: "30",
|
||||||
// orient:'vertical',
|
// orient:'vertical',
|
||||||
data:['高温风机', '窑主电机', '篦冷机一室风机', '篦冷机二室风机', '篦冷机三室风机','窑头排风机','充气梁风机(左)','充气梁风机(右)']
|
data: [
|
||||||
|
"高温风机",
|
||||||
|
"窑主电机",
|
||||||
|
"篦冷机一室风机",
|
||||||
|
"篦冷机二室风机",
|
||||||
|
"篦冷机三室风机",
|
||||||
|
"窑头排风机",
|
||||||
|
"充气梁风机(左)",
|
||||||
|
"充气梁风机(右)",
|
||||||
|
],
|
||||||
};
|
};
|
||||||
let yAxis = {
|
let yAxis = {
|
||||||
type: 'value',
|
type: "value",
|
||||||
name: '分布电耗(KW.h/t)',
|
name: "分布电耗(KW.h/t)",
|
||||||
alignTicks: true,
|
alignTicks: true,
|
||||||
axisLine: {
|
axisLine: {
|
||||||
show: true,
|
show: true,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: colors[3]
|
color: colors[3],
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
formatter: '{value}'
|
formatter: "{value}",
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
import scEcharts from "@/components/scEcharts";
|
import scEcharts from "@/components/scEcharts";
|
||||||
import { defineAsyncComponent } from 'vue'
|
import { defineAsyncComponent } from "vue";
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
scEcharts,
|
scEcharts,
|
||||||
charts: defineAsyncComponent(() => import("@/components/scEnm/lineChartsdialog.vue")),
|
charts: defineAsyncComponent(() =>
|
||||||
|
import("@/components/scEnm/lineChartsdialog.vue")
|
||||||
|
),
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
exportLoading: false,
|
||||||
chartShow: false,
|
chartShow: false,
|
||||||
myOption: null,
|
myOption: null,
|
||||||
|
timeStamp: null,
|
||||||
optionHour: {},
|
optionHour: {},
|
||||||
optionDay: {},
|
optionDay: {},
|
||||||
optionMonth: {},
|
optionMonth: {},
|
||||||
|
@ -135,20 +198,20 @@
|
||||||
days: 1,
|
days: 1,
|
||||||
hours: 1,
|
hours: 1,
|
||||||
query: {
|
query: {
|
||||||
mgroup:'3347217246321065984',
|
mgroup: "",
|
||||||
},
|
},
|
||||||
tableName:'主要设备(100KW以上)单位产品电耗数据表',
|
tableName: "主要设备(100KW以上)单位产品电耗数据表",
|
||||||
tableDatas: [
|
tableDatas: [
|
||||||
['高温风机','','KW·h/t','','',''],
|
["高温风机", "", "KW·h/t", "", "", ""],
|
||||||
['窑主电机','','KW·h/t','','',''],
|
["窑主电机", "", "KW·h/t", "", "", ""],
|
||||||
],
|
],
|
||||||
modelValue: true,
|
modelValue: true,
|
||||||
type:'hour_s',
|
type: "hour_s",
|
||||||
title:'回转窑工段',
|
title: "回转窑工段",
|
||||||
cate:'',
|
cate: "",
|
||||||
apiObj: this.$API.enm.mpoint.stat,
|
apiObj: this.$API.enm.mpoint.stat,
|
||||||
showClose: true,
|
showClose: true,
|
||||||
echartType:'line',
|
echartType: "line",
|
||||||
asynDialog: false,
|
asynDialog: false,
|
||||||
allValHour: 0,
|
allValHour: 0,
|
||||||
allValDays: 0,
|
allValDays: 0,
|
||||||
|
@ -165,51 +228,51 @@
|
||||||
length: 5,
|
length: 5,
|
||||||
inside: true,
|
inside: true,
|
||||||
},
|
},
|
||||||
data: []
|
data: [],
|
||||||
},
|
},
|
||||||
yAxis: yAxis,
|
yAxis: yAxis,
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: '高温风机',
|
name: "高温风机",
|
||||||
type: 'bar',
|
type: "bar",
|
||||||
data:[]
|
data: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '窑主电机',
|
name: "窑主电机",
|
||||||
type: 'bar',
|
type: "bar",
|
||||||
data: []
|
data: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '篦冷机一室风机',
|
name: "篦冷机一室风机",
|
||||||
type: 'bar',
|
type: "bar",
|
||||||
data: []
|
data: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '篦冷机二室风机',
|
name: "篦冷机二室风机",
|
||||||
type: 'bar',
|
type: "bar",
|
||||||
data: []
|
data: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '篦冷机三室风机',
|
name: "篦冷机三室风机",
|
||||||
type: 'bar',
|
type: "bar",
|
||||||
data: []
|
data: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '窑头排风机',
|
name: "窑头排风机",
|
||||||
type: 'bar',
|
type: "bar",
|
||||||
data: []
|
data: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '充气梁风机(左)',
|
name: "充气梁风机(左)",
|
||||||
type: 'bar',
|
type: "bar",
|
||||||
data: []
|
data: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '充气梁风机(右)',
|
name: "充气梁风机(右)",
|
||||||
type: 'bar',
|
type: "bar",
|
||||||
data: []
|
data: [],
|
||||||
},
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
option2: {
|
option2: {
|
||||||
color: colors,
|
color: colors,
|
||||||
|
@ -223,51 +286,64 @@
|
||||||
length: 5,
|
length: 5,
|
||||||
inside: true,
|
inside: true,
|
||||||
},
|
},
|
||||||
data: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
|
data: [
|
||||||
|
"一月",
|
||||||
|
"二月",
|
||||||
|
"三月",
|
||||||
|
"四月",
|
||||||
|
"五月",
|
||||||
|
"六月",
|
||||||
|
"七月",
|
||||||
|
"八月",
|
||||||
|
"九月",
|
||||||
|
"十月",
|
||||||
|
"十一月",
|
||||||
|
"十二月",
|
||||||
|
],
|
||||||
},
|
},
|
||||||
yAxis: yAxis,
|
yAxis: yAxis,
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: '高温风机',
|
name: "高温风机",
|
||||||
type: 'bar',
|
type: "bar",
|
||||||
data:[]
|
data: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '窑主电机',
|
name: "窑主电机",
|
||||||
type: 'bar',
|
type: "bar",
|
||||||
data: []
|
data: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '篦冷机一室风机电机',
|
name: "篦冷机一室风机",
|
||||||
type: 'bar',
|
type: "bar",
|
||||||
data: []
|
data: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '篦冷机二室风机电机',
|
name: "篦冷机二室风机",
|
||||||
type: 'bar',
|
type: "bar",
|
||||||
data: []
|
data: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '篦冷机三室风机电机',
|
name: "篦冷机三室风机",
|
||||||
type: 'bar',
|
type: "bar",
|
||||||
data: []
|
data: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '窑头排风机主电机',
|
name: "窑头排风机",
|
||||||
type: 'bar',
|
type: "bar",
|
||||||
data: []
|
data: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '充气梁风机(左)电机',
|
name: "充气梁风机(左)",
|
||||||
type: 'bar',
|
type: "bar",
|
||||||
data: []
|
data: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '充气梁风机(右)电机',
|
name: "充气梁风机(右)",
|
||||||
type: 'bar',
|
type: "bar",
|
||||||
data: []
|
data: [],
|
||||||
},
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
option3: {
|
option3: {
|
||||||
color: colors,
|
color: colors,
|
||||||
|
@ -281,52 +357,65 @@
|
||||||
length: 5,
|
length: 5,
|
||||||
inside: true,
|
inside: true,
|
||||||
},
|
},
|
||||||
data: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
|
data: [
|
||||||
|
"一月",
|
||||||
|
"二月",
|
||||||
|
"三月",
|
||||||
|
"四月",
|
||||||
|
"五月",
|
||||||
|
"六月",
|
||||||
|
"七月",
|
||||||
|
"八月",
|
||||||
|
"九月",
|
||||||
|
"十月",
|
||||||
|
"十一月",
|
||||||
|
"十二月",
|
||||||
|
],
|
||||||
},
|
},
|
||||||
yAxis: yAxis,
|
yAxis: yAxis,
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: '高温风机',
|
name: "高温风机",
|
||||||
type: 'bar',
|
type: "bar",
|
||||||
data:[]
|
data: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '窑主电机',
|
name: "窑主电机",
|
||||||
type: 'bar',
|
type: "bar",
|
||||||
data: []
|
data: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '篦冷机一室风机电机',
|
name: "篦冷机一室风机",
|
||||||
type: 'bar',
|
type: "bar",
|
||||||
data: []
|
data: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '篦冷机二室风机电机',
|
name: "篦冷机二室风机",
|
||||||
type: 'bar',
|
type: "bar",
|
||||||
data: []
|
data: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '篦冷机三室风机电机',
|
name: "篦冷机三室风机",
|
||||||
type: 'bar',
|
type: "bar",
|
||||||
data: []
|
data: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '窑头排风机主电机',
|
name: "窑头排风机",
|
||||||
type: 'bar',
|
type: "bar",
|
||||||
data: []
|
data: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '充气梁风机(左)电机',
|
name: "充气梁风机(左)",
|
||||||
type: 'bar',
|
type: "bar",
|
||||||
data: []
|
data: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '充气梁风机(右)电机',
|
name: "充气梁风机(右)",
|
||||||
type: 'bar',
|
type: "bar",
|
||||||
data: []
|
data: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
]
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -339,8 +428,11 @@
|
||||||
let timeDate = myDate.getTime();
|
let timeDate = myDate.getTime();
|
||||||
let dayTime = 24 * 60 * 60 * 1000;
|
let dayTime = 24 * 60 * 60 * 1000;
|
||||||
//昨天的计算
|
//昨天的计算
|
||||||
let year_d = year,month_d = month,days_d = days;
|
let year_d = year,
|
||||||
if(hours<21){//21点前,查找昨日数据为前一天数据
|
month_d = month,
|
||||||
|
days_d = days;
|
||||||
|
if (hours < 21) {
|
||||||
|
//21点前,查找昨日数据为前一天数据
|
||||||
let newDate = timeDate - dayTime;
|
let newDate = timeDate - dayTime;
|
||||||
let lastDate = new Date(newDate);
|
let lastDate = new Date(newDate);
|
||||||
year_d = lastDate.getFullYear();
|
year_d = lastDate.getFullYear();
|
||||||
|
@ -354,52 +446,79 @@
|
||||||
let month_h = hourDate.getMonth() + 1;
|
let month_h = hourDate.getMonth() + 1;
|
||||||
let days_h = hourDate.getDate();
|
let days_h = hourDate.getDate();
|
||||||
let hours_h = hourDate.getHours();
|
let hours_h = hourDate.getHours();
|
||||||
|
that.$API.mtm.mgroup.list
|
||||||
|
.req({ page: 0, search: "回转窑" })
|
||||||
|
.then((res) => {
|
||||||
|
console.log("回转窑", res);
|
||||||
|
that.query.mgroup = res[0].id;
|
||||||
//本月
|
//本月
|
||||||
let params2 = {};
|
let params2 = {};
|
||||||
params2.page = 0;
|
params2.page = 0;
|
||||||
params2.year_s = year;
|
params2.year_s = year;
|
||||||
params2.month_s = month;
|
params2.month_s = month;
|
||||||
params2.type = 'month_s';
|
params2.type = "month_s";
|
||||||
params2.mgroup = this.query.mgroup;
|
params2.mgroup = this.query.mgroup;
|
||||||
|
this.$API.enm.enstat
|
||||||
this.$API.enm.enstat.req(params2).then((res2) => {
|
.req(params2)
|
||||||
|
.then((res2) => {
|
||||||
if (res2.length > 0) {
|
if (res2.length > 0) {
|
||||||
let allValMonth =that.allValMonth= res2[0].total_production;//当前条件下的总产量
|
let allValMonth = (that.allValMonth =
|
||||||
|
res2[0].total_production); //当前条件下的总产量
|
||||||
params2.mpoint__ep_monitored__power_kw__gte = 100;
|
params2.mpoint__ep_monitored__power_kw__gte = 100;
|
||||||
this.$API.enm.mpoint.stat.req(params2).then((res) => {
|
this.$API.enm.mpoint.stat
|
||||||
|
.req(params2)
|
||||||
|
.then((res) => {
|
||||||
let data2 = res;
|
let data2 = res;
|
||||||
for (let i = 0; i < data2.length; i++) {
|
for (let i = 0; i < data2.length; i++) {
|
||||||
that.tableDatas[i] = [];
|
that.tableDatas[i] = [];
|
||||||
that.tableDatas[i][0]=data2[i].ep_monitored_name;
|
that.tableDatas[i][0] =
|
||||||
that.tableDatas[i][1]=data2[i].ep_monitored_number;
|
data2[i].ep_monitored_name;
|
||||||
that.tableDatas[i][2]='KW·h/t';
|
that.tableDatas[i][1] =
|
||||||
let val = allValMonth==0?'/':(data2[i].val/allValMonth).toFixed(2);
|
data2[i].ep_monitored_number;
|
||||||
|
that.tableDatas[i][2] = "KW·h/t";
|
||||||
|
let val =
|
||||||
|
allValMonth == 0
|
||||||
|
? "/"
|
||||||
|
: (
|
||||||
|
data2[i].val /
|
||||||
|
allValMonth
|
||||||
|
).toFixed(2);
|
||||||
that.tableDatas[i][5] = val;
|
that.tableDatas[i][5] = val;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}).then(res2=>{
|
})
|
||||||
|
.then((res2) => {
|
||||||
//昨日
|
//昨日
|
||||||
let params3 = {};
|
let params3 = {};
|
||||||
params3.page = 0;
|
params3.page = 0;
|
||||||
params3.year_s = year_d;
|
params3.year_s = year_d;
|
||||||
params3.month_s = month_d;
|
params3.month_s = month_d;
|
||||||
params3.day_s = days_d;
|
params3.day_s = days_d;
|
||||||
params3.type = 'day_s';
|
params3.type = "day_s";
|
||||||
params3.mgroup = this.query.mgroup;
|
params3.mgroup = this.query.mgroup;
|
||||||
this.$API.enm.enstat.req(params3).then((res3) => {
|
this.$API.enm.enstat.req(params3).then((res3) => {
|
||||||
if (res3.length > 0) {
|
if (res3.length > 0) {
|
||||||
let allValDays =that.allValDays= res3[0].total_production;
|
let allValDays = (that.allValDays =
|
||||||
|
res3[0].total_production);
|
||||||
params3.mpoint__ep_monitored__power_kw__gte = 100;
|
params3.mpoint__ep_monitored__power_kw__gte = 100;
|
||||||
this.$API.enm.mpoint.stat.req(params3).then((res) => {
|
this.$API.enm.mpoint.stat
|
||||||
|
.req(params3)
|
||||||
|
.then((res) => {
|
||||||
let data3 = res3;
|
let data3 = res3;
|
||||||
for (let j = 0; j < data3.length; j++) {
|
for (let j = 0; j < data3.length; j++) {
|
||||||
let val = allValDays==0?'/':(data3[j].val/allValDays).toFixed(2);
|
let val =
|
||||||
|
allValDays == 0
|
||||||
|
? "/"
|
||||||
|
: (
|
||||||
|
data3[j].val /
|
||||||
|
allValDays
|
||||||
|
).toFixed(2);
|
||||||
that.tableDatas[j][4] = val;
|
that.tableDatas[j][4] = val;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
//上小时
|
//上小时
|
||||||
let params4 = {};
|
let params4 = {};
|
||||||
params4.page = 0;
|
params4.page = 0;
|
||||||
|
@ -407,26 +526,35 @@
|
||||||
params4.month = month_h;
|
params4.month = month_h;
|
||||||
params4.day = days_h;
|
params4.day = days_h;
|
||||||
params4.hour = hours_h;
|
params4.hour = hours_h;
|
||||||
params4.type = 'hour_s';
|
params4.type = "hour_s";
|
||||||
params4.mgroup = this.query.mgroup;
|
params4.mgroup = this.query.mgroup;
|
||||||
this.$API.enm.enstat.req(params4).then((res4) => {
|
this.$API.enm.enstat.req(params4).then((res4) => {
|
||||||
if (res4.length > 0) {
|
if (res4.length > 0) {
|
||||||
let hourProduct = that.allValHour=res4[0].total_production;
|
let hourProduct = (that.allValHour =
|
||||||
|
res4[0].total_production);
|
||||||
params4.mpoint__ep_monitored__power_kw__gte = 100;
|
params4.mpoint__ep_monitored__power_kw__gte = 100;
|
||||||
this.$API.enm.mpoint.stat.req(params4).then((res) => {
|
this.$API.enm.mpoint.stat
|
||||||
|
.req(params4)
|
||||||
|
.then((res) => {
|
||||||
let data4 = res4;
|
let data4 = res4;
|
||||||
for (let k = 0; k < data4.length; k++) {
|
for (let k = 0; k < data4.length; k++) {
|
||||||
let val = hourProduct==0?'/':(data4[k].val/hourProduct).toFixed(2);
|
let val =
|
||||||
|
hourProduct == 0
|
||||||
|
? "/"
|
||||||
|
: (
|
||||||
|
data4[k].val /
|
||||||
|
hourProduct
|
||||||
|
).toFixed(2);
|
||||||
that.tableDatas[k][3] = val;
|
that.tableDatas[k][3] = val;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
that.getHourData();
|
that.getHourData();
|
||||||
that.getDayData();
|
that.getDayData();
|
||||||
that.getMonthData();
|
that.getMonthData();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//获取小时数据
|
//获取小时数据
|
||||||
|
@ -437,37 +565,46 @@
|
||||||
query.year_s = that.year;
|
query.year_s = that.year;
|
||||||
query.month_s = that.month;
|
query.month_s = that.month;
|
||||||
query.day_s = that.days;
|
query.day_s = that.days;
|
||||||
query.type = 'hour_s';
|
query.type = "hour_s";
|
||||||
query.mgroup = that.query.mgroup;
|
query.mgroup = that.query.mgroup;
|
||||||
query.mpoint__ep_monitored__power_kw__gte = 100;
|
query.mpoint__ep_monitored__power_kw__gte = 100;
|
||||||
this.$API.enm.mpoint.stat.req(query).then((response) => {
|
this.$API.enm.mpoint.stat.req(query).then((response) => {
|
||||||
let seriesData0 = [],seriesData1 = [], seriesData2 = [],
|
let seriesData0 = [],
|
||||||
seriesData3 = [],seriesData4 = [],seriesData5 = [],
|
seriesData1 = [],
|
||||||
seriesData6 = [],seriesData7 = [];
|
seriesData2 = [],
|
||||||
|
seriesData3 = [],
|
||||||
|
seriesData4 = [],
|
||||||
|
seriesData5 = [],
|
||||||
|
seriesData6 = [],
|
||||||
|
seriesData7 = [];
|
||||||
let data = response;
|
let data = response;
|
||||||
data.forEach(item => {
|
data.forEach((item) => {
|
||||||
let ind = item.hour;
|
let ind = item.hour;
|
||||||
let val = 0;
|
let val = 0;
|
||||||
if (that.allValHour == 0) {
|
if (that.allValHour == 0) {
|
||||||
val = ''
|
val = "";
|
||||||
} else {
|
} else {
|
||||||
val = (item.val / that.allValHour).toFixed(2);
|
val = (item.val / that.allValHour).toFixed(2);
|
||||||
}
|
}
|
||||||
if(item.equip_name=='高温风机'){
|
if (item.equip_name == "高温风机") {
|
||||||
seriesData0[ind] = val;
|
seriesData0[ind] = val;
|
||||||
}else if(item.equip_name=='窑主电机'){
|
} else if (item.equip_name == "窑主电机") {
|
||||||
seriesData1[ind] = val;
|
seriesData1[ind] = val;
|
||||||
}else if(item.equip_name=='篦冷机一室风机电机'){
|
} else if (item.equip_name == "篦冷机一室风机电机") {
|
||||||
seriesData2[ind] = val;
|
seriesData2[ind] = val;
|
||||||
}else if(item.equip_name=='篦冷机二室风机电机'){
|
} else if (item.equip_name == "篦冷机二室风机电机") {
|
||||||
seriesData3[ind] = val;
|
seriesData3[ind] = val;
|
||||||
}else if(item.equip_name=='篦冷机三室风机电机'){
|
} else if (item.equip_name == "篦冷机三室风机电机") {
|
||||||
seriesData4[ind] = val;
|
seriesData4[ind] = val;
|
||||||
}else if(item.equip_name=='窑头排风机主电机'){
|
} else if (item.equip_name == "窑头排风机主电机") {
|
||||||
seriesData5[ind] = val;
|
seriesData5[ind] = val;
|
||||||
}else if(item.equip_name=='篦冷机一室充气梁风机(左)电机'){
|
} else if (
|
||||||
|
item.equip_name == "篦冷机一室充气梁风机(左)电机"
|
||||||
|
) {
|
||||||
seriesData6[ind] = val;
|
seriesData6[ind] = val;
|
||||||
}else if(item.equip_name=='篦冷机一室充气梁风机(右)电机'){
|
} else if (
|
||||||
|
item.equip_name == "篦冷机一室充气梁风机(右)电机"
|
||||||
|
) {
|
||||||
seriesData7[ind] = val;
|
seriesData7[ind] = val;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -482,12 +619,12 @@
|
||||||
options.series[7].data = seriesData4;
|
options.series[7].data = seriesData4;
|
||||||
let hourXAxis = [];
|
let hourXAxis = [];
|
||||||
for (let i = 1; i <= that.hours; i++) {
|
for (let i = 1; i <= that.hours; i++) {
|
||||||
let item = i+'时'
|
let item = i + "时";
|
||||||
hourXAxis.push(item)
|
hourXAxis.push(item);
|
||||||
}
|
}
|
||||||
options.xAxis.data = hourXAxis;
|
options.xAxis.data = hourXAxis;
|
||||||
that.optionHour = options;
|
that.optionHour = options;
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
//获取天数据
|
//获取天数据
|
||||||
getDayData() {
|
getDayData() {
|
||||||
|
@ -496,38 +633,47 @@
|
||||||
query1.page = 0;
|
query1.page = 0;
|
||||||
query1.year_s = that.year;
|
query1.year_s = that.year;
|
||||||
query1.month_s = that.month;
|
query1.month_s = that.month;
|
||||||
query1.type = 'day_s';
|
query1.type = "day_s";
|
||||||
query1.mgroup = this.query.mgroup;
|
query1.mgroup = this.query.mgroup;
|
||||||
query1.mpoint__ep_monitored__power_kw__gte = 100;
|
query1.mpoint__ep_monitored__power_kw__gte = 100;
|
||||||
this.$API.enm.enstat.req(query1).then((response) => {
|
this.$API.enm.enstat.req(query1).then((response) => {
|
||||||
let seriesData0 = [],seriesData1 = [], seriesData2 = [],
|
let seriesData0 = [],
|
||||||
seriesData3 = [],seriesData4 = [],seriesData5 = [],
|
seriesData1 = [],
|
||||||
seriesData6 = [],seriesData7 = [];
|
seriesData2 = [],
|
||||||
|
seriesData3 = [],
|
||||||
|
seriesData4 = [],
|
||||||
|
seriesData5 = [],
|
||||||
|
seriesData6 = [],
|
||||||
|
seriesData7 = [];
|
||||||
let data = response;
|
let data = response;
|
||||||
data.forEach(item => {
|
data.forEach((item) => {
|
||||||
// debugger;
|
// debugger;
|
||||||
let ind = item.day_s;
|
let ind = item.day_s;
|
||||||
let val = 0;
|
let val = 0;
|
||||||
if (that.allValDays == 0) {
|
if (that.allValDays == 0) {
|
||||||
val = ''
|
val = "";
|
||||||
} else {
|
} else {
|
||||||
val = (item.val / that.allValDays).toFixed(2);
|
val = (item.val / that.allValDays).toFixed(2);
|
||||||
}
|
}
|
||||||
if(item.equip_name=='高温风机'){
|
if (item.equip_name == "高温风机") {
|
||||||
seriesData0[ind] = val;
|
seriesData0[ind] = val;
|
||||||
}else if(item.equip_name=='窑主电机'){
|
} else if (item.equip_name == "窑主电机") {
|
||||||
seriesData1[ind] = val;
|
seriesData1[ind] = val;
|
||||||
}else if(item.equip_name=='篦冷机一室风机电机'){
|
} else if (item.equip_name == "篦冷机一室风机电机") {
|
||||||
seriesData2[ind] = val;
|
seriesData2[ind] = val;
|
||||||
}else if(item.equip_name=='篦冷机二室风机电机'){
|
} else if (item.equip_name == "篦冷机二室风机电机") {
|
||||||
seriesData3[ind] = val;
|
seriesData3[ind] = val;
|
||||||
}else if(item.equip_name=='篦冷机三室风机电机'){
|
} else if (item.equip_name == "篦冷机三室风机电机") {
|
||||||
seriesData4[ind] = val;
|
seriesData4[ind] = val;
|
||||||
}else if(item.equip_name=='窑头排风机主电机'){
|
} else if (item.equip_name == "窑头排风机主电机") {
|
||||||
seriesData5[ind] = val;
|
seriesData5[ind] = val;
|
||||||
}else if(item.equip_name=='篦冷机一室充气梁风机(左)电机'){
|
} else if (
|
||||||
|
item.equip_name == "篦冷机一室充气梁风机(左)电机"
|
||||||
|
) {
|
||||||
seriesData6[ind] = val;
|
seriesData6[ind] = val;
|
||||||
}else if(item.equip_name=='篦冷机一室充气梁风机(右)电机'){
|
} else if (
|
||||||
|
item.equip_name == "篦冷机一室充气梁风机(右)电机"
|
||||||
|
) {
|
||||||
seriesData7[ind] = val;
|
seriesData7[ind] = val;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -542,12 +688,12 @@
|
||||||
options.series[7].data = seriesData4;
|
options.series[7].data = seriesData4;
|
||||||
let dayXAxis = [];
|
let dayXAxis = [];
|
||||||
for (let i = 1; i <= that.days; i++) {
|
for (let i = 1; i <= that.days; i++) {
|
||||||
let item = i+'日'
|
let item = i + "日";
|
||||||
dayXAxis.push(item)
|
dayXAxis.push(item);
|
||||||
}
|
}
|
||||||
options.xAxis.data = dayXAxis;
|
options.xAxis.data = dayXAxis;
|
||||||
that.optionDay = options;
|
that.optionDay = options;
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
//获取月数据
|
//获取月数据
|
||||||
getMonthData() {
|
getMonthData() {
|
||||||
|
@ -555,37 +701,46 @@
|
||||||
let query2 = {};
|
let query2 = {};
|
||||||
query2.page = 0;
|
query2.page = 0;
|
||||||
query2.year_s = that.year;
|
query2.year_s = that.year;
|
||||||
query2.type = 'month_s';
|
query2.type = "month_s";
|
||||||
query2.mgroup = that.query.mgroup;
|
query2.mgroup = that.query.mgroup;
|
||||||
query2.mpoint__ep_monitored__power_kw__gte = 100;
|
query2.mpoint__ep_monitored__power_kw__gte = 100;
|
||||||
this.$API.enm.enstat.req(query2).then((response) => {
|
this.$API.enm.enstat.req(query2).then((response) => {
|
||||||
let seriesData0 = [],seriesData1 = [], seriesData2 = [],
|
let seriesData0 = [],
|
||||||
seriesData3 = [],seriesData4 = [],seriesData5 = [],
|
seriesData1 = [],
|
||||||
seriesData6 = [],seriesData7 = [];
|
seriesData2 = [],
|
||||||
|
seriesData3 = [],
|
||||||
|
seriesData4 = [],
|
||||||
|
seriesData5 = [],
|
||||||
|
seriesData6 = [],
|
||||||
|
seriesData7 = [];
|
||||||
let data = response;
|
let data = response;
|
||||||
data.forEach(item => {
|
data.forEach((item) => {
|
||||||
let ind = item.month_s;
|
let ind = item.month_s;
|
||||||
let val = 0;
|
let val = 0;
|
||||||
if (that.allValMonth == 0) {
|
if (that.allValMonth == 0) {
|
||||||
val = ''
|
val = "";
|
||||||
} else {
|
} else {
|
||||||
val = (item.val / that.allValMonth).toFixed(2);
|
val = (item.val / that.allValMonth).toFixed(2);
|
||||||
}
|
}
|
||||||
if(item.equip_name=='高温风机'){
|
if (item.equip_name == "高温风机") {
|
||||||
seriesData0[ind] = val;
|
seriesData0[ind] = val;
|
||||||
}else if(item.equip_name=='窑主电机'){
|
} else if (item.equip_name == "窑主电机") {
|
||||||
seriesData1[ind] = val;
|
seriesData1[ind] = val;
|
||||||
}else if(item.equip_name=='篦冷机一室风机电机'){
|
} else if (item.equip_name == "篦冷机一室风机电机") {
|
||||||
seriesData2[ind] = val;
|
seriesData2[ind] = val;
|
||||||
}else if(item.equip_name=='篦冷机二室风机电机'){
|
} else if (item.equip_name == "篦冷机二室风机电机") {
|
||||||
seriesData3[ind] = val;
|
seriesData3[ind] = val;
|
||||||
}else if(item.equip_name=='篦冷机三室风机电机'){
|
} else if (item.equip_name == "篦冷机三室风机电机") {
|
||||||
seriesData4[ind] = val;
|
seriesData4[ind] = val;
|
||||||
}else if(item.equip_name=='窑头排风机主电机'){
|
} else if (item.equip_name == "窑头排风机主电机") {
|
||||||
seriesData5[ind] = val;
|
seriesData5[ind] = val;
|
||||||
}else if(item.equip_name=='篦冷机一室充气梁风机(左)电机'){
|
} else if (
|
||||||
|
item.equip_name == "篦冷机一室充气梁风机(左)电机"
|
||||||
|
) {
|
||||||
seriesData6[ind] = val;
|
seriesData6[ind] = val;
|
||||||
}else if(item.equip_name=='篦冷机一室充气梁风机(右)电机'){
|
} else if (
|
||||||
|
item.equip_name == "篦冷机一室充气梁风机(右)电机"
|
||||||
|
) {
|
||||||
seriesData7[ind] = val;
|
seriesData7[ind] = val;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -600,12 +755,12 @@
|
||||||
options.series[7].data = seriesData4;
|
options.series[7].data = seriesData4;
|
||||||
let monthXAxis = [];
|
let monthXAxis = [];
|
||||||
for (let i = 1; i <= that.month; i++) {
|
for (let i = 1; i <= that.month; i++) {
|
||||||
let item = i+'月'
|
let item = i + "月";
|
||||||
monthXAxis.push(item)
|
monthXAxis.push(item);
|
||||||
}
|
}
|
||||||
options.xAxis.data = monthXAxis;
|
options.xAxis.data = monthXAxis;
|
||||||
that.optionMonth = options;
|
that.optionMonth = options;
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
itemClick(type, item) {
|
itemClick(type, item) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
@ -613,14 +768,14 @@
|
||||||
this.asynDialog = true;
|
this.asynDialog = true;
|
||||||
},
|
},
|
||||||
handlePrint() {
|
handlePrint() {
|
||||||
this.$PRINT('#myReport');
|
this.$PRINT("#myReport");
|
||||||
},
|
},
|
||||||
exportExcel() {
|
exportExcel() {
|
||||||
this.exportLoading = true;
|
this.exportLoading = true;
|
||||||
this.$XLSX('#myTable', this.tableName)
|
this.$XLSX("#myTable", this.tableName);
|
||||||
this.exportLoading = false;
|
this.exportLoading = false;
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -21,17 +21,20 @@
|
||||||
:loading="exportLoading"
|
:loading="exportLoading"
|
||||||
>导出xlsx
|
>导出xlsx
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button type="primary" @click="handlePrint">打印 </el-button>
|
||||||
type="primary"
|
|
||||||
@click="handlePrint"
|
|
||||||
>打印
|
|
||||||
</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
</el-header>
|
</el-header>
|
||||||
<el-card style="margin-top: 5px">
|
<el-card style="margin-top: 5px">
|
||||||
<div class="printWrap">
|
<div class="printWrap">
|
||||||
<div ref="print" id="myReport" class="printContainer">
|
<div ref="print" id="myReport" class="printContainer">
|
||||||
<table border="1" width="3200" cellspacing="0" :key="timeStamp" id="myTable" class="myTable">
|
<table
|
||||||
|
border="1"
|
||||||
|
width="3200"
|
||||||
|
cellspacing="0"
|
||||||
|
:key="timeStamp"
|
||||||
|
id="myTable"
|
||||||
|
class="myTable"
|
||||||
|
>
|
||||||
<thead class="myTableHead">
|
<thead class="myTableHead">
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="32">回转窑工段班组月度对比分析</th>
|
<th colspan="32">回转窑工段班组月度对比分析</th>
|
||||||
|
@ -82,7 +85,13 @@
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tr v-for="(item, index) in tableDatas" :key="index">
|
<tr v-for="(item, index) in tableDatas" :key="index">
|
||||||
<td v-for="(item0,index0) in item" :key="index0" class="numCell">{{item0}}</td>
|
<td
|
||||||
|
v-for="(item0, index0) in item"
|
||||||
|
:key="index0"
|
||||||
|
class="numCell"
|
||||||
|
>
|
||||||
|
{{ item0 }}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
@ -96,70 +105,100 @@
|
||||||
return {
|
return {
|
||||||
timeStamp: 0,
|
timeStamp: 0,
|
||||||
query: {
|
query: {
|
||||||
year_s:'',
|
year_s: "",
|
||||||
page: 0,
|
page: 0,
|
||||||
type : 'month_st',
|
type: "month_st",
|
||||||
mgroup:'3347217246321065984',
|
mgroup: "",
|
||||||
},
|
},
|
||||||
tableDatas: [],
|
tableDatas: [],
|
||||||
|
exportLoading: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
let that = this;
|
let that = this;
|
||||||
var myDate = new Date();
|
var myDate = new Date();
|
||||||
let year = myDate.getFullYear();
|
let year = myDate.getFullYear();
|
||||||
|
this.timeStamp = myDate.getTime();
|
||||||
that.query.year_s = year;
|
that.query.year_s = year;
|
||||||
this.getData();
|
this.$API.mtm.mgroup.list
|
||||||
|
.req({ page: 0, search: "回转窑" })
|
||||||
|
.then((res) => {
|
||||||
|
console.log("回转窑", res);
|
||||||
|
that.query.mgroup = res[0].id;
|
||||||
|
that.getGoalData();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getData(){
|
getGoalData() {
|
||||||
|
let that = this;
|
||||||
|
let params = {};
|
||||||
|
params.page = 0;
|
||||||
|
params.year = that.query.year_s;
|
||||||
|
params.mgroup = that.query.mgroup;
|
||||||
|
this.$API.mtm.goal.list.req(params).then((res) => {
|
||||||
|
let data = [];
|
||||||
|
if (res.length > 0) {
|
||||||
|
data = res[0];
|
||||||
|
}
|
||||||
|
that.getData(data);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getData(goalData) {
|
||||||
let that = this;
|
let that = this;
|
||||||
let query0 = {};
|
let query0 = {};
|
||||||
query0.page = 0;
|
query0.page = 0;
|
||||||
query0.type='month_st';
|
query0.type = "month_st";
|
||||||
query0.year_s = that.query.year_s - 1;
|
query0.year_s = that.query.year_s - 1;
|
||||||
query0.mgroup='3347217246321065984';
|
query0.mgroup = that.query.mgroup;
|
||||||
let wrapArr = [],wrapArr0 = [] ,wrapArrs = [];
|
let wrapArr = [],
|
||||||
|
wrapArr0 = [],
|
||||||
|
wrapArrs = [];
|
||||||
this.$API.enm.enstat.req(query0).then((res0) => {
|
this.$API.enm.enstat.req(query0).then((res0) => {
|
||||||
let data0 = res0;
|
let data0 = res0;
|
||||||
debugger;
|
debugger;
|
||||||
if (data0.length > 0) {
|
if (data0.length > 0) {
|
||||||
data0.forEach(item0 => {
|
data0.forEach((item0) => {
|
||||||
//先按月份排序,再按班组排序
|
//先按月份排序,再按班组排序
|
||||||
let n0 = item0.month_s;
|
let n0 = item0.month_s;
|
||||||
let ind0 = 0;
|
let ind0 = 0;
|
||||||
if(team_name0.indexOf('甲')>-1){
|
let team_name0 = item0.team_name;
|
||||||
|
let arr0 = [];
|
||||||
|
arr0[0] = n0;
|
||||||
|
arr0[1] = team_name0;
|
||||||
|
arr0[2] = item0.total_output_unit;
|
||||||
|
arr0[3] = item0.total_output_unit;
|
||||||
|
arr0[4] = item0.run_rate_unit;
|
||||||
|
if (team_name0.indexOf("甲") > -1) {
|
||||||
ind0 = (n0 - 1) * 3;
|
ind0 = (n0 - 1) * 3;
|
||||||
}else if(team_name0.indexOf('乙')>-1){
|
} else if (team_name0.indexOf("乙") > -1) {
|
||||||
ind0 = (n0 - 1) * 3 + 1;
|
ind0 = (n0 - 1) * 3 + 1;
|
||||||
}else if(team_name0.indexOf('丙')>-1){
|
} else if (team_name0.indexOf("丙") > -1) {
|
||||||
ind0 = (n0 - 1) * 3 + 2;
|
ind0 = (n0 - 1) * 3 + 2;
|
||||||
}
|
}
|
||||||
wrapArr0[ind0] = item0;
|
wrapArr0[ind0] = item0;
|
||||||
});
|
});
|
||||||
debugger;
|
debugger;
|
||||||
console.log(wrapArr0)
|
console.log(wrapArr0);
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
this.$API.enm.enstat.req(that.query).then((res) => {
|
this.$API.enm.enstat.req(that.query).then((res) => {
|
||||||
let data = res;
|
let data = res;
|
||||||
if (data.length > 0) {
|
if (data.length > 0) {
|
||||||
data.forEach(item => {
|
data.forEach((item) => {
|
||||||
//先按月份排序,再按班组排序
|
//先按月份排序,再按班组排序
|
||||||
let n = item.month_s;
|
let n = item.month_s;
|
||||||
let team_name = item.team_name;
|
let team_name = item.team_name;
|
||||||
let ind = 0;
|
let ind = 0;
|
||||||
if(team_name.indexOf('甲')>-1){
|
if (team_name.indexOf("甲") > -1) {
|
||||||
ind = (n - 1) * 3;
|
ind = (n - 1) * 3;
|
||||||
}else if(team_name.indexOf('乙')>-1){
|
} else if (team_name.indexOf("乙") > -1) {
|
||||||
ind = (n - 1) * 3 + 1;
|
ind = (n - 1) * 3 + 1;
|
||||||
}else if(team_name.indexOf('丙')>-1){
|
} else if (team_name.indexOf("丙") > -1) {
|
||||||
ind = (n - 1) * 3 + 2;
|
ind = (n - 1) * 3 + 2;
|
||||||
}
|
}
|
||||||
wrapArrs[ind] = item;
|
wrapArrs[ind] = item;
|
||||||
let arr = [];
|
let arr = [];
|
||||||
let time = ''+item.year_s+'.'+item.month_s;
|
let time = "" + item.year_s + "." + item.month_s;
|
||||||
arr.push(time);
|
arr.push(time);
|
||||||
arr.push(item.team_name);
|
arr.push(item.team_name);
|
||||||
arr.push(item.total_production);
|
arr.push(item.total_production);
|
||||||
|
@ -167,24 +206,50 @@
|
||||||
arr.push(item.run_rate);
|
arr.push(item.run_rate);
|
||||||
arr.push(item.production_cost_unit);
|
arr.push(item.production_cost_unit);
|
||||||
//质量
|
//质量
|
||||||
arr[6]=item.入窑生料_CaO_rate_pass!=null?item.入窑生料_CaO_rate_pass:'/';
|
arr[6] =
|
||||||
arr[7]=item.入窑生料_Fe2O3_rate_pass!=null?item.入窑生料_Fe2O3_rate_pass:'/';
|
item.入窑生料_CaO_rate_pass != null
|
||||||
arr[8]=item.入窑生料_细度_rate_pass!=null?item.入窑生料_细度_rate_pass:'/';
|
? item.入窑生料_CaO_rate_pass
|
||||||
arr[9]=item.入窑生料_水分_rate_pass!=null?item.入窑生料_水分_rate_pass:'/';
|
: "/";
|
||||||
arr[10]=item.熟料_立升重_rate_pass!=null?item.熟料_立升重_rate_pass:'/';
|
arr[7] =
|
||||||
arr[11]=item.熟料_fCaO_rate_pass!=null?item.熟料_fCaO_rate_pass:'/';
|
item.入窑生料_Fe2O3_rate_pass != null
|
||||||
|
? item.入窑生料_Fe2O3_rate_pass
|
||||||
|
: "/";
|
||||||
|
arr[8] =
|
||||||
|
item.入窑生料_细度_rate_pass != null
|
||||||
|
? item.入窑生料_细度_rate_pass
|
||||||
|
: "/";
|
||||||
|
arr[9] =
|
||||||
|
item.入窑生料_水分_rate_pass != null
|
||||||
|
? item.入窑生料_水分_rate_pass
|
||||||
|
: "/";
|
||||||
|
arr[10] =
|
||||||
|
item.熟料_立升重_rate_pass != null
|
||||||
|
? item.熟料_立升重_rate_pass
|
||||||
|
: "/";
|
||||||
|
arr[11] =
|
||||||
|
item.熟料_fCaO_rate_pass != null
|
||||||
|
? item.熟料_fCaO_rate_pass
|
||||||
|
: "/";
|
||||||
|
|
||||||
//煤耗
|
//煤耗
|
||||||
arr[12]=item.elec_consume_unit//当期值(KW·h/t)
|
arr[12] = item.elec_consume_unit; //当期值(KW·h/t)
|
||||||
arr[13]=item.celec_consume_unit;//目标值(KW·h/t)//需要接口获取
|
let keyVale = "goal_val_" + n;
|
||||||
arr[14]=item.celec_consume_unit;//当期与目标差值(KW·h/t)
|
arr[5] = goalData[keyVale]; //目标值(KW·h/t)//需要接口获取
|
||||||
let ind_pre = 0,huanbi = 0;
|
arr[6] = arr[4] - item.celec_consume_unit; //当期与目标差值(KW·h/t)
|
||||||
|
let ind_pre = 0,
|
||||||
|
huanbi = 0;
|
||||||
if (item.month_s == 1) {
|
if (item.month_s == 1) {
|
||||||
ind_pre = 12;
|
ind_pre = 12;
|
||||||
huanbi = wrapArr0[ind_pre]?wrapArr0[ind_pre].elec_consume_unit:'/';
|
huanbi = wrapArr0[ind_pre]
|
||||||
|
? wrapArr0[ind_pre].elec_consume_unit
|
||||||
|
: "/";
|
||||||
} else {
|
} else {
|
||||||
ind_pre = ind - 1;
|
ind_pre = ind - 1;
|
||||||
huanbi = wrapArr[ind_pre]?wrapArr[ind_pre].elec_consume_unit?wrapArr[ind_pre].elec_consume_unit:'/':'/'
|
huanbi = wrapArr[ind_pre]
|
||||||
|
? wrapArr[ind_pre].elec_consume_unit
|
||||||
|
? wrapArr[ind_pre].elec_consume_unit
|
||||||
|
: "/"
|
||||||
|
: "/";
|
||||||
}
|
}
|
||||||
arr[15] = huanbi; //环期值(KW·h/t)上个月的值
|
arr[15] = huanbi; //环期值(KW·h/t)上个月的值
|
||||||
arr[16] = item.celec_consume_unit; //当期与环期差值(KW·h/t)
|
arr[16] = item.celec_consume_unit; //当期与环期差值(KW·h/t)
|
||||||
|
@ -192,21 +257,43 @@
|
||||||
arr[18] = item.celec_consume_unit; //同比增长率(%)
|
arr[18] = item.celec_consume_unit; //同比增长率(%)
|
||||||
//电耗
|
//电耗
|
||||||
//设备
|
//设备
|
||||||
arr[19]=item.高温风机_consume_unit!=null?item.高温风机_consume_unit:'/';
|
arr[19] =
|
||||||
arr[20]=item.篦冷机一室风机_consume_unit!=null?item.篦冷机一室风机_consume_unit:'/';
|
item.高温风机_consume_unit != null
|
||||||
arr[21]=item.篦冷机三室风机_consume_unit!=null?item.篦冷机三室风机_consume_unit:'/';
|
? item.高温风机_consume_unit
|
||||||
arr[22]=item.篦冷机二室风机_consume_unit!=null?item.篦冷机二室风机_consume_unit:'/';
|
: "/";
|
||||||
arr[23]=item.窑头排风机_consume_unit!=null?item.窑头排风机_consume_unit:'/';
|
arr[20] =
|
||||||
arr[24]=item.elec_consume_unit//当期值(KW·h/t)
|
item.篦冷机一室风机_consume_unit != null
|
||||||
|
? item.篦冷机一室风机_consume_unit
|
||||||
|
: "/";
|
||||||
|
arr[21] =
|
||||||
|
item.篦冷机三室风机_consume_unit != null
|
||||||
|
? item.篦冷机三室风机_consume_unit
|
||||||
|
: "/";
|
||||||
|
arr[22] =
|
||||||
|
item.篦冷机二室风机_consume_unit != null
|
||||||
|
? item.篦冷机二室风机_consume_unit
|
||||||
|
: "/";
|
||||||
|
arr[23] =
|
||||||
|
item.窑头排风机_consume_unit != null
|
||||||
|
? item.窑头排风机_consume_unit
|
||||||
|
: "/";
|
||||||
|
arr[24] = item.elec_consume_unit; //当期值(KW·h/t)
|
||||||
arr[25] = item.celec_consume_unit; //目标值(KW·h/t)//需要接口获取
|
arr[25] = item.celec_consume_unit; //目标值(KW·h/t)//需要接口获取
|
||||||
arr[26] = item.celec_consume_unit; //当期与目标差值(KW·h/t)
|
arr[26] = item.celec_consume_unit; //当期与目标差值(KW·h/t)
|
||||||
let ind_pre1 = 0,huanbi1 = 0;
|
let ind_pre1 = 0,
|
||||||
|
huanbi1 = 0;
|
||||||
if (item.month_s == 1) {
|
if (item.month_s == 1) {
|
||||||
ind_pre1 = 12;
|
ind_pre1 = 12;
|
||||||
huanbi1 = wrapArr0[ind_pre]?wrapArr0[ind_pre].elec_consume_unit:'/';
|
huanbi1 = wrapArr0[ind_pre]
|
||||||
|
? wrapArr0[ind_pre].elec_consume_unit
|
||||||
|
: "/";
|
||||||
} else {
|
} else {
|
||||||
ind_pre1 = ind - 1;
|
ind_pre1 = ind - 1;
|
||||||
huanbi1 = wrapArr[ind_pre]?wrapArr[ind_pre].elec_consume_unit?wrapArr[ind_pre].elec_consume_unit:'/':'/'
|
huanbi1 = wrapArr[ind_pre]
|
||||||
|
? wrapArr[ind_pre].elec_consume_unit
|
||||||
|
? wrapArr[ind_pre].elec_consume_unit
|
||||||
|
: "/"
|
||||||
|
: "/";
|
||||||
}
|
}
|
||||||
arr[27] = huanbi; //环期值(KW·h/t)上个月的值
|
arr[27] = huanbi; //环期值(KW·h/t)上个月的值
|
||||||
arr[28] = item.celec_consume_unit; //当期与环期差值(KW·h/t)
|
arr[28] = item.celec_consume_unit; //当期与环期差值(KW·h/t)
|
||||||
|
@ -215,16 +302,16 @@
|
||||||
arr[31] = item.celec_consume_unit; //同比增长率(%)
|
arr[31] = item.celec_consume_unit; //同比增长率(%)
|
||||||
wrapArr[ind] = arr;
|
wrapArr[ind] = arr;
|
||||||
});
|
});
|
||||||
console.log(wrapArr)
|
console.log(wrapArr);
|
||||||
that.tableDatas = wrapArr;
|
that.tableDatas = wrapArr;
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.tableDatas = [];
|
this.tableDatas = [];
|
||||||
this.getData();
|
this.getGoalData();
|
||||||
},
|
},
|
||||||
itemClick(type, item) {
|
itemClick(type, item) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
@ -232,24 +319,22 @@
|
||||||
},
|
},
|
||||||
itemClick1(type, item) {
|
itemClick1(type, item) {
|
||||||
this.chartShow = false;
|
this.chartShow = false;
|
||||||
this.$API.bi.dataset.exec
|
this.$API.bi.dataset.exec.req("3322567213885833216").then((res) => {
|
||||||
.req('3322567213885833216')
|
|
||||||
.then((res) => {
|
|
||||||
this.myOption = JSON.parse(res.echart_options);
|
this.myOption = JSON.parse(res.echart_options);
|
||||||
debugger;
|
debugger;
|
||||||
console.log(this.myOption)
|
console.log(this.myOption);
|
||||||
this.chartShow = true;
|
this.chartShow = true;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handlePrint() {
|
handlePrint() {
|
||||||
this.$PRINT('#myReport');
|
this.$PRINT("#myReport");
|
||||||
},
|
},
|
||||||
exportExcel() {
|
exportExcel() {
|
||||||
this.exportLoading = true;
|
this.exportLoading = true;
|
||||||
this.$XLSX('#myTable', this.tableName)
|
this.$XLSX("#myTable", this.tableName);
|
||||||
this.exportLoading = false;
|
this.exportLoading = false;
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
|
@ -34,17 +34,21 @@
|
||||||
:loading="exportLoading"
|
:loading="exportLoading"
|
||||||
>导出xlsx
|
>导出xlsx
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button type="primary" @click="handlePrint">打印 </el-button>
|
||||||
type="primary"
|
|
||||||
@click="handlePrint"
|
|
||||||
>打印
|
|
||||||
</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
</el-header>
|
</el-header>
|
||||||
<el-card style="margin-top: 5px">
|
<el-card style="margin-top: 5px">
|
||||||
<div class="printWrap">
|
<div class="printWrap">
|
||||||
<div ref="print" id="myReport" class="printContainer">
|
<div ref="print" id="myReport" class="printContainer">
|
||||||
<table border="1" width="1075" cellspacing="0" :key="1" id="myTable" class="myTable" v-if="query.type==1">
|
<table
|
||||||
|
border="1"
|
||||||
|
width="1075"
|
||||||
|
cellspacing="0"
|
||||||
|
:key="1"
|
||||||
|
id="myTable"
|
||||||
|
class="myTable"
|
||||||
|
v-if="query.type == 1"
|
||||||
|
>
|
||||||
<thead class="myTableHead">
|
<thead class="myTableHead">
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="8">车间单位产品电耗月度分析表</th>
|
<th colspan="8">车间单位产品电耗月度分析表</th>
|
||||||
|
@ -62,22 +66,44 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="item in tableDatas" :key="item">
|
<tr v-for="item in tableDatas" :key="item">
|
||||||
<td v-for="(item1,ind) in item" :key="ind" class="numCell">
|
<td
|
||||||
|
v-for="(item1, ind) in item"
|
||||||
|
:key="ind"
|
||||||
|
class="numCell"
|
||||||
|
>
|
||||||
<div :class="bindClass(item1, ind)">
|
<div :class="bindClass(item1, ind)">
|
||||||
<span v-if="item1>0&&ind==3">↑</span>
|
<span v-if="item1 > 0 && ind == 3"
|
||||||
<span v-if="item1<0&&ind==3">↓</span>
|
>↑</span
|
||||||
<span v-if="item1<0&&ind==5">▲</span>
|
>
|
||||||
<span v-if="item1<0&&ind==5">▼</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 }}
|
{{ item1 }}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<table border="1" width="1075" cellspacing="0" :key="2" id="myTable1" class="myTable" v-else-if="query.type==2">
|
<table
|
||||||
|
border="1"
|
||||||
|
width="1075"
|
||||||
|
cellspacing="0"
|
||||||
|
:key="2"
|
||||||
|
id="myTable1"
|
||||||
|
class="myTable"
|
||||||
|
v-else-if="query.type == 2"
|
||||||
|
>
|
||||||
<thead class="myTableHead">
|
<thead class="myTableHead">
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="9">车间单位产品综合电耗月度分析表</th>
|
<th colspan="9">
|
||||||
|
车间单位产品综合电耗月度分析表
|
||||||
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th rowspan="2">月份</th>
|
<th rowspan="2">月份</th>
|
||||||
|
@ -96,20 +122,38 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="item in tableDatas2" :key="item">
|
<tr v-for="item in tableDatas2" :key="item">
|
||||||
<td v-for="(item1,ind) in item" :key="ind" class="numCell">
|
<td
|
||||||
|
v-for="(item1, ind) in item"
|
||||||
|
:key="ind"
|
||||||
|
class="numCell"
|
||||||
|
>
|
||||||
<div :class="bindClass(item1, ind)">
|
<div :class="bindClass(item1, ind)">
|
||||||
<span v-if="item1<0&&ind==6">▲</span>
|
<span v-if="item1 < 0 && ind == 6"
|
||||||
<span v-if="item1<0&&ind==6">▼</span>
|
>▲</span
|
||||||
|
>
|
||||||
|
<span v-if="item1 < 0 && ind == 6"
|
||||||
|
>▼</span
|
||||||
|
>
|
||||||
{{ item1 }}
|
{{ item1 }}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<table border="1" width="1075" cellspacing="0" :key="3" id="myTable1" class="myTable" v-else-if="query.type==3">
|
<table
|
||||||
|
border="1"
|
||||||
|
width="1075"
|
||||||
|
cellspacing="0"
|
||||||
|
:key="3"
|
||||||
|
id="myTable1"
|
||||||
|
class="myTable"
|
||||||
|
v-else-if="query.type == 3"
|
||||||
|
>
|
||||||
<thead class="myTableHead">
|
<thead class="myTableHead">
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="9">车间单位产品标煤耗月度分析表</th>
|
<th colspan="9">
|
||||||
|
车间单位产品标煤耗月度分析表
|
||||||
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th rowspan="2">月份</th>
|
<th rowspan="2">月份</th>
|
||||||
|
@ -128,20 +172,38 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="item in tableDatas3" :key="item">
|
<tr v-for="item in tableDatas3" :key="item">
|
||||||
<td v-for="(item1,ind) in item" :key="ind" class="numCell">
|
<td
|
||||||
|
v-for="(item1, ind) in item"
|
||||||
|
:key="ind"
|
||||||
|
class="numCell"
|
||||||
|
>
|
||||||
<div :class="bindClass(item1, ind)">
|
<div :class="bindClass(item1, ind)">
|
||||||
<span v-if="item1<0&&ind==6">▲</span>
|
<span v-if="item1 < 0 && ind == 6"
|
||||||
<span v-if="item1<0&&ind==6">▼</span>
|
>▲</span
|
||||||
|
>
|
||||||
|
<span v-if="item1 < 0 && ind == 6"
|
||||||
|
>▼</span
|
||||||
|
>
|
||||||
{{ item1 }}
|
{{ item1 }}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<table border="1" width="1075" cellspacing="0" :key="4" id="myTable1" class="myTable" v-else-if="query.type==4">
|
<table
|
||||||
|
border="1"
|
||||||
|
width="1075"
|
||||||
|
cellspacing="0"
|
||||||
|
:key="4"
|
||||||
|
id="myTable1"
|
||||||
|
class="myTable"
|
||||||
|
v-else-if="query.type == 4"
|
||||||
|
>
|
||||||
<thead class="myTableHead">
|
<thead class="myTableHead">
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="9">车间单位产品综合能耗月度分析表</th>
|
<th colspan="9">
|
||||||
|
车间单位产品综合能耗月度分析表
|
||||||
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th rowspan="2">月份</th>
|
<th rowspan="2">月份</th>
|
||||||
|
@ -160,10 +222,18 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="item in tableDatas4" :key="item">
|
<tr v-for="item in tableDatas4" :key="item">
|
||||||
<td v-for="(item1,ind) in item" :key="ind" class="numCell">
|
<td
|
||||||
|
v-for="(item1, ind) in item"
|
||||||
|
:key="ind"
|
||||||
|
class="numCell"
|
||||||
|
>
|
||||||
<div :class="bindClass(item1, ind)">
|
<div :class="bindClass(item1, ind)">
|
||||||
<span v-if="item1<0&&ind==6">▲</span>
|
<span v-if="item1 < 0 && ind == 6"
|
||||||
<span v-if="item1<0&&ind==6">▼</span>
|
>▲</span
|
||||||
|
>
|
||||||
|
<span v-if="item1 < 0 && ind == 6"
|
||||||
|
>▼</span
|
||||||
|
>
|
||||||
{{ item1 }}
|
{{ item1 }}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
@ -177,20 +247,24 @@
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import scEcharts from "@/components/scEcharts";
|
import scEcharts from "@/components/scEcharts";
|
||||||
import { defineAsyncComponent } from 'vue'
|
import { defineAsyncComponent } from "vue";
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
scEcharts,
|
scEcharts,
|
||||||
charts: defineAsyncComponent(() => import("@/components/scEnm/lineChartsdialog.vue")),
|
charts: defineAsyncComponent(() =>
|
||||||
|
import("@/components/scEnm/lineChartsdialog.vue")
|
||||||
|
),
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
exportLoading: false,
|
||||||
chartShow: false,
|
chartShow: false,
|
||||||
myOption: null,
|
myOption: null,
|
||||||
|
timeStamp: null,
|
||||||
query: {
|
query: {
|
||||||
type: 1,
|
type: 1,
|
||||||
year_s:'',
|
year_s: "",
|
||||||
mgroup:'3347217246321065984',
|
mgroup: "",
|
||||||
},
|
},
|
||||||
monthGoal: [],
|
monthGoal: [],
|
||||||
monthGoal2: [],
|
monthGoal2: [],
|
||||||
|
@ -200,21 +274,30 @@
|
||||||
tableDatas2: [],
|
tableDatas2: [],
|
||||||
tableDatas3: [],
|
tableDatas3: [],
|
||||||
tableDatas4: [],
|
tableDatas4: [],
|
||||||
options:[{
|
options: [
|
||||||
name:'电耗',id:1,
|
{
|
||||||
},{
|
name: "电耗",
|
||||||
name:'综合电耗',id:2,
|
id: 1,
|
||||||
},{
|
},
|
||||||
name:'标煤耗',id:3,
|
{
|
||||||
},{
|
name: "综合电耗",
|
||||||
name:'综合能耗',id:4,
|
id: 2,
|
||||||
}],
|
},
|
||||||
|
{
|
||||||
|
name: "标煤耗",
|
||||||
|
id: 3,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "综合能耗",
|
||||||
|
id: 4,
|
||||||
|
},
|
||||||
|
],
|
||||||
modelValue: true,
|
modelValue: true,
|
||||||
type:'hours',
|
type: "hours",
|
||||||
title:'title',
|
title: "title",
|
||||||
apiObj:'',
|
apiObj: "",
|
||||||
showClose: true,
|
showClose: true,
|
||||||
echartType:'line',
|
echartType: "line",
|
||||||
asynDialog: false,
|
asynDialog: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -223,15 +306,49 @@
|
||||||
var myDate = new Date();
|
var myDate = new Date();
|
||||||
let year = myDate.getFullYear();
|
let year = myDate.getFullYear();
|
||||||
that.query.year_s = year;
|
that.query.year_s = year;
|
||||||
|
that.timeStamp = myDate.getTime();
|
||||||
|
this.$API.mtm.mgroup.list
|
||||||
|
.req({ page: 0, search: "回转窑" })
|
||||||
|
.then((res) => {
|
||||||
|
console.log("回转窑", res);
|
||||||
|
that.query.mgroup = res[0].id;
|
||||||
//月目标
|
//月目标
|
||||||
|
this.getMonthGoal();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
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;
|
||||||
|
},
|
||||||
|
//月目标
|
||||||
|
getMonthGoal() {
|
||||||
|
let that = this;
|
||||||
let paramsGoal = {};
|
let paramsGoal = {};
|
||||||
paramsGoal.page = 0;
|
paramsGoal.page = 0;
|
||||||
paramsGoal.mgroup = that.query.mgroup;
|
paramsGoal.mgroup = that.query.mgroup;
|
||||||
that.$API.mtm.goal.list.req(paramsGoal).then((ress) => {
|
that.$API.mtm.goal.list.req(paramsGoal).then((ress) => {
|
||||||
if (ress.length > 0) {
|
if (ress.length > 0) {
|
||||||
let monthGoal = [],monthGoal2 = [],monthGoal3 = [],monthGoal4 = [];
|
let monthGoal = [],
|
||||||
ress.forEach(goal=>{
|
monthGoal2 = [],
|
||||||
if(goal.goal_cate_name=='单位产品分布电耗(KW·h/t)'){
|
monthGoal3 = [],
|
||||||
|
monthGoal4 = [];
|
||||||
|
ress.forEach((goal) => {
|
||||||
|
if (
|
||||||
|
goal.goal_cate_name == "单位产品分布电耗(KW·h/t)"
|
||||||
|
) {
|
||||||
monthGoal[0] = goal.goal_val;
|
monthGoal[0] = goal.goal_val;
|
||||||
monthGoal[1] = goal.goal_val_2;
|
monthGoal[1] = goal.goal_val_2;
|
||||||
monthGoal[2] = goal.goal_val_3;
|
monthGoal[2] = goal.goal_val_3;
|
||||||
|
@ -247,7 +364,9 @@
|
||||||
monthGoal[12] = goal.goal_val_12;
|
monthGoal[12] = goal.goal_val_12;
|
||||||
that.monthGoal = monthGoal;
|
that.monthGoal = monthGoal;
|
||||||
}
|
}
|
||||||
if(goal.goal_cate_name=='单位产品综合电耗(KW·h/t)'){
|
if (
|
||||||
|
goal.goal_cate_name == "单位产品综合电耗(KW·h/t)"
|
||||||
|
) {
|
||||||
monthGoal2[0] = goal.goal_val;
|
monthGoal2[0] = goal.goal_val;
|
||||||
monthGoal2[1] = goal.goal_val_2;
|
monthGoal2[1] = goal.goal_val_2;
|
||||||
monthGoal2[2] = goal.goal_val_3;
|
monthGoal2[2] = goal.goal_val_3;
|
||||||
|
@ -263,7 +382,7 @@
|
||||||
monthGoal2[12] = goal.goal_val_12;
|
monthGoal2[12] = goal.goal_val_12;
|
||||||
that.monthGoal2 = monthGoal2;
|
that.monthGoal2 = monthGoal2;
|
||||||
}
|
}
|
||||||
if(goal.goal_cate_name=='单位产品标煤耗(kgce/t)'){
|
if (goal.goal_cate_name == "单位产品标煤耗(kgce/t)") {
|
||||||
monthGoal3[0] = goal.goal_val;
|
monthGoal3[0] = goal.goal_val;
|
||||||
monthGoal3[1] = goal.goal_val_2;
|
monthGoal3[1] = goal.goal_val_2;
|
||||||
monthGoal3[2] = goal.goal_val_3;
|
monthGoal3[2] = goal.goal_val_3;
|
||||||
|
@ -279,7 +398,9 @@
|
||||||
monthGoal3[12] = goal.goal_val_12;
|
monthGoal3[12] = goal.goal_val_12;
|
||||||
that.monthGoal3 = monthGoal3;
|
that.monthGoal3 = monthGoal3;
|
||||||
}
|
}
|
||||||
if(goal.goal_cate_name=='单位产品综合能耗(kgce/t)'){
|
if (
|
||||||
|
goal.goal_cate_name == "单位产品综合能耗(kgce/t)"
|
||||||
|
) {
|
||||||
monthGoal4[0] = goal.goal_val;
|
monthGoal4[0] = goal.goal_val;
|
||||||
monthGoal4[1] = goal.goal_val_2;
|
monthGoal4[1] = goal.goal_val_2;
|
||||||
monthGoal4[2] = goal.goal_val_3;
|
monthGoal4[2] = goal.goal_val_3;
|
||||||
|
@ -295,42 +416,30 @@
|
||||||
monthGoal4[12] = goal.goal_val_12;
|
monthGoal4[12] = goal.goal_val_12;
|
||||||
that.monthGoal4 = monthGoal4;
|
that.monthGoal4 = monthGoal4;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
this.getData();
|
this.getData();
|
||||||
} else {
|
} else {
|
||||||
this.getData();
|
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() {
|
getData() {
|
||||||
let that = this;
|
let that = this;
|
||||||
let query0 = {};
|
let query0 = {};
|
||||||
query0.page = 0;
|
query0.page = 0;
|
||||||
query0.type='month_s';
|
query0.type = "month_s";
|
||||||
query0.year_s = that.query.year_s - 1;
|
query0.year_s = that.query.year_s - 1;
|
||||||
query0.mgroup = that.query.mgroup;
|
query0.mgroup = that.query.mgroup;
|
||||||
let wrapArr = [],wrapArr0 = [] ,wrapArrs = [],wrapArrs2=[],wrapArrs3=[],wrapArrs4=[];
|
let wrapArr = [],
|
||||||
|
wrapArr0 = [],
|
||||||
|
wrapArrs = [],
|
||||||
|
wrapArrs2 = [],
|
||||||
|
wrapArrs3 = [],
|
||||||
|
wrapArrs4 = [];
|
||||||
this.$API.enm.enstat.req(query0).then((res0) => {
|
this.$API.enm.enstat.req(query0).then((res0) => {
|
||||||
let data0 = res0;
|
let data0 = res0;
|
||||||
if (data0.length > 0) {
|
if (data0.length > 0) {
|
||||||
data0.forEach(item0 => {
|
data0.forEach((item0) => {
|
||||||
//先按月份排序,再按班组排序
|
//先按月份排序,再按班组排序
|
||||||
let ind0 = item0.month_s;
|
let ind0 = item0.month_s;
|
||||||
wrapArr0[ind0] = item0;
|
wrapArr0[ind0] = item0;
|
||||||
|
@ -338,201 +447,282 @@
|
||||||
}
|
}
|
||||||
let query = {};
|
let query = {};
|
||||||
query.page = 0;
|
query.page = 0;
|
||||||
query.type='month_s';
|
query.type = "month_s";
|
||||||
query.year_s = that.query.year_s;
|
query.year_s = that.query.year_s;
|
||||||
query.mgroup = that.query.mgroup;
|
query.mgroup = that.query.mgroup;
|
||||||
that.$API.enm.enstat.req(query).then((res) => {
|
that.$API.enm.enstat.req(query).then((res) => {
|
||||||
let data = res;
|
let data = res;
|
||||||
if (data.length > 0) {
|
if (data.length > 0) {
|
||||||
data.forEach(item => {
|
data.forEach((item) => {
|
||||||
//先按月份排序,再按班组排序
|
//先按月份排序,再按班组排序
|
||||||
let ind = item.month_s;
|
let ind = item.month_s;
|
||||||
let arr = item;
|
let arr = item;
|
||||||
let time = ''+item.year_s+'.'+item.month_s;
|
let time = "" + item.year_s + "." + item.month_s;
|
||||||
arr.time = time;
|
arr.time = time;
|
||||||
wrapArr[ind] = arr;
|
wrapArr[ind] = arr;
|
||||||
});
|
});
|
||||||
//type==1
|
//type==1
|
||||||
wrapArr.forEach((item, index) => {
|
wrapArr.forEach((item, index) => {
|
||||||
let ind = item.month_s;
|
let ind = item.month_s;
|
||||||
let arrs = [],arrs2 = [],arrs3 = [],arrs4 = [];
|
let arrs = [],
|
||||||
|
arrs2 = [],
|
||||||
|
arrs3 = [],
|
||||||
|
arrs4 = [];
|
||||||
arrs[0] = item.time;
|
arrs[0] = item.time;
|
||||||
arrs2[0] = item.time;
|
arrs2[0] = item.time;
|
||||||
arrs3[0] = item.time;
|
arrs3[0] = item.time;
|
||||||
arrs4[0] = item.time;
|
arrs4[0] = item.time;
|
||||||
arrs[1] = item.elec_consume_unit;
|
arrs[1] = item.elec_consume_unit;
|
||||||
arrs[2]=that.monthGoal[ind]!==undefined?that.monthGoal[ind]:'/';
|
arrs[2] =
|
||||||
|
that.monthGoal[ind] !== undefined
|
||||||
|
? that.monthGoal[ind]
|
||||||
|
: "/";
|
||||||
//当期与目标差值(KW·h/t)
|
//当期与目标差值(KW·h/t)
|
||||||
let diff = 0;
|
let diff = 0;
|
||||||
if(arrs[2]!=='/'){
|
if (arrs[2] !== "/") {
|
||||||
diff = arrs[1] - arrs[2];
|
diff = arrs[1] - arrs[2];
|
||||||
} else {
|
} else {
|
||||||
diff = '/';
|
diff = "/";
|
||||||
}
|
}
|
||||||
arrs[3] = diff;
|
arrs[3] = diff;
|
||||||
//环期值(KW·h/t)上个月的值
|
//环期值(KW·h/t)上个月的值
|
||||||
let lastNum = 0;
|
let lastNum = 0;
|
||||||
if (index > 1) {
|
if (index > 1) {
|
||||||
let num = index - 1;
|
let num = index - 1;
|
||||||
if(wrapArr[num]&&wrapArr[num].elec_consume_unit){
|
if (
|
||||||
|
wrapArr[num] &&
|
||||||
|
wrapArr[num].elec_consume_unit
|
||||||
|
) {
|
||||||
lastNum = wrapArr[num].elec_consume_unit;
|
lastNum = wrapArr[num].elec_consume_unit;
|
||||||
} else {
|
} else {
|
||||||
lastNum='/'
|
lastNum = "/";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
lastNum = wrapArr0[12]?wrapArr0[12].elec_consume_unit:'/';
|
lastNum = wrapArr0[12]
|
||||||
|
? wrapArr0[12].elec_consume_unit
|
||||||
|
: "/";
|
||||||
}
|
}
|
||||||
arrs[4] = lastNum;
|
arrs[4] = lastNum;
|
||||||
//当期与环期差值(KW·h/t)
|
//当期与环期差值(KW·h/t)
|
||||||
let lastDiff = 0;
|
let lastDiff = 0;
|
||||||
|
|
||||||
if(arrs[1]!=='/'&&arrs[4]!=='/'){
|
if (arrs[1] !== "/" && arrs[4] !== "/") {
|
||||||
lastDiff = arrs[1] - arrs[4];
|
lastDiff = arrs[1] - arrs[4];
|
||||||
} else {
|
} else {
|
||||||
lastDiff = '/';
|
lastDiff = "/";
|
||||||
}
|
}
|
||||||
arrs[5] = lastDiff;
|
arrs[5] = lastDiff;
|
||||||
//环比增长率(%)
|
//环比增长率(%)
|
||||||
let lastRate = 0;
|
let lastRate = 0;
|
||||||
if(lastDiff=='/'&&lastNum!=='/'&&lastNum!==0){
|
if (
|
||||||
|
lastDiff == "/" &&
|
||||||
|
lastNum !== "/" &&
|
||||||
|
lastNum !== 0
|
||||||
|
) {
|
||||||
lastRate = (lastDiff / lastNum) * 100;
|
lastRate = (lastDiff / lastNum) * 100;
|
||||||
} else {
|
} else {
|
||||||
lastRate = '/'
|
lastRate = "/";
|
||||||
}
|
}
|
||||||
arrs[6] = lastRate;
|
arrs[6] = lastRate;
|
||||||
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
||||||
let sameRate = 0;
|
let sameRate = 0;
|
||||||
if(wrapArr0[index]&&wrapArr0[index].elec_consume_unit){
|
if (
|
||||||
sameRate =((arrs[1]- wrapArr0[index].elec_consume_unit)/wrapArr0[index].elec_consume_unit)*100
|
wrapArr0[index] &&
|
||||||
|
wrapArr0[index].elec_consume_unit
|
||||||
|
) {
|
||||||
|
sameRate =
|
||||||
|
((arrs[1] -
|
||||||
|
wrapArr0[index].elec_consume_unit) /
|
||||||
|
wrapArr0[index].elec_consume_unit) *
|
||||||
|
100;
|
||||||
} else {
|
} else {
|
||||||
sameRate='/';
|
sameRate = "/";
|
||||||
}
|
}
|
||||||
arrs[7] = sameRate;
|
arrs[7] = sameRate;
|
||||||
wrapArrs.push(arrs);
|
wrapArrs.push(arrs);
|
||||||
arrs2[1] = item.celec_consume_unit;
|
arrs2[1] = item.celec_consume_unit;
|
||||||
arrs2[2]=that.monthGoal2[ind]!==undefined?that.monthGoal2[ind]:'/';
|
arrs2[2] =
|
||||||
|
that.monthGoal2[ind] !== undefined
|
||||||
|
? that.monthGoal2[ind]
|
||||||
|
: "/";
|
||||||
arrs2[3] = 48;
|
arrs2[3] = 48;
|
||||||
arrs2[4] = 57;
|
arrs2[4] = 57;
|
||||||
arrs2[5] = 61;
|
arrs2[5] = 61;
|
||||||
//当期与环期差值(KW·h/t)
|
//当期与环期差值(KW·h/t)
|
||||||
let lastNum2 = 0,lastDiff2 = 0;
|
let lastNum2 = 0,
|
||||||
|
lastDiff2 = 0;
|
||||||
if (index > 1) {
|
if (index > 1) {
|
||||||
let num = index - 1;
|
let num = index - 1;
|
||||||
if(wrapArr[num]&&wrapArr[num].celec_consume_unit){
|
if (
|
||||||
|
wrapArr[num] &&
|
||||||
|
wrapArr[num].celec_consume_unit
|
||||||
|
) {
|
||||||
lastNum2 = wrapArr[num].celec_consume_unit;
|
lastNum2 = wrapArr[num].celec_consume_unit;
|
||||||
} else {
|
} else {
|
||||||
lastNum2='/'
|
lastNum2 = "/";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
lastNum2 = wrapArr0[12]?wrapArr0[12].celec_consume_unit:'/';
|
lastNum2 = wrapArr0[12]
|
||||||
|
? wrapArr0[12].celec_consume_unit
|
||||||
|
: "/";
|
||||||
}
|
}
|
||||||
if(arrs2[1]!=='/'&&lastNum2!=='/'){
|
if (arrs2[1] !== "/" && lastNum2 !== "/") {
|
||||||
lastDiff2 = arrs2[1] - lastNum2;
|
lastDiff2 = arrs2[1] - lastNum2;
|
||||||
} else {
|
} else {
|
||||||
lastDiff2 = '/';
|
lastDiff2 = "/";
|
||||||
}
|
}
|
||||||
arrs2[6] = lastDiff2;
|
arrs2[6] = lastDiff2;
|
||||||
//环比增长率(%)
|
//环比增长率(%)
|
||||||
let lastRate2 = 0;
|
let lastRate2 = 0;
|
||||||
if(lastDiff2=='/'&&lastNum2!=='/'&&lastNum2!==0){
|
if (
|
||||||
|
lastDiff2 == "/" &&
|
||||||
|
lastNum2 !== "/" &&
|
||||||
|
lastNum2 !== 0
|
||||||
|
) {
|
||||||
lastRate2 = (lastDiff2 / lastNum2) * 100;
|
lastRate2 = (lastDiff2 / lastNum2) * 100;
|
||||||
} else {
|
} else {
|
||||||
lastRate2 = '/'
|
lastRate2 = "/";
|
||||||
}
|
}
|
||||||
arrs2[7] = lastRate2;
|
arrs2[7] = lastRate2;
|
||||||
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
||||||
let sameRate2 = 0;
|
let sameRate2 = 0;
|
||||||
if(wrapArr0[index]&&wrapArr0[index].celec_consume_unit){
|
if (
|
||||||
sameRate2 =((arrs[1]- wrapArr0[index].celec_consume_unit)/wrapArr0[index].celec_consume_unit)*100
|
wrapArr0[index] &&
|
||||||
|
wrapArr0[index].celec_consume_unit
|
||||||
|
) {
|
||||||
|
sameRate2 =
|
||||||
|
((arrs[1] -
|
||||||
|
wrapArr0[index].celec_consume_unit) /
|
||||||
|
wrapArr0[index].celec_consume_unit) *
|
||||||
|
100;
|
||||||
} else {
|
} else {
|
||||||
sameRate2='/';
|
sameRate2 = "/";
|
||||||
}
|
}
|
||||||
arrs2[8] = sameRate2;
|
arrs2[8] = sameRate2;
|
||||||
wrapArrs2.push(arrs2);
|
wrapArrs2.push(arrs2);
|
||||||
|
|
||||||
arrs3[1] = item.coal_consume_unit;
|
arrs3[1] = item.coal_consume_unit;
|
||||||
arrs3[2]=that.monthGoal3[ind]!==undefined?that.monthGoal3[ind]:'/';
|
arrs3[2] =
|
||||||
|
that.monthGoal3[ind] !== undefined
|
||||||
|
? that.monthGoal3[ind]
|
||||||
|
: "/";
|
||||||
arrs3[3] = 94;
|
arrs3[3] = 94;
|
||||||
arrs3[4] = 100;
|
arrs3[4] = 100;
|
||||||
arrs3[5] = 109;
|
arrs3[5] = 109;
|
||||||
//当期与环期差值(KW·h/t)
|
//当期与环期差值(KW·h/t)
|
||||||
let lastNum3 = 0,lastDiff3 = 0;
|
let lastNum3 = 0,
|
||||||
|
lastDiff3 = 0;
|
||||||
if (index > 1) {
|
if (index > 1) {
|
||||||
let num = index - 1;
|
let num = index - 1;
|
||||||
if(wrapArr[num]&&wrapArr[num].coal_consume_unit){
|
if (
|
||||||
|
wrapArr[num] &&
|
||||||
|
wrapArr[num].coal_consume_unit
|
||||||
|
) {
|
||||||
lastNum3 = wrapArr[num].coal_consume_unit;
|
lastNum3 = wrapArr[num].coal_consume_unit;
|
||||||
} else {
|
} else {
|
||||||
lastNum3='/'
|
lastNum3 = "/";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
lastNum3 = wrapArr0[12]?wrapArr0[12].coal_consume_unit:'/';
|
lastNum3 = wrapArr0[12]
|
||||||
|
? wrapArr0[12].coal_consume_unit
|
||||||
|
: "/";
|
||||||
}
|
}
|
||||||
if(arrs3[1]!=='/'&&lastNum3!=='/'){
|
if (arrs3[1] !== "/" && lastNum3 !== "/") {
|
||||||
lastDiff3 = arrs3[1] - lastNum3;
|
lastDiff3 = arrs3[1] - lastNum3;
|
||||||
} else {
|
} else {
|
||||||
lastDiff3 = '/';
|
lastDiff3 = "/";
|
||||||
}
|
}
|
||||||
arrs3[6] = lastDiff3;
|
arrs3[6] = lastDiff3;
|
||||||
//环比增长率(%)
|
//环比增长率(%)
|
||||||
let lastRate3 = 0;
|
let lastRate3 = 0;
|
||||||
if(lastDiff3=='/'&&lastNum3!=='/'&&lastNum3!==0){
|
if (
|
||||||
|
lastDiff3 == "/" &&
|
||||||
|
lastNum3 !== "/" &&
|
||||||
|
lastNum3 !== 0
|
||||||
|
) {
|
||||||
lastRate3 = (lastDiff3 / lastNum3) * 100;
|
lastRate3 = (lastDiff3 / lastNum3) * 100;
|
||||||
} else {
|
} else {
|
||||||
lastRate3 = '/'
|
lastRate3 = "/";
|
||||||
}
|
}
|
||||||
arrs3[7] = lastRate3;
|
arrs3[7] = lastRate3;
|
||||||
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
||||||
let sameRate3 = 0;
|
let sameRate3 = 0;
|
||||||
if(wrapArr0[index]&&wrapArr0[index].coal_consume_unit){
|
if (
|
||||||
sameRate3 =((arrs[1]- wrapArr0[index].coal_consume_unit)/wrapArr0[index].coal_consume_unit)*100
|
wrapArr0[index] &&
|
||||||
|
wrapArr0[index].coal_consume_unit
|
||||||
|
) {
|
||||||
|
sameRate3 =
|
||||||
|
((arrs[1] -
|
||||||
|
wrapArr0[index].coal_consume_unit) /
|
||||||
|
wrapArr0[index].coal_consume_unit) *
|
||||||
|
100;
|
||||||
} else {
|
} else {
|
||||||
sameRate3='/';
|
sameRate3 = "/";
|
||||||
}
|
}
|
||||||
arrs3[8] = sameRate3;
|
arrs3[8] = sameRate3;
|
||||||
wrapArrs3.push(arrs3);
|
wrapArrs3.push(arrs3);
|
||||||
|
|
||||||
|
|
||||||
arrs4[1] = item.cen_consume_unit;
|
arrs4[1] = item.cen_consume_unit;
|
||||||
arrs4[2]=that.monthGoal4[ind]!==undefined?that.monthGoal4[ind]:'/';
|
arrs4[2] =
|
||||||
|
that.monthGoal4[ind] !== undefined
|
||||||
|
? that.monthGoal4[ind]
|
||||||
|
: "/";
|
||||||
arrs4[3] = 100;
|
arrs4[3] = 100;
|
||||||
arrs4[4] = 107;
|
arrs4[4] = 107;
|
||||||
arrs4[5] = 117;
|
arrs4[5] = 117;
|
||||||
//当期与环期差值(KW·h/t)
|
//当期与环期差值(KW·h/t)
|
||||||
let lastNum4 = 0,lastDiff4 = 0;
|
let lastNum4 = 0,
|
||||||
|
lastDiff4 = 0;
|
||||||
if (index > 1) {
|
if (index > 1) {
|
||||||
let num = index - 1;
|
let num = index - 1;
|
||||||
if(wrapArr[num]&&wrapArr[num].cen_consume_unit){
|
if (
|
||||||
|
wrapArr[num] &&
|
||||||
|
wrapArr[num].cen_consume_unit
|
||||||
|
) {
|
||||||
lastNum4 = wrapArr[num].cen_consume_unit;
|
lastNum4 = wrapArr[num].cen_consume_unit;
|
||||||
} else {
|
} else {
|
||||||
lastNum4='/'
|
lastNum4 = "/";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
lastNum4 = wrapArr0[12]?wrapArr0[12].cen_consume_unit:'/';
|
lastNum4 = wrapArr0[12]
|
||||||
|
? wrapArr0[12].cen_consume_unit
|
||||||
|
: "/";
|
||||||
}
|
}
|
||||||
if(arrs4[1]!=='/'&&lastNum4!=='/'){
|
if (arrs4[1] !== "/" && lastNum4 !== "/") {
|
||||||
lastDiff4 = arrs4[1] - lastNum4;
|
lastDiff4 = arrs4[1] - lastNum4;
|
||||||
} else {
|
} else {
|
||||||
lastDiff4 = '/';
|
lastDiff4 = "/";
|
||||||
}
|
}
|
||||||
arrs4[6] = lastDiff4;
|
arrs4[6] = lastDiff4;
|
||||||
//环比增长率(%)
|
//环比增长率(%)
|
||||||
let lastRate4 = 0;
|
let lastRate4 = 0;
|
||||||
if(lastDiff4=='/'&&lastNum4!=='/'&&lastNum4!==0){
|
if (
|
||||||
|
lastDiff4 == "/" &&
|
||||||
|
lastNum4 !== "/" &&
|
||||||
|
lastNum4 !== 0
|
||||||
|
) {
|
||||||
lastRate4 = (lastDiff4 / lastNum4) * 100;
|
lastRate4 = (lastDiff4 / lastNum4) * 100;
|
||||||
} else {
|
} else {
|
||||||
lastRate4 = '/'
|
lastRate4 = "/";
|
||||||
}
|
}
|
||||||
arrs4[7] = lastRate4;
|
arrs4[7] = lastRate4;
|
||||||
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
||||||
let sameRate4 = 0;
|
let sameRate4 = 0;
|
||||||
if(wrapArr0[index]&&wrapArr0[index].cen_consume_unit){
|
if (
|
||||||
sameRate4 =((arrs[1]- wrapArr0[index].cen_consume_unit)/wrapArr0[index].cen_consume_unit)*100
|
wrapArr0[index] &&
|
||||||
|
wrapArr0[index].cen_consume_unit
|
||||||
|
) {
|
||||||
|
sameRate4 =
|
||||||
|
((arrs[1] -
|
||||||
|
wrapArr0[index].cen_consume_unit) /
|
||||||
|
wrapArr0[index].cen_consume_unit) *
|
||||||
|
100;
|
||||||
} else {
|
} else {
|
||||||
sameRate4='/';
|
sameRate4 = "/";
|
||||||
}
|
}
|
||||||
arrs4[8] = sameRate4;
|
arrs4[8] = sameRate4;
|
||||||
wrapArrs4.push(arrs4);
|
wrapArrs4.push(arrs4);
|
||||||
})
|
});
|
||||||
that.tableDatas = wrapArrs;
|
that.tableDatas = wrapArrs;
|
||||||
that.tableDatas2 = wrapArrs2;
|
that.tableDatas2 = wrapArrs2;
|
||||||
that.tableDatas3 = wrapArrs3;
|
that.tableDatas3 = wrapArrs3;
|
||||||
|
@ -707,33 +897,26 @@
|
||||||
// that.tableDatas3 = wrapArrs3;
|
// that.tableDatas3 = wrapArrs3;
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
itemClick(type, item) {
|
itemClick(type, item) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.asynDialog = true;
|
this.asynDialog = true;
|
||||||
},
|
},
|
||||||
itemClick1(type,item){
|
handleQuery() {
|
||||||
this.chartShow = false;
|
this.getMonthGoal();
|
||||||
this.$API.bi.dataset.exec
|
|
||||||
.req('3322567213885833216')
|
|
||||||
.then((res) => {
|
|
||||||
this.myOption = JSON.parse(res.echart_options);
|
|
||||||
debugger;
|
|
||||||
console.log(this.myOption)
|
|
||||||
this.chartShow = true;
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
typeCange() {},
|
||||||
handlePrint() {
|
handlePrint() {
|
||||||
this.$PRINT('#myReport');
|
this.$PRINT("#myReport");
|
||||||
},
|
},
|
||||||
exportExcel() {
|
exportExcel() {
|
||||||
this.exportLoading = true;
|
this.exportLoading = true;
|
||||||
this.$XLSX('#myTable', this.tableName)
|
this.$XLSX("#myTable", this.tableName);
|
||||||
this.exportLoading = false;
|
this.exportLoading = false;
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
@ -741,5 +924,4 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
overflow-x: scroll;
|
overflow-x: scroll;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
|
@ -263,10 +263,10 @@ export default {
|
||||||
team: "",
|
team: "",
|
||||||
end_time__lt: "",
|
end_time__lt: "",
|
||||||
start_time__gte: "",
|
start_time__gte: "",
|
||||||
mgroup: "3347217246321065984",
|
mgroup: "",
|
||||||
},
|
},
|
||||||
|
|
||||||
deptId: "3347207082608115712",
|
deptId: "",
|
||||||
sflogItem: {},
|
sflogItem: {},
|
||||||
options: [],
|
options: [],
|
||||||
optionsShift: [],
|
optionsShift: [],
|
||||||
|
@ -276,8 +276,16 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.$API.mtm.mgroup.list
|
||||||
|
.req({ page: 0, search: "回转窑" })
|
||||||
|
.then((res) => {
|
||||||
|
console.log("回转窑", res);
|
||||||
|
this.query.mgroup = res[0].id;
|
||||||
|
this.apiObj = this.$API.wpm.sflog.list;
|
||||||
|
this.deptId = res[0].belong_dept;
|
||||||
this.getTeam();
|
this.getTeam();
|
||||||
this.getShfit();
|
this.getShfit();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getTeam() {
|
getTeam() {
|
||||||
|
|
|
@ -177,8 +177,10 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
exportLoading: false,
|
||||||
chartShow: false,
|
chartShow: false,
|
||||||
myOption: null,
|
myOption: null,
|
||||||
|
timeStamp: null,
|
||||||
optionHour: {},
|
optionHour: {},
|
||||||
optionDay: {},
|
optionDay: {},
|
||||||
optionMonth: {},
|
optionMonth: {},
|
||||||
|
@ -187,7 +189,7 @@ export default {
|
||||||
days: 1,
|
days: 1,
|
||||||
hours: 1,
|
hours: 1,
|
||||||
query: {
|
query: {
|
||||||
mgroup: "3347217246321065984",
|
mgroup: "",
|
||||||
},
|
},
|
||||||
tableName: "主要设备(100KW以上)单位产品电耗数据表",
|
tableName: "主要设备(100KW以上)单位产品电耗数据表",
|
||||||
tableDatas: [
|
tableDatas: [
|
||||||
|
@ -363,6 +365,11 @@ export default {
|
||||||
let month_h = hourDate.getMonth() + 1;
|
let month_h = hourDate.getMonth() + 1;
|
||||||
let days_h = hourDate.getDate();
|
let days_h = hourDate.getDate();
|
||||||
let hours_h = hourDate.getHours();
|
let hours_h = hourDate.getHours();
|
||||||
|
that.$API.mtm.mgroup.list
|
||||||
|
.req({ page: 0, search: "回转窑" })
|
||||||
|
.then((res) => {
|
||||||
|
console.log("回转窑", res);
|
||||||
|
that.query.mgroup = res[0].id;
|
||||||
//本月
|
//本月
|
||||||
let params2 = {};
|
let params2 = {};
|
||||||
params2.page = 0;
|
params2.page = 0;
|
||||||
|
@ -370,7 +377,6 @@ export default {
|
||||||
params2.month_s = month;
|
params2.month_s = month;
|
||||||
params2.type = "month_s";
|
params2.type = "month_s";
|
||||||
params2.mgroup = this.query.mgroup;
|
params2.mgroup = this.query.mgroup;
|
||||||
|
|
||||||
this.$API.enm.enstat
|
this.$API.enm.enstat
|
||||||
.req(params2)
|
.req(params2)
|
||||||
.then((res2) => {
|
.then((res2) => {
|
||||||
|
@ -378,18 +384,24 @@ export default {
|
||||||
let allValMonth = (that.allValMonth =
|
let allValMonth = (that.allValMonth =
|
||||||
res2[0].total_production); //当前条件下的总产量
|
res2[0].total_production); //当前条件下的总产量
|
||||||
params2.mpoint__ep_monitored__power_kw__gte = 100;
|
params2.mpoint__ep_monitored__power_kw__gte = 100;
|
||||||
this.$API.enm.mpoint.stat.req(params2).then((res) => {
|
this.$API.enm.mpoint.stat
|
||||||
|
.req(params2)
|
||||||
|
.then((res) => {
|
||||||
let data2 = res;
|
let data2 = res;
|
||||||
for (let i = 0; i < data2.length; i++) {
|
for (let i = 0; i < data2.length; i++) {
|
||||||
that.tableDatas[i] = [];
|
that.tableDatas[i] = [];
|
||||||
that.tableDatas[i][0] = data2[i].ep_monitored_name;
|
that.tableDatas[i][0] =
|
||||||
|
data2[i].ep_monitored_name;
|
||||||
that.tableDatas[i][1] =
|
that.tableDatas[i][1] =
|
||||||
data2[i].ep_monitored_number;
|
data2[i].ep_monitored_number;
|
||||||
that.tableDatas[i][2] = "KW·h/t";
|
that.tableDatas[i][2] = "KW·h/t";
|
||||||
let val =
|
let val =
|
||||||
allValMonth == 0
|
allValMonth == 0
|
||||||
? "/"
|
? "/"
|
||||||
: (data2[i].val / allValMonth).toFixed(2);
|
: (
|
||||||
|
data2[i].val /
|
||||||
|
allValMonth
|
||||||
|
).toFixed(2);
|
||||||
that.tableDatas[i][5] = val;
|
that.tableDatas[i][5] = val;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -409,15 +421,18 @@ export default {
|
||||||
let allValDays = (that.allValDays =
|
let allValDays = (that.allValDays =
|
||||||
res3[0].total_production);
|
res3[0].total_production);
|
||||||
params3.mpoint__ep_monitored__power_kw__gte = 100;
|
params3.mpoint__ep_monitored__power_kw__gte = 100;
|
||||||
this.$API.enm.mpoint.stat.req(params3).then((res) => {
|
this.$API.enm.mpoint.stat
|
||||||
|
.req(params3)
|
||||||
|
.then((res) => {
|
||||||
let data3 = res3;
|
let data3 = res3;
|
||||||
for (let j = 0; j < data3.length; j++) {
|
for (let j = 0; j < data3.length; j++) {
|
||||||
let val =
|
let val =
|
||||||
allValDays == 0
|
allValDays == 0
|
||||||
? "/"
|
? "/"
|
||||||
: (data3[j].val / allValDays).toFixed(
|
: (
|
||||||
2
|
data3[j].val /
|
||||||
);
|
allValDays
|
||||||
|
).toFixed(2);
|
||||||
that.tableDatas[j][4] = val;
|
that.tableDatas[j][4] = val;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -437,15 +452,18 @@ export default {
|
||||||
let hourProduct = (that.allValHour =
|
let hourProduct = (that.allValHour =
|
||||||
res4[0].total_production);
|
res4[0].total_production);
|
||||||
params4.mpoint__ep_monitored__power_kw__gte = 100;
|
params4.mpoint__ep_monitored__power_kw__gte = 100;
|
||||||
this.$API.enm.mpoint.stat.req(params4).then((res) => {
|
this.$API.enm.mpoint.stat
|
||||||
|
.req(params4)
|
||||||
|
.then((res) => {
|
||||||
let data4 = res4;
|
let data4 = res4;
|
||||||
for (let k = 0; k < data4.length; k++) {
|
for (let k = 0; k < data4.length; k++) {
|
||||||
let val =
|
let val =
|
||||||
hourProduct == 0
|
hourProduct == 0
|
||||||
? "/"
|
? "/"
|
||||||
: (data4[k].val / hourProduct).toFixed(
|
: (
|
||||||
2
|
data4[k].val /
|
||||||
);
|
hourProduct
|
||||||
|
).toFixed(2);
|
||||||
that.tableDatas[k][3] = val;
|
that.tableDatas[k][3] = val;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -455,6 +473,7 @@ export default {
|
||||||
that.getHourData();
|
that.getHourData();
|
||||||
that.getDayData();
|
that.getDayData();
|
||||||
that.getMonthData();
|
that.getMonthData();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//获取小时数据
|
//获取小时数据
|
||||||
|
|
|
@ -341,8 +341,10 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
exportLoading: false,
|
||||||
chartShow: false,
|
chartShow: false,
|
||||||
myOption: null,
|
myOption: null,
|
||||||
|
timeStamp: null,
|
||||||
optionHour: {},
|
optionHour: {},
|
||||||
optionDay: {},
|
optionDay: {},
|
||||||
optionMonth: {},
|
optionMonth: {},
|
||||||
|
@ -351,7 +353,7 @@ export default {
|
||||||
days: 1,
|
days: 1,
|
||||||
hours: 1,
|
hours: 1,
|
||||||
query: {
|
query: {
|
||||||
mgroup: "3347217246321065984",
|
mgroup: "",
|
||||||
},
|
},
|
||||||
tableDatas: [
|
tableDatas: [
|
||||||
["产量", "总产量(t)", 0, 0, 0, 0, 0, 0, 0, 0],
|
["产量", "总产量(t)", 0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
|
@ -568,6 +570,11 @@ export default {
|
||||||
let month_h = hourDate.getMonth() + 1;
|
let month_h = hourDate.getMonth() + 1;
|
||||||
let days_h = hourDate.getDate();
|
let days_h = hourDate.getDate();
|
||||||
let hours_h = hourDate.getHours();
|
let hours_h = hourDate.getHours();
|
||||||
|
that.$API.mtm.mgroup.list
|
||||||
|
.req({ page: 0, search: "回转窑" })
|
||||||
|
.then((res) => {
|
||||||
|
console.log("回转窑", res);
|
||||||
|
that.query.mgroup = res[0].id;
|
||||||
//昨日
|
//昨日
|
||||||
let params3 = {};
|
let params3 = {};
|
||||||
params3.page = 0;
|
params3.page = 0;
|
||||||
|
@ -575,8 +582,8 @@ export default {
|
||||||
params3.month_s = month_d;
|
params3.month_s = month_d;
|
||||||
params3.day_s = days_d;
|
params3.day_s = days_d;
|
||||||
params3.type = "day_s";
|
params3.type = "day_s";
|
||||||
params3.mgroup = this.query.mgroup;
|
params3.mgroup = that.query.mgroup;
|
||||||
this.$API.enm.enstat.req(params3).then((res3) => {
|
that.$API.enm.enstat.req(params3).then((res3) => {
|
||||||
if (res3.length > 0) {
|
if (res3.length > 0) {
|
||||||
let data3 = res3[0];
|
let data3 = res3[0];
|
||||||
that.tableDatas[0][3] = data3.total_production;
|
that.tableDatas[0][3] = data3.total_production;
|
||||||
|
@ -597,8 +604,8 @@ export default {
|
||||||
params4.day = days_h;
|
params4.day = days_h;
|
||||||
params4.hour = hours_h;
|
params4.hour = hours_h;
|
||||||
params4.type = "hour_st";
|
params4.type = "hour_st";
|
||||||
params4.mgroup = this.query.mgroup;
|
params4.mgroup = that.query.mgroup;
|
||||||
this.$API.enm.enstat.req(params4).then((res4) => {
|
that.$API.enm.enstat.req(params4).then((res4) => {
|
||||||
if (res4.length > 0) {
|
if (res4.length > 0) {
|
||||||
let data4 = res4[0];
|
let data4 = res4[0];
|
||||||
that.tableDatas[0][2] = data4.total_production;
|
that.tableDatas[0][2] = data4.total_production;
|
||||||
|
@ -610,8 +617,8 @@ export default {
|
||||||
});
|
});
|
||||||
let params5 = {};
|
let params5 = {};
|
||||||
params5.page = 0;
|
params5.page = 0;
|
||||||
params5.mgroup = "3346520558031773696";
|
params5.mgroup = that.query.mgroup;
|
||||||
this.$API.mtm.goal.list
|
that.$API.mtm.goal.list
|
||||||
.req(params5)
|
.req(params5)
|
||||||
.then((res5) => {
|
.then((res5) => {
|
||||||
if (res5.length > 0) {
|
if (res5.length > 0) {
|
||||||
|
@ -621,32 +628,42 @@ export default {
|
||||||
if (item5.goal_cate_name == "总产量(t)") {
|
if (item5.goal_cate_name == "总产量(t)") {
|
||||||
that.tableDatas[0][6] = item5[str];
|
that.tableDatas[0][6] = item5[str];
|
||||||
that.tableDatas[0][8] = item5.goal_val;
|
that.tableDatas[0][8] = item5.goal_val;
|
||||||
} else if (item5.goal_cate_name == "台时产量(t/h)") {
|
} else if (
|
||||||
|
item5.goal_cate_name == "台时产量(t/h)"
|
||||||
|
) {
|
||||||
that.tableDatas[1][6] = item5[str];
|
that.tableDatas[1][6] = item5[str];
|
||||||
that.tableDatas[1][8] = item5.goal_val;
|
that.tableDatas[1][8] = item5.goal_val;
|
||||||
} else if (item5.goal_cate_name == "运转时间(h)") {
|
} else if (
|
||||||
|
item5.goal_cate_name == "运转时间(h)"
|
||||||
|
) {
|
||||||
that.tableDatas[2][6] = item5[str];
|
that.tableDatas[2][6] = item5[str];
|
||||||
that.tableDatas[2][8] = item5.goal_val;
|
that.tableDatas[2][8] = item5.goal_val;
|
||||||
} else if (item5.goal_cate_name == "运转率(%)") {
|
} else if (
|
||||||
|
item5.goal_cate_name == "运转率(%)"
|
||||||
|
) {
|
||||||
that.tableDatas[3][6] = item5[str];
|
that.tableDatas[3][6] = item5[str];
|
||||||
that.tableDatas[3][8] = item5.goal_val;
|
that.tableDatas[3][8] = item5.goal_val;
|
||||||
} else if (
|
} else if (
|
||||||
item5.goal_cate_name == "单位产品分布电耗(KW·h/t)"
|
item5.goal_cate_name ==
|
||||||
|
"单位产品分布电耗(KW·h/t)"
|
||||||
) {
|
) {
|
||||||
that.tableDatas[4][6] = item5[str];
|
that.tableDatas[4][6] = item5[str];
|
||||||
that.tableDatas[4][8] = item5.goal_val;
|
that.tableDatas[4][8] = item5.goal_val;
|
||||||
} else if (
|
} else if (
|
||||||
item5.goal_cate_name == "单位产品综合电耗(KW·h/t)"
|
item5.goal_cate_name ==
|
||||||
|
"单位产品综合电耗(KW·h/t)"
|
||||||
) {
|
) {
|
||||||
that.tableDatas[5][6] = item5[str];
|
that.tableDatas[5][6] = item5[str];
|
||||||
that.tableDatas[5][8] = item5.goal_val;
|
that.tableDatas[5][8] = item5.goal_val;
|
||||||
} else if (
|
} else if (
|
||||||
item5.goal_cate_name == "单位产品标煤耗(kgce/t)"
|
item5.goal_cate_name ==
|
||||||
|
"单位产品标煤耗(kgce/t)"
|
||||||
) {
|
) {
|
||||||
that.tableDatas[6][6] = item5[str];
|
that.tableDatas[6][6] = item5[str];
|
||||||
that.tableDatas[6][8] = item5.goal_val;
|
that.tableDatas[6][8] = item5.goal_val;
|
||||||
} else if (
|
} else if (
|
||||||
item5.goal_cate_name == "单位产品综合能耗(kgce/t)"
|
item5.goal_cate_name ==
|
||||||
|
"单位产品综合能耗(kgce/t)"
|
||||||
) {
|
) {
|
||||||
that.tableDatas[7][6] = item5[str];
|
that.tableDatas[7][6] = item5[str];
|
||||||
that.tableDatas[7][8] = item5.goal_val;
|
that.tableDatas[7][8] = item5.goal_val;
|
||||||
|
@ -689,7 +706,8 @@ export default {
|
||||||
that.tableDatas[4][5],
|
that.tableDatas[4][5],
|
||||||
that.tableDatas[4][8]
|
that.tableDatas[4][8]
|
||||||
);
|
);
|
||||||
that.tableDatas[5][5] = data1.celec_consume_unit;
|
that.tableDatas[5][5] =
|
||||||
|
data1.celec_consume_unit;
|
||||||
that.tableDatas[5][9] = precen(
|
that.tableDatas[5][9] = precen(
|
||||||
that.tableDatas[5][5],
|
that.tableDatas[5][5],
|
||||||
that.tableDatas[5][8]
|
that.tableDatas[5][8]
|
||||||
|
@ -742,7 +760,8 @@ export default {
|
||||||
that.tableDatas[4][4],
|
that.tableDatas[4][4],
|
||||||
that.tableDatas[4][6]
|
that.tableDatas[4][6]
|
||||||
);
|
);
|
||||||
that.tableDatas[5][4] = data2.celec_consume_unit;
|
that.tableDatas[5][4] =
|
||||||
|
data2.celec_consume_unit;
|
||||||
that.tableDatas[5][7] = precen(
|
that.tableDatas[5][7] = precen(
|
||||||
that.tableDatas[5][4],
|
that.tableDatas[5][4],
|
||||||
that.tableDatas[5][6]
|
that.tableDatas[5][6]
|
||||||
|
@ -763,6 +782,7 @@ export default {
|
||||||
that.getHourData();
|
that.getHourData();
|
||||||
that.getDayData();
|
that.getDayData();
|
||||||
that.getMonthData();
|
that.getMonthData();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//获取小时数据
|
//获取小时数据
|
||||||
|
|
|
@ -93,26 +93,48 @@ export default {
|
||||||
year_s: "",
|
year_s: "",
|
||||||
page: 0,
|
page: 0,
|
||||||
type: "month_st",
|
type: "month_st",
|
||||||
mgroup: "3347217246321065984",
|
mgroup: "",
|
||||||
},
|
},
|
||||||
tableDatas: [],
|
tableDatas: [],
|
||||||
|
exportLoading: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
let that = this;
|
let that = this;
|
||||||
var myDate = new Date();
|
var myDate = new Date();
|
||||||
let year = myDate.getFullYear();
|
let year = myDate.getFullYear();
|
||||||
|
this.timeStamp = myDate.getTime();
|
||||||
that.query.year_s = year;
|
that.query.year_s = year;
|
||||||
this.getData();
|
this.$API.mtm.mgroup.list
|
||||||
|
.req({ page: 0, search: "回转窑" })
|
||||||
|
.then((res) => {
|
||||||
|
console.log("回转窑", res);
|
||||||
|
that.query.mgroup = res[0].id;
|
||||||
|
that.getGoalData();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getGoalData() {
|
||||||
|
let that = this;
|
||||||
|
let params = {};
|
||||||
|
params.page = 0;
|
||||||
|
params.year = that.query.year_s;
|
||||||
|
params.mgroup = that.query.mgroup;
|
||||||
|
this.$API.mtm.goal.list.req(params).then((res) => {
|
||||||
|
let data = [];
|
||||||
|
if (res.length > 0) {
|
||||||
|
data = res[0];
|
||||||
|
}
|
||||||
|
that.getData(data);
|
||||||
|
});
|
||||||
|
},
|
||||||
getData() {
|
getData() {
|
||||||
let that = this;
|
let that = this;
|
||||||
let query0 = {};
|
let query0 = {};
|
||||||
query0.page = 0;
|
query0.page = 0;
|
||||||
query0.type = "month_st";
|
query0.type = "month_st";
|
||||||
query0.year_s = that.query.year_s - 1;
|
query0.year_s = that.query.year_s - 1;
|
||||||
query0.mgroup = "3347217246321065984";
|
query0.mgroup = that.query.mgroup;
|
||||||
let wrapArr = [],
|
let wrapArr = [],
|
||||||
wrapArr0 = [],
|
wrapArr0 = [],
|
||||||
wrapArrs = [];
|
wrapArrs = [];
|
||||||
|
@ -124,6 +146,7 @@ export default {
|
||||||
//先按月份排序,再按班组排序
|
//先按月份排序,再按班组排序
|
||||||
let n0 = item0.month_s;
|
let n0 = item0.month_s;
|
||||||
let ind0 = 0;
|
let ind0 = 0;
|
||||||
|
let team_name0 = item0.team_name;
|
||||||
if (team_name0.indexOf("甲") > -1) {
|
if (team_name0.indexOf("甲") > -1) {
|
||||||
ind0 = (n0 - 1) * 3;
|
ind0 = (n0 - 1) * 3;
|
||||||
} else if (team_name0.indexOf("乙") > -1) {
|
} else if (team_name0.indexOf("乙") > -1) {
|
||||||
|
@ -133,8 +156,6 @@ export default {
|
||||||
}
|
}
|
||||||
wrapArr0[ind0] = item0;
|
wrapArr0[ind0] = item0;
|
||||||
});
|
});
|
||||||
debugger;
|
|
||||||
console.log(wrapArr0);
|
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
this.$API.enm.enstat.req(that.query).then((res) => {
|
this.$API.enm.enstat.req(that.query).then((res) => {
|
||||||
|
|
|
@ -34,17 +34,21 @@
|
||||||
:loading="exportLoading"
|
:loading="exportLoading"
|
||||||
>导出xlsx
|
>导出xlsx
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button type="primary" @click="handlePrint">打印 </el-button>
|
||||||
type="primary"
|
|
||||||
@click="handlePrint"
|
|
||||||
>打印
|
|
||||||
</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
</el-header>
|
</el-header>
|
||||||
<el-card style="margin-top: 5px">
|
<el-card style="margin-top: 5px">
|
||||||
<div class="printWrap">
|
<div class="printWrap">
|
||||||
<div ref="print" id="myReport" class="printContainer">
|
<div ref="print" id="myReport" class="printContainer">
|
||||||
<table border="1" width="1075" cellspacing="0" :key="1" id="myTable" class="myTable" v-if="query.type==1">
|
<table
|
||||||
|
border="1"
|
||||||
|
width="1075"
|
||||||
|
cellspacing="0"
|
||||||
|
:key="1"
|
||||||
|
id="myTable"
|
||||||
|
class="myTable"
|
||||||
|
v-if="query.type == 1"
|
||||||
|
>
|
||||||
<thead class="myTableHead">
|
<thead class="myTableHead">
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="8">车间单位产品电耗月度分析表</th>
|
<th colspan="8">车间单位产品电耗月度分析表</th>
|
||||||
|
@ -62,22 +66,44 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="item in tableDatas" :key="item">
|
<tr v-for="item in tableDatas" :key="item">
|
||||||
<td v-for="(item1,ind) in item" :key="ind" class="numCell">
|
<td
|
||||||
|
v-for="(item1, ind) in item"
|
||||||
|
:key="ind"
|
||||||
|
class="numCell"
|
||||||
|
>
|
||||||
<div :class="bindClass(item1, ind)">
|
<div :class="bindClass(item1, ind)">
|
||||||
<span v-if="item1>0&&ind==3">↑</span>
|
<span v-if="item1 > 0 && ind == 3"
|
||||||
<span v-if="item1<0&&ind==3">↓</span>
|
>↑</span
|
||||||
<span v-if="item1<0&&ind==5">▲</span>
|
>
|
||||||
<span v-if="item1<0&&ind==5">▼</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 }}
|
{{ item1 }}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<table border="1" width="1075" cellspacing="0" :key="2" id="myTable1" class="myTable" v-else-if="query.type==2">
|
<table
|
||||||
|
border="1"
|
||||||
|
width="1075"
|
||||||
|
cellspacing="0"
|
||||||
|
:key="2"
|
||||||
|
id="myTable1"
|
||||||
|
class="myTable"
|
||||||
|
v-else-if="query.type == 2"
|
||||||
|
>
|
||||||
<thead class="myTableHead">
|
<thead class="myTableHead">
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="9">车间单位产品综合电耗月度分析表</th>
|
<th colspan="9">
|
||||||
|
车间单位产品综合电耗月度分析表
|
||||||
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th rowspan="2">月份</th>
|
<th rowspan="2">月份</th>
|
||||||
|
@ -96,20 +122,38 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="item in tableDatas2" :key="item">
|
<tr v-for="item in tableDatas2" :key="item">
|
||||||
<td v-for="(item1,ind) in item" :key="ind" class="numCell">
|
<td
|
||||||
|
v-for="(item1, ind) in item"
|
||||||
|
:key="ind"
|
||||||
|
class="numCell"
|
||||||
|
>
|
||||||
<div :class="bindClass(item1, ind)">
|
<div :class="bindClass(item1, ind)">
|
||||||
<span v-if="item1<0&&ind==6">▲</span>
|
<span v-if="item1 < 0 && ind == 6"
|
||||||
<span v-if="item1<0&&ind==6">▼</span>
|
>▲</span
|
||||||
|
>
|
||||||
|
<span v-if="item1 < 0 && ind == 6"
|
||||||
|
>▼</span
|
||||||
|
>
|
||||||
{{ item1 }}
|
{{ item1 }}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<table border="1" width="1075" cellspacing="0" :key="3" id="myTable1" class="myTable" v-else-if="query.type==3">
|
<table
|
||||||
|
border="1"
|
||||||
|
width="1075"
|
||||||
|
cellspacing="0"
|
||||||
|
:key="3"
|
||||||
|
id="myTable1"
|
||||||
|
class="myTable"
|
||||||
|
v-else-if="query.type == 3"
|
||||||
|
>
|
||||||
<thead class="myTableHead">
|
<thead class="myTableHead">
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="9">车间单位产品标煤耗月度分析表</th>
|
<th colspan="9">
|
||||||
|
车间单位产品标煤耗月度分析表
|
||||||
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th rowspan="2">月份</th>
|
<th rowspan="2">月份</th>
|
||||||
|
@ -128,20 +172,38 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="item in tableDatas3" :key="item">
|
<tr v-for="item in tableDatas3" :key="item">
|
||||||
<td v-for="(item1,ind) in item" :key="ind" class="numCell">
|
<td
|
||||||
|
v-for="(item1, ind) in item"
|
||||||
|
:key="ind"
|
||||||
|
class="numCell"
|
||||||
|
>
|
||||||
<div :class="bindClass(item1, ind)">
|
<div :class="bindClass(item1, ind)">
|
||||||
<span v-if="item1<0&&ind==6">▲</span>
|
<span v-if="item1 < 0 && ind == 6"
|
||||||
<span v-if="item1<0&&ind==6">▼</span>
|
>▲</span
|
||||||
|
>
|
||||||
|
<span v-if="item1 < 0 && ind == 6"
|
||||||
|
>▼</span
|
||||||
|
>
|
||||||
{{ item1 }}
|
{{ item1 }}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<table border="1" width="1075" cellspacing="0" :key="4" id="myTable1" class="myTable" v-else-if="query.type==4">
|
<table
|
||||||
|
border="1"
|
||||||
|
width="1075"
|
||||||
|
cellspacing="0"
|
||||||
|
:key="4"
|
||||||
|
id="myTable1"
|
||||||
|
class="myTable"
|
||||||
|
v-else-if="query.type == 4"
|
||||||
|
>
|
||||||
<thead class="myTableHead">
|
<thead class="myTableHead">
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="9">车间单位产品综合能耗月度分析表</th>
|
<th colspan="9">
|
||||||
|
车间单位产品综合能耗月度分析表
|
||||||
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th rowspan="2">月份</th>
|
<th rowspan="2">月份</th>
|
||||||
|
@ -160,10 +222,18 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="item in tableDatas4" :key="item">
|
<tr v-for="item in tableDatas4" :key="item">
|
||||||
<td v-for="(item1,ind) in item" :key="ind" class="numCell">
|
<td
|
||||||
|
v-for="(item1, ind) in item"
|
||||||
|
:key="ind"
|
||||||
|
class="numCell"
|
||||||
|
>
|
||||||
<div :class="bindClass(item1, ind)">
|
<div :class="bindClass(item1, ind)">
|
||||||
<span v-if="item1<0&&ind==6">▲</span>
|
<span v-if="item1 < 0 && ind == 6"
|
||||||
<span v-if="item1<0&&ind==6">▼</span>
|
>▲</span
|
||||||
|
>
|
||||||
|
<span v-if="item1 < 0 && ind == 6"
|
||||||
|
>▼</span
|
||||||
|
>
|
||||||
{{ item1 }}
|
{{ item1 }}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
@ -177,20 +247,24 @@
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import scEcharts from "@/components/scEcharts";
|
import scEcharts from "@/components/scEcharts";
|
||||||
import { defineAsyncComponent } from 'vue'
|
import { defineAsyncComponent } from "vue";
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
scEcharts,
|
scEcharts,
|
||||||
charts: defineAsyncComponent(() => import("@/components/scEnm/lineChartsdialog.vue")),
|
charts: defineAsyncComponent(() =>
|
||||||
|
import("@/components/scEnm/lineChartsdialog.vue")
|
||||||
|
),
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
exportLoading: false,
|
||||||
chartShow: false,
|
chartShow: false,
|
||||||
myOption: null,
|
myOption: null,
|
||||||
|
timeStamp: null,
|
||||||
query: {
|
query: {
|
||||||
type: 1,
|
type: 1,
|
||||||
year_s:'',
|
year_s: "",
|
||||||
mgroup:'3347217246321065984',
|
mgroup: "",
|
||||||
},
|
},
|
||||||
monthGoal: [],
|
monthGoal: [],
|
||||||
monthGoal2: [],
|
monthGoal2: [],
|
||||||
|
@ -200,21 +274,30 @@
|
||||||
tableDatas2: [],
|
tableDatas2: [],
|
||||||
tableDatas3: [],
|
tableDatas3: [],
|
||||||
tableDatas4: [],
|
tableDatas4: [],
|
||||||
options:[{
|
options: [
|
||||||
name:'电耗',id:1,
|
{
|
||||||
},{
|
name: "电耗",
|
||||||
name:'综合电耗',id:2,
|
id: 1,
|
||||||
},{
|
},
|
||||||
name:'标煤耗',id:3,
|
{
|
||||||
},{
|
name: "综合电耗",
|
||||||
name:'综合能耗',id:4,
|
id: 2,
|
||||||
}],
|
},
|
||||||
|
{
|
||||||
|
name: "标煤耗",
|
||||||
|
id: 3,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "综合能耗",
|
||||||
|
id: 4,
|
||||||
|
},
|
||||||
|
],
|
||||||
modelValue: true,
|
modelValue: true,
|
||||||
type:'hours',
|
type: "hours",
|
||||||
title:'title',
|
title: "title",
|
||||||
apiObj:'',
|
apiObj: "",
|
||||||
showClose: true,
|
showClose: true,
|
||||||
echartType:'line',
|
echartType: "line",
|
||||||
asynDialog: false,
|
asynDialog: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -223,15 +306,50 @@
|
||||||
var myDate = new Date();
|
var myDate = new Date();
|
||||||
let year = myDate.getFullYear();
|
let year = myDate.getFullYear();
|
||||||
that.query.year_s = year;
|
that.query.year_s = year;
|
||||||
|
that.timeStamp = myDate.getTime();
|
||||||
|
that.$API.mtm.mgroup.list
|
||||||
|
.req({ page: 0, search: "回转窑" })
|
||||||
|
.then((res) => {
|
||||||
|
console.log("回转窑", res);
|
||||||
|
that.query.mgroup = res[0].id;
|
||||||
//月目标
|
//月目标
|
||||||
|
that.getMonthGoal();
|
||||||
|
});
|
||||||
|
|
||||||
|
//月目标
|
||||||
|
},
|
||||||
|
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;
|
||||||
|
},
|
||||||
|
getMonthGoal() {
|
||||||
|
let that = this;
|
||||||
let paramsGoal = {};
|
let paramsGoal = {};
|
||||||
paramsGoal.page = 0;
|
paramsGoal.page = 0;
|
||||||
paramsGoal.mgroup = that.query.mgroup;
|
paramsGoal.mgroup = that.query.mgroup;
|
||||||
that.$API.mtm.goal.list.req(paramsGoal).then((ress) => {
|
that.$API.mtm.goal.list.req(paramsGoal).then((ress) => {
|
||||||
if (ress.length > 0) {
|
if (ress.length > 0) {
|
||||||
let monthGoal = [],monthGoal2 = [],monthGoal3 = [],monthGoal4 = [];
|
let monthGoal = [],
|
||||||
ress.forEach(goal=>{
|
monthGoal2 = [],
|
||||||
if(goal.goal_cate_name=='单位产品分布电耗(KW·h/t)'){
|
monthGoal3 = [],
|
||||||
|
monthGoal4 = [];
|
||||||
|
ress.forEach((goal) => {
|
||||||
|
if (
|
||||||
|
goal.goal_cate_name == "单位产品分布电耗(KW·h/t)"
|
||||||
|
) {
|
||||||
monthGoal[0] = goal.goal_val;
|
monthGoal[0] = goal.goal_val;
|
||||||
monthGoal[1] = goal.goal_val_2;
|
monthGoal[1] = goal.goal_val_2;
|
||||||
monthGoal[2] = goal.goal_val_3;
|
monthGoal[2] = goal.goal_val_3;
|
||||||
|
@ -247,7 +365,9 @@
|
||||||
monthGoal[12] = goal.goal_val_12;
|
monthGoal[12] = goal.goal_val_12;
|
||||||
that.monthGoal = monthGoal;
|
that.monthGoal = monthGoal;
|
||||||
}
|
}
|
||||||
if(goal.goal_cate_name=='单位产品综合电耗(KW·h/t)'){
|
if (
|
||||||
|
goal.goal_cate_name == "单位产品综合电耗(KW·h/t)"
|
||||||
|
) {
|
||||||
monthGoal2[0] = goal.goal_val;
|
monthGoal2[0] = goal.goal_val;
|
||||||
monthGoal2[1] = goal.goal_val_2;
|
monthGoal2[1] = goal.goal_val_2;
|
||||||
monthGoal2[2] = goal.goal_val_3;
|
monthGoal2[2] = goal.goal_val_3;
|
||||||
|
@ -263,7 +383,7 @@
|
||||||
monthGoal2[12] = goal.goal_val_12;
|
monthGoal2[12] = goal.goal_val_12;
|
||||||
that.monthGoal2 = monthGoal2;
|
that.monthGoal2 = monthGoal2;
|
||||||
}
|
}
|
||||||
if(goal.goal_cate_name=='单位产品标煤耗(kgce/t)'){
|
if (goal.goal_cate_name == "单位产品标煤耗(kgce/t)") {
|
||||||
monthGoal3[0] = goal.goal_val;
|
monthGoal3[0] = goal.goal_val;
|
||||||
monthGoal3[1] = goal.goal_val_2;
|
monthGoal3[1] = goal.goal_val_2;
|
||||||
monthGoal3[2] = goal.goal_val_3;
|
monthGoal3[2] = goal.goal_val_3;
|
||||||
|
@ -279,7 +399,9 @@
|
||||||
monthGoal3[12] = goal.goal_val_12;
|
monthGoal3[12] = goal.goal_val_12;
|
||||||
that.monthGoal3 = monthGoal3;
|
that.monthGoal3 = monthGoal3;
|
||||||
}
|
}
|
||||||
if(goal.goal_cate_name=='单位产品综合能耗(kgce/t)'){
|
if (
|
||||||
|
goal.goal_cate_name == "单位产品综合能耗(kgce/t)"
|
||||||
|
) {
|
||||||
monthGoal4[0] = goal.goal_val;
|
monthGoal4[0] = goal.goal_val;
|
||||||
monthGoal4[1] = goal.goal_val_2;
|
monthGoal4[1] = goal.goal_val_2;
|
||||||
monthGoal4[2] = goal.goal_val_3;
|
monthGoal4[2] = goal.goal_val_3;
|
||||||
|
@ -295,42 +417,30 @@
|
||||||
monthGoal4[12] = goal.goal_val_12;
|
monthGoal4[12] = goal.goal_val_12;
|
||||||
that.monthGoal4 = monthGoal4;
|
that.monthGoal4 = monthGoal4;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
this.getData();
|
this.getData();
|
||||||
} else {
|
} else {
|
||||||
this.getData();
|
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() {
|
getData() {
|
||||||
let that = this;
|
let that = this;
|
||||||
let query0 = {};
|
let query0 = {};
|
||||||
query0.page = 0;
|
query0.page = 0;
|
||||||
query0.type='month_s';
|
query0.type = "month_s";
|
||||||
query0.year_s = that.query.year_s - 1;
|
query0.year_s = that.query.year_s - 1;
|
||||||
query0.mgroup = that.query.mgroup;
|
query0.mgroup = that.query.mgroup;
|
||||||
let wrapArr = [],wrapArr0 = [] ,wrapArrs = [],wrapArrs2=[],wrapArrs3=[],wrapArrs4=[];
|
let wrapArr = [],
|
||||||
|
wrapArr0 = [],
|
||||||
|
wrapArrs = [],
|
||||||
|
wrapArrs2 = [],
|
||||||
|
wrapArrs3 = [],
|
||||||
|
wrapArrs4 = [];
|
||||||
this.$API.enm.enstat.req(query0).then((res0) => {
|
this.$API.enm.enstat.req(query0).then((res0) => {
|
||||||
let data0 = res0;
|
let data0 = res0;
|
||||||
if (data0.length > 0) {
|
if (data0.length > 0) {
|
||||||
data0.forEach(item0 => {
|
data0.forEach((item0) => {
|
||||||
//先按月份排序,再按班组排序
|
//先按月份排序,再按班组排序
|
||||||
let ind0 = item0.month_s;
|
let ind0 = item0.month_s;
|
||||||
wrapArr0[ind0] = item0;
|
wrapArr0[ind0] = item0;
|
||||||
|
@ -338,402 +448,308 @@
|
||||||
}
|
}
|
||||||
let query = {};
|
let query = {};
|
||||||
query.page = 0;
|
query.page = 0;
|
||||||
query.type='month_s';
|
query.type = "month_s";
|
||||||
query.year_s = that.query.year_s;
|
query.year_s = that.query.year_s;
|
||||||
query.mgroup = that.query.mgroup;
|
query.mgroup = that.query.mgroup;
|
||||||
that.$API.enm.enstat.req(query).then((res) => {
|
that.$API.enm.enstat.req(query).then((res) => {
|
||||||
let data = res;
|
let data = res;
|
||||||
if (data.length > 0) {
|
if (data.length > 0) {
|
||||||
data.forEach(item => {
|
data.forEach((item) => {
|
||||||
//先按月份排序,再按班组排序
|
//先按月份排序,再按班组排序
|
||||||
let ind = item.month_s;
|
let ind = item.month_s;
|
||||||
let arr = item;
|
let arr = item;
|
||||||
let time = ''+item.year_s+'.'+item.month_s;
|
let time = "" + item.year_s + "." + item.month_s;
|
||||||
arr.time = time;
|
arr.time = time;
|
||||||
wrapArr[ind] = arr;
|
wrapArr[ind] = arr;
|
||||||
});
|
});
|
||||||
//type==1
|
//type==1
|
||||||
wrapArr.forEach((item, index) => {
|
wrapArr.forEach((item, index) => {
|
||||||
let ind = item.month_s;
|
let ind = item.month_s;
|
||||||
let arrs = [],arrs2 = [],arrs3 = [],arrs4 = [];
|
let arrs = [],
|
||||||
|
arrs2 = [],
|
||||||
|
arrs3 = [],
|
||||||
|
arrs4 = [];
|
||||||
arrs[0] = item.time;
|
arrs[0] = item.time;
|
||||||
arrs2[0] = item.time;
|
arrs2[0] = item.time;
|
||||||
arrs3[0] = item.time;
|
arrs3[0] = item.time;
|
||||||
arrs4[0] = item.time;
|
arrs4[0] = item.time;
|
||||||
arrs[1] = item.elec_consume_unit;
|
arrs[1] = item.elec_consume_unit;
|
||||||
arrs[2]=that.monthGoal[ind]!==undefined?that.monthGoal[ind]:'/';
|
arrs[2] =
|
||||||
|
that.monthGoal[ind] !== undefined
|
||||||
|
? that.monthGoal[ind]
|
||||||
|
: "/";
|
||||||
//当期与目标差值(KW·h/t)
|
//当期与目标差值(KW·h/t)
|
||||||
let diff = 0;
|
let diff = 0;
|
||||||
if(arrs[2]!=='/'){
|
if (arrs[2] !== "/") {
|
||||||
diff = arrs[1] - arrs[2];
|
diff = arrs[1] - arrs[2];
|
||||||
} else {
|
} else {
|
||||||
diff = '/';
|
diff = "/";
|
||||||
}
|
}
|
||||||
arrs[3] = diff;
|
arrs[3] = diff;
|
||||||
//环期值(KW·h/t)上个月的值
|
//环期值(KW·h/t)上个月的值
|
||||||
let lastNum = 0;
|
let lastNum = 0;
|
||||||
if (index > 1) {
|
if (index > 1) {
|
||||||
let num = index - 1;
|
let num = index - 1;
|
||||||
if(wrapArr[num]&&wrapArr[num].elec_consume_unit){
|
if (
|
||||||
|
wrapArr[num] &&
|
||||||
|
wrapArr[num].elec_consume_unit
|
||||||
|
) {
|
||||||
lastNum = wrapArr[num].elec_consume_unit;
|
lastNum = wrapArr[num].elec_consume_unit;
|
||||||
} else {
|
} else {
|
||||||
lastNum='/'
|
lastNum = "/";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
lastNum = wrapArr0[12]?wrapArr0[12].elec_consume_unit:'/';
|
lastNum = wrapArr0[12]
|
||||||
|
? wrapArr0[12].elec_consume_unit
|
||||||
|
: "/";
|
||||||
}
|
}
|
||||||
arrs[4] = lastNum;
|
arrs[4] = lastNum;
|
||||||
//当期与环期差值(KW·h/t)
|
//当期与环期差值(KW·h/t)
|
||||||
let lastDiff = 0;
|
let lastDiff = 0;
|
||||||
|
|
||||||
if(arrs[1]!=='/'&&arrs[4]!=='/'){
|
if (arrs[1] !== "/" && arrs[4] !== "/") {
|
||||||
lastDiff = arrs[1] - arrs[4];
|
lastDiff = arrs[1] - arrs[4];
|
||||||
} else {
|
} else {
|
||||||
lastDiff = '/';
|
lastDiff = "/";
|
||||||
}
|
}
|
||||||
arrs[5] = lastDiff;
|
arrs[5] = lastDiff;
|
||||||
//环比增长率(%)
|
//环比增长率(%)
|
||||||
let lastRate = 0;
|
let lastRate = 0;
|
||||||
if(lastDiff=='/'&&lastNum!=='/'&&lastNum!==0){
|
if (
|
||||||
|
lastDiff == "/" &&
|
||||||
|
lastNum !== "/" &&
|
||||||
|
lastNum !== 0
|
||||||
|
) {
|
||||||
lastRate = (lastDiff / lastNum) * 100;
|
lastRate = (lastDiff / lastNum) * 100;
|
||||||
} else {
|
} else {
|
||||||
lastRate = '/'
|
lastRate = "/";
|
||||||
}
|
}
|
||||||
arrs[6] = lastRate;
|
arrs[6] = lastRate;
|
||||||
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
||||||
let sameRate = 0;
|
let sameRate = 0;
|
||||||
if(wrapArr0[index]&&wrapArr0[index].elec_consume_unit){
|
if (
|
||||||
sameRate =((arrs[1]- wrapArr0[index].elec_consume_unit)/wrapArr0[index].elec_consume_unit)*100
|
wrapArr0[index] &&
|
||||||
|
wrapArr0[index].elec_consume_unit
|
||||||
|
) {
|
||||||
|
sameRate =
|
||||||
|
((arrs[1] -
|
||||||
|
wrapArr0[index].elec_consume_unit) /
|
||||||
|
wrapArr0[index].elec_consume_unit) *
|
||||||
|
100;
|
||||||
} else {
|
} else {
|
||||||
sameRate='/';
|
sameRate = "/";
|
||||||
}
|
}
|
||||||
arrs[7] = sameRate;
|
arrs[7] = sameRate;
|
||||||
wrapArrs.push(arrs);
|
wrapArrs.push(arrs);
|
||||||
arrs2[1] = item.celec_consume_unit;
|
arrs2[1] = item.celec_consume_unit;
|
||||||
arrs2[2]=that.monthGoal2[ind]!==undefined?that.monthGoal2[ind]:'/';
|
arrs2[2] =
|
||||||
|
that.monthGoal2[ind] !== undefined
|
||||||
|
? that.monthGoal2[ind]
|
||||||
|
: "/";
|
||||||
arrs2[3] = 48;
|
arrs2[3] = 48;
|
||||||
arrs2[4] = 57;
|
arrs2[4] = 57;
|
||||||
arrs2[5] = 61;
|
arrs2[5] = 61;
|
||||||
//当期与环期差值(KW·h/t)
|
//当期与环期差值(KW·h/t)
|
||||||
let lastNum2 = 0,lastDiff2 = 0;
|
let lastNum2 = 0,
|
||||||
|
lastDiff2 = 0;
|
||||||
if (index > 1) {
|
if (index > 1) {
|
||||||
let num = index - 1;
|
let num = index - 1;
|
||||||
if(wrapArr[num]&&wrapArr[num].celec_consume_unit){
|
if (
|
||||||
|
wrapArr[num] &&
|
||||||
|
wrapArr[num].celec_consume_unit
|
||||||
|
) {
|
||||||
lastNum2 = wrapArr[num].celec_consume_unit;
|
lastNum2 = wrapArr[num].celec_consume_unit;
|
||||||
} else {
|
} else {
|
||||||
lastNum2='/'
|
lastNum2 = "/";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
lastNum2 = wrapArr0[12]?wrapArr0[12].celec_consume_unit:'/';
|
lastNum2 = wrapArr0[12]
|
||||||
|
? wrapArr0[12].celec_consume_unit
|
||||||
|
: "/";
|
||||||
}
|
}
|
||||||
if(arrs2[1]!=='/'&&lastNum2!=='/'){
|
if (arrs2[1] !== "/" && lastNum2 !== "/") {
|
||||||
lastDiff2 = arrs2[1] - lastNum2;
|
lastDiff2 = arrs2[1] - lastNum2;
|
||||||
} else {
|
} else {
|
||||||
lastDiff2 = '/';
|
lastDiff2 = "/";
|
||||||
}
|
}
|
||||||
arrs2[6] = lastDiff2;
|
arrs2[6] = lastDiff2;
|
||||||
//环比增长率(%)
|
//环比增长率(%)
|
||||||
let lastRate2 = 0;
|
let lastRate2 = 0;
|
||||||
if(lastDiff2=='/'&&lastNum2!=='/'&&lastNum2!==0){
|
if (
|
||||||
|
lastDiff2 == "/" &&
|
||||||
|
lastNum2 !== "/" &&
|
||||||
|
lastNum2 !== 0
|
||||||
|
) {
|
||||||
lastRate2 = (lastDiff2 / lastNum2) * 100;
|
lastRate2 = (lastDiff2 / lastNum2) * 100;
|
||||||
} else {
|
} else {
|
||||||
lastRate2 = '/'
|
lastRate2 = "/";
|
||||||
}
|
}
|
||||||
arrs2[7] = lastRate2;
|
arrs2[7] = lastRate2;
|
||||||
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
||||||
let sameRate2 = 0;
|
let sameRate2 = 0;
|
||||||
if(wrapArr0[index]&&wrapArr0[index].celec_consume_unit){
|
if (
|
||||||
sameRate2 =((arrs[1]- wrapArr0[index].celec_consume_unit)/wrapArr0[index].celec_consume_unit)*100
|
wrapArr0[index] &&
|
||||||
|
wrapArr0[index].celec_consume_unit
|
||||||
|
) {
|
||||||
|
sameRate2 =
|
||||||
|
((arrs[1] -
|
||||||
|
wrapArr0[index].celec_consume_unit) /
|
||||||
|
wrapArr0[index].celec_consume_unit) *
|
||||||
|
100;
|
||||||
} else {
|
} else {
|
||||||
sameRate2='/';
|
sameRate2 = "/";
|
||||||
}
|
}
|
||||||
arrs2[8] = sameRate2;
|
arrs2[8] = sameRate2;
|
||||||
wrapArrs2.push(arrs2);
|
wrapArrs2.push(arrs2);
|
||||||
|
|
||||||
arrs3[1] = item.coal_consume_unit;
|
arrs3[1] = item.coal_consume_unit;
|
||||||
arrs3[2]=that.monthGoal3[ind]!==undefined?that.monthGoal3[ind]:'/';
|
arrs3[2] =
|
||||||
|
that.monthGoal3[ind] !== undefined
|
||||||
|
? that.monthGoal3[ind]
|
||||||
|
: "/";
|
||||||
arrs3[3] = 94;
|
arrs3[3] = 94;
|
||||||
arrs3[4] = 100;
|
arrs3[4] = 100;
|
||||||
arrs3[5] = 109;
|
arrs3[5] = 109;
|
||||||
//当期与环期差值(KW·h/t)
|
//当期与环期差值(KW·h/t)
|
||||||
let lastNum3 = 0,lastDiff3 = 0;
|
let lastNum3 = 0,
|
||||||
|
lastDiff3 = 0;
|
||||||
if (index > 1) {
|
if (index > 1) {
|
||||||
let num = index - 1;
|
let num = index - 1;
|
||||||
if(wrapArr[num]&&wrapArr[num].coal_consume_unit){
|
if (
|
||||||
|
wrapArr[num] &&
|
||||||
|
wrapArr[num].coal_consume_unit
|
||||||
|
) {
|
||||||
lastNum3 = wrapArr[num].coal_consume_unit;
|
lastNum3 = wrapArr[num].coal_consume_unit;
|
||||||
} else {
|
} else {
|
||||||
lastNum3='/'
|
lastNum3 = "/";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
lastNum3 = wrapArr0[12]?wrapArr0[12].coal_consume_unit:'/';
|
lastNum3 = wrapArr0[12]
|
||||||
|
? wrapArr0[12].coal_consume_unit
|
||||||
|
: "/";
|
||||||
}
|
}
|
||||||
if(arrs3[1]!=='/'&&lastNum3!=='/'){
|
if (arrs3[1] !== "/" && lastNum3 !== "/") {
|
||||||
lastDiff3 = arrs3[1] - lastNum3;
|
lastDiff3 = arrs3[1] - lastNum3;
|
||||||
} else {
|
} else {
|
||||||
lastDiff3 = '/';
|
lastDiff3 = "/";
|
||||||
}
|
}
|
||||||
arrs3[6] = lastDiff3;
|
arrs3[6] = lastDiff3;
|
||||||
//环比增长率(%)
|
//环比增长率(%)
|
||||||
let lastRate3 = 0;
|
let lastRate3 = 0;
|
||||||
if(lastDiff3=='/'&&lastNum3!=='/'&&lastNum3!==0){
|
if (
|
||||||
|
lastDiff3 == "/" &&
|
||||||
|
lastNum3 !== "/" &&
|
||||||
|
lastNum3 !== 0
|
||||||
|
) {
|
||||||
lastRate3 = (lastDiff3 / lastNum3) * 100;
|
lastRate3 = (lastDiff3 / lastNum3) * 100;
|
||||||
} else {
|
} else {
|
||||||
lastRate3 = '/'
|
lastRate3 = "/";
|
||||||
}
|
}
|
||||||
arrs3[7] = lastRate3;
|
arrs3[7] = lastRate3;
|
||||||
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
||||||
let sameRate3 = 0;
|
let sameRate3 = 0;
|
||||||
if(wrapArr0[index]&&wrapArr0[index].coal_consume_unit){
|
if (
|
||||||
sameRate3 =((arrs[1]- wrapArr0[index].coal_consume_unit)/wrapArr0[index].coal_consume_unit)*100
|
wrapArr0[index] &&
|
||||||
|
wrapArr0[index].coal_consume_unit
|
||||||
|
) {
|
||||||
|
sameRate3 =
|
||||||
|
((arrs[1] -
|
||||||
|
wrapArr0[index].coal_consume_unit) /
|
||||||
|
wrapArr0[index].coal_consume_unit) *
|
||||||
|
100;
|
||||||
} else {
|
} else {
|
||||||
sameRate3='/';
|
sameRate3 = "/";
|
||||||
}
|
}
|
||||||
arrs3[8] = sameRate3;
|
arrs3[8] = sameRate3;
|
||||||
wrapArrs3.push(arrs3);
|
wrapArrs3.push(arrs3);
|
||||||
|
|
||||||
|
|
||||||
arrs4[1] = item.cen_consume_unit;
|
arrs4[1] = item.cen_consume_unit;
|
||||||
arrs4[2]=that.monthGoal4[ind]!==undefined?that.monthGoal4[ind]:'/';
|
arrs4[2] =
|
||||||
|
that.monthGoal4[ind] !== undefined
|
||||||
|
? that.monthGoal4[ind]
|
||||||
|
: "/";
|
||||||
arrs4[3] = 100;
|
arrs4[3] = 100;
|
||||||
arrs4[4] = 107;
|
arrs4[4] = 107;
|
||||||
arrs4[5] = 117;
|
arrs4[5] = 117;
|
||||||
//当期与环期差值(KW·h/t)
|
//当期与环期差值(KW·h/t)
|
||||||
let lastNum4 = 0,lastDiff4 = 0;
|
let lastNum4 = 0,
|
||||||
|
lastDiff4 = 0;
|
||||||
if (index > 1) {
|
if (index > 1) {
|
||||||
let num = index - 1;
|
let num = index - 1;
|
||||||
if(wrapArr[num]&&wrapArr[num].cen_consume_unit){
|
if (
|
||||||
|
wrapArr[num] &&
|
||||||
|
wrapArr[num].cen_consume_unit
|
||||||
|
) {
|
||||||
lastNum4 = wrapArr[num].cen_consume_unit;
|
lastNum4 = wrapArr[num].cen_consume_unit;
|
||||||
} else {
|
} else {
|
||||||
lastNum4='/'
|
lastNum4 = "/";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
lastNum4 = wrapArr0[12]?wrapArr0[12].cen_consume_unit:'/';
|
lastNum4 = wrapArr0[12]
|
||||||
|
? wrapArr0[12].cen_consume_unit
|
||||||
|
: "/";
|
||||||
}
|
}
|
||||||
if(arrs4[1]!=='/'&&lastNum4!=='/'){
|
if (arrs4[1] !== "/" && lastNum4 !== "/") {
|
||||||
lastDiff4 = arrs4[1] - lastNum4;
|
lastDiff4 = arrs4[1] - lastNum4;
|
||||||
} else {
|
} else {
|
||||||
lastDiff4 = '/';
|
lastDiff4 = "/";
|
||||||
}
|
}
|
||||||
arrs4[6] = lastDiff4;
|
arrs4[6] = lastDiff4;
|
||||||
//环比增长率(%)
|
//环比增长率(%)
|
||||||
let lastRate4 = 0;
|
let lastRate4 = 0;
|
||||||
if(lastDiff4=='/'&&lastNum4!=='/'&&lastNum4!==0){
|
if (
|
||||||
|
lastDiff4 == "/" &&
|
||||||
|
lastNum4 !== "/" &&
|
||||||
|
lastNum4 !== 0
|
||||||
|
) {
|
||||||
lastRate4 = (lastDiff4 / lastNum4) * 100;
|
lastRate4 = (lastDiff4 / lastNum4) * 100;
|
||||||
} else {
|
} else {
|
||||||
lastRate4 = '/'
|
lastRate4 = "/";
|
||||||
}
|
}
|
||||||
arrs4[7] = lastRate4;
|
arrs4[7] = lastRate4;
|
||||||
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
||||||
let sameRate4 = 0;
|
let sameRate4 = 0;
|
||||||
if(wrapArr0[index]&&wrapArr0[index].cen_consume_unit){
|
if (
|
||||||
sameRate4 =((arrs[1]- wrapArr0[index].cen_consume_unit)/wrapArr0[index].cen_consume_unit)*100
|
wrapArr0[index] &&
|
||||||
|
wrapArr0[index].cen_consume_unit
|
||||||
|
) {
|
||||||
|
sameRate4 =
|
||||||
|
((arrs[1] -
|
||||||
|
wrapArr0[index].cen_consume_unit) /
|
||||||
|
wrapArr0[index].cen_consume_unit) *
|
||||||
|
100;
|
||||||
} else {
|
} else {
|
||||||
sameRate4='/';
|
sameRate4 = "/";
|
||||||
}
|
}
|
||||||
arrs4[8] = sameRate4;
|
arrs4[8] = sameRate4;
|
||||||
wrapArrs4.push(arrs4);
|
wrapArrs4.push(arrs4);
|
||||||
})
|
});
|
||||||
that.tableDatas = wrapArrs;
|
that.tableDatas = wrapArrs;
|
||||||
that.tableDatas2 = wrapArrs2;
|
that.tableDatas2 = wrapArrs2;
|
||||||
that.tableDatas3 = wrapArrs3;
|
that.tableDatas3 = wrapArrs3;
|
||||||
that.tableDatas4 = wrapArrs4;
|
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 {
|
} else {
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
itemClick(type, item) {
|
itemClick(type, item) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.asynDialog = true;
|
this.asynDialog = true;
|
||||||
},
|
},
|
||||||
itemClick1(type,item){
|
handleQuery() {
|
||||||
this.chartShow = false;
|
this.getMonthGoal();
|
||||||
this.$API.bi.dataset.exec
|
|
||||||
.req('3322567213885833216')
|
|
||||||
.then((res) => {
|
|
||||||
this.myOption = JSON.parse(res.echart_options);
|
|
||||||
debugger;
|
|
||||||
console.log(this.myOption)
|
|
||||||
this.chartShow = true;
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
typeCange() {},
|
||||||
handlePrint() {
|
handlePrint() {
|
||||||
this.$PRINT('#myReport');
|
this.$PRINT("#myReport");
|
||||||
},
|
},
|
||||||
exportExcel() {
|
exportExcel() {
|
||||||
this.exportLoading = true;
|
this.exportLoading = true;
|
||||||
this.$XLSX('#myTable', this.tableName)
|
this.$XLSX("#myTable", this.tableName);
|
||||||
this.exportLoading = false;
|
this.exportLoading = false;
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
@ -741,5 +757,4 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
overflow-x: scroll;
|
overflow-x: scroll;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
Loading…
Reference in New Issue