浏览代码

护士端一键建单预约建单按钮和直接建单按钮按钮,调整为一个按钮

seimin 4 年之前
父节点
当前提交
7a470f27f2

+ 0 - 1
src/app/views/compre-statistics/compre-statistics.component.less

@@ -141,7 +141,6 @@
141
             .checkBox {
141
             .checkBox {
142
               position: absolute;
142
               position: absolute;
143
               right: 16px;
143
               right: 16px;
144
-              z-index: 9999;
145
             }
144
             }
146
 
145
 
147
             .more {
146
             .more {

+ 39 - 27
src/app/views/hushijiandan/hushijiandan.component.html

@@ -770,7 +770,6 @@
770
       </div>
770
       </div>
771
       <div>
771
       <div>
772
         <form nz-form [formGroup]="patientForm" class="patientForm">
772
         <form nz-form [formGroup]="patientForm" class="patientForm">
773
-
774
           <nz-form-item class="datesControl">
773
           <nz-form-item class="datesControl">
775
             <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="checkedType">任务类型</nz-form-label>
774
             <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="checkedType">任务类型</nz-form-label>
776
             <nz-form-control nzErrorTip="请选择任务类型!" class="checkedType">
775
             <nz-form-control nzErrorTip="请选择任务类型!" class="checkedType">
@@ -803,33 +802,50 @@
803
               </nz-form-control>
802
               </nz-form-control>
804
               <div *ngIf="!linkCheckLis.length">暂无关联的检查</div>
803
               <div *ngIf="!linkCheckLis.length">暂无关联的检查</div>
805
             </nz-form-item>
804
             </nz-form-item>
805
+            <!-- 需要预约检查 -->
806
+            <nz-form-item>
807
+              <nz-form-control>
808
+                <label nz-checkbox
809
+                  [nzDisabled]="!linkCheckLisTrue&&currentTasktype.associationType.value === 'inspect'||linkCheckLisTrue&&allowUrgent==1&&currentTasktype.associationType.value === 'inspect'||allowUrgent==1&&currentTasktype.associationType.value ==='patientTransport'"
810
+                  [(ngModel)]="isYyInspect" (ngModelChange)="yyInspectChange($event)"
811
+                  [ngModelOptions]="{standalone: true}">需要预约检查</label>
812
+              </nz-form-control>
813
+            </nz-form-item>
806
             <!-- 预约建单时间-患者其他服务 -->
814
             <!-- 预约建单时间-患者其他服务 -->
807
-            <nz-form-item class="yyTime" [ngClass]="{yyTimeError:!yyTimeZy&&clickYYZyFlag}"
808
-              *ngIf="appointmentZyBuildFlag === '1'&&allowUrgent==0">
815
+            <nz-form-item class="yyTime" [ngClass]="{yyTimeError:(!yyTimeZy||!yyDateZy)&&clickYYZyFlag}"
816
+              *ngIf="currentTasktype.associationType.value === 'patientTransport'">
809
               <nz-form-label [nzSm]="24" [nzXs]="24">预约建单时间</nz-form-label>
817
               <nz-form-label [nzSm]="24" [nzXs]="24">预约建单时间</nz-form-label>
810
               <nz-form-control [nzSm]="24" [nzXs]="24">
818
               <nz-form-control [nzSm]="24" [nzXs]="24">
811
-                <nz-time-picker nzFormat="HH:mm" [nzMinuteStep]="30" [nzSecondStep]="60" [(ngModel)]="yyTimeZy"
812
-                  (ngModelChange)="yyTimeZyChange($event)" [ngModelOptions]="{standalone: true}"
813
-                  [nzDisabledHours]="disabledHours" [nzDisabledMinutes]="disabledMinutes"></nz-time-picker>
814
-                <label *ngIf="yyTimeZy" nz-checkbox [(ngModel)]="nextDayZy" (ngModelChange)="nextDayZyChange($event)"
815
-                  class="ml8" [ngModelOptions]="{standalone: true}">次日</label>
819
+                <nz-date-picker [nzDisabled]="!isYyInspect" [(ngModel)]="yyDateZy" [ngModelOptions]="{standalone: true}"
820
+                  [nzAllowClear]="false" [nzDisabledDate]="disabledyyDateZy"></nz-date-picker>
821
+                <nz-time-picker [nzDisabled]="!isYyInspect" class="ml8" nzFormat="HH:mm" [nzMinuteStep]="30"
822
+                  [nzSecondStep]="60" [(ngModel)]="yyTimeZy" (ngModelChange)="yyTimeZyChange($event)"
823
+                  [ngModelOptions]="{standalone: true}" [nzDisabledHours]="disabledHours"
824
+                  [nzDisabledMinutes]="disabledMinutes" [nzAllowEmpty]="false">
825
+                </nz-time-picker>
826
+                <button [disabled]="!isYyInspect||(isYyInspect&&!(yyDateZy&&yyTimeZy))" nz-button nzType="primary"
827
+                  class="ml8" (click)="nextDayZy()">下一日</button>
816
               </nz-form-control>
828
               </nz-form-control>
817
-              <div class="red w100" *ngIf="!yyTimeZy&&clickYYZyFlag">请填写预约建单时间!</div>
829
+              <div class="red w100" *ngIf="(!yyTimeZy||!yyDateZy)&&clickYYZyFlag">请填写预约建单时间!</div>
818
               <div class="red">请您在预约建单时至少在预约检查时间的基础上提前30分钟,以免错过检查!</div>
830
               <div class="red">请您在预约建单时至少在预约检查时间的基础上提前30分钟,以免错过检查!</div>
819
             </nz-form-item>
831
             </nz-form-item>
820
             <!-- 预约建单时间 -->
832
             <!-- 预约建单时间 -->
821
-            <nz-form-item class="yyTime" [ngClass]="{yyTimeError:!yyTime&&clickYYFlag}"
822
-              *ngIf="linkCheckLisTrue&&hasTime&&lessTime&&appointmentBuildFlag === '1'&&allowUrgent==0">
833
+            <nz-form-item class="yyTime" [ngClass]="{yyTimeError:(!yyTime||!yyDate)&&clickYYFlag}"
834
+              *ngIf="currentTasktype.associationType.value === 'inspect'">
823
               <nz-form-label [nzSm]="24" [nzXs]="24">预约建单时间</nz-form-label>
835
               <nz-form-label [nzSm]="24" [nzXs]="24">预约建单时间</nz-form-label>
824
               <nz-form-control [nzSm]="24" [nzXs]="24">
836
               <nz-form-control [nzSm]="24" [nzXs]="24">
825
-                <nz-date-picker [(ngModel)]="date" (ngModelChange)="onChange($event)"></nz-date-picker>
826
-                <nz-time-picker nzFormat="HH:mm" [nzMinuteStep]="30" [nzSecondStep]="60" [(ngModel)]="yyTime"
827
-                  (ngModelChange)="yyTimeChange($event)" [ngModelOptions]="{standalone: true}"
828
-                  [nzDisabledHours]="disabledHours" [nzDisabledMinutes]="disabledMinutes"></nz-time-picker>
829
-                <label *ngIf="yyTime" nz-checkbox [(ngModel)]="nextDay" (ngModelChange)="nextDayChange($event)"
830
-                  class="ml8" [ngModelOptions]="{standalone: true}">次日</label>
837
+                <nz-date-picker [nzDisabled]="!isYyInspect" [(ngModel)]="yyDate" [ngModelOptions]="{standalone: true}"
838
+                  [nzAllowClear]="false" [nzDisabledDate]="disabledyyDate">
839
+                </nz-date-picker>
840
+                <nz-time-picker [nzDisabled]="!isYyInspect" class="ml8" nzFormat="HH:mm" [nzMinuteStep]="30"
841
+                  [nzSecondStep]="60" [(ngModel)]="yyTime" (ngModelChange)="yyTimeChange($event)"
842
+                  [ngModelOptions]="{standalone: true}" [nzDisabledHours]="disabledHours"
843
+                  [nzDisabledMinutes]="disabledMinutes" [nzAllowEmpty]="false">
844
+                </nz-time-picker>
845
+                <button [disabled]="!isYyInspect||(isYyInspect&&!(yyDate&&yyTime))" nz-button nzType="primary"
846
+                  class="ml8" (click)="nextDay()">下一日</button>
831
               </nz-form-control>
847
               </nz-form-control>
832
-              <div class="red w100" *ngIf="!yyTime&&clickYYFlag">请填写预约建单时间!</div>
848
+              <div class="red w100" *ngIf="(!yyTime||!yyDate)&&clickYYFlag">请填写预约建单时间!</div>
833
               <div class="red">请您在预约建单时至少在预约检查时间的基础上提前30分钟,以免错过检查!</div>
849
               <div class="red">请您在预约建单时至少在预约检查时间的基础上提前30分钟,以免错过检查!</div>
834
             </nz-form-item>
850
             </nz-form-item>
835
             <!-- 100009 科室任务类型状态码未配置 -->
851
             <!-- 100009 科室任务类型状态码未配置 -->
@@ -856,7 +872,6 @@
856
             <!-- 100014 (护士端一键建单展示策略)取终点科室和msg 值展示 -->
872
             <!-- 100014 (护士端一键建单展示策略)取终点科室和msg 值展示 -->
857
             <nz-form-item
873
             <nz-form-item
858
               *ngIf="(checkedShowMsg.status!=200)&&(checkedShowMsg.status==100014||checkedShowMsg.status==100015)">
874
               *ngIf="(checkedShowMsg.status!=200)&&(checkedShowMsg.status==100014||checkedShowMsg.status==100015)">
859
-              <!-- <nz-form-item> -->
860
               <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="targetOffice">目标科室</nz-form-label>
875
               <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="targetOffice">目标科室</nz-form-label>
861
               <nz-form-control nzErrorTip="请选择目标科室!">
876
               <nz-form-control nzErrorTip="请选择目标科室!">
862
                 <nz-select class="w100" formControlName="targetOffice" [nzDropdownMatchSelectWidth]="false"
877
                 <nz-select class="w100" formControlName="targetOffice" [nzDropdownMatchSelectWidth]="false"
@@ -889,7 +904,8 @@
889
             <nz-form-item *ngIf="current_allowUrgent">
904
             <nz-form-item *ngIf="current_allowUrgent">
890
               <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="allowUrgent" class="goods">是否加急</nz-form-label>
905
               <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="allowUrgent" class="goods">是否加急</nz-form-label>
891
               <nz-form-control>
906
               <nz-form-control>
892
-                <nz-radio-group [(ngModel)]="allowUrgent" formControlName="allowUrgent">
907
+                <nz-radio-group [(ngModel)]="allowUrgent" (ngModelChange)="allowUrgentChange($event)"
908
+                  formControlName="allowUrgent">
893
                   <label nz-radio nzValue="1">是</label>
909
                   <label nz-radio nzValue="1">是</label>
894
                   <label nz-radio nzValue="0">否</label>
910
                   <label nz-radio nzValue="0">否</label>
895
                 </nz-radio-group>
911
                 </nz-radio-group>
@@ -908,13 +924,9 @@
908
       </div>
924
       </div>
909
     </overlay-scrollbars>
925
     </overlay-scrollbars>
910
     <div class="btns display_flex justify-content_flex-center">
926
     <div class="btns display_flex justify-content_flex-center">
911
-      <button *ngIf="linkCheckLisTrue&&hasTime&&lessTime&&appointmentBuildFlag === '1'&&allowUrgent==0" nz-button
912
-        nzType="primary" [nzLoading]="btnLoading1" (click)="confirmPatient1('patient-yuyue')">预约建单</button>
913
-      <button *ngIf="appointmentZyBuildFlag === '1'&&allowUrgent==0" nz-button nzType="primary"
914
-        [nzLoading]="btnLoading1" (click)="confirmPatient1('patient-zy-yuyue')">预约建单</button>
915
-      <button
916
-        *ngIf="((checkedShowMsg.data&&linkCheckLisTrue)||(!checkedShowMsg.data&&!linkCheckLisTrue))&&((allowUrgent == 1 && urgentReason.trim() !== '')||allowUrgent == 0)"
917
-        nz-button nzType="default" [nzLoading]="btnLoading" (click)="confirmPatient()" class="orderThis">直接建单</button>
927
+      <button nz-button nzType="primary" [nzLoading]="btnLoading1" (click)="confirmPatient1('patient-yuyue')" *ngIf="currentTasktype.associationType.value === 'inspect'&&isYyInspect">预约建单</button>
928
+      <button nz-button nzType="primary" [nzLoading]="btnLoading1" (click)="confirmPatient1('patient-zy-yuyue')" *ngIf="currentTasktype.associationType.value === 'patientTransport'&&isYyInspect">预约建单</button>
929
+      <button nz-button nzType="default" [nzLoading]="btnLoading" (click)="confirmPatient()" class="orderThis" *ngIf="!isYyInspect">直接建单</button>
918
       <button class="btn cancel" nz-button nzType="default" (click)="hidePatientOrder()">取消</button>
930
       <button class="btn cancel" nz-button nzType="default" (click)="hidePatientOrder()">取消</button>
919
     </div>
931
     </div>
920
   </div>
932
   </div>

+ 2 - 1
src/app/views/hushijiandan/hushijiandan.component.less

@@ -9,7 +9,8 @@
9
     flex-direction: column;
9
     flex-direction: column;
10
   }
10
   }
