Ver código fonte

修改指派组失败

maotao 7 meses atrás
pai
commit
cbe3fd90ff

+ 9 - 7
pages/assign/assign.vue

@@ -915,13 +915,15 @@
915
     
915
     
916
 		postData.incident.place = {}
916
 		postData.incident.place = {}
917
 		postData.incident.place.id = floorId.value
917
 		postData.incident.place.id = floorId.value
918
-    if(dataInfo.userId){
919
-      // 派人
920
-      postData.incident.assignee = dataInfo.userId;
921
-    } else {
922
-      // 派组
923
-      postData.incident.candidateGroups = dataInfo.groupId;
924
-    }
918
+		if(dataInfo.userId){
919
+		  // 派人
920
+		  postData.incident.assignee = dataInfo.userId;
921
+			delete postData.incident.candidateGroups
922
+		} else {
923
+		  // 派组
924
+		  postData.incident.candidateGroups = dataInfo.groupId;
925
+			delete postData.incident.assignee
926
+		}
925
     
927
     
926
     return api_incidentTask('accept', postData);
928
     return api_incidentTask('accept', postData);
927
   }
929
   }

+ 12 - 8
pages/changeUser/changeUser.vue

@@ -474,14 +474,16 @@
474
       incident: dataInfo.incidentData,
474
       incident: dataInfo.incidentData,
475
     }
475
     }
476
     
476
     
