seimin преди 1 година
родител
ревизия
bf41b45a87

+ 4 - 2
src/app/share/dialog-delete/dialog-delete.component.html

@@ -5,6 +5,7 @@
5 5
     <div class="content">
6 6
       <div class="icon"><i class="icon_transport transport-wenhao"></i></div>
7 7
       <div class="defeat" [innerHTML]="content | htmlTransform"></div>
8
+      <div class="defeat" [innerHTML]="isShowConfirmInfo" *ngIf="isShowConfirmInfo"></div>
8 9
       <div class="tips red" *ngIf="tips">({{tips}})</div>
9 10
       <div *ngIf="isChecked">
10 11
         <label nz-checkbox [(ngModel)]="isRemandClean" [ngModelOptions]="{ standalone: true }">是否同步建立手术清洁任务工单</label>
@@ -22,8 +23,9 @@
22 23
       </div>
23 24
     </div>
24 25
     <div class="operate">
25
-      <button nz-button nzType="primary" (click)="confirmDel()" [nzLoading]="btnLoading">{{confirmTxt}}</button>
26
-      <button class="btn cancel ml8" nz-button nzType="default" (click)="cancel(cancelTxt=='否'?'no':'cancel')" [nzLoading]="cancenlLoading">{{cancelTxt}}</button>
26
+      <button nz-button nzType="primary" (click)="cancel('cancel')" *ngIf="isShowConfirmInfo">知道了</button>
27
+      <button nz-button nzType="primary" (click)="confirmDel()" [nzLoading]="btnLoading" *ngIf="isShowConfirm">{{confirmTxt}}</button>
28
+      <button *ngIf="!isShowConfirmInfo" class="btn cancel ml8" nz-button nzType="default" (click)="cancel(cancelTxt=='否'?'no':'cancel')" [nzLoading]="cancenlLoading">{{cancelTxt}}</button>
27 29
     </div>
28 30
   </div>
29 31
 </div>

+ 2 - 0
src/app/share/dialog-delete/dialog-delete.component.ts

