|
@@ -2,6 +2,8 @@ import { Component, OnInit } from "@angular/core";
|
2
|
2
|
import { MainService } from 'src/app/services/main.service';
|
3
|
3
|
import { ToolService } from 'src/app/services/tool.service';
|
4
|
4
|
import { NzMessageService } from 'ng-zorro-antd';
|
|
5
|
+import { Subject } from 'rxjs';
|
|
6
|
+import { debounceTime } from 'rxjs/operators';
|
5
|
7
|
|
6
|
8
|
@Component({
|
7
|
9
|
selector: "app-inspect-and-patient-transport-config",
|
|
@@ -27,6 +29,29 @@ export class InspectAndPatientTransportConfigComponent implements OnInit {
|
27
|
29
|
queuingInformation:any[] = [
|
28
|
30
|
{label:'是否开启',value: 0}
|
29
|
31
|
];
|
|
32
|
+
|
|
33
|
+ // 是否起点签到成功展示患者其他服务
|
|
34
|
+ startShowAnotherService:any[] = [
|
|
35
|
+ {label:'是否开启',value: 0}
|
|
36
|
+ ];
|
|
37
|
+ // 是否终点签到成功展示患者其他服务
|
|
38
|
+ endShowAnotherService:any[] = [
|
|
39
|
+ {label:'是否开启',value: 0}
|
|
40
|
+ ];
|
|
41
|
+ // 是否允许交接工单
|
|
42
|
+ handoverOrder:any[] = [
|
|
43
|
+ {label:'是否开启',value: 0}
|
|
44
|
+ ];
|
|
45
|
+ // 是否开启结束服务
|
|
46
|
+ finishService:any[] = [
|
|
47
|
+ {label:'是否开启',value: 0}
|
|
48
|
+ ];
|
|
49
|
+ // 是否允许追加服务
|
|
50
|
+ addService:any[] = [
|
|
51
|
+ {label:'是否开启',value: 0}
|
|
52
|
+ ];
|
|
53
|
+
|
|
54
|
+
|
30
|
55
|
timeMod:any;
|
31
|
56
|
// 交接方式
|
32
|
57
|
// handoverMode:any;
|
|
@@ -55,10 +80,17 @@ export class InspectAndPatientTransportConfigComponent implements OnInit {
|
55
|
80
|
configs:any = {};
|
56
|
81
|
// 任务类型
|
57
|
82
|
tasktype:any = {};
|
|
83
|
+ searchTimerSubject = new Subject();
|
58
|
84
|
constructor(private mainService: MainService,private tool: ToolService,private msg: NzMessageService) {}
|
59
|
85
|
|
60
|
86
|
ngOnInit():void {
|
61
|
87
|
// todo
|
|
88
|
+ this.searchTimerSubject.pipe(debounceTime(500)).subscribe((v) => {
|
|
89
|
+ let fun = v[0];
|
|
90
|
+ fun.call(this, v[1]);
|
|
91
|
+ });
|
|
92
|
+ this.getTaskTypes();
|
|
93
|
+ // todo
|
62
|
94
|
// this.getHandoverModes();
|
63
|
95
|
// this.getCheckModes();
|
64
|
96
|
this.getCheckInModes();
|
|
@@ -79,6 +111,51 @@ export class InspectAndPatientTransportConfigComponent implements OnInit {
|
79
|
111
|
this.timeMod = null;
|
80
|
112
|
}
|
81
|
113
|
}
|
|
114
|
+ // 修改是否允许追加服务
|
|
115
|
+ changeAddService(e){
|
|
116
|
+ console.log(e);
|
|
117
|
+ if(!e[0].checked){
|
|
118
|
+ this.addServiceTaskIds = [];
|
|
119
|
+ }
|
|
120
|
+ }
|
|
121
|
+ // 用户输入搜索
|
|
122
|
+ isLoading: boolean = false;
|
|
123
|
+ addServiceTaskIds:any[] = [];
|
|
124
|
+ taskTypes:any[] = [];
|
|
125
|
+ changeTasktype(e) {
|
|
126
|
+ this.searchTimer(this.getTaskTypes, e);
|
|
127
|
+ }
|
|
128
|
+ // 边输入边搜索节流阀
|
|
129
|
+ searchTimer(fun, e) {
|
|
130
|
+ this.isLoading = true;
|
|
131
|
+ this.searchTimerSubject.next([fun, e]);
|
|
132
|
+ }
|
|
133
|
+ //获取患者其他服务任务类型
|
|
134
|
+ getTaskTypes(e:string = '') {
|
|
135
|
+ let postData:any = {
|
|
136
|
+ idx: 0,
|
|
137
|
+ sum: 9999,
|
|
138
|
+ taskType: {
|
|
139
|
+ taskName: e,
|
|
140
|
+ simpleQuery: true,
|
|
141
|
+ hosId: {
|
|
142
|
+ id: this.hosId
|
|
143
|
+ },
|
|
144
|
+ associationType: {
|
|
145
|
+ key: 'association_types',
|
|
146
|
+ value: 'patientTransport'
|
|
147
|
+ }
|
|
148
|
+ }
|
|
149
|
+ };
|
|
150
|
+ this.isLoading = true;
|
|
151
|
+ this.mainService.getFetchDataList("simple/data", "taskType", postData)
|
|
152
|
+ .subscribe((result) => {
|
|
153
|
+ this.isLoading = false;
|
|
154
|
+ if (result.status == 200) {
|
|
155
|
+ this.taskTypes = result.list || [];
|
|
156
|
+ }
|
|
157
|
+ });
|
|
158
|
+ }
|
82
|
159
|
//获取积分计算方式
|
83
|
160
|
integralCalculationMethods:any = [];
|
84
|
161
|
dLoading = false;
|
|
@@ -117,6 +194,10 @@ export class InspectAndPatientTransportConfigComponent implements OnInit {
|
117
|
194
|
this.msg.create("warning", "请选择精确时间模式!");
|
118
|
195
|
return;
|
119
|
196
|
}
|
|
197
|
+ if(this.addService[0].checked && !this.addServiceTaskIds.length){
|
|
198
|
+ this.msg.create("warning", "请选择追加服务任务类型!");
|
|
199
|
+ return;
|
|
200
|
+ }
|
120
|
201
|
// if(!this.handoverMode){
|
121
|
202
|
// this.msg.create("warning", "请选择交接方式!");
|
122
|
203
|
// return;
|
|
@@ -135,6 +216,15 @@ export class InspectAndPatientTransportConfigComponent implements OnInit {
|
135
|
216
|
integralCalculationMethod: this.multiplayerMode[0].checked ? this.integralCalculationMethod : undefined,
|
136
|
217
|
accurateTimeFilling: this.accurateTimeFilling[0].checked ? 1 : 0,
|
137
|
218
|
queuingInformation: this.queuingInformation[0].checked ? 1 : 0,
|
|
219
|
+
|
|
220
|
+ startShowAnotherService: this.startShowAnotherService[0].checked ? 1 : 0,
|
|
221
|
+ endShowAnotherService: this.endShowAnotherService[0].checked ? 1 : 0,
|
|
222
|
+ handoverOrder: this.handoverOrder[0].checked ? 1 : 0,
|
|
223
|
+ finishService: this.finishService[0].checked ? 1 : 0,
|
|
224
|
+ addService: this.addService[0].checked ? 1 : 0,
|
|
225
|
+ addServiceTaskIds: this.addServiceTaskIds.length ? this.addServiceTaskIds.toString() : undefined,
|
|
226
|
+
|
|
227
|
+
|
138
|
228
|
timeMod: this.timeMod || undefined,
|
139
|
229
|
// autoCreate: this.autoCreateOrders[0].checked ? 1 : 0,
|
140
|
230
|
// autoDept: this.autoDepts[0].checked ? 1 : 0,
|
|
@@ -246,6 +336,13 @@ export class InspectAndPatientTransportConfigComponent implements OnInit {
|
246
|
336
|
this.timeMod = this.configs.timeMod || null;
|
247
|
337
|
this.queuingInformation[0].checked = this.configs.queuingInformation == 1;
|
248
|
338
|
|
|
339
|
+ this.startShowAnotherService[0].checked = this.configs.startShowAnotherService == 1;
|
|
340
|
+ this.endShowAnotherService[0].checked = this.configs.endShowAnotherService == 1;
|
|
341
|
+ this.handoverOrder[0].checked = this.configs.handoverOrder == 1;
|
|
342
|
+ this.finishService[0].checked = this.configs.finishService == 1;
|
|
343
|
+ this.addService[0].checked = this.configs.addService == 1;
|
|
344
|
+ this.addServiceTaskIds = this.configs.addServiceTaskIds ? this.configs.addServiceTaskIds.split(',').map(v => +v) : [];
|
|
345
|
+
|
249
|
346
|
|
250
|
347
|
// if(this.configs.closeTypeIds){
|
251
|
348
|
// let ids = this.configs.closeTypeIds.split(',');
|