feat:凌源新增原料磨、回转窑、煤磨模块

This commit is contained in:
shijing 2024-04-10 17:20:47 +08:00
parent 95b7c45b18
commit e31a3b527a
42 changed files with 9188 additions and 2283 deletions

View File

@ -131,7 +131,7 @@ const routes = [
"title": "电石渣",
"icon": "el-icon-opportunity",
"type": "menu",
"perms": ["enm"]
"perms": ["enm_slag"]
},
"children": [
{
@ -140,7 +140,7 @@ const routes = [
"meta": {
"title": "生产报告",
"icon": "el-icon-document",
"perms": ["enm"]
"perms": ["enm_slag"]
},
"component": "enm_slag/report"
},
@ -150,7 +150,7 @@ const routes = [
"meta": {
"title": "单位产品电耗",
"icon": "el-icon-odometer",
"perms": ["enm"]
"perms": ["enm_slag"]
},
"component": "enm_slag/power"
},
@ -160,7 +160,7 @@ const routes = [
"meta": {
"title": "班组月度对比",
"icon": "el-icon-operation",
"perms": ["enm"]
"perms": ["enm_slag"]
},
"component": "enm_slag/teamAnalysis"
},
@ -170,7 +170,7 @@ const routes = [
"meta": {
"title": "车间单耗分析",
"icon": "el-icon-data-line",
"perms": ["enm"]
"perms": ["enm_slag"]
},
"component": "enm_slag/workshopAnalysis"
},
@ -180,7 +180,7 @@ const routes = [
"meta": {
"title": "交接班日志",
"icon": "el-icon-document-copy",
"perms": ["enm"]
"perms": ["enm_slag"]
},
"component": "enm_slag/handoverLog"
},
@ -248,7 +248,7 @@ const routes = [
"title": "原料磨",
"icon": "el-icon-list",
"type": "menu",
"perms": ["enm"]
"perms": ["enm_rm"]
},
"children": [
{
@ -257,7 +257,7 @@ const routes = [
"meta": {
"title": "生产报告",
"icon": "el-icon-document",
"perms": ["enm"]
"perms": ["enm_rm"]
},
"component": "enm_rm/report"
},
@ -267,7 +267,7 @@ const routes = [
"meta": {
"title": "单位产品电耗",
"icon": "el-icon-odometer",
"perms": ["enm"]
"perms": ["enm_rm"]
},
"component": "enm_rm/power"
},
@ -277,7 +277,7 @@ const routes = [
"meta": {
"title": "班组月度对比",
"icon": "el-icon-operation",
"perms": ["enm"]
"perms": ["enm_rm"]
},
"component": "enm_rm/teamAnalysis"
},
@ -287,7 +287,7 @@ const routes = [
"meta": {
"title": "车间单耗分析",
"icon": "el-icon-data-line",
"perms": ["enm"]
"perms": ["enm_rm"]
},
"component": "enm_rm/workshopAnalysis"
},
@ -297,7 +297,7 @@ const routes = [
"meta": {
"title": "交接班日志",
"icon": "el-icon-document-copy",
"perms": ["enm"]
"perms": ["enm_rm"]
},
"component": "enm_rm/handoverLog"
},
@ -307,7 +307,7 @@ const routes = [
"meta": {
"title": "日志详情",
"icon": "el-icon-document-copy",
"perms": ["enm"],
"perms": ["enm_rm"],
"hidden": true
},
"component": "enm_rm/logDetail"
@ -375,17 +375,6 @@ const routes = [
},
"component": "enm_rmbase/handoverLog"
},
{
"name": "logDetail",
"path": "/enm_rmbase/logDetail",
"meta": {
"title": "日志详情",
"icon": "el-icon-document-copy",
"perms": ["enm_rmbase"],
"hidden": true
},
"component": "enm_rmbase/logDetail"
},
]
},
//回转窑
@ -396,7 +385,7 @@ const routes = [
"title": "回转窑",
"icon": "el-icon-menu",
"type": "menu",
"perms": ["enm"]
"perms": ["enm_kiln"]
},
"children": [
{
@ -405,7 +394,7 @@ const routes = [
"meta": {
"title": "生产报告",
"icon": "el-icon-document",
"perms": ["enm"]
"perms": ["enm_kiln"]
},
"component": "enm_kiln/report"
},
@ -415,7 +404,7 @@ const routes = [
"meta": {
"title": "单位产品电耗",
"icon": "el-icon-odometer",
"perms": ["enm"]
"perms": ["enm_kiln"]
},
"component": "enm_kiln/power"
},
@ -425,7 +414,7 @@ const routes = [
"meta": {
"title": "班组月度对比",
"icon": "el-icon-operation",
"perms": ["enm"]
"perms": ["enm_kiln"]
},
"component": "enm_kiln/teamAnalysis"
},
@ -435,7 +424,7 @@ const routes = [
"meta": {
"title": "车间单耗分析",
"icon": "el-icon-data-line",
"perms": ["enm"]
"perms": ["enm_kiln"]
},
"component": "enm_kiln/workshopAnalysis"
},
@ -445,12 +434,75 @@ const routes = [
"meta": {
"title": "交接班日志",
"icon": "el-icon-document-copy",
"perms": ["enm"]
"perms": ["enm_kiln"]
},
"component": "enm_kiln/handoverLog"
},
]
},
//回转窑——基础
{
"name": "enm_kilnbase",
"path": "/enm_kilnbase",
"meta": {
"title": "回转窑1",
"icon": "el-icon-menu",
"type": "menu",
"perms": ["enm_kilnbase"]
},
"children": [
{
"name": "kilnbase_report",
"path": "/enm_kilnbase/report",
"meta": {
"title": "生产报告",
"icon": "el-icon-document",
"perms": ["enm_kilnbase"]
},
"component": "enm_kilnbase/report"
},
{
"name": "kilnbase_power",
"path": "/enm_kilnbase/power",
"meta": {
"title": "单位产品电耗",
"icon": "el-icon-odometer",
"perms": ["enm_kilnbase"]
},
"component": "enm_kilnbase/power"
},
{
"name": "kilnbase_teamAnalysis",
"path": "/enm_kilnbase/teamAnalysis",
"meta": {
"title": "班组月度对比",
"icon": "el-icon-operation",
"perms": ["enm_kilnbase"]
},
"component": "enm_kilnbase/teamAnalysis"
},
{
"name": "kilnbase_workshopAnalysis",
"path": "/enm_kilnbase/workshopAnalysis",
"meta": {
"title": "车间单耗分析",
"icon": "el-icon-data-line",
"perms": ["enm_kilnbase"]
},
"component": "enm_kilnbase/workshopAnalysis"
},
{
"name": "kilnbase_handoverLog",
"path": "/enm_kilnbase/handoverLog",
"meta": {
"title": "交接班日志",
"icon": "el-icon-document-copy",
"perms": ["enm_kilnbase"]
},
"component": "enm_kilnbase/handoverLog"
},
]
},
//余热发电 cogeneration
{
"name": "enm_cogeneration",
@ -512,7 +564,7 @@ const routes = [
"title": "煤磨",
"icon": "el-icon-brush-filled",
"type": "menu",
"perms": ["enm"]
"perms": ["enm_coal"]
},
"children": [
{
@ -521,7 +573,7 @@ const routes = [
"meta": {
"title": "生产报告",
"icon": "el-icon-document",
"perms": ["enm"]
"perms": ["enm_coal"]
},
"component": "enm_coal/report"
},
@ -531,7 +583,7 @@ const routes = [
"meta": {
"title": "单位产品电耗",
"icon": "el-icon-odometer",
"perms": ["enm"]
"perms": ["enm_coal"]
},
"component": "enm_coal/power"
},
@ -541,7 +593,7 @@ const routes = [
"meta": {
"title": "班组月度对比",
"icon": "el-icon-operation",
"perms": ["enm"]
"perms": ["enm_coal"]
},
"component": "enm_coal/teamAnalysis"
},
@ -551,7 +603,7 @@ const routes = [
"meta": {
"title": "车间单耗分析",
"icon": "el-icon-data-line",
"perms": ["enm"]
"perms": ["enm_coal"]
},
"component": "enm_coal/workshopAnalysis"
},
@ -561,12 +613,75 @@ const routes = [
"meta": {
"title": "交接班日志",
"icon": "el-icon-document-copy",
"perms": ["enm"]
"perms": ["enm_coal"]
},
"component": "enm_coal/handoverLog"
},
]
},
//煤磨——基础
{
"name": "enm_coalbase",
"path": "/enm_coalbase",
"meta": {
"title": "煤磨1",
"icon": "el-icon-brush-filled",
"type": "menu",
"perms": ["enm_coalbase"]
},
"children": [
{
"name": "coalbase_report",
"path": "/enm_coalbase/report",
"meta": {
"title": "生产报告",
"icon": "el-icon-document",
"perms": ["enm_coalbase"]
},
"component": "enm_coalbase/report"
},
{
"name": "coalbase_power",
"path": "/enm_coalbase/power",
"meta": {
"title": "单位产品电耗",
"icon": "el-icon-odometer",
"perms": ["enm_coalbase"]
},
"component": "enm_coalbase/power"
},
{
"name": "coalbase_teamAnalysis",
"path": "/enm_coalbase/teamAnalysis",
"meta": {
"title": "班组月度对比",
"icon": "el-icon-operation",
"perms": ["enm_coalbase"]
},
"component": "enm_coalbase/teamAnalysis"
},
{
"name": "coalbase_workshopAnalysis",
"path": "/enm_coalbase/workshopAnalysis",
"meta": {
"title": "车间单耗分析",
"icon": "el-icon-data-line",
"perms": ["enm_coalbase"]
},
"component": "enm_coalbase/workshopAnalysis"
},
{
"name": "coalbase_handoverLog",
"path": "/enm_coalbase/handoverLog",
"meta": {
"title": "交接班日志",
"icon": "el-icon-document-copy",
"perms": ["enm_coalbase"]
},
"component": "enm_coalbase/handoverLog"
},
]
},
//水泥磨
{
"name": "enm_mill",
@ -575,7 +690,7 @@ const routes = [
"title": "水泥磨",
"icon": "el-icon-help-filled",
"type": "menu",
"perms": ["enm"]
"perms": ["enm_mill"]
},
"children": [
{
@ -584,7 +699,7 @@ const routes = [
"meta": {
"title": "生产报告",
"icon": "el-icon-document",
"perms": ["enm"]
"perms": ["enm_mill"]
},
"component": "enm_mill/report"
},
@ -594,7 +709,7 @@ const routes = [
"meta": {
"title": "单位产品电耗",
"icon": "el-icon-odometer",
"perms": ["enm"]
"perms": ["enm_mill"]
},
"component": "enm_mill/power"
},
@ -604,7 +719,7 @@ const routes = [
"meta": {
"title": "班组月度对比",
"icon": "el-icon-operation",
"perms": ["enm"]
"perms": ["enm_mill"]
},
"component": "enm_mill/teamAnalysis"
},
@ -614,7 +729,7 @@ const routes = [
"meta": {
"title": "车间单耗分析",
"icon": "el-icon-data-line",
"perms": ["enm"]
"perms": ["enm_mill"]
},
"component": "enm_mill/workshopAnalysis"
},
@ -624,7 +739,7 @@ const routes = [
"meta": {
"title": "交接班日志",
"icon": "el-icon-document-copy",
"perms": ["enm"]
"perms": ["enm_mill"]
},
"component": "enm_mill/handoverLog"
},
@ -638,7 +753,7 @@ const routes = [
"title": "水泥包装",
"icon": "el-icon-goods-filled",
"type": "menu",
"perms": ["enm"]
"perms": ["enm_pack"]
},
"children": [
{
@ -647,7 +762,7 @@ const routes = [
"meta": {
"title": "生产报告",
"icon": "el-icon-document",
"perms": ["enm"]
"perms": ["enm_pack"]
},
"component": "enm_pack/report"
},
@ -667,7 +782,7 @@ const routes = [
"meta": {
"title": "班组月度对比",
"icon": "el-icon-operation",
"perms": ["enm"]
"perms": ["enm_pack"]
},
"component": "enm_pack/teamAnalysis"
},
@ -677,7 +792,7 @@ const routes = [
"meta": {
"title": "车间单耗分析",
"icon": "el-icon-data-line",
"perms": ["enm"]
"perms": ["enm_pack"]
},
"component": "enm_pack/workshopAnalysis"
},
@ -687,7 +802,7 @@ const routes = [
"meta": {
"title": "交接班日志",
"icon": "el-icon-document-copy",
"perms": ["enm"]
"perms": ["enm_pack"]
},
"component": "enm_pack/handoverLog"
},
@ -695,137 +810,166 @@ const routes = [
},
//全厂能源
{
"name": "energy",
"path": "/energy",
"name": "enm_energy",
"path": "/enm_energy",
"meta": {
"title": "全厂能源",
"icon": "el-icon-share",
"type": "menu",
"perms": ["enm"]
"perms": ["enm_energy"]
},
"children": [
{
"name": "energy",
"path": "/ungrouped/energy",
"path": "/enm_energy/energy",
"meta": {
"title": "能源统计",
"icon": "el-icon-grid",
"perms": ["enm"]
"perms": ["enm_energy_energy"]
},
"component": "ungrouped/energy"
"component": "enm_energy/energy"
},
{
"name": "value",
"path": "/ungrouped/value",
"path": "/enm_energy/value",
"meta": {
"title": "工业产值",
"icon": "el-icon-grid",
"perms": ["enm"]
"perms": ["enm_energy_value"]
},
"component": "ungrouped/value"
"component": "enm_energy/value"
},
{
"name": "electric",
"path": "/ungrouped/electric",
"path": "/enm_energy/electric",
"meta": {
"title": "全厂电量统计",
"icon": "el-icon-grid",
"perms": ["enm"]
"perms": ["enm_energy_electric"]
},
"component": "ungrouped/electric"
"component": "enm_energy/electric"
},
{
"name": "electricHour",
"path": "/ungrouped/electricHour",
"path": "/enm_energy/electricHour",
"meta": {
"title": "全厂电量小时统计",
"icon": "el-icon-grid",
"perms": ["enm"]
"perms": ["enm_energy_hour"]
},
"component": "ungrouped/electric_hour"
},
{
"name": "energyPicture",
"path": "/ungrouped/energyPicture",
"meta": {
"title": "能源流向",
"icon": "el-icon-grid",
"perms": ["enm"]
},
"component": "ungrouped/energyPicture"
"component": "enm_energy/electric_hour"
},
{
"name": "electricDay",
"path": "/ungrouped/electricDay",
"path": "/enm_energy/electricDay",
"meta": {
"title": "全厂电量日统计",
"icon": "el-icon-grid",
"perms": ["enm"]
"perms": ["enm_energy_day"]
},
"component": "ungrouped/electric_day"
"component": "enm_energy/electric_day"
},
{
"name": "electricMonth",
"path": "/ungrouped/electricMonth",
"path": "/enm_energy/electricMonth",
"meta": {
"title": "全厂电量月统计",
"icon": "el-icon-grid",
"perms": ["enm"]
"perms": ["enm_energy_month"]
},
"component": "ungrouped/electric_month"
"component": "enm_energy/electric_month"
},
{
"name": "hourBase",
"path": "/enm_energy/hourBase",
"meta": {
"title": "电量消耗小时报表",
"icon": "el-icon-grid",
"perms": ["hour_base"]
},
"component": "enm_energy/hour_base"
},
{
"name": "dayBase",
"path": "/enm_energy/dayBase",
"meta": {
"title": "电量消耗日报表",
"icon": "el-icon-grid",
"perms": ["day_base"]
},
"component": "enm_energy/day_base"
},
{
"name": "monthBase",
"path": "/enm_energy/monthBase",
"meta": {
"title": "电量消耗月报表",
"icon": "el-icon-grid",
"perms": ["month_base"]
},
"component": "enm_energy/month_base"
},
{
"name": "energyPicture",
"path": "/enm_energy/energyPicture",
"meta": {
"title": "能源流向",
"icon": "el-icon-grid",
"perms": ["enm_energy_picture"]
},
"component": "enm_energy/energyPicture"
}
]
},
//全厂报表
{
"name": "rforms",
"path": "/rforms",
"name": "enm_report",
"path": "/enm_report",
"meta": {
"title": "全厂报表",
"icon": "el-icon-histogram",
"type": "menu",
"perms": ["enm"]
"perms": ["enm_report"]
},
"children": [
{
"name": "costing",
"path": "/ungrouped/costing",
"path": "/enm_report/costing",
"meta": {
"title": "成本计算",
"icon": "el-icon-grid",
"perms": ["enm"]
"perms": ["enm_report"]
},
"component": "ungrouped/costing"
"component": "enm_report/costing"
},
{
"name": "quality",
"path": "/ungrouped/quality",
"path": "/enm_report/quality",
"meta": {
"title": "质量报表",
"icon": "el-icon-grid",
"perms": ["enm"]
"perms": ["enm_report"]
},
"component": "ungrouped/quality"
"component": "enm_report/quality"
}
, {
"name": "reportAll",
"path": "/ungrouped/report",
"name": "reportDay",
"path": "/enm_report/reportDay",
"meta": {
"title": "生产日报表",
"icon": "el-icon-grid",
"perms": ["enm"]
"perms": ["enm_report"]
},
"component": "ungrouped/report"
"component": "enm_report/reportDay"
}, {
"name": "reportMonthAll",
"path": "/ungrouped/reportMonth",
"name": "reportMonth",
"path": "/enm_report/reportMonth",
"meta": {
"title": "生产月报表",
"icon": "el-icon-grid",
"perms": ["enm"]
"perms": ["enm_report"]
},
"component": "ungrouped/report_month"
"component": "enm_report/reportMonth"
}
]
},
@ -2185,62 +2329,62 @@ const routes = [
},
//基础配置
{
"name": "base",
"path": "/base",
"name": "enm_base",
"path": "/enm_base",
"meta": {
"title": "基础配置",
"icon": "el-icon-management",
"type": "menu",
"perms": ["enm"]
"perms": ["enm_base"]
},
"children": [
{
"path": "/ungrouped/team",
"path": "/enm_base/team",
"name": "team",
"meta": {
"title": "班组管理",
"icon": "el-icon-postcard",
"type": "menu",
"perms": ["enm"]
"perms": ["enm_base"]
},
"component": "ungrouped/team"
"component": "enm_base/team"
},
{
"name": "mgruop",
"path": "/ungrouped/mgruop",
"path": "/enm_base/mgruop",
"meta": {
"title": "测点集",
"icon": "el-icon-grid",
"perms": ["enm"]
"perms": ["enm_base"]
},
"component": "ungrouped/mgroup"
"component": "enm_base/mgroup"
},
{
"name": "mpoint",
"path": "/em/mpoint",
"path": "/enm_base/mpoint",
"meta": {
"title": "测点",
"icon": "el-icon-grid",
"perms": ["enm"]
"perms": ["enm_base"]
},
"component": "em/mpoint"
},
{
"name": "material",
"path": "/ungrouped/material",
"path": "/enm_base/material",
"meta": {
"title": "物料",
"icon": "el-icon-grid",
"perms": ["enm"]
"perms": ["enm_base"]
},
"component": "ungrouped/material"
"component": "enm_base/material"
}
]
},
//每月配置
{
"name": "month",
"path": "/month",
"name": "enm_monthSet",
"path": "/enm_monthSet",
"meta": {
"title": "每月配置",
"icon": "el-icon-checked",
@ -2250,33 +2394,33 @@ const routes = [
"children": [
{
"name": "priceset",
"path": "/ungrouped/priceset",
"path": "/enm_monthSet/priceset",
"meta": {
"title": "物料价格配置",
"icon": "el-icon-grid",
"perms": ["enm"]
},
"component": "ungrouped/priceset"
"component": "enm_monthSet/priceset"
},
{
"name": "feeset",
"path": "/ungrouped/feeset",
"path": "/enm_monthSet/feeset",
"meta": {
"title": "工段成本配置",
"icon": "el-icon-grid",
"perms": ["enm"]
},
"component": "ungrouped/feeset"
"component": "enm_monthSet/feeset"
},
{
"name": "goalSetting",
"path": "/ungrouped/goalSetting",
"path": "/enm_monthSet/goalSetting",
"meta": {
"title": "月度年度目标值",
"icon": "el-icon-grid",
"perms": ["enm"]
},
"component": "ungrouped/goalSetting"
"component": "enm_monthSet/goalSetting"
},
]
},

View File

@ -0,0 +1,359 @@
<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="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)
}}</span>
<span
v-if="sflogItem.shift_name"
style="margin: 0 10px"
>{{ 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">产量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 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",
data() {
return {
apiObj: this.$API.wpm.sflog.list,
apiObj2: null,
query: {
shift: "",
team: "",
end_time__lt: "",
start_time__gte: "",
mgroup: "3347217512021835776",
},
deptId: "3347207082608115712",
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];
}
console.log(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;
}
#numTable td {
height: 32px;
padding-left: 5px;
}
.numCell {
width: 80px;
}
.numCell.numCell_last {
width: 100px;
}
.searchHead {
display: flex;
}
.middleText {
height: 32px;
line-height: 32px;
margin: 0 5px;
display: inline-block;
}
.searchBtn {
margin-left: 5px;
}
</style>

View File

@ -0,0 +1,478 @@
<template>
<div class="app-container">
<el-header>
<div class="left-panel">
<el-button
type="primary"
@click="exportExcel()"
:loading = "exportLoading"
>导出xlsx
</el-button>
<el-button
type="primary"
@click="handlePrint"
>打印
</el-button>
</div>
</el-header>
<el-card style="margin-top:5px">
<div class="printWrap">
<div ref="print" id="myReport" class="printContainer">
<table border="1" width="1035" cellspacing="0" :key="timeStamp" class="myTable" id="myTable">
<thead class="myTableHead">
<tr>
<th colspan="6">煤磨工段主要设备100KW以上单位产品电耗数据表</th>
</tr>
<tr>
<th>设备名称</th>
<th>设备编号</th>
<th>单位</th>
<th>上个小时</th>
<th>昨日</th>
<th>本月</th>
</tr>
</thead>
<tbody>
<tr v-for="item in tableDatas" :key="item">
<template v-for="(item1,ind) in item" :key="item1">
<td v-if="ind==0||ind==1||ind==2" class="numCell">{{item1}}</td>
<td v-if="ind==3" class="numCell hoursItem" @click="itemClick('hour_s',item1)">{{item1}}</td>
<td v-if="ind==4" class="numCell monthItem" @click="itemClick('day_s',item1)">{{item1}}</td>
<td v-if="ind==5" class="numCell yearItem" @click="itemClick('month_s',item1)">{{item1}}</td>
</template>
</tr>
</tbody>
</table>
<div class="chartWrap">
<div class="chartTitle">小时生产参数统计图</div>
<scEcharts height="400px" width="1033px" :option="optionHour"></scEcharts>
</div>
<div class="chartWrap">
<div class="chartTitle">本月生产参数统计图</div>
<scEcharts height="400px" width="1033px" :option="optionDay"></scEcharts>
</div>
<div class="chartWrap">
<div class="chartTitle">本年生产参数统计图</div>
<scEcharts height="400px" width="1033px" :option="optionMonth"></scEcharts>
</div>
</div>
</div>
<charts
v-if="asynDialog"
:type="type"
:title="title"
:cate="cate"
:apiObj = "apiObj"
:mgroup="query.mgroup"
:modelValue="modelValue"
:showClose="showClose"
:echartType='echartType'
@closed="asynDialog = false"
></charts>
</el-card>
</div>
</template>
<script>
const colors =['#647bfe','#8698fe','#a9b6fe','#cbd3fe','#91CC75','#EE6666'];
let tooltip= {
show: true,
trigger: 'axis',
axisPointer: {
type: 'cross'
},
confine:false,
showContent: true,
triggerOn:"mousemove",
// alwaysShowContent:true,
};
let grid={
right: '3%',
left:'7%',
top:'15%'
};
let toolbox={
right:'5%',
feature: {
dataView: { show: true, readOnly: false },
// restore: { show: true },
saveAsImage: { show: true }
}
};
let legend= {
top:'2%',
data:['煤磨排风机主电机', '煤磨主电机']
};
let yAxis= {
type: 'value',
name: '分布电耗(KW.h/t)',
alignTicks: true,
axisLine: {
show: true,
lineStyle: {
color: colors[3]
}
},
axisLabel: {
formatter: '{value}'
}
};
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,
optionHour:{},
optionDay:{},
optionMonth:{},
year:2023,
month:1,
days:1,
hours:1,
query: {
mgroup:'3347217512021835776',
},
tableName:'主要设备100KW以上单位产品电耗数据表',
tableDatas:[
['煤磨排风机主电机','','KW·h/t','','',''],
['煤磨主电机','','KW·h/t','','',''],
],
modelValue:true,
type:'hour_s',
title:'煤磨工段',
cate:'',
apiObj:this.$API.enm.mpoint.stat,
showClose:true,
echartType:'line',
asynDialog:false,
allValHour:0,
allValDays:0,
allValMonth:0,
option1:{
color: colors,
tooltip:tooltip,
grid: grid,
toolbox: toolbox,
legend:legend,
xAxis: {
axisTick: {
show: true,
length: 5,
inside: true,
},
data: []
},
yAxis:yAxis,
series:[
{
name: '煤磨排风机主电机',
type: 'bar',
data:[]
},
{
name: '煤磨主电机',
type: 'bar',
data: []
},
]
},
option2:{
color: colors,
tooltip:tooltip,
grid: grid,
toolbox: toolbox,
legend: legend,
xAxis: {
axisTick: {
show: true,
length: 5,
inside: true,
},
data: []
},
yAxis: yAxis,
series:[
{
name: '煤磨排风机主电机',
type: 'bar',
data:[]
},
{
name: '煤磨主电机',
type: 'bar',
data: []
},
]
},
option3:{
color: colors,
tooltip:tooltip,
grid: grid,
toolbox: toolbox,
legend: legend,
xAxis: {
axisTick: {
show: true,
length: 5,
inside: true,
},
data: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
},
yAxis: yAxis,
series:[
{
name: '煤磨排风机主电机',
type: 'bar',
data:[]
},
{
name: '煤磨主电机',
type: 'bar',
data: []
},
]
}
};
},
mounted() {
let that = this;
var myDate = new Date();
let year = myDate.getFullYear();
let month = myDate.getMonth()+1;
let days = myDate.getDate();
let hours = myDate.getHours();
let timeDate = myDate.getTime();
let dayTime = 24 * 60 * 60 * 1000;
//
let year_d = year,month_d = month,days_d = days;
if(hours<21){//21点前查找昨日数据为前一天数据
let newDate = timeDate- dayTime;
let lastDate = new Date(newDate);
year_d = lastDate.getFullYear();
month_d = lastDate.getMonth()+1;
days_d = lastDate.getDate();
}
//
let hourTime = timeDate - 3600000;
let hourDate = new Date(hourTime);
let year_h = hourDate.getFullYear();
let month_h = hourDate.getMonth()+1;
let days_h = hourDate.getDate();
let hours_h = hourDate.getHours();
//
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 hourProduct=that.allValMonth = res2[0].total_production;//
params2.mpoint__ep_monitored__power_kw__gte = 100;
this.$API.enm.mpoint.stat.req(params2).then((res) => {
let data2 = res;
for (let i = 0; i < data2.length; i++) {
that.tableDatas[i]=[];
that.tableDatas[i][0]=data2[i].ep_monitored_name;
that.tableDatas[i][1]=data2[i].ep_monitored_number;
that.tableDatas[i][2]='KW·h/t';
let val = hourProduct==0?'/':(data2[i].val/hourProduct).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 hourProduct=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 = hourProduct==0?'/':(data3[j].val/hourProduct).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: {
//
getHourData(){
let that = this;
let query = {};
query.page = 0;
query.year_s = that.year;
query.month_s = that.month;
query.day_s = that.days;
query.type = 'hour_s';
query.mgroup = that.query.mgroup;
query.mpoint__ep_monitored__power_kw__gte = 100;
this.$API.enm.mpoint.stat.req(query).then((response) => {
let seriesData0 = [],seriesData1 = [];
let data = response;
data.forEach(item => {
let ind = item.hour;
let val=0;
if(that.allValHour==0){
val = ''
}else{
val = (item.val/that.allValHour).toFixed(2);
}
if(item.equip_name=='煤磨排风机主电机'){
seriesData0[ind] = val;
}else if(item.equip_name=='煤磨主电机'){
seriesData1[ind] = val;
}
});
let options = {...that.option1};
options.series[0].data=seriesData0;
options.series[1].data=seriesData1;
let hourXAxis = [];
for (let i = 1; i <= that.hours; i++) {
let item = i+'时'
hourXAxis.push(item)
}
options.xAxis.data = hourXAxis;
that.optionHour = options;
})
},
//
getDayData(){
let that = this;
let query1 = {};
query1.page = 0;
query1.year_s = that.year;
query1.month_s = that.month;
query1.type = 'day_s';
query1.mgroup = this.query.mgroup;
query1.mpoint__ep_monitored__power_kw__gte = 100;
this.$API.enm.enstat.req(query1).then((response) => {
let seriesData0 = [],seriesData1 = [];
let data = response;
data.forEach(item => {
// debugger;
let ind = item.day_s;
let val=0;
if(that.allValDays==0){
val = ''
}else{
val = (item.val/that.allValDays).toFixed(2);
}
if(item.equip_name=='煤磨排风机主电机'){
seriesData0[ind] = val;
}else if(item.equip_name=='煤磨主电机'){
seriesData1[ind] = val;
}
});
let options = {...that.option2};
options.series[0].data=seriesData0;
options.series[1].data=seriesData1;
let dayXAxis = [];
for (let i = 1; i <= that.days; i++) {
let item = i+'日'
dayXAxis.push(item)
}
options.xAxis.data = dayXAxis;
that.optionDay = options;
})
},
//
getMonthData(){
let that = this;
let query2 = {};
query2.page = 0;
query2.year_s = that.year;
query2.type = 'month_s';
query2.mgroup = that.query.mgroup;
query2.mpoint__ep_monitored__power_kw__gte = 100;
this.$API.enm.enstat.req(query2).then((response) => {
let seriesData0 = [],seriesData1 = [];
let data = response;
data.forEach(item => {
let ind = item.month_s;
let val=0;
if(that.allValMonth==0){
val = ''
}else{
val = (item.val/that.allValMonth).toFixed(2);
}
if(item.equip_name=='煤磨排风机主电机'){
seriesData0[ind] = val;
}else if(item.equip_name=='煤磨主电机'){
seriesData1[ind] = val;
}
});
let options = {...that.option3};
options.series[0].data=seriesData0;
options.series[1].data=seriesData1;
let monthXAxis = [];
for (let i = 1; i <= that.month; i++) {
let item = i+'月'
monthXAxis.push(item)
}
options.xAxis.data = monthXAxis;
that.optionMonth = options;
})
},
itemClick(type,item){
this.type=type;
this.cate = item[0];
this.asynDialog = true;
},
handlePrint() {
this.$PRINT('#myReport');
},
exportExcel() {
this.exportLoading = true;
this.$XLSX('#myTable', this.tableName)
this.exportLoading = false;
},
}
};
</script>
<style scoped>
.printContainer{
padding-left: 20px;
}
</style>

View File

@ -0,0 +1,607 @@
<template>
<div class="app-container">
<el-header>
<div class="left-panel">
<el-button
type="primary"
@click="exportExcel()"
:loading = "exportLoading"
>导出xlsx
</el-button>
<el-button
type="primary"
@click="handlePrint"
>打印
</el-button>
</div>
</el-header>
<el-card style="margin-top:5px">
<div class="printWrap">
<div ref="print" id="myReport" class="printContainer">
<table border="1" width="1035" cellspacing="0" :key="timeStamp" id="myTable" class="myTable">
<thead class="myTableHead">
<tr>
<th colspan="10">煤磨工段生产报告</th>
</tr>
<tr>
<th colspan="2">参数</th>
<th>上个小时</th>
<th>昨日</th>
<th>本月</th>
<th>本年</th>
<th>月目标值</th>
<th>月完成度</th>
<th>年目标值</th>
<th>年完成度</th>
</tr>
</thead>
<tbody>
<tr v-for="(item,index) in tableDatas" :key="item">
<td class="numCell" v-if="index==0||index==2" rowspan="2">{{item[0]}}</td>
<td class="numCell" v-else-if="index==4">{{item[0]}}</td>
<td class="numCell">{{item[1]}}</td>
<td class="numCell hoursItem" @click="itemClick('hour_s',item)">{{item[2]}}</td>
<td class="numCell daysItem" @click="itemClick('day_s',item)">{{item[3]}}</td>
<td class="numCell monthItem" @click="itemClick('month_s',item)">{{item[4]}}</td>
<td class="numCell yearItem" @click="itemClick('year_s',item)">{{item[5]}}</td>
<td class="numCell">{{item[6]}}</td>
<td class="numCell">{{item[7]}}</td>
<td class="numCell">{{item[8]}}</td>
<td class="numCell">{{item[9]}}</td>
</tr>
</tbody>
</table>
<div class="chartWrap">
<div class="chartTitle">小时生产参数统计图</div>
<scEcharts height="400px" width="1033px" :option="optionHour"></scEcharts>
</div>
<div class="chartWrap">
<div class="chartTitle">本月生产参数统计图</div>
<scEcharts height="400px" width="1033px" :option="optionDay"></scEcharts>
</div>
<div class="chartWrap">
<div class="chartTitle">本年生产参数统计图</div>
<scEcharts height="400px" width="1033px" :option="optionMonth"></scEcharts>
</div>
</div>
</div>
<charts
v-if="asynDialog"
:type="type"
:title="title"
:cate="cate"
:apiObj = "apiObj"
:mgroup="query.mgroup"
:modelValue="modelValue"
:showClose="showClose"
:echartType='echartType'
@closed="asynDialog = false"
></charts>
</el-card>
</div>
</template>
<script>
const colors =['#647bfe','#8698fe','#a9b6fe','#91CC75','#EE6666'];
let tooltip= {
show: true,
trigger: 'axis',
axisPointer: {
type: 'cross'
},
confine:false,
showContent: true,
triggerOn:"mousemove",
};
let grid={
right: '8%',
left:'4%',
top:'15%'
};
let toolbox={
right:'2%',
feature: {
dataView: { show: true, readOnly: false },
// restore: { show: true },
saveAsImage: { show: true }
}
};
let legend= {
top:'2%',
data:['总产量', '台时产量', '运转率', '分布电耗']
};
let yAxis= [{
type: 'value',
name: '产量 (t)',
position: 'left',
alignTicks: true,
axisLine: {
show: true,
lineStyle: {
color: colors[0]
}
},
axisLabel: {
formatter: '{value}'
}
},
{
type: 'value',
name: '运转率 (%)',
position: 'right',
alignTicks: true,
offset: 80,
axisLine: {
show: true,
lineStyle: {
color: colors[2]
}
},
axisLabel: {
formatter: '{value}'
}
},
{
type: 'value',
name: '分布电耗(KW.h)',
position: 'right',
alignTicks: true,
axisLine: {
show: true,
lineStyle: {
color: colors[3]
}
},
axisLabel: {
formatter: '{value}'
}
}
];
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,
optionHour:{},
optionDay:{},
optionMonth:{},
year:2023,
month:1,
days:1,
hours:1,
query: {
mgroup:'3347217512021835776',
},
tableDatas:[
['产量','总产量t',0,0,0,0,0,0,0,0],
['产量','台时产量t/h','/',0,0,0,0,0,0,0],
['运转时间','运转时间h','/',0,0,0,0,0,0,0],
['运转时间','运转率(%','/',0,0,0,0,0,0,0],
['能耗','煤磨分布电耗KW·h/t',0,0,0,0,0,0,0,0],
],
tableName:'生产报告',
modelValue:true,
type:'hour_s',
title:'煤磨工段',
cate:'',
apiObj:this.$API.enm.enstat,
showClose:true,
echartType:'line',
asynDialog:false,
option1:{
color: colors,
tooltip:tooltip,
grid: grid,
toolbox: toolbox,
legend:legend,
xAxis: {
axisTick: {
show: true,
length: 5,
inside: true,
// alignWithLabel: true
},
data: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
},
yAxis:yAxis,
series:[
{
name: '总产量',
type: 'bar',
yAxisIndex:0,
data:[]
},
{
name: '台时产量',
type: 'bar',
yAxisIndex:0,
data: []
},
{
name: '运转率',
type: 'line',
yAxisIndex: 1,
data: []
},
{
name: '分布电耗',
type: 'bar',
yAxisIndex: 2,
data: []
},
]
},
option2:{
color: colors,
tooltip:tooltip,
grid: grid,
toolbox: toolbox,
legend: legend,
xAxis: {
axisTick: {
show: true,
length: 5,
inside: true,
// alignWithLabel: true
},
data: []
},
yAxis: yAxis,
series:[
{
name: '总产量',
type: 'bar',
yAxisIndex:0,
data:[]
},
{
name: '台时产量',
type: 'bar',
yAxisIndex:0,
data: []
},
{
name: '运转率',
type: 'line',
yAxisIndex: 1,
data: []
},
{
name: '分布电耗',
type: 'bar',
yAxisIndex: 2,
data: []
},
]
},
option3:{
color: colors,
tooltip:tooltip,
grid: grid,
toolbox: toolbox,
legend: legend,
xAxis: {
axisTick: {
show: true,
length: 5,
inside: true,
},
data: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
},
yAxis: yAxis,
series: [
{
name: '总产量',
type: 'bar',
yAxisIndex:0,
data: []
},
{
name: '台时产量',
type: 'bar',
yAxisIndex:0,
data: []
},
{
name: '运转率',
type: 'line',
yAxisIndex: 1,
data: []
},
{
name: '分布电耗',
type: 'bar',
yAxisIndex: 2,
data: []
},
]
}
};
},
mounted() {
function precen(a,b){
if(b!==0&&b!==null&&a!==null){
let precen = (a/b).toFixed(2)
return precen*100+'%'
}else{
return '/'
}
}
let that = this;
var myDate = new Date();
let year =that.year = myDate.getFullYear();
let month = that.month = myDate.getMonth()+1;
let days = that.days = myDate.getDate();
let hours = that.hours = myDate.getHours();
let timeDate = myDate.getTime();
let dayTime = 24 * 60 * 60 * 1000;
//
let year_d = year,month_d = month,days_d = days;
if(hours<21){//21点前查找昨日数据为前一天数据
let newDate = timeDate- dayTime;
let lastDate = new Date(newDate);
year_d = lastDate.getFullYear();
month_d = lastDate.getMonth()+1;
days_d = lastDate.getDate();
}
//
let hourTime = timeDate - 3600000;
let hourDate = new Date(hourTime);
let year_h = hourDate.getFullYear();
let month_h = hourDate.getMonth()+1;
let days_h = hourDate.getDate();
let hours_h = hourDate.getHours();
//
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 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;
}
})
//
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;
}
})
//
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;
}
})
}
}).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])
}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.getHourData();
that.getDayData();
that.getMonthData();
},
methods: {
//
getHourData(){
let that = this;
let query = {};
query.page = 0;
query.year_s = that.year;
query.month_s = that.month;
query.day_s = that.days;
query.type = 'hour_s';
query.mgroup = that.query.mgroup;
this.$API.enm.enstat.req(query).then((response) => {
// debugger;
let seriesData0 = [],seriesData1 = [], seriesData2 = [],seriesData3 = [];
let data = response;
data.forEach(item => {
let ind = item.hour;
seriesData0[ind] = item.total_production;//
seriesData1[ind] = item.production_hour;//
seriesData2[ind] = item.run_rate;//
seriesData3[ind] = item.elec_consume_unit;//
});
let options = {...that.option1};
options.series[0].data=seriesData0;
options.series[1].data=seriesData1;
options.series[2].data=seriesData2;
options.series[3].data=seriesData3;
let hourXAxis = [];
for (let i = 1; i <= that.hours; i++) {
let item = i+'时'
hourXAxis.push(item)
}
options.xAxis.data = hourXAxis;
that.optionHour = options;
})
},
//
getDayData(){
let that = this;
let query1 = {};
query1.page = 0;
query1.year_s = that.year;
query1.month_s = that.month;
query1.type = 'day_s';
query1.mgroup = this.query.mgroup;
this.$API.enm.enstat.req(query1).then((response) => {
let seriesData0 = [],seriesData1 = [], seriesData2 = [],seriesData3 = [];
// debugger;
console.log(response)
let data = response;
data.forEach(item => {
// debugger;
let ind = item.day_s;
seriesData0[ind] = item.total_production;
seriesData1[ind] = item.production_hour;
seriesData2[ind] = item.run_rate;
seriesData3[ind] = item.elec_consume_unit;
});
let options = {...that.option2};
options.series[0].data=seriesData0;
options.series[1].data=seriesData1;
options.series[2].data=seriesData2;
options.series[3].data=seriesData3;
let dayXAxis = [];
for (let i = 1; i <= that.days; i++) {
let item = i+'日'
dayXAxis.push(item)
}
options.xAxis.data = dayXAxis;
that.optionDay = options;
})
},
//
getMonthData(){
let that = this;
let query2 = {};
query2.page = 0;
query2.year_s = that.year;
query2.type = 'month_s';
query2.mgroup = that.query.mgroup;
this.$API.enm.enstat.req(query2).then((response) => {
// debugger;
let seriesData0 = [],seriesData1 = [], seriesData2 = [],seriesData3 = [];
console.log(response)
let data = response;
data.forEach(item => {
let ind = item.month_s;
seriesData0[ind] = item.total_production;
seriesData1[ind] = item.production_hour;
seriesData2[ind] = item.run_rate;
seriesData3[ind] = item.elec_consume_unit;
});
let options = {...that.option3};
options.series[0].data=seriesData0;
options.series[1].data=seriesData1;
options.series[2].data=seriesData2;
options.series[3].data=seriesData3;
let monthXAxis = [];
for (let i = 1; i <= that.month; i++) {
let item = i+'月'
monthXAxis.push(item)
}
options.xAxis.data = monthXAxis;
that.optionMonth = options;
})
},
itemClick(type,item){
this.type=type;
this.cate=item[1];
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>
.printContainer{
padding-left: 20px;
}
</style>

View File

@ -0,0 +1,245 @@
<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"
cellspacing="0"
:key="timeStamp"
id="myTable"
class="myTable"
width="1200"
>
<thead class="myTableHead">
<tr>
<th colspan="12">煤磨工段班组月度对比分析</th>
</tr>
<tr>
<th rowspan="2">月份</th>
<th rowspan="2">班组</th>
<th rowspan="2">总产量t</th>
<th rowspan="2">台时产量t/h</th>
<th rowspan="2">运转率%</th>
<th colspan="7">单位产品电耗</th>
</tr>
<tr>
<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>
</tr>
</thead>
<tr v-for="(item, index) in tableDatas" :key="index">
<td
v-for="(item0, index0) in item"
:key="index0"
class="numCell"
>
{{ item0 }}
</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: "3347217512021835776",
},
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 = that.query.mgroup;
let wrapArr = [],
wrapArr0 = [],
wrapArrs = [];
this.$API.enm.enstat.req(query0).then((res0) => {
let data0 = res0;
if (data0.length > 0) {
data0.forEach((item0) => {
//
let 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);
let keyVale = "goal_val_" + n;
arr[5] = item.elec_consume_unit; //KW·h/t
arr[6] = goalData[keyVale]; //KW·h/t//
arr[7] = item.celec_consume_unit - arr[10]; //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[8] = huanqi; //KW·h/t
if (huanqi !== "/") {
huanqicha = item.celec_consume_unit - huanqi;
} else {
huanqicha = item.celec_consume_unit;
}
arr[9] = huanqicha; //KW·h/t
arr[10] =
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[11] = tongqi; //%
arr[12] = 0; //%
wrapArr[ind] = arr;
});
console.log(wrapArr);
that.tableDatas = wrapArr;
} 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>

View File

@ -0,0 +1,275 @@
<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="1075" cellspacing="0" :key="timeStamp" id="myTable" class="myTable">
<thead class="myTableHead">
<tr>
<th colspan="8">煤磨工段车间单位产品电耗月度分析表</th>
</tr>
<tr>
<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>环比增长率%</th>
<th>同比增长率%</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==3"></span>
<span v-if="item1<0&&ind==3"></span>
<span v-if="item1<0&&ind==5"></span>
<span v-if="item1<0&&ind==5"></span>
{{item1}}
</div>
</td>
</tr>
</tbody>
</table>
</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:{
year_s:'',
mgroup:'3347217512021835776',
},
monthGoal:[],
tableDatas:[],
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;
}
})
this.getData();
}else{
this.getData();
}
})
},
methods: {
// Class
bindClass(item,index){
let classInfo = { redColor: false, greenColor: false }
if(index==3||index==5){
if( typeof(item)=='number'){
if(item>0){
classInfo.greenColor = true;
classInfo.redColor = false;
}else if(item<0){
classInfo.redColor = true;
classInfo.greenColor = false
}
}
}
return classInfo
},
getData(){
let that = this;
let query0={};
query0.page = 0;
query0.type='month_s';
query0.year_s = that.query.year_s-1;
query0.mgroup=that.query.mgroup;
let wrapArr = [],wrapArr0 = [] ,wrapArrs = [];
this.$API.enm.enstat.req(query0).then((res0) => {
let data0 = res0;
if(data0.length>0){
data0.forEach(item0 => {
//
let ind0 = item0.month_s;
wrapArr0[ind0] = item0;
});
}
let query={};
query.page = 0;
query.type='month_s';
query.year_s = that.query.year_s;
query.mgroup=that.query.mgroup;
that.$API.enm.enstat.req(query).then((res) => {
let data = res;
if(data.length>0){
data.forEach(item => {
//
let ind = item.month_s;
let arr = [];
let time = ''+item.year_s+'.'+item.month_s;
arr.push(time);
arr.push(item.elec_consume_unit);//KW·h/t
arr[2] = that.monthGoal[ind]!==undefined?that.monthGoal[ind]:'/';
wrapArr[ind] = arr;
});
wrapArr.forEach((item,index)=>{
let arrs = [];
arrs[0]=item[0];
arrs[1]=item[1];
arrs[2]=item[2];
//KW·h/t//
//KW·h/t
let diff = 0;
if(item[2]!=='/'){
diff = item[1]-item[2];
}else{
diff = '/';
}
arrs[3]=diff;
//KW·h/t
let lastNum = 0;
if(index>1){
let num = index-1;
if(wrapArr[num]&&wrapArr[num].elec_consume_unit){
lastNum = wrapArr[num].elec_consume_unit;
}else{
lastNum='/'
}
}else{
lastNum = wrapArr0[12]?wrapArr0[12].elec_consume_unit:'/';
}
arrs[4]=lastNum;
//KW·h/t
let lastDiff = 0;
if(arrs[1]!=='/'&&arrs[4]!=='/'){
lastDiff =arrs[1]- arrs[4];
}else{
lastDiff = '/';
}
arrs[5]=lastDiff;
//%
let lastRate = 0;
if(lastDiff=='/'&&lastNum!=='/'&&lastNum!==0){
lastRate = (lastDiff/lastNum)*100;
}else{
lastRate = '/'
}
arrs[6]=lastRate;
//%-wrapArr0[ind].elec_consume_unit
let sameRate =0;
if(wrapArr0[index]&&wrapArr0[index].elec_consume_unit){
sameRate =((arrs[1]- wrapArr0[index].elec_consume_unit)/wrapArr0[index].elec_consume_unit)*100
}else{
sameRate='/';
}
arrs[7]=sameRate;
wrapArrs.push(arrs);
})
that.tableDatas = wrapArrs;
}else{
}
})
})
},
itemClick(type,item){
this.type=type;
this.asynDialog = true;
},
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>

View File

@ -0,0 +1,354 @@
<!-- 全厂电量统计 -->
<template>
<div class="app-container">
<el-header>
<div class="left-panel">
<el-date-picker
v-model="search_date"
type="month"
value-format="YYYY-MM"
format="YYYY-MM"
placeholder="月"
style="margin-right: 6px;"
@change="dateChange"
/>
<el-button
type="primary"
icon="el-icon-search"
@click="getTableData"
></el-button>
<el-button
type="primary"
@click="exportExcel()"
:loading = "exportLoading"
>导出xlsx
</el-button>
<el-button
type="primary"
@click="handlePrint"
>打印
</el-button>
</div>
</el-header>
<el-card style="margin-top:5px">
<div class="printWrap">
<div ref="print" id="myReport" class="printContainer">
<table border="1" width="3300" cellspacing="0" :key="timeStamp" id="myTable" class="myTable">
<thead class="myTableHead">
<tr>
<th :colspan="headerLength">全厂电量日统计</th>
</tr>
<tr>
<th>车间</th>
<th>工段</th>
<th>设备</th>
<th v-for="item in days" :key="item">{{ item }}</th>
</tr>
</thead>
<tr v-for="(item,index) in tableDatas" :key="index">
<td class="numCell" v-if="index==0" rowspan="9">{{item[0]}}</td>
<td class="numCell" v-else-if="index==9" rowspan="18">{{item[0]}}</td>
<td class="numCell" v-else-if="index==27" rowspan="12">{{item[0]}}</td>
<td class="numCell" v-else-if="index==39" rowspan="10" colspan="2">{{item[0]}}</td>
<td class="numCell" v-else-if="index==49" colspan="3">{{item[0]}}</td>
<td class="numCell" v-if="index==8||index==26||index==37||index==38" colspan="2">{{item[1]}}</td>
<td class="numCell" v-else-if="index==0" rowspan="2">{{item[1]}}</td>
<td class="numCell" v-else-if="index==2" rowspan="6">{{item[1]}}</td>
<td class="numCell" v-else-if="index==9" rowspan="14">{{item[1]}}</td>
<td class="numCell" v-else-if="index==23" rowspan="3">{{item[1]}}</td>
<td class="numCell" v-else-if="index==27" rowspan="10">{{item[1]}}</td>
<td class="numCell" v-else>{{item[1]}}</td>
<td class="numCell">{{item[2]}}</td>
<template v-for="day in days" :key="day">
<td class="numCell" v-if="item[day+2]!==null&&item[day+2]!==undefined">{{item[day+2]}}</td>
</template>
</tr>
</table>
</div>
</div>
</el-card>
</div>
</template>
<script>
export default {
data() {
return {
year:'',
month:'',
days:'',
search_date:'',
headerLength:33,
tableDatas:[
['原料车间','电石渣','烘干破主电机'],//0
['原料车间','电石渣合计'],
['原料车间','原料磨','反击式破碎机'],//2
['原料车间','立磨主电机'],
['原料车间','循环风机'],
['原料车间','废气风机'],//5
['原料车间','尾排风机'],
['原料车间','原料磨合计'],
['原料车间','原料车间合计'],//8
['烧成车间','回转窑','高温风机'],//9
['烧成车间','窑主电机'],//10
['烧成车间','篦冷机一室风机电机'],
['烧成车间','篦冷机三室风机电机'],
['烧成车间','篦冷机二室风机电机'],
['烧成车间','篦冷机一室充气梁风机(左)'],
['烧成车间','篦冷机一室充气梁风机(右)'],//15
['烧成车间','窑头排风机主电机'],
['烧成车间','头煤粉罗茨电机(东、备用)'],
['烧成车间','尾煤粉罗茨电机(西)'],
['烧成车间','空压机3301'],
['烧成车间','空压机3308'],//20
['烧成车间','空压机3318'],//21
['烧成车间','回转窑合计'],
['烧成车间','煤磨','煤磨主电机'],
['烧成车间','煤磨排风机主电机'],
['烧成车间','煤磨合计'],//25
['烧成车间','烧成车间合计'],//26
['水泥车间','水泥磨','循环风机1906'],//27
['水泥车间','系统风机'],
['水泥车间','水平涡流选粉机1915'],
['水泥车间','水泥磨主电机'],//30
['水泥车间','辊压机动辊电机'],
['水泥车间','辊压机定辊电机'],
['水泥车间','新增磨尾风机'],
['水泥车间','水泥1#空压机'],
['水泥车间','水泥2#空压机'],//35
['水泥车间','水泥磨合计计'],
['水泥车间','水泥包装合计'],//37
['水泥车间','水泥车间合计'],//38
['生活区','食堂'],//39
['生活区','单元楼'],//40
['生活区','单身宿舍'],
['生活区','办公楼'],
['生活区','余热锅炉'],
['生活区','污水站'],
['生活区','南门办公区'],//45
['生活区','东门办公区'],
['生活区','地磅'],
['生活区','生活区合计'],
['全厂电量']
],
tableName:'全厂电量日统计',
sourceData:{}
};
},
mounted() {
let that = this;
var nowDate = new Date();
that.year = nowDate.getFullYear();
that.month = nowDate.getMonth()+1;
that.days = new Date(that.year,that.month,0).getDate();
let month0 = that.month>9?that.month :'0'+that.month ;
that.search_date = that.year+'-'+month0;
that.headerLength = that.days+3;
let tableDatas = that.tableDatas;
this.$nextTick(()=>{
for (let i = 0; i < tableDatas.length; i++) {
for (let j = 0; j < that.days; j++) {
let k = 0;
if(i==0||i==2||i==9||i==23||i==27){
k = 3+j;
}else{
k = 2+j;
}
that.tableDatas[i].push(0);
this.$forceUpdate();
}
}
})
// that.$set(that.$data,'tableDatas',tableDatas);
this.getData();
},
methods: {
dateChange(e){
let that = this;
let arr = e.split('-')
that.year = Number(arr[0]);
that.month = Number(arr[1]);
},
getData(){
let that = this;
function dataPush(name,value){
let index=0;
if(name=='烘干破主电机'){
index=0;
that.tableDatas[0][3] = value;
}else if(name=='电石渣合计'){
index=1;
that.tableDatas[1][2] = value;
}else if(name=='反击式破碎机'){
index=2;
}else if(name=='立磨主电机'){
index=3;
}else if(name=='循环风机'){
index=4;
}else if(name=='废气风机'){
index=5;
}else if(name=='尾排风机'){
index=6;
}else if(name=='原料磨合计'){
index=7;
}else if(name=='高温风机'){
index=9;
}else if(name=='窑主电机'){
index=10;
}else if(name=='篦冷机一室风机电机'){
index=11;
}else if(name=='篦冷机三室风机电机'){
index=12;
}else if(name=='篦冷机二室风机电机'){
index=13;
}else if(name=='篦冷机一室充气梁风机(左)'){
index=14;
}else if(name=='篦冷机一室充气梁风机(右)'){
index=15;
}else if(name=='窑头排风机主电机'){
index=16;
}else if(name=='头煤粉罗茨电机(东、备用)'){
index=17;
}else if(name=='尾煤粉罗茨电机(西)'){
index=18;
}else if(name=='空压机3301'){
index=19;
}else if(name=='空压机3308'){
index=20;
}else if(name=='空压机3318'){
index=21;
}else if(name=='回转窑合计'){
index=22;
}else if(name=='煤磨主电机'){
index=23;
}else if(name=='煤磨排风机主电机'){
index=24;
}else if(name=='煤磨合计'){
index=25;
}else if(name=='循环风机1906'){
index=27;
}else if(name=='系统风机'){
index=28;
}else if(name=='水平涡流选粉机1915'){
index=29;
}else if(name=='水泥磨主电机'){
index=30;
}else if(name=='辊压机动辊电机'){
index=31;
}else if(name=='辊压机定辊电机'){
index=32;
}else if(name=='新增磨尾风机'){
index=33;
}else if(name=='水泥1#空压机'){
index=34;
}else if(name=='水泥2#空压机'){
index=35;
}else if(name=='水泥磨合计计'){
index=36;
}else if(name=='水泥包装合计'){
index=37;
}else if(name=='食堂'){
index=39;
}else if(name=='单元楼'){
index=40;
}else if(name=='单身宿舍'){
index=41;
}else if(name=='办公楼'){
index=42;
}else if(name=='余热锅炉'){
index=43;
}else if(name=='污水站'){
index=44;
}else if(name=='南门办公区'){
index=45;
}else if(name=='东门办公区'){
index=46;
}else if(name=='生活区合计'){
index=47;
}else if(name=='地磅'){
index=48;
}
return index;
}
function sumNum(a,b,c,d){
let sum = 0;
if(a&&Number(a)){sum=sum+Number(a);}
if(b&&Number(b)){sum=sum+Number(b);}
if(c&&Number(c)){sum=sum+Number(c);}
if(d&&Number(d)){sum=sum+Number(d);}
return sum;
}
let obj = {};
obj.type='day_s';
obj.year_s = that.year;
obj.month_s = that.month;
obj.page = 0;
obj.mpoint__ep_monitored__power_kw__gte=100;
this.$API.enm.mpoint.stat.req(obj).then((res) => {
let wrapArr = [],innerArr=[];
res.forEach(item=>{
let day = item.day_s;
if(wrapArr[day]){
wrapArr[day].push(day)
}else{
wrapArr[day]=[];
wrapArr[day].push(day);
}
})
wrapArr.forEach((inner,inde)=>{
inner.forEach(item=>{
let i = dataPush(item.mpoint_name);
let k = 0;
if(i==0||i==2||i==9||i==23||i==27){
k = 3+inde;
}else{
k = 2+inde;
}
that.tableDatas[i][k] = item.val;
})
})
for(let k = 0;k<that.days;k++){
let m = k+2;
let n = k+1;
that.tableDatas[8][m] = sumNum(that.tableDatas[1][m],that.tableDatas[7][m]);
that.tableDatas[26][m] = sumNum(that.tableDatas[22][m],that.tableDatas[25][m]);
that.tableDatas[38][m] = sumNum(that.tableDatas[36][m],that.tableDatas[37][m]);
that.tableDatas[49][n] = sumNum(that.tableDatas[8][m],that.tableDatas[26][m]+ that.tableDatas[38][m]+ that.tableDatas[48][m]);
}
})
},
getTableData(){
for(let i=0;i<this.tableDatas.length;i++){
let k = 0;
if(i==0||i==2||i==9||i==23||i==27){
k = 3;
}else if(i==49){
k = 1;
}else{
k = 2;
}
for (let j = k; j < this.tableDatas[i].length; j++) {
this.tableDatas[i][j]=0;
}
}
this.getData();
},
exportExcel() {
this.exportLoading = true;
this.$XLSX('#myTable', this.tableName)
this.exportLoading = false;
},
handlePrint() {
this.$PRINT('#myReport');
},
}
};
</script>
<style scoped>
.printWrap{
width: 100%;
overflow-x: scroll;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,339 @@
<!-- 全厂电量统计 -->
<template>
<div class="app-container">
<el-header>
<div class="left-panel">
<el-date-picker
v-model="search_date"
type="year"
value-format="YYYY"
format="YYYY"
placeholder="年"
style="margin-right: 6px;"
@change="dateChange"
/>
<el-button
type="primary"
icon="el-icon-search"
@click="getTableData"
></el-button>
<el-button
type="primary"
@click="exportExcel()"
:loading = "exportLoading"
>导出xlsx
</el-button>
<el-button
type="primary"
@click="handlePrint"
>打印
</el-button>
</div>
</el-header>
<el-card style="margin-top:5px">
<div class="printWrap">
<div ref="print" id="myReport" class="printContainer">
<table border="1" width="1500" cellspacing="0" :key="timeStamp" id="myTable" class="myTable">
<thead class="myTableHead">
<tr>
<th colspan="15">全厂电量月统计</th>
</tr>
<tr>
<th>车间</th>
<th>工段</th>
<th>设备</th>
<th v-for="month in 12" :key="month">{{month}}</th>
</tr>
</thead>
<tr v-for="(item,index) in tableDatas" :key="index">
<td class="numCell" v-if="index==0" rowspan="9">{{item[0]}}</td>
<td class="numCell" v-else-if="index==9" rowspan="18">{{item[0]}}</td>
<td class="numCell" v-else-if="index==27" rowspan="12">{{item[0]}}</td>
<td class="numCell" v-else-if="index==39" rowspan="10" colspan="2">{{item[0]}}</td>
<td class="numCell" v-else-if="index==49" colspan="3">{{item[0]}}</td>
<td class="numCell" v-if="index==8||index==26||index==37||index==38" colspan="2">{{item[1]}}</td>
<td class="numCell" v-else-if="index==0" rowspan="2">{{item[1]}}</td>
<td class="numCell" v-else-if="index==2" rowspan="6">{{item[1]}}</td>
<td class="numCell" v-else-if="index==9" rowspan="14">{{item[1]}}</td>
<td class="numCell" v-else-if="index==23" rowspan="3">{{item[1]}}</td>
<td class="numCell" v-else-if="index==27" rowspan="10">{{item[1]}}</td>
<td class="numCell" v-else>{{item[1]}}</td>
<td class="numCell">{{item[2]}}</td>
<td class="numCell">{{item[3]}}</td>
<td class="numCell">{{item[4]}}</td>
<td class="numCell">{{item[5]}}</td>
<td class="numCell">{{item[6]}}</td>
<td class="numCell">{{item[7]}}</td>
<td class="numCell">{{item[8]}}</td>
<td class="numCell">{{item[9]}}</td>
<td class="numCell">{{item[10]}}</td>
<td class="numCell">{{item[11]}}</td>
<td class="numCell">{{item[12]}}</td>
<td class="numCell" v-if="item[13]!==null&&item[13]!==undefined">{{item[13]}}</td>
<td class="numCell" v-if="item[14]!==null&&item[14]!==undefined">{{item[14]}}</td>
</tr>
</table>
</div>
</div>
</el-card>
</div>
</template>
<script>
export default {
data() {
return {
year:'',
search_date:'',
tableDatas:[
['原料车间','电石渣','烘干破主电机',0,0,0,0,0,0,0,0,0,0,0,0],//0
['原料车间','电石渣合计',0,0,0,0,0,0,0,0,0,0,0,0],
['原料车间','原料磨','反击式破碎机',0,0,0,0,0,0,0,0,0,0,0,0],//2
['原料车间','立磨主电机',0,0,0,0,0,0,0,0,0,0,0,0],
['原料车间','循环风机',0,0,0,0,0,0,0,0,0,0,0,0],
['原料车间','废气风机' ,0,0,0,0,0,0,0,0,0,0,0,0],//5
['原料车间','尾排风机',0,0,0,0,0,0,0,0,0,0,0,0],
['原料车间','原料磨合计' ,0,0,0,0,0,0,0,0,0,0,0,0],
['原料车间','原料车间合计',0,0,0,0,0,0,0,0,0,0,0,0],//8
['烧成车间','回转窑','高温风机',0,0,0,0,0,0,0,0,0,0,0,0],//9
['烧成车间','窑主电机',0,0,0,0,0,0,0,0,0,0,0,0],//10
['烧成车间','篦冷机一室风机电机',0,0,0,0,0,0,0,0,0,0,0,0],
['烧成车间','篦冷机三室风机电机',0,0,0,0,0,0,0,0,0,0,0,0],
['烧成车间','篦冷机二室风机电机',0,0,0,0,0,0,0,0,0,0,0,0],
['烧成车间','篦冷机一室充气梁风机(左)',0,0,0,0,0,0,0,0,0,0,0,0],
['烧成车间','篦冷机一室充气梁风机(右)',0,0,0,0,0,0,0,0,0,0,0,0],//15
['烧成车间','窑头排风机主电机',0,0,0,0,0,0,0,0,0,0,0,0],
['烧成车间','头煤粉罗茨电机(东、备用)',0,0,0,0,0,0,0,0,0,0,0,0],
['烧成车间','尾煤粉罗茨电机(西)',0,0,0,0,0,0,0,0,0,0,0,0],
['烧成车间','空压机3301',0,0,0,0,0,0,0,0,0,0,0,0],
['烧成车间','空压机3308',0,0,0,0,0,0,0,0,0,0,0,0],//20
['烧成车间','空压机3318',0,0,0,0,0,0,0,0,0,0,0,0],//21
['烧成车间','回转窑合计',0,0,0,0,0,0,0,0,0,0,0,0],
['烧成车间','煤磨','煤磨主电机',0,0,0,0,0,0,0,0,0,0,0,0],
['烧成车间','煤磨排风机主电机',0,0,0,0,0,0,0,0,0,0,0,0],
['烧成车间','煤磨合计',0,0,0,0,0,0,0,0,0,0,0,0],//25
['烧成车间','烧成车间合计',0,0,0,0,0,0,0,0,0,0,0,0],//26
['水泥车间','水泥磨','循环风机1906',0,0,0,0,0,0,0,0,0,0,0,0],//27
['水泥车间','系统风机',0,0,0,0,0,0,0,0,0,0,0,0],
['水泥车间','水平涡流选粉机1915',0,0,0,0,0,0,0,0,0,0,0,0],
['水泥车间','水泥磨主电机',0,0,0,0,0,0,0,0,0,0,0,0],//30
['水泥车间','辊压机动辊电机',0,0,0,0,0,0,0,0,0,0,0,0],
['水泥车间','辊压机定辊电机',0,0,0,0,0,0,0,0,0,0,0,0],
['水泥车间','新增磨尾风机',0,0,0,0,0,0,0,0,0,0,0,0],
['水泥车间','水泥1#空压机',0,0,0,0,0,0,0,0,0,0,0,0],
['水泥车间','水泥2#空压机',0,0,0,0,0,0,0,0,0,0,0,0],//35
['水泥车间','水泥磨合计计',0,0,0,0,0,0,0,0,0,0,0,0],
['水泥车间','水泥包装合计',0,0,0,0,0,0,0,0,0,0,0,0],//37
['水泥车间','水泥车间合计',0,0,0,0,0,0,0,0,0,0,0,0],//38
['生活区','食堂',0,0,0,0,0,0,0,0,0,0,0,0],//39
['生活区','单元楼',0,0,0,0,0,0,0,0,0,0,0,0],//40
['生活区','单身宿舍',0,0,0,0,0,0,0,0,0,0,0,0],
['生活区','办公楼',0,0,0,0,0,0,0,0,0,0,0,0],
['生活区','余热锅炉',0,0,0,0,0,0,0,0,0,0,0,0],
['生活区','污水站',0,0,0,0,0,0,0,0,0,0,0,0],
['生活区','南门办公区',0,0,0,0,0,0,0,0,0,0,0,0],//45
['生活区','东门办公区',0,0,0,0,0,0,0,0,0,0,0,0],
['生活区','地磅',0,0,0,0,0,0,0,0,0,0,0,0],
['生活区','生活区合计',0,0,0,0,0,0,0,0,0,0,0,0],
['全厂电量',0,0,0,0,0,0,0,0,0,0,0,0]
],
tableName:'全厂电量月统计',
sourceData:{}
};
},
mounted() {
let that = this;
var nowDate = new Date();
that.year = nowDate.getFullYear();
that.search_date = that.year+'';
this.getData();
},
methods: {
dateChange(e){
let that = this;
that.year = Number(e);
},
getData(){
let that = this;
function dataPush(name,value){
let index=0;
if(name=='烘干破主电机'){
index=0;
that.tableDatas[0][3] = value;
}else if(name=='电石渣合计'){
index=1;
that.tableDatas[1][2] = value;
}else if(name=='反击式破碎机'){
index=2;
}else if(name=='立磨主电机'){
index=3;
}else if(name=='循环风机'){
index=4;
}else if(name=='废气风机'){
index=5;
}else if(name=='尾排风机'){
index=6;
}else if(name=='原料磨合计'){
index=7;
}else if(name=='高温风机'){
index=9;
}else if(name=='窑主电机'){
index=10;
}else if(name=='篦冷机一室风机电机'){
index=11;
}else if(name=='篦冷机三室风机电机'){
index=12;
}else if(name=='篦冷机二室风机电机'){
index=13;
}else if(name=='篦冷机一室充气梁风机(左)'){
index=14;
}else if(name=='篦冷机一室充气梁风机(右)'){
index=15;
}else if(name=='窑头排风机主电机'){
index=16;
}else if(name=='头煤粉罗茨电机(东、备用)'){
index=17;
}else if(name=='尾煤粉罗茨电机(西)'){
index=18;
}else if(name=='空压机3301'){
index=19;
}else if(name=='空压机3308'){
index=20;
}else if(name=='空压机3318'){
index=21;
}else if(name=='回转窑合计'){
index=22;
}else if(name=='煤磨主电机'){
index=23;
}else if(name=='煤磨排风机主电机'){
index=24;
}else if(name=='煤磨合计'){
index=25;
}else if(name=='循环风机1906'){
index=27;
}else if(name=='系统风机'){
index=28;
}else if(name=='水平涡流选粉机1915'){
index=29;
}else if(name=='水泥磨主电机'){
index=30;
}else if(name=='辊压机动辊电机'){
index=31;
}else if(name=='辊压机定辊电机'){
index=32;
}else if(name=='新增磨尾风机'){
index=33;
}else if(name=='水泥1#空压机'){
index=34;
}else if(name=='水泥2#空压机'){
index=35;
}else if(name=='水泥磨合计计'){
index=36;
}else if(name=='水泥包装合计'){
index=37;
}else if(name=='食堂'){
index=39;
}else if(name=='单元楼'){
index=40;
}else if(name=='单身宿舍'){
index=41;
}else if(name=='办公楼'){
index=42;
}else if(name=='余热锅炉'){
index=43;
}else if(name=='污水站'){
index=44;
}else if(name=='南门办公区'){
index=45;
}else if(name=='东门办公区'){
index=46;
}else if(name=='生活区合计'){
index=47;
}else if(name=='地磅'){
index=48;
}
return index;
}
function sumNum(a,b,c,d){
let sum = 0;
if(a&&Number(a)){sum=sum+Number(a);}
if(b&&Number(b)){sum=sum+Number(b);}
if(c&&Number(c)){sum=sum+Number(c);}
if(d&&Number(d)){sum=sum+Number(d);}
return sum;
}
let obj = {};
obj.type='month_s';
obj.year_s = that.year;
obj.page = 0;
obj.mpoint__ep_monitored__power_kw__gte=100;
this.$API.enm.mpoint.stat.req(obj).then((res) => {
console.log(res)
let wrapArr = [],innerArr=[];
res.forEach(item=>{
let month = item.month_s;
if(wrapArr[month]){
wrapArr[month].push(item)
}else{
wrapArr[month]=[];
wrapArr[month].push(item);
}
})
console.log(wrapArr)//
wrapArr.forEach((inner,inde)=>{
inner.forEach(item=>{
let i = dataPush(item.mpoint_name);
let k = 0;
if(i==0||i==2||i==9||i==23||i==27){
k = 3+inde;
}else{
k = 2+inde;
}
that.tableDatas[i][k] = item.val;
})
})
for(let k = 0;k<12;k++){
let m = k+2;
let n = k+1;
that.tableDatas[8][m] = sumNum(that.tableDatas[1][m],that.tableDatas[7][m]);
that.tableDatas[26][m] = sumNum(that.tableDatas[22][m],that.tableDatas[25][m]);
that.tableDatas[38][m] = sumNum(that.tableDatas[36][m],that.tableDatas[37][m]);
that.tableDatas[49][n] = sumNum(that.tableDatas[8][m],that.tableDatas[26][m]+ that.tableDatas[38][m]+ that.tableDatas[48][m]);
}
})
},
getTableData(){
for(let i=0;i<this.tableDatas.length;i++){
let k = 0;
if(i==0||i==2||i==9||i==23||i==27){
k = 3;
}else if(i==49){
k = 1;
}else{
k = 2;
}
for (let j = k; j < this.tableDatas[i].length; j++) {
this.tableDatas[i][j]=0;
}
}
this.getData();
},
exportExcel() {
this.exportLoading = true;
this.$XLSX('#myTable', this.tableName)
this.exportLoading = false;
},
handlePrint() {
this.$PRINT('#myReport');
},
}
};
</script>
<style scoped>
.printWrap{
width: 100%;
overflow-x: scroll;
}
</style>

View File

@ -0,0 +1,236 @@
<template>
<div class="app-container">
<el-header>
<div class="left-panel">
<el-button
type="primary"
@click="exportExcel()"
:loading="exportLoading"
>导出xlsx
</el-button>
<el-button type="primary" @click="handlePrint">打印 </el-button>
</div>
</el-header>
<el-card style="margin-top: 5px">
<div ref="print" id="myReport" class="printContainer">
<table
border="1"
cellspacing="0"
:key="timeStamp"
id="myTable"
class="myTable"
>
<thead class="myTableHead">
<tr>
<th colspan="12">全厂能源统计</th>
</tr>
<tr>
<th rowspan="2">月份</th>
<th rowspan="2">工业总产值万元</th>
<th rowspan="2">工业增加值万元</th>
<th colspan="3">综合能源消费</th>
<th colspan="3">单位总产值能耗</th>
<th colspan="3">单位工业增加值能耗</th>
</tr>
<tr>
<th>当期值tce</th>
<th>环比增长率%</th>
<th>同比增长率%</th>
<th>当期值tce/万元</th>
<th>环比增长率%</th>
<th>同比增长率%</th>
<th>当期值tce/万元</th>
<th>环比增长率%</th>
<th>同比增长率%</th>
</tr>
</thead>
<tr v-for="(item, index) in tableDatas" :key="index">
<td class="numCell" v-for="item1 in item" :key="item1">
{{ item1 }}
</td>
</tr>
</table>
</div>
</el-card>
</div>
</template>
<script>
export default {
data() {
return {
timeStamp: 0,
year_s: "",
tableDatas: [],
};
},
mounted() {
let that = this;
var myDate = new Date();
let year = myDate.getFullYear();
that.year_s = year;
this.getData();
},
methods: {
getData() {
let that = this;
let wrapArr = [],
wrapArr2 = [];
let obj = {};
obj.year_s = this.year_s - 1;
obj.page = 0;
that.$API.enm.enstat2.req(obj).then((res) => {
if (res.length > 0) {
res.forEach((item) => {
let ind = item.month_s - 1;
wrapArr[ind] = item;
});
} else {
}
let obj2 = {};
obj2.year_s = this.year_s;
obj2.page = 0;
that.$API.enm.enstat2.req(obj2).then((res2) => {
if (res2.length > 0) {
res2.forEach((item2) => {
let ind2 = item2.month_s - 1;
wrapArr2[ind2] = item2;
});
} else {
}
for (let i = 0; i < wrapArr2.length; i++) {
if (Boolean(wrapArr2[i])) {
if (this.tableDatas[i]) {
} else {
this.tableDatas[i] = [];
}
let time =
wrapArr2[i].year_s + "." + wrapArr2[i].month_s;
this.tableDatas[i][0] = time;
this.tableDatas[i][1] =
wrapArr2[i].industry_total_val;
this.tableDatas[i][2] =
wrapArr2[i].industry_add_val;
this.tableDatas[i][3] = wrapArr2[i].en_consume;
let tValue3 = 0,
hValue3 = 0,
tPercent3 = 0,
hPercent3 = 0;
if (wrapArr2[i].month_s > 1) {
tValue3 = wrapArr2[i - 1]
? wrapArr2[i - 1].en_consume
: "/";
} else {
tValue3 = wrapArr[12]
? wrapArr[12].en_consume
: "/";
}
if (tValue3 !== "/" && tValue3 !== 0) {
tPercent3 =
((wrapArr2[i].en_consume - tValue3) /
tValue3) *
100;
} else {
tPercent3 = "/";
}
hValue3 = wrapArr[i] ? wrapArr[i].en_consume : "/";
if (hValue3 !== "/" && hValue3 !== 0) {
hPercent3 =
((wrapArr2[i].en_consume - hValue3) /
hValue3) *
100;
} else {
hPercent3 = "/";
}
this.tableDatas[i][4] = hPercent3;
this.tableDatas[i][5] = tPercent3;
this.tableDatas[i][6] = wrapArr2[i].en_consume_unit;
let tValue6 = 0,
hValue6 = 0,
tPercent6 = 0,
hPercent6 = 0;
if (wrapArr2[i].month_s > 1) {
tValue6 = wrapArr2[i - 1]
? wrapArr2[i - 1].en_consume_unit
: "/";
} else {
tValue6 = wrapArr[12]
? wrapArr[12].en_consume_unit
: "/";
}
if (tValue6 !== "/" && tValue6 !== 0) {
tPercent6 =
((wrapArr2[i].en_consume_unit - tValue6) /
tValue6) *
100;
} else {
tPercent6 = "/";
}
hValue6 = wrapArr[i]
? wrapArr[i].en_consume_unit
: "/";
if (hValue6 !== "/" && hValue6 !== 0) {
hPercent6 =
((wrapArr2[i].en_consume_unit - hValue6) /
hValue6) *
100;
} else {
hPercent6 = "/";
}
this.tableDatas[i][7] = hPercent6;
this.tableDatas[i][8] = tPercent6;
this.tableDatas[i][9] =
wrapArr2[i].en_add_consume_unit;
let tValue9 = 0,
hValue9 = 0,
tPercent9 = 0,
hPercent9 = 0;
if (wrapArr2[i].month_s > 1) {
tValue9 = wrapArr2[i - 1]
? wrapArr2[i - 1].en_add_consume_unit
: "/";
} else {
tValue9 = wrapArr[12]
? wrapArr[12].en_add_consume_unit
: "/";
}
if (tValue9 !== "/" && tValue9 !== 0) {
tPercent9 =
((wrapArr2[i].en_add_consume_unit -
tValue9) /
tValue9) *
100;
} else {
tPercent9 = "/";
}
hValue9 = wrapArr[i]
? wrapArr[i].en_add_consume_unit
: "/";
if (hValue9 !== "/" && hValue9 !== 0) {
hPercent9 =
((wrapArr2[i].en_add_consume_unit -
hValue9) /
hValue9) *
100;
} else {
hPercent9 = "/";
}
this.tableDatas[i][10] = hPercent9;
this.tableDatas[i][11] = tPercent9;
} else {
}
}
});
});
},
exportExcel() {
this.exportLoading = true;
this.$XLSX("#myTable", this.tableName);
this.exportLoading = false;
},
handlePrint() {
this.$PRINT("#myReport");
},
},
};
</script>
<style></style>

View File

@ -0,0 +1,385 @@
<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-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)
}}</span>
<span
v-if="sflogItem.shift_name"
style="margin: 0 10px"
>{{ 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">产量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"></td>
<td class="numCell"></td>
<td class="numCell"></td>
<td
class="numCell"
v-if="
reportItem['入磨熟料_f-CaO_rate_pass']
"
>
{{
reportItem["入磨熟料_f-CaO_rate_pass"] *
100
}}
</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",
data() {
return {
apiObj: this.$API.wpm.sflog.list,
apiObj2: null,
query: {
shift: "",
team: "",
end_time__lt: "",
start_time__gte: "",
mgroup: "3347217246321065984",
},
deptId: "3347207082608115712",
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];
}
console.log(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;
}
#numTable td {
height: 32px;
padding-left: 5px;
}
.numCell {
width: 80px;
text-align: center;
}
.numCell.numCell_last {
width: 100px;
}
.searchHead {
display: flex;
}
.middleText {
height: 32px;
line-height: 32px;
margin: 0 5px;
display: inline-block;
}
.searchBtn {
margin-left: 5px;
}
</style>

View File

@ -0,0 +1,625 @@
<template>
<div class="app-container">
<el-header>
<div class="left-panel">
<el-button
type="primary"
@click="exportExcel()"
:loading="exportLoading"
>导出xlsx
</el-button>
<el-button type="primary" @click="handlePrint">打印 </el-button>
</div>
</el-header>
<el-card style="margin-top: 5px">
<div class="printWrap">
<div ref="print" id="myReport" class="printContainer">
<table
border="1"
width="1035"
cellspacing="0"
:key="timeStamp"
class="myTable"
id="myTable"
>
<thead class="myTableHead">
<tr>
<th colspan="6">
回转窑工段主要设备100KW以上单位产品电耗数据表
</th>
</tr>
<tr>
<th>设备名称</th>
<th>设备编号</th>
<th>单位</th>
<th>上个小时</th>
<th>昨日</th>
<th>本月</th>
</tr>
</thead>
<tbody>
<tr v-for="item in tableDatas" :key="item">
<template
v-for="(item1, ind) in item"
:key="item1"
>
<td
v-if="ind == 0 || ind == 1 || ind == 2"
class="numCell"
>
{{ item1 }}
</td>
<td
v-if="ind == 3"
class="numCell"
@click="itemClick('hour_s', item)"
>
{{ item1 }}
</td>
<td
v-if="ind == 4"
class="numCell"
@click="itemClick('day_s', item)"
>
{{ item1 }}
</td>
<td
v-if="ind == 5"
class="numCell"
@click="itemClick('month_s', item)"
>
{{ item1 }}
</td>
</template>
</tr>
</tbody>
</table>
<div class="chartWrap">
<div class="chartTitle">小时生产参数统计图</div>
<scEcharts
height="400px"
width="1033px"
:option="optionHour"
></scEcharts>
</div>
<div class="chartWrap">
<div class="chartTitle">本月生产参数统计图</div>
<scEcharts
height="400px"
width="1033px"
:option="optionDay"
></scEcharts>
</div>
<div class="chartWrap">
<div class="chartTitle">本年生产参数统计图</div>
<scEcharts
height="400px"
width="1033px"
:option="optionMonth"
></scEcharts>
</div>
</div>
</div>
<charts
v-if="asynDialog"
:type="type"
:title="title"
:cate="cate"
:apiObj="apiObj"
:mgroup="query.mgroup"
:modelValue="modelValue"
:showClose="showClose"
:echartType="echartType"
@closed="asynDialog = false"
></charts>
</el-card>
</div>
</template>
<script>
const colors = [
"#647bfe",
"#8698fe",
"#a9b6fe",
"#cbd3fe",
"#91CC75",
"#EE6666",
];
let tooltip = {
show: true,
trigger: "axis",
axisPointer: {
type: "cross",
},
confine: false,
showContent: true,
triggerOn: "mousemove",
};
let grid = {
right: "3%",
left: "7%",
top: "15%",
};
let toolbox = {
right: "2%",
feature: {
dataView: { show: true, readOnly: false },
saveAsImage: { show: true },
},
};
let legend = {
top: "2%",
left: "center",
// orient:'vertical',
data: ["尾排风机", "高温风机", "头排风机", "低压变压器柜"],
};
let yAxis = {
type: "value",
name: "电耗(KW.h/t)",
alignTicks: true,
axisLine: {
show: true,
lineStyle: {
color: colors[3],
},
},
axisLabel: {
formatter: "{value}",
},
};
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,
optionHour: {},
optionDay: {},
optionMonth: {},
year: 2023,
month: 1,
days: 1,
hours: 1,
query: {
mgroup: "3347217246321065984",
},
tableName: "主要设备100KW以上单位产品电耗数据表",
tableDatas: [
["尾排风机", "", "KW·h/t", "", "", ""],
["高温风机", "", "KW·h/t", "", "", ""],
["头排风机", "", "KW·h/t", "", "", ""],
],
modelValue: true,
type: "hour_s",
title: "回转窑工段",
cate: "",
apiObj: this.$API.enm.mpoint.stat,
showClose: true,
echartType: "line",
asynDialog: false,
allValHour: 0,
allValDays: 0,
allValMonth: 0,
option1: {
color: colors,
tooltip: tooltip,
grid: grid,
toolbox: toolbox,
legend: legend,
xAxis: {
axisTick: {
show: true,
length: 5,
inside: true,
},
data: [],
},
yAxis: yAxis,
series: [
{
name: "尾排风机",
type: "bar",
data: [],
},
{
name: "高温风机",
type: "bar",
data: [],
},
{
name: "头排风机",
type: "bar",
data: [],
},
{
name: "低压变压器柜",
type: "bar",
data: [],
},
],
},
option2: {
color: colors,
tooltip: tooltip,
grid: grid,
toolbox: toolbox,
legend: legend,
xAxis: {
axisTick: {
show: true,
length: 5,
inside: true,
},
data: [],
},
yAxis: yAxis,
series: [
{
name: "尾排风机",
type: "bar",
data: [],
},
{
name: "高温风机",
type: "bar",
data: [],
},
{
name: "头排风机",
type: "bar",
data: [],
},
{
name: "低压变压器柜",
type: "bar",
data: [],
},
],
},
option3: {
color: colors,
tooltip: tooltip,
grid: grid,
toolbox: toolbox,
legend: legend,
xAxis: {
axisTick: {
show: true,
length: 5,
inside: true,
},
data: [
"一月",
"二月",
"三月",
"四月",
"五月",
"六月",
"七月",
"八月",
"九月",
"十月",
"十一月",
"十二月",
],
},
yAxis: yAxis,
series: [
{
name: "尾排风机",
type: "bar",
data: [],
},
{
name: "高温风机",
type: "bar",
data: [],
},
{
name: "头排风机",
type: "bar",
data: [],
},
{
name: "低压变压器柜",
type: "bar",
data: [],
},
],
},
};
},
mounted() {
let that = this;
var myDate = new Date();
let year = myDate.getFullYear();
let month = myDate.getMonth() + 1;
let days = myDate.getDate();
let hours = myDate.getHours();
let timeDate = myDate.getTime();
let dayTime = 24 * 60 * 60 * 1000;
//
let year_d = year,
month_d = month,
days_d = days;
if (hours < 21) {
//21
let newDate = timeDate - dayTime;
let lastDate = new Date(newDate);
year_d = lastDate.getFullYear();
month_d = lastDate.getMonth() + 1;
days_d = lastDate.getDate();
}
//
let hourTime = timeDate - 3600000;
let hourDate = new Date(hourTime);
let year_h = hourDate.getFullYear();
let month_h = hourDate.getMonth() + 1;
let days_h = hourDate.getDate();
let hours_h = hourDate.getHours();
//
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 allValMonth = (that.allValMonth =
res2[0].total_production); //
params2.mpoint__ep_monitored__power_kw__gte = 100;
this.$API.enm.mpoint.stat.req(params2).then((res) => {
let data2 = res;
for (let i = 0; i < data2.length; i++) {
that.tableDatas[i] = [];
that.tableDatas[i][0] = data2[i].ep_monitored_name;
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();
that.getMonthData();
},
methods: {
//
getHourData() {
let that = this;
let query = {};
query.page = 0;
query.year_s = that.year;
query.month_s = that.month;
query.day_s = that.days;
query.type = "hour_s";
query.mgroup = that.query.mgroup;
query.mpoint__ep_monitored__power_kw__gte = 100;
this.$API.enm.mpoint.stat.req(query).then((response) => {
let seriesData0 = [],
seriesData1 = [],
seriesData2 = [],
seriesData3 = [];
let data = response;
data.forEach((item) => {
let ind = item.hour;
let val = 0;
if (that.allValHour == 0) {
val = "";
} else {
val = (item.val / that.allValHour).toFixed(2);
}
if (item.equip_name == "尾排风机") {
seriesData0[ind] = val;
} else if (item.equip_name == "高温风机") {
seriesData1[ind] = val;
} else if (item.equip_name == "头排风机") {
seriesData2[ind] = val;
} else if (item.equip_name == "低压变压器柜") {
seriesData3[ind] = val;
}
});
let options = { ...that.option1 };
options.series[0].data = seriesData0;
options.series[1].data = seriesData1;
options.series[2].data = seriesData2;
options.series[3].data = seriesData3;
let hourXAxis = [];
for (let i = 1; i <= that.hours; i++) {
let item = i + "时";
hourXAxis.push(item);
}
options.xAxis.data = hourXAxis;
that.optionHour = options;
});
},
//
getDayData() {
let that = this;
let query1 = {};
query1.page = 0;
query1.year_s = that.year;
query1.month_s = that.month;
query1.type = "day_s";
query1.mgroup = this.query.mgroup;
query1.mpoint__ep_monitored__power_kw__gte = 100;
this.$API.enm.enstat.req(query1).then((response) => {
let seriesData0 = [],
seriesData1 = [],
seriesData2 = [],
seriesData3 = [];
let data = response;
data.forEach((item) => {
// debugger;
let ind = item.day_s;
let val = 0;
if (that.allValDays == 0) {
val = "";
} else {
val = (item.val / that.allValDays).toFixed(2);
}
if (item.equip_name == "尾排风机") {
seriesData0[ind] = val;
} else if (item.equip_name == "高温风机") {
seriesData1[ind] = val;
} else if (item.equip_name == "头排风机") {
seriesData2[ind] = val;
} else if (item.equip_name == "低压变压器柜") {
seriesData3[ind] = val;
}
});
let options = { ...that.option2 };
options.series[0].data = seriesData0;
options.series[1].data = seriesData1;
options.series[2].data = seriesData2;
options.series[3].data = seriesData3;
let dayXAxis = [];
for (let i = 1; i <= that.days; i++) {
let item = i + "日";
dayXAxis.push(item);
}
options.xAxis.data = dayXAxis;
that.optionDay = options;
});
},
//
getMonthData() {
let that = this;
let query2 = {};
query2.page = 0;
query2.year_s = that.year;
query2.type = "month_s";
query2.mgroup = that.query.mgroup;
query2.mpoint__ep_monitored__power_kw__gte = 100;
this.$API.enm.enstat.req(query2).then((response) => {
let seriesData0 = [],
seriesData1 = [],
seriesData2 = [],
seriesData3 = [];
let data = response;
data.forEach((item) => {
let ind = item.month_s;
let val = 0;
if (that.allValMonth == 0) {
val = "";
} else {
val = (item.val / that.allValMonth).toFixed(2);
}
if (item.equip_name == "尾排风机") {
seriesData0[ind] = val;
} else if (item.equip_name == "高温风机") {
seriesData1[ind] = val;
} else if (item.equip_name == "头排风机") {
seriesData2[ind] = val;
} else if (item.equip_name == "低压变压器柜") {
seriesData3[ind] = val;
}
});
let options = { ...that.option3 };
options.series[0].data = seriesData0;
options.series[1].data = seriesData1;
options.series[2].data = seriesData2;
options.series[3].data = seriesData3;
let monthXAxis = [];
for (let i = 1; i <= that.month; i++) {
let item = i + "月";
monthXAxis.push(item);
}
options.xAxis.data = monthXAxis;
that.optionMonth = options;
});
},
itemClick(type, item) {
this.type = type;
this.cate = item[0];
this.asynDialog = true;
},
handlePrint() {
this.$PRINT("#myReport");
},
exportExcel() {
this.exportLoading = true;
this.$XLSX("#myTable", this.tableName);
this.exportLoading = false;
},
},
};
</script>
<style scoped>
.printContainer {
padding-left: 20px;
}
</style>

View File

@ -0,0 +1,917 @@
<template>
<div class="app-container">
<el-header>
<div class="left-panel">
<el-button
type="primary"
@click="exportExcel()"
:loading="exportLoading"
>导出xlsx
</el-button>
<el-button type="primary" @click="handlePrint">打印 </el-button>
</div>
</el-header>
<el-card style="margin-top: 5px">
<div class="printWrap">
<div ref="print" id="myReport" class="printContainer">
<table
border="1"
width="1035"
cellspacing="0"
:key="timeStamp"
id="myTable"
class="myTable"
>
<thead class="myTableHead">
<tr>
<th colspan="10">回转窑工段生产报告</th>
</tr>
<tr>
<th colspan="2">参数</th>
<th>上个小时</th>
<th>昨日</th>
<th>本月</th>
<th>本年</th>
<th>月目标值</th>
<th>月完成度</th>
<th>年目标值</th>
<th>年完成度</th>
</tr>
</thead>
<tbody>
<tr
v-for="(item, index) in tableDatas"
:key="index"
>
<td
class="numCell"
v-if="index == 0 || index == 2"
rowspan="2"
>
{{ item[0] }}
</td>
<td
class="numCell"
v-else-if="index == 4"
rowspan="4"
>
{{ item[0] }}
</td>
<td class="numCell" v-else-if="index == 8">
{{ item[0] }}
</td>
<td class="numCell">{{ item[1] }}</td>
<td
class="numCell hoursItem"
@click="itemClick('hour_s', item)"
>
{{ item[2] }}
</td>
<td
class="numCell daysItem"
@click="itemClick('day_s', item)"
>
{{ item[3] }}
</td>
<td
class="numCell monthItem"
@click="itemClick('month_s', item)"
>
{{ item[4] }}
</td>
<td
class="numCell yearItem"
@click="itemClick('year_s', item)"
>
{{ item[5] }}
</td>
<td class="numCell">{{ item[6] }}</td>
<td class="numCell">{{ item[7] }}</td>
<td class="numCell">{{ item[8] }}</td>
<td class="numCell">{{ item[9] }}</td>
</tr>
</tbody>
</table>
<div class="chartWrap">
<div class="chartTitle">小时生产参数统计图</div>
<scEcharts
height="400px"
width="1033px"
:option="optionHour"
></scEcharts>
</div>
<div class="chartWrap">
<div class="chartTitle">本月生产参数统计图</div>
<scEcharts
height="400px"
width="1033px"
:option="optionDay"
></scEcharts>
</div>
<div class="chartWrap">
<div class="chartTitle">本年生产参数统计图</div>
<scEcharts
height="400px"
width="1033px"
:option="optionMonth"
></scEcharts>
</div>
</div>
</div>
<sc-dialog v-model="chartShow" draggable title="回转窑工段">
<div class="searchHead" v-if="type == 'hours'">
<el-date-picker
v-model="query.start_time"
type="date"
placeholder="选择时间"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
:picker-options="pickerOptions"
/>
<span class="middleText"></span>
<el-date-picker
v-model="query.end_time"
type="date"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
start-placeholder="结束日期"
:picker-options="pickerOptions"
/>
<el-button
type="primary"
class="searchBtn"
@click="dataSearch"
>查询</el-button
>
</div>
<div class="searchHead" v-if="type == 'days'">
<el-date-picker
v-model="query.start_time"
type="date"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
start-placeholder="开始日期"
:picker-options="pickerOptions"
/>
<el-date-picker
v-model="query.end_time"
type="date"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
start-placeholder="结束日期"
:picker-options="pickerOptions"
/>
<el-button
type="primary"
class="searchBtn"
@click="dataSearch"
>查询</el-button
>
</div>
<div class="searchHead" v-if="type == 'month'">
<el-date-picker
v-model="query.start_time"
type="month"
format="YYYY-MM"
value-format="YYYY-MM"
start-placeholder="开始月份"
:picker-options="pickerOptions"
/>
<el-date-picker
v-model="query.end_time"
type="month"
format="YYYY-MM"
value-format="YYYY-MM"
start-placeholder="结束月份"
:picker-options="pickerOptions"
/>
<el-button
type="primary"
class="searchBtn"
@click="dataSearch"
>查询</el-button
>
</div>
<div class="searchHead" v-if="type == 'year'">
<el-date-picker
v-model="query.start_time"
type="year"
format="YYYY"
value-format="YYYY"
start-placeholder="开始日期"
:picker-options="pickerOptions"
/>
<el-date-picker
v-model="query.end_time"
type="year"
format="YYYY"
value-format="YYYY"
start-placeholder="结束日期"
:picker-options="pickerOptions"
/>
<el-button
type="primary"
class="searchBtn"
@click="dataSearch"
>查询</el-button
>
</div>
<scEcharts
height="360px"
:option="myOption"
v-if="chartShow"
></scEcharts>
</sc-dialog>
<charts
v-if="asynDialog"
:type="type"
:title="title"
:cate="cate"
:apiObj="apiObj"
:mgroup="query.mgroup"
:modelValue="modelValue"
:showClose="showClose"
:echartType="echartType"
@closed="asynDialog = false"
></charts>
</el-card>
</div>
</template>
<script>
const colors = ["#647bfe", "#8698fe", "#a9b6fe", "#cbd3fe", "#91CC75"];
let tooltip = {
show: true,
trigger: "axis",
axisPointer: {
type: "cross",
},
confine: false,
showContent: true,
triggerOn: "mousemove",
};
let grid = {
right: "9%",
left: "7%",
top: "15%",
};
let toolbox = {
right: "2%",
feature: {
dataView: { show: true, readOnly: false },
saveAsImage: { show: true },
},
};
let legend = {
top: "2%",
data: ["总产量", "台时产量", "运转率", "分布电耗", "单位产品标煤耗"],
};
let yAxis = [
{
type: "value",
name: "产量 (t)",
position: "left",
alignTicks: true,
axisLine: {
show: true,
lineStyle: {
color: colors[0],
},
},
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "运转率 ",
position: "right",
alignTicks: true,
offset: 70,
axisLine: {
show: true,
lineStyle: {
color: colors[2],
},
},
axisLabel: {
formatter: "{value}%",
},
},
{
type: "value",
name: "分布电耗",
position: "left",
alignTicks: true,
offset: 70,
axisLine: {
show: true,
lineStyle: {
color: colors[3],
},
},
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "标煤耗",
position: "right",
alignTicks: true,
axisLine: {
show: true,
lineStyle: {
color: colors[4],
},
},
axisLabel: {
formatter: "{value}",
},
},
];
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,
optionHour: {},
optionDay: {},
optionMonth: {},
year: 2023,
month: 1,
days: 1,
hours: 1,
query: {
mgroup: "3347217246321065984",
},
tableDatas: [
["产量", "总产量t", 0, 0, 0, 0, 0, 0, 0, 0],
["产量", "台时产量t/h", "/", 0, 0, 0, 0, 0, 0, 0],
["运转时间", "运转时间h", "/", 0, 0, 0, 0, 0, 0, 0],
["运转时间", "运转率(%", "/", 0, 0, 0, 0, 0, 0, 0],
["能耗", "单位产品分布电耗KW·h/t", 0, 0, 0, 0, 0, 0, 0, 0],
["能耗", "单位产品综合电耗KW·h/t", 0, 0, 0, 0, 0, 0, 0, 0],
["能耗", "单位产品标煤耗kgce/t", 0, 0, 0, 0, 0, 0, 0, 0],
["能耗", "单位产品综合能耗kgce/t", 0, 0, 0, 0, 0, 0, 0, 0],
],
tableName: "生产报告",
modelValue: true,
type: "hour_s",
title: "回转窑工段",
cate: "",
apiObj: this.$API.enm.enstat,
showClose: true,
echartType: "line",
asynDialog: false,
option1: {
color: colors,
tooltip: tooltip,
grid: grid,
toolbox: toolbox,
legend: legend,
xAxis: {
axisTick: {
show: true,
length: 5,
inside: true,
},
data: [],
},
yAxis: yAxis,
series: [
{
name: "总产量",
type: "bar",
yAxisIndex: 0,
data: [],
},
{
name: "台时产量",
type: "bar",
yAxisIndex: 0,
data: [],
},
{
name: "运转率",
type: "line",
yAxisIndex: 1,
data: [],
},
{
name: "分布电耗",
type: "bar",
yAxisIndex: 2,
data: [],
},
{
name: "单位产品标煤耗",
type: "bar",
yAxisIndex: 3,
data: [],
},
],
},
option2: {
color: colors,
tooltip: tooltip,
grid: grid,
toolbox: toolbox,
legend: legend,
xAxis: {
axisTick: {
show: true,
length: 5,
inside: true,
// alignWithLabel: true
},
data: [
"一月",
"二月",
"三月",
"四月",
"五月",
"六月",
"七月",
"八月",
"九月",
"十月",
"十一月",
"十二月",
],
},
yAxis: yAxis,
series: [
{
name: "总产量",
type: "bar",
yAxisIndex: 0,
data: [],
},
{
name: "台时产量",
type: "bar",
yAxisIndex: 0,
data: [],
},
{
name: "运转率",
type: "line",
yAxisIndex: 1,
data: [],
},
{
name: "分布电耗",
type: "bar",
yAxisIndex: 2,
data: [],
},
{
name: "单位产品标煤耗",
type: "bar",
yAxisIndex: 3,
data: [],
},
],
},
option3: {
color: colors,
tooltip: tooltip,
grid: grid,
toolbox: toolbox,
legend: legend,
xAxis: {
axisTick: {
show: true,
length: 5,
inside: true,
},
data: [],
},
yAxis: yAxis,
series: [
{
name: "总产量",
type: "bar",
yAxisIndex: 0,
data: [],
},
{
name: "台时产量",
type: "bar",
yAxisIndex: 0,
data: [],
},
{
name: "运转率",
type: "line",
yAxisIndex: 1,
data: [],
},
{
name: "分布电耗",
type: "bar",
yAxisIndex: 2,
data: [],
},
{
name: "单位产品标煤耗",
type: "bar",
yAxisIndex: 3,
data: [],
},
],
},
};
},
mounted() {
function precen(a, b) {
if (b !== 0 && b !== null && a !== null) {
let precen = (a / b).toFixed(2);
return precen * 100 + "%";
} else {
return "/";
}
}
let that = this;
var myDate = new Date();
let year = (that.year = myDate.getFullYear());
let month = (that.month = myDate.getMonth() + 1);
let days = (that.days = myDate.getDate());
let hours = (that.hours = myDate.getHours());
let timeDate = myDate.getTime();
let dayTime = 24 * 60 * 60 * 1000;
//
let year_d = year,
month_d = month,
days_d = days;
if (hours < 21) {
//21
let newDate = timeDate - dayTime;
let lastDate = new Date(newDate);
year_d = lastDate.getFullYear();
month_d = lastDate.getMonth() + 1;
days_d = lastDate.getDate();
}
//
let hourTime = timeDate - 3600000;
let hourDate = new Date(hourTime);
let year_h = hourDate.getFullYear();
let month_h = hourDate.getMonth() + 1;
let days_h = hourDate.getDate();
let hours_h = hourDate.getHours();
//
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 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) => {
//
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();
},
methods: {
//
getHourData() {
let that = this;
let query = {};
query.page = 0;
query.year_s = that.year;
query.month_s = that.month;
query.day_s = that.days;
query.type = "hour_s";
query.mgroup = that.query.mgroup;
this.$API.enm.enstat.req(query).then((response) => {
let seriesData0 = [],
seriesData1 = [],
seriesData2 = [],
seriesData3 = [],
seriesData4 = [];
let data = response;
data.forEach((item) => {
let ind = item.hour;
seriesData0[ind] = item.total_production;
seriesData1[ind] = item.production_hour;
seriesData2[ind] = item.run_rate;
seriesData3[ind] = item.elec_consume_unit;
seriesData4[ind] = item.coal_consume_unit;
});
let options = { ...that.option1 };
options.series[0].data = seriesData0;
options.series[1].data = seriesData1;
options.series[2].data = seriesData2;
options.series[3].data = seriesData3;
options.series[4].data = seriesData4;
let hourXAxis = [];
for (let i = 1; i <= that.hours; i++) {
let item = i + "时";
hourXAxis.push(item);
}
options.xAxis.data = hourXAxis;
that.optionHour = options;
});
},
//
getDayData() {
let that = this;
let query1 = {};
query1.page = 0;
query1.year_s = that.year;
query1.month_s = that.month;
query1.type = "day_s";
query1.mgroup = this.query.mgroup;
this.$API.enm.enstat.req(query1).then((response) => {
let seriesData0 = [],
seriesData1 = [],
seriesData2 = [],
seriesData3 = [],
seriesData4 = [];
// debugger;
console.log(response);
let data = response;
data.forEach((item) => {
// debugger;
let ind = item.day_s;
seriesData0[ind] = item.total_production;
seriesData1[ind] = item.production_hour;
seriesData2[ind] = item.run_rate;
seriesData3[ind] = item.elec_consume_unit;
seriesData4[ind] = item.coal_consume_unit;
});
let options = { ...that.option2 };
options.series[0].data = seriesData0;
options.series[1].data = seriesData1;
options.series[2].data = seriesData2;
options.series[3].data = seriesData3;
options.series[4].data = seriesData4;
let dayXAxis = [];
for (let i = 1; i <= that.days; i++) {
let item = i + "日";
dayXAxis.push(item);
}
options.xAxis.data = dayXAxis;
that.optionDay = options;
});
},
//
getMonthData() {
let that = this;
let query2 = {};
query2.page = 0;
query2.year_s = that.year;
query2.type = "month_s";
query2.mgroup = that.query.mgroup;
this.$API.enm.enstat.req(query2).then((response) => {
let seriesData0 = [],
seriesData1 = [],
seriesData2 = [],
seriesData3 = [],
seriesData4 = [];
let data = response;
data.forEach((item) => {
let ind = item.month_s;
seriesData0[ind] = item.total_production;
seriesData1[ind] = item.production_hour;
seriesData2[ind] = item.run_rate;
seriesData3[ind] = item.elec_consume_unit;
seriesData4[ind] = item.coal_consume_unit;
});
let options = { ...that.option3 };
options.series[0].data = seriesData0;
options.series[1].data = seriesData1;
options.series[2].data = seriesData2;
options.series[3].data = seriesData3;
options.series[4].data = seriesData4;
let monthXAxis = [];
for (let i = 1; i <= that.month; i++) {
let item = i + "月";
monthXAxis.push(item);
}
options.xAxis.data = monthXAxis;
that.optionMonth = options;
});
},
itemClick(type, item) {
this.type = type;
this.cate = item[1];
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>
.printContainer {
padding-left: 20px;
}
</style>

View File

@ -0,0 +1,257 @@
<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="1800"
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">产量</th>
<th>运转率</th>
<th colspan="7">单位产品煤耗</th>
<th colspan="7">单位产品电耗</th>
</tr>
<tr>
<th>总产量t</th>
<th>台时产量t/h</th>
<th>运转率%</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>当期值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"
>
{{ item0 }}
</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: "3347217246321065984",
},
tableDatas: [],
};
},
mounted() {
let that = this;
var myDate = new Date();
let year = myDate.getFullYear();
that.query.year_s = year;
this.getData();
},
methods: {
getData() {
let that = this;
let query0 = {};
query0.page = 0;
query0.type = "month_st";
query0.year_s = that.query.year_s - 1;
query0.mgroup = "3347217246321065984";
let wrapArr = [],
wrapArr0 = [],
wrapArrs = [];
this.$API.enm.enstat.req(query0).then((res0) => {
let data0 = res0;
debugger;
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;
});
debugger;
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[5] = item.elec_consume_unit; //KW·h/t
arr[6] = item.celec_consume_unit; //KW·h/t//
arr[7] = item.celec_consume_unit; //KW·h/t
let ind_pre = 0,
huanbi = 0;
if (item.month_s == 1) {
ind_pre = 12;
huanbi = wrapArr0[ind_pre]
? wrapArr0[ind_pre].elec_consume_unit
: "/";
} else {
ind_pre = ind - 1;
huanbi = wrapArr[ind_pre]
? wrapArr[ind_pre].elec_consume_unit
? wrapArr[ind_pre].elec_consume_unit
: "/"
: "/";
}
arr[8] = huanbi; //KW·h/t
arr[9] = item.celec_consume_unit; //KW·h/t
arr[10] = item.celec_consume_unit; //%
arr[11] = item.celec_consume_unit; //%
//
arr[12] = item.elec_consume_unit; //KW·h/t
arr[13] = item.celec_consume_unit; //KW·h/t//
arr[14] = 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[15] = huanbi; //KW·h/t
arr[16] = item.celec_consume_unit; //KW·h/t
arr[17] = item.celec_consume_unit; //%
arr[18] = item.celec_consume_unit; //%
arr[19] = item.celec_consume_unit; //%
wrapArr[ind] = arr;
});
console.log(wrapArr);
that.tableDatas = wrapArr;
} 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;
}
.numCell {
width: 100px !important;
}
</style>

