소스 검색

增加分院区

seimin 3 년 전
부모
커밋
577c207e33
4개의 변경된 파일238개의 추가작업 그리고 66개의 파일을 삭제
  1. 3 3
      src/views/incidentList.vue
  2. 200 28
      src/views/newIncident.vue
  3. 35 34
      src/views/processing.vue
  4. 0 1
      src/views/wxChartDetail.vue

+ 3 - 3
src/views/incidentList.vue

@@ -355,12 +355,12 @@ export default {
355
     this.getData();
355
     this.getData();
356
 
356
 
357
     localStorage.removeItem("modelData");
357
     localStorage.removeItem("modelData");
358
-    localStorage.removeItem("category");
359
-    localStorage.removeItem("categoryVal");
358
+    // localStorage.removeItem("category");
359
+    // localStorage.removeItem("categoryVal");
360
     localStorage.removeItem("referenceInfo");
360
     localStorage.removeItem("referenceInfo");
361
     localStorage.removeItem("order");
361
     localStorage.removeItem("order");
362
     localStorage.removeItem("model");
362
     localStorage.removeItem("model");
363
-    localStorage.removeItem("selectedCategoryTxt");
363
+    // localStorage.removeItem("selectedCategoryTxt");
364
   }
364
   }
365
 };
365
 };
366
 </script>
366
 </script>

+ 200 - 28
src/views/newIncident.vue

@@ -218,6 +218,7 @@ const solution = {
218
       allPlace: {}, //存放请求到的所有区域地点
218
       allPlace: {}, //存放请求到的所有区域地点
219
       sleectHouseNumber: {}, //区域地点
219
       sleectHouseNumber: {}, //区域地点
220
       initSjList: [], //原始事件列表
220
       initSjList: [], //原始事件列表
221
+      initAreaList: [], //原始区域列表
221
       selectedIndex: [0, 0],
222
       selectedIndex: [0, 0],
222
       selectedIndexCate: [0, 0, 0]
223
       selectedIndexCate: [0, 0, 0]
223
     };
224
     };
@@ -767,7 +768,7 @@ export default {
767
     }
768
     }
768
   },
769
   },
