Browse Source

Merge branch 'develop' into lmm

seimin 3 years ago
parent
commit
2722a3cdf6

+ 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 {

+ 1 - 1
src/app/views/group-management/group-management.component.html

@@ -6,7 +6,7 @@
6
       <div *ngIf="coopBtns.edit" class="edit item" (click)="showCoopModal('edit')">编辑</div>
6
       <div *ngIf="coopBtns.edit" class="edit item" (click)="showCoopModal('edit')">编辑</div>
7
       <div *ngIf="coopBtns.del" class="del item" (click)="showDelModal()">删除</div>
7
       <div *ngIf="coopBtns.del" class="del item" (click)="showDelModal()">删除</div>
8
     </div>
8
     </div>
9
-    <div class="groups" *ngIf="!loading1">
9
+    <div class="groups" [ngStyle]="{display:!loading1?'block':'none'}">
10
       <overlay-scrollbars #osComponentRef1 [ngStyle]="{ height:'100%' }">
10
       <overlay-scrollbars #osComponentRef1 [ngStyle]="{ height:'100%' }">
11
         <div [ngClass]="{'item':true,'checked':data.id==checkedGroup.id}" *ngFor="let data of groupList"
11
         <div [ngClass]="{'item':true,'checked':data.id==checkedGroup.id}" *ngFor="let data of groupList"
12
           (click)="checkGroup(data)" [title]="data.scheduleClass.name+' '+data.groupName">
12
           (click)="checkGroup(data)" [title]="data.scheduleClass.name+' '+data.groupName">

+ 162 - 129
src/app/views/group-management/group-management.component.ts

@@ -1,22 +1,31 @@
1
-import { Component, OnInit, ViewChild } from '@angular/core';
2
-import { ActivatedRoute } from "@angular/router"
3
-import { FormBuilder, Validators, FormGroup } from '@angular/forms';
4
-import { NzMessageService } from 'ng-zorro-antd/message';
1
+import { Component, OnInit, ViewChild } from "@angular/core";
2
+import { ActivatedRoute } from "@angular/router";
3
+import { FormBuilder, Validators, FormGroup } from "@angular/forms";
4
+import { NzMessageService } from "ng-zorro-antd/message";
5
 
5
 
6
 import { MainService } from "../../services/main.service";
6
 import { MainService } from "../../services/main.service";
7
-import { OverlayScrollbarsComponent } from 'overlayscrollbars-ngx';
8
-import { ToolService } from '../../services/tool.service';
7
+import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
8
+import { ToolService } from "../../services/tool.service";
9
 
9
 
10
 @Component({
10
 @Component({
11
-  selector: 'app-group-management',
12
-  templateUrl: './group-management.component.html',
13
-  styleUrls: ['./group-management.component.less']
11
+  selector: "app-group-management",
12
+  templateUrl: "./group-management.component.html",
13
+  styleUrls: ["./group-management.component.less"],
14
 })
14
 })
15
 export class GroupManagementComponent implements OnInit {
15
 export class GroupManagementComponent implements OnInit {
16
   tableHeight;
16
   tableHeight;
17
 
17
 
18
-  constructor(private fb: FormBuilder, private route: ActivatedRoute, private mainService: MainService, private msg: NzMessageService, private tool: ToolService) { }
19
-  @ViewChild('osComponentRef1', { read: OverlayScrollbarsComponent, static: false })
18
+  constructor(
19
+    private fb: FormBuilder,
20
+    private route: ActivatedRoute,
21
+    private mainService: MainService,
22
+    private msg: NzMessageService,
23
+    private tool: ToolService
24
+  ) {}
25
+  @ViewChild("osComponentRef1", {
26
+    read: OverlayScrollbarsComponent,
27
+    static: false,
28
+  })
20
   osComponentRef1: OverlayScrollbarsComponent;
29
   osComponentRef1: OverlayScrollbarsComponent;
21
   ngOnInit() {
30
   ngOnInit() {
22
     this.initCoopBtns();
31
     this.initCoopBtns();
@@ -26,89 +35,96 @@ export class GroupManagementComponent implements OnInit {
26
     this.getScheduleList();
35
     this.getScheduleList();
27
     this.tableHeight = document.body.clientHeight - 267;
36
     this.tableHeight = document.body.clientHeight - 267;
28
   }
37
   }
29
-  menu: any = JSON.parse(localStorage.getItem('menu')) || [];//菜单
38
+  menu: any = JSON.parse(localStorage.getItem("menu")) || []; //菜单
30
   isAllDisplayDataChecked = false;
39
   isAllDisplayDataChecked = false;
31
   isIndeterminate = false;
40
   isIndeterminate = false;
32
   listOfDisplayData: any[] = [];
41
   listOfDisplayData: any[] = [];
33
-  allUserList: any[] = [];//所有用户
34
-  groupUserList: any[] = [];//所选组内用户
42
+  allUserList: any[] = []; //所有用户
43
+  groupUserList: any[] = []; //所选组内用户
35
   mapOfCheckedId: { [key: string]: boolean } = {};
44
   mapOfCheckedId: { [key: string]: boolean } = {};
36
-  checkedGroup: any = {};//选中分组
37
-  groupList: Array<any> = [];//分组信息
38
-  hospitalList: Array<any> = [];//院区列表
39
-  hosId:any;//当前选择的院区id
40
-  scheduleList: Array<any> = [];//班次列表
41
-  searchName: string = '';//用户信息搜索输入框
45
+  checkedGroup: any = {}; //选中分组
46
+  groupList: Array<any> = []; //分组信息
47
+  hospitalList: Array<any> = []; //院区列表
48
+  hosId: any; //当前选择的院区id
49
+  scheduleList: Array<any> = []; //班次列表
50
+  searchName: string = ""; //用户信息搜索输入框
42
 
51
 
43
-  promptContent: string;//操作提示框提示信息
44
-  ifSuccess: boolean;//操作成功/失败
45
-  promptInfo: string;//操作结果提示信息
46
-  promptModalShow: boolean;//是否展示提示框
52
+  promptContent: string; //操作提示框提示信息
53
+  ifSuccess: boolean; //操作成功/失败
54
+  promptInfo: string; //操作结果提示信息
55
+  promptModalShow: boolean; //是否展示提示框
47
 
56
 
48
-  btnLoading: boolean = false;//确认按钮loading状态
49
-  saveLoading: boolean = false;//批量打印按钮loading状态
57
+  btnLoading: boolean = false; //确认按钮loading状态
58
+  saveLoading: boolean = false; //批量打印按钮loading状态
50
 
59
 
51
   // 初始化增删改按钮
60
   // 初始化增删改按钮
52
   coopBtns: any = {
61
   coopBtns: any = {
53
     look: false,
62
     look: false,
54
     add: false,
63
     add: false,
55
     edit: false,
64
     edit: false,
56
-    del: false
65
+    del: false,
57
   };
66
   };
58
 
67
 
59
   initCoopBtns() {
68
   initCoopBtns() {
60
     // 二级菜单
69
     // 二级菜单
61
-    let secondMenus = []
62
-    this.menu.forEach(e => {
63
-      e.childrens.forEach(el => {
64
-        secondMenus.push(el)
70
+    let secondMenus = [];
71
+    this.menu.forEach((e) => {
72
+      e.childrens.forEach((el) => {
73
+        secondMenus.push(el);
65
       });
74
       });
66
     });
75
     });
67
     let link = this.route.parent.snapshot.routeConfig.path;
76
     let link = this.route.parent.snapshot.routeConfig.path;
68
-    let btns = []
69
-    secondMenus.forEach(e => {
77
+    let btns = [];
78
+    secondMenus.forEach((e) => {
70
       if (e.link == link) {
79
       if (e.link == link) {
71
         btns = e.childrens || [];
80
         btns = e.childrens || [];
72
       }
81
       }
73
     });
82
     });
74
-    btns.forEach(e => {
83
+    btns.forEach((e) => {
75
       switch (e.link) {
84
       switch (e.link) {
76
-        case 'look':
85
+        case "look":
77
           this.coopBtns.look = true;
86
           this.coopBtns.look = true;
78
           break;
87
           break;
79
-        case 'add':
88
+        case "add":
80
           this.coopBtns.add = true;
89
           this.coopBtns.add = true;
81
           break;
90
           break;
82
-        case 'edit':
91
+        case "edit":
83
           this.coopBtns.edit = true;
92
           this.coopBtns.edit = true;
84
           break;
93
           break;
85
-        case 'del':
94
+        case "del":
86
           this.coopBtns.del = true;
95
           this.coopBtns.del = true;
87
           break;
96
           break;
88
       }
97
       }
89
-    })
98
+    });
90
   }
99
   }
91
   // 分组列表
100
   // 分组列表
92
   loading1 = false;
101
   loading1 = false;
93
   getGroupList() {
102
   getGroupList() {
94
     let that = this;
103
     let that = this;
95
     let arr = [];
104
     let arr = [];
96
-    this.hospitalList.forEach(item => {
97
-      arr.push(item['id']);
98
-    })
105
+    this.hospitalList.forEach((item) => {
106
+      arr.push(item["id"]);
107
+    });
99
     let data = {
108
     let data = {
100
       idx: 0,
109
       idx: 0,
101
       sum: 999,
110
       sum: 999,
102
       group2: {
111
       group2: {
103
-        hospitals: arr.join()
104
-      }
105
-    }
112
+        hospitals: arr.join(),
113
+      },
114
+    };
106
     this.loading1 = true;
115
     this.loading1 = true;
107
-    that.mainService.getFetchDataList('data', 'group2', data).subscribe(data1 => {
108
-      this.loading1 = false;
109
-      that.groupList = data1.list;
110
-      this.checkGroup(data1.list[0]);
111
-    })
116
+    that.mainService
117
+      .getFetchDataList("data", "group2", data)
118
+      .subscribe((data1) => {
119
+        this.loading1 = false;
120
+        that.groupList = data1.list;
121
+        console.log(this.checkedGroup);
122
+        if (Object.keys(this.checkedGroup).length) {
123
+          this.checkGroup(this.checkedGroup);
124
+        } else {
125
+          this.checkGroup(data1.list[0]);
126
+        }
127
+      });
112
   }
128
   }
113
 
129
 
114
   // 获取选中院区下用户列表
130
   // 获取选中院区下用户列表
@@ -124,26 +140,32 @@ export class GroupManagementComponent implements OnInit {
124
         user: {
140
         user: {
125
           name: this.searchName,
141
           name: this.searchName,
126
           usertype: { id: 106 },
142
           usertype: { id: 106 },
127
-          hospital: { id: this.checkedGroup['hospital']['id'] }
128
-        }
129
-      }
143
+          hospital: { id: this.checkedGroup["hospital"]["id"] },
144
+        },
145
+      };
130
       this.timeNum++;
146
       this.timeNum++;
131
       this.loading2 = true;
147
       this.loading2 = true;
132
-      this.mainService.getFetchDataList('data', 'user', data).subscribe(result => {
133
-        this.timeNum--;
134
-        if (this.timeNum === 0) {
135
-          this.loading2 = false;
136
-          this.onlyFlag = false;
137
-        }
138
-        this.allUserList = result.list;
139
-        this.allUsers = JSON.parse(JSON.stringify(result.list));
140
-        this.refreshStatus(true)
141
-      })
148
+      this.mainService
149
+        .getFetchDataList("data", "user", data)
150
+        .subscribe((result) => {
151
+          this.timeNum--;
152
+          if (this.timeNum === 0) {
153
+            this.loading2 = false;
154
+            this.onlyFlag = false;
155
+          }
156
+          this.allUserList = result.list;
157
+          this.allUsers = JSON.parse(JSON.stringify(result.list));
158
+          this.refreshStatus(true);
159
+        });
142
     } else {
160
     } else {
143
-      this.allUserList = this.allUsers.filter(item => {
144
-        return item.pinYin.includes(this.searchName) || item.name.includes(this.searchName) || item.inputCode.includes(this.searchName);
145
-      })
146
-      this.refreshStatus(true)
161
+      this.allUserList = this.allUsers.filter((item) => {
162
+        return (
163
+          item.pinYin.includes(this.searchName) ||
164
+          item.name.includes(this.searchName) ||
165
+          item.inputCode.includes(this.searchName)
166
+        );
167
+      });
168
+      this.refreshStatus(true);
147
     }
169
     }
148
   }