View File

@ -0,0 +1,745 @@
<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-select
v-model="query.type"
placeholder="查询类型"
clearable
@change="typeCange"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<el-button
type="primary"
@click="exportExcel()"
: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="1" id="myTable" class="myTable" v-if="query.type==1">
<thead class="myTableHead">
<tr>
<th colspan="8">车间单位产品电耗月度分析表</th>
</tr>
<tr>
<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>环比增长率%</th>
<th>同比增长率%</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==3"></span>
<span v-if="item1<0&&ind==3"></span>
<span v-if="item1<0&&ind==5"></span>
<span v-if="item1<0&&ind==5"></span>
{{item1}}
</div>
</td>
</tr>
</tbody>
</table>
<table border="1" width="1075" cellspacing="0" :key="2" id="myTable1" class="myTable" v-else-if="query.type==2">
<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>
<table border="1" width="1075" cellspacing="0" :key="3" id="myTable1" class="myTable" v-else-if="query.type==3">
<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 tableDatas3" :key="item">
<td v-for="(item1,ind) in item" :key="ind" class="numCell">
<div :class="bindClass(item1,ind)">
<span v-if="item1<0&&ind==6"></span>
<span v-if="item1<0&&ind==6"></span>
{{item1}}
</div>
</td>
</tr>
</tbody>
</table>
<table border="1" width="1075" cellspacing="0" :key="4" id="myTable1" class="myTable" v-else-if="query.type==4">
<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 tableDatas4" :key="item">
<td v-for="(item1,ind) in item" :key="ind" class="numCell">
<div :class="bindClass(item1,ind)">
<span v-if="item1<0&&ind==6"></span>
<span v-if="item1<0&&ind==6"></span>
{{item1}}
</div>
</td>
</tr>
</tbody>
</table>
</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:'3347217246321065984',
},
monthGoal:[],
monthGoal2:[],
monthGoal3:[],
monthGoal4:[],
tableDatas:[],
tableDatas2:[],
tableDatas3:[],
tableDatas4:[],
options:[{
name:'电耗',id:1,
},{
name:'综合电耗',id:2,
},{
name:'标煤耗',id:3,
},{
name:'综合能耗',id:4,
}],
modelValue:true,
type:'hours',
title:'title',
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 = [],monthGoal2 = [],monthGoal3 = [],monthGoal4 = [];
ress.forEach(goal=>{
if(goal.goal_cate_name=='单位产品分布电耗KW·h/t'){
monthGoal[0]=goal.goal_val;
monthGoal[1]=goal.goal_val_2;
monthGoal[2]=goal.goal_val_3;
monthGoal[3]=goal.goal_val_4;
monthGoal[4]=goal.goal_val_5;
monthGoal[5]=goal.goal_val_6;
monthGoal[6]=goal.goal_val_7;
monthGoal[7]=goal.goal_val_8;
monthGoal[8]=goal.goal_val_9;
monthGoal[9]=goal.goal_val_10;
monthGoal[10]=goal.goal_val_11;
monthGoal[11]=goal.goal_val_12;
monthGoal[12]=goal.goal_val_12;
that.monthGoal = monthGoal;
}
if(goal.goal_cate_name=='单位产品综合电耗KW·h/t'){
monthGoal2[0]=goal.goal_val;
monthGoal2[1]=goal.goal_val_2;
monthGoal2[2]=goal.goal_val_3;
monthGoal2[3]=goal.goal_val_4;
monthGoal2[4]=goal.goal_val_5;
monthGoal2[5]=goal.goal_val_6;
monthGoal2[6]=goal.goal_val_7;
monthGoal2[7]=goal.goal_val_8;
monthGoal2[8]=goal.goal_val_9;
monthGoal2[9]=goal.goal_val_10;
monthGoal2[10]=goal.goal_val_11;
monthGoal2[11]=goal.goal_val_12;
monthGoal2[12]=goal.goal_val_12;
that.monthGoal2 = monthGoal2;
}
if(goal.goal_cate_name=='单位产品标煤耗kgce/t'){
monthGoal3[0]=goal.goal_val;
monthGoal3[1]=goal.goal_val_2;
monthGoal3[2]=goal.goal_val_3;
monthGoal3[3]=goal.goal_val_4;
monthGoal3[4]=goal.goal_val_5;
monthGoal3[5]=goal.goal_val_6;
monthGoal3[6]=goal.goal_val_7;
monthGoal3[7]=goal.goal_val_8;
monthGoal3[8]=goal.goal_val_9;
monthGoal3[9]=goal.goal_val_10;
monthGoal3[10]=goal.goal_val_11;
monthGoal3[11]=goal.goal_val_12;
monthGoal3[12]=goal.goal_val_12;
that.monthGoal3 = monthGoal3;
}
if(goal.goal_cate_name=='单位产品综合能耗kgce/t'){
monthGoal4[0]=goal.goal_val;
monthGoal4[1]=goal.goal_val_2;
monthGoal4[2]=goal.goal_val_3;
monthGoal4[3]=goal.goal_val_4;
monthGoal4[4]=goal.goal_val_5;
monthGoal4[5]=goal.goal_val_6;
monthGoal4[6]=goal.goal_val_7;
monthGoal4[7]=goal.goal_val_8;
monthGoal4[8]=goal.goal_val_9;
monthGoal4[9]=goal.goal_val_10;
monthGoal4[10]=goal.goal_val_11;
monthGoal4[11]=goal.goal_val_12;
monthGoal4[12]=goal.goal_val_12;
that.monthGoal4 = monthGoal4;
}
})
this.getData();
}else{
this.getData();
}
})
},
methods: {
// Class
bindClass(item,index){
let classInfo = { redColor: false, greenColor: false }
if(index==3||index==5){
if( typeof(item)=='number'){
if(item>0){
classInfo.greenColor = true;
classInfo.redColor = false;
}else if(item<0){
classInfo.redColor = true;
classInfo.greenColor = false
}
}
}
return classInfo
},
getData(){
let that = this;
let query0={};
query0.page = 0;
query0.type='month_s';
query0.year_s = that.query.year_s-1;
query0.mgroup=that.query.mgroup;
let wrapArr = [],wrapArr0 = [] ,wrapArrs = [],wrapArrs2=[],wrapArrs3=[],wrapArrs4=[];
this.$API.enm.enstat.req(query0).then((res0) => {
let data0 = res0;
if(data0.length>0){
data0.forEach(item0 => {
//
let ind0 = item0.month_s;
wrapArr0[ind0] = item0;
});
}
let query={};
query.page = 0;
query.type='month_s';
query.year_s = that.query.year_s;
query.mgroup=that.query.mgroup;
that.$API.enm.enstat.req(query).then((res) => {
let data = res;
if(data.length>0){
data.forEach(item => {
//
let ind = item.month_s;
let arr = item;
let time = ''+item.year_s+'.'+item.month_s;
arr.time=time;
wrapArr[ind] = arr;
});
//type==1
wrapArr.forEach((item,index)=>{
let ind = item.month_s;
let arrs = [],arrs2 = [],arrs3 = [],arrs4 = [];
arrs[0]=item.time;
arrs2[0]=item.time;
arrs3[0]=item.time;
arrs4[0]=item.time;
arrs[1]=item.elec_consume_unit;
arrs[2]=that.monthGoal[ind]!==undefined?that.monthGoal[ind]:'/';
//KW·h/t
let diff = 0;
if(arrs[2]!=='/'){
diff = arrs[1]-arrs[2];
}else{
diff = '/';
}
arrs[3]=diff;
//KW·h/t
let lastNum = 0;
if(index>1){
let num = index-1;
if(wrapArr[num]&&wrapArr[num].elec_consume_unit){
lastNum = wrapArr[num].elec_consume_unit;
}else{
lastNum='/'
}
}else{
lastNum = wrapArr0[12]?wrapArr0[12].elec_consume_unit:'/';
}
arrs[4]=lastNum;
//KW·h/t
let lastDiff = 0;
if(arrs[1]!=='/'&&arrs[4]!=='/'){
lastDiff =arrs[1]- arrs[4];
}else{
lastDiff = '/';
}
arrs[5]=lastDiff;
//%
let lastRate = 0;
if(lastDiff=='/'&&lastNum!=='/'&&lastNum!==0){
lastRate = (lastDiff/lastNum)*100;
}else{
lastRate = '/'
}
arrs[6]=lastRate;
//%-wrapArr0[ind].elec_consume_unit
let sameRate =0;
if(wrapArr0[index]&&wrapArr0[index].elec_consume_unit){
sameRate =((arrs[1]- wrapArr0[index].elec_consume_unit)/wrapArr0[index].elec_consume_unit)*100
}else{
sameRate='/';
}
arrs[7]=sameRate;
wrapArrs.push(arrs);
arrs2[1]=item.celec_consume_unit;
arrs2[2]=that.monthGoal2[ind]!==undefined?that.monthGoal2[ind]:'/';
arrs2[3]=48;
arrs2[4]=57;
arrs2[5]=61;
//KW·h/t
let lastNum2 = 0,lastDiff2 = 0;
if(index>1){
let num = index-1;
if(wrapArr[num]&&wrapArr[num].celec_consume_unit){
lastNum2 = wrapArr[num].celec_consume_unit;
}else{
lastNum2='/'
}
}else{
lastNum2 = wrapArr0[12]?wrapArr0[12].celec_consume_unit:'/';
}
if(arrs2[1]!=='/'&&lastNum2!=='/'){
lastDiff2 =arrs2[1]- lastNum2;
}else{
lastDiff2 = '/';
}
arrs2[6]=lastDiff2;
//%
let lastRate2 = 0;
if(lastDiff2=='/'&&lastNum2!=='/'&&lastNum2!==0){
lastRate2 = (lastDiff2/lastNum2)*100;
}else{
lastRate2 = '/'
}
arrs2[7]=lastRate2;
//%-wrapArr0[ind].elec_consume_unit
let sameRate2 =0;
if(wrapArr0[index]&&wrapArr0[index].celec_consume_unit){
sameRate2 =((arrs[1]- wrapArr0[index].celec_consume_unit)/wrapArr0[index].celec_consume_unit)*100
}else{
sameRate2='/';
}
arrs2[8]=sameRate2;
wrapArrs2.push(arrs2);
arrs3[1]=item.coal_consume_unit;
arrs3[2]=that.monthGoal3[ind]!==undefined?that.monthGoal3[ind]:'/';
arrs3[3]=94;
arrs3[4]=100;
arrs3[5]=109;
//KW·h/t
let lastNum3 = 0,lastDiff3 = 0;
if(index>1){
let num = index-1;
if(wrapArr[num]&&wrapArr[num].coal_consume_unit){
lastNum3 = wrapArr[num].coal_consume_unit;
}else{
lastNum3='/'
}
}else{
lastNum3 = wrapArr0[12]?wrapArr0[12].coal_consume_unit:'/';
}
if(arrs3[1]!=='/'&&lastNum3!=='/'){
lastDiff3 =arrs3[1]- lastNum3;
}else{
lastDiff3 = '/';
}
arrs3[6]=lastDiff3;
//%
let lastRate3 = 0;
if(lastDiff3=='/'&&lastNum3!=='/'&&lastNum3!==0){
lastRate3 = (lastDiff3/lastNum3)*100;
}else{
lastRate3 = '/'
}
arrs3[7]=lastRate3;
//%-wrapArr0[ind].elec_consume_unit
let sameRate3 =0;
if(wrapArr0[index]&&wrapArr0[index].coal_consume_unit){
sameRate3 =((arrs[1]- wrapArr0[index].coal_consume_unit)/wrapArr0[index].coal_consume_unit)*100
}else{
sameRate3='/';
}
arrs3[8]=sameRate3;
wrapArrs3.push(arrs3);
arrs4[1]=item.cen_consume_unit;
arrs4[2]=that.monthGoal4[ind]!==undefined?that.monthGoal4[ind]:'/';
arrs4[3]=100;
arrs4[4]=107;
arrs4[5]=117;
//KW·h/t
let lastNum4 = 0,lastDiff4 = 0;
if(index>1){
let num = index-1;
if(wrapArr[num]&&wrapArr[num].cen_consume_unit){
lastNum4 = wrapArr[num].cen_consume_unit;
}else{
lastNum4='/'
}
}else{
lastNum4 = wrapArr0[12]?wrapArr0[12].cen_consume_unit:'/';
}
if(arrs4[1]!=='/'&&lastNum4!=='/'){
lastDiff4 =arrs4[1]- lastNum4;
}else{
lastDiff4 = '/';
}
arrs4[6]=lastDiff4;
//%
let lastRate4 = 0;
if(lastDiff4=='/'&&lastNum4!=='/'&&lastNum4!==0){
lastRate4 = (lastDiff4/lastNum4)*100;
}else{
lastRate4 = '/'
}
arrs4[7]=lastRate4;
//%-wrapArr0[ind].elec_consume_unit
let sameRate4 =0;
if(wrapArr0[index]&&wrapArr0[index].cen_consume_unit){
sameRate4 =((arrs[1]- wrapArr0[index].cen_consume_unit)/wrapArr0[index].cen_consume_unit)*100
}else{
sameRate4='/';
}
arrs4[8]=sameRate4;
wrapArrs4.push(arrs4);
})
that.tableDatas = wrapArrs;
that.tableDatas2 = wrapArrs2;
that.tableDatas3 = wrapArrs3;
that.tableDatas4 = wrapArrs4;
// //type==2
// wrapArr.forEach((item,index)=>{
// let arrs = [];
// arrs[0]=item[0];
// arrs[1]=item[1];
// arrs[2]=item[2];
// //KW·h/t//
// //KW·h/t
// let diff = 0;
// if(item[2]!=='/'){
// diff = item[1]-item[2];
// }else{
// diff = '/';
// }
// arrs[3]=diff;
// //KW·h/t
// let lastNum = 0;
// if(index>1){
// let num = index-1;
// if(wrapArr[num]&&wrapArr[num].elec_consume_unit){
// lastNum = wrapArr[num].elec_consume_unit;
// }else{
// lastNum='/'
// }
// }else{
// lastNum = wrapArr0[12]?wrapArr0[12].elec_consume_unit:'/';
// }
// arrs[4]=lastNum;
// //KW·h/t
// let lastDiff = 0;
// if(arrs[1]!=='/'&&arrs[4]!=='/'){
// lastDiff =arrs[1]- arrs[4];
// }else{
// lastDiff = '/';
// }
// arrs[5]=lastDiff;
// //%
// let lastRate = 0;
// if(lastDiff=='/'&&lastNum!=='/'&&lastNum!==0){
// lastRate = (lastDiff/lastNum)*100;
// }else{
// lastRate = '/'
// }
// arrs[6]=lastRate;
// //%-wrapArr0[ind].elec_consume_unit
// let sameRate =0;
// if(wrapArr0[index]&&wrapArr0[index].elec_consume_unit){
// sameRate =((arrs[1]- wrapArr0[index].elec_consume_unit)/wrapArr0[index].elec_consume_unit)*100
// }else{
// sameRate='/';
// }
// arrs[7]=sameRate;
// wrapArrs.push(arrs);
// })
// that.tableDatas2 = wrapArrs2;
// //type==3
// wrapArr.forEach((item,index)=>{
// let arrs = [];
// arrs[0]=item[0];
// arrs[1]=item[1];
// arrs[2]=item[2];
// //KW·h/t//
// //KW·h/t
// let diff = 0;
// if(item[2]!=='/'){
// diff = item[1]-item[2];
// }else{
// diff = '/';
// }
// arrs[3]=diff;
// //KW·h/t
// let lastNum = 0;
// if(index>1){
// let num = index-1;
// if(wrapArr[num]&&wrapArr[num].elec_consume_unit){
// lastNum = wrapArr[num].elec_consume_unit;
// }else{
// lastNum='/'
// }
// }else{
// lastNum = wrapArr0[12]?wrapArr0[12].elec_consume_unit:'/';
// }
// arrs[4]=lastNum;
// //KW·h/t
// let lastDiff = 0;
// if(arrs[1]!=='/'&&arrs[4]!=='/'){
// lastDiff =arrs[1]- arrs[4];
// }else{
// lastDiff = '/';
// }
// arrs[5]=lastDiff;
// //%
// let lastRate = 0;
// if(lastDiff=='/'&&lastNum!=='/'&&lastNum!==0){
// lastRate = (lastDiff/lastNum)*100;
// }else{
// lastRate = '/'
// }
// arrs[6]=lastRate;
// //%-wrapArr0[ind].elec_consume_unit
// let sameRate =0;
// if(wrapArr0[index]&&wrapArr0[index].elec_consume_unit){
// sameRate =((arrs[1]- wrapArr0[index].elec_consume_unit)/wrapArr0[index].elec_consume_unit)*100
// }else{
// sameRate='/';
// }
// arrs[7]=sameRate;
// wrapArrs.push(arrs);
// })
// that.tableDatas3 = wrapArrs3;
// //type==3
// wrapArr.forEach((item,index)=>{
// let arrs = [];
// arrs[0]=item[0];
// arrs[1]=item[1];
// arrs[2]=item[2];
// //KW·h/t//
// //KW·h/t
// let diff = 0;
// if(item[2]!=='/'){
// diff = item[1]-item[2];
// }else{
// diff = '/';
// }
// arrs[3]=diff;
// //KW·h/t
// let lastNum = 0;
// if(index>1){
// let num = index-1;
// if(wrapArr[num]&&wrapArr[num].elec_consume_unit){
// lastNum = wrapArr[num].elec_consume_unit;
// }else{
// lastNum='/'
// }
// }else{
// lastNum = wrapArr0[12]?wrapArr0[12].elec_consume_unit:'/';
// }
// arrs[4]=lastNum;
// //KW·h/t
// let lastDiff = 0;
// if(arrs[1]!=='/'&&arrs[4]!=='/'){
// lastDiff =arrs[1]- arrs[4];
// }else{
// lastDiff = '/';
// }
// arrs[5]=lastDiff;
// //%
// let lastRate = 0;
// if(lastDiff=='/'&&lastNum!=='/'&&lastNum!==0){
// lastRate = (lastDiff/lastNum)*100;
// }else{
// lastRate = '/'
// }
// arrs[6]=lastRate;
// //%-wrapArr0[ind].elec_consume_unit
// let sameRate =0;
// if(wrapArr0[index]&&wrapArr0[index].elec_consume_unit){
// sameRate =((arrs[1]- wrapArr0[index].elec_consume_unit)/wrapArr0[index].elec_consume_unit)*100
// }else{
// sameRate='/';
// }
// arrs[7]=sameRate;
// wrapArrs.push(arrs);
// })
// that.tableDatas3 = wrapArrs3;
}else{
}
})
})
},
itemClick(type,item){
this.type=type;
this.asynDialog = true;
},
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>

View File

@ -242,10 +242,10 @@ export default {
apiObj: this.$API.wpm.sflog.list,
apiObj2: null,
query: {
mgroup: "3346520558031773696",
mgroup: "",
},
deptId: "3345780809943797760",
mgroupItem: {},
deptId: "",
sflogItem: {},
selection: [],
modelValue: true,
@ -261,7 +261,14 @@ export default {
};
},
mounted() {
this.getTeam();
this.$API.mtm.mgroup.list
.req({ page: 0, search: "石灰石破碎" })
.then((res) => {
this.mgroupItem = res[0];
this.query.mgroup = res[0].id;
this.deptId = res[0].belong_dept;
this.getTeam();
});
this.getShfit();
},
methods: {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,459 +0,0 @@
<template>
<div>
<div id="main" style="width:1200px;height:600px;"></div>
</div>
</template>
<script>
const colors = [ '#647bfe', '#a9b6fe','#cbd3fe','#91CC75', '#EE6666'];
import * as echarts from 'echarts';
export default {
name: "echartsmorey",
data() {
return {
list: [
{
x: 1,
y: 1,
z: 99,
k: 11
},
{
x: 2,
y: 2,
z: 70,
k: 11
},
{
x: 3,
y: 3,
z: 1,
k: 11
},
{
x: 4,
y: 4,
z: 30,
k: 11
},
{
x: 5,
y: 1,
z: 20,
k: 11
},
{
x: 6,
y: 0,
z: 18,
k: 11
},
{
x: 7,
y: 10,
z: 12,
k: 11
}
],
dataX: [],
dataY: [],
dataY2: [],
option : {
color: [ '#647bfe', '#8698fe', '#a9b6fe','#cbd3fe','#91CC75', '#EE6666'],
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
}
},
grid: {
right: '20%',
left:'20%'
},
toolbox: {
feature: {
dataView: { show: true, readOnly: false },
restore: { show: true },
saveAsImage: { show: true }
}
},
legend: {
data: ['总产量', '台时产量', '运转率', '分布电耗', '单位产品标煤耗', '成本']
},
xAxis: [
{
type: 'category',
axisTick: {
alignWithLabel: true
},
// prettier-ignore
data: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
}
],
yAxis: [
{
type: 'value',
name: '产量 (t)',
position: 'right',
alignTicks: true,
axisLine: {
show: true,
lineStyle: {
color: colors[0]
}
},
axisLabel: {
formatter: '{value}'
}
},
{
type: 'value',
name: '运转率 (%)',
position: 'right',
alignTicks: true,
offset: 80,
axisLine: {
show: true,
lineStyle: {
color: colors[1]
}
},
axisLabel: {
formatter: '{value}'
}
},
{
type: 'value',
name: '成本(元)',
position: 'right',
alignTicks: true,
offset: 160,
axisLine: {
show: true,
lineStyle: {
color: colors[2]
}
},
axisLabel: {
formatter: '{value}'
}
},
{
type: 'value',
name: '分布电耗(KW.h)',
position: 'left',
alignTicks: true,
axisLine: {
show: true,
lineStyle: {
color: colors[3]
}
},
axisLabel: {
formatter: '{value} '
}
},
{
type: 'value',
name: '标煤耗 (t)',
position: 'left',
alignTicks: true,
offset: 80,
min:0,max:180,
axisLine: {
show: true,
lineStyle: {
color: colors[4]
}
},
axisLabel: {
formatter: '{value}'
}
}
],
series: [
{
name: '总产量',
type: 'bar',
yAxisIndex:0,
data: [100, 120, 110, 130, 140, 120, 110, 120, 100,150, 120, 160]
},
{
name: '台时产量',
type: 'bar',
data: [
2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3
]
},
{
name: '运转率',
type: 'bar',
yAxisIndex: 1,
data: [
2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3
]
},
{
name: '分布电耗',
type: 'line',
yAxisIndex: 2,
data: [2.0, 2.2, 3.3, 4.5, 6.3, 10.2, 20.3, 23.4, 23.0, 16.5, 12.0, 6.2]
},
{
name: '单位产品标煤耗',
type: 'bar',
yAxisIndex: 2,
data: [2.0, 2.2, 3.3, 4.5, 6.3, 10.2, 20.3, 23.4, 23.0, 16.5, 12.0, 6.2]
}
]
}
};
},
methods: {
init(dataX, dataY) {
this.myChart = echarts.init(document.getElementById("main"));
// 使
this.myChart.setOption(this.option);
}
},
mounted() {
this.$nextTick(() => {
this.dataX = this.list.map(item => item.x);
// 1Y
this.dataY.push({
name: "AA",
type: "line", // 线
yAxisIndex: 0, // Y
symbolSize: '10',
// lineStyle: { color: '#4485f4' },
data: this.list.map(item => item.y)
});
// 2Y
this.dataY.push({
name: "BB",
type: "line",
yAxisIndex: 1, // Y
data: this.list.map(item => item.z)
});
// 3Y
this.dataY.push({
name: "CC",
type: "line",
yAxisIndex: 2, // Y
data: this.list.map(item => item.k)
});
this.init(this.dataX, this.dataY);
});
let option = {
//
title: {
text: '多坐标折线图',
subtext: '小标题',
x: 'left'
},
color:['#ff0000','#00ff00','#0000ff'],
//
legend: {
icon: "stack",
data: ["AA", "BB", "CC"],
orient: 'horizontal', // 'horizontal' 'vertical'
x: 'center', // 'center''left''right''number' px
y: '10',// 'top''bottom''center''number' px
},
tooltip: {
trigger: "axis",
axisPointer: {
animation: true
}
},
//
toolbox: {
x: 1100,
y: 0,
feature: {
saveAsImage: {
name: `test`
}
}
},
// px
grid: {
left: "5%", //
right: "20%",
top: "15%"
},
// X
// dataZoom: [
// {
// type: "slider",
// show: true,
// start: 0, //
// end: 100 //
// }
// ],
xAxis: [
{
type: "category",
// name:'',
// x
nameTextStyle: {
fontWeight: 600,
fontSize: 14
},
// X
axisLine: {
show:true,
lineStyle: {
color: '#3366CC'
}
},
// X 线
splitLine: {
show: false,
lineStyle: {
color: ["#cccccc"],
width: 2,
type: "solid"
}
},
axisLabel: {
rotate: 45, // X
interval: 0 // X 0
},
axisTick: {
show: false, // 线
},
boundaryGap: true, // Y
data: dataX
},
{ type: 'category',
data: dataX,
position: 'top',
offset: 20,
boundaryGap: true, // Y
axisLine: {
show: true, // 线
lineStyle: {
color: '#3366CC'
}
// symbol: ['none', 'arrow'], // 线nonearrow
// symbolSize: [10, 15], // 线
// lineStyle: {
// color: '#333', // 线线
// width: '5', // 线线
// type: 'solid', // 线线solid线dashed线dotted
// },
},
axisLabel: {
show: false, //
},
// axisTick: {
// show: true, // 线
// length: 2 // 线
// }
}
],
yAxis: [
{
name: "AA",
type: "value",
// y
nameTextStyle: {
fontWeight: 500,
fontSize: 14
},
//min:0, // Y
//max:4000, // Y
position: "left",
offset:10,
splitNumber: 10, // Y
//y线
axisLine: {
show:true,
lineStyle: { // Y
color: '#ff0000' ,
width: 2,
type: "solid"
}
},
//axisTick线
axisTick:{
show:false
},
//
splitLine: {
// Y 线
show: true,
lineStyle: {
color: ["#ff0000"],
width: 2,
type: "solid"
}
}
},
{
name: "BB",
type: "value",
position: "right",
offset:10,
splitNumber: 10, // Y
//y线
axisLine: {
show:true,
lineStyle: { // Y
color: '#00ff00' ,
width: 2,
type: "solid"
}
},
splitLine: {
// Y 线
show: true,
lineStyle: {
color: ["#f3f0f0"],
width: 2,
type: "solid"
}
}
},
{
name: "CC",
type: "value",
offset: 70,
nameGap: 30, //
position: "right",
splitNumber: 10, // Y
//y线
axisLine: {
show:true,
lineStyle: { // Y
color: '#0000ff' ,
width: 2,
type: "solid"
}
},
splitLine: {
// Y 线
show: true,
lineStyle: {
color: ["#f3f0f0"],
width: 2,
type: "solid"
}
}
}
],
series: dataY
};
}
};
</script>
<style scoped>
</style>