769
   methods: {
770
   methods: {
770
-    // 切换处理方式liaomingming
771
+    // 切换处理方式
771
     changeHandleTypes() {
772
     changeHandleTypes() {
772
       let reverseArr = this.model.category.filter(Boolean).reverse(); //数组翻转,取第一项不为空的
773
       let reverseArr = this.model.category.filter(Boolean).reverse(); //数组翻转,取第一项不为空的
773
       let sjId = reverseArr[0]; //事件Id baba
774
       let sjId = reverseArr[0]; //事件Id baba
@@ -1048,7 +1049,9 @@ export default {
1048
       that.modelData.incident.description = that.model.description;
1049
       that.modelData.incident.description = that.model.description;
1049
       // that.modelData.incident.emergency = { id: that.model.emergency };
1050
       // that.modelData.incident.emergency = { id: that.model.emergency };
1050
       // that.modelData.incident.influence = { id: that.model.influence };
1051
       // that.modelData.incident.influence = { id: that.model.influence };
1051
-      that.modelData.incident.priority = { id: that.model.priority };
1052
+      if (that.model.priority) {
1053
+        that.modelData.incident.priority = { id: that.model.priority };
1054
+      }
1052
       that.modelData.incident.alarmType = false;
1055
       that.modelData.incident.alarmType = false;
1053
       if (that.order == 1) {
1056
       if (that.order == 1) {
1054
         // 直接处理
1057
         // 直接处理
@@ -1265,10 +1268,10 @@ export default {
1265
           }
1268
           }
1266
         })
1269
         })
1267
         .show();
1270
         .show();
1268
-      localStorage.removeItem("category");
1271
+      // localStorage.removeItem("category");
1269
       localStorage.removeItem("model");
1272
       localStorage.removeItem("model");
1270
       localStorage.removeItem("modelData");
1273
       localStorage.removeItem("modelData");
1271
-      localStorage.removeItem("placeIndex");
1274
+      // localStorage.removeItem("placeIndex");
1272
       localStorage.removeItem("referenceInfo");
1275
       localStorage.removeItem("referenceInfo");
1273
       localStorage.removeItem("solution");
1276
       localStorage.removeItem("solution");
1274
       localStorage.removeItem("order");
1277
       localStorage.removeItem("order");
@@ -1296,7 +1299,6 @@ export default {
1296
                 (this.integralMechanism == 2 &&
1299
                 (this.integralMechanism == 2 &&
1297
                   this.loginUser.userType.value == 2))
1300
                   this.loginUser.userType.value == 2))
1298
             ) {
1301
             ) {
1299
-              //liaomingming
1300
               this.$http
1302
               this.$http
1301
                 .post("service/common/common/getDictionary", {
1303
                 .post("service/common/common/getDictionary", {
1302
                   key: "incident_integral_state",
1304
                   key: "incident_integral_state",
@@ -1442,30 +1444,75 @@ export default {
1442
       // ----------------------回显其他数据---------------------
1444
       // ----------------------回显其他数据---------------------
1443
       console.log(selectedVal, "seimin");
1445
       console.log(selectedVal, "seimin");
1444
       let reverseArr = selectedVal.filter(Boolean).reverse(); //数组翻转,取第一项不为空的
1446
       let reverseArr = selectedVal.filter(Boolean).reverse(); //数组翻转,取第一项不为空的
1445
-      let sjId = reverseArr[0]; //事件Id baba
1447
+      let sjId = reverseArr[0]; //事件Id
1446
       let sj = this.initSjList.filter(v => v.id == sjId)[0];
1448
       let sj = this.initSjList.filter(v => v.id == sjId)[0];
1447
       console.log(sj);
1449
       console.log(sj);
1448
-      this.model.priority = sj.priority.id;
1449
-      if (sj.userOrGroupType === 1) {
1450
-        //派人
1451
-        this.order = 2;
1452
-        this.model.handleUserOrGroup = true;
1453
-        this.model.handlerUser = sj.handleUser.id;
1454
-      } else if (sj.userOrGroupType === 2) {
1455
-        //派组
1456
-        this.order = 2;
1457
-        this.model.handleUserOrGroup = false;
1458
-        this.model.candidateGroups = sj.group.id;
1459
-      } else {
1460
-        this.order = 1;
1461
-        this.model.handleUserOrGroup = false;
1462
-        this.model.handlerUser = "";
1463
-        this.model.candidateGroups = "";
1450
+      this.model.priority = sj.priority ? sj.priority.id : null;
1451
+      if (sj.branchType == 0) {
1452
+        if (sj.userOrGroupType === 1) {
1453
+          //派人
1454
+          this.order = 2;
1455
+          this.model.handleUserOrGroup = true;
1456
+          this.model.handlerUser = sj.handleUser ? sj.handleUser.id : "";
1457
+        } else if (sj.userOrGroupType === 2) {
1458
+          //派组
1459
+          this.order = 2;
1460
+          this.model.handleUserOrGroup = false;
1461
+          this.model.candidateGroups = sj.group ? sj.group.id : "";
1462
+        } else {
1463
+          this.order = 1;
1464
+          this.model.handleUserOrGroup = false;
1465
+          this.model.handlerUser = "";
1466
+          this.model.candidateGroups = "";
1467
+        }
1468
+      } else if (sj.branchType == 1) {
1469
+        // 分院区
1470
+        // liaomingming
1471
+        let areaId = this.model.placeValue[0]; //区域id
1472
+        console.log(this.initAreaList);
1473
+        if (areaId) {
1474
+          // 选择了区域
1475
+          let areaObj = this.initAreaList.find(v => v.id == areaId);
1476
+          if (areaObj) {
1477
+            let branchId = areaObj.branch;
1478
+            let branchUserGroup =
1479
+              sj.branchUserGroups.find(v => v.branchId == branchId) || {};
1480
+            if (branchUserGroup.branchUserOrGroupType == 1) {
1481
+              //派人
1482
+              this.order = 2;
1483
+              this.model.handleUserOrGroup = true;
1484
+              this.model.handlerUser = branchUserGroup.userId
1485
+                ? branchUserGroup.userId
1486
+                : undefined;
1487
+            } else if (branchUserGroup.branchUserOrGroupType === 2) {
1488
+              //派组
1489
+              this.order = 2;
1490
+              this.model.handleUserOrGroup = false;
1491
+              this.model.candidateGroups = branchUserGroup.groupId
1492
+                ? branchUserGroup.groupId
1493
+                : undefined;
1494
+            } else {
1495
+              this.order = 1;
1496
+              this.model.handleUserOrGroup = false;
1497
+              this.model.handlerUser = "";
1498
+              this.model.candidateGroups = "";
1499
+            }
1500
+          } else {
1501
+            this.order = 1;
1502
+            this.model.handleUserOrGroup = false;
1503
+            this.model.handlerUser = "";
1504
+            this.model.candidateGroups = "";
1505
+          }
1506
+        } else {
1507
+          this.order = 1;
1508
+          this.model.handleUserOrGroup = false;
1509
+          this.model.handlerUser = "";
1510
+          this.model.candidateGroups = "";
1511
+        }
1464
       }
1512
       }
1465
       console.log(this.order, sj.hasSimple);
1513
       console.log(this.order, sj.hasSimple);
1466
       if (this.order == 1 && sj.hasSimple == 1) {
1514
       if (this.order == 1 && sj.hasSimple == 1) {
1467
         // 直接处理 && 简单处理
1515
         // 直接处理 && 简单处理
1468
-        // liaomingming
1469
         this.isShowDes = false;
1516
         this.isShowDes = false;
1470
       } else {
1517
       } else {
1471
         this.isShowDes = true;
1518
         this.isShowDes = true;
@@ -1480,7 +1527,7 @@ export default {
1480
           idx: 0,
1527
           idx: 0,
1481
           sum: 1000
1528
           sum: 1000
1482
         })
1529
         })
1483
-        .then(function(res) {
1530
+        .then(res => {
1484
           that.initSjList = JSON.parse(JSON.stringify(res.data.list));
1531
           that.initSjList = JSON.parse(JSON.stringify(res.data.list));
1485
           var list = res.data.list;
1532
           var list = res.data.list;
1486
           var tree = [];
1533
           var tree = [];
@@ -1517,7 +1564,7 @@ export default {
1517
             }
1564
             }
1518
           });
1565
           });
1519
           var idCate = [0, 0, 0];
1566
           var idCate = [0, 0, 0];
1520
-          that.selectData = tree; //dada
1567
+          that.selectData = tree;
1521
           //报修转事件,回显一级分类
1568
           //报修转事件,回显一级分类
1522
           var inspecInfo1 = that.$route.params.data;
1569
           var inspecInfo1 = that.$route.params.data;
1523
           if (inspecInfo1 && inspecInfo1.category) {
1570
           if (inspecInfo1 && inspecInfo1.category) {
@@ -1556,6 +1603,77 @@ export default {
1556
             selectedIndex: that.selectedIndexCate,
1603
             selectedIndex: that.selectedIndexCate,
1557
             onSelect: that.selectCategoryHandler
1604
             onSelect: that.selectCategoryHandler
1558
           });
1605
           });
1606
+          // ----------------------start--------------------
1607
+          if (
1608
+            this.$route.params.data.category &&
1609
+            this.$route.params.data.place
1610
+          ) {
1611
+            // 有区域和事件分类
1612
+            let sj = this.$route.params.data.category;
1613
+            if (sj.branchType == 0) {
1614
+              if (sj.userOrGroupType === 1) {
1615
+                //派人
1616
+                this.order = 2;
1617
+                this.model.handleUserOrGroup = true;
1618
+                this.model.handlerUser = sj.handleUser ? sj.handleUser.id : "";
1619
+              } else if (sj.userOrGroupType === 2) {
1620
+                //派组
1621
+                this.order = 2;
1622
+                this.model.handleUserOrGroup = false;
1623
+                this.model.candidateGroups = sj.group ? sj.group.id : "";
1624
+              } else {
1625
+                this.order = 1;
1626
+                this.model.handleUserOrGroup = false;
1627
+                this.model.handlerUser = "";
1628
+                this.model.candidateGroups = "";
1629
+              }
1630
+            } else if (sj.branchType == 1) {
1631
+              // 分院区
1632
+              // liaomingming
1633
+              let areaId = this.$route.params.data.place.area.id; //区域id
1634
+              console.log(this.initAreaList);
1635
+              if (areaId) {
1636
+                // 选择了区域
1637
+                let areaObj = this.initAreaList.find(v => v.id == areaId);
1638
+                if (areaObj) {
1639
+                  let branchId = areaObj.branch;
1640
+                  let branchUserGroup =
1641
+                    sj.branchUserGroups.find(v => v.branchId == branchId) || {};
1642
+                  if (branchUserGroup.branchUserOrGroupType == 1) {
1643
+                    //派人
1644
+                    this.order = 2;
1645
+                    this.model.handleUserOrGroup = true;
1646
+                    this.model.handlerUser = branchUserGroup.userId
1647
+                      ? branchUserGroup.userId
1648
+                      : undefined;
1649
+                  } else if (branchUserGroup.branchUserOrGroupType === 2) {
1650
+                    //派组
1651
+                    this.order = 2;
1652
+                    this.model.handleUserOrGroup = false;
1653
+                    this.model.candidateGroups = branchUserGroup.groupId
1654
+                      ? branchUserGroup.groupId
1655
+                      : undefined;
1656
+                  } else {
1657
+                    this.order = 1;
1658
+                    this.model.handleUserOrGroup = false;
1659
+                    this.model.handlerUser = "";
1660
+                    this.model.candidateGroups = "";
1661
+                  }
1662
+                } else {
1663
+                  this.order = 1;
1664
+                  this.model.handleUserOrGroup = false;
1665
+                  this.model.handlerUser = "";
1666
+                  this.model.candidateGroups = "";
1667
+                }
1668
+              } else {
1669
+                this.order = 1;
1670
+                this.model.handleUserOrGroup = false;
1671
+                this.model.handlerUser = "";
1672
+                this.model.candidateGroups = "";
1673
+              }
1674
+            }
1675
+          }
1676
+          // ----------------------end--------------------
1559
           that.loadShow = false;
1677
           that.loadShow = false;
1560
         });
1678
         });