11
   .yyTimeError {
11
   .yyTimeError {
12
-    ::ng-deep .ant-time-picker-input {
12
+    ::ng-deep .ant-time-picker-input,
13
+    ::ng-deep .ant-calendar-picker-input {
13
       border: 1px solid red !important;
14
       border: 1px solid red !important;
14
     }
15
     }
15
   }
16
   }

+ 123 - 127
src/app/views/hushijiandan/hushijiandan.component.ts

@@ -23,7 +23,14 @@ import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
23
 import { ToolService } from "../../services/tool.service";
23
 import { ToolService } from "../../services/tool.service";
24
 import { Subject } from "rxjs";
24
 import { Subject } from "rxjs";
25
 import { debounceTime } from "rxjs/operators";
25
 import { debounceTime } from "rxjs/operators";
26
-import { format, getMinutes, setMinutes, setSeconds, addDays } from "date-fns";
26
+import {
27
+  format,
28
+  getMinutes,
29
+  setMinutes,
30
+  setSeconds,
31
+  addDays,
32
+  differenceInCalendarDays,
33
+} from "date-fns";
27
 // 日期禁用
34
 // 日期禁用
28
 function range(start: number, end: number): number[] {
35
 function range(start: number, end: number): number[] {
29
   const result: number[] = [];
36
   const result: number[] = [];
@@ -83,7 +90,7 @@ export class HushijiandanComponent implements OnInit {
83
   sortableTimer = null;
90
   sortableTimer = null;
84
   searchTabInpSubject = new Subject(); //左侧查患者信息和检查信息防抖
91
   searchTabInpSubject = new Subject(); //左侧查患者信息和检查信息防抖
85
   otherSearchChangeSubject = new Subject(); //其他建单搜索防抖
92
   otherSearchChangeSubject = new Subject(); //其他建单搜索防抖
86
-  timeDefaultValue = setSeconds(new Date(), 0);
93
+  isYyInspect = false; //需要预约检查
87
   constructor(
94
   constructor(
88
     private message: NzMessageService,
95
     private message: NzMessageService,
89
     private fb: FormBuilder,
96
     private fb: FormBuilder,
@@ -231,8 +238,9 @@ export class HushijiandanComponent implements OnInit {
231
   recentInfoNum = 0;
238
   recentInfoNum = 0;
232
   isRemand = true; //自动送回
239
   isRemand = true; //自动送回
233
   yyTime = null; //预约时间-患者列表
240
   yyTime = null; //预约时间-患者列表
234
-  yyTimeInspect = null; //预约时间-检查列表
235
   yyTimeZy = null; //预约时间-患者列表-患者其他服务
241
   yyTimeZy = null; //预约时间-患者列表-患者其他服务
242
+  yyDate = null; //预约日期-陪检
243
+  yyDateZy = null; //预约日期-转运
236
   getRecentInfo(patientCode) {
244
   getRecentInfo(patientCode) {
237
     this.recentInfo = "";
245
     this.recentInfo = "";
238
     clearTimeout(this.recentInfoTimer);
246
     clearTimeout(this.recentInfoTimer);
@@ -693,6 +701,24 @@ export class HushijiandanComponent implements OnInit {
693
     if (!this.deptTaskTypeRules.openInspection) return;
701
     if (!this.deptTaskTypeRules.openInspection) return;
694
     this.searchTabInpSubject.next(e);
702
     this.searchTabInpSubject.next(e);
695
   }
703
   }
704
+  // 下一日(陪检)
705
+  nextDay() {
706
+    this.yyDate = addDays(this.yyDate, 1);
707
+    this.yyTime = addDays(this.yyTime, 1);
708
+  }
709
+  // 下一日(转运)
710
+  nextDayZy() {
711
+    this.yyDateZy = addDays(this.yyDateZy, 1);
712
+    this.yyTimeZy = addDays(this.yyTimeZy, 1);
713
+  }
714
+  // 禁用日期(陪检)
715
+  disabledyyDate = (current: Date): boolean => {
716
+    return differenceInCalendarDays(current, new Date()) < 0;
717
+  };
718
+  // 禁用日期(转运)
719
+  disabledyyDateZy = (current: Date): boolean => {
720
+    return differenceInCalendarDays(current, new Date()) < 0;
721
+  };
696
 
722
 
697
   // 一键建单确认弹框
723
   // 一键建单确认弹框
698
   confirmSub: boolean = false;
724
   confirmSub: boolean = false;
@@ -858,8 +884,6 @@ export class HushijiandanComponent implements OnInit {
858
       if (getMinutes(this.yyTime) != 30) {
884
       if (getMinutes(this.yyTime) != 30) {
859
         this.yyTime = setMinutes(this.yyTime, 0);
885
         this.yyTime = setMinutes(this.yyTime, 0);
860
       }
886
       }
861
-    } else {
862
-      this.nextDay = false;
863
     }
887
     }
864
     this.clickYYFlag = false;
888
     this.clickYYFlag = false;
865
   }
889
   }
@@ -868,8 +892,6 @@ export class HushijiandanComponent implements OnInit {
868
       if (getMinutes(this.yyTimeZy) != 30) {
892
       if (getMinutes(this.yyTimeZy) != 30) {
869
         this.yyTimeZy = setMinutes(this.yyTimeZy, 0);
893
         this.yyTimeZy = setMinutes(this.yyTimeZy, 0);
870
       }
894
       }
871
-    } else {
872
-      this.nextDayZy = false;
873
     }
895
     }
874
     this.clickYYZyFlag = false;
896
     this.clickYYZyFlag = false;
875
   }
897
   }
@@ -878,87 +900,6 @@ export class HushijiandanComponent implements OnInit {
878
     this.clickYYFlag = false;
900
     this.clickYYFlag = false;
879
     this.clickYYZyFlag = false;
901
     this.clickYYZyFlag = false;
880
   }
902
   }
