|
@@ -120,6 +120,14 @@ export class TaskTypeManagementComponent implements OnInit {
|
120
|
120
|
isAddQRemarks = true; //添加新的备注快捷选择输入是否禁用
|
121
|
121
|
qRemarksId = 1; //备注快捷选择输入自增id
|
122
|
122
|
leadTime: any = 20; //提前生效时间,默认20分钟
|
|
123
|
+
|
|
124
|
+ actionsModal = false; //动作弹窗
|
|
125
|
+ actionsAdd = false; //动作弹窗新增还是编辑
|
|
126
|
+ validateActionForm: FormGroup; //新增/编辑动作
|
|
127
|
+ actionses = []; //动作第二条-第N条(其他类型)
|
|
128
|
+ isAddActions = true; //添加新的动作是否禁用
|
|
129
|
+ actionsId = 1; //动作自增id
|
|
130
|
+
|
123
|
131
|
formatterDollar = (value) => Number(value);
|
124
|
132
|
// 护士端是否允许预约建单,选中
|
125
|
133
|
appointmentBuildClick() {
|
|
@@ -397,6 +405,86 @@ export class TaskTypeManagementComponent implements OnInit {
|
397
|
405
|
}
|
398
|
406
|
// 备注快速选择输入---------------------------------------------------------------------
|
399
|
407
|
|
|
408
|
+ // 动作------------------------------------------------------------------start
|
|
409
|
+ // 新添加动作快速选择输入
|
|
410
|
+ addAction(e: MouseEvent) {
|
|
411
|
+ e.preventDefault();
|
|
412
|
+ this.actionses.push({ id: ++this.actionsId, content: "" });
|
|
413
|
+ this.actionsChange();
|
|
414
|
+ }
|
|
415
|
+ // 删除新添加动作快速选择输入
|
|
416
|
+ removeActions(index: number, e: MouseEvent) {
|
|
417
|
+ e.preventDefault();
|
|
418
|
+ this.actionses.splice(index, 1);
|
|
419
|
+ this.actionsChange();
|
|
420
|
+ }
|
|
421
|
+ //监听动作快速选择输入输入事件
|
|
422
|
+ actionsChange(e?, action?) {
|
|
423
|
+ if (e !== undefined && action !== undefined) {
|
|
424
|
+ action.content = e;
|
|
425
|
+ }
|
|
426
|
+ // -------------判断添加按钮是否禁用 start
|
|
427
|
+ this.isAddActions = !this.validateActionForm.value.actions;
|
|
428
|
+ if (!this.isAddActions) {
|
|
429
|
+ //如果没禁用
|
|
430
|
+ this.isAddActions = this.actionses.some(
|
|
431
|
+ (item) => item.content === ""
|
|
432
|
+ );
|
|
433
|
+ }
|
|
434
|
+ // -------------判断添加按钮是否禁用 end
|
|
435
|
+ }
|
|
436
|
+ //动作快速选择输入-新增
|
|
437
|
+ addActions() {
|
|
438
|
+ this.actionsAdd = true;
|
|
439
|
+ this.actionsModal = true;
|
|
440
|
+ this.actionses = [];
|
|
441
|
+ this.initActionForm();
|
|
442
|
+ }
|
|
443
|
+ hideActionsModal() {
|
|
444
|
+ this.actionsModal = false;
|
|
445
|
+ }
|
|
446
|
+ // 初始化新增form表单
|
|
447
|
+ initActionForm() {
|
|
448
|
+ this.validateActionForm = this.fb.group({
|
|
449
|
+ actions: [null],
|
|
450
|
+ });
|
|
451
|
+ }
|
|
452
|
+
|
|
453
|
+ // 新增/编辑表单提交
|
|
454
|
+ submitFormActions(): void {
|
|
455
|
+ for (const i in this.validateActionForm.controls) {
|
|
456
|
+ this.validateActionForm.controls[i].markAsDirty();
|
|
457
|
+ this.validateActionForm.controls[i].updateValueAndValidity();
|
|
458
|
+ }
|
|
459
|
+ if (this.validateActionForm.invalid) {
|
|
460
|
+ return;
|
|
461
|
+ }
|
|
462
|
+ this.hideActionsModal();
|
|
463
|
+ let arr = this.actionses.map((item) => item.content);
|
|
464
|
+ if (this.validateActionForm.value.actions) {
|
|
465
|
+ arr.unshift(this.validateActionForm.value.actions);
|
|
466
|
+ }
|
|
467
|
+ this.carryingCourses[this.indexs].actionRemarks = arr.join("$");
|
|
468
|
+ }
|
|
469
|
+
|
|
470
|
+ // 编辑
|
|
471
|
+ editActions() {
|
|
472
|
+ this.initActionForm();
|
|
473
|
+ this.isAddActions = false;
|
|
474
|
+ this.actionsAdd = false;
|
|
475
|
+ this.actionsModal = true;
|
|
476
|
+ let arr = this.carryingCourses[this.indexs].actionRemarks.split("$");
|
|
477
|
+ if (arr.length === 1) {
|
|
478
|
+ this.validateActionForm.controls.actions.setValue(arr[0]);
|
|
479
|
+ } else {
|
|
480
|
+ this.validateActionForm.controls.actions.setValue(arr[0]);
|
|
481
|
+ this.actionses = arr.slice(1).map((item) => {
|
|
482
|
+ return { id: ++this.actionsId, content: item };
|
|
483
|
+ });
|
|
484
|
+ }
|
|
485
|
+ }
|
|
486
|
+ // 动作---------------------------------------------------------------------end
|
|
487
|
+
|
400
|
488
|
// 初始化增删改按钮
|
401
|
489
|
coopBtns: any = {};
|
402
|
490
|
// 获取所有院区
|
|
@@ -1141,6 +1229,11 @@ export class TaskTypeManagementComponent implements OnInit {
|
1141
|
1229
|
this.taskData.taskType.carryingCourses[0].autoAddDeptSwitch = 0; //自动建单追加终点科室开关
|
1142
|
1230
|
this.taskData.taskType.carryingCourses[0].handAddDeptSwitch = 0; //手动建单追加终点科室开关
|
1143
|
1231
|
}
|
|
1232
|
+ // 其他临床服务,多动作开启后,必须配置至少一个动作
|
|
1233
|
+ if(this.taskData.taskType.associationType.value === 'other' && this.taskData.taskType.carryingCourses[1].actionConfirmSwitch && !this.taskData.taskType.carryingCourses[1].actionRemarks){
|
|
1234
|
+ this.showPromptModal("提示", false, "确认动作开启后,至少配置一个动作!");
|
|
1235
|
+ return;
|
|
1236
|
+ }
|
1144
|
1237
|
console.log(this.taskData);
|
1145
|
1238
|
// return;
|
1146
|
1239
|
this.loading5 = true;
|