Browse Source

标本间优化

maotao 6 months ago
parent
commit
dd3d9bcac1

+ 24 - 0
src/app/views/pathology/pathology.component.html

@@ -21,6 +21,10 @@
21 21
       </div>
22 22
 			<div class="error-class">{{errorcODEMsg}}</div>
23 23
     </div>
24
+		<div class="nurseCode" (click)="showNurseCode()">
25
+		  <i class="nurseCodeIcon icon_transport transport-erweima"></i
26
+		  >二维码
27
+		</div>
24 28
     <div class="userInfo">
25 29
       <div class="wel">欢迎您:</div>
26 30
       <div class="user">
@@ -235,6 +239,26 @@
235 239
   <!-- <router-outlet></router-outlet> -->
236 240
 </div>
237 241
 
242
+<!-- 科室二维码模态框 -->
243
+<!-- 在模态框所在的 div 添加属性 [appDrag] -->
244
+<div appDrag class="modal" *ngIf="isShowNurseCode">
245
+  <div class="header drag-title">
246
+    <h2>签到二维码</h2>
247
+    <i
248
+      class="icon-close icon_transport transport-guanbi1"
249
+      (click)="closeNurseCode()"
250
+    ></i>
251
+  </div>
252
+  <div class="dialog-center">
253
+    <div class="dialog-code">
254
+      <img [src]="nurseCodeImg" alt="" />
255
+    </div>
256
+  </div>
257
+  <div class="dialog-operate">
258
+    <strong class="dialog-refresh" (click)="showNurseCode()">刷新</strong>
259
+    <span>{{ refreshQRCodeTime }}s</span>
260
+  </div>
261
+</div>
238 262
 <!-- 科室切换提示框 -->
239 263
 <app-hs-prompt-modal
240 264
   [changeShow]="changeShow"

+ 109 - 8
src/app/views/pathology/pathology.component.less

@@ -82,7 +82,7 @@
82 82
     }
83 83
 
84 84
     .pharmacy-name {
85
-      // flex: 1;
85
+      flex: 1;
86 86
       // border-right: 1px solid #e5e9ed;
87 87
       display: flex;
88 88
       // justify-content: space-between;
@@ -199,15 +199,30 @@
199 199
 		}
200 200
 	}
201 201
 	