881
-  // 次日-陪检
882
-  nextDay = false;
883
-  nextDayChange(e) {
884
-    if (this.yyTime) {
885
-      if (e) {
886
-        this.yyTime = addDays(this.yyTime, 1);
887
-        this.disabledHours = () => [];
888
-        this.disabledMinutes = (hour) => [];
889
-      } else {
890
-        // this.yyTime = addDays(this.yyTime, -1);
891
-        this.yyTime = null;
892
-        this.disabledHours = () => {
893
-          let now = new Date();
894
-          let nHour = now.getHours();
895
-          let nMinute = now.getMinutes();
896
-          if (nMinute > 30) {
897
-            return range(0, nHour + 1);
898
-          } else {
899
-            return range(0, nHour);
900
-          }
901
-        };
902
-        this.disabledMinutes = (hour) => {
903
-          let now = new Date();
904
-          let nHour = now.getHours();
905
-          let nMinute = now.getMinutes();
906
-          if (hour === nHour || hour === undefined) {
907
-            if (nMinute == 0) {
908
-              return [];
909
-            } else if (nMinute <= 30 && nMinute > 0) {
910
-              return [0];
911
-            } else {
912
-              return [0, 30];
913
-            }
914
-          } else {
915
-            return [];
916
-          }
917
-        };
918
-      }
919
-    }
920
-  }
921
-  // 次日-陪检
922
-  nextDayZy = false;
923
-  nextDayZyChange(e) {
924
-    if (this.yyTimeZy) {
925
-      if (e) {
926
-        this.yyTimeZy = addDays(this.yyTimeZy, 1);
927
-        this.disabledHours = () => [];
928
-        this.disabledMinutes = (hour) => [];
929
-      } else {
930
-        console.log("狗血");
931
-        // this.yyTimeZy = addDays(this.yyTimeZy, -1);
932
-        this.yyTimeZy = null;
933
-        this.disabledHours = () => {
934
-          let now = new Date();
935
-          let nHour = now.getHours();
936
-          let nMinute = now.getMinutes();
937
-          if (nMinute > 30) {
938
-            return range(0, nHour + 1);
939
-          } else {
940
-            return range(0, nHour);
941
-          }
942
-        };
943
-        this.disabledMinutes = (hour) => {
944
-          let now = new Date();
945
-          let nHour = now.getHours();
946
-          let nMinute = now.getMinutes();
947
-          if (hour === nHour || hour === undefined) {
948
-            if (nMinute == 0) {
949
-              return [];
950
-            } else if (nMinute <= 30 && nMinute > 0) {
951
-              return [0];
952
-            } else {
953
-              return [0, 30];
954
-            }
955
-          } else {
956
-            return [];
957
-          }
958
-        };
959
-      }
960
-    }
961
-  }
962
   // 预约建单
