seimin 2 lat temu
rodzic
commit
8a9a2fb3f2
1 zmienionych plików z 68 dodań i 19 usunięć
  1. 68 19
      src/views/Inspection.vue

+ 68 - 19
src/views/Inspection.vue

@@ -4,7 +4,7 @@
4
       <div class="demo">
4
       <div class="demo">
5
         <div class="header">巡检列表</div>
5
         <div class="header">巡检列表</div>
6
         <div class="seatchHeader">
6
         <div class="seatchHeader">
7
-          <div class="search fl">
7
+          <!-- <div class="search fl">
8
             <input
8
             <input
9
               class="searchInp"
9
               class="searchInp"
10
               type="text"
10
               type="text"
@@ -13,7 +13,19 @@
13
               @input="searchData()"
13
               @input="searchData()"
14
             />
14
             />
15
           </div>
15
           </div>
16
-          <button class="selectBtn fr" @click="showPicker">筛选</button>
16
+          <button class="selectBtn fr" @click="showPicker">筛选</button> -->
17
+          <cube-select
18
+          class="stateSearch"
19
+          v-model="searchType"
20
+          :options="searchsType"
21
+          @change="stateChange()"
22
+        ></cube-select>
23
+        <cube-select
24
+          class="stateSearch"
25
+          v-model="searchType1"
26
+          :options="searchsType1"
27
+          @change="stateChange()"
28
+        ></cube-select>
17
         </div>
29
         </div>
18
         <div class="scroll-list-wrap">
30
         <div class="scroll-list-wrap">
19
           <cube-scroll
31
           <cube-scroll
@@ -23,12 +35,6 @@
23
             @pulling-down="onPullingDown"
35
             @pulling-down="onPullingDown"
24
             @pulling-up="onPullingUp"
36
             @pulling-up="onPullingUp"
25
           >
37
           >
26
-            <!-- <cube-select
27
-              class="fr"
28
-              v-model="stateValue"
29
-              :options="stateData"
30
-              @change="stateChange()"
31
-            ></cube-select>-->
32
             <div class="conentBox">
38
             <div class="conentBox">
33
               <div
39
               <div
34
                 class="conent"
40
                 class="conent"
@@ -57,6 +63,10 @@
57
                       item.inspection.title
63
                       item.inspection.title
58
                     }}</span>
64
                     }}</span>
59
                   </p>
65
                   </p>
66
+                  <p>
67
+                    <span class="fl">巡检范围:</span>
68
+                    <span class="grayFont overflowEllipsis2">{{item.online?"线上巡检-":(item.online===false?"线下巡检-":"")}}{{item.inspectionType.type}}</span>
69
+                  </p>
60
                 </div>
70
                 </div>
61
                 <div class="bottom">
71
                 <div class="bottom">
62
                   <i
72
                   <i