View File

@ -1,74 +0,0 @@
<!-- 质量检验 -->
<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="datetime" value-format="YYYY-MM-DD HH:mm:ss"
format="YYYY-MM-DD HH:mm:ss" placeholder="开始时间" />
<el-date-picker v-model="query.end_time__day" type="date" value-format="YYYY-MM-DD" format="YYYY-MM-DD"
placeholder="结束时间" />
<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>
<el-row gutter="6">
<el-col :span="12"><el-card style="height: 300px;"></el-card></el-col>
<el-col :span="12"><el-card style="height: 300px;"></el-card></el-col>
<el-col :span="12"><el-card style="height: 300px;"></el-card></el-col>
<el-col :span="12"><el-card style="height: 300px;"></el-card></el-col>
</el-row>
</el-main>
</el-container>
</template>
<script>
export default {
name: "listSon",
data() {
return {
query: {
mgroup: '3346520558031773696',
},
options: [],
optionsShift: [],
};
},
mounted() {
this.getTeam();
this.getShift();
},
methods: {
getTeam() {
this.$API.mtm.team.list.req({ page: 0 }).then(res => {
this.options = res;
})
},
getShift() {
this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
this.optionsShift = res;
})
},
//
sflog_check(row) {
this.dialog.check = true;
this.$nextTick(() => {
this.$refs.checkDialog.open("edit").setData(row);
});
},
handleQuery() {
this.$API.wpm.sflog.list.req(this.query).then(res => {
debugger;
console.log(res)
})
},
},
};
</script>

