Kaynağa Gözat

新建事件BUG

seimin 1 yıl önce
ebeveyn
işleme
d97924aedb

+ 9 - 13
pages/buildIncident/buildIncident.vue

@@ -86,11 +86,13 @@
86
   import { useGoBack } from '@/share/useGoBack.js'
86
   import { useGoBack } from '@/share/useGoBack.js'
87
   import { useLoginUserStore } from '@/stores/loginUser'
87
   import { useLoginUserStore } from '@/stores/loginUser'
88
   import { useIncidentBuildStore } from '@/stores/incidentBuild'
88
   import { useIncidentBuildStore } from '@/stores/incidentBuild'
89
+  import { useHandlerStore } from '@/stores/handler'
89
   import { useUploadFile } from '@/share/useUploadFile.js'
90
   import { useUploadFile } from '@/share/useUploadFile.js'
90
 
91
 
91
   useSetTitle();
92
   useSetTitle();
92
   const loginUserStore = useLoginUserStore();
93
   const loginUserStore = useLoginUserStore();
93
   const incidentBuildStore = useIncidentBuildStore();
94
   const incidentBuildStore = useIncidentBuildStore();
95
+  const handlerStore = useHandlerStore();
94
   const { uploadFile }  = useUploadFile();
96
   const { uploadFile }  = useUploadFile();
95
   const { goBack }  = useGoBack();
97
   const { goBack }  = useGoBack();
96
 
98
 
@@ -171,7 +173,7 @@
171
 
173
 
172
   // 选择楼栋楼层
174
   // 选择楼栋楼层