@@ -122,7 +132,6 @@ import LoadIng from "./../views/loading.vue";
122
 export default {
132
 export default {
123
   data() {
133
   data() {
124
     return {
134
     return {
125
-      //   items: _foods,
126
       loginUser: JSON.parse(localStorage.getItem("loginUser")),
135
       loginUser: JSON.parse(localStorage.getItem("loginUser")),
127
       menu: JSON.parse(localStorage.getItem("menu")),
136
       menu: JSON.parse(localStorage.getItem("menu")),
128
       valConfig: JSON.parse(localStorage.getItem("valConfig")) - 0, //报修主体
137
       valConfig: JSON.parse(localStorage.getItem("valConfig")) - 0, //报修主体
@@ -138,7 +147,8 @@ export default {
138
       customPullDown: true,
147
       customPullDown: true,
139
       wushuju: false,
148
       wushuju: false,
140
       title: "", //搜索内容
149
       title: "", //搜索内容
141
-      stateData: [
150
+      searchType: "todo",
151
+      searchsType: [
142
         {
152
         {
143
           text: "全部",
153
           text: "全部",
144
           value: "all"
154
           value: "all"
@@ -152,7 +162,13 @@ export default {
152
           value: "done"
162
           value: "done"
153
         }
163
         }
154
       ],
164
       ],
155
-      stateValue: "todo",
165
+      searchType1: "all",
166
+      searchsType1: [
167
+        {
168
+          text: "全部",
169
+          value: "all"
170
+        }
171
+      ],
156
       sum: 10,
172
       sum: 10,
157
       idx: 0,
173
       idx: 0,
158
       stateClass: "",
174
       stateClass: "",
@@ -196,6 +212,25 @@ export default {
196
     }
212
     }
197
   },
213
   },
198
   methods: {
214
   methods: {
215
+    // 获取巡检范围
216
+    getInspectionType(){
217
+      const postData = {"idx":0, "sum":1000, inspectionType: {hierarchy: 1}};
218
+      this.$http
219
+        .post("service/bpm/data/fetchDataList/inspectionType",postData)
220
+        .then((res) => {
221
+          if(res.data.status == 200){
222
+            this.searchsType1 = this.searchsType1.concat(res.data.list.map(v => ({text:v.type, value: v.id})));
223
+            console.log('searchsType1=>', this.searchsType1)
224
+          }
225
+        })
226
+    },
227
+    stateChange() {
228
+      this.loadShow = true;
229
+      this.items = [];
230
+      this.idx = 0;
231
+      this.sum = 10;
232
+      this.getData();
233
+    },
199
     // 查看详情
234
     // 查看详情
200
     toDetail(item) {
235
     toDetail(item) {
201
       console.log(item);
236
       console.log(item);
@@ -286,14 +321,14 @@ export default {
286
       console.log(this.$route.params.state)
321
       console.log(this.$route.params.state)
287
       if (this.$route.params.state) {
322
       if (this.$route.params.state) {
288
         console.log(this.$route.params.state);
323
         console.log(this.$route.params.state);
289
-        this.stateValue = this.$route.params.state;
324
+        this.searchType = this.$route.params.state;
290
       }
325
       }
291
     },
326
     },
292
     showPicker() {
327
     showPicker() {
293
       if (!this.picker) {
328
       if (!this.picker) {
294
         this.picker = this.$createPicker({
329
         this.picker = this.$createPicker({
295
           title: "",
330
           title: "",
296
-          data: [this.stateData],
331
+          data: [this.searchsType],
297
           selectedIndex: [1],
332
           selectedIndex: [1],
298
           onSelect: this.selectHandle,
333
           onSelect: this.selectHandle,
299
           onCancel: this.cancelHandle
334
           onCancel: this.cancelHandle
@@ -304,7 +339,7 @@ export default {
304
     selectHandle(selectedVal, selectedIndex, selectedText) {
339
     selectHandle(selectedVal, selectedIndex, selectedText) {
305
       console.log(selectedVal, selectedIndex, selectedText);
340
       console.log(selectedVal, selectedIndex, selectedText);
306
 
341
 
307
-      this.stateValue = selectedVal[0];
342
+      this.searchType = selectedVal[0];
308
       this.items = [];
343
       this.items = [];
309
       this.getData();
344
       this.getData();
310
     },
345
     },
@@ -317,7 +352,7 @@ export default {
317
     },
352
     },
318
     // 获取列表
353
     // 获取列表
319
     getData() {
354
     getData() {
320
-      console.log(this.stateValue);
355
+      console.log(this.searchType);
321
       var that = this;
356
       var that = this;
322
       // that.items.length=0;
357
       // that.items.length=0;
323
       if (that.searching) {
358
       if (that.searching) {
@@ -332,14 +367,15 @@ export default {
332
           //   title: that.title,
367
           //   title: that.title,
333
           //   executeUser: { id: that.loginUser.id }
368
           //   executeUser: { id: that.loginUser.id }
334
           // }
369
           // }
335
-          typeSearch: that.title
370
+          typeSearch: that.title,
371
+          inspectionTypeId: that.searchType1 === 'all' ? undefined :that.searchType1,
336
           // processUser:{
372
           // processUser:{
337
           //   id:that.loginUser.id
373
           //   id:that.loginUser.id
338
           // }
374
           // }
339
         },
375
         },
340
-        searchType: that.stateValue
376
+        searchType: that.searchType
341
       };
377
       };
342
-      if (that.stateValue === "todo") {
378
+      if (that.searchType === "todo") {
343
         // 待处理添加筛选条件
379
         // 待处理添加筛选条件
344
         console.log(postData, "2022年5月30日");
380
         console.log(postData, "2022年5月30日");
345
         postData.candidateGroups = that.loginUser.group
381
         postData.candidateGroups = that.loginUser.group
@@ -424,6 +460,7 @@ export default {
424
   },
460
   },
425
   created() {
461
   created() {
426
     this.getParamsState();
462
     this.getParamsState();
463
+    this.getInspectionType();
427
     this.getData(this.idx, this.sum);
464
     this.getData(this.idx, this.sum);
428
   }
465
   }
429
 };
466
 };
@@ -439,6 +476,15 @@ export default {
439
   padding-top: 1.76rem;
476
   padding-top: 1.76rem;
440
 }
477
 }
441
 
478
 
479
+.cube-select {
480
+  height: 0.88rem;
481
+  line-height: 0.88rem;
482
+  padding: 0 0.24rem;
483
+  font-size: 0.36rem;
484
+  color: #333333;
485
+  border-bottom: 0.08rem solid #e5e5e5;
486
+}
487
+
442
 .foods-wrapper {
488
 .foods-wrapper {
443
   .food-item {
489
   .food-item {
444
     display: flex;
490
     display: flex;
@@ -640,14 +686,17 @@ export default {
640
     z-index: 6;
686
     z-index: 6;
641
   }
687
   }
642
   .seatchHeader {
688
   .seatchHeader {
689
+    display: flex;
643
     width: 100%;
690
     width: 100%;
644
     background-color: #eee;
691
     background-color: #eee;
645
-    padding: 0.16rem;
646
     overflow: hidden;
692
     overflow: hidden;
647
     position: fixed;
693
     position: fixed;
648
     top: 0.88rem;
694
     top: 0.88rem;
649
     z-index: 6;
695
     z-index: 6;
650
     box-sizing: border-box;
696
     box-sizing: border-box;
697
+    .stateSearch{
698
+      flex: 1;
699
+    }
651
     .search {
700
     .search {
652
       width: 5.74rem;
701
       width: 5.74rem;
653
       height: 0.56rem;
702
       height: 0.56rem;