@@ -20,6 +20,8 @@ export class DialogDeleteComponent implements OnInit, OnChanges {
20 20
   @Input() isSelected: boolean = false;
21 21
   @Input() isSelectedArr: any[] = [];
22 22
   @Input() deptDisplay: number = 0;
23
+  @Input() isShowConfirm: boolean = true;
24
+  @Input() isShowConfirmInfo: string = '';
23 25
   constructor(private message: NzMessageService) {}
24 26
 
25 27
   isRemandClean:boolean = true;

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

@@ -3799,4 +3799,4 @@
3799 3799
 
3800 3800
 <!-- 是否限制业务发起时间模态框 -->
3801 3801
 <app-dialog-delete [delModal]="limitTimeModal" (hideDelModalEvent)="hideLimitTimeModal()" [btnLoading]="limitTimeLoading"
3802
-(confirmDelEvent)="confirmLimitTime()" [content]="limitTimeInfo" confirmTxt="继续建单"></app-dialog-delete>
3802
+(confirmDelEvent)="confirmLimitTime()" [content]="limitTimeInfo" confirmTxt="继续建单" [isShowConfirm]="isShowConfirm" [isShowConfirmInfo]="isShowConfirmInfo"></app-dialog-delete>

+ 24 - 13
src/app/views/hushijiandan/hushijiandan.component.ts

@@ -1609,7 +1609,7 @@ export class HushijiandanComponent implements OnInit {
1609 1609
     }
1610 1610
     this.btnLoading3 = true;
1611 1611
     this.confirmPostData.workOrder.isAccompany = 0; //是否需要医护陪同检查
1612
-    this.newOrderTimeFun(this.confirmPostData.workOrder.taskType.id, () => {
1612
+    this.newOrderTimeFun(this.confirmPostData.workOrder, () => {
1613 1613
       this.btnLoading3 = false;
1614 1614
       this.cancel();
1615 1615
     }, () => {
@@ -2159,7 +2159,7 @@ export class HushijiandanComponent implements OnInit {
2159 2159
         }
2160 2160
       }
2161 2161
       postData.workOrder.isAccompany = 0; //是否需要医护陪同检查
2162
-      this.newOrderTimeFun(postData.workOrder.taskType.id, () => {
2162
+      this.newOrderTimeFun(postData.workOrder, () => {
2163 2163
         this.hidePatientOrder();
2164 2164
       }, () => {
2165 2165
         this.mainService
@@ -2215,7 +2215,7 @@ export class HushijiandanComponent implements OnInit {
2215 2215
     this.accompanyLoading = true;
2216 2216
     if (this.accompanyType == "patient") {
2217 2217
       //患者列表直接建单
2218
-      this.newOrderTimeFun(this.accompanyPostData.workOrder.taskType.id, () => {
2218
+      this.newOrderTimeFun(this.accompanyPostData.workOrder, () => {
2219 2219
         this.hidePatientOrder();
2220 2220
         this.accompanyModal = false;
2221 2221
         this.accompanyLoading = false;
@@ -2265,7 +2265,7 @@ export class HushijiandanComponent implements OnInit {
2265 2265
       })
2266 2266
     } else if (this.accompanyType == "patient-yy") {
2267 2267
       //患者列表预约建单
2268
-      this.newOrderTimeFun(this.accompanyPostData.workOrder.taskType.id, () => {
2268
+      this.newOrderTimeFun(this.accompanyPostData.workOrder, () => {
2269 2269
         this.btnLoading3 = false;
2270 2270
         this.accompanyModal = false;
2271 2271
         this.accompanyLoading = false;
@@ -2329,7 +2329,7 @@ export class HushijiandanComponent implements OnInit {
2329 2329
     this.cancenlLoading = true;
2330 2330
     if (this.accompanyType == "patient") {
2331 2331
       //患者列表直接建单
2332
-      this.newOrderTimeFun(this.accompanyPostData.workOrder.taskType.id, () => {
2332
+      this.newOrderTimeFun(this.accompanyPostData.workOrder, () => {
2333 2333
         this.hidePatientOrder();
2334 2334
         this.accompanyModal = false;
2335 2335
         this.cancenlLoading = false;
@@ -2379,7 +2379,7 @@ export class HushijiandanComponent implements OnInit {
2379 2379
       })
2380 2380
     } else if (this.accompanyType == "patient-yy") {
2381 2381
       //患者列表预约建单
2382
-      this.newOrderTimeFun(this.accompanyPostData.workOrder.taskType.id, () => {
2382
+      this.newOrderTimeFun(this.accompanyPostData.workOrder, () => {
2383 2383
         this.btnLoading3 = false;
2384 2384
         this.accompanyModal = false;
2385 2385
         this.cancenlLoading = false;
@@ -2866,7 +2866,7 @@ export class HushijiandanComponent implements OnInit {
2866 2866
       }
2867 2867
     }
2868 2868
     console.log(postData);
2869
-    this.newOrderTimeFun(postData.workOrder.taskType.id, () => {
2869
+    this.newOrderTimeFun(postData.workOrder, () => {
2870 2870
       that.loading5 = false;
2871 2871
     }, () => {
2872 2872
       that.mainService
@@ -2903,6 +2903,7 @@ export class HushijiandanComponent implements OnInit {
2903 2903
   // 打开一键发起建单模态框,urgent为true的时候是紧急
2904 2904
   historyCustomRemarks1 = [];
2905 2905
   newShortcutOrder1(msg, type, urgent?) {
2906
+    this.btnLoading = false;
2906 2907
     this.workOrderRemark1 = "";
2907 2908
     this.customRemarks1 = [];
2908 2909
     this.historyCustomRemarks1 = [];
@@ -2979,22 +2980,32 @@ export class HushijiandanComponent implements OnInit {
2979 2980
     }
2980 2981
   };
2981 2982
   // 建单判断时间-护士端建单通用方法
2982
-  newOrderTimeFun(taskTypeId, fun1, fun2){
2983
+  isShowConfirm:boolean = true;
2984
+  isShowConfirmInfo:string = '';
2985
+  newOrderTimeFun(order, fun1, fun2){
2983 2986
     if(this.currentDept.typeValue != 'recovery' && this.currentDept.typeValue != 'surgery'){
2987
+      let taskTypeId = order.taskType.id;
2988
+      let deptId = order.createDept;
2984 2989
       let maskFlag = this.message.loading("正在加载中..", {
2985 2990
         nzDuration: 0,
2986 2991
       }).messageId;
2987 2992
       this.mainService
2988
-      .postCustom("api", "compareReserveDate", {taskTypeId})
2993
+      .postCustom("api", "compareWorkTime", {taskTypeId, deptId})
2989 2994
       .subscribe((data) => {
2990 2995
         this.message.remove(maskFlag);
2991
-        if(!data.data){
2996
+        if(data.state == 200){
2992 2997
           fun2.call(this);
2993 2998
         }else{
2994 2999
           fun1.call(this);
2995 3000
           this.limitTimeModal = true;
2996 3001
           this.limitTimeItem = {taskTypeId, fun1, fun2};
2997
-          this.limitTimeInfo = data.data;
3002
+          this.limitTimeInfo = data.data.remark;
3003
+          this.isShowConfirm = data.data.limitType == 1;
3004
+          if(this.isShowConfirm){
3005
+            this.isShowConfirmInfo = '';
3006
+          }else{
3007
+            this.isShowConfirmInfo = '请在规定时间内下单';
3008
+          }
2998 3009
         }
2999 3010
       })
3000 3011
     }else{
@@ -3043,7 +3054,7 @@ export class HushijiandanComponent implements OnInit {
3043 3054
       };
3044 3055
     }
3045 3056
     console.log(postData);
3046
-    this.newOrderTimeFun(postData.workOrder.taskType.id, () => {
3057
+    this.newOrderTimeFun(postData.workOrder, () => {
3047 3058
       this.hideShortcutOrder();
3048 3059
     }, () => {
3049 3060
       that.mainService
@@ -3092,7 +3103,7 @@ export class HushijiandanComponent implements OnInit {
3092 3103
   confirmRepeat() {
3093 3104
     this.loadingRepeat = true;
3094 3105
     this.repeatPostData.tipsCreateOder = 1;
3095
-    this.newOrderTimeFun(this.repeatPostData.workOrder.taskType.id, () => {
3106
+    this.newOrderTimeFun(this.repeatPostData.workOrder, () => {
3096 3107
       this.loadingRepeat = false;
3097 3108
       this.repeatModal = false;
3098 3109
     }, () => {

+ 14 - 0
src/app/views/limit-initiation-time/limit-initiation-time-routing.module.ts

@@ -0,0 +1,14 @@
1
+import { NgModule } from '@angular/core';
2
+import { Routes, RouterModule } from '@angular/router';
3
+import { LimitInitiationTimeComponent } from './limit-initiation-time.component';
4
+
5
+
6
+const routes: Routes = [
7
+  { path: '', component: LimitInitiationTimeComponent }
8
+];
9
+
10
+@NgModule({
11
+  imports: [RouterModule.forChild(routes)],
12
+  exports: [RouterModule]
13
+})
14
+export class LimitInitiationTimeRoutingModule { }

+ 149 - 0
src/app/views/limit-initiation-time/limit-initiation-time.component.html

@@ -0,0 +1,149 @@
1
+<div class="list-template">
2
+  <div class="list-template__content">
3
+    <div class="list-template__top" nz-row>
4
+      <div nz-col nzXl='18' class="list-template__searchBox"></div>
5
+      <div nz-col nzLg="6" class="list-template__btns">
6
+        <button nz-button *ngIf="coopBtns.add" class="btn default" (click)="addModal()">新增</button>
7
+      </div>
8
+    </div>
9
+    <div class="list-template__bottom">
10
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
11
+        [nzLoading]="loading1">
12
+        <thead>
13
+          <tr class="thead">
14
+            <th nzWidth="5%">序号</th>
15
+            <th nzWidth="10%">任务类型</th>
16
+            <th nzWidth="10%">是否限制所有科室</th>
17
+            <th nzWidth="10%">楼栋名称</th>
18
+            <th nzWidth="10%">科室名称</th>
19
+            <th nzWidth="10%">限制方式</th>
20
+            <th nzWidth="10%">时间限制</th>
21
+            <th nzWidth="10%">提示备注</th>
22
+            <th nzWidth="25%">操作</th>
23
+          </tr>
24
+        </thead>
25
+        <tbody>
26
+          <tr *ngFor="let data of listOfData;let index = index">
27
+            <td>{{index+(pageIndex-1) * pageSize + 1}}</td>
28
+            <td>{{data.taskTypeDTO ? data.taskTypeDTO.taskName : '-'}}</td>
29
+            <td>{{data.limitAllDept == 1 ? '是' : '否'}}</td>
30
+            <td>{{data.buildingListNames || '-'}}</td>
31
+            <td>{{data.deptListNames || '-'}}</td>
32
+            <td>{{data.limitType == 1 ? '仅提示允许建单' : (data.limitType == 2 ? '提示不允许建单' : '-')}}</td>
33
+            <td>{{data.startTime | date: 'HH:mm'}} ~ {{data.endTime | date: 'HH:mm'}}</td>
34
+            <td>{{data.remark || '-'}}</td>
35
+            <td>
36
+              <div class="coop">
37
+                <span *ngIf="coopBtns.del&&!data.status" (click)="showDelModal(data,'您确认要删除此方案吗?','删除','del')">删除</span>
38
+                <span *ngIf="coopBtns.edit" (click)="edit(data)">编辑</span>
39
+              </div>
40
+            </td>
41
+          </tr>
42
+        </tbody>
43
+      </nz-table>
44
+      <div class="list-template__pagination">
45
+        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize"
46
+          (nzPageIndexChange)="getList(0)" (nzPageSizeChange)="getList(0)">
47
+        </nz-pagination>
48
+      </div>
49
+    </div>
50
+  </div>
51
+
52
+  <!-- 新增/编辑/复制模态框 -->
53
+  <div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modal">
54
+    <div class="modalBody">
55
+      <div class="title">{{modelName}}<i class="icon_transport transport-guanbi" (click)="hideAddModal()"></i></div>
56
+      <div class="content">
57
+        <form nz-form [formGroup]="validateForm" class="addForm">
58
+          <nz-form-item>
59
+            <nz-form-label [nzSpan]="24" nzRequired nzFor="taskType">任务类型</nz-form-label>
60
+            <nz-form-control nzErrorTip="请选择任务类型!">
61
+              <nz-select class="formItem" (nzOnSearch)="changeInp($event, 'taskType')" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzPlaceHolder="请选择任务类型" formControlName="taskType" (nzOpenChange)="getTaskTypeList($event)">
62
+                <ng-container *ngFor="let option of taskTypeList">
63
+                  <nz-option *ngIf="!isLoading" [nzLabel]="option.taskName" [nzValue]="option.id"></nz-option>
64
+                </ng-container>
65
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
66
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
67
+                </nz-option>
68
+              </nz-select>
69
+            </nz-form-control>
70
+          </nz-form-item>
71
+          <nz-form-item>
72
+            <nz-form-label [nzSpan]="8" nzRequired nzFor="limitAllDept">是否限制所有科室</nz-form-label>
73
+            <nz-form-control [nzSpan]="16" nzErrorTip="请选择是否限制所有科室!">
74
+              <nz-radio-group formControlName="limitAllDept" (ngModelChange)="changeLimitAllDept($event)">
75
+                <label nz-radio [nzValue]="1">是</label>
76
+                <label nz-radio [nzValue]="0">否</label>
77
+              </nz-radio-group>
78
+            </nz-form-control>
79
+          </nz-form-item>
80
+          <nz-form-item *ngIf="validateForm.value.limitAllDept === 0">
81
+            <nz-form-label [nzSpan]="24" nzFor="buildingIds">楼栋名称</nz-form-label>
82
+            <nz-form-control nzErrorTip="请选择楼栋名称!">
83
+              <nz-select nzMode="multiple" class="formItem" (nzOnSearch)="changeInp($event, 'building')" [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch nzPlaceHolder="请选择楼栋名称" formControlName="buildingIds" (nzOpenChange)="getBuildingList($event)">
84
+                <ng-container *ngFor="let option of buildingList">
85
+                  <nz-option *ngIf="!isLoading" [nzLabel]="option.buildingName" [nzValue]="option.id"></nz-option>
86
+                </ng-container>
87
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
88
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
89
+                </nz-option>
90
+              </nz-select>
91
+            </nz-form-control>
92
+          </nz-form-item>
93
+          <nz-form-item *ngIf="validateForm.value.limitAllDept === 0">
94
+            <nz-form-label [nzSpan]="24" nzFor="deptIds">科室名称</nz-form-label>
95
+            <nz-form-control nzErrorTip="请选择科室名称!">
96
+              <nz-select nzMode="multiple" class="formItem" (nzOnSearch)="changeInp($event, 'department')" [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch nzPlaceHolder="请选择科室名称" formControlName="deptIds" (nzOpenChange)="getDepartmentList($event)">
97
+                <ng-container *ngFor="let option of departmentList">
98
+                  <nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
99
+                </ng-container>
100
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
101
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
102
+                </nz-option>
103
+              </nz-select>
104
+            </nz-form-control>
105
+          </nz-form-item>
106
+          <nz-form-item>
107
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="limitType">限制方式</nz-form-label>
108
+            <nz-form-control [nzSpan]="19" nzErrorTip="请选择限制方式!">
109
+              <nz-radio-group formControlName="limitType">
110
+                <label nz-radio [nzValue]="1">仅提示允许建单</label>
111
+                <label nz-radio [nzValue]="2">提示不允许建单</label>
112
+              </nz-radio-group>
113
+            </nz-form-control>
114
+          </nz-form-item>
115
+          <nz-form-item>
116
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="limitType">时间限制</nz-form-label>
117
+            <nz-form-control [nzSpan]="19" nzErrorTip="请选择时间限制!">
118
+              <nz-time-picker nzFormat="HH:mm" formControlName="startTime" [nzDisabledHours]="startTimeHourdis" [nzDisabledMinutes]="startTimeMindis" (nzOpenChange)="timeChange($event,'startTime')">
119
+            </nz-time-picker>
120
+            -
121
+            <nz-time-picker nzFormat="HH:mm" formControlName="endTime" [nzDisabledHours]="endTimeHourdis" [nzDisabledMinutes]="endTimeMindis" (nzOpenChange)="timeChange($event,'endTime')"></nz-time-picker>
122
+            </nz-form-control>
123
+            <div style="text-align: left;color: red;" *ngIf="(validateForm.value.startTime||validateForm.value.endTime)&&!(validateForm.value.startTime&&validateForm.value.endTime)">请选择完整的时间限制</div>
124
+          </nz-form-item>
125
+          <nz-form-item>
126
+            <nz-form-label [nzSpan]="24" nzRequired nzFor="remark">提示备注</nz-form-label>
127
+            <nz-form-control nzErrorTip="请输入提示备注!">
128
+              <nz-input-group>
129
+                <input nz-input formControlName="remark" placeholder="请输入提示备注" />
130
+              </nz-input-group>
131
+            </nz-form-control>
132
+          </nz-form-item>
133
+        </form>
134
+      </div>
135
+      <div class=" display_flex justify-content_flex-center">
136
+        <button nzType="primary" nz-button (click)="submitForm()" [nzLoading]="btnLoading">确认</button>
137
+        <button class="btn cancel" nz-button nzType="default" (click)="hideAddModal()">取消</button>
138
+      </div>
139
+    </div>
140
+  </div>
141
+  <!-- 删除模态框 -->
142
+  <app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
143
+    (confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
144
+</div>
145
+<!-- 操作成功/失败提示框 -->
146
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
147
+  [info]="promptInfo">
148
+</app-prompt-modal>
149
+

+ 167 - 0
src/app/views/limit-initiation-time/limit-initiation-time.component.less

@@ -0,0 +1,167 @@
1
+@import "../../../../src/theme.less";
2
+
3
+:host {
4
+  ::ng-deep .ant-calendar-picker {
5
+    width: 100% !important;
6
+  }
7
+}
8
+.save {
9
+  position: fixed;
10
+  left: 0;
11
+  top: 0;
12
+  width: 100%;
13
+  height: 100%;
14
+  background: rgba(0, 0, 0, 0.4);
15
+  z-index: 99;
16
+
17
+  .modalBody {
18
+    width: 350px;
19
+    background: #fff;
20
+    border-radius: 5px;
21
+    padding: 10px 20px;
22
+    color: #333;
23
+
24
+    .title {
25
+      width: 100%;
26
+      text-align: center;
27
+      font-size: 18px;
28
+      position: relative;
29
+
30
+      i {
31
+        position: absolute;
32
+        right: 0;
33
+        top: 0;
34
+        font-size: 20px;
35
+        color: #666;
36
+        cursor: pointer;
37
+        padding: 0 5px;
38
+      }
39
+    }
40
+
41
+    .content {
42
+      width: 310px;
43
+      background: #f9fafb;
44
+      border: 1px solid #e5e9ed;
45
+      border-radius: 5px;
46
+      overflow: hidden;
47
+      margin-top: 12px;
48
+      padding: 16px 0;
49
+
50
+      & > div {
51
+        text-align: center;
52
+        margin: 0;
53
+
54
+        &.icon {
55
+          // margin-top: 17px;
56
+
57
+          i {
58
+            color: #34b349;
59
+            font-size: 30px !important;
60
+
61
+            &.transport-wenhao {
62
+              color: #f5a523;
63
+            }
64
+
65
+            &.transport-shibai {
66
+              color: #ff3a52;
67
+            }
68
+          }
69
+        }
70
+
71
+        &.defeat {
72
+          color: #333;
73
+          font-size: 14px;
74
+        }
75
+
76
+        &:nth-child(3) {
77
+          font-size: 14px;
78
+          color: #666;
79
+        }
80
+      }
81
+      .workAssignmentTips {
82
+        font-size: 12px;
83
+      }
84
+    }
85
+
86
+    button {
87
+      margin-top: 10px;
88
+
89
+      &.btn {
90
+        margin-left: 8px;
91
+      }
92
+    }
93
+  }
94
+
95
+  // 新增
96
+  &.add {
97
+    .modalBody {
98
+      width: 480px;
99
+      height: auto;
100
+
101
+      .content {
102
+        width: 100%;
103
+        height: auto;
104
+        padding: 16px;
105
+        max-height: 497px;
106
+        overflow-y: auto;
107
+
108
+        .addForm {
109
+          .workAssignmentDescribe {
110
+            margin-top: 8px;
111
+          }
112
+          .ant-form-item {
113
+            margin-bottom: 0;
114
+
115
+            .ant-form-item-label {
116
+              text-align: left;
117
+            }
118
+
119
+            .desc {
120
+              margin-top: 5px;
121
+            }
122
+          }
123
+
124
+          .datesControl {
125
+            margin-top: -16px;
126
+
127
+            .ant-form-item-label {
128
+              line-height: 40px;
129
+            }
130
+          }
131
+
132
+          .timer {
133
+            .ant-form-item-label {
134
+              width: 100%;
135
+              text-align: left;
136
+            }
137
+
138
+            .numInp {
139
+              margin-right: 5px;
140
+            }
141
+
142
+            .line {
143
+              margin-right: 5px;
144
+            }
145
+          }
146
+
147
+          .timer2 {
148
+            .ant-form-item-label {
149
+              line-height: 20px;
150
+            }
151
+          }
152
+        }
153
+
154
+        .editForm {
155
+          .ant-form-item {
156
+            margin-bottom: 15px;
157
+
158
+            .ant-form-item-label {
159
+              line-height: 14px;
160
+              text-align: left;
161
+            }
162
+          }
163
+        }
164
+      }
165
+    }
166
+  }
167
+}

+ 416 - 0
src/app/views/limit-initiation-time/limit-initiation-time.component.ts

@@ -0,0 +1,416 @@
1
+import { Component, OnInit } from "@angular/core";
2
+import { ActivatedRoute } from "@angular/router";
3
+import { FormBuilder, Validators, FormGroup } from "@angular/forms";
4
+
5
+import { ToolService } from "../../services/tool.service";
6
+import { LimitInitiationTimeService } from './limit-initiation-time.service';
7
+import { Subject } from 'rxjs';
8
+import { debounceTime } from 'rxjs/operators';
9
+import { format, startOfMinute, endOfMinute } from 'date-fns';
10
+import { NzMessageService } from 'ng-zorro-antd/message';
11
+@Component({
12
+  selector: "app-limit-initiation-time",
13
+  templateUrl: "./limit-initiation-time.component.html",
14
+  styleUrls: ["./limit-initiation-time.component.less"],
15
+})
16
+export class LimitInitiationTimeComponent implements OnInit {
17
+  constructor(
18
+    private fb: FormBuilder,
19
+    private limitInitiationTimeService: LimitInitiationTimeService,
20
+    private route: ActivatedRoute,
21
+    private tool: ToolService,
22
+    private message: NzMessageService,
23
+  ) {}
24
+
25
+  userInfo: any = JSON.parse(localStorage.getItem("user")) || {}; //登录用户信息
26
+  listOfData: any[] = []; //表格数据
27
+  pageIndex: number = 1; //表格当前页码
28
+  pageSize: number = 10; //表格每页展示条数
29
+  listLength: number = 10; //表格总数据量
30
+  tableHeight: number; //表格动态高
31
+  modal: boolean = false; //新增/编辑模态框
32
+  add: boolean; //true:新增;false:编辑
33
+  validateForm: FormGroup; //新增/编辑表单
34
+  coopId: any; //当前操作列
35
+  currentHospital; //当前院区
36
+
37
+  btnLoading: boolean = false; //提交按钮loading状态
38
+
39
+  promptContent: string; //操作提示框提示信息
40
+  ifSuccess: boolean; //操作成功/失败
41
+  promptInfo: string; //操作结果提示信息
42
+  promptModalShow: boolean; //操作提示框是否展示
43
+  modelName = ""; //模态框名称
44
+
45
+  changeInpSubject = new Subject(); //防抖
46
+
47
+  ngOnInit() {
48
+    //防抖
49
+    this.changeInpSubject.pipe(debounceTime(500)).subscribe((v) => {
50
+      if(v[1] === 'taskType'){
51
+        this.getTaskTypeList(true, v[0]);
52
+      }else if(v[1] === 'building'){
53
+        this.getBuildingList(true, v[0]);
54
+      }else if(v[1] === 'department'){
55
+        this.getDepartmentList(true, v[0]);
56
+      }
57
+    });
58
+    this.currentHospital = this.tool.getCurrentHospital();
59
+    this.coopBtns = this.tool.initCoopBtns(this.route);
60
+    this.initForm();
61
+    this.getList(1);
62
+  }
63
+
64
+  // 初始化增删改按钮
65
+  coopBtns: any = {};
66
+
67
+  // 表格数据
68
+  loading1 = false;
69
+  getList(type) {
70
+    if (type == 1) {
71
+      this.pageIndex = 1;
72
+    }
73
+    let data = {
74
+      idx: this.pageIndex - 1,
75
+      sum: this.pageSize,
76
+      workTimeRule: {
77
+        hosId: this.currentHospital.id,
78
+      },
79
+    };
80
+    this.loading1 = true;
81
+    this.limitInitiationTimeService
82
+      .getFetchDataList(data)
83
+      .subscribe((data) => {
84
+        this.loading1 = false;
85
+        if (data.status == 200) {
86
+          this.listOfData = data.list;
87
+          this.listLength = data.totalNum;
88
+        }
89
+      });
90
+  }
91
+
92
+  //打开查询任务类型下拉框
93
+  isLoading:boolean = false;
94
+  taskTypeList:any[] = [];
95
+  getTaskTypeList(flag, keyWord = '') {
96
+    if (flag) {
97
+      let postData = {
98
+        idx: 0,
99
+        sum: 9999,
100
+        taskType: {
101
+          simpleQuery: true,
102
+          taskName: keyWord,
103
+          hosId: {
104
+            id: this.currentHospital.id,
105
+          },
106
+        }
107
+      };
108
+      this.isLoading = true;
109
+      this.limitInitiationTimeService
110
+      .getTaskTypes(postData)
111
+      .subscribe((data) => {
112
+        this.isLoading = false;
113
+        if (data.status == 200) {
114
+          this.taskTypeList = data.list;
115
+        }
116
+      });
117
+    }
118
+  }
119
+
120
+  //打开查询楼栋下拉框
121
+  buildingList:any[] = [];
122
+  getBuildingList(flag, keyWord = '') {
123
+    if (flag) {
124
+      let postData = {
125
+        idx: 0,
126
+        sum: 9999,
127
+        building: {
128
+          simpleQuery: true,
129
+          buildingName: keyWord,
130
+          hosId: this.currentHospital.id,
131
+        }
132
+      };
133
+      this.isLoading = true;
134
+      this.limitInitiationTimeService
135
+      .getBuildings(postData)
136
+      .subscribe((data) => {
137
+        this.isLoading = false;
138
+        if (data.status == 200) {
139
+          this.buildingList = data.list;
140
+        }
141
+      });
142
+    }
143
+  }
144
+
145
+  //打开查询科室下拉框
146
+  departmentList:any[] = [];
147
+  getDepartmentList(flag, keyWord = '') {
148
+    if (flag) {
149
+      let postData = {
150
+        idx: 0,
151
+        sum: 9999,
152
+        department: {
153
+          searchType: 1,// 简单查询
154
+          dept: keyWord,
155
+          hospital: {
156
+            id: this.currentHospital.id,
157
+          },
158
+        }
159
+      };
160
+      this.isLoading = true;
161
+      this.limitInitiationTimeService
162
+      .getDepartments(postData)
163
+      .subscribe((data) => {
164
+        this.isLoading = false;
165
+        if (data.status == 200) {
166
+          this.departmentList = data.list;
167
+        }
168
+      });
169
+    }
170
+  }
171
+
172
+  //搜索
173
+  changeInp(e, type) {
174
+    this.isLoading = true;
175
+    this.changeInpSubject.next([e, type]);
176
+  }
177
+
178
+  // 新增弹框
179
+  addModal() {
180
+    this.modelName = "新增";
181
+    this.add = true; //新增
182
+    this.modal = true;
183
+    this.initForm();
184
+  }
185
+  //关闭新增/编辑弹框
186
+  hideAddModal() {
187
+    this.modal = false;
188
+    this.initForm();
189
+  }
190
+
191
+  //服务时间选择
192
+  // 禁用的小时
193
+  startTimeHourdis() {
194
+    return [];
195
+  }
196
+  endTimeHourdis() {
197
+    return [];
198
+  }
199
+
200
+  // 禁用的分钟
201
+  startTimeMindis() {
202
+    return [];
203
+  }
204
+  endTimeMindis() {
205
+    return [];
206
+  }
207
+
208
+  timeChange(e: boolean, type: string) {
209
+    if (!e && this.validateForm.value[type]) {
210
+      let hour = new Date(this.validateForm.value[type]).getHours();
211
+      // let minute = new Date(this.validateForm.value[type]).getMinutes();
212
+      if (type == "startTime") {
213
+        this.endTimeHourdis = () => this.generateArray(0, hour);
214
+        // this.endTimeMindis = () => this.generateArray(0, minute + 1);
215
+      } else if (type == "endTime") {
216
+        this.startTimeHourdis = () => this.generateArray(hour + 1, 24);
217
+        // this.startTimeMindis = () => this.generateArray(minute, 60);
218
+      }
219
+    }
220
+  }
221
+
222
+  /**
223
+   * 生成一个从 start 到 end 的连续数组
224
+   * @param start
225
+   * @param end
226
+   */
227
+  generateArray(start, end) {
228
+    return Array.from(new Array(end).keys()).slice(start);
229
+  }
230
+
231
+  // 初始化新增form表单
232
+  initForm() {
233
+    this.endTimeHourdis = () => [];
234
+    this.endTimeMindis = () => [];
235
+    this.startTimeHourdis = () => [];
236
+    this.startTimeMindis = () => [];
237
+    this.validateForm = this.fb.group({
238
+      taskType: [null, [Validators.required]],
239
+      limitAllDept: [1, [Validators.required]],
240
+      buildingIds: [[]],
241
+      deptIds: [[]],
242
+      limitType: [1, [Validators.required]],
243
+      startTime: [null],
244
+      endTime: [null],
245
+      remark: ['', [Validators.required]],
246
+    });
247
+  }
248
+
249
+  // 修改是否限制所有科室
250
+  changeLimitAllDept(e){
251
+    this.validateForm.controls.buildingIds.setValue([]);
252
+    this.validateForm.controls.deptIds.setValue([]);
253
+  }
254
+
255
+  // 新增/编辑表单提交
256
+  submitForm(): void {
257
+    for (const i in this.validateForm.controls) {
258
+      this.validateForm.controls[i].markAsDirty();
259
+      this.validateForm.controls[i].updateValueAndValidity();
260
+    }
261
+    if (this.validateForm.invalid) {
262
+      return;
263
+    }
264
+    if(this.validateForm.value.limitAllDept == 0 && !this.validateForm.value.buildingIds.length && !this.validateForm.value.deptIds.length){
265
+      this.message.info('请设置楼栋或科室!');
266
+      return;
267
+    }
268
+    if(/^\s+/.test(this.validateForm.value.remark) || /\s+$/.test(this.validateForm.value.remark)){
269
+      this.message.info('请设置提示备注!');
270
+      return;
271
+    }
272
+
273
+    if(this.validateForm.value.startTime.getTime() >= this.validateForm.value.endTime.getTime()){
274
+      this.message.info('开始时间不能大于结束时间!');
275
+      return;
276
+    }
277
+
278
+    this.btnLoading = true;
279
+    let data = {};
280
+
281
+    if (this.add) {
282
+      //增加
283
+      data = {
284
+        taskType: this.validateForm.value.taskType,
285
+        limitAllDept: this.validateForm.value.limitAllDept,
286
+        buildingIds: this.validateForm.value.buildingIds.length ? this.validateForm.value.buildingIds.toString() : null,
287
+        deptIds: this.validateForm.value.deptIds.length ? this.validateForm.value.deptIds.toString() : null,
288
+        limitType: this.validateForm.value.limitType,
289
+        startTime: format(startOfMinute(this.validateForm.value.startTime), "yyyy-MM-dd HH:mm:ss"),
290
+        endTime: format(endOfMinute(this.validateForm.value.endTime), "yyyy-MM-dd HH:mm:ss"),
291
+        remark: this.validateForm.value.remark,
292
+        hosId: this.currentHospital.id,
293
+      };
294
+    } else {
295
+      //编辑
296
+      data = {
297
+        ...this.coopId,
298
+        taskType: this.validateForm.value.taskType,
299
+        limitAllDept: this.validateForm.value.limitAllDept,
300
+        buildingIds: this.validateForm.value.buildingIds.length ? this.validateForm.value.buildingIds.toString() : null,
301
+        deptIds: this.validateForm.value.deptIds.length ? this.validateForm.value.deptIds.toString() : null,
302
+        limitType: this.validateForm.value.limitType,
303
+        startTime: format(startOfMinute(this.validateForm.value.startTime), "yyyy-MM-dd HH:mm:ss"),
304
+        endTime: format(endOfMinute(this.validateForm.value.endTime), "yyyy-MM-dd HH:mm:ss"),
305
+        remark: this.validateForm.value.remark,
306
+        hosId: this.currentHospital.id,
307
+      };
308
+    }
309
+    this.limitInitiationTimeService
310
+      .simplePost("addData", "workTimeRule", data)
311
+      .subscribe((result) => {
312
+        this.btnLoading = false;
313
+        this.hideAddModal();
314
+        this.initForm();
315
+        if (result.status == 200) {
316
+          if (this.add) {
317
+            this.showPromptModal("新增", true, "");
318
+            this.listLength++;
319
+          }else{
320
+            this.showPromptModal("编辑", true, "");
321
+          }
322
+        } else {
323
+          this.showPromptModal(this.add ? '新增' : '修改', false, result.msg);
324
+        }
325
+      });
326
+  }
327
+
328
+  // 编辑
329
+  edit(data) {
330
+    console.log(data);
331
+    this.modelName = "编辑";
332
+    this.add = false;
333
+    this.modal = true;
334
+    this.coopId = data;
335
+
336
+    this.taskTypeList = data.taskTypeDTO ? [data.taskTypeDTO] : [];
337
+    this.validateForm.controls.taskType.setValue(data.taskType); //任务类型
338
+
339
+    this.validateForm.controls.limitAllDept.setValue(data.limitAllDept); //是否限制所有科室
340
+
341
+    this.buildingList = data.buildingList || [];
342
+    this.validateForm.controls.buildingIds.setValue(this.buildingList.map(v => v.id)); //楼栋
343
+
344
+    this.departmentList = data.deptList || [];
345
+    this.validateForm.controls.deptIds.setValue( this.departmentList.map(v => v.id)); //科室
346
+    this.validateForm.controls.limitType.setValue(data.limitType); //限制方式
347
+    if (data.startTime && data.endTime) {
348
+      this.validateForm.controls.startTime.setValue(new Date(data.startTime));
349
+      this.validateForm.controls.endTime.setValue(new Date(data.endTime));
350
+    }
351
+    this.validateForm.controls.remark.setValue(data.remark); //提示备注
352
+  }
353
+
354
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
355
+  showPromptModal(con, success, promptInfo?) {
356
+    this.promptModalShow = false;
357
+    this.promptContent = con;
358
+    this.ifSuccess = success;
359
+    this.promptInfo = promptInfo;
360
+    setTimeout(() => {
361
+      this.promptModalShow = true;
362
+    }, 100);
363
+    this.getList(0);
364
+  }
365
+
366
+  delModal: boolean = false; //删除模态框
367
+  tipsMsg1: string; //提示框信息
368
+  tipsMsg2: string; //操作后信息
369
+  confirmDelType: string; //确认的类型(启用/停用,删除)
370
+  showDelModal(
371
+    data,
372
+    tipsMsg1: string,
373
+    tipsMsg2: string,
374
+    type: string,
375
+  ) {
376
+    this.confirmDelType = type;
377
+    this.delModal = true;
378
+    this.coopId = data;
379
+    this.tipsMsg1 = tipsMsg1;
380
+    this.tipsMsg2 = tipsMsg2;
381
+  }
382
+  // 隐藏删除框
383
+  hideDelModal() {
384
+    this.delModal = false;
385
+  }
386
+  // 确认删除
387
+  confirmDel() {
388
+    this.btnLoading = true;
389
+    if (this.confirmDelType === "del") {
390
+      //删除
391
+      this.limitInitiationTimeService
392
+        .simplePost("rmvData", "workTimeRule", [this.coopId.id])
393
+        .subscribe((data) => {
394
+          this.btnLoading = false;
395
+          this.delModal = false;
396
+          if (data.status == 200) {
397
+            if (
398
+              this.listOfData.length == 1 &&
399
+              this.pageIndex == Math.ceil(this.listLength / this.pageSize)
400
+            ) {
401
+              this.listLength--;
402
+              if (this.listLength === 0) {
403
+                this.pageIndex = 1;
404
+              } else {
405
+                this.pageIndex = Math.ceil(this.listLength / this.pageSize);
406
+              }
407
+            }
408
+            this.showPromptModal(this.tipsMsg2, true, "");
409
+          } else {
410
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
411
+          }
412
+        });
413
+    }
414
+  }
415
+}
416
+

+ 19 - 0
src/app/views/limit-initiation-time/limit-initiation-time.module.ts

@@ -0,0 +1,19 @@
1
+import { NgModule } from '@angular/core';
2
+import { CommonModule } from '@angular/common';
3
+
4
+import { LimitInitiationTimeRoutingModule } from './limit-initiation-time-routing.module';
5
+import { ShareModule } from 'src/app/share/share.module';
6
+import { LimitInitiationTimeComponent } from './limit-initiation-time.component';
7
+
8
+
9
+@NgModule({
10
+  declarations: [
11
+    LimitInitiationTimeComponent,
12
+  ],
13
+  imports: [
14
+    CommonModule,
15
+    LimitInitiationTimeRoutingModule,
16
+    ShareModule,
17
+  ]
18
+})
19
+export class LimitInitiationTimeModule { }

+ 71 - 0
src/app/views/limit-initiation-time/limit-initiation-time.service.ts

@@ -0,0 +1,71 @@
1
+import { Injectable } from '@angular/core';
2
+import { MainService } from 'src/app/services/main.service';
3
+import { map } from 'rxjs/operators';
4
+
5
+@Injectable({
6
+  providedIn: 'root'
7
+})
8
+export class LimitInitiationTimeService {
9
+
10
+  constructor(
11
+    private mainService: MainService,
12
+  ) { }
13
+
14
+  // simple增删改
15
+  simplePost(type, model, postData) {
16
+    return this.mainService.simplePost(type, model, postData);
17
+  }
18
+
19
+  // 获取任务类型列表
20
+  getTaskTypes(postData) {
21
+    return this.mainService.getFetchDataList("simple/data", "taskType", postData).pipe(map((v:any) => {
22
+      if(Array.isArray(v.list)){
23
+        v.list = v.list.map(vv => ({id: vv.id, taskName: vv.taskName}));
24
+      }else{
25
+        v.list = [];
26
+      }
27
+      return v;
28
+    }));
29
+  }
30
+
31
+  // 获取楼栋列表
32
+  getBuildings(postData) {
33
+    return this.mainService.getFetchDataList("simple/data", "building", postData).pipe(map((v:any) => {
34
+      if(Array.isArray(v.list)){
35
+        v.list = v.list.map(vv => ({id: vv.id, buildingName: vv.buildingName}));
36
+      }else{
37
+        v.list = [];
38
+      }
39
+      return v;
40
+    }));
41
+  }
42
+
43
+  // 获取科室列表
44
+  getDepartments(postData) {
45
+    return this.mainService.getFetchDataList("simple/data", "department", postData).pipe(map((v:any) => {
46
+      if(Array.isArray(v.list)){
47
+        v.list = v.list.map(vv => ({id: vv.id, dept: vv.dept}));
48
+      }else{
49
+        v.list = [];
50
+      }
51
+      return v;
52
+    }));
53
+  }
54
+
55
+  // 查询
56
+  getFetchDataList(postData) {
57
+    return this.mainService.getFetchDataList("simple/data", "workTimeRule", postData).pipe(map((v:any) => {
58
+      if(Array.isArray(v.list)){
59
+        v.list = v.list.map(vv => ({
60
+          ...vv,
61
+          buildingListNames: vv.buildingList ? vv.buildingList.map(v => v.buildingName).toString() : '',
62
+          deptListNames: vv.deptList ? vv.deptList.map(v => v.dept).toString() : '',
63
+        }));
64
+      }else{
65
+        v.list = [];
66
+      }
67
+      return v;
68
+    }));;
69
+  }
70
+}
71
+

+ 5 - 0
src/app/views/main/main-routing.module.ts

@@ -93,6 +93,11 @@ const routes: Routes = [
93 93
         path: "otherPageControl",
94 94
         loadChildren: () => import("../other-page-control/other-page-control.module").then((m) => m.OtherPageControlModule),
95 95
       },
96
+      // 限制发起时间
97
+      {
98
+        path: "limitInitiationTime",
99
+        loadChildren: () => import("../limit-initiation-time/limit-initiation-time.module").then((m) => m.LimitInitiationTimeModule),
100
+      },
96 101
       // 工作分配方案列表
97 102
       {
98 103
         path: "workAssignment",

+ 2 - 2
src/app/views/task-type-management/task-type-management.component.html

@@ -247,7 +247,7 @@
247 247
             <label nz-radio nzValue='0'>否</label>
248 248
           </nz-radio-group>
249 249
         </div>
250
-        <div class="mb8 w100">
250
+        <!-- <div class="mb8 w100">
251 251
           <nz-form-label class="label" nzRequired>是否限制业务发起时间</nz-form-label>
252 252
           <nz-radio-group class="handlerType" [(ngModel)]="reserveType" (ngModelChange)="changeReserveType($event)">
253 253
             <label nz-radio [nzValue]='option.value' *ngFor="let option of reserveTypes">{{option.name}}</label>
@@ -256,7 +256,7 @@
256 256
         <div class="mb8 w100" *ngIf="reserveType == 3">
257 257
           <nz-time-picker [(ngModel)]="reserveDate" nzFormat="HH:mm" class="mr8"></nz-time-picker>
258 258
           <input nz-input style="width: 300px;" class="handlerType" [(ngModel)]="reserveMsg" placeholder="请填写超出时间提示用语" nzSize="default" />
259
-        </div>
259
+        </div> -->
260 260
         <div nz-row *ngIf="association.value == 'inspect' || association.value == 'patientTransport'">
261 261
           <nz-form-label class="label">携带设备</nz-form-label>
262 262
           <nz-checkbox-group class="handlerType" [nzDisabled]="isRemarks == 1" [(ngModel)]="carryEquipmentIds"></nz-checkbox-group>