173
   function selectAreaPlace(){
175
   function selectAreaPlace(){
174
-    incidentBuildStore.setIncidentBuildData(incidentData, 'buildIncident');
176
+    incidentBuildStore.setIncidentBuildData(incidentData, 'buildIncident', 'area');
175
     uni.navigateTo({
177
     uni.navigateTo({
176
       url: `/pages/searchArea/searchArea`
178
       url: `/pages/searchArea/searchArea`
177
     })
179
     })
@@ -179,7 +181,7 @@
179
 
181
 
180
   // 跳转到搜索报修科室
182
   // 跳转到搜索报修科室
181
   function selectDepartment(){
183
   function selectDepartment(){
182
-    incidentBuildStore.setIncidentBuildData(incidentData, 'buildIncident');
184
+    incidentBuildStore.setIncidentBuildData(incidentData, 'buildIncident', 'department');
183
     uni.navigateTo({
185
     uni.navigateTo({
184
       url: `/pages/searchDept/searchDept`
186
       url: `/pages/searchDept/searchDept`
185
     })
187
     })
@@ -414,20 +416,14 @@
414
   }
416
   }
415
 
417
 
416
   onLoad((option) => {
418
   onLoad((option) => {
419
+    handlerStore.clearHandlerData();
417
     if(incidentBuildStore.incidentBuild.data){
420
     if(incidentBuildStore.incidentBuild.data){
418
       Object.assign(incidentData, incidentBuildStore.incidentBuild.data);
421
       Object.assign(incidentData, incidentBuildStore.incidentBuild.data);
419
-
420
       // 修改报修科室,则回显楼栋,楼层,详细地址,联系电话
422
       // 修改报修科室,则回显楼栋,楼层,详细地址,联系电话
421
-      if(!incidentData.place){
422
-        incidentData.place = incidentData.department ? incidentData.department.place : undefined;
423
-      }
424
-
425
-      if(!incidentData.houseNumber){
426
-        incidentData.houseNumber = incidentData.department ? incidentData.department.address : '';
427
-      }
428
-
429
-      if(!incidentData.contactsInformation){
430
-        incidentData.contactsInformation = incidentData.department ? incidentData.department.phone : '';
423
+      if(incidentBuildStore.incidentBuild.sign === 'department'){
424
+        incidentData.place = incidentData.department.place || undefined;
425
+        incidentData.houseNumber = incidentData.department.address || '';
426
+        incidentData.contactsInformation = incidentData.department.phone || '';
431
       }
427
       }
432
     }
428
     }
433
     getBranchs();
429
     getBranchs();

+ 1 - 0
pages/handler/handler.vue

@@ -472,6 +472,7 @@
472
           console.log(dataInfo)
472
           console.log(dataInfo)
473
           handlerStore.clearHandlerData();
473
           handlerStore.clearHandlerData();
474
         }else{
474
         }else{
475
+          handlerStore.clearHandlerData();
475
           // 初始化回显
476
           // 初始化回显
476
           dataInfo.category = dataInfo.incidentData.category || {};
477
           dataInfo.category = dataInfo.incidentData.category || {};
477
           dataInfo.synergetic = dataInfo.incidentData.synergetic || [];
478
           dataInfo.synergetic = dataInfo.incidentData.synergetic || [];

+ 1 - 1
pages/searchDept/searchDept.vue

@@ -100,7 +100,7 @@
100
   // 点击
100
   // 点击
101
   function clickItem(data){
101
   function clickItem(data){
102
     dataInfo.incidentData.department = data;
102
     dataInfo.incidentData.department = data;
103
-    incidentBuildStore.setIncidentBuildData(dataInfo.incidentData, incidentBuildStore.incidentBuild.type);
103
+    incidentBuildStore.setIncidentBuildData(dataInfo.incidentData, incidentBuildStore.incidentBuild.type, incidentBuildStore.incidentBuild.sign);
104
     uni.navigateTo({
104
     uni.navigateTo({
105
       url: '/pages/buildIncident/buildIncident'
105
       url: '/pages/buildIncident/buildIncident'
106
     })
106
     })

+ 1 - 1
pages/searchPlace/searchPlace.vue

@@ -65,7 +65,7 @@
65
       return;
65
       return;
66
     }
66
     }
67
     dataInfo.paramData.place = dataInfo.placeObj;
67
     dataInfo.paramData.place = dataInfo.placeObj;
68
-    incidentBuildStore.setIncidentBuildData(dataInfo.paramData, incidentBuildStore.incidentBuild.type);
68
+    incidentBuildStore.setIncidentBuildData(dataInfo.paramData, incidentBuildStore.incidentBuild.type, incidentBuildStore.incidentBuild.sign);
69
     uni.navigateTo({
69
     uni.navigateTo({
70
       url: `/pages/${incidentBuildStore.incidentBuild.type}/${incidentBuildStore.incidentBuild.type}?incidentId=${dataInfo.incidentId}`,
70
       url: `/pages/${incidentBuildStore.incidentBuild.type}/${incidentBuildStore.incidentBuild.type}?incidentId=${dataInfo.incidentId}`,
71
     })
71
     })

+ 1 - 1
pages/synergeticAdd/synergeticAdd.vue

@@ -120,7 +120,7 @@
120
     if(dataInfo.incidentId !== 'undefined'){
120
     if(dataInfo.incidentId !== 'undefined'){
121
       getIncidentDetail();
121
       getIncidentDetail();
122
     }else{
122
     }else{
123
-      dataInfo.incidentData = handlerStore.handler.data || {};
123
+      dataInfo.incidentData = handlerStore.handler.data.incidentData || {};
124
       getList(0);
124
       getList(0);
125
     }
125
     }
126
   }
126
   }

+ 9 - 1
stores/incidentBuild.js

@@ -7,12 +7,19 @@ export const useIncidentBuildStore = defineStore(
7
     const incidentBuild = reactive({
7
     const incidentBuild = reactive({
8
       data: null,
8
       data: null,
9
       type: '',
9
       type: '',
10
+      sign: '',
10
     });
11
     });
11
 
12
 
12
     // 保存
13
     // 保存
13
-    function setIncidentBuildData(data, type) {
14
+    /**
15
+     * @param {Object} data 数据
16
+     * @param {Object} type 路由
17
+     * @param {Object} sign 标识
18
+     */
19
+    function setIncidentBuildData(data, type, sign) {
14
       incidentBuild.data = data;
20
       incidentBuild.data = data;
15
       incidentBuild.type = type;
21
       incidentBuild.type = type;
22
+      incidentBuild.sign = sign;
16
     }
23
     }
17
     
24
     
18
     // 清空
25
     // 清空
@@ -20,6 +27,7 @@ export const useIncidentBuildStore = defineStore(
20
       console.log(incidentBuild.data)
27
       console.log(incidentBuild.data)
21
       incidentBuild.data = null;
28
       incidentBuild.data = null;
22
       incidentBuild.type = '';
29
       incidentBuild.type = '';
30
+      incidentBuild.sign = '';
23
     }
31
     }
24
 
32
 
25
     return {
33
     return {