170
   }
149
   // 获取组内用户
171
   // 获取组内用户
@@ -179,19 +201,25 @@ export class GroupManagementComponent implements OnInit {
179
     const data = {
201
     const data = {
180
       idx: 0,
202
       idx: 0,
181
       scheduleClass: { hospital: { id: this.hosId } },
203
       scheduleClass: { hospital: { id: this.hosId } },
182
-      sum: 999
183
-    }
184
-    this.mainService.getFetchDataList('configuration', 'scheduleClass', data).subscribe(data => {
185
-      this.scheduleList = data.list;
186
-    })
204
+      sum: 999,
205
+    };
206
+    this.mainService
207
+      .getFetchDataList("configuration", "scheduleClass", data)
208
+      .subscribe((data) => {
209
+        this.scheduleList = data.list;
210
+      });
187
   }
211
   }
188
 
212
 
189
   // 选中分组
213
   // 选中分组
214
+  positionY = 0; //记录其他建单Y轴滚动距离
190
   checkGroup(data) {
215
   checkGroup(data) {
191
-    this.searchName = '';
216
+    this.positionY = this.osComponentRef1.osInstance().scroll().position.y; //内容滚动的距离
217
+    this.searchName = "";
192
     this.checkedGroup = data;
218
     this.checkedGroup = data;
193
     this.mapOfCheckedId = {};
219
     this.mapOfCheckedId = {};
194
-    this.groupUserList = this.checkedGroup['users'] ? this.checkedGroup['users'] : [];
220
+    this.groupUserList = this.checkedGroup["users"]
221
+      ? this.checkedGroup["users"]
222
+      : [];
195
     this.getAllUser();
223
     this.getAllUser();
196
   }
224
   }
