电表报表

This commit is contained in:
白菜
2025-07-09 23:52:19 +08:00
parent b8827248cb
commit 0336e67ac5
6 changed files with 118 additions and 55 deletions

View File

@ -1,10 +1,10 @@
<template>
<div style="width:100%">
<div style="width:100%" v-loading="loading">
<!-- 搜索栏-->
<el-form :inline="true" class="select-container">
<el-form-item label="电表">
<el-select v-model="search.deviceId" placeholder="请选择" :loading="loading" loading-text="正在加载数据">
<el-select v-model="search.deviceId" placeholder="请选择" loading-text="正在加载数据">
<el-option :label="item.deviceName" :value="item.id" v-for="(item,index) in deviceOptions" :key="index+'dbOptions'"></el-option>
</el-select>
</el-form-item>
@ -33,17 +33,16 @@
class="common-table"
:data="tableData"
stripe
max-height="500"
show-summary
sum-text="汇总"
style="width: 100%;margin-top:25px;">
<!-- todo汇总数据 :summary-method="getSummaries"-->
<!-- 汇总列-->
<el-table-column label="汇总">
<el-table-column
prop="dateTime"
prop="dataTime"
label="日期"
width="120">
<template slot-scope="scope">
<span>{{scope.row.dataTime}}{{scope.row.dataTime === '汇总' ? '' : ':00'}}</span>
</template>
</el-table-column>
</el-table-column>
<!--充电量列-->
@ -140,6 +139,7 @@ export default {
},
// 获取数据
getData(){
if(!this.search.deviceId) return
this.loading=true
getAmmeterData({siteId:this.siteId,deviceId:this.search.deviceId,dateTime:formatDate(this.search.date)}).then(response=>{
this.tableData=response?.data || [];
@ -155,13 +155,18 @@ export default {
},
init(){
this.loading = true
this.deviceOptions = []
this.search.deviceId=''
this.search.date=''
this.tableData=[]
this.getDbList().then(()=>{
this.onReset()
if(this.search.deviceId){
this.onReset()
}else{
this.loading = false
}
})
},
getSummaries(){
}
},
mounted(){