202
+	.nurseCode {
203
+	  width: 80px;
204
+	  font-size: 14px;
205
+	  color: #333;
206
+	  display: flex;
207
+	  justify-content: space-between;
208
+	  align-items: center;
209
+	  margin-right: 20px;
210
+	  cursor: pointer;
211
+	
212
+	  .nurseCodeIcon {
213
+	    margin-right: 8px;
214
+	    font-size: 24px;
215
+	    color: #929292;
216
+	  }
217
+	}
218
+	
202 219
   .userInfo {
203
-    // display: none;
204
-    width: 336px;
205
-    // height: 100%;
206
-    // float: right;
207
-    padding: 8px;
220
+    width: 260px;
221
+    height: 100%;
222
+    padding: 8px 36px 8px 8px;
208 223
     box-sizing: border-box;
209 224
     font-size: 14px;
210
-    // border-left: 1px solid #e5e9ed;
225
+    border-left: 1px solid #e5e9ed;
211 226
 
212 227
     .wel {
213 228
       line-height: 15px;
@@ -1094,4 +1109,90 @@
1094 1109
 }
1095 1110
 .spin-style{
1096 1111
 	z-index:9999;
1097
-}
1112
+}
1113
+
1114
+  .modal {
1115
+    // 相对于 background 定位, 位置暂时设置为 0,0,0,0 在指令中将其位置水平垂直居中在页面中间
1116
+    position: absolute;
1117
+    top: 0;
1118
+    left: 0;
1119
+    bottom: 0;
1120
+    right: 0;
1121
+    width: 280px;
1122
+    height: 310px;
1123
+    z-index: 3100;
1124
+    background: #f9fafb;
1125
+    box-shadow: 1px 1px 20px rgba(0, 0, 0, 0.3);
1126
+    border-radius: 30px;
1127
+    border: 1px solid @hs_border_color;
1128
+    overflow: hidden;
1129
+    cursor: move;
1130
+
1131
+    .drag-title {
1132
+      height: 50px;
1133
+      line-height: 50px;
1134
+      position: relative;
1135
+
1136
+      h2 {
1137
+        height: 100%;
1138
+        font-size: 18px;
1139
+        color: #333;
1140
+        text-align: center;
1141
+        margin: 0;
1142
+      }
1143
+
1144
+      .icon-close {
1145
+        position: absolute;
1146
+        top: 0;
1147
+        right: 16px;
1148
+        font-size: 16px;
1149
+        cursor: pointer;
1150
+        color: @hs_border_color;
1151
+      }
1152
+    }
1153
+
1154
+    .dialog-center {
1155
+      width: 235px;
1156
+      height: 208px;
1157
+      background-color: #fff;
1158
+      border: 1px solid @hs_border_color;
1159
+      margin: 0 auto;
1160
+      border-radius: 30px;
1161
+      position: relative;
1162
+
1163
+      .dialog-code {
1164
+        width: 180px;
1165
+        height: 200px;
1166
+        overflow: hidden;
1167
+        position: absolute;
1168
+        margin: auto;
1169
+        top: 0;
1170
+        right: 0;
1171
+        bottom: 0;
1172
+        left: 0;
1173
+
1174
+        img {
1175
+          width: 100%;
1176
+        }
1177
+      }
1178
+    }
1179
+
1180
+    .dialog-operate {
1181
+      display: flex;
1182
+      height: 40px;
1183
+      justify-content: space-between;
1184
+      align-items: center;
1185
+      font-size: 14px;
1186
+
1187
+      .dialog-refresh {
1188
+        color: @primary-color;
1189
+        margin-left: 40px;
1190
+        cursor: pointer;
1191
+      }
1192
+
1193
+      span {
1194
+        color: #999;
1195
+        margin-right: 40px;
1196
+      }
1197
+    }
1198
+  }

+ 32 - 0
src/app/views/pathology/pathology.component.ts

@@ -166,6 +166,8 @@ export class PathologyComponent implements OnInit, OnDestroy {
166 166
 	toDayData:any = null;
167 167
 	toDayTime:any = null;
168 168
 	backType='list';
169
+	loginUserDeptId: number = JSON.parse(localStorage.getItem("user")).user.dept
170
+	  .id; //登录人所属科室
169 171
   ngOnDestroy() {
170 172
     clearTimeout(this.timer);
171 173
     clearTimeout(this.logTimer);
@@ -215,6 +217,36 @@ export class PathologyComponent implements OnInit, OnDestroy {
215 217
 			this.getToday()
216 218
 		},60000)
217 219
   }
220
+	
221
+	isShowNurseCode = false; //是否展开科室二维码
222
+	nurseCodeImg = ""; //图片
223
+	refreshQRCodeTime = 0; //刷新时间间隔
224
+	// 关闭科室二维码
225
+	closeNurseCode() {
226
+	  this.isShowNurseCode = false;
227
+	  clearInterval(this.timers);
228
+	  this.timer = null;
229
+	}
230
+	// 展开科室二维码
231
+	timers = null;
232
+	showNurseCode() {
233
+	  this.isShowNurseCode = true;
234
+	  this.mainService.getDeptCode([this.loginUserDeptId]).subscribe((data) => {
235
+	    if (data["status"] == 200) {
236
+	      this.nurseCodeImg = data["data"][0].base64;
237
+	      this.refreshQRCodeTime = data["data"][0].refreshQRCodeTime;
238
+	      clearInterval(this.timers);
239
+	      this.timers = setInterval(() => {
240
+	        this.refreshQRCodeTime = Math.max(--this.refreshQRCodeTime, 0);
241
+	        if (this.refreshQRCodeTime === 0) {
242
+	          clearInterval(this.timers);
243
+	          this.showNurseCode();
244
+	        }
245
+	      }, 1000);
246
+	    }
247
+	  });
248
+	}
249
+	
218 250
   // 当前时间日期