197
 
225
 
@@ -204,8 +232,8 @@ export class GroupManagementComponent implements OnInit {
204
     if (first) {
232
     if (first) {
205
       for (j = 0; j < that.groupUserList.length; j++) {
233
       for (j = 0; j < that.groupUserList.length; j++) {
206
         for (i = 0; i < that.allUserList.length; i++) {
234
         for (i = 0; i < that.allUserList.length; i++) {
207
-          if (that.allUserList[i]['id'] == that.groupUserList[j]['id']) {
208
-            that.mapOfCheckedId[that.allUserList[i]['id']] = true;
235
+          if (that.allUserList[i]["id"] == that.groupUserList[j]["id"]) {
236
+            that.mapOfCheckedId[that.allUserList[i]["id"]] = true;
209
             break;
237
             break;
210
           }
238
           }
211
         }
239
         }
@@ -214,7 +242,7 @@ export class GroupManagementComponent implements OnInit {
214
     let arr = [];
242
     let arr = [];
215
     for (var m in that.mapOfCheckedId) {
243
     for (var m in that.mapOfCheckedId) {
216
       if (that.mapOfCheckedId[m]) {
244
       if (that.mapOfCheckedId[m]) {
217
-        arr.push({ 'id': m })
245
+        arr.push({ id: m });
218
       }
246
       }
219
     }
247
     }
220
     that.usersArr = arr;
248
     that.usersArr = arr;
@@ -226,34 +254,40 @@ export class GroupManagementComponent implements OnInit {
226
     that.saveLoading = true;
254
     that.saveLoading = true;
227
     let postData = {
255
     let postData = {
228
       group2: {
256
       group2: {
229
-        id: that.checkedGroup['id'],
230
-        users: that.usersArr
231
-      }
232
-    }
233
-    that.mainService.coopData('updData', 'group2', postData).subscribe(data => {
234
-      that.saveLoading = false;
235
-      if (data.status == 200) {
236
-        that.showPromptModal('保存', true, '');
237
-      } else {
238
-        that.showPromptModal('保存', false, data.msg);
239
-      }
240
-    })
257
+        id: that.checkedGroup["id"],
258
+        users: that.usersArr,
259
+      },
260
+    };
261
+    that.mainService
262
+      .coopData("updData", "group2", postData)
263
+      .subscribe((data) => {
264
+        that.saveLoading = false;
265
+        if (data.status == 200) {
266
+          that.showPromptModal("保存", true, "");
267
+        } else {
268
+          that.showPromptModal("保存", false, data.msg);
269
+        }
270
+      });
241
   }
271
   }
242
 
272
 
243
   // 新增/编辑模态框
273
   // 新增/编辑模态框
244
-  coopModal: boolean = false;//模态框是否展示
245
-  add: boolean = true;//true:新增;false:编辑
274
+  coopModal: boolean = false; //模态框是否展示
275
+  add: boolean = true; //true:新增;false:编辑
246
   showCoopModal(type) {
276
   showCoopModal(type) {
247
     let that = this;
277
     let that = this;
248
-    if (type == 'edit' && !that.checkedGroup['groupName']) {
249
-      that.msg.create('warning', '请选择需要编辑的分组!');
278
+    if (type == "edit" && !that.checkedGroup["groupName"]) {
279
+      that.msg.create("warning", "请选择需要编辑的分组!");
250
       return;
280
       return;
251
     }
281
     }
252
     that.coopModal = true;
282
     that.coopModal = true;
253
-    that.add = type == 'add';
254
-    if (type == 'edit') {
255
-      that.validateForm.controls.classes.setValue(that.checkedGroup['scheduleClass'].id + '');
256
-      that.validateForm.controls.groupName.setValue(that.checkedGroup['groupName']);
283
+    that.add = type == "add";
284
+    if (type == "edit") {
285
+      that.validateForm.controls.classes.setValue(
286
+        that.checkedGroup["scheduleClass"].id + ""
287
+      );
288
+      that.validateForm.controls.groupName.setValue(
289
+        that.checkedGroup["groupName"]
290
+      );
257
     } else {
291
     } else {
258
       that.validateForm.controls.classes.setValue(null);
292
       that.validateForm.controls.classes.setValue(null);
259
       that.validateForm.controls.groupName.setValue(null);
293
       that.validateForm.controls.groupName.setValue(null);
@@ -268,7 +302,7 @@ export class GroupManagementComponent implements OnInit {
268
   initForm() {
302
   initForm() {
269
     this.validateForm = this.fb.group({
303
     this.validateForm = this.fb.group({
270
       classes: [null, [Validators.required]],
304
       classes: [null, [Validators.required]],
271
-      groupName: [null, [Validators.required]]
305
+      groupName: [null, [Validators.required]],
272
     });
306
     });
273
   }
307
   }
274
 
308
 
@@ -286,29 +320,31 @@ export class GroupManagementComponent implements OnInit {
286
       group2: {
320
       group2: {
287
         groupName: that.validateForm.value.groupName,
321
         groupName: that.validateForm.value.groupName,
288
         hospital: { id: that.hosId - 0 },
322
         hospital: { id: that.hosId - 0 },
289
-        scheduleClass: { id: that.validateForm.value.classes - 0 }
290
-      }
291
-    }
323
+        scheduleClass: { id: that.validateForm.value.classes - 0 },
324
+      },
325
+    };
292
     if (!that.add) {
326
     if (!that.add) {
293
-      data.group2['id'] = that.checkedGroup['id'];
327
+      data.group2["id"] = that.checkedGroup["id"];
294
     }
328
     }
295
-    that.mainService.coopData((that.add ? 'addData' : 'updData'), 'group2', data).subscribe(data => {
296
-      that.hideCoopModal();
297
-      that.btnLoading = false;
298
-      that.initForm();
299
-      if (data.status == 200) {
300
-        that.showPromptModal((that.add ? '新增' : '编辑'), true, '');
301
-      } else {
302
-        that.showPromptModal((that.add ? '新增' : '编辑'), false, data.msg);
303
-      }
304
-    })
329
+    that.mainService
330
+      .coopData(that.add ? "addData" : "updData", "group2", data)
331
+      .subscribe((data) => {
332
+        that.hideCoopModal();
333
+        that.btnLoading = false;
334
+        that.initForm();
335
+        if (data.status == 200) {
336
+          that.showPromptModal(that.add ? "新增" : "编辑", true, "");
337
+        } else {
338
+          that.showPromptModal(that.add ? "新增" : "编辑", false, data.msg);
339
+        }
340
+      });
305
   }
341
   }
306
 
342
 
307
   //删除modal
343
   //删除modal
308
   delModal: boolean = false;
344
   delModal: boolean = false;
309
   showDelModal() {
345
   showDelModal() {
310
-    if (!this.checkedGroup['groupName']) {
311
-      this.msg.create('warning', '请选择需要删除的分组!');
346
+    if (!this.checkedGroup["groupName"]) {
347
+      this.msg.create("warning", "请选择需要删除的分组!");
312
       return;
348
       return;
313
     }
349
     }
314
     this.delModal = true;
350
     this.delModal = true;
@@ -320,16 +356,17 @@ export class GroupManagementComponent implements OnInit {
320
   confirmDel() {
356
   confirmDel() {
321
     let that = this;
357
     let that = this;
322
     that.btnLoading = true;
358
     that.btnLoading = true;
323
-    that.mainService.coopData('rmvData', 'group2', [that.checkedGroup['id']]).subscribe(data => {
324
-      that.hideDelModal();
325
-      that.btnLoading = false;
326
-      if (data.status == 200) {
327
-        that.showPromptModal('删除', true, '');
328
-      } else {
329
-        that.showPromptModal('删除', false, data.msg);
330
-      }
331
-    })
332
-
359
+    that.mainService
360
+      .coopData("rmvData", "group2", [that.checkedGroup["id"]])
361
+      .subscribe((data) => {
362
+        that.hideDelModal();
363
+        that.btnLoading = false;
364
+        if (data.status == 200) {
365
+          that.showPromptModal("删除", true, "");
366
+        } else {
367
+          that.showPromptModal("删除", false, data.msg);
368
+        }
369
+      });
333
   }
370
   }
334
 
371
 
335
   // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
372
   // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
@@ -338,14 +375,10 @@ export class GroupManagementComponent implements OnInit {
338
     this.promptContent = con;
375
     this.promptContent = con;
339
     this.ifSuccess = success;
376
     this.ifSuccess = success;
340
     this.promptInfo = promptInfo;
377
     this.promptInfo = promptInfo;
378
+    this.osComponentRef1.osInstance().scroll({ x: 0, y: this.positionY });
341
     setTimeout(() => {
379
     setTimeout(() => {
342
       this.promptModalShow = true;
380
       this.promptModalShow = true;
343
       this.getGroupList();
381
       this.getGroupList();
344
     }, 100);
382
     }, 100);
345
   }
383
   }
346
-
347
-
348
-
349
-
350
-
351
 }
384
 }

+ 39 - 26
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,32 +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-time-picker nzFormat="HH:mm" [nzMinuteStep]="30" [nzSecondStep]="60" [(ngModel)]="yyTime"
826
-                  (ngModelChange)="yyTimeChange($event)" [ngModelOptions]="{standalone: true}"
827
-                  [nzDisabledHours]="disabledHours" [nzDisabledMinutes]="disabledMinutes"></nz-time-picker>
828
-                <label *ngIf="yyTime" nz-checkbox [(ngModel)]="nextDay" (ngModelChange)="nextDayChange($event)"
829
-                  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>
830
               </nz-form-control>
847
               </nz-form-control>
831
-              <div class="red w100" *ngIf="!yyTime&&clickYYFlag">请填写预约建单时间!</div>
848
+              <div class="red w100" *ngIf="(!yyTime||!yyDate)&&clickYYFlag">请填写预约建单时间!</div>
832
               <div class="red">请您在预约建单时至少在预约检查时间的基础上提前30分钟,以免错过检查!</div>
849
               <div class="red">请您在预约建单时至少在预约检查时间的基础上提前30分钟,以免错过检查!</div>
833
             </nz-form-item>
850
             </nz-form-item>
834
             <!-- 100009 科室任务类型状态码未配置 -->
851
             <!-- 100009 科室任务类型状态码未配置 -->
@@ -855,7 +872,6 @@
855
             <!-- 100014 (护士端一键建单展示策略)取终点科室和msg 值展示 -->
872
             <!-- 100014 (护士端一键建单展示策略)取终点科室和msg 值展示 -->
856
             <nz-form-item
873
             <nz-form-item
857
               *ngIf="(checkedShowMsg.status!=200)&&(checkedShowMsg.status==100014||checkedShowMsg.status==100015)">
874
               *ngIf="(checkedShowMsg.status!=200)&&(checkedShowMsg.status==100014||checkedShowMsg.status==100015)">
858
-              <!-- <nz-form-item> -->
859
               <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>
860
               <nz-form-control nzErrorTip="请选择目标科室!">
876
               <nz-form-control nzErrorTip="请选择目标科室!">
861
                 <nz-select class="w100" formControlName="targetOffice" [nzDropdownMatchSelectWidth]="false"
877
                 <nz-select class="w100" formControlName="targetOffice" [nzDropdownMatchSelectWidth]="false"
@@ -888,7 +904,8 @@
888
             <nz-form-item *ngIf="current_allowUrgent">
904
             <nz-form-item *ngIf="current_allowUrgent">
889
               <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>
890
               <nz-form-control>
906
               <nz-form-control>
891
-                <nz-radio-group [(ngModel)]="allowUrgent" formControlName="allowUrgent">
907
+                <nz-radio-group [(ngModel)]="allowUrgent" (ngModelChange)="allowUrgentChange($event)"
908
+                  formControlName="allowUrgent">
892
                   <label nz-radio nzValue="1">是</label>
909
                   <label nz-radio nzValue="1">是</label>
893
                   <label nz-radio nzValue="0">否</label>
910
                   <label nz-radio nzValue="0">否</label>
894
                 </nz-radio-group>
911
                 </nz-radio-group>
@@ -907,13 +924,9 @@
907
       </div>
924
       </div>
908
     </overlay-scrollbars>
925
     </overlay-scrollbars>
909
     <div class="btns display_flex justify-content_flex-center">
926
     <div class="btns display_flex justify-content_flex-center">
910
-      <button *ngIf="linkCheckLisTrue&&hasTime&&lessTime&&appointmentBuildFlag === '1'&&allowUrgent==0" nz-button
911
-        nzType="primary" [nzLoading]="btnLoading1" (click)="confirmPatient1('patient-yuyue')">预约建单</button>
912
-      <button *ngIf="appointmentZyBuildFlag === '1'&&allowUrgent==0" nz-button nzType="primary"
913
-        [nzLoading]="btnLoading1" (click)="confirmPatient1('patient-zy-yuyue')">预约建单</button>
914
-      <button
915
-        *ngIf="((checkedShowMsg.data&&linkCheckLisTrue)||(!checkedShowMsg.data&&!linkCheckLisTrue))&&((allowUrgent == 1 && urgentReason.trim() !== '')||allowUrgent == 0)"
916
-        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>
917
       <button class="btn cancel" nz-button nzType="default" (click)="hidePatientOrder()">取消</button>
930
       <button class="btn cancel" nz-button nzType="default" (click)="hidePatientOrder()">取消</button>
918
     </div>
931
     </div>
919
   </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
   }

+ 136 - 143
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);
@@ -267,9 +275,8 @@ export class HushijiandanComponent implements OnInit {
267
   closeModel(e) {
275
   closeModel(e) {
268
     console.log(e);
276
     console.log(e);
269
     if (e === "other") {
277
     if (e === "other") {
270
-      this.getDeptTaskType("", "clear");
278
+      this.osComponentRef2.osInstance().scroll({ x: 0, y: this.positionY });
271
       this.getOrderList();
279
       this.getOrderList();
272
-      this.getSpecimenWorkOrderMsg();
273
     } else if (e === "bb") {
280
     } else if (e === "bb") {
274
       this.getOrderList();
281
       this.getOrderList();
275
       this.getSpecimenWorkOrderMsg();
282
       this.getSpecimenWorkOrderMsg();
@@ -280,8 +287,9 @@ export class HushijiandanComponent implements OnInit {
280
   otherSearch = ""; //搜索的关键词
287
   otherSearch = ""; //搜索的关键词
281
   oLoading = false;
288
   oLoading = false;
282
   nLoading = false;
289
   nLoading = false;
290
+  positionY = 0; //记录其他建单Y轴滚动距离
283
   otherClick(item) {
291
   otherClick(item) {
284
-    console.log(item);
292
+    this.positionY = this.osComponentRef2.osInstance().scroll().position.y; //内容滚动的距离
285
     this.selectOtherId = item.id;
293
     this.selectOtherId = item.id;
286
     this.newShortcutOrder(item, "other");
294
     this.newShortcutOrder(item, "other");
287
   }
295
   }
@@ -571,19 +579,16 @@ export class HushijiandanComponent implements OnInit {
571
               that.patientMsgList.push(e);
579
               that.patientMsgList.push(e);
572
             }
580
             }
573
           });
581
           });
574
-          if (clear === "clear") {
575
-            this.otherSearch = "";
576
-            this.workOrderRemark = "";
577
-            this.customRemarks = [];
578
-            this.historyCustomRemarks = [];
579
-            this.selectOtherId = that.othersList.length
580
-              ? that.othersList[0].id
581
-              : null;
582
-            let obj = that.othersList.find(
583
-              (item) => item.id == this.selectOtherId
584
-            );
585
-            obj && this.otherClick(obj);
586
-          }
582
+          // if (clear === "clear") {
583
+          //   this.otherSearch = "";
584
+          //   this.workOrderRemark = "";
585
+          //   this.customRemarks = [];
586
+          //   this.historyCustomRemarks = [];
587
+          //   let obj = that.othersList.find(
588
+          //     (item) => item.id == this.selectOtherId
589
+          //   );
590
+          //   obj && this.otherClick(obj);
591
+          // }
587
           console.log(this.selectOtherId);
592
           console.log(this.selectOtherId);
588
           if (!this.selectOtherId) {
593
           if (!this.selectOtherId) {
589
             if (that.othersList.length) {
594
             if (that.othersList.length) {
@@ -693,6 +698,24 @@ export class HushijiandanComponent implements OnInit {
693
     if (!this.deptTaskTypeRules.openInspection) return;
698
     if (!this.deptTaskTypeRules.openInspection) return;
694
     this.searchTabInpSubject.next(e);
699
     this.searchTabInpSubject.next(e);
695
   }
700
   }
701
+  // 下一日(陪检)
702
+  nextDay() {
703
+    this.yyDate = addDays(this.yyDate, 1);
704
+    this.yyTime = addDays(this.yyTime, 1);
705
+  }
706
+  // 下一日(转运)
707
+  nextDayZy() {
708
+    this.yyDateZy = addDays(this.yyDateZy, 1);
709
+    this.yyTimeZy = addDays(this.yyTimeZy, 1);
710
+  }
711
+  // 禁用日期(陪检)
712
+  disabledyyDate = (current: Date): boolean => {
713
+    return differenceInCalendarDays(current, new Date()) < 0;
714
+  };
715
+  // 禁用日期(转运)
716
+  disabledyyDateZy = (current: Date): boolean => {
717
+    return differenceInCalendarDays(current, new Date()) < 0;
718
+  };
696
 
719
 
697
   // 一键建单确认弹框
720
   // 一键建单确认弹框
698
   confirmSub: boolean = false;
721
   confirmSub: boolean = false;
@@ -858,8 +881,6 @@ export class HushijiandanComponent implements OnInit {
858
       if (getMinutes(this.yyTime) != 30) {
881
       if (getMinutes(this.yyTime) != 30) {
859
         this.yyTime = setMinutes(this.yyTime, 0);
882
         this.yyTime = setMinutes(this.yyTime, 0);
860
       }
883
       }
861
-    } else {
862
-      this.nextDay = false;
863
     }
884
     }
864
     this.clickYYFlag = false;
885
     this.clickYYFlag = false;
865
   }
886
   }
@@ -868,8 +889,6 @@ export class HushijiandanComponent implements OnInit {
868
       if (getMinutes(this.yyTimeZy) != 30) {
889
       if (getMinutes(this.yyTimeZy) != 30) {
869
         this.yyTimeZy = setMinutes(this.yyTimeZy, 0);
890
         this.yyTimeZy = setMinutes(this.yyTimeZy, 0);
870
       }
891
       }
871
-    } else {
872
-      this.nextDayZy = false;
873
     }
892
     }
874
     this.clickYYZyFlag = false;
893
     this.clickYYZyFlag = false;
875
   }
894
   }
@@ -878,87 +897,6 @@ export class HushijiandanComponent implements OnInit {
878
     this.clickYYFlag = false;
897
     this.clickYYFlag = false;
879
     this.clickYYZyFlag = false;
898
     this.clickYYZyFlag = false;
880
   }
899
   }
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
   // 预约建单
900
   // 预约建单
963
   btnLoading1 = false;
901
   btnLoading1 = false;
964
   confirmPatient1(type) {
902
   confirmPatient1(type) {
@@ -988,8 +926,8 @@ export class HushijiandanComponent implements OnInit {
988
     });
926
     });
989
     //预约时间-患者陪检不能为空
927
     //预约时间-患者陪检不能为空
990
     if (
928
     if (
991
-      (!this.yyTime && !flag && yuyue) ||
992
-      (!this.yyTimeZy && flag && yuyue === "patient-zy-yuyue")
929
+      (!this.yyTime && !this.yyDate && !flag && yuyue === "patient-yuyue") ||
930
+      (!this.yyTimeZy && !this.yyDateZy && flag && yuyue === "patient-zy-yuyue")
993
     ) {
931
     ) {
994
       return;
932
       return;
995
     }
933
     }
@@ -1273,11 +1211,10 @@ export class HushijiandanComponent implements OnInit {
1273
   currentTasktype; //当前选中的任务类型对象
1211
   currentTasktype; //当前选中的任务类型对象
1274
   cLoading = false;
1212
   cLoading = false;
1275
   changeCheckedType() {
1213
   changeCheckedType() {
1214
+    this.isYyInspect = false;
1276
     this.linkCheckLisTrue = false;
1215
     this.linkCheckLisTrue = false;
1277
     this.clickYYFlag = false;
1216
     this.clickYYFlag = false;
1278
     this.clickYYZyFlag = false;
1217
     this.clickYYZyFlag = false;
1279
-    this.nextDay = false;
1280
-    this.nextDayZy = false;
1281
     this.currentTasktype = this.checkTypeLis.find(
1218
     this.currentTasktype = this.checkTypeLis.find(
1282
       (item) => item.id == this.patientForm.controls.checkedType.value
1219
       (item) => item.id == this.patientForm.controls.checkedType.value
1283
     );
1220
     );
@@ -1290,6 +1227,17 @@ export class HushijiandanComponent implements OnInit {
1290
     if (appointmentZyBuildFlag.length) {
1227
     if (appointmentZyBuildFlag.length) {
1291
       this.appointmentZyBuildFlag =
1228
       this.appointmentZyBuildFlag =
1292
         appointmentZyBuildFlag[0].appointmentOtherSwitch == 1 ? "1" : "0";
1229
         appointmentZyBuildFlag[0].appointmentOtherSwitch == 1 ? "1" : "0";
1230
+      this.yyDateZy = new Date();
1231
+      this.yyTimeZy = new Date();
1232
+      if (this.yyTimeZy.getMinutes() >= 0 && this.yyTimeZy.getMinutes() <= 30) {
1233
+        this.yyTimeZy.setMinutes(30);
1234
+      } else if (
1235
+        this.yyTimeZy.getMinutes() > 30 &&
1236
+        this.yyTimeZy.getMinutes() < 60
1237
+      ) {
1238
+        this.yyTimeZy.setMinutes(0);
1239
+        this.yyTimeZy.setHours(this.yyTimeZy.getHours() + 1);
1240
+      }
1293
     } else {
1241
     } else {
1294
       this.appointmentZyBuildFlag = "0";
1242
       this.appointmentZyBuildFlag = "0";
1295
     }
1243
     }
@@ -1352,22 +1300,62 @@ export class HushijiandanComponent implements OnInit {
1352
         }
1300
         }
1353
       });
1301
       });