903
   // 预约建单
963
   btnLoading1 = false;
904
   btnLoading1 = false;
964
   confirmPatient1(type) {
905
   confirmPatient1(type) {
@@ -988,8 +929,8 @@ export class HushijiandanComponent implements OnInit {
988
     });
929
     });
989
     //预约时间-患者陪检不能为空
930
     //预约时间-患者陪检不能为空
990
     if (
931
     if (
991
-      (!this.yyTime && !flag && yuyue) ||
992
-      (!this.yyTimeZy && flag && yuyue === "patient-zy-yuyue")
932
+      (!this.yyTime && !this.yyDate && !flag && yuyue === "patient-yuyue") ||
933
+      (!this.yyTimeZy && !this.yyDateZy && flag && yuyue === "patient-zy-yuyue")
993
     ) {
934
     ) {
994
       return;
935
       return;
995
     }
936
     }
@@ -1273,11 +1214,10 @@ export class HushijiandanComponent implements OnInit {
1273
   currentTasktype; //当前选中的任务类型对象
1214
   currentTasktype; //当前选中的任务类型对象
1274
   cLoading = false;
1215
   cLoading = false;
1275
   changeCheckedType() {
1216
   changeCheckedType() {
1217
+    this.isYyInspect = false;
1276
     this.linkCheckLisTrue = false;
1218
     this.linkCheckLisTrue = false;
1277
     this.clickYYFlag = false;
1219
     this.clickYYFlag = false;
1278
     this.clickYYZyFlag = false;
1220
     this.clickYYZyFlag = false;
1279
-    this.nextDay = false;
1280
-    this.nextDayZy = false;
1281
     this.currentTasktype = this.checkTypeLis.find(
1221
     this.currentTasktype = this.checkTypeLis.find(
1282
       (item) => item.id == this.patientForm.controls.checkedType.value
1222
       (item) => item.id == this.patientForm.controls.checkedType.value
1283
     );
1223
     );
@@ -1290,6 +1230,17 @@ export class HushijiandanComponent implements OnInit {
1290
     if (appointmentZyBuildFlag.length) {
1230
     if (appointmentZyBuildFlag.length) {
1291
       this.appointmentZyBuildFlag =
1231
       this.appointmentZyBuildFlag =
1292
         appointmentZyBuildFlag[0].appointmentOtherSwitch == 1 ? "1" : "0";
1232
         appointmentZyBuildFlag[0].appointmentOtherSwitch == 1 ? "1" : "0";
1233
+      this.yyDateZy = new Date();
1234
+      this.yyTimeZy = new Date();
1235
+      if (this.yyTimeZy.getMinutes() >= 0 && this.yyTimeZy.getMinutes() <= 30) {
1236
+        this.yyTimeZy.setMinutes(30);
1237
+      } else if (
1238
+        this.yyTimeZy.getMinutes() > 30 &&
1239
+        this.yyTimeZy.getMinutes() < 60
1240
+      ) {
1241
+        this.yyTimeZy.setMinutes(0);
1242
+        this.yyTimeZy.setHours(this.yyTimeZy.getHours() + 1);
1243
+      }
1293
     } else {
1244
     } else {
1294
       this.appointmentZyBuildFlag = "0";
1245
       this.appointmentZyBuildFlag = "0";
1295
     }
1246
     }
@@ -1352,22 +1303,62 @@ export class HushijiandanComponent implements OnInit {
1352
         }
1303
         }
1353
       });
1304
       });
