fix:水泥磨mgroup根据名称获取
This commit is contained in:
parent
63737587e1
commit
4e8a3d486a
|
@ -1,258 +1,398 @@
|
|||
<template>
|
||||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<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"
|
||||
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 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-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<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 label="关联工段" prop="mgroup_name"></el-table-column> -->
|
||||
<el-table-column label="开始时间" prop="start_time">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.start_time.slice(0, 16) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结束时间" prop="end_time">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.end_time.slice(0, 16) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="班组名称" 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-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<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"
|
||||
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
|
||||
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-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="handleQuery"
|
||||
></el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<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 label="关联工段" prop="mgroup_name"></el-table-column> -->
|
||||
<el-table-column label="开始时间" prop="start_time">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.start_time.slice(0, 16) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结束时间" prop="end_time">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.end_time.slice(0, 16) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="班组名称"
|
||||
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="检验时间">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.last_test_time">{{ scope.row.last_test_time.slice(0, 16) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="140">
|
||||
<template #default="scope">
|
||||
<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_other(scope.row)" type="primary">其他能源</el-button> -->
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<el-button link size="small" @click="sflog_export(scope.row)" type="success">报表</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
<el-drawer v-model="limitedExport" size="60%" :show-close="false">
|
||||
<template #header="{ close, titleId, titleClass }">
|
||||
<h4 :id="titleId" :class="titleClass">交接班日志</h4>
|
||||
<el-button type="danger" @click="close">
|
||||
<el-icon class="el-icon--left">
|
||||
<CircleCloseFilled />
|
||||
</el-icon>
|
||||
关闭
|
||||
</el-button>
|
||||
</template>
|
||||
<div class="left-panel">
|
||||
<el-button type="primary" @click="exportExcel()" :loading="exportLoading">导出xlsx
|
||||
</el-button>
|
||||
<el-button type="primary" @click="handlePrint">打印
|
||||
</el-button>
|
||||
</div>
|
||||
<el-main class="nopadding">
|
||||
<div ref="print" id="myReport" class="printContainer">
|
||||
<div style="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>
|
||||
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="numCell">日期</td>
|
||||
<td class="numCell" v-if="sflogItem.end_time">{{ sflogItem.end_time.slice(0, 10) }}</td>
|
||||
<td class="numCell">班次</td>
|
||||
<td class="numCell">{{ sflogItem.shift_name }}</td>
|
||||
<td class="numCell">班组</td>
|
||||
<td class="numCell"><span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">产量(t)</td>
|
||||
<td class="numCell">{{ reportItem.total_production }}</td>
|
||||
<td class="numCell">台时(t/h)</td>
|
||||
<td class="numCell">{{ reportItem.production_hour }}</td>
|
||||
<td class="numCell">运转时间(h)</td>
|
||||
<td class="numCell">{{ reportItem.run_hour }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">运转率(%)</td>
|
||||
<td class="numCell">{{ reportItem.run_rate * 100 }}</td>
|
||||
<td class="numCell">停机时长(h)</td>
|
||||
<td class="numCell">{{ reportItem.shut_hour }}</td>
|
||||
<td class="numCell">煤磨分布电耗(KW·h/t)</td>
|
||||
<td class="numCell">{{ reportItem.elec_consume_unit }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">煤粉细度合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.煤粉_细度_rate_pass">{{ reportItem.煤粉_细度_rate_pass * 100 }}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
<td class="numCell">煤粉水分合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.煤粉_水分_rate_pass">{{ reportItem.煤粉_水分_rate_pass * 100 }}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
</tr>
|
||||
<tr v-if="sflogexpList.length > 0">
|
||||
<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>
|
||||
</tr>
|
||||
<tr v-for="item in sflogexpList" :key="item.id">
|
||||
<td class="numCell">{{ item.happen_time }}</td>
|
||||
<td class="numCell">{{ item.cate }}</td>
|
||||
<td class="numCell">{{ item.reason }}</td>
|
||||
<td class="numCell">{{ item.measure }}</td>
|
||||
<td class="numCell">{{ item.handler }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</el-main>
|
||||
</el-drawer>
|
||||
</el-container>
|
||||
<el-table-column label="检验时间">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.last_test_time">{{
|
||||
scope.row.last_test_time.slice(0, 16)
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
fixed="right"
|
||||
align="center"
|
||||
width="140"
|
||||
>
|
||||
<template #default="scope">
|
||||
<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_other(scope.row)" type="primary">其他能源</el-button> -->
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<el-button
|
||||
link
|
||||
size="small"
|
||||
@click="sflog_export(scope.row)"
|
||||
type="success"
|
||||
>报表</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
<el-drawer v-model="limitedExport" size="60%" :show-close="false">
|
||||
<template #header="{ close, titleId, titleClass }">
|
||||
<h4 :id="titleId" :class="titleClass">交接班日志</h4>
|
||||
<el-button type="danger" @click="close">
|
||||
<el-icon class="el-icon--left">
|
||||
<CircleCloseFilled />
|
||||
</el-icon>
|
||||
关闭
|
||||
</el-button>
|
||||
</template>
|
||||
<div class="left-panel">
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="exportExcel()"
|
||||
:loading="exportLoading"
|
||||
>导出xlsx
|
||||
</el-button>
|
||||
<el-button type="primary" @click="handlePrint">打印 </el-button>
|
||||
</div>
|
||||
<el-main class="nopadding">
|
||||
<div ref="print" id="myReport" class="printContainer">
|
||||
<div
|
||||
style="
|
||||
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>
|
||||
<table
|
||||
border="1"
|
||||
width="1000"
|
||||
cellspacing="0"
|
||||
:key="timeStamp"
|
||||
id="myTable"
|
||||
>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="numCell">日期</td>
|
||||
<td class="numCell" v-if="sflogItem.end_time">
|
||||
{{ sflogItem.end_time.slice(0, 10) }}
|
||||
</td>
|
||||
<td class="numCell">班次</td>
|
||||
<td class="numCell">
|
||||
{{ sflogItem.shift_name }}
|
||||
</td>
|
||||
<td class="numCell">班组</td>
|
||||
<td class="numCell">
|
||||
<span v-if="sflogItem.team_name">{{
|
||||
sflogItem.team_name
|
||||
}}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">产量(t)</td>
|
||||
<td class="numCell">
|
||||
{{ reportItem.total_production }}
|
||||
</td>
|
||||
<td class="numCell">台时(t/h)</td>
|
||||
<td class="numCell">
|
||||
{{ reportItem.production_hour }}
|
||||
</td>
|
||||
<td class="numCell">运转时间(h)</td>
|
||||
<td class="numCell">
|
||||
{{ reportItem.run_hour }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">运转率(%)</td>
|
||||
<td class="numCell">
|
||||
{{ reportItem.run_rate * 100 }}
|
||||
</td>
|
||||
<td class="numCell">停机时长(h)</td>
|
||||
<td class="numCell">
|
||||
{{ reportItem.shut_hour }}
|
||||
</td>
|
||||
<td class="numCell">煤磨分布电耗(KW·h/t)</td>
|
||||
<td class="numCell">
|
||||
{{ reportItem.elec_consume_unit }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">煤粉细度合格率(%)</td>
|
||||
<td
|
||||
class="numCell"
|
||||
v-if="reportItem.煤粉_细度_rate_pass"
|
||||
>
|
||||
{{ reportItem.煤粉_细度_rate_pass * 100 }}
|
||||
</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
<td class="numCell">煤粉水分合格率(%)</td>
|
||||
<td
|
||||
class="numCell"
|
||||
v-if="reportItem.煤粉_水分_rate_pass"
|
||||
>
|
||||
{{ reportItem.煤粉_水分_rate_pass * 100 }}
|
||||
</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
</tr>
|
||||
<tr v-if="sflogexpList.length > 0">
|
||||
<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>
|
||||
</tr>
|
||||
<tr v-for="item in sflogexpList" :key="item.id">
|
||||
<td class="numCell">{{ item.happen_time }}</td>
|
||||
<td class="numCell">{{ item.cate }}</td>
|
||||
<td class="numCell">{{ item.reason }}</td>
|
||||
<td class="numCell">{{ item.measure }}</td>
|
||||
<td class="numCell">{{ item.handler }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</el-main>
|
||||
</el-drawer>
|
||||
</el-container>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "sflog",
|
||||
name: "sflog",
|
||||
|
||||
data() {
|
||||
return {
|
||||
apiObj: this.$API.wpm.sflog.list,
|
||||
apiObj2: null,
|
||||
query: {
|
||||
shift: '',
|
||||
team: '',
|
||||
end_time__lt: '',
|
||||
start_time__gte: '',
|
||||
mgroup: '3347217651339837440',
|
||||
},
|
||||
deptId: '3347207316583170048',
|
||||
sflogItem: {},
|
||||
options: [],
|
||||
optionsShift: [],
|
||||
limitedExport: false,
|
||||
reportItem: {},
|
||||
sflogexpList: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getTeam();
|
||||
this.getShfit();
|
||||
},
|
||||
methods: {
|
||||
getTeam() {
|
||||
let form = {};
|
||||
form.page = 0;
|
||||
form.belong_dept = this.deptId;
|
||||
this.$API.mtm.team.list.req(form).then(res => {
|
||||
this.options = res;
|
||||
})
|
||||
},
|
||||
getShfit() {
|
||||
this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
|
||||
this.optionsShift = res;
|
||||
})
|
||||
},
|
||||
handleQuery() {
|
||||
this.$refs.table.queryData(this.query);
|
||||
},
|
||||
sflog_export() {
|
||||
this.limitedExport = true;
|
||||
},
|
||||
rowClick(row) {
|
||||
this.sflogId = row.id;
|
||||
this.sflogItem = row;
|
||||
this.getSflogItem(row.id);
|
||||
this.getSflogexp(row.id);
|
||||
},
|
||||
getSflogexp(id) {
|
||||
let that = this;
|
||||
that.$API.wpm.sflogexp.list.req({ page: 0, sflog: id }).then(res => {
|
||||
that.sflogexpList = res;
|
||||
})
|
||||
},
|
||||
getSflogItem(id) {
|
||||
let that = this;
|
||||
that.$API.enm.enstat.req({ type: 'sflog', sflog: id, page: 0 }).then(res => {
|
||||
if (res.length > 0) {
|
||||
that.reportItem = res[0];
|
||||
}
|
||||
})
|
||||
},
|
||||
//编辑
|
||||
sflog_edit(row) {
|
||||
let jsonStr = JSON.stringify(row);
|
||||
this.$TOOL.data.remove("sflogItem")
|
||||
this.$TOOL.data.set('sflogItem', jsonStr)
|
||||
this.$router.push({
|
||||
name: "logDetail",
|
||||
query: {
|
||||
mgroupId: row.mgroup,
|
||||
deptId: this.deptId
|
||||
},
|
||||
});
|
||||
},
|
||||
handlePrint() {
|
||||
this.$PRINT('#myReport');
|
||||
},
|
||||
exportExcel() {
|
||||
this.exportLoading = true;
|
||||
this.$XLSX('#myTable', this.tableName)
|
||||
this.exportLoading = false;
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
apiObj: null,
|
||||
apiObj2: null,
|
||||
query: {
|
||||
shift: "",
|
||||
team: "",
|
||||
end_time__lt: "",
|
||||
start_time__gte: "",
|
||||
mgroup: "",
|
||||
},
|
||||
deptId: "",
|
||||
sflogItem: {},
|
||||
options: [],
|
||||
optionsShift: [],
|
||||
limitedExport: false,
|
||||
reportItem: {},
|
||||
sflogexpList: [],
|
||||
};
|
||||
},
|
||||
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.getShfit();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
getTeam() {
|
||||
let form = {};
|
||||
form.page = 0;
|
||||
form.belong_dept = this.deptId;
|
||||
this.$API.mtm.team.list.req(form).then((res) => {
|
||||
this.options = res;
|
||||
});
|
||||
},
|
||||
getShfit() {
|
||||
this.$API.mtm.shift.list.req({ page: 0 }).then((res) => {
|
||||
this.optionsShift = res;
|
||||
});
|
||||
},
|
||||
handleQuery() {
|
||||
this.$refs.table.queryData(this.query);
|
||||
},
|
||||
sflog_export() {
|
||||
this.limitedExport = true;
|
||||
},
|
||||
rowClick(row) {
|
||||
this.sflogId = row.id;
|
||||
this.sflogItem = row;
|
||||
this.getSflogItem(row.id);
|
||||
this.getSflogexp(row.id);
|
||||
},
|
||||
getSflogexp(id) {
|
||||
let that = this;
|
||||
that.$API.wpm.sflogexp.list
|
||||
.req({ page: 0, sflog: id })
|
||||
.then((res) => {
|
||||
that.sflogexpList = res;
|
||||
});
|
||||
},
|
||||
getSflogItem(id) {
|
||||
let that = this;
|
||||
that.$API.enm.enstat
|
||||
.req({ type: "sflog", sflog: id, page: 0 })
|
||||
.then((res) => {
|
||||
if (res.length > 0) {
|
||||
that.reportItem = res[0];
|
||||
}
|
||||
});
|
||||
},
|
||||
//编辑
|
||||
sflog_edit(row) {
|
||||
let jsonStr = JSON.stringify(row);
|
||||
this.$TOOL.data.remove("sflogItem");
|
||||
this.$TOOL.data.set("sflogItem", jsonStr);
|
||||
this.$router.push({
|
||||
name: "logDetail",
|
||||
query: {
|
||||
mgroupId: row.mgroup,
|
||||
deptId: this.deptId,
|
||||
},
|
||||
});
|
||||
},
|
||||
handlePrint() {
|
||||
this.$PRINT("#myReport");
|
||||
},
|
||||
exportExcel() {
|
||||
this.exportLoading = true;
|
||||
this.$XLSX("#myTable", this.tableName);
|
||||
this.exportLoading = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped>
|
||||
#numTable {
|
||||
margin-left: 37px;
|
||||
margin-left: 37px;
|
||||
}
|
||||
|
||||
#numTable td {
|
||||
height: 32px;
|
||||
padding-left: 5px;
|
||||
height: 32px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.numCell {
|
||||
width: 80px;
|
||||
width: 80px;
|
||||
}
|
||||
|
||||
.numCell.numCell_last {
|
||||
width: 100px;
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.searchHead {
|
||||
display: flex
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.middleText {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
margin: 0 5px;
|
||||
display: inline-block;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
margin: 0 5px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.searchBtn {
|
||||
margin-left: 5px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
</style>
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,253 +1,304 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-date-picker
|
||||
v-model="query.year_s"
|
||||
type="year"
|
||||
value-format="YYYY"
|
||||
format="YYYY"
|
||||
placeholder="查询年份"
|
||||
class="headerSearch"
|
||||
/>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="handleQuery"
|
||||
></el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="exportExcel()"
|
||||
:loading = "exportLoading"
|
||||
>导出xlsx
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="handlePrint"
|
||||
>打印
|
||||
</el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-card style="margin-top:5px">
|
||||
<div class="printWrap">
|
||||
<div ref="print" id="myReport" class="printContainer">
|
||||
<table border="1" width="1900" cellspacing="0" :key="timeStamp" id="myTable" class="myTable">
|
||||
<thead class="myTableHead">
|
||||
<tr>
|
||||
<th colspan="19">水泥磨工段班组月度对比分析</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="2">月份</th>
|
||||
<th rowspan="2">班组</th>
|
||||
<th colspan="2">总产量(t)</th>
|
||||
<th>运转率</th>
|
||||
<th>成本</th>
|
||||
<th colspan="3">质量</th>
|
||||
<th colspan="9">单位产品电耗</th>
|
||||
<th rowspan="2">得分</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>总产量(t)</th>
|
||||
<th>台时产量(t/h)</th>
|
||||
<th>运转率(%)</th>
|
||||
<th>单位产品成本(元/吨)</th>
|
||||
<th>比表面积(%)</th>
|
||||
<th>SO3(%)</th>
|
||||
<th>掺量(%)</th>
|
||||
<th>循环风机1906(KW·h/t)</th>
|
||||
<th>系统风机(KW·h/t)</th>
|
||||
<th>水平涡流选粉机1915(KW·h/t)</th>
|
||||
<th>目标值(kW·h/t)</th>
|
||||
<th>当期与目标值差值(kW·h/t)</th>
|
||||
<th>环期值(kW·h/t)</th>
|
||||
<th>当期与环期差值(kW·h/t)</th>
|
||||
<th>环比增长率(%)</th>
|
||||
<th>同比增长率(%)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="(item,index) in tableDatas" :key="index">
|
||||
<td v-for="(item0,index0) in item" :key="index0" class="numCell"> <span v-if="item0">{{item0}}</span> <span v-else>0</span></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<div class="app-container">
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-date-picker
|
||||
v-model="query.year_s"
|
||||
type="year"
|
||||
value-format="YYYY"
|
||||
format="YYYY"
|
||||
placeholder="查询年份"
|
||||
class="headerSearch"
|
||||
/>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="handleQuery"
|
||||
></el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="exportExcel()"
|
||||
:loading="exportLoading"
|
||||
>导出xlsx
|
||||
</el-button>
|
||||
<el-button type="primary" @click="handlePrint">打印 </el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-card style="margin-top: 5px">
|
||||
<div class="printWrap">
|
||||
<div ref="print" id="myReport" class="printContainer">
|
||||
<table
|
||||
border="1"
|
||||
width="1900"
|
||||
cellspacing="0"
|
||||
:key="timeStamp"
|
||||
id="myTable"
|
||||
class="myTable"
|
||||
>
|
||||
<thead class="myTableHead">
|
||||
<tr>
|
||||
<th colspan="19">水泥磨工段班组月度对比分析</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="2">月份</th>
|
||||
<th rowspan="2">班组</th>
|
||||
<th colspan="2">总产量(t)</th>
|
||||
<th>运转率</th>
|
||||
<th>成本</th>
|
||||
<th colspan="3">质量</th>
|
||||
<th colspan="9">单位产品电耗</th>
|
||||
<th rowspan="2">得分</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>总产量(t)</th>
|
||||
<th>台时产量(t/h)</th>
|
||||
<th>运转率(%)</th>
|
||||
<th>单位产品成本(元/吨)</th>
|
||||
<th>比表面积(%)</th>
|
||||
<th>SO3(%)</th>
|
||||
<th>掺量(%)</th>
|
||||
<th>循环风机1906(KW·h/t)</th>
|
||||
<th>系统风机(KW·h/t)</th>
|
||||
<th>水平涡流选粉机1915(KW·h/t)</th>
|
||||
<th>目标值(kW·h/t)</th>
|
||||
<th>当期与目标值差值(kW·h/t)</th>
|
||||
<th>环期值(kW·h/t)</th>
|
||||
<th>当期与环期差值(kW·h/t)</th>
|
||||
<th>环比增长率(%)</th>
|
||||
<th>同比增长率(%)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="(item, index) in tableDatas" :key="index">
|
||||
<td
|
||||
v-for="(item0, index0) in item"
|
||||
:key="index0"
|
||||
class="numCell"
|
||||
>
|
||||
<span v-if="item0">{{ item0 }}</span>
|
||||
<span v-else>0</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
timeStamp:0,
|
||||
query:{
|
||||
year_s:'',
|
||||
page : 0,
|
||||
type : 'month_st',
|
||||
mgroup:'3347217651339837440',
|
||||
},
|
||||
tableDatas:[],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
var myDate = new Date();
|
||||
let year = myDate.getFullYear();
|
||||
that.query.year_s = year;
|
||||
let params = {};
|
||||
params.page=0;
|
||||
params.year=year;
|
||||
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);
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
getData(goalData){
|
||||
let that = this;
|
||||
let query0={};
|
||||
query0.page = 0;
|
||||
query0.type='month_st';
|
||||
query0.year_s = that.query.year_s-1;
|
||||
query0.mgroup='3346520558031773696';
|
||||
let wrapArr = [],wrapArr0 = [] ,wrapArrs = [];
|
||||
this.$API.enm.enstat.req(query0).then((res0) => {
|
||||
let data0 = [];//去年的值
|
||||
data0 = res0;
|
||||
if(data0.length>0){
|
||||
data0.forEach(item0 => {
|
||||
//先按月份排序,再按班组排序
|
||||
let n0 = item0.month_s;
|
||||
let ind0 = 0;
|
||||
if(team_name0.indexOf('甲')>-1){
|
||||
ind0 = (n0-1)*3;
|
||||
}else if(team_name0.indexOf('乙')>-1){
|
||||
ind0 = (n0-1)*3+1;
|
||||
}else if(team_name0.indexOf('丙')>-1){
|
||||
ind0 = (n0-1)*3+2;
|
||||
}
|
||||
wrapArr0[ind0] = item0;
|
||||
});
|
||||
console.log(wrapArr0)
|
||||
}else{
|
||||
}
|
||||
this.$API.enm.enstat.req(that.query).then((res) => {
|
||||
//今年的值
|
||||
let data = res;
|
||||
if(data.length>0){
|
||||
data.forEach(item => {
|
||||
//先按月份排序,再按班组排序
|
||||
let n = item.month_s;
|
||||
let team_name = item.team_name;
|
||||
let ind = 0;
|
||||
if(team_name.indexOf('甲')>-1){
|
||||
ind = (n-1)*3;
|
||||
}else if(team_name.indexOf('乙')>-1){
|
||||
ind = (n-1)*3+1;
|
||||
}else if(team_name.indexOf('丙')>-1){
|
||||
ind = (n-1)*3+2;
|
||||
}
|
||||
wrapArrs[ind] = item;
|
||||
let arr = [];
|
||||
let time = ''+item.year_s+'.'+item.month_s;
|
||||
arr.push(time);
|
||||
arr.push(item.team_name);
|
||||
arr.push(item.total_production);
|
||||
arr.push(item.production_hour);
|
||||
arr.push(item.run_rate);
|
||||
arr.push(item.production_cost_unit);
|
||||
//质量
|
||||
arr[6]=item.出磨水泥_比表面积_rate_pass!=null?item.出磨水泥_比表面积_rate_pass:'/';
|
||||
arr[7]=item.出磨水泥_SO3_rate_pass!=null?item.出磨水泥_SO3_rate_pass:'/';
|
||||
arr[8]=item.出磨水泥_掺量_rate_pass!=null?item.出磨水泥_掺量_rate_pass:'/';
|
||||
//设备
|
||||
arr[9]=item.循环风机1906_consume_unit!=null?item.循环风机1906_consume_unit:'/';
|
||||
arr[10]=item.系统风机_consume_unit!=null?item.系统风机_consume_unit:'/';
|
||||
arr[11]=item.水平涡流选粉机1915_consume_unit!=null?item.水平涡流选粉机1915_consume_unit:'/';
|
||||
// arr[12]=item.新增磨尾风机_consume_unit!=null?item.新增磨尾风机_consume_unit:'/';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
timeStamp: 0,
|
||||
query: {
|
||||
year_s: "",
|
||||
page: 0,
|
||||
type: "month_st",
|
||||
mgroup: "3347217651339837440",
|
||||
},
|
||||
tableDatas: [],
|
||||
exportLoading: false,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
var myDate = new Date();
|
||||
let year = myDate.getFullYear();
|
||||
this.timeStamp = myDate.getTime();
|
||||
that.query.year_s = year;
|
||||
this.$API.mtm.mgroup.list
|
||||
.req({ page: 0, search: "水泥磨" })
|
||||
.then((res) => {
|
||||
console.log("水泥磨", res);
|
||||
that.query.mgroup = res[0].id;
|
||||
let params = {};
|
||||
params.page = 0;
|
||||
params.year = year;
|
||||
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);
|
||||
});
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
getData(goalData) {
|
||||
let that = this;
|
||||
let query0 = {};
|
||||
query0.page = 0;
|
||||
query0.type = "month_st";
|
||||
query0.year_s = that.query.year_s - 1;
|
||||
query0.mgroup = that.query.mgroup;
|
||||
let wrapArr = [],
|
||||
wrapArr0 = [],
|
||||
wrapArrs = [];
|
||||
this.$API.enm.enstat.req(query0).then((res0) => {
|
||||
let data0 = []; //去年的值
|
||||
data0 = res0;
|
||||
if (data0.length > 0) {
|
||||
data0.forEach((item0) => {
|
||||
//先按月份排序,再按班组排序
|
||||
let n0 = item0.month_s;
|
||||
let ind0 = 0;
|
||||
let team_name0 = item0.team_name;
|
||||
if (team_name0.indexOf("甲") > -1) {
|
||||
ind0 = (n0 - 1) * 3;
|
||||
} else if (team_name0.indexOf("乙") > -1) {
|
||||
ind0 = (n0 - 1) * 3 + 1;
|
||||
} else if (team_name0.indexOf("丙") > -1) {
|
||||
ind0 = (n0 - 1) * 3 + 2;
|
||||
}
|
||||
wrapArr0[ind0] = item0;
|
||||
});
|
||||
console.log(wrapArr0);
|
||||
} else {
|
||||
}
|
||||
this.$API.enm.enstat.req(that.query).then((res) => {
|
||||
//今年的值
|
||||
let data = res;
|
||||
if (data.length > 0) {
|
||||
data.forEach((item) => {
|
||||
//先按月份排序,再按班组排序
|
||||
let n = item.month_s;
|
||||
let team_name = item.team_name;
|
||||
let ind = 0;
|
||||
if (team_name.indexOf("甲") > -1) {
|
||||
ind = (n - 1) * 3;
|
||||
} else if (team_name.indexOf("乙") > -1) {
|
||||
ind = (n - 1) * 3 + 1;
|
||||
} else if (team_name.indexOf("丙") > -1) {
|
||||
ind = (n - 1) * 3 + 2;
|
||||
}
|
||||
wrapArrs[ind] = item;
|
||||
let arr = [];
|
||||
let time = "" + item.year_s + "." + item.month_s;
|
||||
arr.push(time);
|
||||
arr.push(item.team_name);
|
||||
arr.push(item.total_production);
|
||||
arr.push(item.production_hour);
|
||||
arr.push(item.run_rate);
|
||||
arr.push(item.production_cost_unit);
|
||||
//质量
|
||||
arr[6] =
|
||||
item.出磨水泥_比表面积_rate_pass != null
|
||||
? item.出磨水泥_比表面积_rate_pass
|
||||
: "/";
|
||||
arr[7] =
|
||||
item.出磨水泥_SO3_rate_pass != null
|
||||
? item.出磨水泥_SO3_rate_pass
|
||||
: "/";
|
||||
arr[8] =
|
||||
item.出磨水泥_掺量_rate_pass != null
|
||||
? item.出磨水泥_掺量_rate_pass
|
||||
: "/";
|
||||
//设备
|
||||
arr[9] =
|
||||
item.循环风机1906_consume_unit != null
|
||||
? item.循环风机1906_consume_unit
|
||||
: "/";
|
||||
arr[10] =
|
||||
item.系统风机_consume_unit != null
|
||||
? item.系统风机_consume_unit
|
||||
: "/";
|
||||
arr[11] =
|
||||
item.水平涡流选粉机1915_consume_unit != null
|
||||
? item.水平涡流选粉机1915_consume_unit
|
||||
: "/";
|
||||
// arr[12]=item.新增磨尾风机_consume_unit!=null?item.新增磨尾风机_consume_unit:'/';
|
||||
|
||||
// arr[13]=item.elec_consume_unit//当期值(KW·h/t)
|
||||
let keyVale ='goal_val_'+n;
|
||||
arr[12]=goalData[keyVale];//目标值(KW·h/t)//需要接口获取
|
||||
arr[13]=arr[12]-item.celec_consume_unit;//当期与目标差值(KW·h/t)
|
||||
let ind_pre = 0,huanqi = 0,huanqicha=0,tongqi=0,tongqicha=0;
|
||||
if(n==1){
|
||||
ind_pre = 12;
|
||||
huanqi = wrapArr0[ind_pre]?wrapArr0[ind_pre].elec_consume_unit:'/';
|
||||
}else{
|
||||
ind_pre=n-1;
|
||||
huanqi = wrapArr[ind_pre]?wrapArr[ind_pre].elec_consume_unit?wrapArr[ind_pre].elec_consume_unit:'/':'/'
|
||||
}
|
||||
arr[14]=huanqi;//环期值(KW·h/t)上个月的值
|
||||
if(huanqi!=='/'){
|
||||
huanqicha = item.celec_consume_unit-huanqi;
|
||||
}else{
|
||||
huanqicha = item.celec_consume_unit
|
||||
}
|
||||
arr[15]=huanqicha;//当期与环期差值(KW·h/t)
|
||||
arr[16]=huanqi!='/'? huanqicha/huanqi*100:0;//环比增长率(%)
|
||||
if(wrapArr0[n]){
|
||||
tongqicha = item.celec_consume_unit-wrapArr0[n].celec_consume_unit;
|
||||
tongqi = tongqicha/tongqi;
|
||||
}else{
|
||||
tongqicha = item.celec_consume_unit;
|
||||
tongqi = 0;
|
||||
}
|
||||
|
||||
arr[17]=tongqi;//同比增长率(%):本月-去年本月/去年
|
||||
arr[18]=0.00;//同比增长率(%)
|
||||
wrapArr[ind] = arr;
|
||||
});
|
||||
let newArr= [];
|
||||
for (let i = 0; i < wrapArr.length; i++) {
|
||||
let item = wrapArr[i];
|
||||
console.log(item);
|
||||
if (item==undefined) {}else{
|
||||
newArr.push(wrapArr[i])
|
||||
}
|
||||
}
|
||||
that.tableDatas = newArr;
|
||||
}else{
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
handleQuery(){
|
||||
this.tableDatas = [];
|
||||
this.getData();
|
||||
},
|
||||
itemClick(type,item){
|
||||
this.type=type;
|
||||
this.asynDialog = true;
|
||||
},
|
||||
itemClick1(type,item){
|
||||
this.chartShow = false;
|
||||
this.$API.bi.dataset.exec
|
||||
.req('3322567213885833216')
|
||||
.then((res) => {
|
||||
this.myOption = JSON.parse(res.echart_options);
|
||||
// debugger;
|
||||
console.log(this.myOption)
|
||||
this.chartShow = true;
|
||||
});
|
||||
},
|
||||
handlePrint() {
|
||||
this.$PRINT('#myReport');
|
||||
},
|
||||
exportExcel() {
|
||||
this.exportLoading = true;
|
||||
this.$XLSX('#myTable', this.tableName)
|
||||
this.exportLoading = false;
|
||||
},
|
||||
}
|
||||
};
|
||||
// arr[13]=item.elec_consume_unit//当期值(KW·h/t)
|
||||
let keyVale = "goal_val_" + n;
|
||||
arr[12] = goalData[keyVale]; //目标值(KW·h/t)//需要接口获取
|
||||
arr[13] = arr[12] - item.celec_consume_unit; //当期与目标差值(KW·h/t)
|
||||
let ind_pre = 0,
|
||||
huanqi = 0,
|
||||
huanqicha = 0,
|
||||
tongqi = 0,
|
||||
tongqicha = 0;
|
||||
if (n == 1) {
|
||||
ind_pre = 12;
|
||||
huanqi = wrapArr0[ind_pre]
|
||||
? wrapArr0[ind_pre].elec_consume_unit
|
||||
: "/";
|
||||
} else {
|
||||
ind_pre = n - 1;
|
||||
huanqi = wrapArr[ind_pre]
|
||||
? wrapArr[ind_pre].elec_consume_unit
|
||||
? wrapArr[ind_pre].elec_consume_unit
|
||||
: "/"
|
||||
: "/";
|
||||
}
|
||||
arr[14] = huanqi; //环期值(KW·h/t)上个月的值
|
||||
if (huanqi !== "/") {
|
||||
huanqicha = item.celec_consume_unit - huanqi;
|
||||
} else {
|
||||
huanqicha = item.celec_consume_unit;
|
||||
}
|
||||
arr[15] = huanqicha; //当期与环期差值(KW·h/t)
|
||||
arr[16] =
|
||||
huanqi != "/" ? (huanqicha / huanqi) * 100 : 0; //环比增长率(%)
|
||||
if (wrapArr0[n]) {
|
||||
tongqicha =
|
||||
item.celec_consume_unit -
|
||||
wrapArr0[n].celec_consume_unit;
|
||||
tongqi = tongqicha / tongqi;
|
||||
} else {
|
||||
tongqicha = item.celec_consume_unit;
|
||||
tongqi = 0;
|
||||
}
|
||||
|
||||
arr[17] = tongqi; //同比增长率(%):本月-去年本月/去年
|
||||
arr[18] = 0.0; //同比增长率(%)
|
||||
wrapArr[ind] = arr;
|
||||
});
|
||||
let newArr = [];
|
||||
for (let i = 0; i < wrapArr.length; i++) {
|
||||
let item = wrapArr[i];
|
||||
console.log(item);
|
||||
if (item == undefined) {
|
||||
} else {
|
||||
newArr.push(wrapArr[i]);
|
||||
}
|
||||
}
|
||||
that.tableDatas = newArr;
|
||||
} else {
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
handleQuery() {
|
||||
this.tableDatas = [];
|
||||
this.getData();
|
||||
},
|
||||
itemClick(type, item) {
|
||||
this.type = type;
|
||||
this.asynDialog = true;
|
||||
},
|
||||
itemClick1(type, item) {
|
||||
this.chartShow = false;
|
||||
this.$API.bi.dataset.exec.req("3322567213885833216").then((res) => {
|
||||
this.myOption = JSON.parse(res.echart_options);
|
||||
// debugger;
|
||||
console.log(this.myOption);
|
||||
this.chartShow = true;
|
||||
});
|
||||
},
|
||||
handlePrint() {
|
||||
this.$PRINT("#myReport");
|
||||
},
|
||||
exportExcel() {
|
||||
this.exportLoading = true;
|
||||
this.$XLSX("#myTable", this.tableName);
|
||||
this.exportLoading = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.printWrap{
|
||||
width: 100%;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
</style>
|
||||
.printWrap {
|
||||
width: 100%;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,376 +1,468 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-date-picker
|
||||
v-model="query.year_s"
|
||||
type="year"
|
||||
value-format="YYYY"
|
||||
format="YYYY"
|
||||
placeholder="查询年份"
|
||||
class="headerSearch"
|
||||
/>
|
||||
<el-select
|
||||
v-model="query.type"
|
||||
placeholder="查询类型"
|
||||
clearable
|
||||
@change="typeCange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="handleQuery"
|
||||
></el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="exportExcel()"
|
||||
:loading = "exportLoading"
|
||||
>导出xlsx
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="handlePrint"
|
||||
>打印
|
||||
</el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-card style="margin-top:5px">
|
||||
<div class="printWrap">
|
||||
<div ref="print" id="myReport" class="printContainer">
|
||||
<table border="1" width="1075" cellspacing="0" :key="0" id="myTable" class="myTable" v-if="query.type==1">
|
||||
<thead class="myTableHead">
|
||||
<tr>
|
||||
<th colspan="9">水泥磨工段车间单位产品电耗月度分析表</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="2">月份</th>
|
||||
<th rowspan="2">当期值(KW·h/t)</th>
|
||||
<th rowspan="2">目标值(KW·h/t)</th>
|
||||
<th colspan="3">国家标准(KW·h/t)</th>
|
||||
<th rowspan="2">当期与环期差值(KW·h/t)</th>
|
||||
<th rowspan="2">环比增长率(%)</th>
|
||||
<th rowspan="2">同比增长率(%)</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>1级</th>
|
||||
<th>2级</th>
|
||||
<th>3级</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="item in tableDatas" :key="item">
|
||||
<td v-for="(item1,ind) in item" :key="ind" class="numCell">
|
||||
<div :class="bindClass(item1,ind)">
|
||||
<span v-if="item1<0&&ind==6">▲</span>
|
||||
<span v-if="item1<0&&ind==6">▼</span>
|
||||
{{item1}}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table border="1" width="1075" cellspacing="0" :key="1" id="myTable1" class="myTable" v-else>
|
||||
<thead class="myTableHead">
|
||||
<tr>
|
||||
<th colspan="9">水泥磨工段车间单位产品综合能耗月度分析表</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="2">月份</th>
|
||||
<th rowspan="2">当期值(KW·h/t)</th>
|
||||
<th rowspan="2">目标值(KW·h/t)</th>
|
||||
<th colspan="3">国家标准(KW·h/t)</th>
|
||||
<th rowspan="2">当期与环期差值(KW·h/t)</th>
|
||||
<th rowspan="2">环比增长率(%)</th>
|
||||
<th rowspan="2">同比增长率(%)</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>1级</th>
|
||||
<th>2级</th>
|
||||
<th>3级</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="item in tableDatas2" :key="item">
|
||||
<td v-for="(item1,ind) in item" :key="ind" class="numCell">
|
||||
<div :class="bindClass(item1,ind)">
|
||||
<span v-if="item1<0&&ind==6">▲</span>
|
||||
<span v-if="item1<0&&ind==6">▼</span>
|
||||
{{item1}}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<div class="app-container">
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-date-picker
|
||||
v-model="query.year_s"
|
||||
type="year"
|
||||
value-format="YYYY"
|
||||
format="YYYY"
|
||||
placeholder="查询年份"
|
||||
class="headerSearch"
|
||||
/>
|
||||
<el-select
|
||||
v-model="query.type"
|
||||
placeholder="查询类型"
|
||||
clearable
|
||||
@change="typeCange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="handleQuery"
|
||||
></el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="exportExcel()"
|
||||
:loading="exportLoading"
|
||||
>导出xlsx
|
||||
</el-button>
|
||||
<el-button type="primary" @click="handlePrint">打印 </el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-card style="margin-top: 5px">
|
||||
<div class="printWrap">
|
||||
<div ref="print" id="myReport" class="printContainer">
|
||||
<table
|
||||
border="1"
|
||||
width="1075"
|
||||
cellspacing="0"
|
||||
:key="0"
|
||||
id="myTable"
|
||||
class="myTable"
|
||||
v-if="query.type == 1"
|
||||
>
|
||||
<thead class="myTableHead">
|
||||
<tr>
|
||||
<th colspan="9">
|
||||
水泥磨工段车间单位产品电耗月度分析表
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="2">月份</th>
|
||||
<th rowspan="2">当期值(KW·h/t)</th>
|
||||
<th rowspan="2">目标值(KW·h/t)</th>
|
||||
<th colspan="3">国家标准(KW·h/t)</th>
|
||||
<th rowspan="2">当期与环期差值(KW·h/t)</th>
|
||||
<th rowspan="2">环比增长率(%)</th>
|
||||
<th rowspan="2">同比增长率(%)</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>1级</th>
|
||||
<th>2级</th>
|
||||
<th>3级</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="item in tableDatas" :key="item">
|
||||
<td
|
||||
v-for="(item1, ind) in item"
|
||||
:key="ind"
|
||||
class="numCell"
|
||||
>
|
||||
<div :class="bindClass(item1, ind)">
|
||||
<span v-if="item1 < 0 && ind == 6"
|
||||
>▲</span
|
||||
>
|
||||
<span v-if="item1 < 0 && ind == 6"
|
||||
>▼</span
|
||||
>
|
||||
{{ item1 }}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table
|
||||
border="1"
|
||||
width="1075"
|
||||
cellspacing="0"
|
||||
:key="1"
|
||||
id="myTable1"
|
||||
class="myTable"
|
||||
v-else
|
||||
>
|
||||
<thead class="myTableHead">
|
||||
<tr>
|
||||
<th colspan="9">
|
||||
水泥磨工段车间单位产品综合能耗月度分析表
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="2">月份</th>
|
||||
<th rowspan="2">当期值(KW·h/t)</th>
|
||||
<th rowspan="2">目标值(KW·h/t)</th>
|
||||
<th colspan="3">国家标准(KW·h/t)</th>
|
||||
<th rowspan="2">当期与环期差值(KW·h/t)</th>
|
||||
<th rowspan="2">环比增长率(%)</th>
|
||||
<th rowspan="2">同比增长率(%)</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>1级</th>
|
||||
<th>2级</th>
|
||||
<th>3级</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="item in tableDatas2" :key="item">
|
||||
<td
|
||||
v-for="(item1, ind) in item"
|
||||
:key="ind"
|
||||
class="numCell"
|
||||
>
|
||||
<div :class="bindClass(item1, ind)">
|
||||
<span v-if="item1 < 0 && ind == 6"
|
||||
>▲</span
|
||||
>
|
||||
<span v-if="item1 < 0 && ind == 6"
|
||||
>▼</span
|
||||
>
|
||||
{{ item1 }}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import scEcharts from "@/components/scEcharts";
|
||||
import { defineAsyncComponent } from 'vue'
|
||||
export default {
|
||||
components: {
|
||||
scEcharts,
|
||||
charts: defineAsyncComponent(() => import("@/components/scEnm/lineChartsdialog.vue")),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
chartShow: false,
|
||||
myOption: null,
|
||||
query: {
|
||||
type:1,
|
||||
year_s:'',
|
||||
mgroup:'3347217651339837440',
|
||||
},
|
||||
monthGoal:[],
|
||||
monthGoal2:[],
|
||||
tableDatas:[],
|
||||
tableDatas2:[],
|
||||
options:[{
|
||||
name:'电耗',id:1,
|
||||
},{
|
||||
name:'综合能耗',id:2,
|
||||
}],
|
||||
modelValue:true,
|
||||
type:'hours',
|
||||
title:'title',
|
||||
apiObj:'',
|
||||
showClose:true,
|
||||
echartType:'line',
|
||||
asynDialog:false,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
var myDate = new Date();
|
||||
let year = myDate.getFullYear();
|
||||
that.query.year_s = year;
|
||||
//月目标
|
||||
let paramsGoal = {};
|
||||
paramsGoal.page=0;
|
||||
paramsGoal.mgroup=that.query.mgroup;
|
||||
that.$API.mtm.goal.list.req(paramsGoal).then((ress) => {
|
||||
if(ress.length>0){
|
||||
let monthGoal = [];
|
||||
ress.forEach(goal=>{
|
||||
if(goal.goal_cate_name=='单位产品分布电耗(KW·h/t)'){
|
||||
monthGoal[0]=goal.goal_val;
|
||||
monthGoal[1]=goal.goal_val_2;
|
||||
monthGoal[2]=goal.goal_val_3;
|
||||
monthGoal[3]=goal.goal_val_4;
|
||||
monthGoal[4]=goal.goal_val_5;
|
||||
monthGoal[5]=goal.goal_val_6;
|
||||
monthGoal[6]=goal.goal_val_7;
|
||||
monthGoal[7]=goal.goal_val_8;
|
||||
monthGoal[8]=goal.goal_val_9;
|
||||
monthGoal[9]=goal.goal_val_10;
|
||||
monthGoal[10]=goal.goal_val_11;
|
||||
monthGoal[11]=goal.goal_val_12;
|
||||
monthGoal[12]=goal.goal_val_12;
|
||||
that.monthGoal = monthGoal;
|
||||
}
|
||||
if(goal.goal_cate_name=='单位产品综合能耗(kgce/t)'){
|
||||
monthGoal2[0]=goal.goal_val;
|
||||
monthGoal2[1]=goal.goal_val_2;
|
||||
monthGoal2[2]=goal.goal_val_3;
|
||||
monthGoal2[3]=goal.goal_val_4;
|
||||
monthGoal2[4]=goal.goal_val_5;
|
||||
monthGoal2[5]=goal.goal_val_6;
|
||||
monthGoal2[6]=goal.goal_val_7;
|
||||
monthGoal2[7]=goal.goal_val_8;
|
||||
monthGoal2[8]=goal.goal_val_9;
|
||||
monthGoal2[9]=goal.goal_val_10;
|
||||
monthGoal2[10]=goal.goal_val_11;
|
||||
monthGoal2[11]=goal.goal_val_12;
|
||||
monthGoal2[12]=goal.goal_val_12;
|
||||
that.monthGoal2 = monthGoal2;
|
||||
}
|
||||
})
|
||||
this.getData();
|
||||
}else{
|
||||
this.getData();
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 动态绑定Class
|
||||
bindClass(item,index){
|
||||
let classInfo = { redColor: false, greenColor: false }
|
||||
if(index==6){
|
||||
if( typeof(item)=='number'){
|
||||
if(item>0){
|
||||
classInfo.greenColor = true;
|
||||
classInfo.redColor = false;
|
||||
}else if(item<0){
|
||||
classInfo.redColor = true;
|
||||
classInfo.greenColor = false
|
||||
}
|
||||
}
|
||||
}
|
||||
return classInfo
|
||||
},
|
||||
getData(){
|
||||
let that = this;
|
||||
let query0={};
|
||||
query0.page = 0;
|
||||
query0.type='month_s';
|
||||
query0.year_s = that.query.year_s-1;
|
||||
query0.mgroup=that.query.mgroup;
|
||||
let wrapArr = [],wrapArr0 = [] ,wrapArrs = [],wrapArrs2 = [];
|
||||
this.$API.enm.enstat.req(query0).then((res0) => {
|
||||
let data0 = res0;
|
||||
if(data0.length>0){
|
||||
data0.forEach(item0 => {
|
||||
//先按月份排序,再按班组排序
|
||||
let ind0 = item0.month_s;
|
||||
wrapArr0[ind0] = item0;
|
||||
});
|
||||
}
|
||||
let query={};
|
||||
query.page = 0;
|
||||
query.type='month_s';
|
||||
query.year_s = that.query.year_s;
|
||||
query.mgroup=that.query.mgroup;
|
||||
that.$API.enm.enstat.req(query).then((res) => {
|
||||
let data = res;
|
||||
if(data.length>0){
|
||||
data.forEach(item => {
|
||||
//先按月份排序,再按班组排序
|
||||
let ind = item.month_s;
|
||||
let arr = [];
|
||||
let time = ''+item.year_s+'.'+item.month_s;
|
||||
arr.push(time);
|
||||
arr.push(item.elec_consume_unit);//当期值(KW·h/t)
|
||||
arr[2] = that.monthGoal[ind]!==undefined?that.monthGoal[ind]:'/';
|
||||
wrapArr[ind] = arr;
|
||||
});
|
||||
wrapArr.forEach((item,index)=>{
|
||||
let ind = item.month_s;
|
||||
let arrs = [],arrs2=[];
|
||||
arrs[0]=item[0];
|
||||
arrs[1]=item[1];
|
||||
arrs[2]=item[2];
|
||||
arrs[3]=26;
|
||||
arrs[4]=29;
|
||||
arrs[5]=34;
|
||||
//当期与环期差值(KW·h/t)
|
||||
let lastNum = 0,lastDiff = 0;
|
||||
if(index>1){
|
||||
let num = index-1;
|
||||
if(wrapArr[num]&&wrapArr[num].elec_consume_unit){
|
||||
lastNum = wrapArr[num].elec_consume_unit;
|
||||
}else{
|
||||
lastNum='/'
|
||||
}
|
||||
}else{
|
||||
lastNum = wrapArr0[12]?wrapArr0[12].elec_consume_unit:'/';
|
||||
}
|
||||
if(arrs[1]!=='/'&&lastNum!=='/'){
|
||||
lastDiff =arrs[1]- lastNum;
|
||||
}else{
|
||||
lastDiff = '/';
|
||||
}
|
||||
arrs[6]=lastDiff;
|
||||
//环比增长率(%)
|
||||
let lastRate = 0;
|
||||
if(lastDiff=='/'&&lastNum!=='/'&&lastNum!==0){
|
||||
lastRate = (lastDiff/lastNum)*100;
|
||||
}else{
|
||||
lastRate = '/'
|
||||
}
|
||||
arrs[7]=lastRate;
|
||||
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
||||
let sameRate =0;
|
||||
if(wrapArr0[index]&&wrapArr0[index].elec_consume_unit){
|
||||
sameRate =((arrs[1]- wrapArr0[index].elec_consume_unit)/wrapArr0[index].elec_consume_unit)*100
|
||||
}else{
|
||||
sameRate='/';
|
||||
}
|
||||
arrs[8]=sameRate;
|
||||
wrapArrs.push(arrs);
|
||||
import scEcharts from "@/components/scEcharts";
|
||||
import { defineAsyncComponent } from "vue";
|
||||
export default {
|
||||
components: {
|
||||
scEcharts,
|
||||
charts: defineAsyncComponent(() =>
|
||||
import("@/components/scEnm/lineChartsdialog.vue")
|
||||
),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
exportLoading: false,
|
||||
chartShow: false,
|
||||
myOption: null,
|
||||
query: {
|
||||
type: 1,
|
||||
year_s: "",
|
||||
mgroup: "",
|
||||
},
|
||||
monthGoal: [],
|
||||
monthGoal2: [],
|
||||
tableDatas: [],
|
||||
tableDatas2: [],
|
||||
options: [
|
||||
{
|
||||
name: "电耗",
|
||||
id: 1,
|
||||
},
|
||||
{
|
||||
name: "综合能耗",
|
||||
id: 2,
|
||||
},
|
||||
],
|
||||
modelValue: true,
|
||||
type: "hours",
|
||||
title: "title",
|
||||
apiObj: "",
|
||||
showClose: true,
|
||||
echartType: "line",
|
||||
asynDialog: false,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
var myDate = new Date();
|
||||
let year = myDate.getFullYear();
|
||||
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 == 6) {
|
||||
if (typeof item == "number") {
|
||||
if (item > 0) {
|
||||
classInfo.greenColor = true;
|
||||
classInfo.redColor = false;
|
||||
} else if (item < 0) {
|
||||
classInfo.redColor = true;
|
||||
classInfo.greenColor = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return classInfo;
|
||||
},
|
||||
//月目标
|
||||
getMonthGoal() {
|
||||
let that = this;
|
||||
let paramsGoal = {};
|
||||
paramsGoal.page = 0;
|
||||
paramsGoal.mgroup = that.query.mgroup;
|
||||
that.$API.mtm.goal.list.req(paramsGoal).then((ress) => {
|
||||
if (ress.length > 0) {
|
||||
let monthGoal = [];
|
||||
ress.forEach((goal) => {
|
||||
if (
|
||||
goal.goal_cate_name == "单位产品分布电耗(KW·h/t)"
|
||||
) {
|
||||
monthGoal[0] = goal.goal_val;
|
||||
monthGoal[1] = goal.goal_val_2;
|
||||
monthGoal[2] = goal.goal_val_3;
|
||||
monthGoal[3] = goal.goal_val_4;
|
||||
monthGoal[4] = goal.goal_val_5;
|
||||
monthGoal[5] = goal.goal_val_6;
|
||||
monthGoal[6] = goal.goal_val_7;
|
||||
monthGoal[7] = goal.goal_val_8;
|
||||
monthGoal[8] = goal.goal_val_9;
|
||||
monthGoal[9] = goal.goal_val_10;
|
||||
monthGoal[10] = goal.goal_val_11;
|
||||
monthGoal[11] = goal.goal_val_12;
|
||||
monthGoal[12] = goal.goal_val_12;
|
||||
that.monthGoal = monthGoal;
|
||||
}
|
||||
if (
|
||||
goal.goal_cate_name == "单位产品综合能耗(kgce/t)"
|
||||
) {
|
||||
monthGoal2[0] = goal.goal_val;
|
||||
monthGoal2[1] = goal.goal_val_2;
|
||||
monthGoal2[2] = goal.goal_val_3;
|
||||
monthGoal2[3] = goal.goal_val_4;
|
||||
monthGoal2[4] = goal.goal_val_5;
|
||||
monthGoal2[5] = goal.goal_val_6;
|
||||
monthGoal2[6] = goal.goal_val_7;
|
||||
monthGoal2[7] = goal.goal_val_8;
|
||||
monthGoal2[8] = goal.goal_val_9;
|
||||
monthGoal2[9] = goal.goal_val_10;
|
||||
monthGoal2[10] = goal.goal_val_11;
|
||||
monthGoal2[11] = goal.goal_val_12;
|
||||
monthGoal2[12] = goal.goal_val_12;
|
||||
that.monthGoal2 = monthGoal2;
|
||||
}
|
||||
});
|
||||
this.getData();
|
||||
} else {
|
||||
this.getData();
|
||||
}
|
||||
});
|
||||
},
|
||||
getData() {
|
||||
let that = this;
|
||||
let query0 = {};
|
||||
query0.page = 0;
|
||||
query0.type = "month_s";
|
||||
query0.year_s = that.query.year_s - 1;
|
||||
query0.mgroup = that.query.mgroup;
|
||||
let wrapArr = [],
|
||||
wrapArr0 = [],
|
||||
wrapArrs = [],
|
||||
wrapArrs2 = [];
|
||||
this.$API.enm.enstat.req(query0).then((res0) => {
|
||||
let data0 = res0;
|
||||
if (data0.length > 0) {
|
||||
data0.forEach((item0) => {
|
||||
//先按月份排序,再按班组排序
|
||||
let ind0 = item0.month_s;
|
||||
wrapArr0[ind0] = item0;
|
||||
});
|
||||
}
|
||||
let query = {};
|
||||
query.page = 0;
|
||||
query.type = "month_s";
|
||||
query.year_s = that.query.year_s;
|
||||
query.mgroup = that.query.mgroup;
|
||||
that.$API.enm.enstat.req(query).then((res) => {
|
||||
let data = res;
|
||||
if (data.length > 0) {
|
||||
data.forEach((item) => {
|
||||
//先按月份排序,再按班组排序
|
||||
let ind = item.month_s;
|
||||
let arr = [];
|
||||
let time = "" + item.year_s + "." + item.month_s;
|
||||
arr.push(time);
|
||||
arr.push(item.elec_consume_unit); //当期值(KW·h/t)
|
||||
arr[2] =
|
||||
that.monthGoal[ind] !== undefined
|
||||
? that.monthGoal[ind]
|
||||
: "/";
|
||||
wrapArr[ind] = arr;
|
||||
});
|
||||
wrapArr.forEach((item, index) => {
|
||||
let ind = item.month_s;
|
||||
let arrs = [],
|
||||
arrs2 = [];
|
||||
arrs[0] = item[0];
|
||||
arrs[1] = item[1];
|
||||
arrs[2] = item[2];
|
||||
arrs[3] = 26;
|
||||
arrs[4] = 29;
|
||||
arrs[5] = 34;
|
||||
//当期与环期差值(KW·h/t)
|
||||
let lastNum = 0,
|
||||
lastDiff = 0;
|
||||
if (index > 1) {
|
||||
let num = index - 1;
|
||||
if (
|
||||
wrapArr[num] &&
|
||||
wrapArr[num].elec_consume_unit
|
||||
) {
|
||||
lastNum = wrapArr[num].elec_consume_unit;
|
||||
} else {
|
||||
lastNum = "/";
|
||||
}
|
||||
} else {
|
||||
lastNum = wrapArr0[12]
|
||||
? wrapArr0[12].elec_consume_unit
|
||||
: "/";
|
||||
}
|
||||
if (arrs[1] !== "/" && lastNum !== "/") {
|
||||
lastDiff = arrs[1] - lastNum;
|
||||
} else {
|
||||
lastDiff = "/";
|
||||
}
|
||||
arrs[6] = lastDiff;
|
||||
//环比增长率(%)
|
||||
let lastRate = 0;
|
||||
if (
|
||||
lastDiff == "/" &&
|
||||
lastNum !== "/" &&
|
||||
lastNum !== 0
|
||||
) {
|
||||
lastRate = (lastDiff / lastNum) * 100;
|
||||
} else {
|
||||
lastRate = "/";
|
||||
}
|
||||
arrs[7] = lastRate;
|
||||
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
||||
let sameRate = 0;
|
||||
if (
|
||||
wrapArr0[index] &&
|
||||
wrapArr0[index].elec_consume_unit
|
||||
) {
|
||||
sameRate =
|
||||
((arrs[1] -
|
||||
wrapArr0[index].elec_consume_unit) /
|
||||
wrapArr0[index].elec_consume_unit) *
|
||||
100;
|
||||
} else {
|
||||
sameRate = "/";
|
||||
}
|
||||
arrs[8] = sameRate;
|
||||
wrapArrs.push(arrs);
|
||||
|
||||
arrs2[0]=item[0];
|
||||
arrs2[1]=item.cen_consume_unit;
|
||||
arrs2[2]=that.monthGoal2[ind]!==undefined?that.monthGoal2[ind]:'/';
|
||||
arrs2[3]=80;
|
||||
arrs2[4]=87;
|
||||
arrs2[5]=94;
|
||||
//当期与环期差值(KW·h/t)
|
||||
let lastNum2 = 0,lastDiff2 = 0;
|
||||
if(index>1){
|
||||
let num = index-1;
|
||||
if(wrapArr[num]&&wrapArr[num].cen_consume_unit){
|
||||
lastNum2 = wrapArr[num].cen_consume_unit;
|
||||
}else{
|
||||
lastNum2='/'
|
||||
}
|
||||
}else{
|
||||
lastNum2 = wrapArr0[12]?wrapArr0[12].cen_consume_unit:'/';
|
||||
}
|
||||
if(arrs2[1]!=='/'&&lastNum2!=='/'){
|
||||
lastDiff2 =arrs2[1]- lastNum2;
|
||||
}else{
|
||||
lastDiff2 = '/';
|
||||
}
|
||||
arrs2[6]=lastDiff2;
|
||||
//环比增长率(%)
|
||||
let lastRate2 = 0;
|
||||
if(lastDiff2=='/'&&lastNum2!=='/'&&lastNum2!==0){
|
||||
lastRate2 = (lastDiff2/lastNum2)*100;
|
||||
}else{
|
||||
lastRate2 = '/'
|
||||
}
|
||||
arrs2[7]=lastRate2;
|
||||
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
||||
let sameRate2 =0;
|
||||
if(wrapArr0[index]&&wrapArr0[index].cen_consume_unit){
|
||||
sameRate2 =((arrs[1]- wrapArr0[index].cen_consume_unit)/wrapArr0[index].cen_consume_unit)*100
|
||||
}else{
|
||||
sameRate2='/';
|
||||
}
|
||||
arrs2[8]=sameRate2;
|
||||
wrapArrs2.push(arrs2);
|
||||
})
|
||||
that.tableDatas = wrapArrs;
|
||||
that.tableDatas2 = wrapArrs2;
|
||||
}else{
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
itemClick(type,item){
|
||||
this.type=type;
|
||||
this.asynDialog = true;
|
||||
},
|
||||
itemClick1(type,item){
|
||||
this.chartShow = false;
|
||||
this.$API.bi.dataset.exec
|
||||
.req('3322567213885833216')
|
||||
.then((res) => {
|
||||
this.myOption = JSON.parse(res.echart_options);
|
||||
debugger;
|
||||
console.log(this.myOption)
|
||||
this.chartShow = true;
|
||||
});
|
||||
},
|
||||
handlePrint() {
|
||||
this.$PRINT('#myReport');
|
||||
},
|
||||
exportExcel() {
|
||||
this.exportLoading = true;
|
||||
this.$XLSX('#myTable', this.tableName)
|
||||
this.exportLoading = false;
|
||||
},
|
||||
}
|
||||
};
|
||||
arrs2[0] = item[0];
|
||||
arrs2[1] = item.cen_consume_unit;
|
||||
arrs2[2] =
|
||||
that.monthGoal2[ind] !== undefined
|
||||
? that.monthGoal2[ind]
|
||||
: "/";
|
||||
arrs2[3] = 80;
|
||||
arrs2[4] = 87;
|
||||
arrs2[5] = 94;
|
||||
//当期与环期差值(KW·h/t)
|
||||
let lastNum2 = 0,
|
||||
lastDiff2 = 0;
|
||||
if (index > 1) {
|
||||
let num = index - 1;
|
||||
if (
|
||||
wrapArr[num] &&
|
||||
wrapArr[num].cen_consume_unit
|
||||
) {
|
||||
lastNum2 = wrapArr[num].cen_consume_unit;
|
||||
} else {
|
||||
lastNum2 = "/";
|
||||
}
|
||||
} else {
|
||||
lastNum2 = wrapArr0[12]
|
||||
? wrapArr0[12].cen_consume_unit
|
||||
: "/";
|
||||
}
|
||||
if (arrs2[1] !== "/" && lastNum2 !== "/") {
|
||||
lastDiff2 = arrs2[1] - lastNum2;
|
||||
} else {
|
||||
lastDiff2 = "/";
|
||||
}
|
||||
arrs2[6] = lastDiff2;
|
||||
//环比增长率(%)
|
||||
let lastRate2 = 0;
|
||||
if (
|
||||
lastDiff2 == "/" &&
|
||||
lastNum2 !== "/" &&
|
||||
lastNum2 !== 0
|
||||
) {
|
||||
lastRate2 = (lastDiff2 / lastNum2) * 100;
|
||||
} else {
|
||||
lastRate2 = "/";
|
||||
}
|
||||
arrs2[7] = lastRate2;
|
||||
//同比增长率(%)需要当前值-上一年同一个月的值即wrapArr0[ind].elec_consume_unit
|
||||
let sameRate2 = 0;
|
||||
if (
|
||||
wrapArr0[index] &&
|
||||
wrapArr0[index].cen_consume_unit
|
||||
) {
|
||||
sameRate2 =
|
||||
((arrs[1] -
|
||||
wrapArr0[index].cen_consume_unit) /
|
||||
wrapArr0[index].cen_consume_unit) *
|
||||
100;
|
||||
} else {
|
||||
sameRate2 = "/";
|
||||
}
|
||||
arrs2[8] = sameRate2;
|
||||
wrapArrs2.push(arrs2);
|
||||
});
|
||||
that.tableDatas = wrapArrs;
|
||||
that.tableDatas2 = wrapArrs2;
|
||||
} else {
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
itemClick(type, item) {
|
||||
this.type = type;
|
||||
this.asynDialog = true;
|
||||
},
|
||||
handleQuery() {
|
||||
this.getMonthGoal();
|
||||
},
|
||||
typeCange() {},
|
||||
handlePrint() {
|
||||
this.$PRINT("#myReport");
|
||||
},
|
||||
exportExcel() {
|
||||
this.exportLoading = true;
|
||||
this.$XLSX("#myTable", this.tableName);
|
||||
this.exportLoading = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
<style scoped></style>
|
||||
|
|
Loading…
Reference in New Issue