1354
   }
1302
   }
1303
+  // 需要预约建单-事件
1304
+  yyInspectChange(e) {
1305
+    if (this.filterLinkCheckLis.length) {
1306
+      this.showDateTime();
1307
+    } else {
1308
+      this.yyTime = null;
1309
+      this.yyDate = null;
1310
+      console.log(this.isYyInspect);
1311
+    }
1312
+  }
1313
+  //回显时间日期
1314
+  showDateTime() {
1315
+    //当前时间要大于生效时间
1316
+    let isYyInspect = this.filterLinkCheckLis.every((item) => {
1317
+      return (
1318
+        new Date(item.yyTime).getTime() - new Date().getTime() >
1319
+        this.leadTime * 60 * 1000
1320
+      );
1321
+    });
1322
+    //如果勾选需要预约检查
1323
+    if (isYyInspect) {
1324
+      //筛选离当前时间最近的
1325
+      let timeList = this.filterLinkCheckLis
1326
+        .map((item) => new Date(item.yyTime).getTime())
1327
+        .sort();
1328
+      this.yyTime = new Date(timeList[0] - this.leadTime * 60 * 1000); //回显预约时间,需要减去生效时间
1329
+      this.yyDate = new Date(timeList[0] - this.leadTime * 60 * 1000); //回显预约日期,需要减去生效时间
1330
+    } else {
1331
+      this.yyTime = null;
1332
+      this.yyDate = null;
1333
+    }
1334
+  }
1355
   // 患者送检检查项目-选择检查项目
