change - 峰平谷耗量报表

main
yinq 5 months ago
parent 2d0e4917af
commit 7d03b5a25b

@ -1,6 +1,6 @@
import request from '@/utils/request'
// 查询水整点数据列
// 查询统计能耗报
export function energyStatisticalReportList(query) {
return request({
url: '/ems/report/energyStatisticalReportList',
@ -8,3 +8,12 @@ export function energyStatisticalReportList(query) {
params: query
})
}
// 查询峰平谷耗量报表
export function peaksValleysConsumptionReportList(query) {
return request({
url: '/ems/report/peaksValleysConsumptionReportList',
method: 'get',
params: query
})
}

@ -84,8 +84,8 @@
<dict-tag :options="dict.type.price_type" :value="scope.row.priceType"/>
</template>
</el-table-column>
<el-table-column label="用电起始小时" align="center" prop="startHour" v-if="columns[3].visible"/>
<el-table-column label="用电结束小时" align="center" prop="endHour" v-if="columns[4].visible"/>
<el-table-column label="用电起始小时" align="center" prop="startHour" v-if="columns[3].visible"/>
<el-table-column label="用电结束小时" align="center" prop="endHour" v-if="columns[4].visible"/>
<el-table-column label="电单价" align="center" prop="dnbPrice" v-if="columns[5].visible"/>
<el-table-column label="备注" align="center" prop="remark" v-if="columns[6].visible"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100">
@ -134,11 +134,27 @@
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="用电起始小时数" prop="startHour">
<el-input-number v-model="form.startHour" placeholder="请输入用电起始小时数"/>
<el-form-item label="用电起始小时" prop="startHour">
<el-time-picker
v-model="form.startHour"
clearable
placeholder="请选择用电起始小时"
format="HH:mm:ss"
value-format="HH:mm:ss"
:picker-options="{selectableRange: '00:00:00 - 23:59:59'}"
>
</el-time-picker>
</el-form-item>
<el-form-item label="用电结束小时数" prop="endHour">
<el-input-number v-model="form.endHour" placeholder="请输入用电结束小时数"/>
<el-form-item label="用电结束小时" prop="endHour">
<el-time-picker
v-model="form.endHour"
clearable
placeholder="请选择用电结束小时"
format="HH:mm:ss"
value-format="HH:mm:ss"
:picker-options="{selectableRange: '00:00:00 - 23:59:59'}"
>
</el-time-picker>
</el-form-item>
<el-form-item label="电单价" prop="dnbPrice">
<el-input-number v-model="form.dnbPrice" placeholder="请输入电单价"/>
@ -212,8 +228,8 @@ export default {
{ key: 0, label: `自增标识`, visible: false },
{ key: 1, label: `记录月份`, visible: true },
{ key: 2, label: `分时电价类型`, visible: true },
{ key: 3, label: `用电起始小时`, visible: true },
{ key: 4, label: `用电结束小时`, visible: true },
{ key: 3, label: `用电起始小时`, visible: true },
{ key: 4, label: `用电结束小时`, visible: true },
{ key: 5, label: `电单价`, visible: true },
{ key: 6, label: `备注`, visible: true }
]

@ -99,7 +99,6 @@
<script>
import { getWorkUnitTrees } from '@/api/ems/base/baseWorkUnit'
import {listBaseMonitorInfo} from '@//api/ems/base/baseMonitorInfo'
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { energyStatisticalReportList } from '@//api/ems/report/reportPort.js'
@ -195,7 +194,6 @@ export default {
getWorkUnitTrees() {
getWorkUnitTrees().then(response => {
this.workUnitOptions = [];
console.log(response.data)
this.workUnitOptions = JSON.parse(JSON.stringify(response.data).replaceAll('id','id2').replaceAll('code','id'));
});
},
@ -212,8 +210,9 @@ export default {
/** 查询统计计量信息列表 */
getList() {
this.loading = true;
// this.queryParams = {};
if (null != this.daterangeCollectTime && '' != this.daterangeCollectTime) {
this.queryParams.beginCollectTime = null;
this.queryParams.endCollectTime = null;
if (this.daterangeCollectTime != null && this.daterangeCollectTime !== '') {
this.queryParams.beginCollectTime = this.daterangeCollectTime[0];
this.queryParams.endCollectTime = this.daterangeCollectTime[1];
}

@ -0,0 +1,267 @@
<template>
<div class="app-container">
<el-row :gutter="20">
<el-col :span="5" :xs="24">
<div class="head-container">
<el-input
v-model="workUnitName"
placeholder="请输入统计单元名称"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
</div>
<div class="head-container">
<el-tree
:data="workUnitOptions"
:props="workUnitProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
node-key="id"
default-expand-all
highlight-current
@node-click="handleNodeClick"
/>
</div>
</el-col>
<el-col :span="19" :xs="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
label-width="100px">
<el-form-item label="日期类型" prop="dateType">
<el-select v-model="queryParams.dateType" placeholder="请选择日期类型">
<el-option
v-for="item in dateTypeList"
:key="item.dateTypeCode"
:label="item.dateTypeName"
:value="item.dateTypeCode"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="采集日期">
<el-date-picker
v-model="daterangeCollectTime"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="monitorWorkUnitList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="主键标识" align="center" prop="objId" v-if="columns[0].visible" />
<el-table-column label="统计单元编号" align="center" prop="workUnitCode" v-if="columns[1].visible" />
<el-table-column label="统计单元名称" align="center" prop="workUnitName" v-if="columns[2].visible" />
<el-table-column label="统计日期" align="center" prop="pointTime" v-if="columns[3].visible" />
<el-table-column label="分时类型" align="center" prop="priceType" v-if="columns[4].visible" />
<el-table-column label="耗量(kwh)" align="center" prop="expend" v-if="columns[5].visible" />
<el-table-column label="价格" align="center" prop="price" v-if="columns[6].visible" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
</div>
</template>
<script>
import { getWorkUnitTrees } from '@/api/ems/base/baseWorkUnit'
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { peaksValleysConsumptionReportList } from '@//api/ems/report/reportPort.js'
import { parseTime } from '@//utils/ruoyi'
export default {
name: "PeaksValleysConsumptionReport",
components: {
Treeselect
}, data() {
return {
monitorInfoOptions: [],
workUnitOptions: [],
workUnitName: undefined,
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
monitorWorkUnitList: [],
daterangeCollectTime: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
monitorCode: null,
workUnitCode: null,
monitorStatus: null,
monitorType: null,
dateType: 10,
},
//
form: {},
workUnitProps: {
children: "children",
label: "label"
},
dateTypeList: [
{dateTypeCode: 19, dateTypeName: '时'},
{dateTypeCode: 10, dateTypeName: '日'},
{dateTypeCode: 7, dateTypeName: '月'},
{dateTypeCode: 4, dateTypeName: '年'},
],
columns: [
{key: 0, label: `主键标识`, visible: false},
{key: 1, label: `统计单元编号`, visible: true},
{key: 2, label: `统计单元名称`, visible: true},
{key: 3, label: `统计日期`, visible: true},
{key: 4, label: `分时类型`, visible: true},
{key: 5, label: `仪表值(kwh)`, visible: true},
{key: 6, label: `价格`, visible: true},
]
};
},
created() {
const nowDate = parseTime(new Date(), '{y}-{m}-{d}')
this.daterangeCollectTime[0] = nowDate
this.daterangeCollectTime[1] = nowDate
this.getList();
this.getWorkUnitTrees();
},
watch: {
//
workUnitName(val) {
this.$refs.tree.filter(val);
}
},
methods: {
/** 转换统计单元信息数据结构 */
workUnitOptionsNormalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id2: node.workUnitCode,
label2: node.workUnitName,
children2: node.children
};
},
/** 查询计量设备下拉树结构 */
getWorkUnitTrees() {
getWorkUnitTrees().then(response => {
this.workUnitOptions = [];
this.workUnitOptions = JSON.parse(JSON.stringify(response.data).replaceAll('id','id2').replaceAll('code','id'));
});
},
//
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
//
handleNodeClick(data) {
this.queryParams.workUnitCode = data.id;
this.handleQuery();
},
/** 查询统计计量信息列表 */
getList() {
this.loading = true;
this.queryParams.beginCollectTime = null;
this.queryParams.endCollectTime = null;
if (this.daterangeCollectTime != null && this.daterangeCollectTime !== '') {
this.queryParams.beginCollectTime = this.daterangeCollectTime[0];
this.queryParams.endCollectTime = this.daterangeCollectTime[1];
}
peaksValleysConsumptionReportList(this.queryParams).then(response => {
this.monitorWorkUnitList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
parentIds: null,
parentId: null,
objId: null,
monitorCode: null,
workUnitCode: null,
monitorStatus: 0,
monitorType: 1,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams.workUnitCode = null;
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.objId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 导出按钮操作 */
handleExport() {
this.download('ems/report/peaksValleysConsumptionReportList/export', {
...this.queryParams
}, `峰平谷耗量报表_${new Date().getTime()}.xlsx`)
}
}
};
</script>
Loading…
Cancel
Save