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
     proxyTable: {
14
     proxyTable: {
15
       '/service': {//自定义名字,代表的是以下target中的内容
15
       '/service': {//自定义名字,代表的是以下target中的内容
16
         // target: host.host+'/service/',//微信
16
         // target: host.host+'/service/',//微信
17
-        target: 'http://192.168.3.111',//微信
17
+        target: 'http://192.168.3.105',//微信
18
         changeOrigin: true,//是否允许跨域
18
         changeOrigin: true,//是否允许跨域
19
         // pathRewrite: {
19
         // pathRewrite: {
20
         //   '^/service': ''
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
       name: 'IncidentList',
56
       name: 'IncidentList',
57
       component: IncidentList,
57
       component: IncidentList,
58
       meta: {
58
       meta: {

+ 2 - 2
src/views/Main.vue

@@ -1,14 +1,14 @@
1
 <template>
1
 <template>
2
     <div class="fle bgColor">
2
     <div class="fle bgColor">
3
         <transition name="fade" mode="out-in">
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
         </transition>
5
         </transition>
6
         <div class="section2">
6
         <div class="section2">
7
             <router-link to="/main/indes" class="link" active-class="active">
7
             <router-link to="/main/indes" class="link" active-class="active">
8
                 <i class="iconfont icon-shouyexian"></i>
8
                 <i class="iconfont icon-shouyexian"></i>
9
                 <span>首页</span>
9
                 <span>首页</span>
10
             </router-link>
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
                 <i class="iconfont icon-baoxiuxian"></i>
12
                 <i class="iconfont icon-baoxiuxian"></i>
13
                 <span>事件</span>
13
                 <span>事件</span>
14
             </router-link>
14
             </router-link>

+ 94 - 37
src/views/incidentList.vue

@@ -3,12 +3,20 @@
3
     <div slot="content" class="scroll-wrapper">
3
     <div slot="content" class="scroll-wrapper">
4
       <div class="demo">
4
       <div class="demo">
5
         <div class="header">事件列表</div>
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
         <div class="scroll-list-wrap">
20
         <div class="scroll-list-wrap">
13
           <cube-scroll
21
           <cube-scroll
14
             ref="scroll"
22
             ref="scroll"
@@ -188,6 +196,7 @@ export default {
188
         disjunctor: false
196
         disjunctor: false
189
       },
197
       },
190
       isAssign: false, //是否有权限指派
198
       isAssign: false, //是否有权限指派
199
+      isAll: false, //是否显示全部事件
191
       loginUser: JSON.parse(localStorage.getItem("loginUser")),
200
       loginUser: JSON.parse(localStorage.getItem("loginUser")),
192
       valConfig: JSON.parse(localStorage.getItem("valConfig")) - 0, //报修主体
201
       valConfig: JSON.parse(localStorage.getItem("valConfig")) - 0, //报修主体
193
       items: [],
202
       items: [],
@@ -203,15 +212,11 @@ export default {
203
       candidateGroups: "",
212
       candidateGroups: "",
204
       searchsType: [
213
       searchsType: [
205
         {
214
         {
206
-          text: "全部",
207
-          value: "userAll"
208
-        },
209
-        {
210
-          text: "待处理",
215
+          text: "待我处理",
211
           value: "todo"
216
           value: "todo"
212
         },
217
         },
213
         {
218
         {
214
-          text: "处理过",
219
+          text: "与我关联",
215
           value: "done"
220
           value: "done"
216
         }
221
         }
217
         // {
222
         // {
@@ -219,8 +224,11 @@ export default {
219
         //   value: "create"
224
         //   value: "create"
220
         // }
225
         // }
221
       ],
226
       ],
222
-      searchType: "userAll",
227
+      searchsState:[],//状态列表
228
+      searchType: "all",
229
+      searchState: 0,
223
       type: "all",
230
       type: "all",
231
+      isToday: "",
224
       sum: 10,
232
       sum: 10,
225
       idx: 0,
233
       idx: 0,
226
       stateClass: "",
234
       stateClass: "",
@@ -405,22 +413,22 @@ export default {
405
     getParamsState() {
413
     getParamsState() {
406
       if (this.$route.params.type) {
414
       if (this.$route.params.type) {
407
         this.type = this.$route.params.type;
415
         this.type = this.$route.params.type;
416
+        this.isToday = this.$route.params.isToday;
408
         if (this.type === "todo") {
417
         if (this.type === "todo") {
409
           this.searchType = "todo";
418
           this.searchType = "todo";
410
         } else if (this.type === "done") {
419
         } else if (this.type === "done") {
411
           this.searchType = "done";
420
           this.searchType = "done";
412
         } else {
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
       this.loadShow = true;
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
     toIncidentDetails(data) {
433
     toIncidentDetails(data) {
426
       console.log(1111111);
434
       console.log(1111111);
@@ -452,25 +460,53 @@ export default {
452
     },
460
     },
453
 
461
 
454
     getData() {
462
     getData() {
455
-      var that = this;
456
       let postData = {
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
         postData.incident.acceptDate =
472
         postData.incident.acceptDate =
466
           formatDate(new Date(), "yyyy-MM-dd") + " 00:00:00";
473
           formatDate(new Date(), "yyyy-MM-dd") + " 00:00:00";
467
         postData.incident.acceptDateEnd =
474
         postData.incident.acceptDateEnd =
468
           formatDate(new Date(), "yyyy-MM-dd") + " 23:59:59";
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
         .post("service/bpm/bpm/fetchTask/bpm_incident", postData)
508
         .post("service/bpm/bpm/fetchTask/bpm_incident", postData)
473
-        .then(function(res) {
509
+        .then((res) => {
474
           if (res.data.data.length > 0) {
510
           if (res.data.data.length > 0) {
475
             for (var i = 0; i < res.data.data.length; i++) {
511
             for (var i = 0; i < res.data.data.length; i++) {
476
               res.data.data[i].createTime = formatDate(
512
               res.data.data[i].createTime = formatDate(
@@ -478,16 +514,17 @@ export default {
478
                 "yyyy-MM-dd hh:mm"
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
             } else {
519
             } else {
484
-              that.items = res.data.data;
520
+              this.items = res.data.data;
485
             }
521
             }
486
           } else {
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
     onPullingDown() {
529
     onPullingDown() {
493
       var that = this;
530
       var that = this;
@@ -531,6 +568,14 @@ export default {
531
         this.$refs.scroll.destroy();
568
         this.$refs.scroll.destroy();
532
         this.$refs.scroll.initScroll();
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
   created() {
581
   created() {
@@ -538,6 +583,13 @@ export default {
538
     let menu = JSON.parse(localStorage.getItem("menu"));
583
     let menu = JSON.parse(localStorage.getItem("menu"));
539
     if (menu) {
584
     if (menu) {
540
       this.isAssign = menu.some(v => v.link == "shijianliebiao_assign");
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
     that.loginUser.group.forEach(element => {
594
     that.loginUser.group.forEach(element => {
543
       that.candidateGroups += element.id + ",";
595
       that.candidateGroups += element.id + ",";
@@ -549,6 +601,7 @@ export default {
549
     this.getParamsState();
601
     this.getParamsState();
550
     this.loadShow = true;
602
     this.loadShow = true;
551
     this.getData();
603
     this.getData();
604
+    this.getStateList();
552
 
605
 
553
     localStorage.removeItem("modelData");
606
     localStorage.removeItem("modelData");
554
     // localStorage.removeItem("category");
607
     // localStorage.removeItem("category");
@@ -698,11 +751,15 @@ export default {
698
   top: 0;
751
   top: 0;
699
   z-index: 6;
752
   z-index: 6;
700
 }
753
 }
701
-.stateSearch {
754
+.stateSearchWrap{
702
   width: 100%;
755
   width: 100%;
703
   position: fixed;
756
   position: fixed;
704
   top: 0.88rem;
757
   top: 0.88rem;
705
   z-index: 6;
758
   z-index: 6;
759
+  display: flex;
760
+  .stateSearch {
761
+    flex: 1;
762
+  }
706
 }
763
 }
707
 .bgColor {
764
 .bgColor {
708
   background-color: white;
765
   background-color: white;

+ 20 - 11
src/views/indes.vue

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

+ 9 - 1
src/views/my.vue

@@ -125,6 +125,7 @@ import "./../../static/css/iconfont.js";
125
 export default {
125
 export default {
126
   data() {
126
   data() {
127
     return {
127
     return {
128
+      isAll:false,//是否显示全部事件权限
128
       loginUser: JSON.parse(localStorage.getItem("loginUser")),
129
       loginUser: JSON.parse(localStorage.getItem("loginUser")),
129
       valConfig: JSON.parse(localStorage.getItem("valConfig")) - 0, //报修主体
130
       valConfig: JSON.parse(localStorage.getItem("valConfig")) - 0, //报修主体
130
       ifWorking: localStorage.getItem("ifWorking"), //是否开通上下班
131
       ifWorking: localStorage.getItem("ifWorking"), //是否开通上下班
@@ -284,7 +285,9 @@ export default {
284
     },
285
     },
285
     // 跳转到事件列表
286
     // 跳转到事件列表
286
     toIncidentList(searchType) {
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
     toinspectionList(state) {
293
     toinspectionList(state) {
@@ -334,6 +337,11 @@ export default {
334
     },
337
     },
335
   },
338
   },
336
   created() {
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
     this.getGroups();
345
     this.getGroups();
338
     this.getIncidentData();
346
     this.getIncidentData();
339
     if(this.ifWorking == 1){
347
     if(this.ifWorking == 1){

+ 44 - 2
src/views/newIncident.vue

@@ -27,6 +27,10 @@
27
     >
27
     >
28
       <cube-form-group>
28
       <cube-form-group>
29
         <cube-form-item
29
         <cube-form-item
30
+          :field="fields[24]"
31
+          class="btn_plcaeholde"
32
+        ></cube-form-item>
33
+        <cube-form-item
30
           :field="fields[20]"
34
           :field="fields[20]"
31
           v-if="valConfig == 2"
35
           v-if="valConfig == 2"
32
           class="btn_plcaeholde btn_local"
36
           class="btn_plcaeholde btn_local"
@@ -365,6 +369,7 @@ export default {
365
         assetId: "", //资产
369
         assetId: "", //资产
366
         category: [],
370
         category: [],
367
         source: "", //事件来源
371
         source: "", //事件来源
372
+        branch: "", //院区
368
         title: "", //事件主题
373
         title: "", //事件主题
369
         priority: "", //优先级
374
         priority: "", //优先级
370
         emergency: "", //紧急度
375
         emergency: "", //紧急度
@@ -377,7 +382,7 @@ export default {
377
         candidateGroups: "", //处理组
382
         candidateGroups: "", //处理组
378
         solutionType: [], //知识库类型
383
         solutionType: [], //知识库类型
379
         handleUserOrGroup: false, //处理人or处理组
384
         handleUserOrGroup: false, //处理人or处理组
380
-        room: "" //房间号
385
+        room: "", //房间号
381
       },
386
       },
382
       selectedCategoryTxt: "", //事件分类选中展示
387
       selectedCategoryTxt: "", //事件分类选中展示
383
       selectedPlaceTxt: "", //区域地点选中展示
388
       selectedPlaceTxt: "", //区域地点选中展示
@@ -385,6 +390,7 @@ export default {
385
       promptingConent: "",
390
       promptingConent: "",
386
       promptingStatus: "",
391
       promptingStatus: "",
387
       order: 1, //处理方式  1:直接处理,2:派单
392
       order: 1, //处理方式  1:直接处理,2:派单
393
+      branchArr: [], //院区数组
388
       sourceArr: [], //事件来源数组
394
       sourceArr: [], //事件来源数组
389
       priorityArr: [], //优先级数组
395
       priorityArr: [], //优先级数组
390
       emergencyArr: [], //紧急度数组
396
       emergencyArr: [], //紧急度数组
@@ -736,7 +742,20 @@ export default {
736
           rules: {
742
           rules: {
737
             required: false
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
           that.fields[5].props.options = that.sourceArr;
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
     getPriority() {
869
     getPriority() {
830
       var that = this;
870
       var that = this;
@@ -1854,6 +1894,8 @@ export default {
1854
   },
1894
   },
1855
   created() {
1895
   created() {
1856
     console.log(this.$route.params.data);
1896
     console.log(this.$route.params.data);
1897
+    //获取院区
1898
+    this.getBranch();
1857
     //获取事件来源
1899
     //获取事件来源
1858
     this.getSource();
1900
     this.getSource();
1859
     // 优先级
1901
     // 优先级