Эх сурвалжийг харах

修改自动抄表

Signed-off-by: hsshuxian <3049816743@qq.com>
hsshuxian 4 сар өмнө
parent
commit
c285afb5d5

+ 15 - 13
ems-ui-cloud/src/views/devmgr/meterData/index.vue

@@ -134,6 +134,7 @@
           </el-table-column>
         </el-table>
 
+
         <el-table v-if="activeTab === 'second'" v-loading="loading" :data="waterMeterHList">
           <el-table-column type="selection" width="55" align="center"/>
           <el-table-column label="表计名称" align="left" prop="deviceName" width="250"/>
@@ -148,7 +149,6 @@
           <el-table-column label="单位水价" align="center" prop="meterUnitPrice"/>
           <el-table-column label="小时水费" align="center" prop="useWaterCost"/>
         </el-table>
-
         <pagination
           v-show="total>0"
           :total="total"
@@ -156,6 +156,7 @@
           :limit.sync="queryParams.pageSize"
           @pagination="getElecList"
         />
+
         <!-- 添加或修改用电计量-小时对话框 -->
         <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
           <el-form ref="form" :model="form" :rules="rules" label-width="80px">
@@ -239,6 +240,8 @@ export default {
       showSearch: true,
       // 总条数
       total: 0,
+      eleCTotal:0,
+      waterTotal:0,
       // 用电计量-小时表格数据
       elecMeterHList: [],
       // 用水计量-小时表格数据
@@ -294,16 +297,16 @@ export default {
     }
   },
   created() {
-      this.getAreaTreeSelect().then(() => {
+    this.getAreaTreeSelect().then(() => {
+      /** 获取第一个有效的树节点*/
+      const firstValidNode = this.findFirstValidNode(this.areaOptions);
+      if (firstValidNode) {
+        this.queryParams.deviceCode = firstValidNode.id;
+        this.handleQuery();
+      } else {
         this.getElecList();
-        /** 自动触发第一个 id 非 null 的树节点*/
-        this.$nextTick(() => {
-          const firstValidNode = this.findFirstValidNode(this.areaOptions);
-          if (firstValidNode) {
-            this.handleNodeClick(firstValidNode);
-          }
-        });
-      });
+      }
+    });
   },
   methods: {
     handleTabChange() {
@@ -415,11 +418,11 @@ export default {
       this.queryParams.endRecTime = this.daterangeRecordTime[1]
       if (this.activeTab === 'first') {
         this.queryParams.meterCls = '45'
-        this.queryParams.pageNum = 1
+       // this.queryParams.pageNum = 1
         this.getElecList()
       } else if (this.activeTab === 'second') {
         this.queryParams.meterCls = '70'
-        this.queryParams.pageNum = 1
+       // this.queryParams.pageNum = 1
         this.getWaterList()
       }
       // 获取统计数据
@@ -431,7 +434,6 @@ export default {
         startRecTime: this.queryParams.startRecTime,
         endRecTime: this.queryParams.endRecTime,
       };
-
       try {
         const response = await getNumElecMeterH(query);
         this.numElecMeterHData = response.data;

+ 9 - 9
ems-ui-cloud/src/views/devmgr/meterRead/index.vue

@@ -203,6 +203,7 @@ export default {
             }
           })
         })
+
       })
     },
     /** 搜索按钮操作 */
@@ -271,7 +272,6 @@ export default {
       return null;
     },
 
-
     getHistoryList() {
       const { areaCode, deviceCode } = this.curRow
       listMeterReadingByParam({
@@ -290,7 +290,7 @@ export default {
       this.resetForm('fillForm');
       this.fillTitle = '填报抄表记录';
 
-      // 获取最新抄表记录
+      /** 获取最新抄表记录*/
       const latestRecord = this.recListForm.recList[0];
       if (!latestRecord) {
         this.$modal.msgError('没有可填报的记录');
@@ -352,13 +352,13 @@ export default {
       const currentDevice = this.recListForm.recList.find(
         (item) => item.deviceCode === row.deviceCode
       );
-      this.fillForm.deviceCode = row.deviceCode; // 设备编号
-      this.fillForm.areaCode = currentDevice.areaCode; // 区域代码
-      this.fillForm.magnification = currentDevice.magnification || 1; // 综合倍率
-      this.fillForm.id = row.id; // 抄表记录 ID
-      this.fillForm.lastTime = row.meterTime; // 上次抄表日期
-      this.fillForm.lastReading = row.meterReading; // 上次抄表示数
-      this.fillForm.meterReading = row.meterReading; // 本次抄表示数(默认为上次抄表示数)
+      this.fillForm.deviceCode = row.deviceCode;
+      this.fillForm.areaCode = currentDevice.areaCode;
+      this.fillForm.magnification = currentDevice.magnification || 1;
+      this.fillForm.id = row.id;
+      this.fillForm.lastTime = row.meterTime;
+      this.fillForm.lastReading = row.meterReading;
+      this.fillForm.meterReading = row.meterReading;
     },
     // updateRecord(row) {
     //   this.ifAdd = false