1335
   // 患者送检检查项目-选择检查项目
1356
   linkCheckLisTrue = false; //是否有已选择(患者)
1336
   linkCheckLisTrue = false; //是否有已选择(患者)
1357
   isInspectPriority = false; //选择的检查是否紧急(患者)
1337
   isInspectPriority = false; //选择的检查是否紧急(患者)
1358
-  hasTime = false; //是否有已选择,并且是否有预约时间(患者)
1359
-  lessTime = false; //预约时间列表中预约时间少于生效时长,则是false
1338
+  filterLinkCheckLis = []; //有预约时间并且选中的
1360
   linkCheckLisChange(e) {
1339
   linkCheckLisChange(e) {
1361
     console.log(e, this.linkCheckLis);
1340
     console.log(e, this.linkCheckLis);
1362
     let flag = false; //检查是否紧急
1341
     let flag = false; //检查是否紧急
1363
     this.linkCheckLis.forEach((item) => {
1342
     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
-      });
1343
+      if (e.length) {
1344
+        //有选中的检查
1345
+        e.forEach((v) => {
1346
+          //检查是否有紧急度
1347
+          if (v.priority == 1) {
1348
+            flag = true;
1349
+          }
1350
+          //选中的检查设置checked
1351
+          item.checked = v.value == item.value;
1352
+        });
1353
+      } else {
1354
+        item.checked = false;
1355
+      }
1370
     });