1561
     },
1679
     },
@@ -1581,6 +1699,60 @@ export default {
1581
       this.model.placeValue = selectedVal;
1699
       this.model.placeValue = selectedVal;
1582
       this.selectedPlaceTxt = selectedTxt.join(" ");
1700
       this.selectedPlaceTxt = selectedTxt.join(" ");
1583
       this.selectedIndex = selectedIndex;
1701
       this.selectedIndex = selectedIndex;
1702
+      // 分院区
1703
+      // --------------------start---------------------
1704
+      let categoryId = this.model.category.slice(-1)[0];
1705
+      if (categoryId) {
1706
+        // 选择了事件分类 liaomingming
1707
+        let categoryObj = this.initSjList.find(v => v.id == categoryId);
1708
+        if (categoryObj) {
1709
+          if (categoryObj.branchType == 1) {
1710
+            // 分院区开关打开的情况下
1711
+            let areaId = this.model.placeValue[0]; //区域id
1712
+            let areaObj = this.initAreaList.find(v => v.id == areaId);
1713
+            let branchId = areaObj.branch;
1714
+            let branchUserGroup =
1715
+              categoryObj.branchUserGroups.find(v => v.branchId == branchId) ||
1716
+              {};
1717
+            if (branchUserGroup.branchUserOrGroupType == 1) {
1718
+              //派人
1719
+              this.order = 2;
1720
+              this.model.handleUserOrGroup = true;
1721
+              this.model.handlerUser = branchUserGroup.userId
1722
+                ? branchUserGroup.userId
1723
+                : undefined;
1724
+            } else if (branchUserGroup.branchUserOrGroupType === 2) {
1725
+              //派组
1726
+              this.order = 2;
1727
+              this.model.handleUserOrGroup = false;
1728
+              this.model.candidateGroups = branchUserGroup.groupId
1729
+                ? branchUserGroup.groupId
1730
+                : undefined;
1731
+            } else {
1732
+              this.order = 1;
1733
+              this.model.handleUserOrGroup = false;
1734
+              this.model.handlerUser = "";
1735
+              this.model.candidateGroups = "";
1736
+            }
1737
+          } else {
1738
+            this.order = 1;
1739
+            this.model.handleUserOrGroup = false;
1740
+            this.model.handlerUser = "";
1741
+            this.model.candidateGroups = "";
1742
+          }
1743
+        } else {
1744
+          this.order = 1;
1745
+          this.model.handleUserOrGroup = false;
1746
+          this.model.handlerUser = "";
1747
+          this.model.candidateGroups = "";
1748
+        }
1749
+      } else {
1750
+        this.order = 1;
1751
+        this.model.handleUserOrGroup = false;
1752
+        this.model.handlerUser = "";
1753
+        this.model.candidateGroups = "";
1754
+      }
1755
+      // --------------------end---------------------
1584
     },