477
-    if(dataInfo.userId){
478
-      // 派人
479
-      postData.incident.assignee = dataInfo.userId;
480
-    } else {
481
-      // 派组
482
-      postData.incident.candidateGroups = dataInfo.groupId;
483
-    }
484
-    
477
+		if(dataInfo.userId){
478
+		  // 派人
479
+		  postData.incident.assignee = dataInfo.userId;
480
+			delete postData.incident.candidateGroups
481
+		} else {
482
+		  // 派组
483
+		  postData.incident.candidateGroups = dataInfo.groupId;
484
+			delete postData.incident.assignee
485
+		}
486
+		
485
     api_incidentTask(dataInfo.tabActiveValue, postData).then(res => {
487
     api_incidentTask(dataInfo.tabActiveValue, postData).then(res => {
486
       uni.hideLoading();
488
       uni.hideLoading();
487
       if(res.state == 200){
489
       if(res.state == 200){
@@ -550,9 +552,11 @@
550
     if(dataInfo.userId){
552
     if(dataInfo.userId){
551
       // 派人
553
       // 派人
552
       postData.incident.assignee = dataInfo.userId;
554
       postData.incident.assignee = dataInfo.userId;
555
+			delete postData.incident.candidateGroups
553
     } else {
556
     } else {
554
       // 派组
557
       // 派组
555
       postData.incident.candidateGroups = dataInfo.groupId;
558
       postData.incident.candidateGroups = dataInfo.groupId;
559
+			delete postData.incident.assignee
556
     }
560
     }
557
     
561
     
558
     postData.incident.duty = { id: dataInfo.dutyId };
562
     postData.incident.duty = { id: dataInfo.dutyId };

+ 2 - 0
pages/repair/home.vue

@@ -192,6 +192,8 @@
192
 	})
192
 	})
193
 	
193
 	
194
 	onShow((option) => {
194
 	onShow((option) => {
195
+		uni.setStorageSync('repairData','')
196
+		uni.setStorageSync('rapidRepNext','')
195
 		getCount()
197
 		getCount()
196
 	})
198
 	})
197
 	
199
 	

+ 3 - 1
pages/repair/rapidRep.vue

@@ -157,7 +157,9 @@
157
   // 上一步或者返回列表
157
   // 上一步或者返回列表
158
   function goBackOrToList(){
158
   function goBackOrToList(){
159
 		uni.setStorageSync('repairData','')
159
 		uni.setStorageSync('repairData','')
160
-    goBack();
160
+		uni.switchTab({
161
+		  url: `/pages/repair/home`
162
+		})
161
   }
163
   }
162
 	
164
 	
163
 	function itemCandidate(item){
165
 	function itemCandidate(item){

+ 42 - 20
pages/repair/rapidRepNext.vue

@@ -15,13 +15,20 @@
15
 						:clear-icon="false" :class="{formRed: isSubmit && !dataInfo.branch}">
15
 						:clear-icon="false" :class="{formRed: isSubmit && !dataInfo.branch}">
16
 					</uni-data-picker>
16
 					</uni-data-picker>
17
 				</view>
17
 				</view>
18
-        <view class="form_item">
18
+<!--        <view class="form_item">
19
           <view class="title select"><text class="required newicon newicon-bitian"></text>报修科室:</view>
19
           <view class="title select"><text class="required newicon newicon-bitian"></text>报修科室:</view>
20
         	<uni-data-picker class="value" placeholder="请选择报修科室" 
20
         	<uni-data-picker class="value" placeholder="请选择报修科室" 
21
         		v-model="dataInfo.department" :localdata="dataInfo.repairTypeList"
21
         		v-model="dataInfo.department" :localdata="dataInfo.repairTypeList"
22
         		:clear-icon="false" :class="{formRed: isSubmit && !dataInfo.department}">
22
         		:clear-icon="false" :class="{formRed: isSubmit && !dataInfo.department}">
23
         	</uni-data-picker>
23
         	</uni-data-picker>
24
-        </view>
24
+        </view> -->
25
+				<view class="form_item">
26
+				  <view class="title select"><text class="required newicon newicon-bitian"></text>报修科室:</view>
27
+				  <view class="value category" @click="selectDepartment">
28
+				    <text class="categoryName ellipsis-multiline">{{dataInfo.departmentName}}</text>
29
+				    <text class="newicon newicon-weibiaoti2010104"></text>
30
+				  </view>
31
+				</view>
25
 				<view class="candidate" v-if="itemUser">
32
 				<view class="candidate" v-if="itemUser">
26
 					<view class="candidate-item" v-for="(item, index) in itemUser.commonDeptDTO" :key="item" @click="itemCandidate(item)">{{item.dept}}</view>
33
 					<view class="candidate-item" v-for="(item, index) in itemUser.commonDeptDTO" :key="item" @click="itemCandidate(item)">{{item.dept}}</view>
27
 				</view>
34
 				</view>
@@ -164,7 +171,8 @@
164
 		repairTypeList:[],//科室数据
171
 		repairTypeList:[],//科室数据
165
 		buildingTypeList:[],//楼栋数据
172
 		buildingTypeList:[],//楼栋数据
166
 		placeTypeList:[],//楼层数据
173
 		placeTypeList:[],//楼层数据
167
-    department:'',//报修科室
174
+    department:'',//报修科室id
175
+		departmentName:'',//报修科室
168
 		address:'',//详细地址
176
 		address:'',//详细地址
169
 		contacts:'',//联系人
177
 		contacts:'',//联系人
170
 		contactsInformation:'',//手机
178
 		contactsInformation:'',//手机
@@ -197,7 +205,9 @@
197
   // 上一步或者返回列表
205
   // 上一步或者返回列表
198
   function goBackOrToList(){
206
   function goBackOrToList(){
199
 		uni.setStorageSync('rapidRepNext',JSON.stringify(dataInfo))
207
 		uni.setStorageSync('rapidRepNext',JSON.stringify(dataInfo))
200
-    goBack();
208
+		uni.navigateTo({
209
+		  url: `/pages/repair/rapidRep`
210
+		})
201
   }
211
   }
202
   
212
   
203
   // 重置
213
   // 重置
@@ -280,18 +290,31 @@
280
   
290
   
281
   // 获取事件详情
291
   // 获取事件详情
282
   function getIncidentDetail(){
292
   function getIncidentDetail(){
293
+		let user = loginUserStore.loginUser.user
283
     if(uni.getStorageSync('rapidRepNext')){
294
     if(uni.getStorageSync('rapidRepNext')){
284
     	let data = JSON.parse(uni.getStorageSync('rapidRepNext'))
295
     	let data = JSON.parse(uni.getStorageSync('rapidRepNext'))
285
     	if(data){
296
     	if(data){
286
     		dataInfo.department = data.department//报修科室
297
     		dataInfo.department = data.department//报修科室
298
+				dataInfo.departmentName = data.departmentName//报修科室
287
     		dataInfo.address = data.address//详细地址
299
     		dataInfo.address = data.address//详细地址
288
     		dataInfo.contacts = data.contacts//联系人
300
     		dataInfo.contacts = data.contacts//联系人
289
     		dataInfo.contactsInformation = data.contactsInformation//手机
301
     		dataInfo.contactsInformation = data.contactsInformation//手机
290
-				dataInfo.branch = data.branch//院区
302
+				dataInfo.branch = Number(data.branch)//院区
291
     		dataInfo.areaId = data.areaId//楼栋
303
     		dataInfo.areaId = data.areaId//楼栋
292
-				getRepairTypes()
304
+				// getRepairTypes()
293
     	}
305
     	}
294
-    }
306
+    }else if(user){
307
+			if(user.currentHospital.parent){
308
+				dataInfo.branch = user.currentHospital.parent.id
309
+			}else{
310
+				dataInfo.branch = user.currentHospital.id
311
+			}
312
+			dataInfo.contacts = user.name
313
+			dataInfo.contactsInformation = user.phone
314
+			dataInfo.department = user.dept.id
315
+			dataInfo.departmentName = user.dept.dept
316
+			// getRepairTypes()
317
+		}
295
 		if(uni.getStorageSync('repairData')){
318
 		if(uni.getStorageSync('repairData')){
296
 			let data = JSON.parse(uni.getStorageSync('repairData'))
319
 			let data = JSON.parse(uni.getStorageSync('repairData'))
297
 			if(data){
320
 			if(data){
@@ -323,18 +346,7 @@
323
 			dataInfo.tabActiveValue = 'overtime'
346
 			dataInfo.tabActiveValue = 'overtime'
324
 			getbuildingList()
347
 			getbuildingList()
325
 		}
348
 		}
326
-		let user = loginUserStore.loginUser.user
327
-		if(user){
328
-			if(user.currentHospital.parent){
329
-				dataInfo.branch = user.currentHospital.parent.id
330
-			}else{
331
-				dataInfo.branch = user.currentHospital.id
332
-			}
333
-			dataInfo.contacts = user.name
334
-			dataInfo.contactsInformation = user.phone
335
-			dataInfo.department = user.dept.id
336
-			getRepairTypes()
337
-		}
349
+
338
 		
350
 		
339
 		let postData = {
351
 		let postData = {
340
 		  "key": 'repair_incident_type',
352
 		  "key": 'repair_incident_type',
@@ -358,7 +370,9 @@
358
 	
370
 	
359
 	// 科内报修选择院区
371
 	// 科内报修选择院区
360
 	function doingDeptChange(){
372
 	function doingDeptChange(){
361
-		getRepairTypes()
373
+		dataInfo.department = ''
374
+		dataInfo.departmentName = ''
375
+		// getRepairTypes()
362
 	}
376
 	}
363
 	
377
 	
364
 	// 公区报修选择院区
378
 	// 公区报修选择院区
@@ -366,6 +380,14 @@
366
 		getbuildingList()
380
 		getbuildingList()
367
 	}
381
 	}
368
 	
382
 	
383
+	// 跳转到搜索报修科室
384
+	function selectDepartment(){
385
+		uni.setStorageSync('rapidRepNext',JSON.stringify(dataInfo))
386
+	  uni.navigateTo({
387
+	    url: `/pages/searchDept/searchDept?type=repair&branchId=${dataInfo.branch}`
388
+	  })
389
+	}
390
+	
369
   // 获取报修科室列表
391
   // 获取报修科室列表
370
   function getRepairTypes(){
392
   function getRepairTypes(){
371
     uni.showLoading({
393
     uni.showLoading({

+ 54 - 11
pages/searchDept/searchDept.vue

@@ -39,6 +39,11 @@
39
   // placeHolder
39
   // placeHolder
40
   const placeHolder = ref('');
40
   const placeHolder = ref('');
41
   
41
   
42
+	const entranceType = ref(null);
43
+	
44
+	// 院区id
45
+	const branchId = ref(null);
46
+	
42
   // 数据
47
   // 数据
43
   const dataInfo = reactive({
48
   const dataInfo = reactive({
44
     list: [],//工单列表
49
     list: [],//工单列表
@@ -73,18 +78,26 @@
73
       idx: dataInfo.idx,
78
       idx: dataInfo.idx,
74
       sum: 20,
79
       sum: 20,
75
       department: {
80
       department: {
76
-				hospital:'',
81
+				hospital:{
82
+					id:''
83
+				},
77
         // branch: dataInfo.incidentData.branch,
84
         // branch: dataInfo.incidentData.branch,
78
         // searchType: 'quickStart',
85
         // searchType: 'quickStart',
79
         // selectType: 'pinyin_qs',
86
         // selectType: 'pinyin_qs',
80
         dept: dataInfo.keyWord,
87
         dept: dataInfo.keyWord,
81
       }
88
       }
82
     }
89
     }
83
-    if(loginUserStore.loginUser.user.currentHospital.parent){
84
-    	postData.department.hospital = loginUserStore.loginUser.user.currentHospital.parent.id
85
-    }else{
86
-    	postData.department.hospital = loginUserStore.loginUser.user.currentHospital.id
87
-    }
90
+		if(entranceType.value=='repair'){
91
+			if(branchId.value){
92
+				postData.department.hospital.id = branchId.value
93
+			}
94
+		}else{
95
+			if(loginUserStore.loginUser.user.currentHospital.parent){
96
+				postData.department.hospital.id = loginUserStore.loginUser.user.currentHospital.parent.id
97
+			}else{
98
+				postData.department.hospital.id = loginUserStore.loginUser.user.currentHospital.id
99
+			}
100
+		}
88
     api_department(postData).then(res => {
101
     api_department(postData).then(res => {
89
       uni.hideLoading();
102
       uni.hideLoading();
90
       uni.stopPullDownRefresh();
103
       uni.stopPullDownRefresh();
@@ -107,14 +120,44 @@
107
   
120
   
108
   // 点击
121
   // 点击
109
   function clickItem(data){
122
   function clickItem(data){
110
-    dataInfo.incidentData.department = data;
111
-    incidentBuildStore.setIncidentBuildData(dataInfo.incidentData, incidentBuildStore.incidentBuild.type, incidentBuildStore.incidentBuild.sign);
112
-    uni.navigateTo({
113
-      url: '/pages/buildIncident/buildIncident'
114
-    })
123
+		if(entranceType.value=='repair'){
124
+			let query = {
125
+				department:null,
126
+				departmentName:null,
127
+				branch:branchId.value
128
+			}
129
+			let rapidRepNextData = uni.getStorageSync('rapidRepNext')
130
+			if(rapidRepNextData){
131
+				let parseData = JSON.parse(rapidRepNextData)
132
+				query.department = data.id//报修科室
133
+				query.departmentName = data.dept//报修科室
134
+				let repairData = {
135
+					...parseData,
136
+					...query
137
+				}
138
+				uni.setStorageSync('rapidRepNext',JSON.stringify(repairData))
139
+			}else{
140
+				query.department = data.id//报修科室
141
+				query.departmentName = data.dept//报修科室
142
+				uni.setStorageSync('rapidRepNext',JSON.stringify(query))
143
+			}
144
+			uni.navigateTo({
145
+			  url: '/pages/repair/rapidRepNext'
146
+			})
147
+		}else{
148
+			dataInfo.incidentData.department = data;
149
+			incidentBuildStore.setIncidentBuildData(dataInfo.incidentData, incidentBuildStore.incidentBuild.type, incidentBuildStore.incidentBuild.sign);
150
+			uni.navigateTo({
151
+			  url: '/pages/buildIncident/buildIncident'
152
+			})
153
+		}
115
   }
154
   }
116
   
155
   
117
   onLoad((option) => {
156
   onLoad((option) => {
157
+		if(option.type){
158
+			entranceType.value = option.type
159
+			branchId.value = option.branchId
160
+		}
118
     if(incidentBuildStore.incidentBuild.data){
161
     if(incidentBuildStore.incidentBuild.data){
119
       dataInfo.incidentData = incidentBuildStore.incidentBuild.data;
162
       dataInfo.incidentData = incidentBuildStore.incidentBuild.data;
120
     }
163
     }