|
@@ -1,6 +1,12 @@
|
1
|
1
|
<template>
|
2
|
2
|
<view class="pharmacy">
|
3
|
3
|
<view class="pharmacy_header">
|
|
4
|
+ <view class="page_tab_bar pharmacy_changeDept active">
|
|
5
|
+ <view class="tab_dept">{{ currenDept.dept
|
|
6
|
+ }}<button type="default" size="mini" class="changeDept" @click="changeDept">
|
|
7
|
+ 切换科室
|
|
8
|
+ </button></view>
|
|
9
|
+ </view>
|
4
|
10
|
<view
|
5
|
11
|
class="scanning_btn"
|
6
|
12
|
hover-class="seimin-btn-hover"
|
|
@@ -9,9 +15,6 @@
|
9
|
15
|
<text class="icon_transport transport-saoma"></text>
|
10
|
16
|
</view>
|
11
|
17
|
<view class="scanFont">扫一扫</view>
|
12
|
|
- <picker v-if="depts[index]" @change="bindPickerChange" :value="index" range-key="dept" :range="depts" class="pharmacy_changeDept">
|
13
|
|
- <view class="pharmacy_input">{{depts[index].dept}}</view>
|
14
|
|
- </picker>
|
15
|
18
|
</view>
|
16
|
19
|
<view class="pharmacy-heng">
|
17
|
20
|
<view
|
|
@@ -126,9 +129,9 @@ export default {
|
126
|
129
|
label: "核对中",
|
127
|
130
|
},
|
128
|
131
|
],
|
129
|
|
- depts: [],//下拉框选项
|
130
|
|
- index: 0,//下拉框索引
|
131
|
132
|
hosId: uni.getStorageSync("userData").user.currentHospital.id,//当前院区
|
|
133
|
+ loginUser: uni.getStorageSync("userData").user,
|
|
134
|
+ currenDept: {},//当前登录人所属科室
|
132
|
135
|
};
|
133
|
136
|
},
|
134
|
137
|
methods: {
|
|
@@ -156,7 +159,7 @@ export default {
|
156
|
159
|
sum: 20,
|
157
|
160
|
drugsBag: {
|
158
|
161
|
searchType: type,
|
159
|
|
- launch:{id:this.depts[this.index].id}
|
|
162
|
+ launch:{id:this.currenDept.id}
|
160
|
163
|
},
|
161
|
164
|
};
|
162
|
165
|
uni.showLoading({
|
|
@@ -235,45 +238,36 @@ export default {
|
235
|
238
|
stop(e) {
|
236
|
239
|
e.preventDefault();
|
237
|
240
|
},
|
238
|
|
- //选择药房科室
|
239
|
|
- bindPickerChange: function(e) {
|
240
|
|
- console.log('picker发送选择改变,携带值为', e.target.value)
|
241
|
|
- this.index = e.target.value;
|
242
|
|
- // 待配药
|
243
|
|
- this.getPharmacyListData(4, 0);
|
|
241
|
+ // 切换科室
|
|
242
|
+ changeDept() {
|
|
243
|
+ uni.navigateTo({
|
|
244
|
+ url: `../search/search?type=pharmacy`,
|
|
245
|
+ });
|
244
|
246
|
},
|
245
|
|
- // 获取药房类型的科室
|
246
|
|
- getDeptByPharmacy(){
|
247
|
|
- let postData = {
|
248
|
|
- "idx": 0,
|
249
|
|
- "sum": 10,
|
250
|
|
- "department": {
|
251
|
|
- "hospital": {
|
252
|
|
- "id": this.hosId
|
253
|
|
- },
|
254
|
|
- "type": {
|
255
|
|
- "id": "386"
|
256
|
|
- },
|
257
|
|
- }
|
|
247
|
+ // 更新用户所在科室
|
|
248
|
+ updateUser(dept){
|
|
249
|
+ let dataObj = {
|
|
250
|
+ user: {
|
|
251
|
+ dept: {
|
|
252
|
+ id: dept.id,
|
|
253
|
+ },
|
|
254
|
+ id: this.loginUser.id,
|
|
255
|
+ },
|
258
|
256
|
};
|
259
|
|
- uni.showLoading({
|
260
|
|
- title: "加载中",
|
261
|
|
- mask: true,
|
262
|
|
- });
|
263
|
|
- post("/data/fetchDataList/department", postData).then((res) => {
|
264
|
|
- uni.hideLoading();
|
|
257
|
+ post("/data/updData/user", dataObj).then((res) => {
|
265
|
258
|
if (res.status == 200) {
|
266
|
|
- this.depts = res.list.map(v=>({id:v.id,dept:v.dept}));
|
267
|
|
- if(this.depts.length){
|
268
|
|
- this.getPharmacyListData(this.selectedLabelSlots, 0);
|
269
|
|
- }
|
270
|
|
- } else {
|
271
|
|
- uni.showToast({
|
272
|
|
- icon: "none",
|
273
|
|
- title: "请求失败!",
|
274
|
|
- });
|
|
259
|
+ this.getCurrentUserNow();
|
275
|
260
|
}
|
276
|
|
- });
|
|
261
|
+ })
|
|
262
|
+ },
|
|
263
|
+ // 重新获取用户信息
|
|
264
|
+ getCurrentUserNow(){
|
|
265
|
+ get("/user/data/getCurrentUser").then((res) => {
|
|
266
|
+ if (res.status == 200) {
|
|
267
|
+ this.loginUser.dept = this.currenDept;
|
|
268
|
+ uni.setStorageSync('userData', this.loginUser);
|
|
269
|
+ }
|
|
270
|
+ })
|
277
|
271
|
}
|
278
|
272
|
},
|
279
|
273
|
onLoad(options) {
|
|
@@ -286,8 +280,19 @@ export default {
|
286
|
280
|
});
|
287
|
281
|
}
|
288
|
282
|
//#endif
|
289
|
|
- // 获取药房类型的科室
|
290
|
|
- this.getDeptByPharmacy();
|
|
283
|
+ if (options.id && options.dept) {
|
|
284
|
+ let {
|
|
285
|
+ id,
|
|
286
|
+ dept
|
|
287
|
+ } = options;
|
|
288
|
+ this.currenDept.id = id;
|
|
289
|
+ this.currenDept.dept = dept;
|
|
290
|
+ this.updateUser(this.currenDept)
|
|
291
|
+ } else {
|
|
292
|
+ this.currenDept = uni.getStorageSync("userData").user.dept;
|
|
293
|
+ }
|
|
294
|
+ // 请求列表
|
|
295
|
+ this.getPharmacyListData(this.selectedLabelSlots, 0);
|
291
|
296
|
// #ifdef APP-PLUS
|
292
|
297
|
webHandle("no", "app");
|
293
|
298
|
// #endif
|
|
@@ -321,27 +326,58 @@ export default {
|
321
|
326
|
|
322
|
327
|
.pharmacy {
|
323
|
328
|
background-color: rgb(249, 250, 251);
|
324
|
|
- padding-top: 36rpx;
|
|
329
|
+ // padding-top: 36rpx;
|
325
|
330
|
.pharmacy_header{
|
326
|
331
|
position: relative;
|
327
|
332
|
.pharmacy_changeDept{
|
328
|
|
- position: absolute;
|
329
|
|
- top: 50%;
|
330
|
|
- right: 52rpx;
|
331
|
|
- transform: translateY(-50%);
|
332
|
|
- .pharmacy_input{
|
333
|
|
- background-image: linear-gradient(to right, #72c172, #3bb197);
|
334
|
|
- border-radius: 8rpx;
|
335
|
|
- color: #fff;
|
|
333
|
+ padding: 16rpx 0;
|
|
334
|
+ &.page_tab_bar {
|
|
335
|
+ flex: 1;
|
336
|
336
|
font-size: 36rpx;
|
337
|
|
- font-weight: 700;
|
338
|
|
- padding: 8rpx 16rpx;
|
|
337
|
+ background: #fff;
|
|
338
|
+ display: flex;
|
|
339
|
+ justify-content: center;
|
|
340
|
+ align-items: center;
|
|
341
|
+ position: relative;
|
|
342
|
+
|
|
343
|
+ &:after {
|
|
344
|
+ content: "";
|
|
345
|
+ position: absolute;
|
|
346
|
+ left: 0;
|
|
347
|
+ bottom: 0;
|
|
348
|
+ height: 2rpx;
|
|
349
|
+ width: 100%;
|
|
350
|
+ background-color: transparent;
|
|
351
|
+ }
|
|
352
|
+
|
|
353
|
+ .tab_dept {
|
|
354
|
+ position: relative;
|
|
355
|
+
|
|
356
|
+ .changeDept {
|
|
357
|
+ white-space: nowrap;
|
|
358
|
+ margin: 0;
|
|
359
|
+ position: absolute;
|
|
360
|
+ right: 0;
|
|
361
|
+ top: 50%;
|
|
362
|
+ transform: translate(105%, -50%);
|
|
363
|
+ padding: 0 0.5em;
|
|
364
|
+ line-height: 2;
|
|
365
|
+ }
|
|
366
|
+ }
|
|
367
|
+
|
|
368
|
+ &.active {
|
|
369
|
+ color: #49b856;
|
|
370
|
+
|
|
371
|
+ &:after {
|
|
372
|
+ background-color: #49b856;
|
|
373
|
+ }
|
|
374
|
+ }
|
339
|
375
|
}
|
340
|
376
|
}
|
341
|
377
|
}
|
342
|
378
|
|
343
|
379
|
.scanning_btn {
|
344
|
|
- margin: 0 auto;
|
|
380
|
+ margin: 16rpx auto;
|
345
|
381
|
width: 138rpx;
|
346
|
382
|
height: 138rpx;
|
347
|
383
|
background: #72c172;
|
|
@@ -580,7 +616,7 @@ export default {
|
580
|
616
|
font-size: 36rpx;
|
581
|
617
|
font-weight: 700;
|
582
|
618
|
margin-top: 16rpx;
|
583
|
|
- margin-bottom: 32rpx;
|
|
619
|
+ margin-bottom: 16rpx;
|
584
|
620
|
text-align: center;
|
585
|
621
|
}
|
586
|
622
|
}
|