seimin hai 4 meses
pai
achega
7f67135de6

+ 52 - 15
src/app/views/hushijiandan/hushijiandan.component.html

@@ -177,26 +177,26 @@
177 177
         <div
178 178
           class="app-header borderB display_flex justify-content_space-between align-items_center"
179 179
         >
180
-          <div
181
-            class="nurseTitle display_flex justify-content_space-between align-items_center"
182
-          >
180
+          <div class="nurseTitle display_flex justify-content_space-between align-items_center">
183 181
             <div class="todayNumWrap">护士端<span class="todayNum">当日建单数:{{ todayNum }}</span></div>
184 182
             <div class="updateTipsForNurses red">{{ updateTipsForNurses }}</div>
185 183
             <div class="queuingInformation" *ngIf="!updateTipsForNurses && inspectAndPatientTransportConfig.queuingInformation == 1">等待陪检:<span class="red">{{queuingInformationList[0]}}</span>&emsp;陪检中:<span class="red">{{queuingInformationList[1]}}</span></div>
186 184
             <div class="nurseCode" (click)="showNurseCode()">
187
-              <i class="nurseCodeIcon icon_transport transport-erweima"></i
188
-              >二维码
185
+              <i class="nurseCodeIcon icon_transport transport-erweima"></i>二维码
189 186
             </div>
190 187
           </div>
191
-          <div class="userInfo">
192
-            <div class="wel">欢迎您<strong>{{tool.getCurrentUserInfo().name}}</strong>:</div>
193
-            <div class="user">
194
-              <img src="../../assets/images/icon_keshi.png" alt="" />
195
-              <span *ngIf="deptDisplay" [title]="deptDisplay == 2 ? loginUser.dept.deptalias : loginUser.dept.dept">{{deptDisplay == 2 ? loginUser.dept.deptalias : loginUser.dept.dept}}</span>
196
-            </div>
197
-            <div class="userInfo-wrap">
198
-              <div class="logOut" (click)="changeKsNow()">切换科室</div>
199
-              <div class="logOut" (click)="logOut()">退出</div>
188
+          <div class="right">
189
+            <div class="userInfo dropdown">
190
+              <div class="user" (mouseenter)="showDropdown = true" (mouseleave)="showDropdown = false">
191
+                <img src="../../assets/images/icon_keshi.png" alt="">
192
+                <span><ng-container *ngIf="loginUser.dept">{{deptDisplay == 2 ? loginUser.dept.deptalias : loginUser.dept.dept}}-</ng-container>{{loginUser.name}}</span>
193
+                <i class="icon_transport transport-xiala1 ml8"></i>
194
+              </div>
195
+              <div class="dropdown-content r8" [hidden]="!showDropdown" (mouseenter)="showDropdown = true" (mouseleave)="showDropdown = false">
196
+                <div class="dropdownItem" (click)="changeKsNow()">切换科室</div>
197
+                <div class="dropdownItem" (click)="showUpPwd()">修改密码</div>
198
+                <div class="dropdownItem" (click)="logOut()">退出</div>
199
+              </div>
200 200
             </div>
201 201
           </div>
202 202
         </div>
@@ -3511,4 +3511,41 @@
3511 3511
 </div>
3512 3512
 <div class="mask-style" *ngIf="isSpinning">
3513 3513
 	<nz-spin nzSimple class="spin-style"></nz-spin>