1756
     },
1585
     // 报修科室
1757
     // 报修科室
1586
     showDeptPicker() {
1758
     showDeptPicker() {
@@ -1615,7 +1787,6 @@ export default {
1615
       }
1787
       }
1616
     },
1788
     },
1617
     getAreaData() {
1789
     getAreaData() {
1618
-      var that = this;
1619
       this.$http
1790
       this.$http
1620
         .post("/service/user/data/fetchDataList/area", {
1791
         .post("/service/user/data/fetchDataList/area", {
1621
           idx: 0,
1792
           idx: 0,
@@ -1624,10 +1795,11 @@ export default {
1624
             wechatArea: true
1795
             wechatArea: true
1625
           }
1796
           }
1626
         })
1797
         })
1627
-        .then(function(res) {
1798
+        .then(res => {
1799
+          this.initAreaList = JSON.parse(JSON.stringify(res.data.list));
1628
           var data = res.data.list;
1800
           var data = res.data.list;
1629
           for (var i = 0; i < data.length; i++) {
1801
           for (var i = 0; i < data.length; i++) {
1630
-            that.placeSelectData.push({
1802
+            this.placeSelectData.push({
1631
               text: data[i].area,
1803
               text: data[i].area,
1632
               value: data[i].id,
1804
               value: data[i].id,
1633
               children: []
1805
               children: []

+ 35 - 34
src/views/processing.vue

@@ -849,12 +849,12 @@ export default {
849
           ? selected[selected.length - 1]
849
           ? selected[selected.length - 1]
850
           : "";
850
           : "";
851
         this.model.category = selectedVal;
851
         this.model.category = selectedVal;
852
-        localStorage.setItem("category", JSON.stringify(selectedIndex));
853
-        localStorage.setItem("categoryVal", JSON.stringify(selectedVal));
854
-        localStorage.setItem(
855
-          "selectedCategoryTxt",
856
-          JSON.stringify(this.selectedCategoryTxt)
857
-        );
852
+        // localStorage.setItem("category", JSON.stringify(selectedIndex));
853
+        // localStorage.setItem("categoryVal", JSON.stringify(selectedVal));
854
+        // localStorage.setItem(
855
+        //   "selectedCategoryTxt",
856
+        //   JSON.stringify(this.selectedCategoryTxt)
857
+        // );
858
       }
858
       }
859
     },
859
     },
860
     // 获取处理进度
860
     // 获取处理进度
@@ -1084,11 +1084,11 @@ export default {
1084
       if (localStorage.getItem("order")) {
1084
       if (localStorage.getItem("order")) {
1085
         that.order = localStorage.getItem("order") - 0;
1085
         that.order = localStorage.getItem("order") - 0;
1086
       }
1086
       }
1087
-      if (localStorage.getItem("selectedCategoryTxt")) {
1088
-        that.selectedCategoryTxt = JSON.parse(
1089
-          localStorage.getItem("selectedCategoryTxt")
1090
-        );
1091
-      }
1087
+      // if (localStorage.getItem("selectedCategoryTxt")) {
1088
+      //   that.selectedCategoryTxt = JSON.parse(
1089
+      //     localStorage.getItem("selectedCategoryTxt")
1090
+      //   );
1091
+      // }
1092
       that.getProgressInfo();
1092
       that.getProgressInfo();
1093
     },
1093
     },
1094
     // 事件分类
1094
     // 事件分类
@@ -1108,12 +1108,12 @@ export default {
1108
         ? selected[selected.length - 1]
1108
         ? selected[selected.length - 1]
1109
         : "";
1109
         : "";
1110
       this.model.category = selectedVal;
1110
       this.model.category = selectedVal;
1111
-      localStorage.setItem("category", JSON.stringify(selectedIndex));
1112
-      localStorage.setItem("categoryVal", JSON.stringify(selectedVal));
1113
-      localStorage.setItem(
1114
-        "selectedCategoryTxt",
1115
-        JSON.stringify(this.selectedCategoryTxt)
1116
-      );
1111
+      // localStorage.setItem("category", JSON.stringify(selectedIndex));
1112
+      // localStorage.setItem("categoryVal", JSON.stringify(selectedVal));
1113
+      // localStorage.setItem(
1114
+      //   "selectedCategoryTxt",
1115
+      //   JSON.stringify(this.selectedCategoryTxt)
1116
+      // );
1117
     },
1117
     },
1118
     getIncidentcategory() {
1118
     getIncidentcategory() {
1119
       var that = this;
1119
       var that = this;
@@ -1158,7 +1158,8 @@ export default {
1158
             }
1158
             }
1159
           });
1159
           });
1160
 
1160
 
1161
-          if (!localStorage.getItem("category")) {
1161
+          // if (!localStorage.getItem("category")) {
1162
+          if (true) {
1162
             let cate = that.modelData.incident.category;
1163
             let cate = that.modelData.incident.category;
1163
             let cateGrand =
1164
             let cateGrand =
1164
               cate.parentCategory &&
1165
               cate.parentCategory &&
@@ -1217,20 +1218,20 @@ export default {
1217
               );
1218
               );
1218
             }, 500);
1219
             }, 500);
