East hace 3 años
padre
commit
ad4d2a7501
Se han modificado 2 ficheros con 52 adiciones y 36 borrados
  1. 9 4
      src/components/bioSafety/QueryConditions.vue
  2. 43 32
      src/views/BioSafety/CarAdmin.vue

+ 9 - 4
src/components/bioSafety/QueryConditions.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-09-18 10:40:12
- * @LastEditTime: 2021-12-22 09:36:15
+ * @LastEditTime: 2021-12-27 18:16:01
  * @LastEditors: Please set LastEditors
  * @Description: 查询条件组件
  * @FilePath: \hyyfClient\src\components\bioSafety\QueryConditions.vue
@@ -95,6 +95,7 @@
                     type="daterange"
                     clearable
                     class="date-picker-reset"
+                    ref="123"
                   >
                   </el-date-picker>
                 </template>
@@ -108,8 +109,9 @@
                 size="small"
                 @click="handleClick"
                 style="margin-left: 30px"
-                >查询结果</el-button
               >
+                查询结果
+              </el-button>
             </el-form-item>
           </el-col>
         </el-row>
@@ -154,8 +156,11 @@ export default {
     });
   },
   watch: {
-    propFormData(newValue) {
-      this.formData = { ...newValue };
+    propFormData: {
+      handler(newValue) {
+        this.formData = { ...newValue };
+      },
+      deep: true,
     },
   },
 };

+ 43 - 32
src/views/BioSafety/CarAdmin.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-09-13 17:52:31
- * @LastEditTime: 2021-12-27 09:06:13
+ * @LastEditTime: 2021-12-27 18:18:52
  * @LastEditors: Please set LastEditors
  * @Description: 生物安全 - 车辆管理
  * @FilePath: \hyyfClient\src\views\BioSafety\CarAdmin.vue
@@ -17,10 +17,9 @@
 
     <!-- 筛选条件 -->
     <query-conditions
-      v-if="btnSelected === 2 || btnSelected === 3"
+      v-if="btnSelected === 2 || btnSelected === 3 || btnSelected === 4"
       :formItems="formItems"
       :propFormData="propFormData"
-      :defaultEmit="true"
       @getQueryParams="handleQuery"
     >
     </query-conditions>
@@ -364,32 +363,46 @@ export default {
     };
   },
   watch: {
-    btnSelected(newVal) {
-      this.pageNum = 1;
-      this.listData = [];
-      this.formItems = formItems[this.btnSelected - 1];
-      this.propFormData = propFormData[this.btnSelected - 1];
-      this.title = titles[this.btnSelected - 1];
-      this.tableItems = tableItems[this.btnSelected - 1];
-      if (newVal === 1) {
-        // 档案
-        this.getCarList();
-      } else if (newVal === 2) {
-        // 车辆通行
-        this.carPassage();
-      } else if (newVal === 3) {
-        // 车辆洗消
-        this.carWash();
-      } else if (newVal === 4) {
-        // 车辆烘干
-        this.carDrying();
-      } else if (newVal === 5) {
-        // 白名单
-        this.ShowCarWhite();
-      } else {
-        // 黑名单
-        this.ShowCarBlack();
-      }
+    btnSelected: {
+      async handler(newVal) {
+        const loading = this.$loading({
+          lock: true,
+          text: "加载中...",
+          spinner: "el-icon-loading",
+          background: "rgba(0, 0, 0, 0.7)",
+        });
+        this.pageNum = 1;
+        this.listData = [];
+        if (newVal > 1) {
+          this.formItems = formItems[this.btnSelected - 2];
+          this.propFormData = propFormData[this.btnSelected - 2];
+        } else {
+          this.formItems = {};
+          this.propFormData = {};
+        }
+        this.title = titles[this.btnSelected - 1];
+        this.tableItems = tableItems[this.btnSelected - 1];
+        if (newVal === 1) {
+          // 档案
+          await this.getCarList();
+        } else if (newVal === 2) {
+          // 车辆通行
+          await this.carPassage();
+        } else if (newVal === 3) {
+          // 车辆洗消
+          await this.carWash();
+        } else if (newVal === 4) {
+          // 车辆烘干
+          await this.carDrying();
+        } else if (newVal === 5) {
+          // 白名单
+          await this.ShowCarWhite();
+        } else {
+          // 黑名单
+          await this.ShowCarBlack();
+        }
+        loading.close();
+      },
     },
   },
   mounted() {
@@ -638,7 +651,6 @@ export default {
             });
           }
         } else {
-          console.log("error submit!!");
           return false;
         }
       });
@@ -743,7 +755,6 @@ export default {
         const result = JSON.parse(res.result);
         this.listData = result.data.pageData;
         this.listData.forEach((item) => {
-          console.log(item);
           item.alarmPicture = `${this.ip}/video/picture/get?alarmPicture=${item.alarmPicture}`;
         });
       });
@@ -795,7 +806,7 @@ export default {
         current: this.pageNum,
         size: this.size,
       }).then((res) => {
-        if (res.code === 10000) {
+        if (res && res.code === 10000) {
           this.listData = res.data.records;
           this.total = res.data.total;
         }