Przeglądaj źródła

药房端添加科室切换

seimin 3 lat temu
rodzic
commit
02a353a059

+ 23 - 9
src/app/share/hs-prompt-modal/hs-prompt-modal.component.ts

@@ -24,6 +24,7 @@ export class HsPromptModalComponent implements OnInit {
24 24
   @Input() changeShow: Boolean;
25 25
   @Input() closeTime: Number;
26 26
   @Input() closeTimeFlag;
27
+  @Input() deptType:string = 'nurse';//默认按护士端的科室条件搜索
27 28
 
28 29
   @Output() closeModelHs = new EventEmitter<any>(); //1.组件暴露一个 EventEmitter 属性,当事件发生时,子组件利用该属性 emits(向上弹射)事件
29 30
   @Output() clearModelHs = new EventEmitter<any>(); //1.组件暴露一个 EventEmitter 属性,当事件发生时,子组件利用该属性 emits(向上弹射)事件
@@ -162,15 +163,28 @@ export class HsPromptModalComponent implements OnInit {
162 163
       keywords = e;
163 164
     }
164 165
     this.currentKeywords = keywords;
165
-    let dataObj = {
166
-      idx: 0,
167
-      sum: 10,
168
-      department: {
169
-        hospital: { id: hosId },
170
-        keyWord: keywords,
171
-        nurseSign: 1,
172
-      },
173
-    };
166
+    let dataObj = {};
167
+    if(this.deptType === 'nurse'){
168
+      dataObj = {
169
+        idx: 0,
170
+        sum: 10,
171
+        department: {
172
+          hospital: { id: hosId },
173
+          keyWord: keywords,
174
+          nurseSign: 1,
175
+        },
176
+      }
177
+    }else if(this.deptType === 'pharmacy'){
178
+      dataObj = {
179
+        idx: 0,
180
+        sum: 10,
181
+        department: {
182
+          hospital: { id: hosId },
183
+          dept: keywords,
184
+          type: {id: "386"},
185
+        },
186
+      }
187
+    }
174 188
     this.mainService
175 189
       .getFetchDataList("data", "department", dataObj)
176 190
       .subscribe((data) => {

+ 1 - 0
src/app/views/hushijiandan/hushijiandan.component.html

@@ -2943,6 +2943,7 @@
2943 2943
   [show]="hsPromptModalShow"
2944 2944
   (closeModelHs)="closeModelHs($event)"
2945 2945
   (clearModelHs)="clearModelHs($event)"
2946
+  deptType="nurse"
2946 2947
 >
2947 2948
 </app-hs-prompt-modal>
2948 2949
 <!-- 标本历史记录查看 -->

+ 23 - 7
src/app/views/pharmacy/pharmacy.component.html

@@ -8,12 +8,19 @@
8 8
     <div class="pharmacy-name">
9 9
       <h2 class="pharmacy-name__title">药房</h2>
10 10
     </div>
11
-    <div class="pharmacy-operate" (click)="toggleLogin()">
12
-      <img src="./../../assets/images/login_logo.png" class="pharmacy-operate__img" alt="">
13
-      <p class="pharmacy-operate__title">{{currentDept}}</p>
14
-      <!-- 弹层 -->
15
-      <div class="pharmacy-operatePop" (click)="logOut()" *ngIf="loginFlag">
16
-        退出
11
+    <div class="userInfo">
12
+      <div class="wel">欢迎您:</div>
13
+      <div class="user">
14
+        <img src="../../assets/images/icon_keshi.png" alt="" />
15
+        <span *ngIf="deptDisplay">{{
16
+          deptDisplay == 2
17
+            ? loginUser.dept.deptalias
18
+            : loginUser.dept.dept
19
+        }}</span>
20
+      </div>
21
+      <div class="userInfo-wrap">
22
+        <div class="logOut" (click)="changeKsNow()">切换科室</div>
23
+        <div class="logOut" (click)="logOut()">退出</div>
17 24
       </div>
18 25
     </div>
19 26
   </div>
@@ -208,7 +215,16 @@
208 215
   </div>
209 216
 </div>
210 217
 
211
-
218
+<!-- 药房端科室切换提示框 -->
219
+<app-hs-prompt-modal
220
+  [changeShow]="changeShow"
221
+  [closeTime]="closeTime"
222
+  [closeTimeFlag]="closeTimeFlag"
223
+  [show]="hsPromptModalShow"
224
+  (closeModelHs)="closeModelHs($event)"
225
+  (clearModelHs)="clearModelHs($event)"
226
+  deptType="pharmacy"
227
+>
212 228
 
213 229
 
214 230
 <!-- 返回系统按钮 -->

+ 38 - 0
src/app/views/pharmacy/pharmacy.component.less

@@ -103,7 +103,45 @@
103 103
 			}
104 104
 		}
105 105
 	}
