wh 2 years ago
parent
commit
c86aab2a0b
7 changed files with 414 additions and 200 deletions
  1. 2 1
      src/main.js
  2. 4 4
      src/views/bill/detail.vue
  3. 100 9
      src/views/bill/list.vue
  4. 2 2
      src/views/device/list.vue
  5. 42 15
      src/views/pay/fee.vue
  6. 74 10
      src/views/pay/record.vue
  7. 190 159
      src/views/remoteControl.vue

+ 2 - 1
src/main.js

@@ -6,12 +6,13 @@ import VConsole from 'vconsole';
 import Vant from 'vant';
 import 'vant/es/toast/style';//无法自动按需引入这两个的样式,需要手动引入
 import 'vant/es/notify/style';
+import 'vant/es/datetime-picker/style';
 import 'vant/es/dialog/style';
 import 'vant/es/image-preview/style';
 
 if (process.env.NODE_ENV !== "production") {
     new VConsole({ theme: 'dark' });
 }
-
+console.log(Vant)
 const app = createApp(App)
 app.use(Vant).use(store).use(router).mount('#app')

+ 4 - 4
src/views/bill/detail.vue

@@ -19,24 +19,24 @@
         >
           <van-tab name="bill" title="账单明细">
             <van-dropdown-menu active-color="#2E69EB">
-              <van-dropdown-item
+              <!-- <van-dropdown-item
                 v-model="dataForm.costCycle"
                 @change="handelChange('costCycle', costCycle)"
                 :title="costCycleTitle"
                 :options="costCycleList"
-              />
+              /> -->
               <van-dropdown-item
                 v-model="dataForm.costType"
                 @change="handelChange('costType', dataForm.costType)"
                 :title="costTypeTitle"
                 :options="payTypeList"
               />
-              <van-dropdown-item
+              <!-- <van-dropdown-item
                 v-model="dataForm.status"
                 @change="handelChange('status', dataForm.status)"
                 :title="statusTitle"
                 :options="payStatusList"
-              />
+              /> -->
             </van-dropdown-menu>
           </van-tab>
           <van-tab name="record" title="扣缴记录">

+ 100 - 9
src/views/bill/list.vue

@@ -7,7 +7,7 @@
   <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
     <div class="page_info">
       <van-row align="center" class="position_pannel">
-        <van-col>
+        <van-col @click="showRepairPositionPicker = true">
           <van-image
             :src="require('@/assets/position.svg')"
             width="16"
@@ -38,11 +38,19 @@
       <div class="drop_down">
         <van-dropdown-menu active-color="#1989fa">
           <van-dropdown-item
-            v-model="dataForm.cycle"
-            @change="handelChange('cycle', dataForm.cycle)"
-            :title="cycleTitle"
-            :options="cycleList"
-          />
+            :title="dataForm.cycle == '' ? '选择周期' : dataForm.cycle"
+            ref="item"
+          >
+            <van-datetime-picker
+              v-model="currentDate"
+              type="year-month"
+              @confirm="checkTime"
+              @cancel="$refs.item.toggle()"
+              confirm-button-text=""
+              :min-date="minDate"
+              :max-date="maxDate"
+            />
+          </van-dropdown-item>
           <van-dropdown-item
             v-model="dataForm.status"
             @change="handelChange('status', dataForm.status)"
@@ -124,6 +132,15 @@
         </van-list>
       </div>
     </div>
+    <van-popup v-model:show="showRepairPositionPicker" round position="bottom">
+      <van-picker
+        title="标题"
+        :columns="positionList"
+        :columns-field-names="fieldNames"
+        @cancel="showRepairPositionPicker = false"
+        @confirm="confirmPosition"
+      />
+    </van-popup>
   </van-pull-refresh>
 </template>
 <script>