1356
     });
1357
+
1358
+    //检查有紧急度,则加急
1371
     if (flag) {
1359
     if (flag) {
1372
       this.allowUrgent = "1";
1360
       this.allowUrgent = "1";
1373
       this.urgentReason = "系统根据检查信息,自动进行加急";
1361
       this.urgentReason = "系统根据检查信息,自动进行加急";
@@ -1376,40 +1364,45 @@ export class HushijiandanComponent implements OnInit {
1376
       this.urgentReason = "";
1364
       this.urgentReason = "";
1377
     }
1365
     }
1378
     this.clickYYFlag = false;
1366
     this.clickYYFlag = false;
1379
-    let linkCheckLis = this.linkCheckLis.filter(
1367
+    // 有预约时间并且选中的
1368
+    this.filterLinkCheckLis = this.linkCheckLis.filter(
1380
       (item) => Boolean(item.yyTime) && item.checked
1369
       (item) => Boolean(item.yyTime) && item.checked
1381
     );
1370
     );
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);
1371
+    //有预约时间并且选中的检查数组不为空
1372
+    if (this.filterLinkCheckLis.length) {
1373
+      //当前时间要大于生效时间
1374
+      this.isYyInspect = this.filterLinkCheckLis.every((item) => {
1375
+        return (
1376
+          new Date(item.yyTime).getTime() - new Date().getTime() >
1377
+          this.leadTime * 60 * 1000
1378
+        );
1379
+      });
1380
+      this.showDateTime();
1381
+    } else {
1382
+      //有预约时间并且选中的检查数组为空
1383
+      this.isYyInspect = false;
1384
+      this.yyTime = null;
1385
+      this.yyDate = null;
1394
     }