106
+  .userInfo {
107
+    width: 336px;
108
+    height: 100%;
109
+    float: right;
110
+    padding: 8px;
111
+    box-sizing: border-box;
112
+    font-size: 14px;
113
+    border-left: 1px solid #e5e9ed;
114
+
115
+    .wel {
116
+      line-height: 15px;
117
+    }
118
+
119
+    .user {
120
+      font-size: 20px;
121
+      height: 36px;
122
+      display: flex;
123
+      justify-content: center;
124
+      align-items: center;
125
+      line-height: normal;
106 126
 
127
+      img {
128
+        height: 100%;
129
+        margin-right: 8px;
130
+      }
131
+    }
132
+    .userInfo-wrap {
133
+      display: flex;
134
+      justify-content: flex-end;
135
+      .logOut {
136
+        display: inline-block;
137
+        text-align: right;
138
+        color: @primary-color;
139
+        line-height: 20px;
140
+        cursor: pointer;
141
+        margin-right: 8px;
142
+      }
143
+    }
144
+  }
107 145
 	// 头部 end
108 146
 	// 主体部分 start
109 147
 	.pharmacy-main {

+ 52 - 11
src/app/views/pharmacy/pharmacy.component.ts

@@ -27,8 +27,6 @@ export class PharmacyComponent implements OnInit {
27 27
   constructor(private mainService: MainService, public router: Router) {}
28 28
   //待配药数据
29 29
   codes = [];
30
-  // 登录切换效果
31
-  loginFlag = false;
32 30
   // 待配药
33 31
   printPharmacyList = []; //数据列表
34 32
   printPharmacyIdx = 0; //页码
@@ -47,19 +45,20 @@ export class PharmacyComponent implements OnInit {
47 45
   pharmacyFlag = false;
48 46
   pharmacySearchKey = "";
49 47
   pharmacyLoad = false;
50
-  //当前登录人所属科室
51
-  currentDept = "";
48
+
49
+  // other
50
+  loginUser: any = localStorage.getItem("user")
51
+    ? JSON.parse(localStorage.getItem("user")).user
52
+    : null; //登录人信息
52 53
 
53 54
   ngOnInit() {
55
+    this.changeKs();
54 56
     // 待配药列表
55 57
     this.getPharmacyList(this.printPharmacyIdx, 1, this.printPharmacySearchKey);
56 58
     // 配药中列表
57 59
     this.getPharmacyList(this.waitPharmacyIdx, 2, this.waitPharmacySearchKey);
58 60
     // 核对中列表
59 61
     this.getPharmacyList(this.pharmacyIdx, 3, this.pharmacySearchKey);
60
-    //当前登录人所属科室
61
-    this.currentDept = JSON.parse(localStorage.getItem("user")).user.dept.dept;
62
-
63 62
     this.initRole();
64 63
   }
65 64
   // 药房端药房列表查询、搜索
@@ -225,10 +224,6 @@ export class PharmacyComponent implements OnInit {
225 224
       }
226 225
     });
227 226
   }
228
-  // 退出按钮切换效果
229
-  toggleLogin() {
230
-    this.loginFlag = !this.loginFlag;
231
-  }
232 227
   //待配药
233 228
   print(id?) {
234 229
     let arr = [];
@@ -327,4 +322,50 @@ export class PharmacyComponent implements OnInit {
327 322
       this.fixedTab = type;
328 323
     }
329 324
   }
325
+  //药房端科室切换
326
+  changeShow = true;
327
+  closeTime = 3;
328
+  closeTimeFlag = 0;
329
+  hsPromptModalShow: boolean = true; //科室切换提示框是否展示
330
+  timerCloseTime = null;
331
+  deptDisplay = 1; //护士端是否显示可以别名,1是显示科室名称,2是显示科室别名
332
+  //子传父接收
333
+  closeModelHs(e) {
334
+    this.hsPromptModalShow = JSON.parse(e).show;
335
+    this.changeShow = JSON.parse(e).changeShow;
336
+  }
337
+  //子传父接收
338
+  clearModelHs(e) {
339
+    if (JSON.parse(e).clear === true) {
340
+      clearInterval(this.timerCloseTime);
341
+    }
342
+    this.changeShow = JSON.parse(e).changeShow;
343
+  }
344
+  // 头部切换科室
345
+  changeKsNow() {
346
+    this.hsPromptModalShow = true;
347
+    clearInterval(this.timerCloseTime);
348
+    this.changeShow = false;
349
+  }
350
+  // 切换科室
351
+  changeKs() {
352
+    this.hsPromptModalShow = true;
353
+    // (1)	当用户设置为正数时,用户必须查看此窗体指定秒数。
354
+    // (2)	当用户设置为负数时,用户可点击知道了也可倒计时自动关闭。
355
+    // (3)	如果用户填写0则为无自动关闭和强制查看时间。
356
+    if (this.closeTimeFlag === 0) {
357
+      return;
358
+    }
359
+    this.closeTime = Math.abs(this.closeTimeFlag);
360
+    clearInterval(this.timerCloseTime);
361
+    this.timerCloseTime = setInterval(() => {
362
+      this.closeTime = Math.max(--this.closeTime, 0);
363
+      if (this.closeTime === 0) {
364
+        if (this.closeTimeFlag <= 0) {
365
+          this.hsPromptModalShow = false;
366
+        }
367
+        clearInterval(this.timerCloseTime);
368
+      }
369
+    }, 1000);
370
+  }
330 371
 }