fix:enm_kiln回转窑mgroup根据名称获取id

This commit is contained in:
shijing 2024-04-29 15:10:39 +08:00
parent d392d7f012
commit 25e2a1e9d6
10 changed files with 4599 additions and 3700 deletions

View File

@ -1,282 +1,468 @@
<template> <template>
<el-container> <el-container>
<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="开始时间"
</el-select> style="width: 120px"
<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-date-picker
</el-select> v-model="query.end_time__lt"
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button> type="date"
</div> value-format="YYYY-MM-DD HH:mm:ss"
</el-header> format="YYYY-MM-DD"
<el-main class="nopadding"> placeholder="结束时间"
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query" highlightCurrentRow @row-click="rowClick"> style="margin-left: 2px; width: 120px"
<el-table-column type="index" width="50" /> />
<!-- <el-table-column label="关联工段" prop="mgroup_name"></el-table-column> --> <el-select
<el-table-column label="开始时间" prop="start_time"> v-model="query.shift"
<template #default="scope"> placeholder="班次"
<span>{{ scope.row.start_time.slice(0, 16) }}</span> clearable
</template> style="margin-left: 2px; width: 120px"
</el-table-column> >
<el-table-column label="结束时间" prop="end_time"> <el-option
<template #default="scope"> v-for="item in optionsShift"
<span>{{ scope.row.end_time.slice(0, 16) }}</span> :key="item.id"
</template> :label="item.name"
</el-table-column> :value="item.id"
<el-table-column label="班组名称" prop="team_name"></el-table-column> ></el-option>
<el-table-column label="当前班次" prop="shift_name"></el-table-column> </el-select>
<el-table-column label="班长" prop="leader_name"></el-table-column> <el-select
<el-table-column label="检验时间"> v-model="query.team"
<template #default="scope"> placeholder="班组"
<span v-if="scope.row.last_test_time">{{ scope.row.last_test_time.slice(0, 16) }}</span> clearable
</template> style="margin-left: 2px; width: 120px"
</el-table-column> >
<el-table-column label="操作" fixed="right" align="center" width="140"> <el-option
<template #default="scope"> v-for="item in options"
<el-button link size="small" @click="sflog_edit(scope.row)" type="primary">操作</el-button> :key="item.id"
<!-- <el-button link size="small" @click="sflog_check(scope.row)" type="primary">质量检验</el-button> --> :label="item.name"
<!-- <el-button link size="small" @click="sflog_other(scope.row)" type="primary">其他能源</el-button> --> :value="item.id"
<el-divider direction="vertical"></el-divider> ></el-option>
<el-button link size="small" @click="sflog_export(scope.row)" type="success">报表</el-button> </el-select>
</template> <el-button
</el-table-column> type="primary"
</scTable> icon="el-icon-search"
</el-main> @click="handleQuery"
<el-drawer v-model="limitedExport" size="60%" :show-close="false"> ></el-button>
<template #header="{ close, titleId, titleClass }"> </div>
<h4 :id="titleId" :class="titleClass">交接班日志</h4> </el-header>
<el-button type="danger" @click="close"> <el-main class="nopadding">
<el-icon class="el-icon--left"> <scTable
<CircleCloseFilled /> ref="table"
</el-icon> :apiObj="apiObj"
关闭 row-key="id"
</el-button> stripe
</template> :params="query"
<div class="left-panel"> highlightCurrentRow
<el-button type="primary" @click="exportExcel()" :loading="exportLoading">导出xlsx @row-click="rowClick"
</el-button> >
<el-button type="primary" @click="handlePrint">打印 <el-table-column type="index" width="50" />
</el-button> <!-- <el-table-column label="关联工段" prop="mgroup_name"></el-table-column> -->
</div> <el-table-column label="开始时间" prop="start_time">
<el-main class="nopadding"> <template #default="scope">
<div ref="print" id="myReport" class="printContainer"> <span>{{ scope.row.start_time.slice(0, 16) }}</span>
<div style="margin-right: 20px;text-align: center;font-size: 16px;font-weight: bold;margin-bottom: 20px;"> </template>
<span v-if="sflogItem.end_time">{{ sflogItem.end_time.slice(0, 10) }}{{ sflogItem.shift_name }}</span> </el-table-column>
<span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span> <el-table-column label="结束时间" prop="end_time">
交接班记录 <template #default="scope">
</div> <span>{{ scope.row.end_time.slice(0, 16) }}</span>
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable"> </template>
<tbody> </el-table-column>
<tr> <el-table-column
<td class="numCell">日期</td> label="班组名称"
<td class="numCell" v-if="sflogItem.end_time">{{ sflogItem.end_time.slice(0, 10) }}</td> prop="team_name"
<td class="numCell">班次</td> ></el-table-column>
<td class="numCell">{{ sflogItem.shift_name }}</td> <el-table-column
<td class="numCell">班组</td> label="当前班次"
<td class="numCell"><span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span></td> prop="shift_name"
</tr> ></el-table-column>
<tr> <el-table-column
<td class="numCell">产量t</td> label="班长"
<td class="numCell">{{ reportItem.total_production }}</td> prop="leader_name"
<td class="numCell">台时t/h</td> ></el-table-column>
<td class="numCell">{{ reportItem.production_hour }}</td> <el-table-column label="检验时间">
<td class="numCell">运转时间h</td> <template #default="scope">
<td class="numCell">{{ reportItem.run_hour }}</td> <span v-if="scope.row.last_test_time">{{
</tr> scope.row.last_test_time.slice(0, 16)
<tr> }}</span>
<td class="numCell">运转率%</td> </template>
<td class="numCell">{{ reportItem.run_rate * 100 }}</td> </el-table-column>
<td class="numCell">停机时长h</td> <el-table-column
<td class="numCell">{{ reportItem.shut_hour }}</td> label="操作"
<td class="numCell">单位产品分布电耗KW·h/t</td> fixed="right"
<td class="numCell">{{ reportItem.elec_consume_unit }}</td> align="center"
</tr> width="140"
<tr> >
<td class="numCell">单位产品标煤耗kgce/t</td> <template #default="scope">
<td class="numCell">{{ reportItem.coal_consume_unit }}</td> <el-button
<td class="numCell">熟料立升重合格率%</td> link
<td class="numCell" v-if="reportItem.入磨熟料_立升重_rate_pass">{{ reportItem.入磨熟料_立升重_rate_pass * 100 }}</td> size="small"
<td class="numCell" v-else>0</td> @click="sflog_edit(scope.row)"
<td class="numCell">熟料f-CaO合格率%</td> type="primary"
<td class="numCell" v-if="reportItem['入磨熟料_f-CaO_rate_pass']">{{ reportItem['入磨熟料_f-CaO_rate_pass'] * 100 }} >操作</el-button
</td> >
<td class="numCell" v-else>0</td> <!-- <el-button link size="small" @click="sflog_check(scope.row)" type="primary">质量检验</el-button> -->
</tr> <!-- <el-button link size="small" @click="sflog_other(scope.row)" type="primary">其他能源</el-button> -->
<tr> <el-divider direction="vertical"></el-divider>
<td class="numCell">入窑生料细度合格率%</td> <el-button
<td class="numCell" v-if="reportItem.入窑生料_细度_rate_pass">{{ reportItem.入窑生料_细度_rate_pass * 100 }}</td> link
<td class="numCell" v-else>0</td> size="small"
<td class="numCell">入窑生料CaO合格率%</td> @click="sflog_export(scope.row)"
<td class="numCell" v-if="reportItem.入窑生料_CaO_rate_pass">{{ reportItem.入窑生料_CaO_rate_pass * 100 }}</td> type="success"
<td class="numCell" v-else>0</td> >报表</el-button
<td class="numCell">入窑生料Fe₂O₃合格率%</td> >
<td class="numCell" v-if="reportItem.入窑生料_Fe2O3_rate_pass">{{ reportItem.入窑生料_Fe2O3_rate_pass * 100 }}</td> </template>
<td class="numCell" v-else>0</td> </el-table-column>
</tr> </scTable>
<tr> </el-main>
<td class="numCell">入窑生料水分合格率%</td> <el-drawer v-model="limitedExport" size="60%" :show-close="false">
<td class="numCell" v-if="reportItem.入窑生料_水分_rate_pass">{{ reportItem.入窑生料_水分_rate_pass * 100 }}</td> <template #header="{ close, titleId, titleClass }">
<td class="numCell" v-else>0</td> <h4 :id="titleId" :class="titleClass">交接班日志</h4>
<td class="numCell">单位成本/</td> <el-button type="danger" @click="close">
<td class="numCell">{{ reportItem.production_cost_unit }}</td> <el-icon class="el-icon--left">
<td class="numCell"></td> <CircleCloseFilled />
<td class="numCell"></td> </el-icon>
</tr> 关闭
<tr v-if="sflogexpList.length > 0"> </el-button>
<td class="numCell" :rowspan="sflogexpList.length + 1">生产情况记录</td> </template>
<td class="numCell">时间</td> <div class="left-panel">
<td class="numCell">类别</td> <el-button
<td class="numCell">原因</td> type="primary"
<td class="numCell">处置措施</td> @click="exportExcel()"
<td class="numCell">处置人</td> :loading="exportLoading"
</tr> >导出xlsx
<tr v-for="item in sflogexpList" :key="item.id"> </el-button>
<td class="numCell">{{ item.happen_time }}</td> <el-button type="primary" @click="handlePrint">打印 </el-button>
<td class="numCell">{{ item.cate }}</td> </div>
<td class="numCell">{{ item.reason }}</td> <el-main class="nopadding">
<td class="numCell">{{ item.measure }}</td> <div ref="print" id="myReport" class="printContainer">
<td class="numCell">{{ item.handler }}</td> <div
</tr> style="
</tbody> margin-right: 20px;
</table> text-align: center;
</div> font-size: 16px;
</el-main> font-weight: bold;
</el-drawer> margin-bottom: 20px;
</el-container> "
>
<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">
单位产品标煤耗kgce/t
</td>
<td class="numCell">
{{ reportItem.coal_consume_unit }}
</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>
<td class="numCell">熟料f-CaO合格率%</td>
<td
class="numCell"
v-if="
reportItem['入磨熟料_f-CaO_rate_pass']
"
>
{{
reportItem["入磨熟料_f-CaO_rate_pass"] *
100
}}
</td>
<td class="numCell" v-else>0</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">入窑生料CaO合格率%</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">
入窑生料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>
</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">
{{ reportItem.production_cost_unit }}
</td>
<td class="numCell"></td>
<td class="numCell"></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> </template>
<script> <script>
export default { 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: [],
limitedExport: false, limitedExport: false,
reportItem: {}, reportItem: {},
sflogexpList: [], sflogexpList: [],
}; };
}, },
mounted() { mounted() {
this.getTeam(); this.$API.mtm.mgroup.list
this.getShfit(); .req({ page: 0, search: "回转窑" })
}, .then((res) => {
methods: { console.log("回转窑", res);
getTeam() { this.query.mgroup = res[0].id;
let form = {}; this.apiObj = this.$API.wpm.sflog.list;
form.page = 0; this.deptId = res[0].belong_dept;
form.belong_dept = this.deptId; this.getTeam();
this.$API.mtm.team.list.req(form).then(res => { this.getShfit();
this.options = res; });
}) },
}, methods: {
getShfit() { getTeam() {
this.$API.mtm.shift.list.req({ page: 0 }).then(res => { let form = {};
this.optionsShift = res; form.page = 0;
}) form.belong_dept = this.deptId;
}, this.$API.mtm.team.list.req(form).then((res) => {
handleQuery() { this.options = res;
this.$refs.table.queryData(this.query); });
}, },
sflog_export() { getShfit() {
this.limitedExport = true; this.$API.mtm.shift.list.req({ page: 0 }).then((res) => {
}, this.optionsShift = res;
rowClick(row) { });
this.sflogId = row.id; },
this.sflogItem = row; handleQuery() {
this.getSflogItem(row.id); this.$refs.table.queryData(this.query);
this.getSflogexp(row.id); },
}, sflog_export() {
getSflogexp(id) { this.limitedExport = true;
let that = this; },
that.$API.wpm.sflogexp.list.req({ page: 0, sflog: id }).then(res => { rowClick(row) {
that.sflogexpList = res; this.sflogId = row.id;
}) this.sflogItem = row;
}, this.getSflogItem(row.id);
getSflogItem(id) { this.getSflogexp(row.id);
let that = this; },
that.$API.enm.enstat.req({ type: 'sflog', sflog: id, page: 0 }).then(res => { getSflogexp(id) {
if (res.length > 0) { let that = this;
that.reportItem = res[0]; that.$API.wpm.sflogexp.list
} .req({ page: 0, sflog: id })
console.log(res[0]) .then((res) => {
}) that.sflogexpList = res;
}, });
// },
sflog_edit(row) { getSflogItem(id) {
let jsonStr = JSON.stringify(row); let that = this;
this.$TOOL.data.remove("sflogItem") that.$API.enm.enstat
this.$TOOL.data.set('sflogItem', jsonStr) .req({ type: "sflog", sflog: id, page: 0 })
this.$router.push({ .then((res) => {
name: "logDetail", if (res.length > 0) {
query: { that.reportItem = res[0];
mgroupId: row.mgroup, }
deptId: this.deptId console.log(res[0]);
}, });
}); },
}, //
handlePrint() { sflog_edit(row) {
this.$PRINT('#myReport'); let jsonStr = JSON.stringify(row);
}, this.$TOOL.data.remove("sflogItem");
exportExcel() { this.$TOOL.data.set("sflogItem", jsonStr);
this.exportLoading = true; this.$router.push({
this.$XLSX('#myTable', this.tableName) name: "logDetail",
this.exportLoading = false; query: {
}, mgroupId: row.mgroup,
}, deptId: this.deptId,
},
});
},
handlePrint() {
this.$PRINT("#myReport");
},
exportExcel() {
this.exportLoading = true;
this.$XLSX("#myTable", this.tableName);
this.exportLoading = false;
},
},
}; };
</script> </script>
<style scoped> <style scoped>
#numTable { #numTable {
margin-left: 37px; margin-left: 37px;
} }
#numTable td { #numTable td {
height: 32px; height: 32px;
padding-left: 5px; padding-left: 5px;
} }
.numCell { .numCell {
width: 80px; width: 80px;
text-align: center; text-align: center;
} }
.numCell.numCell_last { .numCell.numCell_last {
width: 100px; width: 100px;
} }
.searchHead { .searchHead {
display: flex display: flex;
} }
.middleText { .middleText {
height: 32px; height: 32px;
line-height: 32px; line-height: 32px;
margin: 0 5px; margin: 0 5px;
display: inline-block; display: inline-block;
} }
.searchBtn { .searchBtn {
margin-left: 5px; margin-left: 5px;
} }
</style> </style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,263 +1,348 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-date-picker <el-date-picker
v-model="query.year_s" v-model="query.year_s"
type="year" type="year"
value-format="YYYY" value-format="YYYY"
format="YYYY" format="YYYY"
placeholder="查询年份" placeholder="查询年份"
class="headerSearch" class="headerSearch"
/> />
<el-button <el-button
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleQuery" @click="handleQuery"
></el-button> ></el-button>
<el-button <el-button
type="primary" type="primary"
@click="exportExcel()" @click="exportExcel()"
:loading = "exportLoading" :loading="exportLoading"
>导出xlsx >导出xlsx
</el-button> </el-button>
<el-button <el-button type="primary" @click="handlePrint">打印 </el-button>
type="primary" </div>
@click="handlePrint" </el-header>
>打印 <el-card style="margin-top: 5px">
</el-button> <div class="printWrap">
</div> <div ref="print" id="myReport" class="printContainer">
</el-header> <table
<el-card style="margin-top:5px"> border="1"
<div class="printWrap"> width="3200"
<div ref="print" id="myReport" class="printContainer"> cellspacing="0"
<table border="1" width="3200" cellspacing="0" :key="timeStamp" id="myTable" class="myTable"> :key="timeStamp"
<thead class="myTableHead"> id="myTable"
<tr> class="myTable"
<th colspan="32">回转窑工段班组月度对比分析</th> >
</tr> <thead class="myTableHead">
<tr> <tr>
<th rowspan="2">月份</th> <th colspan="32">回转窑工段班组月度对比分析</th>
<th rowspan="2">班组</th> </tr>
<th colspan="2">产量</th> <tr>
<th>运转率</th> <th rowspan="2">月份</th>
<th>成本</th> <th rowspan="2">班组</th>
<th colspan="6">质量</th> <th colspan="2">产量</th>
<th colspan="7">单位产品标煤耗</th> <th>运转率</th>
<th colspan="12">产品单位电耗</th> <th>成本</th>
<th rowspan="2">得分</th> <th colspan="6">质量</th>
</tr> <th colspan="7">单位产品标煤耗</th>
<tr> <th colspan="12">产品单位电耗</th>
<th>总产量t</th> <th rowspan="2">得分</th>
<th>台时产量t/h</th> </tr>
<th>运转率%</th> <tr>
<th>单位产品成本/</th> <th>总产量t</th>
<th>CaO%</th> <th>台时产量t/h</th>
<th>Fe₂O₃%</th> <th>运转率%</th>
<th>细度%</th> <th>单位产品成本/</th>
<th>水分%</th> <th>CaO%</th>
<th>立升重%</th> <th>Fe₂O₃%</th>
<th>f-CaO%</th> <th>细度%</th>
<th>水分%</th>
<th>立升重%</th>
<th>f-CaO%</th>
<th>当期值kgce/t</th> <th>当期值kgce/t</th>
<th>目标值kgce/t</th> <th>目标值kgce/t</th>
<th>当期与目标差值kgce/t</th> <th>当期与目标差值kgce/t</th>
<th>环期值kgce/t</th> <th>环期值kgce/t</th>
<th>当期与环期差值kgce/t</th> <th>当期与环期差值kgce/t</th>
<th>环比增长率%</th> <th>环比增长率%</th>
<th>同比增长率%</th> <th>同比增长率%</th>
<th>高温风机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>篦冷机三室风机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>当期值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>当期与目标差值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>
<th>同比增长率%</th> <th>同比增长率%</th>
</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
</tr> v-for="(item0, index0) in item"
</table> :key="index0"
</div> class="numCell"
</div> >
</el-card> {{ item0 }}
</div> </td>
</template> </tr>
</table>
</div>
</div>
</el-card>
</div>
</template>
<script> <script>
export default { export default {
data() { data() {
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() { },
let that = this; mounted() {
var myDate = new Date(); let that = this;
let year = myDate.getFullYear(); var myDate = new Date();
that.query.year_s = year; let year = myDate.getFullYear();
this.getData(); this.timeStamp = myDate.getTime();
that.query.year_s = year;
}, this.$API.mtm.mgroup.list
methods: { .req({ page: 0, search: "回转窑" })
getData(){ .then((res) => {
let that = this; console.log("回转窑", res);
let query0={}; that.query.mgroup = res[0].id;
query0.page = 0; that.getGoalData();
query0.type='month_st'; });
query0.year_s = that.query.year_s-1; },
query0.mgroup='3347217246321065984'; methods: {
let wrapArr = [],wrapArr0 = [] ,wrapArrs = []; getGoalData() {
this.$API.enm.enstat.req(query0).then((res0) => { let that = this;
let data0 = res0; let params = {};
debugger; params.page = 0;
if(data0.length>0){ params.year = that.query.year_s;
data0.forEach(item0 => { params.mgroup = that.query.mgroup;
// this.$API.mtm.goal.list.req(params).then((res) => {
let n0 = item0.month_s; let data = [];
let ind0 = 0; if (res.length > 0) {
if(team_name0.indexOf('甲')>-1){ data = res[0];
ind0 = (n0-1)*3; }
}else if(team_name0.indexOf('乙')>-1){ that.getData(data);
ind0 = (n0-1)*3+1; });
}else if(team_name0.indexOf('丙')>-1){ },
ind0 = (n0-1)*3+2; getData(goalData) {
} let that = this;
wrapArr0[ind0] = item0; let query0 = {};
}); query0.page = 0;
debugger; query0.type = "month_st";
console.log(wrapArr0) query0.year_s = that.query.year_s - 1;
}else{ query0.mgroup = that.query.mgroup;
} let wrapArr = [],
this.$API.enm.enstat.req(that.query).then((res) => { wrapArr0 = [],
let data = res; wrapArrs = [];
if(data.length>0){ this.$API.enm.enstat.req(query0).then((res0) => {
data.forEach(item => { let data0 = res0;
// debugger;
let n = item.month_s; if (data0.length > 0) {
let team_name = item.team_name; data0.forEach((item0) => {
let ind = 0; //
if(team_name.indexOf('甲')>-1){ let n0 = item0.month_s;
ind = (n-1)*3; let ind0 = 0;
}else if(team_name.indexOf('乙')>-1){ let team_name0 = item0.team_name;
ind = (n-1)*3+1; let arr0 = [];
}else if(team_name.indexOf('丙')>-1){ arr0[0] = n0;
ind = (n-1)*3+2; arr0[1] = team_name0;
} arr0[2] = item0.total_output_unit;
wrapArrs[ind] = item; arr0[3] = item0.total_output_unit;
let arr = []; arr0[4] = item0.run_rate_unit;
let time = ''+item.year_s+'.'+item.month_s; if (team_name0.indexOf("甲") > -1) {
arr.push(time); ind0 = (n0 - 1) * 3;
arr.push(item.team_name); } else if (team_name0.indexOf("乙") > -1) {
arr.push(item.total_production); ind0 = (n0 - 1) * 3 + 1;
arr.push(item.production_hour); } else if (team_name0.indexOf("丙") > -1) {
arr.push(item.run_rate); ind0 = (n0 - 1) * 3 + 2;
arr.push(item.production_cost_unit); }
// wrapArr0[ind0] = item0;
arr[6]=item.入窑生料_CaO_rate_pass!=null?item.入窑生料_CaO_rate_pass:'/'; });
arr[7]=item.入窑生料_Fe2O3_rate_pass!=null?item.入窑生料_Fe2O3_rate_pass:'/'; debugger;
arr[8]=item.入窑生料_细度_rate_pass!=null?item.入窑生料_细度_rate_pass:'/'; console.log(wrapArr0);
arr[9]=item.入窑生料_水分_rate_pass!=null?item.入窑生料_水分_rate_pass:'/'; } else {
arr[10]=item.熟料_立升重_rate_pass!=null?item.熟料_立升重_rate_pass:'/'; }
arr[11]=item.熟料_fCaO_rate_pass!=null?item.熟料_fCaO_rate_pass:'/'; this.$API.enm.enstat.req(that.query).then((res) => {
let data = res;
// if (data.length > 0) {
arr[12]=item.elec_consume_unit//KW·h/t data.forEach((item) => {
arr[13]=item.celec_consume_unit;//KW·h/t// //
arr[14]=item.celec_consume_unit;//KW·h/t let n = item.month_s;
let ind_pre = 0,huanbi = 0; let team_name = item.team_name;
if(item.month_s==1){ let ind = 0;
ind_pre = 12; if (team_name.indexOf("甲") > -1) {
huanbi = wrapArr0[ind_pre]?wrapArr0[ind_pre].elec_consume_unit:'/'; ind = (n - 1) * 3;
}else{ } else if (team_name.indexOf("乙") > -1) {
ind_pre=ind-1; ind = (n - 1) * 3 + 1;
huanbi = wrapArr[ind_pre]?wrapArr[ind_pre].elec_consume_unit?wrapArr[ind_pre].elec_consume_unit:'/':'/' } else if (team_name.indexOf("丙") > -1) {
} ind = (n - 1) * 3 + 2;
arr[15]=huanbi;//KW·h/t }
arr[16]=item.celec_consume_unit;//KW·h/t wrapArrs[ind] = item;
arr[17]=item.celec_consume_unit;//% let arr = [];
arr[18]=item.celec_consume_unit;//% let time = "" + item.year_s + "." + item.month_s;
// arr.push(time);
// arr.push(item.team_name);
arr[19]=item.高温风机_consume_unit!=null?item.高温风机_consume_unit:'/'; arr.push(item.total_production);
arr[20]=item.篦冷机一室风机_consume_unit!=null?item.篦冷机一室风机_consume_unit:'/'; arr.push(item.production_hour);
arr[21]=item.篦冷机三室风机_consume_unit!=null?item.篦冷机三室风机_consume_unit:'/'; arr.push(item.run_rate);
arr[22]=item.篦冷机二室风机_consume_unit!=null?item.篦冷机二室风机_consume_unit:'/'; arr.push(item.production_cost_unit);
arr[23]=item.窑头排风机_consume_unit!=null?item.窑头排风机_consume_unit:'/'; //
arr[24]=item.elec_consume_unit//KW·h/t arr[6] =
arr[25]=item.celec_consume_unit;//KW·h/t// item.入窑生料_CaO_rate_pass != null
arr[26]=item.celec_consume_unit;//KW·h/t ? item.入窑生料_CaO_rate_pass
let ind_pre1 = 0,huanbi1 = 0; : "/";
if(item.month_s==1){ arr[7] =
ind_pre1 = 12; item.入窑生料_Fe2O3_rate_pass != null
huanbi1 = wrapArr0[ind_pre]?wrapArr0[ind_pre].elec_consume_unit:'/'; ? item.入窑生料_Fe2O3_rate_pass
}else{ : "/";
ind_pre1=ind-1; arr[8] =
huanbi1 = wrapArr[ind_pre]?wrapArr[ind_pre].elec_consume_unit?wrapArr[ind_pre].elec_consume_unit:'/':'/' item.入窑生料_细度_rate_pass != null
} ? item.入窑生料_细度_rate_pass
arr[27]=huanbi;//KW·h/t : "/";
arr[28]=item.celec_consume_unit;//KW·h/t arr[9] =
arr[29]=item.celec_consume_unit;//% item.入窑生料_水分_rate_pass != null
arr[30]=item.celec_consume_unit;//% ? item.入窑生料_水分_rate_pass
arr[31]=item.celec_consume_unit;//% : "/";
wrapArr[ind] = arr; arr[10] =
}); item.熟料_立升重_rate_pass != null
console.log(wrapArr) ? item.熟料_立升重_rate_pass
that.tableDatas = wrapArr; : "/";
}else{ arr[11] =
} item.熟料_fCaO_rate_pass != null
}) ? item.熟料_fCaO_rate_pass
}) : "/";
},
handleQuery(){ //
this.tableDatas = []; arr[12] = item.elec_consume_unit; //KW·h/t
this.getData(); let keyVale = "goal_val_" + n;
}, arr[5] = goalData[keyVale]; //KW·h/t//
itemClick(type,item){ arr[6] = arr[4] - item.celec_consume_unit; //KW·h/t
this.type=type; let ind_pre = 0,
this.asynDialog = true; huanbi = 0;
}, if (item.month_s == 1) {
itemClick1(type,item){ ind_pre = 12;
this.chartShow = false; huanbi = wrapArr0[ind_pre]
this.$API.bi.dataset.exec ? wrapArr0[ind_pre].elec_consume_unit
.req('3322567213885833216') : "/";
.then((res) => { } else {
this.myOption = JSON.parse(res.echart_options); ind_pre = ind - 1;
debugger; huanbi = wrapArr[ind_pre]
console.log(this.myOption) ? wrapArr[ind_pre].elec_consume_unit
this.chartShow = true; ? wrapArr[ind_pre].elec_consume_unit
}); : "/"
}, : "/";
handlePrint() { }
this.$PRINT('#myReport'); arr[15] = huanbi; //KW·h/t
}, arr[16] = item.celec_consume_unit; //KW·h/t
exportExcel() { arr[17] = item.celec_consume_unit; //%
this.exportLoading = true; arr[18] = item.celec_consume_unit; //%
this.$XLSX('#myTable', this.tableName) //
this.exportLoading = false; //
}, arr[19] =
} item.高温风机_consume_unit != null
}; ? item.高温风机_consume_unit
: "/";
arr[20] =
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[26] = item.celec_consume_unit; //KW·h/t
let ind_pre1 = 0,
huanbi1 = 0;
if (item.month_s == 1) {
ind_pre1 = 12;
huanbi1 = wrapArr0[ind_pre]
? wrapArr0[ind_pre].elec_consume_unit
: "/";
} else {
ind_pre1 = ind - 1;
huanbi1 = wrapArr[ind_pre]
? wrapArr[ind_pre].elec_consume_unit
? wrapArr[ind_pre].elec_consume_unit
: "/"
: "/";
}
arr[27] = huanbi; //KW·h/t
arr[28] = item.celec_consume_unit; //KW·h/t
arr[29] = item.celec_consume_unit; //%
arr[30] = item.celec_consume_unit; //%
arr[31] = item.celec_consume_unit; //%
wrapArr[ind] = arr;
});
console.log(wrapArr);
that.tableDatas = wrapArr;
} else {
}
});
});
},
handleQuery() {
this.tableDatas = [];
this.getGoalData();
},
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> </script>
<style scoped> <style scoped>
.printWrap{ .printWrap {
width: 100%; width: 100%;
overflow-x: scroll; overflow-x: scroll;
} }
.numCell{ .numCell {
width: 100px!important; width: 100px !important;
} }
</style> </style>

