能源
This commit is contained in:
@@ -1,161 +1,171 @@
|
||||
<template>
|
||||
<div class="app-container" id='energyReportSearchBox'>
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
:isFold="isFold"
|
||||
@headBtnClick="buttonClick"
|
||||
/>
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH"
|
||||
/>
|
||||
<pagination
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="app-container"
|
||||
id="energyReportSearchBox">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
:isFold="isFold"
|
||||
@headBtnClick="buttonClick" />
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH" />
|
||||
<pagination
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { energyReportPage, energyReportPageExport } from "@/api/monitoring/energyReport";
|
||||
import { getEnergyTypeListAll } from "@/api/base/energyType"
|
||||
import {
|
||||
energyReportPage,
|
||||
energyReportPageExport,
|
||||
} from '@/api/monitoring/energyReport';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import { getEnergyTypeListAll } from '@/api/base/energyType';
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'statisticName',
|
||||
label: '统计方案'
|
||||
},
|
||||
{
|
||||
prop: 'energyType',
|
||||
label: '能源类型'
|
||||
},
|
||||
{
|
||||
prop: 'startValue',
|
||||
label: '抄表数(起始)'
|
||||
},
|
||||
{
|
||||
prop: 'endValue',
|
||||
label: '抄表数(结束)'
|
||||
},
|
||||
{
|
||||
prop: 'diffValue',
|
||||
label: '消耗量'
|
||||
}
|
||||
]
|
||||
{
|
||||
prop: 'statisticName',
|
||||
label: '统计方案',
|
||||
},
|
||||
{
|
||||
prop: 'energyType',
|
||||
label: '能源类型',
|
||||
filter: publicFormatter('energy_type'),
|
||||
},
|
||||
{
|
||||
prop: 'startValue',
|
||||
label: '抄表数(起始)',
|
||||
},
|
||||
{
|
||||
prop: 'endValue',
|
||||
label: '抄表数(结束)',
|
||||
},
|
||||
{
|
||||
prop: 'diffValue',
|
||||
label: '消耗量',
|
||||
},
|
||||
];
|
||||
export default {
|
||||
name: "EnergyReportSearch",
|
||||
data() {
|
||||
return {
|
||||
isFold: false,
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '统计方案',
|
||||
param: 'statisticName'
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '能源类型',
|
||||
selectOptions: [],
|
||||
param: 'energyTypeId',
|
||||
filterable: true
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间',
|
||||
dateType: 'datetimerange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: "timestamp",
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'timeVal',
|
||||
defaultSelect: [],
|
||||
width: 350,
|
||||
clearable: false
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary'
|
||||
},
|
||||
{
|
||||
type: 'separate'
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('monitoring:energy-report-search:export') ? 'button' : '',
|
||||
btnName: '导出',
|
||||
name: 'add',
|
||||
color: 'primary',
|
||||
plain: true
|
||||
}
|
||||
],
|
||||
tableProps,
|
||||
tableH: this.tableHeight(260),
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 班次基础信息列表
|
||||
list: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
statisticName: null,
|
||||
startTime: null,
|
||||
endTime: null
|
||||
},
|
||||
energyTypeList: []
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
this.isFold = this.searchBarWidth('energyReportSearchBox', 1180)
|
||||
})
|
||||
this.getList()
|
||||
this.getTypeList()
|
||||
this.isFold = this.searchBarWidth('energyReportSearchBox', 1180)
|
||||
},
|
||||
methods: {
|
||||
getTypeList() {
|
||||
getEnergyTypeListAll().then((res) => {
|
||||
this.formConfig[1].selectOptions = res.data || []
|
||||
})
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.queryParams.pageNo = 1
|
||||
this.queryParams.statisticName = val.statisticName
|
||||
this.queryParams.energyTypeId = val.energyTypeId
|
||||
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null
|
||||
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null
|
||||
this.getList()
|
||||
break
|
||||
default:
|
||||
this.$modal.confirm('是否确认导出').then(() => {
|
||||
return energyReportPageExport({...this.queryParams});
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '能源统计查询报表.xls');
|
||||
}).catch(() => {})
|
||||
}
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
energyReportPage({...this.queryParams}).then(response => {
|
||||
this.list = response.data.list || [];
|
||||
this.total = response.data.total;
|
||||
});
|
||||
}
|
||||
}
|
||||
name: 'EnergyReportSearch',
|
||||
data() {
|
||||
return {
|
||||
isFold: false,
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '统计方案',
|
||||
param: 'statisticName',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '能源类型',
|
||||
labelField: 'labelName',
|
||||
selectOptions: [],
|
||||
param: 'energyTypeId',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间',
|
||||
dateType: 'datetimerange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'timestamp',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'timeVal',
|
||||
defaultSelect: [],
|
||||
width: 350,
|
||||
clearable: false,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('monitoring:energy-report-search:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
name: 'add',
|
||||
color: 'primary',
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
tableProps,
|
||||
tableH: this.tableHeight(260),
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 班次基础信息列表
|
||||
list: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
statisticName: null,
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
},
|
||||
energyTypeList: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260);
|
||||
this.isFold = this.searchBarWidth('energyReportSearchBox', 1180);
|
||||
});
|
||||
this.getList();
|
||||
this.getTypeList();
|
||||
this.isFold = this.searchBarWidth('energyReportSearchBox', 1180);
|
||||
},
|
||||
methods: {
|
||||
getTypeList() {
|
||||
getEnergyTypeListAll().then((res) => {
|
||||
this.formConfig[1].selectOptions = res.data || [];
|
||||
});
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.queryParams.pageNo = 1;
|
||||
this.queryParams.statisticName = val.statisticName;
|
||||
this.queryParams.energyTypeId = val.energyTypeId;
|
||||
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null;
|
||||
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null;
|
||||
this.getList();
|
||||
break;
|
||||
default:
|
||||
this.$modal
|
||||
.confirm('是否确认导出')
|
||||
.then(() => {
|
||||
return energyReportPageExport({ ...this.queryParams });
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '能源统计查询报表.xls');
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
energyReportPage({ ...this.queryParams }).then((response) => {
|
||||
this.list = response.data.list || [];
|
||||
this.total = response.data.total;
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user