|
@@ -7,6 +7,7 @@ import { ToolService } from "../../services/tool.service";
|
7
|
7
|
import { Subject } from "rxjs";
|
8
|
8
|
import { debounceTime } from "rxjs/operators";
|
9
|
9
|
import { NzMessageService } from "ng-zorro-antd";
|
|
10
|
+import { format, startOfSecond } from 'date-fns';
|
10
|
11
|
export interface Data {
|
11
|
12
|
id: number;
|
12
|
13
|
name: string;
|
|
@@ -109,6 +110,12 @@ export class TaskTypeManagementComponent implements OnInit {
|
109
|
110
|
isDrugsCreateTime = "0"; //药品自动建单
|
110
|
111
|
isOneClickSignIn = "0"; //是否允许一键签收
|
111
|
112
|
isDigitalHandover = "0"; //是否允许数字交接
|
|
113
|
+ reserveSwitch = "0"; //是否预定工单
|
|
114
|
+ reserveUserSwitch = "0"; //是否需要填写工号
|
|
115
|
+ reserveType = "0"; //是否限制业务发起时间
|
|
116
|
+ reserveTypes:any = []; //是否限制业务发起时间-字典
|
|
117
|
+ reserveDate = null; //是否限制业务发起时间-时间
|
|
118
|
+ reserveMsg = ''; //是否限制业务发起时间-提示
|
112
|
119
|
// wechatFocusSwitch = "0"; //支助中心端是否能标记重点关注
|
113
|
120
|
isRemarks: any = "0"; //是否需要备注信息(其他类型)
|
114
|
121
|
remarks = ""; //备注信息提示用语(其他类型)
|
|
@@ -305,6 +312,7 @@ export class TaskTypeManagementComponent implements OnInit {
|
305
|
312
|
this.getAllTaskType(); //任务类型列表
|
306
|
313
|
this.getSearchTaskList(); //任务类型列表,可搜索
|
307
|
314
|
this.getSearchDeptList(); //标本配送,空单默认科室列表
|
|
315
|
+ this.getReserveType(); //获取是否限制业务发起时间-字典
|
308
|
316
|
}
|
309
|
317
|
// 搜索科室
|
310
|
318
|
optionList = [];
|
|
@@ -502,6 +510,14 @@ export class TaskTypeManagementComponent implements OnInit {
|
502
|
510
|
that.allAssociation = data;
|
503
|
511
|
});
|
504
|
512
|
}
|
|
513
|
+ // 获取是否限制业务发起时间-字典
|
|
514
|
+ getReserveType() {
|
|
515
|
+ this.mainService
|
|
516
|
+ .getDictionary("list", "reserveType")
|
|
517
|
+ .subscribe((data) => {
|
|
518
|
+ this.reserveTypes = data;
|
|
519
|
+ });
|
|
520
|
+ }
|
505
|
521
|
// 获取所有关联业务
|
506
|
522
|
getAllRelatedBusiness() {
|
507
|
523
|
this.mainService
|
|
@@ -873,6 +889,20 @@ export class TaskTypeManagementComponent implements OnInit {
|
873
|
889
|
!data.isDigitalHandover
|
874
|
890
|
? "0"
|
875
|
891
|
: data.isDigitalHandover + ""; //是否允许数字交接
|
|
892
|
+ this.reserveSwitch =
|
|
893
|
+ !data.reserveSwitch
|
|
894
|
+ ? "0"
|
|
895
|
+ : data.reserveSwitch + ""; //是否预定工单
|
|
896
|
+ this.reserveUserSwitch =
|
|
897
|
+ !data.reserveUserSwitch
|
|
898
|
+ ? "0"
|
|
899
|
+ : data.reserveUserSwitch + ""; //是否需要填写工号
|
|
900
|
+ this.reserveType =
|
|
901
|
+ !data.reserveType
|
|
902
|
+ ? '1'
|
|
903
|
+ : data.reserveType.value + ""; //是否限制业务发起时间
|
|
904
|
+ this.reserveDate = data.reserveDate === undefined ? null : data.reserveDate; //是否限制业务发起时间-时间
|
|
905
|
+ this.reserveMsg = data.reserveMsg === undefined ? '' : data.reserveMsg; //是否限制业务发起时间-提示
|
876
|
906
|
// this.wechatFocusSwitch =
|
877
|
907
|
// data.wechatFocusSwitch === undefined ? "0" : data.wechatFocusSwitch + ""; //支助中心端是否能标记重点关注
|
878
|
908
|
this.leadTime =
|
|
@@ -968,6 +998,14 @@ export class TaskTypeManagementComponent implements OnInit {
|
968
|
998
|
//提交数据
|
969
|
999
|
loading5 = false; //保存按钮loading
|
970
|
1000
|
submitForm() {
|
|
1001
|
+ if (this.reserveType == "3" && !this.reserveDate) {
|
|
1002
|
+ this.showPromptModal(this.add ? "新增" : "编辑", false, "<span class='red'>是否限制业务发起时间</span>选择<span class='red'>根据时间限制</span>时需要选择时间");
|
|
1003
|
+ return;
|
|
1004
|
+ }
|
|
1005
|
+ if (this.reserveType == "3" && !this.reserveMsg) {
|
|
1006
|
+ this.showPromptModal(this.add ? "新增" : "编辑", false, "<span class='red'>是否限制业务发起时间</span>选择<span class='red'>根据时间限制</span>时需要填写超出时间提示用语");
|
|
1007
|
+ return;
|
|
1008
|
+ }
|
971
|
1009
|
//选择自动送回后,必须选择任务类型
|
972
|
1010
|
//空单默认科室必选
|
973
|
1011
|
if (
|
|
@@ -1204,6 +1242,15 @@ export class TaskTypeManagementComponent implements OnInit {
|
1204
|
1242
|
this.taskData.taskType.isOneClickSignIn = parseInt(this.isOneClickSignIn); //是否允许一键签收
|
1205
|
1243
|
}
|
1206
|
1244
|
this.taskData.taskType.isDigitalHandover = this.isDigitalHandover === "1" ? 1 : 0; //是否允许数字交接
|
|
1245
|
+ this.taskData.taskType.reserveSwitch = this.reserveSwitch === "1" ? 1 : 0; //是否预定工单
|
|
1246
|
+ this.taskData.taskType.reserveUserSwitch = this.reserveUserSwitch === "1" ? 1 : 0; //是否需要填写工号
|
|
1247
|
+ this.taskData.taskType.reserveType = this.reserveTypes.find(v => v.value == this.reserveType); //是否限制业务发起时间-字典
|
|
1248
|
+
|
|
1249
|
+ // 根据时间限制
|
|
1250
|
+ if(this.reserveType == '3'){
|
|
1251
|
+ this.taskData.taskType.reserveDate = this.reserveDate ? format(startOfSecond(this.reserveDate), 'yyyy-MM-dd HH:mm:ss') : undefined; //是否限制业务发起时间-时间
|
|
1252
|
+ this.taskData.taskType.reserveMsg = this.reserveMsg; //是否限制业务发起时间-提示
|
|
1253
|
+ }
|
1207
|
1254
|
// this.taskData.taskType.wechatFocusSwitch =
|
1208
|
1255
|
// this.wechatFocusSwitch === "1" ? 1 : 0; //支助中心端重点关注开关
|
1209
|
1256
|
this.taskData.taskType.remarksSwitch = this.isRemarks === "1" ? 1 : 0; //是否需要备注信息
|
|
@@ -2529,4 +2576,12 @@ export class TaskTypeManagementComponent implements OnInit {
|
2529
|
2576
|
this.carryingCourses[this.indexs].actionRemarks = '';
|
2530
|
2577
|
}
|
2531
|
2578
|
}
|
|
2579
|
+
|
|
2580
|
+ // 修改是否限制业务发起时间
|
|
2581
|
+ changeReserveType(e){
|
|
2582
|
+ if(!e){
|
|
2583
|
+ this.reserveDate = null;
|
|
2584
|
+ this.reserveMsg = '';
|
|
2585
|
+ }
|
|
2586
|
+ }
|
2532
|
2587
|
}
|