@@ -136,16 +153,29 @@ export default {
   },
   data() {
     return {
-      name: "电商园四期-B座",
+      currentDate: new Date(),
+      minDate: new Date(2020, 0, 1),
+      maxDate: new Date(2025, 10, 1),
+      showRepairPositionPicker: false,
+      positionList: [],
+      fieldNames: {
+        text: "orgName",
+        value: "orgId",
+        children: "childrenList",
+      },
+      name: "电商园四期",
       cycleTitle: "计费周期",
       statusTitle: "是否结清",
       isFinishedList: [],
       cycleList: [],
       dataForm: {
-        cycle: "2022-08",
+        projectId: "",
+        cycle: "",
         status: "",
         page: 1,
         limit: 10,
+        buildingId: "",
+        storeyId: "",
       },
       dataList: [],
       loading: false,
@@ -154,9 +184,69 @@ export default {
     };
   },
   created() {
+    this.getBuildList();
     this.getIsFinishedList();
   },
+  watch: {
+    // "dataForm.projectId"(newval,oldval){
+    //   if(newval&&newval!=oldval){
+    //     this.getDataList();
+    //   }
+    // },
+    "dataForm.cycle"(newval, oldval) {
+      if (newval && newval != oldval) {
+        this.getDataList();
+      }
+    },
+    "dataForm.buildingId"(newval, oldval) {
+      if (newval && newval != oldval) {
+        this.getDataList();
+      }
+    },
+    "dataForm.storeyId"(newval, oldval) {
+      if (newval && newval != oldval) {
+        this.getDataList();
+      }
+    },
+  },
   methods: {
+    checkTime(val) {
+      let year = new Date(val).getFullYear();
+      let m = new Date(val).getMonth() + 1;
+      m = m > 9 ? m : "0" + m;
+      this.dataForm.cycle = year + "-" + m;
+      this.$refs.item.toggle();
+    },
+    //获取楼栋
+    getBuildList() {
+      Api.getBuildInfo().then((res) => {
+        if (res.code == 0) {
+          this.positionList = res.data[0].childrenList;
+          this.dataForm.projectId = res.data[0].orgId;
+          if (this.positionList) {
+            let json = {
+              category: "s",
+              childrenList: null,
+              orgId: "",
+              orgName: "全部",
+            };
+            for (let i = 0; i < this.positionList.length; i++) {
+              this.positionList[i].childrenList.unshift(json);
+            }
+          }
+        }
+      });
+    },
+    //定位完成
+    confirmPosition(val) {
+      this.page = 1;
+      this.dataList = [];
+      this.dataForm.buildingId = val[0].orgId;
+      this.dataForm.storeyId = val[1].orgId;
+      let storeyName = val[1].orgName == "全部" ? "" : val[1].orgName;
+      this.name = "电商园四期-" + val[0].orgName + storeyName;
+      this.showRepairPositionPicker = false;
+    },
     getIsFinishedList() {
       this.isFinishedList = getDictDataList("isFinished");
       this.isFinishedList.forEach((item) => {
@@ -177,7 +267,7 @@ export default {
           this.refreshing = false;
         }
         await this.getDataList();
-        this.dataForm.page++; // 分页数加一
+        //this.dataForm.page++; // 分页数加一
       }, 100);
     },
     onRefresh() {
@@ -202,6 +292,7 @@ export default {
             }
             // 若数据条数不等于0
             this.dataList.push(...res.data.list); // 将数据放入list中
+            this.page++;
             this.loading = false; // 加载状态结束
 
             // 如果list长度大于等于总数据条数,数据全部加载完成

+ 2 - 2
src/views/device/list.vue

@@ -10,7 +10,7 @@
   </van-nav-bar>
   <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
     <div class="page_info">
-      <van-row align="center" class="position_pannel">
+      <!-- <van-row align="center" class="position_pannel">
         <van-col>
           <van-image
             :src="require('@/assets/position.svg')"
@@ -34,7 +34,7 @@
             fit="contain"
           />
         </van-col>
-      </van-row>
+      </van-row> -->
       <!-- <div class="drop_down">
       <van-dropdown-menu active-color="#1989fa">
         <van-dropdown-item

+ 42 - 15
src/views/pay/fee.vue

@@ -10,8 +10,8 @@
   </van-nav-bar>
   <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
     <div class="page_info">
-      <van-row align="center" class="position_pannel">
-        <van-col>
+      <!-- <van-row align="center" class="position_pannel">
+        <van-col >
           <van-image
             :src="require('@/assets/position.svg')"
             width="16"
@@ -34,21 +34,28 @@
             fit="contain"
           />
         </van-col>
-      </van-row>
+      </van-row> -->
       <div class="drop_down">
         <van-dropdown-menu active-color="#1989fa">
-          <van-dropdown-item
-            v-model="dataForm.cycle"
-            @change="handelChange('cycle', dataForm.cycle)"
-            :title="cycleTitle"
-            :options="cycleList"
-          />
-          <van-dropdown-item
+           <van-dropdown-item
+            :title="dataForm.cycle == '' ? '选择周期' : dataForm.cycle"
+            ref="item"
+          >
+            <van-datetime-picker
+              v-model="currentDate"
+              type="year-month"
+              @confirm="checkTime"
+              @cancel="$refs.item.toggle()"
+              :min-date="minDate"
+              :max-date="maxDate"
+            />
+          </van-dropdown-item>
+          <!-- <van-dropdown-item
             v-model="dataForm.billType"
             @change="handelChange('billType', dataForm.billType)"
             :title="billTypeTitle"
             :options="billTypeList"
-          />
+          /> -->
           <van-dropdown-item
             v-model="dataForm.arrearDay"
             @change="handelChange('arrearDay', dataForm.arrearDay)"
@@ -132,16 +139,20 @@
 import Api from "@/utils/api";
 import { isEmpty, getDictDataList } from "@/utils/index";
 import VCountUp from "../CountUp";
+
 export default {
   components: {
     "v-count-up": VCountUp,
   },
   data() {
     return {
+      currentDate: new Date(),
+      minDate: new Date(2020, 0, 1),
+      maxDate: new Date(2025, 10, 1),
       name: "电商园四期-B座",
       isExpeditTitle: "是否催费",
       cycleTitle: "计费周期",
-      billTypeTitle: "欠费类型",
+      //billTypeTitle: "欠费类型",
       arrearDayTitle: "欠费天数",
       billTypeList: [],
       arrearDayList: [],
@@ -149,7 +160,7 @@ export default {
       isExpeditList: [],
       dataForm: {
         cycle: "",
-        billType: "",
+        //billType: "",
         arrearDay: "",
         isExpedit: "",
         page: 1,
@@ -166,7 +177,21 @@ export default {
     this.getBillTypeList();
     this.getIsExpeditList();
   },
+  watch:{
+     "dataForm.cycle"(newval, oldval) {
+      if (newval && newval != oldval) {
+        this.getDataList();
+      }
+    },
+  },
   methods: {
+    checkTime(val) {
+      let year = new Date(val).getFullYear();
+      let m = new Date(val).getMonth() + 1;
+      m = m > 9 ? m : "0" + m;
+      this.dataForm.cycle = year + "-" + m;
+      this.$refs.item.toggle();
+    },
     getArrearDayList() {
       this.arrearDayList = getDictDataList("ArrearageDay");
       this.arrearDayList.forEach((item) => {
@@ -201,7 +226,7 @@ export default {
           this.refreshing = false;
         }
         await this.getDataList();
-        this.dataForm.page++; // 分页数加一
+        
       }, 100);
     },
     onRefresh() {
@@ -226,7 +251,9 @@ export default {
             // 若数据条数不等于0
             this.dataList.push(...res.data.list); // 将数据放入list中
             this.loading = false; // 加载状态结束
-
+            if(res.data.list.length>9){
+              this.dataForm.page++; // 分页数加一
+            }
             // 如果list长度大于等于总数据条数,数据全部加载完成
             if (this.dataList.length >= res.data.total) {
               this.finished = true; // 结束加载状态

+ 74 - 10
src/views/pay/record.vue

@@ -11,7 +11,7 @@
   <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
     <div class="page_info">
       <van-row align="center" class="position_pannel">
-        <van-col>
+        <van-col @click="showRepairPositionPicker = true">
           <van-image
             :src="require('@/assets/position.svg')"
             width="16"
@@ -37,24 +37,24 @@
       </van-row>
       <div class="drop_down">
         <van-dropdown-menu active-color="#1989fa">
-          <van-dropdown-item
+          <!-- <van-dropdown-item
             v-model="feeDate"
             @change="handelChange('feeDate', dataFrom.feeDate)"
             :title="feeDateTitle"
             :options="feeDateList"
-          />
+          /> -->
           <van-dropdown-item
             v-model="dataForm.type"
             @change="handelChange('type', dataForm.type)"
             :title="typeTitle"
             :options="payTypeList"
           />
-          <van-dropdown-item
+          <!-- <van-dropdown-item
             v-model="operator"
             @change="handelChange('operator', dataForm.operator)"
             :title="operatorTitle"
             :options="operatorList"
-          />
+          /> -->
         </van-dropdown-menu>
       </div>
       <van-row align="center" class="list_total">
@@ -120,6 +120,15 @@
         </van-list>
       </div>
     </div>
+     <van-popup v-model:show="showRepairPositionPicker" round position="bottom">
+      <van-picker
+        title="标题"
+        :columns="positionList"
+        :columns-field-names="fieldNames"
+        @cancel="showRepairPositionPicker = false"
+        @confirm="confirmPosition"
+      />
+    </van-popup>
   </van-pull-refresh>
 </template>
 <script>
@@ -132,7 +141,14 @@ export default {
   },
   data() {
     return {
-      name: "电商园四期-B座",
+      showRepairPositionPicker: false,
+      positionList: [],
+      fieldNames:{
+        text: "orgName",
+        value: "orgId",
+        children: "childrenList",
+      },
+      name: "电商园四期",
       feeDateTitle: "扣缴时间",
       typeTitle: "扣缴类型",
       operatorTitle: "操作人",
@@ -140,8 +156,11 @@ export default {
       operatorList: [],
       feeDateList: [],
       dataForm: {
-        feeDate: "",
-        operator: "",
+        projectId: "",
+        buildingId: "",
+        storeyId: "",
+        //feeDate: "",
+        //operator: "",
         type: "",
         tenantId: "",
         page: 1,
@@ -154,15 +173,60 @@ export default {
     };
   },
   created() {
+    this.getBuildList();
     this.dataForm.tenantId = localStorage.getItem("tenantId");
     this.getPayTypeList();
   },
+  watch:{
+    "dataForm.buildingId"(newval,oldval){
+      if(newval&&newval!=oldval){
+        this.page=1;
+        this.getDataList();
+      }
+    },
+     "dataForm.storeyId"(newval,oldval){
+      if(newval&&newval!=oldval){
+        this.page=1;
+        this.getDataList();
+      }
+    },
+  },
   methods: {
+     //获取楼栋
+    getBuildList() {
+      Api.getBuildInfo().then((res) => {
+        if (res.code == 0) {
+          this.positionList = res.data[0].childrenList;
+          this.dataForm.projectId=res.data[0].orgId;
+          if (this.positionList) {
+            let json = {
+              category: "s",
+              childrenList: null,
+              orgId: "",
+              orgName: "全部",
+            };
+            for (let i = 0; i < this.positionList.length; i++) {
+              this.positionList[i].childrenList.unshift(json);
+            }
+          }
+        }
+      });
+    },
+    //定位完成
+    confirmPosition(val) {
+      this.page=1;
+      this.dataList=[];
+      this.dataForm.buildingId = val[0].orgId;
+      this.dataForm.storeyId = val[1].orgId;
+      let storeyName = val[1].orgName == "全部" ? "" : val[1].orgName;
+      this.name = "电商园四期-" + val[0].orgName + storeyName;
+      this.showRepairPositionPicker = false;
+    },
     getPayTypeList() {
-      this.payTypeList = getDictDataList("PayType");
+      this.payTypeList = getDictDataList("PayType2");
       this.payTypeList.forEach((item) => {
         item.text = item.dictLabel;
-        item.value = item.dictValue;
+        item.value = item.dictValue=='all'?'':item.dictValue;
       });
     },
     dict_filter(val, list) {

+ 190 - 159
src/views/remoteControl.vue

@@ -73,17 +73,17 @@
     <div class="check_info">
       <div class="info_list">
         <!-- <van-pull-refresh v-model="refreshing" @refresh="onRefresh"> -->
-          <van-list
-            v-model:loading="loading"
-            :finished="finished"
-            :error="error"
-            error-text="请求失败,点击重新加载"
-            finished-text="没有更多了"
-            @load="onLoad"
-          >
-            <div v-for="(item, index) in list" :key="item.id" class="list_item">
-              <template v-if="deviceType == 'AirConditioner'">
-                <!-- <div
+        <van-list
+          v-model:loading="loading"
+          :finished="finished"
+          :error="error"
+          error-text="请求失败,点击重新加载"
+          finished-text="没有更多了"
+          @load="onLoad"
+        >
+          <div v-for="(item, index) in list" :key="item.id" class="list_item">
+            <template v-if="deviceType == 'AirConditioner'">
+              <!-- <div
                 v-if="item.attributeList[2]"
                   class="reduce_type"
                   :style="{
@@ -98,83 +98,83 @@
                     }`
                   }}</span>
                 </div> -->
-                <template v-if="item.attributeList">
-                  <van-switch
-                    v-model="item.attributeList[3].value"
-                    :active-value="1"
-                    :inactive-value="0"
-                    class="isSwitch"
-                    inactive-color="#dddddd"
-                    @change="
-                      changeSwitch(
-                        item.attributeList[3].value,
-                        index,
-                        item.deviceId
-                      )
-                    "
-                  />
-                </template>
-                <span class="header">{{ item.airConditionerName }}</span>
-                <span
-                  >空间信息:{{ item.installSite }}{{ item.roomNumbers }}</span
-                >
-                <!-- <span>设备编号:{{ item.airConditionerNo }}</span> -->
-                <span v-if="item.attributeList"
-                  >室温:{{ item.attributeList[4].value }}</span
-                >
-                <!-- <span>所属租户:{{ item.rentNum }}</span> -->
-                <!-- <div class="list_btn" v-if="item.attributeList">
+              <template v-if="item.attributeList">
+                <van-switch
+                  v-model="item.attributeList[3].value"
+                  :active-value="1"
+                  :inactive-value="0"
+                  class="isSwitch"
+                  inactive-color="#dddddd"
+                  @change="
+                    changeSwitch(
+                      item.attributeList[3].value,
+                      index,
+                      item.deviceId
+                    )
+                  "
+                />
+              </template>
+              <span class="header">{{ item.airConditionerName }}</span>
+              <span
+                >空间信息:{{ item.installSite }}{{ item.roomNumbers }}</span
+              >
+              <!-- <span>设备编号:{{ item.airConditionerNo }}</span> -->
+              <span v-if="item.attributeList"
+                >室温:{{ item.attributeList[4].value }}</span
+              >
+              <!-- <span>所属租户:{{ item.rentNum }}</span> -->
+              <!-- <div class="list_btn" v-if="item.attributeList">
                   <van-button plain type="primary" size="small">{{
                     item.attributeList[3].value == 1 ? "开启" : "关闭"
                   }}</van-button>
                 </div> -->
-                <van-row class="operation" v-if="item.attributeList">
-                  <van-col
-                    span="8"
-                    @click="
-                      chooseMs(
-                        'moshitxt',
-                        item.attributeList[2].value,
-                        index,
-                        item.deviceId
-                      )
-                    "
-                    >{{ ms(item.attributeList[2].value)
-                    }}<van-icon name="arrow-down" class="xl"
-                  /></van-col>
-                  <div class="line" style="left: 32%"></div>
-                  <van-col
-                    span="8"
-                    @click="
-                      chooseMs(
-                        'wendu',
-                        item.attributeList[5].value,
-                        index,
-                        item.deviceId
-                      )
-                    "
-                    >{{ item.attributeList[5].value }}℃<van-icon
-                      name="arrow-down"
-                      class="xl"
-                  /></van-col>
-                  <div class="line" style="left: 65%"></div>
-                  <van-col
-                    span="8"
-                    @click="
-                      chooseMs(
-                        'fengs',
-                        item.attributeList[0].value,
-                        index,
-                        item.deviceId
-                      )
-                    "
-                    >{{ fs(item.attributeList[0].value)
-                    }}<van-icon name="arrow-down" class="xl"
-                  /></van-col>
-                </van-row>
-              </template>
-              <template v-if="deviceType == 'Ammeter'">
-                <!-- <div
+              <van-row class="operation" v-if="item.attributeList">
+                <van-col
+                  span="8"
+                  @click="
+                    chooseMs(
+                      'moshitxt',
+                      item.attributeList[2].value,
+                      index,
+                      item.deviceId
+                    )
+                  "
+                  >{{ ms(item.attributeList[2].value)
+                  }}<van-icon name="arrow-down" class="xl"
+                /></van-col>
+                <div class="line" style="left: 32%"></div>
+                <van-col
+                  span="8"
+                  @click="
+                    chooseMs(
+                      'wendu',
+                      item.attributeList[5].value,
+                      index,
+                      item.deviceId
+                    )
+                  "
+                  >{{ item.attributeList[5].value }}℃<van-icon
+                    name="arrow-down"
+                    class="xl"
+                /></van-col>
+                <div class="line" style="left: 65%"></div>
+                <van-col
+                  span="8"
+                  @click="
+                    chooseMs(
+                      'fengs',
+                      item.attributeList[0].value,
+                      index,
+                      item.deviceId
+                    )
+                  "
+                  >{{ fs(item.attributeList[0].value)
+                  }}<van-icon name="arrow-down" class="xl"
+                /></van-col>
+              </van-row>
+            </template>
+            <template v-if="deviceType == 'Ammeter'">
+              <!-- <div
                   v-if="item.attributeList"
                   class="reduce_type"
                   :style="{
@@ -187,22 +187,22 @@
                     `${deviceStatus_filter(item.status)["label"]}`
                   }}</span>
                 </div> -->
-                <span class="header">{{ item.controlName }}</span>
-                <span>空间信息:{{ item.installSite }}</span>
-                <!-- <span>设备编号:{{ item.deviceId }}</span>
+              <span class="header">{{ item.controlName }}</span>
+              <span>空间信息:{{ item.installSite }}</span>
+              <!-- <span>设备编号:{{ item.deviceId }}</span>
                 <span>实时读数:{{ item.status }}</span> -->
-                <!-- <span>所属租户:{{ item.rentNum }}</span> -->
-                <van-switch
-                  v-model="item.status"
-                  active-value="1"
-                  inactive-value="0"
-                  class="isSwitch"
-                  inactive-color="#dddddd"
-                  @change="changeElecSwitch(item.status, item.deviceId)"
-                />
-              </template>
-            </div>
-          </van-list>
+              <!-- <span>所属租户:{{ item.rentNum }}</span> -->
+              <van-switch
+                v-model="item.status"
+                active-value="1"
+                inactive-value="0"
+                class="isSwitch"
+                inactive-color="#dddddd"
+                @change="changeElecSwitch(item.status, item.deviceId)"
+              />
+            </template>
+          </div>
+        </van-list>
         <!-- </van-pull-refresh> -->
       </div>
     </div>
@@ -231,7 +231,7 @@ import api from "../utils/api";
 import { ref } from "vue";
 import { isEmpty } from "@/utils/index.js";
 import VCountUp from "./CountUp";
-import { Notify, Dialog, showConfirmDialog } from "vant";
+import { Notify, Dialog } from "vant";
 export default {
   components: {
     "v-count-up": VCountUp,
@@ -270,10 +270,10 @@ export default {
       value: "orgId",
       children: "childrenList",
     });
-    const storeyId=ref('');
-    const buildingId=ref('');
+    const storeyId = ref("");
+    const buildingId = ref("");
     const positionList = ref([]); //定位
-    const page=ref('1');
+    const page = ref("1");
 
     function ms(data) {
       let text = "";
@@ -336,7 +336,7 @@ export default {
         { text: "连接中", value: 1 },
         { text: "断连中", value: 0 },
       ],
-      total:0,
+      total: 0,
       list: [],
       loading: false,
       refreshing: false,
@@ -344,19 +344,19 @@ export default {
     };
   },
   watch: {
-    positionList(newval, oldval) {
-      if (newval) {
-        let json = {
-          category: "s",
-          childrenList: null,
-          orgId: "",
-          orgName: "全部",
-        };
-        for (let i = 0; i < newval.length; i++) {
-          newval[i].childrenList.push(json);
-        }
-      }
-    },
+    // positionList(newval, oldval) {
+    //   if (newval) {
+    //     let json = {
+    //       category: "s",
+    //       childrenList: null,
+    //       orgId: "",
+    //       orgName: "全部",
+    //     };
+    //     for (let i = 0; i < newval.length; i++) {
+    //       newval[i].childrenList.push(json);
+    //     }
+    //   }
+    // },
   },
   created() {
     this.getBuildList();
@@ -366,11 +366,11 @@ export default {
   methods: {
     //定位完成
     confirmPosition(val) {
-      this.buildingId=val[0].orgId;
-      this.storeyId=val[1].orgId;
-      let storeyName=val[1].orgName=='全部'?'':val[1].orgName+'-';
-      this.name="电商园四期-"+val[0].orgName+storeyName;
-      this.showRepairPositionPicker=false;
+      this.buildingId = val[0].orgId;
+      this.storeyId = val[1].orgId;
+      let storeyName = val[1].orgName == "全部" ? "" : val[1].orgName + "-";
+      this.name = "电商园四期-" + val[0].orgName + storeyName;
+      this.showRepairPositionPicker = false;
     },
     //继电器下发指令开关
     changeElecSwitch(val, deviceId) {
@@ -479,48 +479,73 @@ export default {
         });
     },
     getElec() {
-      console.log(this.page)
+      console.log(this.page);
       api
         .getElec({
-          buildingId:this.buildingId,
-          storeyId:this.storeyId,
-          page:this.page,
+          buildingId: this.buildingId,
+          storeyId: this.storeyId,
+          page: this.page,
           limit: 10,
           status: this.deviceStatus,
           controlCategory: "CommonLighting",
         })
         .then((res) => {
-          console.log(res)
           if (res.code == 0) {
-            this.total = res.data.total;
-            this.list=this.list.concat(res.data.list);
-            this.loading = false;
-            if( res.data.list.length<10){
-              this.finished=true;
-            }else{
-              this.page++;
+            if (res.data) {
+                this.total = res.data.total;
+              if (res.data.list.length == 0) {
+                // 判断获取数据条数若等于0
+                this.list = []; // 清空数组
+                this.finished = true; // 停止加载
+              }
+              // 若数据条数不等于0
+              this.list.push(...res.data.list); // 将数据放入list中
+              this.loading = false; // 加载状态结束
+              if (res.data.list.length > 9) {
+                this.page++; // 分页数加一
+              }
+              // 如果list长度大于等于总数据条数,数据全部加载完成
+              if (this.list.length >= res.data.total) {
+                this.finished = true; // 结束加载状态
+              }
+            } else {
+              // 判断获取数据条数若等于0
+              this.list = []; // 清空数组
+              this.finished = true; // 停止加载
             }
-            console.log(this.list)
-            // for(let i=0;i<res.data.list.length;i++){
-            //   if(res.data.list[i].attributeList&&res.data.list[i].attributeList.length!=0){
-            //     this.list.push(res.data.list[i])
-            //   }
-            // }
+          } else {
+            this.loading = false; // 加载状态结束
+            this.finished = true; // 停止加载
           }
         });
     },
     getAircond() {
       api
         .airconditioner({
-          page:this.page,
+          page: this.page,
           limit: 10,
-          buildingId:this.buildingId,
-          storeyId:this.storeyId,
+          buildingId: this.buildingId,
+          storeyId: this.storeyId,
         })
         .then((res) => {
-          if (res.code == 0) {
-            this.total = res.data.total;
-            for (let i = 0; i < res.data.list.length; i++) {
+          console.log(res)
+           if (res.code == 0) {
+            if (res.data) {
+               this.total = res.data.total;
+              if (res.data.list.length == 0) {
+                // 判断获取数据条数若等于0
+                this.list = []; // 清空数组
+                this.finished = true; // 停止加载
+              }
+              // 若数据条数不等于0
+              //this.list.push(...res.data.list); // 将数据放入list中
+              this.loading = false; // 加载状态结束
+              if (res.data.list.length > 9) {
+                this.page++; // 分页数加一
+              }
+              
+              //数据处理
+              for (let i = 0; i < res.data.list.length; i++) {
               if (
                 res.data.list[i].attributeList &&
                 res.data.list[i].attributeList.length != 0
@@ -528,12 +553,18 @@ export default {
                 this.list.push(res.data.list[i]);
               }
             }
-            if( res.data.list.length<10){
-              this.finished=true;
-            }else{
-              this.page++;
+              // 如果list长度大于等于总数据条数,数据全部加载完成
+              if (this.list.length >= res.data.total) {
+                this.finished = true; // 结束加载状态
+              }
+            } else {
+              // 判断获取数据条数若等于0
+              this.list = []; // 清空数组
+              this.finished = true; // 停止加载
             }
-            this.loading = false;
+          } else {
+            this.loading = false; // 加载状态结束
+            this.finished = true; // 停止加载
           }
         });
     },
@@ -577,10 +608,10 @@ export default {
     },
     onLoad() {
       this.loading = true;
-      if(this.deviceType=='AirConditioner'){
-        this.getAircond()
-      }else{
-         this.getElec();
+      if (this.deviceType == "AirConditioner") {
+        this.getAircond();
+      } else {
+        this.getElec();
       }
     },
     // onRefresh() {
@@ -594,10 +625,10 @@ export default {
     // change事件可以拿到的是value
     handelChange(type, lackTypeTitle, lackTypeList, val) {
       this[type] = val;
-      console.log(this.deviceType)
-      this.list=[];
-      this.page=1;
-      this.finished=true;
+      console.log(this.deviceType);
+      this.list = [];
+      this.page = 1;
+      this.finished = true;
       if (this.deviceType == "Ammeter") this.getElec();
       if (this.deviceType == "AirConditioner") this.getAircond();
       // 显示中文名字