|
@@ -19,7 +19,11 @@ export class OperationConfigComponent implements OnInit {
|
19
|
19
|
hosId = this.tool.getCurrentHospital().id; //当前院区
|
20
|
20
|
// 接手术关联任务类型
|
21
|
21
|
tasktypeId:any;
|
22
|
|
- taskTypes:any[] = [];
|
|
22
|
+ taskTypes1:any[] = [];
|
|
23
|
+ taskTypes2:any[] = [];
|
|
24
|
+ // 苏醒室科室
|
|
25
|
+ recoveryDeptId:any;
|
|
26
|
+ recoveryDepts:any[] = [];
|
23
|
27
|
// 自动建单
|
24
|
28
|
autoCreateOrders:any[] = [
|
25
|
29
|
{label:'是否开启',value: 0}
|
|
@@ -32,10 +36,15 @@ export class OperationConfigComponent implements OnInit {
|
32
|
36
|
autoSendAwakeningRoom:any[] = [
|
33
|
37
|
{label:'是否开启',value: 0}
|
34
|
38
|
];
|
|
39
|
+ // 是否开通关联手术清洁建单
|
|
40
|
+ autoRemandClean:any[] = [
|
|
41
|
+ {label:'是否开启',value: 0}
|
|
42
|
+ ];
|
35
|
43
|
// 建单时间
|
36
|
44
|
autoTime:Date | null = null;
|
37
|
45
|
tasktype1Id:any;
|
38
|
46
|
tasktype2Id:any;
|
|
47
|
+ cleanTypeId:any;
|
39
|
48
|
// 配置
|
40
|
49
|
configs:any = {};
|
41
|
50
|
searchTimerSubject = new Subject();
|
|
@@ -45,9 +54,10 @@ export class OperationConfigComponent implements OnInit {
|
45
|
54
|
// todo
|
46
|
55
|
this.searchTimerSubject.pipe(debounceTime(500)).subscribe((v) => {
|
47
|
56
|
let fun = v[0];
|
48
|
|
- fun.call(this, v[1]);
|
|
57
|
+ fun.call(this, v[1], v[2], v[3]);
|
49
|
58
|
});
|
50
|
|
- this.getTaskTypes('', true);
|
|
59
|
+ this.getTaskTypes('', true, 1);
|
|
60
|
+ this.getTaskTypes('', false, 2);
|
51
|
61
|
}
|
52
|
62
|
|
53
|
63
|
// 切换tab
|
|
@@ -72,7 +82,7 @@ export class OperationConfigComponent implements OnInit {
|
72
|
82
|
}
|
73
|
83
|
}
|
74
|
84
|
|
75
|
|
- // 修改是否是否开通送回苏醒室
|
|
85
|
+ // 修改是否开通送回苏醒室
|
76
|
86
|
changeAutoSendAwakeningRoom(e){
|
77
|
87
|
console.log(e);
|
78
|
88
|
if(!e[0].checked){
|
|
@@ -81,12 +91,25 @@ export class OperationConfigComponent implements OnInit {
|
81
|
91
|
}
|
82
|
92
|
}
|
83
|
93
|
|
|
94
|
+ // 修改是否开通关联手术清洁建单
|
|
95
|
+ changeAutoRemandClean(e){
|
|
96
|
+ console.log(e);
|
|
97
|
+ if(!e[0].checked){
|
|
98
|
+ // todo
|
|
99
|
+ this.cleanTypeId = null;
|
|
100
|
+ }
|
|
101
|
+ }
|
|
102
|
+
|
84
|
103
|
// 保存
|
85
|
104
|
submitForm() {
|
86
|
105
|
if(!this.tasktypeId){
|
87
|
106
|
this.msg.create("warning", "请选择接手术关联任务类型!");
|
88
|
107
|
return;
|
89
|
108
|
}
|
|
109
|
+ if(!this.recoveryDeptId){
|
|
110
|
+ this.msg.create("warning", "请选择苏醒室科室!");
|
|
111
|
+ return;
|
|
112
|
+ }
|
90
|
113
|
if(this.autoCreateOrders[0].checked && !this.autoTime){
|
91
|
114
|
this.msg.create("warning", "请选择建单时间!");
|
92
|
115
|
return;
|
|
@@ -99,9 +122,14 @@ export class OperationConfigComponent implements OnInit {
|
99
|
122
|
this.msg.create("warning", "请选择送回苏醒室任务类型!");
|
100
|
123
|
return;
|
101
|
124
|
}
|
|
125
|
+ if(this.autoRemandClean[0].checked && !this.cleanTypeId){
|
|
126
|
+ this.msg.create("warning", "请选择手术清洁任务类型!");
|
|
127
|
+ return;
|
|
128
|
+ }
|
102
|
129
|
let editData:any = {
|
103
|
130
|
hosId: this.hosId,
|
104
|
131
|
taskType: this.tasktypeId || undefined,
|
|
132
|
+ recoveryDeptId: this.recoveryDeptId || undefined,
|
105
|
133
|
ordinaryField: this.surgeryField,
|
106
|
134
|
autoCreate: this.autoCreateOrders[0].checked ? 1 : 0,
|
107
|
135
|
createTime: this.autoTime ? format(startOfMinute(this.autoTime), "yyyy-MM-dd HH:mm:ss") : undefined,
|
|
@@ -109,6 +137,8 @@ export class OperationConfigComponent implements OnInit {
|
109
|
137
|
clinicalTypeId: this.tasktype1Id || undefined,
|
110
|
138
|
remandRecovery: this.autoSendAwakeningRoom[0].checked ? 1 : 0,
|
111
|
139
|
recoveryTypeId: this.tasktype2Id || undefined,
|
|
140
|
+ remandClean: this.autoRemandClean[0].checked ? 1 : 0,
|
|
141
|
+ cleanTypeId: this.cleanTypeId || undefined,
|
112
|
142
|
};
|
113
|
143
|
let postData = Object.assign({}, this.configs, editData);
|
114
|
144
|
console.log(postData);
|
|
@@ -125,41 +155,83 @@ export class OperationConfigComponent implements OnInit {
|
125
|
155
|
|
126
|
156
|
// 用户输入搜索任务类型
|
127
|
157
|
isLoading: boolean = false;
|
128
|
|
- changeTasktype(e) {
|
129
|
|
- this.searchTimer(this.getTaskTypes, e);
|
|
158
|
+ changeTasktype(e, type) {
|
|
159
|
+ this.searchTimer(this.getTaskTypes, e, false, type);
|
|
160
|
+ }
|
|
161
|
+
|
|
162
|
+ changeRecoveryDepts(e) {
|
|
163
|
+ this.searchTimer(this.getRecoveryDepts, e, false);
|
130
|
164
|
}
|
131
|
165
|
|
132
|
166
|
// 边输入边搜索节流阀
|
133
|
|
- searchTimer(fun, e) {
|
|
167
|
+ searchTimer(fun, e, isFirst, type?) {
|
134
|
168
|
this.isLoading = true;
|
135
|
|
- this.searchTimerSubject.next([fun, e]);
|
|
169
|
+ this.searchTimerSubject.next([fun, e, isFirst, type]);
|
136
|
170
|
}
|
137
|
171
|
|
138
|
172
|
//获取接手术关联任务类型
|
139
|
|
- getTaskTypes(e:string = '', isFirst:boolean = false) {
|
140
|
|
- this.loading = true;
|
141
|
|
- let postData = {
|
|
173
|
+ // 1 患者其他服务
|
|
174
|
+ // 2 其他临床服务
|
|
175
|
+ getTaskTypes(e:string = '', isFirst:boolean = false, type:number = 1) {
|
|
176
|
+ isFirst && (this.loading = true);
|
|
177
|
+ let postData:any = {
|
142
|
178
|
idx: 0,
|
143
|
|
- sum: 1000,
|
|
179
|
+ sum: 9999,
|
144
|
180
|
taskType: {
|
145
|
181
|
taskName: e,
|
146
|
182
|
simpleQuery: true,
|
147
|
183
|
hosId: {
|
148
|
184
|
id: this.hosId
|
149
|
|
- },
|
150
|
|
- associationType: {
|
151
|
|
- key: 'association_types',
|
152
|
|
- value: 'patientTransport'
|
153
|
185
|
}
|
154
|
186
|
}
|
155
|
187
|
};
|
|
188
|
+ if(type === 1){
|
|
189
|
+ postData.taskType.associationType = {
|
|
190
|
+ key: 'association_types',
|
|
191
|
+ value: 'patientTransport'
|
|
192
|
+ }
|
|
193
|
+ }else if(type === 2){
|
|
194
|
+ postData.taskType.associationType = {
|
|
195
|
+ key: 'association_types',
|
|
196
|
+ value: 'other'
|
|
197
|
+ }
|
|
198
|
+ }
|
156
|
199
|
this.isLoading = true;
|
157
|
200
|
this.mainService
|
158
|
201
|
.getFetchDataList("simple/data", "taskType", postData)
|
159
|
202
|
.subscribe((result) => {
|
160
|
203
|
this.isLoading = false;
|
161
|
204
|
if (result.status == 200) {
|
162
|
|
- this.taskTypes = result.list || [];
|
|
205
|
+ if(type === 1){
|
|
206
|
+ this.taskTypes1 = result.list || [];
|
|
207
|
+ }else if(type === 2){
|
|
208
|
+ this.taskTypes2 = result.list || [];
|
|
209
|
+ }
|
|
210
|
+ isFirst && this.getRecoveryDepts('', true);
|
|
211
|
+ }
|
|
212
|
+ });
|
|
213
|
+ }
|
|
214
|
+
|
|
215
|
+ //获取所有科室
|
|
216
|
+ getRecoveryDepts(e:string = '', isFirst:boolean = false) {
|
|
217
|
+ isFirst && (this.loading = true);
|
|
218
|
+ let postData = {
|
|
219
|
+ idx: 0,
|
|
220
|
+ sum: 10,
|
|
221
|
+ department: {
|
|
222
|
+ dept: e,
|
|
223
|
+ hospital: {
|
|
224
|
+ id: this.hosId
|
|
225
|
+ },
|
|
226
|
+ }
|
|
227
|
+ };
|
|
228
|
+ this.isLoading = true;
|
|
229
|
+ this.mainService
|
|
230
|
+ .getFetchDataList("data", "department", postData)
|
|
231
|
+ .subscribe((result) => {
|
|
232
|
+ this.isLoading = false;
|
|
233
|
+ if (result.status == 200) {
|
|
234
|
+ this.recoveryDepts = result.list || [];
|
163
|
235
|
isFirst && this.getConfig();
|
164
|
236
|
}
|
165
|
237
|
});
|
|
@@ -187,12 +259,21 @@ export class OperationConfigComponent implements OnInit {
|
187
|
259
|
if (result.status == 200) {
|
188
|
260
|
this.configs = result.list[0] || {};
|
189
|
261
|
this.tasktypeId = this.configs.taskTypeDTO ? this.configs.taskTypeDTO.id : null;
|
|
262
|
+ this.recoveryDeptId = this.configs.recoveryDeptId || null;
|
|
263
|
+ if(this.recoveryDeptId && this.configs.recoveryDeptDTO){
|
|
264
|
+ let isInRecoveryDepts = this.recoveryDepts.some(v => v.id == this.recoveryDeptId);
|
|
265
|
+ if(!isInRecoveryDepts){
|
|
266
|
+ this.recoveryDepts.unshift(this.configs.recoveryDeptDTO);
|
|
267
|
+ }
|
|
268
|
+ }
|
190
|
269
|
this.autoCreateOrders[0].checked = this.configs.autoCreate == 1;
|
191
|
270
|
this.autoTime = this.configs.createTime ? new Date(this.configs.createTime) : null;
|
192
|
271
|
this.autoSendWard[0].checked = this.configs.remandClinical == 1;
|
193
|
272
|
this.tasktype1Id = this.configs.clinicalTypeId || null;
|
194
|
273
|
this.autoSendAwakeningRoom[0].checked = this.configs.remandRecovery == 1;
|
195
|
274
|
this.tasktype2Id = this.configs.recoveryTypeId || null;
|
|
275
|
+ this.autoRemandClean[0].checked = this.configs.remandClean == 1;
|
|
276
|
+ this.cleanTypeId = this.configs.cleanTypeId || null;
|
196
|
277
|
}
|
197
|
278
|
});
|
198
|
279
|
}else{
|