|
@@ -49,6 +49,21 @@ export class AccExamineSetComponent implements OnInit {
|
49
|
49
|
tasktype1Id:any;
|
50
|
50
|
tasktype2Id:any;
|
51
|
51
|
cleanTypeId:any;
|
|
52
|
+ associationTypeIds:any;
|
|
53
|
+ questionnaireManagementData:any; //调查问卷数据
|
|
54
|
+ questionnaireIds:Number; //问卷参数
|
|
55
|
+ intervalTime:string = ''; //间隔时间参数
|
|
56
|
+ taskTypeIds:any = []; //任务类型参数
|
|
57
|
+ editId:'';
|
|
58
|
+ targetData:any = [];
|
|
59
|
+ stateData:any = [];
|
|
60
|
+ // 间隔时间数据
|
|
61
|
+ timeData:any[] = [
|
|
62
|
+ {label:'10',value: 10},
|
|
63
|
+ {label:'15',value: 15},
|
|
64
|
+ {label:'30',value: 30},
|
|
65
|
+ {label:'60',value: 60}
|
|
66
|
+ ];
|
52
|
67
|
// 配置
|
53
|
68
|
configs:any = {};
|
54
|
69
|
searchTimerSubject = new Subject();
|
|
@@ -60,8 +75,9 @@ export class AccExamineSetComponent implements OnInit {
|
60
|
75
|
let fun = v[0];
|
61
|
76
|
fun.call(this, v[1], v[2], v[3]);
|
62
|
77
|
});
|
63
|
|
- this.getTaskTypes('', true, 1);
|
64
|
|
- this.getTaskTypes('', false, 2);
|
|
78
|
+ // this.getTaskTypes('', true, 1);
|
|
79
|
+ // this.getTaskTypes('', false, 2);
|
|
80
|
+ this.getRelevanceType()
|
65
|
81
|
}
|
66
|
82
|
|
67
|
83
|
// 切换tab
|
|
@@ -106,50 +122,36 @@ export class AccExamineSetComponent implements OnInit {
|
106
|
122
|
|
107
|
123
|
// 保存
|
108
|
124
|
submitForm() {
|
109
|
|
- if(!this.tasktypeId){
|
110
|
|
- this.msg.create("warning", "请选择接手术关联任务类型!");
|
|
125
|
+ if(!this.questionnaireIds){
|
|
126
|
+ this.msg.create("warning", "请选择调查问卷!");
|
111
|
127
|
return;
|
112
|
128
|
}
|
113
|
|
- if(!this.recoveryDeptId){
|
114
|
|
- this.msg.create("warning", "请选择苏醒室科室!");
|
|
129
|
+ if(this.taskTypeIds.length==0){
|
|
130
|
+ this.msg.create("warning", "请选择任务类型!");
|
115
|
131
|
return;
|
116
|
132
|
}
|
117
|
|
- if(this.autoCreateOrders[0].checked && !this.autoTime){
|
118
|
|
- this.msg.create("warning", "请选择建单时间!");
|
|
133
|
+ if(this.intervalTime==''){
|
|
134
|
+ this.msg.create("warning", "请选择间隔时间!");
|
119
|
135
|
return;
|
120
|
136
|
}
|
121
|
|
- if(this.autoSendWard[0].checked && !this.tasktype1Id){
|
122
|
|
- this.msg.create("warning", "请选择送回病房任务类型!");
|
123
|
|
- return;
|
124
|
|
- }
|
125
|
|
- if(this.autoSendAwakeningRoom[0].checked && !this.tasktype2Id){
|
126
|
|
- this.msg.create("warning", "请选择送回苏醒室任务类型!");
|
127
|
|
- return;
|
128
|
|
- }
|
129
|
|
- if(this.autoRemandClean[0].checked && !this.cleanTypeId){
|
130
|
|
- this.msg.create("warning", "请选择手术清洁任务类型!");
|
131
|
|
- return;
|
132
|
|
- }
|
133
|
|
- let editData:any = {
|
134
|
|
- hosId: this.hosId,
|
135
|
|
- taskType: this.tasktypeId || undefined,
|
136
|
|
- recoveryDeptId: this.recoveryDeptId || undefined,
|
137
|
|
- ordinaryField: this.surgeryField,
|
138
|
|
- autoCreate: this.autoCreateOrders[0].checked ? 1 : 0,
|
139
|
|
- createTime: this.autoTime ? format(startOfMinute(this.autoTime), "yyyy-MM-dd HH:mm:ss") : undefined,
|
140
|
|
- remandClinical: this.autoSendWard[0].checked ? 1 : 0,
|
141
|
|
- clinicalTypeId: this.tasktype1Id || undefined,
|
142
|
|
- remandRecovery: this.autoSendAwakeningRoom[0].checked ? 1 : 0,
|
143
|
|
- recoveryTypeId: this.tasktype2Id || undefined,
|
144
|
|
- remandClean: this.autoRemandClean[0].checked ? 1 : 0,
|
145
|
|
- surgeryBegin: this.surgeryBegin[0].checked ? 1 : 0,
|
146
|
|
- cleanTypeId: this.cleanTypeId || undefined,
|
|
137
|
+ let taskArr = JSON.parse(JSON.stringify(this.taskTypeIds))
|
|
138
|
+ let editData = {
|
|
139
|
+ // questionnaireConfig:{
|
|
140
|
+ id:'',
|
|
141
|
+ hosId: this.hosId,
|
|
142
|
+ questionnaireIds:this.questionnaireIds,//问卷参数
|
|
143
|
+ intervalTime:this.intervalTime, //间隔时间参数
|
|
144
|
+ taskTypeIds:taskArr.join(',') //任务类型参数
|
|
145
|
+ // }
|
147
|
146
|
};
|
148
|
|
- let postData = Object.assign({}, this.configs, editData);
|
149
|
|
- console.log(postData);
|
|
147
|
+ if(this.editId){
|
|
148
|
+ editData.id = this.editId
|
|
149
|
+ }else{
|
|
150
|
+ delete editData.id
|
|
151
|
+ }
|
150
|
152
|
this.btnLoading = true;
|
151
|
153
|
this.mainService
|
152
|
|
- .simplePost("addData", "taskTypeConfig", postData)
|
|
154
|
+ .simplePost("addData", "questionnaireConfig", editData)
|
153
|
155
|
.subscribe((result) => {
|
154
|
156
|
this.btnLoading = false;
|
155
|
157
|
if (result.status == 200) {
|
|
@@ -157,11 +159,16 @@ export class AccExamineSetComponent implements OnInit {
|
157
|
159
|
}
|
158
|
160
|
});
|
159
|
161
|
}
|
160
|
|
-
|
|
162
|
+
|
|
163
|
+ // 调查问卷搜索
|
|
164
|
+ changequestionnaire(e) {
|
|
165
|
+ this.searchTimer(this.getOneQuestionnaireManagement, e, false)
|
|
166
|
+ }
|
|
167
|
+
|
161
|
168
|
// 用户输入搜索任务类型
|
162
|
169
|
isLoading: boolean = false;
|
163
|
|
- changeTasktype(e, type) {
|
164
|
|
- this.searchTimer(this.getTaskTypes, e, false, type);
|
|
170
|
+ changeTasktype(e) {
|
|
171
|
+ this.searchTimer(this.getTaskTypes, e, false);
|
165
|
172
|
}
|
166
|
173
|
|
167
|
174
|
changeRecoveryDepts(e) {
|
|
@@ -173,46 +180,96 @@ export class AccExamineSetComponent implements OnInit {
|
173
|
180
|
this.isLoading = true;
|
174
|
181
|
this.searchTimerSubject.next([fun, e, isFirst, type]);
|
175
|
182
|
}
|
176
|
|
-
|
|
183
|
+
|
|
184
|
+ // 获取关联任务类型
|
|
185
|
+ getRelevanceType(){
|
|
186
|
+ this.associationTypeIds=[]
|
|
187
|
+ this.mainService.getDictionary("list", "association_types").subscribe((data) => {
|
|
188
|
+ for( let t of data){
|
|
189
|
+ if(t.value=='patientTransport' ||
|
|
190
|
+ t.value=='other' || t.value=='inspect'){
|
|
191
|
+ this.associationTypeIds.push(t)
|
|
192
|
+ }
|
|
193
|
+ }
|
|
194
|
+ this.getTaskTypes('', true, 1)
|
|
195
|
+ this.getState()
|
|
196
|
+ });
|
|
197
|
+ }
|
|
198
|
+
|
|
199
|
+ // 获取问卷状态
|
|
200
|
+ getState(){
|
|
201
|
+ this.mainService.getDictionary("list", "survey_state").subscribe((data) => {
|
|
202
|
+ this.stateData = data
|
|
203
|
+ this.getQuestionnaireTarget()
|
|
204
|
+ });
|
|
205
|
+ }
|
|
206
|
+
|
|
207
|
+ // 获取问卷调查目标
|
|
208
|
+ getQuestionnaireTarget(){
|
|
209
|
+ this.mainService.getDictionary("list", "survey_target").subscribe((data) => {
|
|
210
|
+ this.targetData = data
|
|
211
|
+ this.getOneQuestionnaireManagement()
|
|
212
|
+ });
|
|
213
|
+ }
|
|
214
|
+
|
|
215
|
+ // 获取问卷数据
|
|
216
|
+ getOneQuestionnaireManagement(e:string = '', isFirst:boolean = false,){
|
|
217
|
+ let targetId = this.targetData.find(i=>i.value==4)
|
|
218
|
+ let stateId = this.stateData.find(i=>i.value==2)
|
|
219
|
+ let query = {
|
|
220
|
+ idx: 0,
|
|
221
|
+ questionnaireManagement: {
|
|
222
|
+ title:e,
|
|
223
|
+ hosId: 1,
|
|
224
|
+ surveyTarget:{ //问卷调查目标
|
|
225
|
+ id:targetId.id
|
|
226
|
+ },
|
|
227
|
+ state:{ //问卷状态
|
|
228
|
+ id:stateId.id
|
|
229
|
+ }
|
|
230
|
+ },
|
|
231
|
+ hosId: 1,
|
|
232
|
+ sum: 10
|
|
233
|
+ }
|
|
234
|
+ isFirst && (this.loading = true);
|
|
235
|
+ this.isLoading = true;
|
|
236
|
+ this.mainService.getFetchDataList('api', "questionnaireManagement", query).subscribe(res=>{
|
|
237
|
+ if(res.status == 200){
|
|
238
|
+ this.isLoading = false;
|
|
239
|
+ this.questionnaireManagementData = res.list;
|
|
240
|
+ }
|
|
241
|
+ })
|
|
242
|
+ }
|
|
243
|
+
|
177
|
244
|
//获取接手术关联任务类型
|
178
|
245
|
// 1 患者其他服务
|
179
|
246
|
// 2 其他临床服务
|
180
|
247
|
getTaskTypes(e:string = '', isFirst:boolean = false, type:number = 1) {
|
|
248
|
+ let ids = []
|
|
249
|
+ for(let i of this.associationTypeIds){
|
|
250
|
+ ids.push(i.id)
|
|
251
|
+ }
|
181
|
252
|
isFirst && (this.loading = true);
|
182
|
253
|
let postData:any = {
|
183
|
254
|
idx: 0,
|
184
|
|
- sum: 10,
|
|
255
|
+ sum: 9999,
|
185
|
256
|
taskType: {
|
186
|
257
|
taskName: e,
|
187
|
258
|
simpleQuery: true,
|
|
259
|
+ associationTypeIds:ids.join(','),
|
188
|
260
|
hosId: {
|
189
|
261
|
id: this.hosId
|
190
|
262
|
}
|
191
|
263
|
}
|
192
|
264
|
};
|
193
|
|
- if(type === 1){
|
194
|
|
- postData.taskType.associationType = {
|
195
|
|
- key: 'association_types',
|
196
|
|
- value: 'patientTransport'
|
197
|
|
- }
|
198
|
|
- }else if(type === 2){
|
199
|
|
- postData.taskType.associationType = {
|
200
|
|
- key: 'association_types',
|
201
|
|
- value: 'other'
|
202
|
|
- }
|
203
|
|
- }
|
204
|
265
|
this.isLoading = true;
|
205
|
266
|
this.mainService
|
206
|
267
|
.getFetchDataList("simple/data", "taskType", postData)
|
207
|
268
|
.subscribe((result) => {
|
208
|
269
|
this.isLoading = false;
|
209
|
270
|
if (result.status == 200) {
|
210
|
|
- if(type === 1){
|
211
|
|
- this.taskTypes1 = result.list || [];
|
212
|
|
- }else if(type === 2){
|
213
|
|
- this.taskTypes2 = result.list || [];
|
214
|
|
- }
|
215
|
|
- isFirst && this.getDeptType(true);
|
|
271
|
+ this.taskTypes1 = result.list || [];
|
|
272
|
+ isFirst && this.getConfig();
|
216
|
273
|
}
|
217
|
274
|
});
|
218
|
275
|
}
|
|
@@ -258,83 +315,28 @@ export class AccExamineSetComponent implements OnInit {
|
258
|
315
|
// 获取配置
|
259
|
316
|
getConfig() {
|
260
|
317
|
this.loading = true;
|
|
318
|
+ let postData = {
|
|
319
|
+ idx: 0,
|
|
320
|
+ sum: 10,
|
|
321
|
+ questionnaireConfig: {
|
|
322
|
+ hosId: this.hosId,
|
|
323
|
+ }
|
|
324
|
+ };
|
261
|
325
|
this.mainService
|
262
|
|
- .getDictionary("list", "ordinary_field")
|
263
|
|
- .subscribe((data) => {
|
264
|
|
- this.surgeryField = data.find(v => v.value == 'surgery');
|
265
|
|
- if(this.surgeryField){
|
266
|
|
- let postData = {
|
267
|
|
- idx: 0,
|
268
|
|
- sum: 10,
|
269
|
|
- taskTypeConfig: {
|
270
|
|
- hosId: this.hosId,
|
271
|
|
- ordinaryField: this.surgeryField
|
272
|
|
- }
|
273
|
|
- };
|
274
|
|
- this.mainService
|
275
|
|
- .getFetchDataList("simple/data", "taskTypeConfig", postData)
|
276
|
|
- .subscribe((result) => {
|
277
|
|
- this.loading = false;
|
278
|
|
- if (result.status == 200) {
|
279
|
|
- this.configs = result.list[0] || {};
|
280
|
|
-
|
281
|
|
- // 接手术关联任务类型
|
282
|
|
- this.tasktypeId = this.configs.taskTypeDTO ? this.configs.taskTypeDTO.id : null;
|
283
|
|
- if(this.tasktypeId && this.configs.taskTypeDTO){
|
284
|
|
- let isInArr = this.taskTypes1.some(v => v.id == this.tasktypeId);
|
285
|
|
- if(!isInArr){
|
286
|
|
- this.taskTypes1.unshift(this.configs.taskTypeDTO);
|
287
|
|
- }
|
288
|
|
- }
|
289
|
|
-
|
290
|
|
- // 苏醒室科室
|
291
|
|
- this.recoveryDeptId = this.configs.recoveryDeptId || null;
|
292
|
|
- if(this.recoveryDeptId && this.configs.recoveryDeptDTO){
|
293
|
|
- let isInArr = this.recoveryDepts.some(v => v.id == this.recoveryDeptId);
|
294
|
|
- if(!isInArr){
|
295
|
|
- this.recoveryDepts.unshift(this.configs.recoveryDeptDTO);
|
296
|
|
- }
|
297
|
|
- }
|
298
|
|
-
|
299
|
|
- this.autoCreateOrders[0].checked = this.configs.autoCreate == 1;
|
300
|
|
- this.autoTime = this.configs.createTime ? new Date(this.configs.createTime) : null;
|
301
|
|
- this.autoSendWard[0].checked = this.configs.remandClinical == 1;
|
302
|
|
-
|
303
|
|
- // 送回病房科室
|
304
|
|
- this.tasktype1Id = this.configs.clinicalTypeId || null;
|
305
|
|
- if(this.tasktype1Id && this.configs.clinicalTypeDTO){
|
306
|
|
- let isInArr = this.taskTypes1.some(v => v.id == this.tasktype1Id);
|
307
|
|
- if(!isInArr){
|
308
|
|
- this.taskTypes1.unshift(this.configs.clinicalTypeDTO);
|
309
|
|
- }
|
310
|
|
- }
|
311
|
|
- this.autoSendAwakeningRoom[0].checked = this.configs.remandRecovery == 1;
|
312
|
|
-
|
313
|
|
- // 送回苏醒室科室
|
314
|
|
- this.tasktype2Id = this.configs.recoveryTypeId || null;
|
315
|
|
- if(this.tasktype2Id && this.configs.recoveryType){
|
316
|
|
- let isInArr = this.taskTypes1.some(v => v.id == this.tasktype2Id);
|
317
|
|
- if(!isInArr){
|
318
|
|
- this.taskTypes1.unshift(this.configs.recoveryType);
|
319
|
|
- }
|
320
|
|
- }
|
321
|
|
-
|
322
|
|
- this.autoRemandClean[0].checked = this.configs.remandClean == 1;
|
323
|
|
-
|
324
|
|
- // 关联手术清洁
|
325
|
|
- this.cleanTypeId = this.configs.cleanTypeId || null;
|
326
|
|
- if(this.cleanTypeId && this.configs.cleanType){
|
327
|
|
- let isInArr = this.taskTypes2.some(v => v.id == this.cleanTypeId);
|
328
|
|
- if(!isInArr){
|
329
|
|
- this.taskTypes2.unshift(this.configs.cleanType);
|
330
|
|
- }
|
331
|
|
- }
|
332
|
|
-
|
333
|
|
- this.surgeryBegin[0].checked = this.configs.surgeryBegin == 1;
|
334
|
|
- }
|
335
|
|
- });
|
336
|
|
- }else{
|
337
|
|
- this.loading = false;
|
|
326
|
+ .getFetchDataList("simple/data", "questionnaireConfig", postData)
|
|
327
|
+ .subscribe((result) => {
|
|
328
|
+ this.loading = false;
|
|
329
|
+ if (result.status == 200) {
|
|
330
|
+ let data = result.list[0] || {};
|
|
331
|
+ this.editId = data.id
|
|
332
|
+ let questionData = data.questionnaireDTOS.map(i=>{
|
|
333
|
+ return i.id
|
|
334
|
+ })
|
|
335
|
+ this.questionnaireIds = Number(questionData.join(',')) //调查问卷
|
|
336
|
+ this.intervalTime = data.intervalTime //间隔时间
|
|
337
|
+ this.taskTypeIds = data.taskTypeDTOS.map(i=>{ //任务类型
|
|
338
|
+ return i.id
|
|
339
|
+ })
|
338
|
340
|
}
|
339
|
341
|
});
|
340
|
342
|
}
|