File diff suppressed because it is too large Load Diff

View File

@ -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.getTeam(); this.$API.mtm.mgroup.list
this.getShfit(); .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: { methods: {
getTeam() { getTeam() {

View File

@ -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,98 +365,115 @@ 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
let params2 = {}; .req({ page: 0, search: "回转窑" })
params2.page = 0; .then((res) => {
params2.year_s = year; console.log("回转窑", res);
params2.month_s = month; that.query.mgroup = res[0].id;
params2.type = "month_s"; //
params2.mgroup = this.query.mgroup; let params2 = {};
params2.page = 0;
this.$API.enm.enstat params2.year_s = year;
.req(params2) params2.month_s = month;
.then((res2) => { params2.type = "month_s";
if (res2.length > 0) { params2.mgroup = this.query.mgroup;
let allValMonth = (that.allValMonth = this.$API.enm.enstat
res2[0].total_production); // .req(params2)
params2.mpoint__ep_monitored__power_kw__gte = 100; .then((res2) => {
this.$API.enm.mpoint.stat.req(params2).then((res) => { if (res2.length > 0) {
let data2 = res; let allValMonth = (that.allValMonth =
for (let i = 0; i < data2.length; i++) { res2[0].total_production); //
that.tableDatas[i] = []; params2.mpoint__ep_monitored__power_kw__gte = 100;
that.tableDatas[i][0] = data2[i].ep_monitored_name; this.$API.enm.mpoint.stat
that.tableDatas[i][1] = .req(params2)
data2[i].ep_monitored_number; .then((res) => {
that.tableDatas[i][2] = "KW·h/t"; let data2 = res;
let val = for (let i = 0; i < data2.length; i++) {
allValMonth == 0 that.tableDatas[i] = [];
? "/" that.tableDatas[i][0] =
: (data2[i].val / allValMonth).toFixed(2); data2[i].ep_monitored_name;
that.tableDatas[i][5] = val; that.tableDatas[i][1] =
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;
}
});
} }
})
.then((res2) => {
//
let params3 = {};
params3.page = 0;
params3.year_s = year_d;
params3.month_s = month_d;
params3.day_s = days_d;
params3.type = "day_s";
params3.mgroup = this.query.mgroup;
this.$API.enm.enstat.req(params3).then((res3) => {
if (res3.length > 0) {
let allValDays = (that.allValDays =
res3[0].total_production);
params3.mpoint__ep_monitored__power_kw__gte = 100;
this.$API.enm.mpoint.stat
.req(params3)
.then((res) => {
let data3 = res3;
for (let j = 0; j < data3.length; j++) {
let val =
allValDays == 0
? "/"
: (
data3[j].val /
allValDays
).toFixed(2);
that.tableDatas[j][4] = val;
}
});
}
});
//
let params4 = {};
params4.page = 0;
params4.year = year_h;
params4.month = month_h;
params4.day = days_h;
params4.hour = hours_h;
params4.type = "hour_s";
params4.mgroup = this.query.mgroup;
this.$API.enm.enstat.req(params4).then((res4) => {
if (res4.length > 0) {
let hourProduct = (that.allValHour =
res4[0].total_production);
params4.mpoint__ep_monitored__power_kw__gte = 100;
this.$API.enm.mpoint.stat
.req(params4)
.then((res) => {
let data4 = res4;
for (let k = 0; k < data4.length; k++) {
let val =
hourProduct == 0
? "/"
: (
data4[k].val /
hourProduct
).toFixed(2);
that.tableDatas[k][3] = val;
}
});
}
});
}); });
} that.getHourData();
}) that.getDayData();
.then((res2) => { that.getMonthData();
//
let params3 = {};
params3.page = 0;
params3.year_s = year_d;
params3.month_s = month_d;
params3.day_s = days_d;
params3.type = "day_s";
params3.mgroup = this.query.mgroup;
this.$API.enm.enstat.req(params3).then((res3) => {
if (res3.length > 0) {
let allValDays = (that.allValDays =
res3[0].total_production);
params3.mpoint__ep_monitored__power_kw__gte = 100;
this.$API.enm.mpoint.stat.req(params3).then((res) => {
let data3 = res3;
for (let j = 0; j < data3.length; j++) {
let val =
allValDays == 0
? "/"
: (data3[j].val / allValDays).toFixed(
2
);
that.tableDatas[j][4] = val;
}
});
}
});
//
let params4 = {};
params4.page = 0;
params4.year = year_h;
params4.month = month_h;
params4.day = days_h;
params4.hour = hours_h;
params4.type = "hour_s";
params4.mgroup = this.query.mgroup;
this.$API.enm.enstat.req(params4).then((res4) => {
if (res4.length > 0) {
let hourProduct = (that.allValHour =
res4[0].total_production);
params4.mpoint__ep_monitored__power_kw__gte = 100;
this.$API.enm.mpoint.stat.req(params4).then((res) => {
let data4 = res4;
for (let k = 0; k < data4.length; k++) {
let val =
hourProduct == 0
? "/"
: (data4[k].val / hourProduct).toFixed(
2
);
that.tableDatas[k][3] = val;
}
});
}
});
}); });
that.getHourData();
that.getDayData();
that.getMonthData();
}, },
methods: { methods: {
// //

View File

@ -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,201 +570,219 @@ 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
let params3 = {}; .req({ page: 0, search: "回转窑" })
params3.page = 0;
params3.year_s = year_d;
params3.month_s = month_d;
params3.day_s = days_d;
params3.type = "day_s";
params3.mgroup = this.query.mgroup;
this.$API.enm.enstat.req(params3).then((res3) => {
if (res3.length > 0) {
let data3 = res3[0];
that.tableDatas[0][3] = data3.total_production;
that.tableDatas[1][3] = data3.production_hour;
that.tableDatas[2][3] = data3.run_hour;
that.tableDatas[3][3] = data3.run_rate;
that.tableDatas[4][3] = data3.elec_consume_unit;
that.tableDatas[5][3] = data3.celec_consume_unit;
that.tableDatas[6][3] = data3.coal_consume_unit;
that.tableDatas[7][3] = data3.cen_consume_unit;
}
});
//
let params4 = {};
params4.page = 0;
params4.year = year_h;
params4.month = month_h;
params4.day = days_h;
params4.hour = hours_h;
params4.type = "hour_st";
params4.mgroup = this.query.mgroup;
this.$API.enm.enstat.req(params4).then((res4) => {
if (res4.length > 0) {
let data4 = res4[0];
that.tableDatas[0][2] = data4.total_production;
that.tableDatas[4][2] = data4.elec_consume_unit;
that.tableDatas[5][2] = data4.celec_consume_unit;
that.tableDatas[6][2] = data4.coal_consume_unit;
that.tableDatas[7][2] = data4.cen_consume_unit;
}
});
let params5 = {};
params5.page = 0;
params5.mgroup = "3346520558031773696";
this.$API.mtm.goal.list
.req(params5)
.then((res5) => {
if (res5.length > 0) {
let data5 = res5;
data5.forEach((item5) => {
let str = "goal_val_" + that.month;
if (item5.goal_cate_name == "总产量t") {
that.tableDatas[0][6] = item5[str];
that.tableDatas[0][8] = item5.goal_val;
} else if (item5.goal_cate_name == "台时产量t/h") {
that.tableDatas[1][6] = item5[str];
that.tableDatas[1][8] = item5.goal_val;
} else if (item5.goal_cate_name == "运转时间h") {
that.tableDatas[2][6] = item5[str];
that.tableDatas[2][8] = item5.goal_val;
} else if (item5.goal_cate_name == "运转率(%") {
that.tableDatas[3][6] = item5[str];
that.tableDatas[3][8] = item5.goal_val;
} else if (
item5.goal_cate_name == "单位产品分布电耗KW·h/t"
) {
that.tableDatas[4][6] = item5[str];
that.tableDatas[4][8] = item5.goal_val;
} else if (
item5.goal_cate_name == "单位产品综合电耗KW·h/t"
) {
that.tableDatas[5][6] = item5[str];
that.tableDatas[5][8] = item5.goal_val;
} else if (
item5.goal_cate_name == "单位产品标煤耗kgce/t"
) {
that.tableDatas[6][6] = item5[str];
that.tableDatas[6][8] = item5.goal_val;
} else if (
item5.goal_cate_name == "单位产品综合能耗kgce/t"
) {
that.tableDatas[7][6] = item5[str];
that.tableDatas[7][8] = item5.goal_val;
}
});
}
})
.then((res) => { .then((res) => {
// console.log("回转窑", res);
let params1 = {}; that.query.mgroup = res[0].id;
params1.page = 0; //
params1.year_s = year; let params3 = {};
params1.type = "year_s"; params3.page = 0;
params1.mgroup = this.query.mgroup; params3.year_s = year_d;
this.$API.enm.enstat.req(params1).then((res1) => { params3.month_s = month_d;
if (res1.length > 0) { params3.day_s = days_d;
let data1 = res1[0]; params3.type = "day_s";
that.tableDatas[0][5] = data1.total_production; params3.mgroup = that.query.mgroup;
that.tableDatas[0][9] = precen( that.$API.enm.enstat.req(params3).then((res3) => {
that.tableDatas[0][5], if (res3.length > 0) {
that.tableDatas[0][8] let data3 = res3[0];
); that.tableDatas[0][3] = data3.total_production;
that.tableDatas[1][5] = data1.production_hour; that.tableDatas[1][3] = data3.production_hour;
that.tableDatas[1][9] = precen( that.tableDatas[2][3] = data3.run_hour;
that.tableDatas[1][5], that.tableDatas[3][3] = data3.run_rate;
that.tableDatas[1][8] that.tableDatas[4][3] = data3.elec_consume_unit;
); that.tableDatas[5][3] = data3.celec_consume_unit;
that.tableDatas[2][5] = data1.run_hour; that.tableDatas[6][3] = data3.coal_consume_unit;
that.tableDatas[2][9] = precen( that.tableDatas[7][3] = data3.cen_consume_unit;
that.tableDatas[2][5],
that.tableDatas[2][8]
);
that.tableDatas[3][5] = data1.run_rate;
that.tableDatas[3][9] = precen(
that.tableDatas[3][5],
that.tableDatas[3][8]
);
that.tableDatas[4][5] = data1.elec_consume_unit;
that.tableDatas[4][9] = precen(
that.tableDatas[4][5],
that.tableDatas[4][8]
);
that.tableDatas[5][5] = data1.celec_consume_unit;
that.tableDatas[5][9] = precen(
that.tableDatas[5][5],
that.tableDatas[5][8]
);
that.tableDatas[6][5] = data1.coal_consume_unit;
that.tableDatas[6][9] = precen(
that.tableDatas[6][5],
that.tableDatas[6][8]
);
that.tableDatas[7][5] = data1.cen_consume_unit;
that.tableDatas[7][9] = precen(
that.tableDatas[7][5],
that.tableDatas[7][8]
);
} else {
} }
}); });
// //
let params2 = {}; let params4 = {};
params2.page = 0; params4.page = 0;
params2.year_s = year; params4.year = year_h;
params2.month_s = month; params4.month = month_h;
params2.type = "month_s"; params4.day = days_h;
params2.mgroup = this.query.mgroup; params4.hour = hours_h;
this.$API.enm.enstat.req(params2).then((res2) => { params4.type = "hour_st";
if (res2.length > 0) { params4.mgroup = that.query.mgroup;
let data2 = res2[0]; that.$API.enm.enstat.req(params4).then((res4) => {
that.tableDatas[0][4] = data2.total_production; if (res4.length > 0) {
that.tableDatas[0][7] = precen( let data4 = res4[0];
that.tableDatas[0][4], that.tableDatas[0][2] = data4.total_production;
that.tableDatas[0][6] that.tableDatas[4][2] = data4.elec_consume_unit;
); that.tableDatas[5][2] = data4.celec_consume_unit;
that.tableDatas[1][4] = data2.production_hour; that.tableDatas[6][2] = data4.coal_consume_unit;
that.tableDatas[1][7] = precen( that.tableDatas[7][2] = data4.cen_consume_unit;
that.tableDatas[1][4],
that.tableDatas[1][6]
);
that.tableDatas[2][4] = data2.run_hour;
that.tableDatas[2][7] = precen(
that.tableDatas[2][4],
that.tableDatas[2][6]
);
that.tableDatas[3][4] = data2.run_rate;
that.tableDatas[3][7] = precen(
that.tableDatas[3][4],
that.tableDatas[3][6]
);
that.tableDatas[4][4] = data2.elec_consume_unit;
that.tableDatas[4][7] = precen(
that.tableDatas[4][4],
that.tableDatas[4][6]
);
that.tableDatas[5][4] = data2.celec_consume_unit;
that.tableDatas[5][7] = precen(
that.tableDatas[5][4],
that.tableDatas[5][6]
);
that.tableDatas[6][4] = data2.coal_consume_unit;
that.tableDatas[6][7] = precen(
that.tableDatas[6][4],
that.tableDatas[6][6]
);
that.tableDatas[7][4] = data2.cen_consume_unit;
that.tableDatas[7][7] = precen(
that.tableDatas[7][4],
that.tableDatas[7][6]
);
} }
}); });
let params5 = {};
params5.page = 0;
params5.mgroup = that.query.mgroup;
that.$API.mtm.goal.list
.req(params5)
.then((res5) => {
if (res5.length > 0) {
let data5 = res5;
data5.forEach((item5) => {
let str = "goal_val_" + that.month;
if (item5.goal_cate_name == "总产量t") {
that.tableDatas[0][6] = item5[str];
that.tableDatas[0][8] = item5.goal_val;
} else if (
item5.goal_cate_name == "台时产量t/h"
) {
that.tableDatas[1][6] = item5[str];
that.tableDatas[1][8] = item5.goal_val;
} else if (
item5.goal_cate_name == "运转时间h"
) {
that.tableDatas[2][6] = item5[str];
that.tableDatas[2][8] = item5.goal_val;
} else if (
item5.goal_cate_name == "运转率(%"
) {
that.tableDatas[3][6] = item5[str];
that.tableDatas[3][8] = item5.goal_val;
} else if (
item5.goal_cate_name ==
"单位产品分布电耗KW·h/t"
) {
that.tableDatas[4][6] = item5[str];
that.tableDatas[4][8] = item5.goal_val;
} else if (
item5.goal_cate_name ==
"单位产品综合电耗KW·h/t"
) {
that.tableDatas[5][6] = item5[str];
that.tableDatas[5][8] = item5.goal_val;
} else if (
item5.goal_cate_name ==
"单位产品标煤耗kgce/t"
) {
that.tableDatas[6][6] = item5[str];
that.tableDatas[6][8] = item5.goal_val;
} else if (
item5.goal_cate_name ==
"单位产品综合能耗kgce/t"
) {
that.tableDatas[7][6] = item5[str];
that.tableDatas[7][8] = item5.goal_val;
}
});
}
})
.then((res) => {
//
let params1 = {};
params1.page = 0;
params1.year_s = year;
params1.type = "year_s";
params1.mgroup = this.query.mgroup;
this.$API.enm.enstat.req(params1).then((res1) => {
if (res1.length > 0) {
let data1 = res1[0];
that.tableDatas[0][5] = data1.total_production;
that.tableDatas[0][9] = precen(
that.tableDatas[0][5],
that.tableDatas[0][8]
);
that.tableDatas[1][5] = data1.production_hour;
that.tableDatas[1][9] = precen(
that.tableDatas[1][5],
that.tableDatas[1][8]
);
that.tableDatas[2][5] = data1.run_hour;
that.tableDatas[2][9] = precen(
that.tableDatas[2][5],
that.tableDatas[2][8]
);
that.tableDatas[3][5] = data1.run_rate;
that.tableDatas[3][9] = precen(
that.tableDatas[3][5],
that.tableDatas[3][8]
);
that.tableDatas[4][5] = data1.elec_consume_unit;
that.tableDatas[4][9] = precen(
that.tableDatas[4][5],
that.tableDatas[4][8]
);
that.tableDatas[5][5] =
data1.celec_consume_unit;
that.tableDatas[5][9] = precen(
that.tableDatas[5][5],
that.tableDatas[5][8]
);
that.tableDatas[6][5] = data1.coal_consume_unit;
that.tableDatas[6][9] = precen(
that.tableDatas[6][5],
that.tableDatas[6][8]
);
that.tableDatas[7][5] = data1.cen_consume_unit;
that.tableDatas[7][9] = precen(
that.tableDatas[7][5],
that.tableDatas[7][8]
);
} else {
}
});
//
let params2 = {};
params2.page = 0;
params2.year_s = year;
params2.month_s = month;
params2.type = "month_s";
params2.mgroup = this.query.mgroup;
this.$API.enm.enstat.req(params2).then((res2) => {
if (res2.length > 0) {
let data2 = res2[0];
that.tableDatas[0][4] = data2.total_production;
that.tableDatas[0][7] = precen(
that.tableDatas[0][4],
that.tableDatas[0][6]
);
that.tableDatas[1][4] = data2.production_hour;
that.tableDatas[1][7] = precen(
that.tableDatas[1][4],
that.tableDatas[1][6]
);
that.tableDatas[2][4] = data2.run_hour;
that.tableDatas[2][7] = precen(
that.tableDatas[2][4],
that.tableDatas[2][6]
);
that.tableDatas[3][4] = data2.run_rate;
that.tableDatas[3][7] = precen(
that.tableDatas[3][4],
that.tableDatas[3][6]
);
that.tableDatas[4][4] = data2.elec_consume_unit;
that.tableDatas[4][7] = precen(
that.tableDatas[4][4],
that.tableDatas[4][6]
);
that.tableDatas[5][4] =
data2.celec_consume_unit;
that.tableDatas[5][7] = precen(
that.tableDatas[5][4],
that.tableDatas[5][6]
);
that.tableDatas[6][4] = data2.coal_consume_unit;
that.tableDatas[6][7] = precen(
that.tableDatas[6][4],
that.tableDatas[6][6]
);
that.tableDatas[7][4] = data2.cen_consume_unit;
that.tableDatas[7][7] = precen(
that.tableDatas[7][4],
that.tableDatas[7][6]
);
}
});
});
that.getHourData();
that.getDayData();
that.getMonthData();
}); });
that.getHourData();
that.getDayData();
that.getMonthData();
}, },
methods: { methods: {
// //

View File

@ -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) => {

File diff suppressed because it is too large Load Diff