1386
     }
1395
     this.linkCheckLisTrue = e.length > 0;
1387
     this.linkCheckLisTrue = e.length > 0;
1396
     this.isInspectPriority = e.some((item) => item.priority == 1);
1388
     this.isInspectPriority = e.some((item) => item.priority == 1);
1397
-    if (!this.linkCheckLisTrue) {
1398
-      this.hasTime = false;
1389
+  }
1390
+  // 是否加急
1391
+  allowUrgentChange(e) {
1392
+    if (this.isYyInspect) {
1393
+      this.isYyInspect = e == 0;
1394
+      if (!this.isYyInspect) {
1395
+        this.yyDate = null;
1396
+        this.yyDateZy = null;
1397
+        this.yyTime = null;
1398
+        this.yyTimeZy = null;
1399
+      }
1399
     } else {
1400
     } else {
1400
-      this.hasTime = this.linkCheckLis.some(
1401
-        (item) => Boolean(item.yyTime) && item.checked
1402
-      );
1401
+      this.yyDate = null;
1402
+      this.yyDateZy = null;
1403
+      this.yyTime = null;
1404
+      this.yyTimeZy = null;
1403
     }
1405
     }
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
   }
1406
   }
1414
   // 禁用小时
1407
   // 禁用小时
1415
   disabledHours(): number[] {
1408
   disabledHours(): number[] {