This commit is contained in:
2025-10-30 13:37:52 +08:00
parent d859ba62c8
commit c9c8f82910
31 changed files with 1485 additions and 397 deletions

View File

@@ -54,7 +54,7 @@
:page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize"
:total="listQuery.total"
@pagination="getDataList" />
@pagination="getNavDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@@ -86,24 +86,27 @@ import ButtonNav from '@/components/ButtonNav';
const tableProps = [
{
prop: 'recTime',
prop: 'time',
label: '日期',
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
},
{
prop: 'remark',
label: '备注',
},
{
prop: 'energyTypeName',
label: '能源类型',
},
{
prop: 'bindObjectName',
label: '监控对象',
filter: (val) => (val != null ? val : '--'),
},
{
prop: 'meterName',
label: '抄表名',
filter: (val) => (val != null ? val : '--'),
},
// {
// prop: 'bindObjectName',
// label: '监控对象',
// filter: (val) => (val != null ? val : '--'),
// },
// {
// prop: 'meterName',
// label: '抄表名',
// filter: (val) => (val != null ? val : '--'),
// },
{
prop: 'quantity',
label: '累计使用量',
@@ -115,20 +118,24 @@ const tableProps = [
},
];
const tableProps2 = [
{
prop: 'remark',
label: '备注',
},
{
prop: 'energyTypeName',
label: '能源类型',
},
{
prop: 'bindObjectName',
label: '监控对象',
filter: (val) => (val != null ? val : '--'),
},
{
prop: 'meter',
label: '抄表名',
filter: (val) => (val != null ? val : '--'),
},
// {
// prop: 'bindObjectName',
// label: '监控对象',
// filter: (val) => (val != null ? val : '--'),
// },
// {
// prop: 'meter',
// label: '抄表名',
// filter: (val) => (val != null ? val : '--'),
// },
{
prop: 'quantity',
label: '累计使用量',
@@ -207,13 +214,16 @@ export default {
{
type: 'datePicker',
label: '时间范围',
dateType: 'daterange',
format: 'yyyy-MM-dd',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
defaultTime: ['08:30:00', '08:30:00'],
param: 'searchTime',
width: 350,
clearable: false,
},
{
type: 'button',
@@ -237,10 +247,11 @@ export default {
activeName: 'his',
tableProps,
tableProps2,
tableBtn: [{
type: 'edit',
btnName: '编辑',
}
tableBtn: [
{
type: 'edit',
btnName: '编辑',
},
].filter((v) => v),
tableData: [],
tableData2: [],
@@ -262,26 +273,18 @@ export default {
},
methods: {
buttonClick(val) {
if (val.statisticType === 2) {
this.tableProps[0].filter = (val) =>
parseTime(val, '{y}年第{w}周');
}else{
this.tableProps[0].filter = (val) =>
parseTime(val, '{y}年{m}月{d}日');
}
this.formConfig2[1].startPlaceholder = '开始时间';
this.formConfig2[1].endPlaceholder = '结束时间';
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.energyTypeId = val.name || null;
this.listQuery.statisticType = val.statisticType || 1;
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
this.listQuery.endTime = val.searchTime
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
: null;
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;
if (this.activeName === 'his') {
this.listQuery.endTime = val.searchTime
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
: null;
this.getDataList();
} else {
this.getDataList2();
@@ -292,13 +295,16 @@ export default {
break;
case 'export':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.energyTypeId = val.name || null;
this.listQuery.statisticType = val.statisticType || 1;
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
this.listQuery.endTime = val.searchTime
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
: null;
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;
if (this.activeName === 'his') {
this.listQuery.endTime = val.searchTime
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
: null;
}
this.handleExport();
break;
default:
@@ -320,15 +326,26 @@ export default {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 00:00:00';
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 23:59:59';
this.formConfig2[1].startPlaceholder = parseTime(start).substr(0, 10);
this.formConfig2[1].endPlaceholder = parseTime(end).substr(0, 10);
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 08:30:00';
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 08:30:00';
this.$nextTick(() => {
this.$refs.searchBarForm2.formInline.searchTime = [
this.listQuery.startTime,
this.listQuery.endTime,
];
});
this.listQuery.name = null;
this.listQuery.pageNo = 1;
this.getDataList2();
}
},
getNavDataList() {
if (this.activeName === 'his') {
this.getDataList();
} else {
this.getDataList2();
}
},
// 获取数据2列表
getDataList2() {
if (this.listQuery.startTime) {