瀏覽代碼

修改科室搜索

maotao 5 月之前
父節點
當前提交
a1c18d9973

+ 1 - 0
pages/assign/assign.vue

@@ -915,6 +915,7 @@
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
+		postData.incident.candidateGroupId = dataInfo.groupId;
918
 		if(dataInfo.userId){
919
 		if(dataInfo.userId){
919
 		  // 派人
920
 		  // 派人
920
 		  postData.incident.assignee = dataInfo.userId;
921
 		  postData.incident.assignee = dataInfo.userId;

+ 2 - 2
pages/changeUser/changeUser.vue

@@ -473,7 +473,7 @@
473
     let postData = {
473
     let postData = {
474
       incident: dataInfo.incidentData,
474
       incident: dataInfo.incidentData,
475
     }
475
     }
476
-    
476
+    postData.incident.candidateGroupId = dataInfo.groupId;
477
 		if(dataInfo.userId){
477
 		if(dataInfo.userId){
478
 		  // 派人
478
 		  // 派人
479
 		  postData.incident.assignee = dataInfo.userId;
479
 		  postData.incident.assignee = dataInfo.userId;
@@ -548,7 +548,7 @@
548
     let postData = {
548
     let postData = {
549
       incident: dataInfo.incidentData,
549
       incident: dataInfo.incidentData,
550
     }
550
     }
551
-    
551
+    postData.incident.candidateGroupId = dataInfo.groupId;
552
     if(dataInfo.userId){
552
     if(dataInfo.userId){
553
       // 派人
553
       // 派人
554
       postData.incident.assignee = dataInfo.userId;
554
       postData.incident.assignee = dataInfo.userId;

+ 78 - 14
pages/repair/config.vue

@@ -6,11 +6,11 @@
6
         <view class="bottom_list">
6
         <view class="bottom_list">
7
           <view class="bottom_list_item">
7
           <view class="bottom_list_item">
8
             <view class="name"><text class="required newicon newicon-bitian"></text>工号</view>
8
             <view class="name"><text class="required newicon newicon-bitian"></text>工号</view>
9
-            <view class="value no-mar">{{loginUserStore.loginUser.user.account}}</view>
9
+            <view class="value no-mar">{{dataForm.account}}</view>
10
           </view>
10
           </view>
11
 					<view class="bottom_list_item">
11
 					<view class="bottom_list_item">
12
 					  <view class="name"><text class="required newicon newicon-bitian"></text>姓名</view>
12
 					  <view class="name"><text class="required newicon newicon-bitian"></text>姓名</view>
13
-					  <view class="value no-mar">{{loginUserStore.loginUser.user.name}}</view>
13
+					  <view class="value no-mar">{{dataForm.name}}</view>
14
 					</view>
14
 					</view>
15
 					<view class="bottom_list_item">
15
 					<view class="bottom_list_item">
16
 					  <view class="name"><text class="required newicon newicon-bitian"></text>院区名称</view>
16
 					  <view class="name"><text class="required newicon newicon-bitian"></text>院区名称</view>
@@ -20,13 +20,20 @@
20
 						</uni-data-picker>
20
 						</uni-data-picker>
21
 						<text class="newicon newicon-youjiantou icon"></text>
21
 						<text class="newicon newicon-youjiantou icon"></text>
22
 					</view>
22
 					</view>
23
-					<view class="bottom_list_item" v-if="deptRepair.valueconfig==1">
24
-					  <view class="name"><text class="required newicon newicon-bitian"></text>科室名称</view>
23
+					<view class="bottom_list_item" v-if="deptRepair.valueconfig==1" @click="selectDepartment">
24
+<!-- 					  <view class="name"><text class="required newicon newicon-bitian"></text>科室名称</view>
25
 						<uni-data-picker class="value" placeholder="请选择报修科室"
25
 						<uni-data-picker class="value" placeholder="请选择报修科室"
26
 							v-model="dataForm.dept" :localdata="deptData" 
26
 							v-model="dataForm.dept" :localdata="deptData" 
27
 							:clear-icon="false" :class="{formRed: isSubmit && !dataForm.dept}">
27
 							:clear-icon="false" :class="{formRed: isSubmit && !dataForm.dept}">
28
-						</uni-data-picker>
28
+						</uni-data-picker> -->
29
 						<text class="newicon newicon-youjiantou icon"></text>
29
 						<text class="newicon newicon-youjiantou icon"></text>
30
+						<!-- <view class="form_item"> -->
31
+						  <view class="title select"><text class="required newicon newicon-bitian"></text>报修科室:</view>
32
+						  <view class="value category">
33
+						    <text class="categoryName ellipsis-multiline">{{dataForm.departmentName}}</text>
34
+						    <!-- <text class="newicon newicon-weibiaoti2010104"></text> -->
35
+						  </view>
36
+						<!-- </view> -->
30
 					</view>
37
 					</view>
31
 					<view class="bottom_list_item" v-if="deptRepair.valueconfig==1" @click="deptSelect">
38
 					<view class="bottom_list_item" v-if="deptRepair.valueconfig==1" @click="deptSelect">
32
 					  <view class="name">常用科室</view>
39
 					  <view class="name">常用科室</view>
@@ -35,7 +42,7 @@
35
 					</view>
42
 					</view>
36
           <view class="bottom_list_item">
43
           <view class="bottom_list_item">
37
             <view class="name"><text class="required newicon newicon-bitian"></text>联系电话</view>
44
             <view class="name"><text class="required newicon newicon-bitian"></text>联系电话</view>
38
-            <view class="value no-mar" @click="makePhoneCall(loginUserStore.loginUser.user.phone)">{{loginUserStore.loginUser.user.phone}}</view>
45
+            <view class="value no-mar" @click="makePhoneCall(dataForm.phone)">{{dataForm.phone}}</view>
39
           </view>
46
           </view>
40
         </view>
47
         </view>
41
       </view>
48
       </view>
@@ -79,10 +86,19 @@
79
 	const commonDeptData = ref(null)
86
 	const commonDeptData = ref(null)
80
 	
87
 	
81
 	const dataForm = reactive({
88
 	const dataForm = reactive({
89
+		name:loginUserStore.loginUser.user.name,
90
+		account:loginUserStore.loginUser.user.account,
91
+		phone:loginUserStore.loginUser.user.phone,
82
 	  dept: '',
92
 	  dept: '',
83
-		branch:''
93
+		departmentName:'',
94
+		branch:'',
95
+		commonDeptName:'',
96
+		commonDeptData:'',
97
+		dataType:false
84
 	})
98
 	})
85
 	
99
 	
100
+	const operationType = ref(null)
101
+	
86
 	const userTypes = ref(null)
102
 	const userTypes = ref(null)
87
 	
103
 	
88
 	const userData = reactive(loginUserStore.loginUser.user)
104
 	const userData = reactive(loginUserStore.loginUser.user)
@@ -165,9 +181,25 @@
165
 	// 选择院区
181
 	// 选择院区
166
 	function branchChange(){
182
 	function branchChange(){
167
 		dataForm.dept = null
183
 		dataForm.dept = null
184
+		dataForm.departmentName = null
185
+		dataForm.commonDeptName = null
186
+		dataForm.commonDeptData = null
168
 		commonDeptName.value = null
187
 		commonDeptName.value = null
169
 		commonDeptData.value = null
188
 		commonDeptData.value = null
170
-		getRepairTypes()
189
+		// getRepairTypes()
190
+	}
191
+	
192
+	// 跳转到科室
193
+	function selectDepartment(){
194
+		if(commonDeptName.value){
195
+			dataForm.dataType = true
196
+		}else{
197
+			dataForm.dataType = false
198
+		}
199
+		uni.setStorageSync('configData',JSON.stringify(dataForm))
200
+	  uni.navigateTo({
201
+	    url: `/pages/searchDept/searchDept?type=config&branchId=${dataForm.branch}`
202
+	  })
171
 	}
203
 	}
172
 	
204
 	
173
 	// 获取科室列表
205
 	// 获取科室列表
@@ -205,8 +237,8 @@
205
 	// 选择常用科室
237
 	// 选择常用科室
206
 	function deptSelect(){
238
 	function deptSelect(){
207
 		uni.setStorageSync('configData',JSON.stringify(dataForm))
239
 		uni.setStorageSync('configData',JSON.stringify(dataForm))
208
-		let data = commonDeptData.value ? 
209
-		commonDeptData.value : loginUserStore.loginUser.user.commonDept
240
+		let data = commonDeptData.value 
241
+		// ? commonDeptData.value : loginUserStore.loginUser.user.commonDept
210
 		if(!data){
242
 		if(!data){
211
 			data = 'none'
243
 			data = 'none'
212
 		}
244
 		}
@@ -245,7 +277,24 @@
245
 		api_user(postData).then(res => {
277
 		api_user(postData).then(res => {
246
 		  if(res.status == 200){
278
 		  if(res.status == 200){
247
 		    let item = res.list.find(i=>i.id==user.id)
279
 		    let item = res.list.find(i=>i.id==user.id)
248
-		    if(item){
280
+				let data = uni.getStorageSync('configData')
281
+				if(operationType.value=='selectDept'){
282
+					if(data){
283
+						data = JSON.parse(data)
284
+						dataForm.name = data.name
285
+						dataForm.account = data.account
286
+						dataForm.phone = data.phone
287
+						dataForm.dept = data.dept
288
+						dataForm.departmentName = data.departmentName
289
+						dataForm.branch = Number(data.branch)
290
+						dataForm.commonDeptName = data.commonDeptName
291
+						dataForm.commonDeptData = data.commonDeptData
292
+						if(data.dataType){
293
+							commonDeptData.value = data.commonDeptData
294
+							commonDeptName.value = data.commonDeptName
295
+						}
296
+					}	
297
+				}else if(item){
249
 					if(item.hospital.parent){
298
 					if(item.hospital.parent){
250
 						dataForm.branch = item.hospital.parent.id
299
 						dataForm.branch = item.hospital.parent.id
251
 					}else{
300
 					}else{
@@ -253,8 +302,9 @@
253
 					}
302
 					}
254
 					if(item.dept){
303
 					if(item.dept){
255
 						dataForm.dept = item.dept.id
304
 						dataForm.dept = item.dept.id
305
+						dataForm.departmentName = item.dept.dept
256
 					}
306
 					}
257
-					getRepairTypes()
307
+					// getRepairTypes()
258
 					let id = []
308
 					let id = []
259
 					let name = []
309
 					let name = []
260
 					if(item.commonDeptDTO){
310
 					if(item.commonDeptDTO){
@@ -264,6 +314,8 @@
264
 						}
314
 						}
265
 						commonDeptData.value = id.join(',')
315
 						commonDeptData.value = id.join(',')
266
 						commonDeptName.value = name.join('/')
316
 						commonDeptName.value = name.join('/')
317
+						dataForm.commonDeptName = commonDeptName.value
318
+						dataForm.commonDeptData = commonDeptData.value
267
 					}
319
 					}
268
 		    }else{
320
 		    }else{
269
 					// let data = uni.getStorageSync('configData')
321
 					// let data = uni.getStorageSync('configData')
@@ -279,6 +331,7 @@
279
 						}
331
 						}
280
 						if(user.dept){
332
 						if(user.dept){
281
 							dataForm.dept = user.dept.id
333
 							dataForm.dept = user.dept.id
334
+							dataForm.departmentName = user.dept.dept
282
 						}
335
 						}
283
 					// }
336
 					// }
284
 					if(user.commonDeptDTO){
337
 					if(user.commonDeptDTO){
@@ -288,8 +341,10 @@
288
 						}
341
 						}
289
 						commonDeptData.value = user.commonDept
342
 						commonDeptData.value = user.commonDept
290
 						commonDeptName.value = name.join('/')
343
 						commonDeptName.value = name.join('/')
344
+						dataForm.commonDeptName = commonDeptName.value
345
+						dataForm.commonDeptData = commonDeptData.value
291
 					}
346
 					}
292
-					getRepairTypes()
347
+					// getRepairTypes()
293
 				}
348
 				}
294
 		  }else{
349
 		  }else{
295
 		    uni.showToast({
350
 		    uni.showToast({
@@ -311,24 +366,33 @@
311
 		if(dataInfo.num==0){
366
 		if(dataInfo.num==0){
312
 			getUserInfo()
367
 			getUserInfo()
313
 		}
368
 		}
369
+		for(let i = 0; i<5; i++){
370
+			setTabbar(i)
371
+		}
314
 	})
372
 	})
315
 			
373
 			
316
   onLoad((option) => {
374
   onLoad((option) => {
317
 		userTypes.value = JSON.parse(uni.getStorageSync('groupData')) 
375
 		userTypes.value = JSON.parse(uni.getStorageSync('groupData')) 
318
 		onLoadFn();
376
 		onLoadFn();
319
 		dataInfo.num = 1
377
 		dataInfo.num = 1
378
+		if(option && option.type){
379
+			operationType.value = option.type
380
+		}
320
 		if(option.data){
381
 		if(option.data){
321
 			let data = JSON.parse(option.data)
382
 			let data = JSON.parse(option.data)
322
 			commonDeptData.value = data.data.join(',')
383
 			commonDeptData.value = data.data.join(',')
323
 			commonDeptName.value = data.name.join('/')
384
 			commonDeptName.value = data.name.join('/')
324
 			commonDeptDTO.value = data.name
385
 			commonDeptDTO.value = data.name
386
+			dataForm.commonDeptData = data.data.join(',')
387
+			dataForm.commonDeptName = data.name.join('/')
325
 			let data2 = uni.getStorageSync('configData')
388
 			let data2 = uni.getStorageSync('configData')
326
 			if(data2){
389
 			if(data2){
327
 				data2 = JSON.parse(data2)
390
 				data2 = JSON.parse(data2)
328
 				dataForm.dept = data2.dept
391
 				dataForm.dept = data2.dept
392
+				dataForm.departmentName = data2.departmentName
329
 				dataForm.branch = data2.branch
393
 				dataForm.branch = data2.branch
330
 			}
394
 			}
331
-			getRepairTypes()
395
+			// getRepairTypes()
332
 		}else{
396
 		}else{
333
 			getUserInfo()
397
 			getUserInfo()
334
 		}
398
 		}

+ 21 - 1
pages/repair/deptSelect.vue

@@ -57,7 +57,21 @@
57
 	
57
 	
58
 	// 上一步或者返回列表
58
 	// 上一步或者返回列表
59
 	function goBackOrToList(){
59
 	function goBackOrToList(){
60
-	  goBack();
60
+		if(entranceType.value=='home'){
61
+			let configNewData = uni.getStorageSync('configData')
62
+			if(configNewData){
63
+				let parseData = JSON.parse(configNewData)
64
+				if(parseData.commonDeptName){
65
+					parseData.dataType = true
66
+				}
67
+				uni.setStorageSync('configData',JSON.stringify(parseData))
68
+			}
69
+			uni.reLaunch({
70
+			  url: '/pages/repair/config?type=selectDept'
71
+			})
72
+		}else{
73
+			goBack();
74
+		}
61
 	}
75
 	}
62
 	
76
 	
63
 	function checkboxChange (e) {
77
 	function checkboxChange (e) {
@@ -138,6 +152,12 @@
138
 		}
152
 		}
139
 		console.log(888,entranceType.value)
153
 		console.log(888,entranceType.value)
140
 		if(entranceType.value=='home'){
154
 		if(entranceType.value=='home'){
155
+			let configNewData = uni.getStorageSync('configData')
156
+			if(configNewData){
157
+				let parseData = JSON.parse(configNewData)
158
+				parseData.dataType = true
159
+				uni.setStorageSync('configData',JSON.stringify(parseData))
160
+			}
141
 			uni.reLaunch({
161
 			uni.reLaunch({
142
 			  url: '/pages/repair/config?data='+JSON.stringify(data)
162
 			  url: '/pages/repair/config?data='+JSON.stringify(data)
143
 			})
163
 			})

+ 13 - 0
pages/repair/rapidRepNext.vue

@@ -236,6 +236,7 @@
236
 		// let arr = loginUserStore.loginUser.user.commonDept.split(',')
236
 		// let arr = loginUserStore.loginUser.user.commonDept.split(',')
237
 		// console.log(66,arr)
237
 		// console.log(66,arr)
238
 		dataInfo.department = item.id
238
 		dataInfo.department = item.id
239
+		dataInfo.departmentName = item.dept
239
 	}
240
 	}
240
 	
241
 	
241
 	function itemAddres(item){
242
 	function itemAddres(item){
@@ -256,7 +257,19 @@
256
 		}
257
 		}
257
 		api_user(postData).then(res => {
258
 		api_user(postData).then(res => {
258
 		  if(res.status == 200){
259
 		  if(res.status == 200){
260
+				let user = loginUserStore.loginUser.user
261
+				if(uni.getStorageSync('rapidRepNext')){
262
+					let data = JSON.parse(uni.getStorageSync('rapidRepNext'))
263
+					if(data){
264
+						dataInfo.departmentName = data.departmentName 
265
+						dataInfo.department = data.department
266
+					}
267
+				}else{
268
+					dataInfo.departmentName = res.list[0].dept.dept
269
+					dataInfo.department = res.list[0].dept.id
270
+				}
259
 		    itemUser.value = res.list.find(i=>i.id==user.id)
271
 		    itemUser.value = res.list.find(i=>i.id==user.id)
272
+				
260
 		  }else{
273
 		  }else{
261
 		    uni.showToast({
274
 		    uni.showToast({
262
 		      icon: 'none',
275
 		      icon: 'none',

+ 38 - 2
pages/searchDept/searchDept.vue

@@ -12,7 +12,7 @@
12
       <text class="newicon newicon-zanwu"></text>
12
       <text class="newicon newicon-zanwu"></text>
13
     </view>
13
     </view>
14
     <view class="foot_common_btns">
14
     <view class="foot_common_btns">
15
-      <button @click="goBack" type="default" class="primaryButton btn">返回</button>
15
+      <button @click="goBackPage" type="default" class="primaryButton btn">返回</button>
16
     </view>
16
     </view>
17
   </view>
17
   </view>
18
 </template>
18
 </template>
@@ -87,7 +87,7 @@
87
         dept: dataInfo.keyWord,
87
         dept: dataInfo.keyWord,
88
       }
88
       }
89
     }
89
     }
90
-		if(entranceType.value=='repair'){
90
+		if(entranceType.value=='repair' || entranceType.value=='config'){
91
 			if(branchId.value){
91
 			if(branchId.value){
92
 				postData.department.hospital.id = branchId.value
92
 				postData.department.hospital.id = branchId.value
93
 			}
93
 			}
@@ -118,6 +118,17 @@
118
     })
118
     })
119
   }
119
   }
120
   
120
   
121
+	function goBackPage(){
122
+		// goBack()
123
+		if(entranceType.value=='config'){
124
+			uni.reLaunch({
125
+			  url: `/pages/repair/config?type=selectDept`
126
+			})
127
+		}else{
128
+			goBack()
129
+		}
130
+	}
131
+	
121
   // 点击
132
   // 点击
122
   function clickItem(data){
133
   function clickItem(data){
123
 		if(entranceType.value=='repair'){
134
 		if(entranceType.value=='repair'){
@@ -144,6 +155,31 @@
144
 			uni.navigateTo({
155
 			uni.navigateTo({
145
 			  url: '/pages/repair/rapidRepNext'
156
 			  url: '/pages/repair/rapidRepNext'
146
 			})
157
 			})
158
+		}else if(entranceType.value=='config'){
159
+			let query = {
160
+				dept:null,
161
+				departmentName:null,
162
+				branch:branchId.value
163
+			}
164
+			let configNewData = uni.getStorageSync('configData')
165
+			if(configNewData){
166
+				let parseData = JSON.parse(configNewData)
167
+				query.dept = data.id//报修科室
168
+				query.departmentName = data.dept//报修科室
169
+				// parseData.dataType = true
170
+				let configData = {
171
+					...parseData,
172
+					...query
173
+				}
174
+				uni.setStorageSync('configData',JSON.stringify(configData))
175
+				uni.reLaunch({
176
+				  url: `/pages/repair/config?type=selectDept`
177
+				})
178
+			}else{
179
+				query.dept = data.id//报修科室
180
+				query.departmentName = data.dept//报修科室
181
+				uni.setStorageSync('configData',JSON.stringify(query))
182
+			}
147
 		}else{
183
 		}else{
148
 			dataInfo.incidentData.department = data;
184
 			dataInfo.incidentData.department = data;
149
 			incidentBuildStore.setIncidentBuildData(dataInfo.incidentData, incidentBuildStore.incidentBuild.type, incidentBuildStore.incidentBuild.sign);
185
 			incidentBuildStore.setIncidentBuildData(dataInfo.incidentData, incidentBuildStore.incidentBuild.type, incidentBuildStore.incidentBuild.sign);