3514
-</div>
3514
+</div>
3515
+
3516
+<!-- 修改密码 -->
3517
+<nz-modal [(nzVisible)]="isPwdVisible" nzTitle="修改密码" (nzOnCancel)="pwdHandleCancel()" (nzOnOk)="pwdHandleOk()" [nzOkLoading]="pwdIsOkLoading" (nzAfterOpen)="pwdAfterOpen()">
3518
+  <div>
3519
+    <label>
3520
+      原始密码:
3521
+      <nz-input-group [nzSuffix]="suffixTemplate">
3522
+        <input minlength="9" [type]="passwordVisible ? 'text' : 'password'" nz-input placeholder="原始密码" [(ngModel)]="upModalData.pwdOld" />
3523
+      </nz-input-group>
3524
+      <ng-template #suffixTemplate>
3525
+        <i nz-icon [nzType]="passwordVisible ? 'eye-invisible' : 'eye'" (click)="passwordVisible = !passwordVisible"></i>
3526
+      </ng-template>
3527
+    </label>
3528
+    <label>新密码:
3529
+      <div style="display: flex;">
3530
+        <nz-input-group [nzSuffix]="suffixTemplate">
3531
+          <input minlength="9" [type]="passwordVisible ? 'text' : 'password'" nz-input placeholder="新密码" [(ngModel)]="upModalData.newPwd" (ngModelChange)="blurNewPwd()" />
3532
+        </nz-input-group>
3533
+        <ng-template #suffixTemplate>
3534
+          <i nz-icon [nzType]="passwordVisible ? 'eye-invisible' : 'eye'" (click)="passwordVisible = !passwordVisible"></i>
3535
+        </ng-template>
3536
+        <div class="red" style="display: flex;justify-content: center;align-items: center;padding-left: 5px;" *ngIf="enoughRegFlag">弱</div>
3537
+        <div style="display: flex;justify-content: center;align-items: center;padding-left: 5px;" *ngIf="mediumRegFlag">中</div>
3538
+        <div class="green" style="display: flex;justify-content: center;align-items: center;padding-left: 5px;" *ngIf="strongRegFlag">强</div>
3539
+      </div>
3540
+    </label>
3541
+    <div class="red">强密码需包含大小写字母、数字、特殊字符,长度至少9个字符</div>
3542
+    <label>确认新密码:
3543
+      <nz-input-group [nzSuffix]="suffixTemplate">
3544
+        <input minlength="9" [type]="passwordVisible ? 'text' : 'password'" nz-input placeholder="确认新密码" [(ngModel)]="upModalData.newPwd2" />
3545
+      </nz-input-group>
3546
+      <ng-template #suffixTemplate>
3547
+        <i nz-icon [nzType]="passwordVisible ? 'eye-invisible' : 'eye'" (click)="passwordVisible = !passwordVisible"></i>
3548
+      </ng-template>
3549
+    </label>
3550
+  </div>
3551
+</nz-modal>

+ 89 - 29
src/app/views/hushijiandan/hushijiandan.component.less

@@ -1184,50 +1184,73 @@
1184 1184
           }
1185 1185
         }
1186 1186
 
