|
@@ -6,11 +6,11 @@
|
6
|
6
|
<view class="bottom_list">
|
7
|
7
|
<view class="bottom_list_item">
|
8
|
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
|
10
|
</view>
|
11
|
11
|
<view class="bottom_list_item">
|
12
|
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
|
14
|
</view>
|
15
|
15
|
<view class="bottom_list_item">
|
16
|
16
|
<view class="name"><text class="required newicon newicon-bitian"></text>院区名称</view>
|
|
@@ -20,13 +20,20 @@
|
20
|
20
|
</uni-data-picker>
|
21
|
21
|
<text class="newicon newicon-youjiantou icon"></text>
|
22
|
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
|
25
|
<uni-data-picker class="value" placeholder="请选择报修科室"
|
26
|
26
|
v-model="dataForm.dept" :localdata="deptData"
|
27
|
27
|
:clear-icon="false" :class="{formRed: isSubmit && !dataForm.dept}">
|
28
|
|
- </uni-data-picker>
|
|
28
|
+ </uni-data-picker> -->
|
29
|
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
|
37
|
</view>
|
31
|
38
|
<view class="bottom_list_item" v-if="deptRepair.valueconfig==1" @click="deptSelect">
|
32
|
39
|
<view class="name">常用科室</view>
|
|
@@ -35,7 +42,7 @@
|
35
|
42
|
</view>
|
36
|
43
|
<view class="bottom_list_item">
|
37
|
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
|
46
|
</view>
|
40
|
47
|
</view>
|
41
|
48
|
</view>
|
|
@@ -79,10 +86,19 @@
|
79
|
86
|
const commonDeptData = ref(null)
|
80
|
87
|
|
81
|
88
|
const dataForm = reactive({
|
|
89
|
+ name:loginUserStore.loginUser.user.name,
|
|
90
|
+ account:loginUserStore.loginUser.user.account,
|
|
91
|
+ phone:loginUserStore.loginUser.user.phone,
|
82
|
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
|
102
|
const userTypes = ref(null)
|
87
|
103
|
|
88
|
104
|
const userData = reactive(loginUserStore.loginUser.user)
|
|
@@ -165,9 +181,25 @@
|
165
|
181
|
// 选择院区
|
166
|
182
|
function branchChange(){
|
167
|
183
|
dataForm.dept = null
|
|
184
|
+ dataForm.departmentName = null
|
|
185
|
+ dataForm.commonDeptName = null
|
|
186
|
+ dataForm.commonDeptData = null
|
168
|
187
|
commonDeptName.value = null
|
169
|
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
|
238
|
function deptSelect(){
|
207
|
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
|
242
|
if(!data){
|
211
|
243
|
data = 'none'
|
212
|
244
|
}
|
|
@@ -245,7 +277,24 @@
|
245
|
277
|
api_user(postData).then(res => {
|
246
|
278
|
if(res.status == 200){
|
247
|
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
|
298
|
if(item.hospital.parent){
|
250
|
299
|
dataForm.branch = item.hospital.parent.id
|
251
|
300
|
}else{
|
|
@@ -253,8 +302,9 @@
|
253
|
302
|
}
|
254
|
303
|
if(item.dept){
|
255
|
304
|
dataForm.dept = item.dept.id
|
|
305
|
+ dataForm.departmentName = item.dept.dept
|
256
|
306
|
}
|
257
|
|
- getRepairTypes()
|
|
307
|
+ // getRepairTypes()
|
258
|
308
|
let id = []
|
259
|
309
|
let name = []
|
260
|
310
|
if(item.commonDeptDTO){
|
|
@@ -264,6 +314,8 @@
|
264
|
314
|
}
|
265
|
315
|
commonDeptData.value = id.join(',')
|
266
|
316
|
commonDeptName.value = name.join('/')
|
|
317
|
+ dataForm.commonDeptName = commonDeptName.value
|
|
318
|
+ dataForm.commonDeptData = commonDeptData.value
|
267
|
319
|
}
|
268
|
320
|
}else{
|
269
|
321
|
// let data = uni.getStorageSync('configData')
|
|
@@ -279,6 +331,7 @@
|
279
|
331
|
}
|
280
|
332
|
if(user.dept){
|
281
|
333
|
dataForm.dept = user.dept.id
|
|
334
|
+ dataForm.departmentName = user.dept.dept
|
282
|
335
|
}
|
283
|
336
|
// }
|
284
|
337
|
if(user.commonDeptDTO){
|
|
@@ -288,8 +341,10 @@
|
288
|
341
|
}
|
289
|
342
|
commonDeptData.value = user.commonDept
|
290
|
343
|
commonDeptName.value = name.join('/')
|
|
344
|
+ dataForm.commonDeptName = commonDeptName.value
|
|
345
|
+ dataForm.commonDeptData = commonDeptData.value
|
291
|
346
|
}
|
292
|
|
- getRepairTypes()
|
|
347
|
+ // getRepairTypes()
|
293
|
348
|
}
|
294
|
349
|
}else{
|
295
|
350
|
uni.showToast({
|
|
@@ -311,24 +366,33 @@
|
311
|
366
|
if(dataInfo.num==0){
|
312
|
367
|
getUserInfo()
|
313
|
368
|
}
|
|
369
|
+ for(let i = 0; i<5; i++){
|
|
370
|
+ setTabbar(i)
|
|
371
|
+ }
|
314
|
372
|
})
|
315
|
373
|
|
316
|
374
|
onLoad((option) => {
|
317
|
375
|
userTypes.value = JSON.parse(uni.getStorageSync('groupData'))
|
318
|
376
|
onLoadFn();
|
319
|
377
|
dataInfo.num = 1
|
|
378
|
+ if(option && option.type){
|
|
379
|
+ operationType.value = option.type
|
|
380
|
+ }
|
320
|
381
|
if(option.data){
|
321
|
382
|
let data = JSON.parse(option.data)
|
322
|
383
|
commonDeptData.value = data.data.join(',')
|
323
|
384
|
commonDeptName.value = data.name.join('/')
|
324
|
385
|
commonDeptDTO.value = data.name
|
|
386
|
+ dataForm.commonDeptData = data.data.join(',')
|
|
387
|
+ dataForm.commonDeptName = data.name.join('/')
|
325
|
388
|
let data2 = uni.getStorageSync('configData')
|
326
|
389
|
if(data2){
|
327
|
390
|
data2 = JSON.parse(data2)
|
328
|
391
|
dataForm.dept = data2.dept
|
|
392
|
+ dataForm.departmentName = data2.departmentName
|
329
|
393
|
dataForm.branch = data2.branch
|
330
|
394
|
}
|
331
|
|
- getRepairTypes()
|
|
395
|
+ // getRepairTypes()
|
332
|
396
|
}else{
|
333
|
397
|
getUserInfo()
|
334
|
398
|
}
|