Quellcode durchsuchen

日常维修为多选

YaolongHan vor 4 Jahren
Ursprung
Commit
1b15be36cf
3 geänderte Dateien mit 58 neuen und 26 gelöschten Zeilen
  1. 44 12
      src/views/equipment/table/rcwxTable.vue
  2. 10 10
      src/views/room/index.vue
  3. 4 4
      vue.config.js

+ 44 - 12
src/views/equipment/table/rcwxTable.vue

@@ -43,11 +43,14 @@
         style="width:192px;margin-right:12px"
       ></el-input>
       <Select
-        @change="pageChanged(1)"
+        @change="confirmMore"
+        @confirm="confirmMore"
+        style="margin-right:12px;"
         v-model="status"
-        width="180"
+        width="200"
         tipPlace="top"
         caption="任务状态描述:"
+        multiple
         :selectdata="statusOption"
       ></Select>
       <Select
@@ -217,7 +220,17 @@ export default {
       people: "",
       locationName: "",
       keyword: "",
-      status: "全部" //搜索状态描述
+      status: [], //搜索状态描述
+      getStatus: [
+        "新建",
+        "待派工",
+        "已派工",
+        "待验收",
+        "验收通过",
+        "工单执行退回",
+        "问题待解决",
+        "执行中"
+      ] //默认选项如果statusOption存在则写入status中
     };
   },
   computed: {
@@ -287,9 +300,6 @@ export default {
         getParams.data.bxfwlymc = this.source;
         getParams.data.bxfwly = this.source;
       }
-      if (this.status && this.status != "全部") {
-        getParams.data.status = this.status;
-      }
       //输入框搜索
       getParams.data.keyword = "";
 
@@ -314,8 +324,14 @@ export default {
       if (getParams.data.keyword == "") {
         delete getParams.data.keyword;
       }
+      if (this.status.length) {
+        const data = {
+          status: this.status
+        };
+        getParams.getParams = data;
+      }
       queryWxzy(getParams).then(res => {
-        this.tableData = res.data || [];
+        this.tableData = res.data.data || [];
         this.total = res.count;
       });
     },
@@ -369,7 +385,6 @@ export default {
     },
     startMethods() {
       this.tabFind();
-      this.getList();
     },
     //下拉框查询
     tabFind() {
@@ -422,17 +437,34 @@ export default {
             ? res.data.data.sms_wxzy.status
             : [];
         this.statusOption = [];
-        this.statusOption.push({
-          name: "全部",
-          id: "全部"
-        });
+        // this.statusOption.push({
+        //   name: "全部",
+        //   id: "全部"
+        // });
         bxfwlymc.forEach(el => {
           this.statusOption.push({
             name: el.value,
             id: el.key
           });
         });
+        let status = [];
+        this.statusOption.forEach(item => {
+          if (this.getStatus.includes(item.id)) {
+            status.push(item.id);
+          }
+        });
+        this.status = status;
+        // 获取数据
+        this.getList();
       });
+    },
+    confirmMore(val) {
+      const arr = [];
+      val.forEach(item => {
+        arr.push(item.id);
+      });
+      this.status = arr;
+      this.getList();
     }
   },
   watch: {

+ 10 - 10
src/views/room/index.vue

@@ -342,7 +342,7 @@
                 style="width:192px;margin-right:12px"
               ></el-input>
               <Select
-                @change="Index3Emit(1)"
+                @change="confirmMore"
                 @confirm="confirmMore"
                 style="margin-right:12px;"
                 v-model="statue"
@@ -593,9 +593,8 @@ export default {
         this.Index2();
         this.$refs.roomTable3.computedHeight();
       } else if (tab.label == "核心设备日常维修") {
-        // this.Index3();
-        this.$refs.roomTable4.computedHeight();
         this.changeSelect("核心设备日常维修");
+        // this.$refs.roomTable4.computedHeight();
       } else if (tab.label == "核心设备日常维保") {
         this.changeSelect("核心设备日常维保");
         this.$refs.roomTable5.computedHeight();
@@ -769,10 +768,6 @@ export default {
       if (this.smsxtArr.smsxt != "1008") {
         getParams.data.onlyMainAsset = true;
       }
-      //////////待定
-      //   if (this.assetnum) {
-      //     getParams.data.assetnum = this.assetnum;
-      //   }
 
       //下拉
       // 监听下拉框
@@ -815,13 +810,17 @@ export default {
       if (getParams.data.keyword == "") {
         delete getParams.data.keyword;
       }
+      if(this.statue.length){
       const data = {
-          status:this.statue
+        status: this.statue
+      };
+      getParams.getParams = data;
       }
-      queryWxzy(data,getParams).then(res => {
+      queryWxzy(getParams).then(res => {
+        console.log('data4',res)
         this.loading4 = false;
         this.total3 = res.count;
-        this.table4 = res.data ? res.data : [];
+        this.table4 = res.data.data ? res.data.data : []
       });
     },
     // 机房维保记录
@@ -986,6 +985,7 @@ export default {
         this.statue = statue;
         if (val == "核心设备日常维修") {
           this.Index3Emit(1);
+          this.$refs.roomTable4.computedHeight();
         } else {
           this.Index4Emit(1);
         }

+ 4 - 4
vue.config.js

@@ -4,8 +4,8 @@ module.exports = {
         port: 8090,
         proxy: {
             "/data": {
-                // target: "http://60.205.177.43",
-                target: "http://10.199.143.126",
+                target: "http://60.205.177.43",
+                // target: "http://10.199.143.126",
                 // target: 'http://192.168.200.11:9003', //yll
                 // target: 'http://localhost:6040/data/',
                 changeOrigin: true,
@@ -34,8 +34,8 @@ module.exports = {
             // 图例库服务
             "/serve": {
                 // target: 'http://192.168.200.87:8088',
-               target: 'http://10.199.143.129:8080',
-                // target: 'http://60.205.177.43:8080',
+            //    target: 'http://10.199.143.129:8080',
+                target: 'http://60.205.177.43:8080',
                 changeOrigin: true,
                 pathRewrite: {
                     "^/serve": "",