1187
-        .userInfo {
1188
-          width: 336px;
1187
+        .right {
1189 1188
           height: 100%;
1190
-          float: right;
1191
-          padding: 8px;
1192
-          box-sizing: border-box;
1193
-          font-size: 14px;
1194
-          border-left: 1px solid @hs_border_color;
1195
-
1196
-          .wel {
1197
-            line-height: 15px;
1198
-          }
1189
+          flex-shrink: 0;
1190
+          display: flex;
1191
+          align-items: center;
1199 1192
 
1200
-          .user {
1201
-            font-size: 20px;
1202
-            height: 36px;
1203
-            display: flex;
1204
-            justify-content: center;
1205
-            align-items: center;
1206
-            line-height: normal;
1193
+          .msg {
1194
+            float: left;
1195
+            width: 50px;
1196
+            height: 100%;
1197
+            border-left: 1px solid #e5e9ed;
1207 1198
 
1208
-            img {
1199
+            .msgBtn {
1200
+              width: 100%;
1209 1201
               height: 100%;
1210
-              margin-right: 8px;
1202
+
1203
+              i {
1204
+                font-size: 30px;
1205
+              }
1211 1206
             }
1207
+          }
1212 1208
 
1213
-            span {
1209
+          .userInfo {
1210
+            height: 100%;
1211
+            float: right;
1212
+            padding: 0 24px;
1213
+            box-sizing: border-box;
1214
+            font-size: 14px;
1215
+            border-left: 1px solid #e5e9ed;
1216
+
1217
+            .wel {
1218
+              line-height: 15px;
1214 1219
               white-space: nowrap;
1215 1220
               overflow: hidden;//文本超出隐藏
1216 1221
               text-overflow: ellipsis;//文本超出省略号替代
1217 1222
             }
1218
-          }
1219 1223
 
1220
-          .userInfo-wrap {
1221
-            display: flex;
1222
-            justify-content: flex-end;
1224
+            .user {
1225
+              overflow: hidden;
1226
+              height: 48px;
1227
+              display: flex;
1228
+              justify-content: center;
1229
+              align-items: center;
1230
+              font-size: 16px;
1231
+              cursor: pointer;
1232
+
1233
+              img {
1234
+                width: 32px;
1235
+                height: 32px;
1236
+                margin-right: 8px;
1237
+              }
1238
+
1239
+              span, .transport-xiala1 {
1240
+                height: 48px;
1241
+                line-height: 48px;
1242
+              }
1243
+            }
1223 1244
 
1224 1245
             .logOut {
1225
-              display: inline-block;
1226 1246
               text-align: right;
1227 1247
               color: @primary-color;
1228 1248
               line-height: 20px;
1229
-              cursor: pointer;
1230
-              margin-right: 8px;
1249
+
1250
+              span {
1251
+                cursor: pointer;
1252
+                padding: 10px;
1253
+              }
1231 1254
             }
1232 1255
           }
1233 1256
         }
@@ -1656,7 +1679,7 @@
1656 1679
             border-bottom: 1px solid @hs_border_color;
1657 1680
             padding: 8px;
1658 1681
             position: relative;
1659
-            z-index: 9;
1682
+            // z-index: 9;
1660 1683
             background: #fff;
1661 1684
 
1662 1685
             & > span {
@@ -2430,3 +2453,40 @@
2430 2453
 .spin-style{
2431 2454
 	z-index:9999;
2432 2455
 }
2456
+
2457
+// 下拉列表
2458
+.dropdown{
2459
+  position: relative;
2460
+  height: 48px;
2461
+  line-height: 48px;
2462
+  .dropdown-content {
2463
+    position: absolute;
2464
+    top: 48px;
2465
+    background-color: #fff;
2466
+    width: 156px;
2467
+    box-shadow: 0px 2px 4px 1px #D9D9D9;
2468
+    z-index: 999999;
2469
+    border-radius: 4px;
2470
+    border: 1px solid rgba(0,0,0,0.15);
2471
+    color: rgba(0,0,0,0.65);
2472
+    &.ct{
2473
+      left: 50%;
2474
+      transform: translateX(-50%);
2475
+    }
2476
+    &.r8{
2477
+      right: 8px;
2478
+    }
2479
+  }
2480
+
2481
+  .dropdown-content .dropdownItem {
2482
+    height: 40px;
2483
+    cursor: pointer;
2484
+    display: flex;
2485
+    align-items: center;
2486
+    padding: 0 24px;
2487
+  }
2488
+
2489
+  .dropdown-content .dropdownItem:hover {
2490
+    background-color: #e9f7e9;
2491
+  }
2492
+}

+ 88 - 11
src/app/views/hushijiandan/hushijiandan.component.ts

@@ -149,6 +149,8 @@ export class HushijiandanComponent implements OnInit {
149 149
       },
150 150
     };
151 151
   }
152
+  // 下拉
153
+  showDropdown:boolean = false;
152 154
   // 关闭倒计时
153 155
   closeTime = 3;
154 156
   closeTimeFlag;
@@ -329,8 +331,8 @@ export class HushijiandanComponent implements OnInit {
329 331
 						this.pathologyModal = true
330 332
 						return
331 333
 					}
332
-					if(data.list[0].status && 
333
-					(data.list[0].status.value==1 || data.list[0].status.value==2 || 
334
+					if(data.list[0].status &&
335
+					(data.list[0].status.value==1 || data.list[0].status.value==2 ||
334 336
 					data.list[0].status.value==3 || data.list[0].status.value==4)){
335 337
 						this.pathologyModal = true
336 338
 					}else{
@@ -380,8 +382,8 @@ export class HushijiandanComponent implements OnInit {
380 382
 					this.pathologyModal = true
381 383
 					return
382 384
 				}
383
-				if(data.list[0].status && 
384
-				(data.list[0].status.value==1 || data.list[0].status.value==2 || 
385
+				if(data.list[0].status &&
386
+				(data.list[0].status.value==1 || data.list[0].status.value==2 ||
385 387
 					data.list[0].status.value==3 || data.list[0].status.value==4)){
386 388
 					this.pathologyModal = true
387 389
 				}else{
@@ -404,7 +406,7 @@ export class HushijiandanComponent implements OnInit {
404 406
 			}
405 407
 		});
406 408
 	}
407
-	
409
+
408 410
 	// 申请单号点击
409 411
 	itemClick(item){
410 412
 		this.detailId = item.id
@@ -414,7 +416,7 @@ export class HushijiandanComponent implements OnInit {
414 416
 				this.pathologyModal = true
415 417
 				return
416 418
 			}
417
-			if(item.status && (item.status.value==1 || item.status.value==2 || 
419
+			if(item.status && (item.status.value==1 || item.status.value==2 ||
418 420
 				item.status.value==3 || item.status.value==4)){
419 421
 				this.pathologyModal = true
420 422
 			}else{
@@ -422,11 +424,11 @@ export class HushijiandanComponent implements OnInit {
422 424
 			}
423 425
 		},200)
424 426
 	}
425
-	
427
+
426 428
 	hideModal(){
427 429
 		this.multiDialog = false
428 430
 	}
429
-	
431
+
430 432
 	pathologyDetailCancel(){
431 433
 		this.pathologyDetailModal = false
432 434
 	}
@@ -4575,7 +4577,7 @@ export class HushijiandanComponent implements OnInit {
4575 4577
     this.isShowNurseCode = true;
4576 4578
 		this.getConfig()
4577 4579
   }
4578
-	
4580
+
4579 4581
 	// 获取配置
4580 4582
 	iskeySwitch:any = false;
4581 4583
 	getConfig() {
@@ -4616,7 +4618,7 @@ export class HushijiandanComponent implements OnInit {
4616 4618
 	      }
4617 4619
 	    });
4618 4620
 	}
4619
-	
4621
+
4620 4622
 	// 获取动态密钥
4621 4623
 	numberKey:any;
4622 4624
 	getSecretKey(){
@@ -4636,7 +4638,7 @@ export class HushijiandanComponent implements OnInit {
4636 4638
       }
4637 4639
     });
4638 4640
 	}
4639
-	
4641
+
4640 4642
   // 右侧菜单
4641 4643
   showLastItems: boolean = false;
4642 4644
   // 下拉
@@ -4701,4 +4703,79 @@ export class HushijiandanComponent implements OnInit {
4701 4703
   printCode(item){
4702 4704
     console.log(item)
4703 4705
   }
4706
+
4707
+  // 修改密码
4708
+  passwordVisible = false;
4709
+  password?: string;
4710
+
4711
+  isPwdVisible = false;
4712
+  pwdIsOkLoading = false;
4713
+  upModalData = {
4714
+    userid: "",
4715
+    pwdOld: "",
4716
+    newPwd: "",
4717
+    newPwd2: "",
4718
+  };
4719
+  upPwd(): void {
4720
+    if(this.upModalData.pwdOld.trim() === ''){
4721
+      this.message.error('请填写原始密码!', {
4722
+        nzDuration: 5000,
4723
+      });
4724
+      return;
4725
+    }
4726
+    if(!this.strongRegFlag){
4727
+      this.message.error('新密码不符合要求!', {
4728
+        nzDuration: 5000,
4729
+      });
4730
+      return;
4731
+    }
4732
+    if(this.upModalData.newPwd !== this.upModalData.newPwd2){
4733
+      this.message.error('新密码与确认新密码不一致!', {
4734
+        nzDuration: 5000,
4735
+      });
4736
+      return;
4737
+    }
4738
+
4739
+    this.pwdIsOkLoading = true;
4740
+    let userid = JSON.parse(localStorage.getItem("user")).user.id;
4741
+    this.upModalData.userid = userid;
4742
+    this.mainService.upPwd(this.upModalData).subscribe((data) => {
4743
+      if (data.status == 200) {
4744
+        this.isPwdVisible = false;
4745
+        this.pwdIsOkLoading = false;
4746
+        this.message.success("修改成功!", {
4747
+          nzDuration: 5000,
4748
+        });
4749
+      } else {
4750
+        this.pwdIsOkLoading = false;
4751
+        this.message.error(data.error, {
4752
+          nzDuration: 5000,
4753
+        });
4754
+      }
4755
+    });
4756
+  }
4757
+  showUpPwd(): void {
4758
+    this.isPwdVisible = true;
4759
+  }
4760
+
4761
+  pwdHandleOk(): void {
4762
+    this.upPwd();
4763
+  }
4764
+
4765
+  pwdHandleCancel(): void {
4766
+    this.isPwdVisible = false;
4767
+  }
4768
+
4769
+  // 新密码失去焦点
4770
+  enoughRegFlag = true; //弱
4771
+  mediumRegFlag = false; //中
4772
+  strongRegFlag = false; //强
4773
+  blurNewPwd(){
4774
+    let enoughReg = /^.{0,6}$/;//密码强度-弱
4775
+    let strongReg = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[\!\@\#\$\%\^\&\*]).{9,}$/;//密码强度-强
4776
+    this.enoughRegFlag = enoughReg.test(this.upModalData.newPwd);
4777
+    this.strongRegFlag = strongReg.test(this.upModalData.newPwd);
4778
+    this.mediumRegFlag = !this.enoughRegFlag && !this.strongRegFlag;
4779
+    console.log(this.enoughRegFlag,this.mediumRegFlag,this.strongRegFlag);
4780
+  }
4704 4781
 }