Bladeren bron

巡检优化

seimin 2 jaren geleden
bovenliggende
commit
8a9a2fb3f2
1 gewijzigde bestanden met toevoegingen van 68 en 19 verwijderingen
  1. 68 19
      src/views/Inspection.vue

+ 68 - 19
src/views/Inspection.vue

@@ -4,7 +4,7 @@
4 4
       <div class="demo">
5 5
         <div class="header">巡检列表</div>
6 6
         <div class="seatchHeader">
7
-          <div class="search fl">
7
+          <!-- <div class="search fl">
8 8
             <input
9 9
               class="searchInp"
10 10
               type="text"
@@ -13,7 +13,19 @@
13 13
               @input="searchData()"
14 14
             />
15 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 29
         </div>
18 30
         <div class="scroll-list-wrap">
19 31
           <cube-scroll
@@ -23,12 +35,6 @@
23 35
             @pulling-down="onPullingDown"
24 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 38
             <div class="conentBox">
33 39
               <div
34 40
                 class="conent"
@@ -57,6 +63,10 @@
57 63
                       item.inspection.title
58 64
                     }}</span>
59 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 70
                 </div>
61 71
                 <div class="bottom">
62 72
                   <i
@@ -122,7 +132,6 @@ import LoadIng from "./../views/loading.vue";
122 132
 export default {
123 133
   data() {
124 134
     return {
125
-      //   items: _foods,
126 135
       loginUser: JSON.parse(localStorage.getItem("loginUser")),
127 136
       menu: JSON.parse(localStorage.getItem("menu")),
128 137
       valConfig: JSON.parse(localStorage.getItem("valConfig")) - 0, //报修主体
@@ -138,7 +147,8 @@ export default {
138 147
       customPullDown: true,
139 148
       wushuju: false,
140 149
       title: "", //搜索内容
141
-      stateData: [
150
+      searchType: "todo",
151
+      searchsType: [
142 152
         {
143 153
           text: "全部",
144 154
           value: "all"
@@ -152,7 +162,13 @@ export default {
152 162
           value: "done"
153 163
         }
154 164
       ],
155
-      stateValue: "todo",
165
+      searchType1: "all",
166
+      searchsType1: [
167
+        {
168
+          text: "全部",
169
+          value: "all"
170
+        }
171
+      ],
156 172
       sum: 10,
157 173
       idx: 0,
158 174
       stateClass: "",
@@ -196,6 +212,25 @@ export default {
196 212
     }
197 213
   },
198 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 235
     toDetail(item) {
201 236
       console.log(item);
@@ -286,14 +321,14 @@ export default {
286 321
       console.log(this.$route.params.state)
287 322
       if (this.$route.params.state) {
288 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 327
     showPicker() {
293 328
       if (!this.picker) {
294 329
         this.picker = this.$createPicker({
295 330
           title: "",
296
-          data: [this.stateData],
331
+          data: [this.searchsType],
297 332
           selectedIndex: [1],
298 333
           onSelect: this.selectHandle,
299 334
           onCancel: this.cancelHandle
@@ -304,7 +339,7 @@ export default {
304 339
     selectHandle(selectedVal, selectedIndex, selectedText) {
305 340
       console.log(selectedVal, selectedIndex, selectedText);
306 341
 
307
-      this.stateValue = selectedVal[0];
342
+      this.searchType = selectedVal[0];
308 343
       this.items = [];
309 344
       this.getData();
310 345
     },
@@ -317,7 +352,7 @@ export default {
317 352
     },
318 353
     // 获取列表
319 354
     getData() {
320
-      console.log(this.stateValue);
355
+      console.log(this.searchType);
321 356
       var that = this;
322 357
       // that.items.length=0;
323 358
       if (that.searching) {
@@ -332,14 +367,15 @@ export default {
332 367
           //   title: that.title,
333 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 372
           // processUser:{
337 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 380
         console.log(postData, "2022年5月30日");
345 381
         postData.candidateGroups = that.loginUser.group
@@ -424,6 +460,7 @@ export default {
424 460
   },
425 461
   created() {
426 462
     this.getParamsState();
463
+    this.getInspectionType();
427 464
     this.getData(this.idx, this.sum);
428 465
   }
429 466
 };
@@ -439,6 +476,15 @@ export default {
439 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 488
 .foods-wrapper {
443 489
   .food-item {
444 490
     display: flex;
@@ -640,14 +686,17 @@ export default {
640 686
     z-index: 6;
641 687
   }
642 688
   .seatchHeader {
689
+    display: flex;
643 690
     width: 100%;
644 691
     background-color: #eee;
645
-    padding: 0.16rem;
646 692
     overflow: hidden;
647 693
     position: fixed;
648 694
     top: 0.88rem;
649 695
     z-index: 6;
650 696
     box-sizing: border-box;
697
+    .stateSearch{
698
+      flex: 1;
699
+    }
651 700
     .search {
652 701
       width: 5.74rem;
653 702
       height: 0.56rem;