1219
           } else {
1220
           } else {
1220
-            that.selectData = tree;
1221
-            // 获取事件分类并设置
1222
-            that.setCategory();
1223
-            that.categoryPicker = that.$createCascadePicker({
1224
-              title: "事件分类选择",
1225
-              data: that.selectData,
1226
-              selectedIndex: JSON.parse(localStorage.getItem("category")) || [
1227
-                0, 0, 0,
1228
-              ],
1229
-              onSelect: that.selectCategoryHandler,
1230
-            });
1231
-            that.model.category = JSON.parse(
1232
-              localStorage.getItem("categoryVal")
1233
-            );
1221
+            // that.selectData = tree;
1222
+            // // 获取事件分类并设置
1223
+            // that.setCategory();
1224
+            // that.categoryPicker = that.$createCascadePicker({
1225
+            //   title: "事件分类选择",
1226
+            //   data: that.selectData,
1227
+            //   selectedIndex: JSON.parse(localStorage.getItem("category")) || [
1228
+            //     0, 0, 0,
1229
+            //   ],
1230
+            //   onSelect: that.selectCategoryHandler,
1231
+            // });
1232
+            // that.model.category = JSON.parse(
1233
+            //   localStorage.getItem("categoryVal")
1234
+            // );
1234
           }
1235
           }