219 251
   runTime() {
220 252
     clearTimeout(this.timer);

+ 2 - 1
src/app/views/pathology/pathology.module.ts

@@ -4,11 +4,12 @@ import { CommonModule } from '@angular/common';
4 4
 import { PathologyRoutingModule } from './pathology-routing.module';
5 5
 import { ShareModule } from 'src/app/share/share.module';
6 6
 import { PathologyComponent } from './pathology.component';
7
-
7
+import { DragModule } from 'src/app/directives/drag/drag.module';
8 8
 
9 9
 @NgModule({
10 10
   declarations: [PathologyComponent],
11 11
   imports: [
12
+		DragModule,
12 13
     CommonModule,
13 14
     PathologyRoutingModule,
14 15
     ShareModule

+ 1 - 1
src/app/views/specimen-room-view/specimen-room-view.component.html

@@ -36,7 +36,7 @@
36 36
         }}</span>
37 37
       </div>
38 38
       <div class="userInfo-wrap">
39
-        <div class="logOut" (click)="changeKsNow()">切换科室</div>
39
+        <div class="logOut" (click)="setSpecimen()">切换科室</div>
40 40
         <div class="logOut" (click)="logOut()">退出</div>
41 41
       </div>
42 42
     </div>

+ 8 - 10
src/app/views/specimen-room-view/specimen-room-view.component.less

@@ -62,7 +62,7 @@
62 62
     display: flex;
63 63
 		color: #000;
64 64
     .pharmacy-logo {
65
-      width: 221px;
65
+      width: 100px;
66 66
       background-color: #fff;
67 67
       display: flex;
68 68
       flex-direction: column;
@@ -82,7 +82,7 @@
82 82
     }
83 83
 
84 84
     .pharmacy-name {
85
-      // flex: 1;
85
+      flex: 1;
86 86
       // border-right: 1px solid #e5e9ed;
87 87
       display: flex;
88 88
       // justify-content: space-between;
@@ -159,14 +159,12 @@
159 159
     }
160 160
   }
161 161
   .userInfo {
162
-    // display: none;
163
-    width: 336px;
164
-    // height: 100%;
165
-    // float: right;
166
-    padding: 8px;
167
-    box-sizing: border-box;
168
-    font-size: 14px;
169
-    // border-left: 1px solid #e5e9ed;
162
+		width: 260px;
163
+		height: 100%;
164
+		padding: 8px 36px 8px 8px;
165
+		box-sizing: border-box;
166
+		font-size: 14px;
167
+		border-left: 1px solid #e5e9ed;
170 168
 
171 169
     .wel {
172 170
       line-height: 15px;

+ 13 - 5
src/app/views/specimen-room-view/specimen-room-view.component.ts

@@ -317,11 +317,19 @@ export class SpecimenRoomViewComponent implements OnInit, OnDestroy {
317 317
 	
318 318
 	// 获取是否关联标本间
319 319
 	setSpecimen(){
320
-		this.validateForm = this.fb.group({
321
-		  specimen: [null, [Validators.required]],
322
-			operation: [null, [Validators.required]],
323
-			generate:[1, [Validators.required]],
324
-		});
320
+		if(this.validateForm){
321
+			this.validateForm = this.fb.group({
322
+			  specimen: [this.validateForm.value.specimen, [Validators.required]],
323
+				operation: [this.validateForm.value.operation, [Validators.required]],
324
+				generate:[this.validateForm.value.generate, [Validators.required]],
325
+			});
326
+		}else{
327
+			this.validateForm = this.fb.group({
328
+			  specimen: [null, [Validators.required]],
329
+				operation: [null, [Validators.required]],
330
+				generate:[1, [Validators.required]],
331
+			});
332
+		}
325 333
 		this.relevanceModal = true
326 334
 	}
327 335