View File

@ -1,123 +0,0 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-select
v-model="query.mgroup"
placeholder="工段"
clearable
style="width: 120px;margin-right: 5px;"
>
<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" hidePagination>
<el-table-column label="#" type="index" width="50"></el-table-column>
<el-table-column label="开始时间" prop="start_time" min-width="100"></el-table-column>
<el-table-column label="结束时间" prop="end_time" min-width="100"></el-table-column>
<el-table-column label="停机时长" prop="duration" min-width="150"></el-table-column>
<el-table-column label="关联工段" prop="mgroup_name" min-width="150"></el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="140">
<template #default="scope">
<el-button link size="small" @click="table_edit(scope.row)" v-auth="'team.update'" type="primary">编辑</el-button>
<el-divider direction="vertical"></el-divider>
<el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)">
<template #reference>
<el-button link size="small" v-auth="'role.delete'" type="danger">删除</el-button>
</template>
</el-popconfirm>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
</template>
<script>
import saveDialog from "./feeset_form.vue";
export default {
name: 'dept',
components: {
saveDialog
},
data() {
return {
apiObj: this.$API.wpm.stlog,
query: {
mgroup:'',
},
dialog: {
save: false,
},
selection:[],
options:[],
}
},
mounted(){
this.getMgroup();
},
methods: {
//
getMgroup(){
this.$API.mtm.mgroup.list.req({page:0}).then(res=>{
this.options = res;
})
},
// //
// table_add() {
// this.dialog.save = true;
// this.$nextTick(() => {
// this.$refs.saveDialog.open("add");
// });
// },
//
table_edit(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("edit").setData(row);
});
},
//
async table_del(row){
var id = row.id;
var res = await this.$API.mtm.mgroup.delete.req(id);
if(res.err_msg){
this.$message.error(res.err_msg)
}else{
this.$refs.table.refresh();
this.$message.success("删除成功")
}
},
//
selectionChange(selection){
this.selection = selection;
},
//
handleQuery(){
this.$refs.table.queryData(this.query)
},
//
//
handleSaveSuccess(data, mode) {
this.dialog.save = false;
this.$refs.table.refresh();
},
}
}
</script>
<style scoped>
.treeMain {width: 100%;height:280px;overflow: auto;border: 1px solid #dcdfe6;margin-bottom: 10px;}
</style>

View File

@ -1,181 +0,0 @@
<template>
<div class="app-container">
<el-header>
<div class="left-panel">
<el-button
type="primary"
@click="exportExcel()"
:loading = "exportLoading"
>导出xlsx
</el-button>
<el-button
type="primary"
@click="handlePrint"
>打印
</el-button>
</div>
</el-header>
<el-card style="margin-top:5px">
<div ref="print" id="myReport" class="printContainer">
<table border="1" cellspacing="0" :key="timeStamp" id="myTable" class="myTable">
<thead class="myTableHead">
<tr>
<th colspan="12">全厂能源统计</th>
</tr>
<tr>
<th rowspan="2">月份</th>
<th rowspan="2">工业总产值万元</th>
<th rowspan="2">工业增加值万元</th>
<th colspan="3">综合能源消费</th>
<th colspan="3">单位总产值能耗</th>
<th colspan="3">单位工业增加值能耗</th>
</tr>
<tr>
<th>当期值tce</th>
<th>环比增长率%</th>
<th>同比增长率%</th>
<th>当期值tce/万元</th>
<th>环比增长率%</th>
<th>同比增长率%</th>
<th>当期值tce/万元</th>
<th>环比增长率%</th>
<th>同比增长率%</th>
</tr>
</thead>
<tr v-for="(item,index) in tableDatas" :key="index">
<td class="numCell" v-for="item1 in item" :key="item1">{{item1}}</td>
</tr>
</table>
</div>
</el-card>
</div>
</template>
<script>
export default {
data() {
return {
timeStamp:0,
year_s:'',
tableDatas:[],
};
},
mounted() {
let that = this;
var myDate = new Date();
let year = myDate.getFullYear();
that.year_s = year;
this.getData();
},
methods: {
getData(){
let that = this;
let wrapArr = [],wrapArr2 = [];
let obj = {};
obj.year_s = this.year_s-1;
obj.page = 0;
that.$API.enm.enstat2.req(obj).then((res) => {
if(res.length>0){
res.forEach(item=>{
let ind = item.month_s-1;
wrapArr[ind] =item;
})
}else{}
let obj2 = {};
obj2.year_s = this.year_s;
obj2.page = 0;
that.$API.enm.enstat2.req(obj2).then((res2) => {
if(res2.length>0){
res2.forEach(item2=>{
let ind2 = item2.month_s-1;
wrapArr2[ind2] =item2;
})
}else{}
for(let i=0;i<wrapArr2.length;i++){
if(Boolean(wrapArr2[i])){
if(this.tableDatas[i]){}else{
this.tableDatas[i] = [];
}
let time = wrapArr2[i].year_s+'.'+wrapArr2[i].month_s;
this.tableDatas[i][0] = time;
this.tableDatas[i][1] = wrapArr2[i].industry_total_val;
this.tableDatas[i][2] = wrapArr2[i].industry_add_val;
this.tableDatas[i][3] = wrapArr2[i].en_consume;
let tValue3 = 0,hValue3 = 0,tPercent3 = 0,hPercent3 = 0;
if(wrapArr2[i].month_s>1){
tValue3 = wrapArr2[i-1]?wrapArr2[i-1].en_consume:'/';
}else{
tValue3 = wrapArr[12]? wrapArr[12].en_consume:'/';
}
if(tValue3!=='/'&&tValue3!==0){
tPercent3 = (wrapArr2[i].en_consume-tValue3)/tValue3*100;
}else{
tPercent3 = '/';
}
hValue3 = wrapArr[i]?wrapArr[i].en_consume:'/';
if(hValue3!=='/'&&hValue3!==0){
hPercent3 = (wrapArr2[i].en_consume-hValue3)/hValue3*100;
}else{
hPercent3 = '/';
}
this.tableDatas[i][4] = hPercent3;
this.tableDatas[i][5] = tPercent3;
this.tableDatas[i][6] = wrapArr2[i].en_consume_unit;
let tValue6 = 0,hValue6 = 0,tPercent6 = 0,hPercent6 = 0;
if(wrapArr2[i].month_s>1){
tValue6 = wrapArr2[i-1]?wrapArr2[i-1].en_consume_unit:'/';
}else{
tValue6 = wrapArr[12]? wrapArr[12].en_consume_unit:'/';
}
if(tValue6!=='/'&&tValue6!==0){
tPercent6 = (wrapArr2[i].en_consume_unit-tValue6)/tValue6*100;
}else{
tPercent6 = '/';
}
hValue6 = wrapArr[i]?wrapArr[i].en_consume_unit:'/';
if(hValue6!=='/'&&hValue6!==0){
hPercent6 = (wrapArr2[i].en_consume_unit-hValue6)/hValue6*100;
}else{
hPercent6 = '/';
}
this.tableDatas[i][7] = hPercent6;
this.tableDatas[i][8] = tPercent6;
this.tableDatas[i][9] = wrapArr2[i].en_add_consume_unit;
let tValue9 = 0,hValue9 = 0,tPercent9 = 0,hPercent9 = 0;
if(wrapArr2[i].month_s>1){
tValue9 = wrapArr2[i-1]?wrapArr2[i-1].en_add_consume_unit:'/';
}else{
tValue9 = wrapArr[12]? wrapArr[12].en_add_consume_unit:'/';
}
if(tValue9!=='/'&&tValue9!==0){
tPercent9 = (wrapArr2[i].en_add_consume_unit-tValue9)/tValue9*100;
}else{
tPercent9 = '/';
}
hValue9 = wrapArr[i]?wrapArr[i].en_add_consume_unit:'/';
if(hValue9!=='/'&&hValue9!==0){
hPercent9 = (wrapArr2[i].en_add_consume_unit-hValue9)/hValue9*100;
}else{
hPercent9 = '/';
}
this.tableDatas[i][10] = hPercent9;
this.tableDatas[i][11] = tPercent9;
}else{
}
}
})
})
},
exportExcel() {
this.exportLoading = true;
this.$XLSX('#myTable', this.tableName)
this.exportLoading = false;
},
handlePrint() {
this.$PRINT('#myReport');
},
}
};
</script>
<style>
</style>