1235
         });
1236
         });
1236
     },
1237
     },
@@ -1379,7 +1380,7 @@ export default {
1379
                   },
1380
                   },
1380
                 })
1381
                 })
1381
                 .show();
1382
                 .show();
1382
-              localStorage.removeItem("category");
1383
+              // localStorage.removeItem("category");
1383
               localStorage.removeItem("model");
1384
               localStorage.removeItem("model");
1384
               localStorage.removeItem("modelData");
1385
               localStorage.removeItem("modelData");
1385
               localStorage.removeItem("referenceInfo");
1386
               localStorage.removeItem("referenceInfo");
@@ -1437,7 +1438,7 @@ export default {
1437
                   },
1438
                   },
1438
                 })
1439
                 })
1439
                 .show();
1440
                 .show();
1440
-              localStorage.removeItem("category");
1441
+              // localStorage.removeItem("category");
1441
               localStorage.removeItem("model");
1442
               localStorage.removeItem("model");
1442
               localStorage.removeItem("modelData");
1443
               localStorage.removeItem("modelData");
1443
               localStorage.removeItem("referenceInfo");
1444
               localStorage.removeItem("referenceInfo");

+ 0 - 1
src/views/wxChartDetail.vue

@@ -179,7 +179,6 @@ export default {
179
           name: "NewIncident",
179
           name: "NewIncident",
180
           params: {
180
           params: {
181
             data: this.model,
181
             data: this.model,
182
-            id: this.model.id
183
           }
182
           }
184
         });
183
         });
185
       } else if (selectedVal == 1) {
184
       } else if (selectedVal == 1) {