Browse Source

事件列表修改

seimin 2 years ago
parent
commit
5efd286520
7 changed files with 171 additions and 55 deletions
  1. 1 1
      config/index.js
  2. 1 1
      src/router/index.js
  3. 2 2
      src/views/Main.vue
  4. 94 37
      src/views/incidentList.vue
  5. 20 11
      src/views/indes.vue
  6. 9 1
      src/views/my.vue
  7. 44 2
      src/views/newIncident.vue

+ 1 - 1
config/index.js

@@ -14,7 +14,7 @@ module.exports = {
14 14
     proxyTable: {
15 15
       '/service': {//自定义名字,代表的是以下target中的内容
16 16
         // target: host.host+'/service/',//微信
17
-        target: 'http://192.168.3.111',//微信
17
+        target: 'http://192.168.3.105',//微信
18 18
         changeOrigin: true,//是否允许跨域
19 19
         // pathRewrite: {
20 20
         //   '^/service': ''

+ 1 - 1
src/router/index.js

@@ -52,7 +52,7 @@ export default new Router({
52 52
       },
53 53
     },
54 54
     {
55
-      path: '/main/incidentList/:type',
55
+      path: '/main/incidentList/:type/:isToday?',
56 56
       name: 'IncidentList',
57 57
       component: IncidentList,
58 58
       meta: {

+ 2 - 2
src/views/Main.vue

@@ -1,14 +1,14 @@
1 1
 <template>
2 2
     <div class="fle bgColor">
3 3
         <transition name="fade" mode="out-in">
4
-            <router-view class="fleHeight"></router-view>
4
+            <router-view class="fleHeight" :key="$route.fullPath"></router-view>
5 5
         </transition>
6 6
         <div class="section2">
7 7
             <router-link to="/main/indes" class="link" active-class="active">
8 8
                 <i class="iconfont icon-shouyexian"></i>
9 9
                 <span>首页</span>
10 10
             </router-link>
11
-            <router-link to="/main/incidentList/all" class="link" active-class="active">
11
+            <router-link to="/main/incidentList/todo/" class="link" active-class="active">
12 12
                 <i class="iconfont icon-baoxiuxian"></i>
13 13
                 <span>事件</span>
14 14
             </router-link>

+ 94 - 37
src/views/incidentList.vue

@@ -3,12 +3,20 @@
3 3
     <div slot="content" class="scroll-wrapper">
4 4
       <div class="demo">
5 5
         <div class="header">事件列表</div>
6
-        <cube-select
7
-          class="stateSearch"
8
-          v-model="searchType"
9
-          :options="searchsType"
10
-          @change="stateChange()"
11
-        ></cube-select>
6
+        <div class="stateSearchWrap">
7
+          <cube-select
8
+            class="stateSearch"
9
+            v-model="searchType"
10
+            :options="searchsType"
11
+            @change="typeChange()"
12
+          ></cube-select>
13
+          <cube-select
14
+            class="stateSearch"
15
+            v-model="searchState"
16
+            :options="searchsState"
17
+            @change="typeChange()"
18
+          ></cube-select>
19
+        </div>
12 20
         <div class="scroll-list-wrap">
13 21
           <cube-scroll
14 22
             ref="scroll"
@@ -188,6 +196,7 @@ export default {
188 196
         disjunctor: false
189 197
       },
190 198
       isAssign: false, //是否有权限指派
199
+      isAll: false, //是否显示全部事件
191 200
       loginUser: JSON.parse(localStorage.getItem("loginUser")),
192 201
       valConfig: JSON.parse(localStorage.getItem("valConfig")) - 0, //报修主体
193 202
       items: [],
@@ -203,15 +212,11 @@ export default {
203 212
       candidateGroups: "",
204 213
       searchsType: [
205 214
         {
206
-          text: "全部",
207
-          value: "userAll"
208
-        },
209
-        {
210
-          text: "待处理",
215
+          text: "待我处理",
211 216
           value: "todo"
212 217
         },
213 218
         {
214
-          text: "处理过",
219
+          text: "与我关联",
215 220
           value: "done"
216 221
         }
217 222
         // {
@@ -219,8 +224,11 @@ export default {
219 224
         //   value: "create"
220 225
         // }
221 226
       ],
222
-      searchType: "userAll",
227
+      searchsState:[],//状态列表
228
+      searchType: "all",
229
+      searchState: 0,
223 230
       type: "all",
231
+      isToday: "",
224 232
       sum: 10,
225 233
       idx: 0,
226 234
       stateClass: "",
@@ -405,22 +413,22 @@ export default {
405 413
     getParamsState() {
406 414
       if (this.$route.params.type) {
407 415
         this.type = this.$route.params.type;
416
+        this.isToday = this.$route.params.isToday;
408 417
         if (this.type === "todo") {
409 418
           this.searchType = "todo";
410 419
         } else if (this.type === "done") {
411 420
           this.searchType = "done";
412 421
         } else {
413
-          this.searchType = "userAll";
422
+          this.searchType = "all";
414 423
         }
415 424
       }
416 425
     },
417
-    stateChange() {
418
-      var that = this;
426
+    typeChange() {
419 427
       this.loadShow = true;
420
-      that.items = [];
421
-      that.idx = 0;
422
-      that.sum = 10;
423
-      that.getData();
428
+      this.items = [];
429
+      this.idx = 0;
430
+      this.sum = 10;
431
+      this.getData();
424 432
     },
425 433
     toIncidentDetails(data) {
426 434
       console.log(1111111);
@@ -452,25 +460,53 @@ export default {
452 460
     },
453 461
 
454 462
     getData() {
455
-      var that = this;
456 463
       let postData = {
457
-        assignee: that.loginUser.id,
458
-        candidateGroups: that.candidateGroups,
459
-        searchType: that.searchType,
460
-        idx: that.idx,
461
-        sum: that.sum,
462
-        incident: { temporary: true }
464
+        assignee: this.loginUser.id,
465
+        candidateGroups: this.candidateGroups,
466
+        searchType: this.searchType,
467
+        idx: this.idx,
468
+        sum: this.sum,
469
+        incident: { temporary: true,statusId:this.searchState?this.searchState:undefined }
463 470
       };
464
-      if (this.type === "today") {
471
+      if (this.isToday == "today") {
465 472
         postData.incident.acceptDate =
466 473
           formatDate(new Date(), "yyyy-MM-dd") + " 00:00:00";
467 474
         postData.incident.acceptDateEnd =
468 475
           formatDate(new Date(), "yyyy-MM-dd") + " 23:59:59";
469 476
       }
470
-
471
-      that.$http
477
+      if(this.searchType === 'all'){
478
+        // 全部事件
479
+        if(this.loginUser.duty){
480
+            // 当前的所属责任科室
481
+            postData.incident.duty = this.loginUser.duty;
482
+        }else if(this.loginUser.branch){
483
+            // 当前的所属院区
484
+            postData.incident.branch = this.loginUser.branch.id;
485
+        }
486
+        this.$http
487
+        .post("service/user/data/fetchDataList/incident", postData)
488
+        .then((res) => {
489
+          if (res.data.list.length > 0) {
490
+            for (var i = 0; i < res.data.list.length; i++) {
491
+              res.data.list[i].createTime = formatDate(
492
+                new Date(res.data.list[i].createTime),
493
+                "yyyy-MM-dd hh:mm"
494
+              );
495
+            }
496
+            if (this.idx) {
497
+              this.items = this.items.concat(res.data.list);
498
+            } else {
499
+              this.items = res.data.list;
500
+            }
501
+          } else {
502
+            this.pullUpLoad = false;
503
+          }
504
+          this.loadShow = false;
505
+        });
506
+      }else{
507
+        this.$http
472 508
         .post("service/bpm/bpm/fetchTask/bpm_incident", postData)
473
-        .then(function(res) {
509
+        .then((res) => {
474 510
           if (res.data.data.length > 0) {
475 511
             for (var i = 0; i < res.data.data.length; i++) {
476 512
               res.data.data[i].createTime = formatDate(
@@ -478,16 +514,17 @@ export default {
478 514
                 "yyyy-MM-dd hh:mm"
479 515
               );
480 516
             }
481
-            if (that.idx) {
482
-              that.items = that.items.concat(res.data.data);
517
+            if (this.idx) {
518
+              this.items = this.items.concat(res.data.data);
483 519
             } else {
484
-              that.items = res.data.data;
520
+              this.items = res.data.data;
485 521
             }
486 522
           } else {
487
-            that.pullUpLoad = false;
523
+            this.pullUpLoad = false;
488 524
           }
489
-          that.loadShow = false;
525
+          this.loadShow = false;
490 526
         });
527
+      }
491 528
     },
492 529
     onPullingDown() {
493 530
       var that = this;
@@ -531,6 +568,14 @@ export default {
531 568
         this.$refs.scroll.destroy();
532 569
         this.$refs.scroll.initScroll();
533 570
       });
571
+    },
572
+    // 获取事件状态
573
+    getStateList(){
574
+      this.$http
575
+        .post("service/common/common/getDictionary", {"type":"list","key":"incident_status"})
576
+        .then((res) => {
577
+          this.searchsState = [{text:'全部',value:0},...res.data.map(v=>({text:v.name,value:v.id}))]
578
+        });
534 579
     }
535 580
   },
536 581
   created() {
@@ -538,6 +583,13 @@ export default {
538 583
     let menu = JSON.parse(localStorage.getItem("menu"));
539 584
     if (menu) {
540 585
       this.isAssign = menu.some(v => v.link == "shijianliebiao_assign");
586
+      this.isAll = menu.some(v => v.link == "shijianliebiao_all");
587
+      if(this.isAll){
588
+        this.searchsType.unshift({
589
+          text: "全部事件",
590
+          value: "all"
591
+        })
592
+      }
541 593
     }
542 594
     that.loginUser.group.forEach(element => {
543 595
       that.candidateGroups += element.id + ",";
@@ -549,6 +601,7 @@ export default {
549 601
     this.getParamsState();
550 602
     this.loadShow = true;
551 603
     this.getData();
604
+    this.getStateList();
552 605
 
553 606
     localStorage.removeItem("modelData");
554 607
     // localStorage.removeItem("category");
@@ -698,11 +751,15 @@ export default {
698 751
   top: 0;
699 752
   z-index: 6;
700 753
 }
701
-.stateSearch {
754
+.stateSearchWrap{
702 755
   width: 100%;
703 756
   position: fixed;
704 757
   top: 0.88rem;
705 758
   z-index: 6;
759
+  display: flex;
760
+  .stateSearch {
761
+    flex: 1;
762
+  }
706 763
 }
707 764
 .bgColor {
708 765
   background-color: white;

+ 20 - 11
src/views/indes.vue

@@ -42,22 +42,20 @@
42 42
         v-if="!newStatisticsLoading && isShowNewStatistics"
43 43
       >
44 44
         <div class="buildOrder">
45
-          <router-link
46
-            class="buildOrderItem"
47
-            :to="{ path: '/main/incidentList/today' }"
48
-            tag="div"
45
+          <div
46
+            class="buildOrderItem" 
47
+            @click="goTo('/main/incidentList/all/today')"
49 48
           >
50 49
             <div class="s_num">{{ newStatistics.createOrders }}</div>
51 50
             <div>今日建单</div>
52
-          </router-link>
53
-          <router-link
54
-            class="buildOrderItem"
55
-            :to="{ path: '/main/incidentList/todo' }"
56
-            tag="div"
51
+          </div>
52
+          <div
53
+            class="buildOrderItem" 
54
+            @click="goTo('/main/incidentList/todo/')"
57 55
           >
58 56
             <div class="s_num">{{ newStatistics.todoOrders }}</div>
59 57
             <div>待处理</div>
60
-          </router-link>
58
+          </div>
61 59
         </div>
62 60
         <div class="attendance" v-if="ifWorking == 1">
63 61
           <router-link
@@ -246,6 +244,7 @@ import { SM } from "./../http/http";
246 244
 export default {
247 245
   data() {
248 246
     return {
247
+      isAll:false,//是否显示全部事件权限
249 248
       wxClQuestions: localStorage.getItem("wxClQuestions"),
250 249
       loginUser: JSON.parse(localStorage.getItem("loginUser")),
251 250
       incidentWithConsumable: localStorage.getItem("incidentWithConsumable"), //是否绑定耗材
@@ -272,6 +271,11 @@ export default {
272 271
     };
273 272
   },
274 273
   methods: {
274
+    goTo(url){
275
+      if(this.isAll){
276
+        this.$router.push(url);
277
+      }
278
+    },
275 279
     scan() {
276 280
       // this.$router.push({name:'ScanResult',params:{data:'[{"name":"资产名称","value":"哈哈哈"},{"name":"数量","value":"12"}]'}});
277 281
       SM(this).then(ress1 => {
@@ -353,7 +357,7 @@ export default {
353 357
       this.$router.push({ path: "/noticeList" });
354 358
     },
355 359
     toIncidentList(searchType) {
356
-      this.$router.push({ path: "/main/incidentList/" + searchType });
360
+      this.$router.push({ path: "/main/incidentList/" + searchType + '/' });
357 361
     },
358 362
     // toKnowList() {
359 363
     //   this.$router.push({ path: "/knowList" });
@@ -392,6 +396,11 @@ export default {
392 396
     }
393 397
   },
394 398
   created() {
399
+    // 判断全部事件是否显示权限
400
+    let menu = JSON.parse(localStorage.getItem("menu"));
401
+    if (menu) {
402
+      this.isAll = menu.some(v => v.link == "shijianliebiao_all");
403
+    }
395 404
     this.isShowNewStatistics = this.loginUser.role.some(
396 405
       v =>
397 406
         v.rolecode == "incident-category-manager" ||

+ 9 - 1
src/views/my.vue

@@ -125,6 +125,7 @@ import "./../../static/css/iconfont.js";
125 125
 export default {
126 126
   data() {
127 127
     return {
128
+      isAll:false,//是否显示全部事件权限
128 129
       loginUser: JSON.parse(localStorage.getItem("loginUser")),
129 130
       valConfig: JSON.parse(localStorage.getItem("valConfig")) - 0, //报修主体
130 131
       ifWorking: localStorage.getItem("ifWorking"), //是否开通上下班
@@ -284,7 +285,9 @@ export default {
284 285
     },
285 286
     // 跳转到事件列表
286 287
     toIncidentList(searchType) {
287
-      this.$router.push({ path: "/main/incidentList/" + searchType });
288
+      if(!(searchType === 'all' && !this.isAll)){
289
+        this.$router.push({ path: "/main/incidentList/" + searchType + '/' });
290
+      }
288 291
     },
289 292
     // 巡检列表
290 293
     toinspectionList(state) {
@@ -334,6 +337,11 @@ export default {
334 337
     },
335 338
   },
336 339
   created() {
340
+    // 判断全部事件是否显示权限
341
+    let menu = JSON.parse(localStorage.getItem("menu"));
342
+    if (menu) {
343
+      this.isAll = menu.some(v => v.link == "shijianliebiao_all");
344
+    }
337 345
     this.getGroups();
338 346
     this.getIncidentData();
339 347
     if(this.ifWorking == 1){

+ 44 - 2
src/views/newIncident.vue

@@ -27,6 +27,10 @@
27 27
     >
28 28
       <cube-form-group>
29 29
         <cube-form-item
30
+          :field="fields[24]"
31
+          class="btn_plcaeholde"
32
+        ></cube-form-item>
33
+        <cube-form-item
30 34
           :field="fields[20]"
31 35
           v-if="valConfig == 2"
32 36
           class="btn_plcaeholde btn_local"
@@ -365,6 +369,7 @@ export default {
365 369
         assetId: "", //资产
366 370
         category: [],
367 371
         source: "", //事件来源
372
+        branch: "", //院区
368 373
         title: "", //事件主题
369 374
         priority: "", //优先级
370 375
         emergency: "", //紧急度
@@ -377,7 +382,7 @@ export default {
377 382
         candidateGroups: "", //处理组
378 383
         solutionType: [], //知识库类型
379 384
         handleUserOrGroup: false, //处理人or处理组
380
-        room: "" //房间号
385
+        room: "", //房间号
381 386
       },
382 387
       selectedCategoryTxt: "", //事件分类选中展示
383 388
       selectedPlaceTxt: "", //区域地点选中展示
@@ -385,6 +390,7 @@ export default {
385 390
       promptingConent: "",
386 391
       promptingStatus: "",
387 392
       order: 1, //处理方式  1:直接处理,2:派单
393
+      branchArr: [], //院区数组
388 394
       sourceArr: [], //事件来源数组
389 395
       priorityArr: [], //优先级数组
390 396
       emergencyArr: [], //紧急度数组
@@ -736,7 +742,20 @@ export default {
736 742
           rules: {
737 743
             required: false
738 744
           }
739
-        }
745
+        },
746
+        {
747
+          type: "select",
748
+          modelKey: "branch",
749
+          label: "院区:",
750
+          props: {
751
+            options: this.branchArr,
752
+            title: "请选择院区",
753
+            placeholder: "请选择院区"
754
+          },
755
+          rules: {
756
+            required: true
757
+          }
758
+        },
740 759
       ]
741 760
     };
742 761
   },
@@ -825,6 +844,27 @@ export default {
825 844
           that.fields[5].props.options = that.sourceArr;
826 845
         });
827 846
     },
847
+    // 获取院区
848
+    getBranch() {
849
+      this.$http
850
+        .post("service/user/data/fetchDataList/branch", {"idx":0,"sum":100})
851
+        .then((res) => {
852
+          if(res.data.status == 200){
853
+            res.data.list.forEach((v) => {
854
+              this.branchArr.push({
855
+                text: v.hosName,
856
+                value: v.id
857
+              });
858
+            });
859
+            this.fields[24].props.options = this.branchArr;
860
+            if(this.loginUser.duty){
861
+              this.model.branch = this.loginUser.duty.branch;
862
+            }else if(this.loginUser.branch){
863
+              this.model.branch = this.loginUser.branch.id;
864
+            }
865
+          }
866
+        });
867
+    },
828 868
     // 获取优先级
829 869
     getPriority() {
830 870
       var that = this;
@@ -1854,6 +1894,8 @@ export default {
1854 1894
   },
1855 1895
   created() {
1856 1896
     console.log(this.$route.params.data);
1897
+    //获取院区
1898
+    this.getBranch();
1857 1899
     //获取事件来源
1858 1900
     this.getSource();
1859 1901
     // 优先级