1354
   }
1305
   }
1306
+  // 需要预约建单-事件
1307
+  yyInspectChange(e) {
1308
+    if (this.filterLinkCheckLis.length) {
1309
+      this.showDateTime();
1310
+    } else {
1311
+      this.yyTime = null;
1312
+      this.yyDate = null;
1313
+      console.log(this.isYyInspect);
1314
+    }
1315
+  }
1316
+  //回显时间日期
1317
+  showDateTime() {
1318
+    //当前时间要大于生效时间
1319
+    let isYyInspect = this.filterLinkCheckLis.every((item) => {
1320
+      return (
1321
+        new Date(item.yyTime).getTime() - new Date().getTime() >
1322
+        this.leadTime * 60 * 1000
1323
+      );
1324
+    });
1325
+    //如果勾选需要预约检查
1326
+    if (isYyInspect) {
1327
+      //筛选离当前时间最近的
1328
+      let timeList = this.filterLinkCheckLis
1329
+        .map((item) => new Date(item.yyTime).getTime())
1330
+        .sort();
1331
+      this.yyTime = new Date(timeList[0] - this.leadTime * 60 * 1000); //回显预约时间,需要减去生效时间
1332
+      this.yyDate = new Date(timeList[0] - this.leadTime * 60 * 1000); //回显预约日期,需要减去生效时间
1333
+    } else {
1334
+      this.yyTime = null;
1335
+      this.yyDate = null;
1336
+    }
1337
+  }
1355
   // 患者送检检查项目-选择检查项目
