seimin 1 year ago
parent
commit
093a9f726e
2 changed files with 27 additions and 8 deletions
  1. 26 8
      src/views/newIncident.vue
  2. 1 0
      src/views/searchDept.vue

+ 26 - 8
src/views/newIncident.vue

@@ -723,6 +723,10 @@ export default {
723 723
               console.log(this.model);
724 724
               this.model.placeValue = [];
725 725
               this.selectedPlaceTxt = '';
726
+
727
+              this.model.contactsInformation = '';
728
+
729
+              this.model.requester = '';
726 730
             }
727 731
           }
728 732
         },
@@ -967,7 +971,7 @@ export default {
967 971
         // that.modelData.requestershow = that.loginUser;
968 972
       } else if (that.valConfig == 2) {
969 973
         that.modelData.incident.branch = that.model.branch;
970
-        if(that.$route.query.id){
974
+        if(that.$route.query.id && that.model.requester){
971 975
           that.modelData.incident.department = {id: +that.$route.query.id};
972 976
         }
973 977
       }
@@ -1618,7 +1622,7 @@ export default {
1618 1622
     },
1619 1623
     // 跳转到报修科室搜索页面
1620 1624
     toSearchDept() {
1621
-      this.$router.push(`/searchDept?type=searchDept`);
1625
+      this.$router.push(`/searchDept?type=searchDept&branch=${this.model.branch}`);
1622 1626
     },
1623 1627
     getAreaData(branchId) {
1624 1628
       this.placeSelectData = [];
@@ -1669,12 +1673,26 @@ export default {
1669 1673
           console.log(this.initAreaList, data);
1670 1674
           console.log(this.placeSelectData);
1671 1675
 
1672
-          this.placePicker = this.$createCascadePicker({
1673
-            title: "区域地点选择",
1674
-            data: this.placeSelectData,
1675
-            selectedIndex: [0, 0],
1676
-            onSelect: this.selectPlaceHandler
1677
-          });
1676
+          if(this.model.placeValue.length){
1677
+            let [areaId, placeId] = this.model.placeValue;
1678
+            let areaIndex = this.placeSelectData.findIndex(v => v.value == areaId);
1679
+            let placeIndex = this.placeSelectData[areaIndex].children.findIndex(v => v.value == placeId);
1680
+            areaIndex = areaIndex < 0 ? 0 : areaIndex;
1681
+            placeIndex = placeIndex < 0 ? 0 : placeIndex;
1682
+            this.placePicker = this.$createCascadePicker({
1683
+              title: "区域地点选择",
1684
+              data: this.placeSelectData,
1685
+              selectedIndex: [areaIndex, placeIndex],
1686
+              onSelect: this.selectPlaceHandler
1687
+            });
1688
+          }else{
1689
+            this.placePicker = this.$createCascadePicker({
1690
+              title: "区域地点选择",
1691
+              data: this.placeSelectData,
1692
+              selectedIndex: [0, 0],
1693
+              onSelect: this.selectPlaceHandler
1694
+            });
1695
+          }
1678 1696
         });
1679 1697
     },
1680 1698
     // 获取院区列表

+ 1 - 0
src/views/searchDept.vue

@@ -115,6 +115,7 @@ export default {
115 115
         department: {
116 116
           dept: keyword,
117 117
           selectType: "pinyin_qs",
118
+          branch: this.$route.query.branch ? +this.$route.query.branch : undefined,
118 119
         }
119 120
       };
120 121
       this.toast = this.$createToast({