seimin 1 年之前
父节点
当前提交
093a9f726e
共有 2 个文件被更改,包括 27 次插入8 次删除
  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
               console.log(this.model);
723
               console.log(this.model);
724
               this.model.placeValue = [];
724
               this.model.placeValue = [];
725
               this.selectedPlaceTxt = '';
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
         // that.modelData.requestershow = that.loginUser;
971
         // that.modelData.requestershow = that.loginUser;
968
       } else if (that.valConfig == 2) {
972
       } else if (that.valConfig == 2) {
969
         that.modelData.incident.branch = that.model.branch;
973
         that.modelData.incident.branch = that.model.branch;
970
-        if(that.$route.query.id){
974
+        if(that.$route.query.id && that.model.requester){
971
           that.modelData.incident.department = {id: +that.$route.query.id};
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
     toSearchDept() {
1624
     toSearchDept() {
1621
-      this.$router.push(`/searchDept?type=searchDept`);
1625
+      this.$router.push(`/searchDept?type=searchDept&branch=${this.model.branch}`);
1622
     },
1626
     },
1623
     getAreaData(branchId) {
1627
     getAreaData(branchId) {
1624
       this.placeSelectData = [];
1628
       this.placeSelectData = [];
@@ -1669,12 +1673,26 @@ export default {
1669
           console.log(this.initAreaList, data);
1673
           console.log(this.initAreaList, data);
1670
           console.log(this.placeSelectData);
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
         department: {
115
         department: {
116
           dept: keyword,
116
           dept: keyword,
117
           selectType: "pinyin_qs",
117
           selectType: "pinyin_qs",
118
+          branch: this.$route.query.branch ? +this.$route.query.branch : undefined,
118
         }
119
         }
119
       };
120
       };
120
       this.toast = this.$createToast({
121
       this.toast = this.$createToast({