1338
   // 患者送检检查项目-选择检查项目
1356
   linkCheckLisTrue = false; //是否有已选择(患者)
1339
   linkCheckLisTrue = false; //是否有已选择(患者)
1357
   isInspectPriority = false; //选择的检查是否紧急(患者)
1340
   isInspectPriority = false; //选择的检查是否紧急(患者)
1358
-  hasTime = false; //是否有已选择,并且是否有预约时间(患者)
1359
-  lessTime = false; //预约时间列表中预约时间少于生效时长,则是false
1341
+  filterLinkCheckLis = []; //有预约时间并且选中的
1360
   linkCheckLisChange(e) {
1342
   linkCheckLisChange(e) {
1361
     console.log(e, this.linkCheckLis);
1343
     console.log(e, this.linkCheckLis);
1362
     let flag = false; //检查是否紧急
1344
     let flag = false; //检查是否紧急
1363
     this.linkCheckLis.forEach((item) => {
1345
     this.linkCheckLis.forEach((item) => {
1364
-      e.forEach((v) => {
1365
-        if (v.priority == 1) {
1366
-          flag = true;
1367
-        }
1368
-        item.checked = v.value == item.value;
1369
-      });
1346
+      if (e.length) {
1347
+        //有选中的检查
1348
+        e.forEach((v) => {
1349
+          //检查是否有紧急度
1350
+          if (v.priority == 1) {
1351
+            flag = true;
1352
+          }
1353
+          //选中的检查设置checked
1354
+          item.checked = v.value == item.value;
1355
+        });
1356
+      } else {
1357
+        item.checked = false;
1358
+      }
1370
     });
1359
     });
1360
+
1361
+    //检查有紧急度,则加急
1371
     if (flag) {
1362
     if (flag) {
1372
       this.allowUrgent = "1";
1363
       this.allowUrgent = "1";
1373
       this.urgentReason = "系统根据检查信息,自动进行加急";
1364
       this.urgentReason = "系统根据检查信息,自动进行加急";
@@ -1376,40 +1367,45 @@ export class HushijiandanComponent implements OnInit {
1376
       this.urgentReason = "";
1367
       this.urgentReason = "";
1377
     }
1368
     }
1378
     this.clickYYFlag = false;
1369
     this.clickYYFlag = false;
1379
-    let linkCheckLis = this.linkCheckLis.filter(
1370
+    // 有预约时间并且选中的
1371
+    this.filterLinkCheckLis = this.linkCheckLis.filter(
1380
       (item) => Boolean(item.yyTime) && item.checked
1372
       (item) => Boolean(item.yyTime) && item.checked
1381
     );
1373
     );
1382
-    this.lessTime = linkCheckLis.every((item) => {
1383
-      return (
1384
-        new Date(item.yyTime).getTime() - new Date().getTime() >
1385
-        this.leadTime * 60 * 1000
1386
-      );
1387
-    });
1388
-    //回显预约时间2021年5月10日
1389
-    if (this.lessTime && linkCheckLis.length) {
1390
-      let timeList = linkCheckLis
1391
-        .map((item) => new Date(item.yyTime).getTime())
1392
-        .sort();
1393
-      this.yyTime = new Date(timeList[0] - this.leadTime * 60 * 1000);
1374
+    //有预约时间并且选中的检查数组不为空
1375
+    if (this.filterLinkCheckLis.length) {
1376
+      //当前时间要大于生效时间
1377
+      this.isYyInspect = this.filterLinkCheckLis.every((item) => {
1378
+        return (
1379
+          new Date(item.yyTime).getTime() - new Date().getTime() >
1380
+          this.leadTime * 60 * 1000
1381
+        );
1382
+      });
1383
+      this.showDateTime();
1384
+    } else {
1385
+      //有预约时间并且选中的检查数组为空
1386
+      this.isYyInspect = false;
1387
+      this.yyTime = null;
1388
+      this.yyDate = null;
1394
     }
1389
     }
1395
     this.linkCheckLisTrue = e.length > 0;
1390
     this.linkCheckLisTrue = e.length > 0;
1396
     this.isInspectPriority = e.some((item) => item.priority == 1);
1391
     this.isInspectPriority = e.some((item) => item.priority == 1);
1397
-    if (!this.linkCheckLisTrue) {
1398
-      this.hasTime = false;
1392
+  }
1393
+  // 是否加急
1394
+  allowUrgentChange(e) {
1395
+    if (this.isYyInspect) {
1396
+      this.isYyInspect = e == 0;
1397
+      if (!this.isYyInspect) {
1398
+        this.yyDate = null;
1399
+        this.yyDateZy = null;
1400
+        this.yyTime = null;
1401
+        this.yyTimeZy = null;
1402
+      }
1399
     } else {
1403
     } else {
1400
-      this.hasTime = this.linkCheckLis.some(
1401
-        (item) => Boolean(item.yyTime) && item.checked
1402
-      );
1404
+      this.yyDate = null;
1405
+      this.yyDateZy = null;
1406
+      this.yyTime = null;
1407
+      this.yyTimeZy = null;
1403
     }
1408
     }
1404
-    console.log(
1405
-      this.linkCheckLisTrue,
1406
-      this.hasTime,
1407
-      this.lessTime,
1408
-      this.appointmentBuildFlag,
1409
-      this.allowUrgent,
1410
-      this.isInspectPriority,
1411
-      this.checkedShowMsg
1412
-    );
1413
   }
1409
   }
1414
   // 禁用小时
1410
   // 禁用小时
1415
   disabledHours(): number[] {
1411
   disabledHours(): number[] {