|
@@ -230,17 +230,22 @@ export class CheckDeptExceptionComponent implements OnInit {
|
230
|
230
|
let postData = {
|
231
|
231
|
idx: this.pageIndex - 1,
|
232
|
232
|
sum: this.pageSize,
|
|
233
|
+ inspectDeptAbnormalSettings: {
|
|
234
|
+ hospitalId: this.hosId,
|
|
235
|
+ },
|
233
|
236
|
};
|
234
|
237
|
this.mapOfCheckedId = {};
|
235
|
238
|
this.checkedDepIds = [];
|
236
|
239
|
this.loading1 = true;
|
237
|
|
- this.mainService.getUnusualDept(postData).subscribe((result: any) => {
|
238
|
|
- this.loading1 = false;
|
239
|
|
- if (result.status == 200) {
|
240
|
|
- this.listOfData = result.list;
|
241
|
|
- this.listLength = result.totalNum;
|
242
|
|
- }
|
243
|
|
- });
|
|
240
|
+ this.mainService
|
|
241
|
+ .getFetchDataList("simple/data", "inspectDeptAbnormalSettings", postData)
|
|
242
|
+ .subscribe((result: any) => {
|
|
243
|
+ this.loading1 = false;
|
|
244
|
+ if (result.status == 200) {
|
|
245
|
+ this.listOfData = result.list;
|
|
246
|
+ this.listLength = result.totalNum;
|
|
247
|
+ }
|
|
248
|
+ });
|
244
|
249
|
}
|
245
|
250
|
|
246
|
251
|
// 新增/编辑弹框
|
|
@@ -276,28 +281,50 @@ export class CheckDeptExceptionComponent implements OnInit {
|
276
|
281
|
return;
|
277
|
282
|
}
|
278
|
283
|
let data = {};
|
|
284
|
+ let startDepartmentInfo =
|
|
285
|
+ this.validateForm.controls.startDepartment.value.split("&&");
|
|
286
|
+ let endDepartmentInfo =
|
|
287
|
+ this.validateForm.controls.endDepartment.value.split("&&");
|
279
|
288
|
|
280
|
289
|
if (this.add) {
|
281
|
|
- //新增
|
|
290
|
+ //新增baba
|
|
291
|
+ data = {
|
|
292
|
+ hospitalId: this.hosId,
|
|
293
|
+ deleteFlag: 0, //1是删除,0是不删除
|
|
294
|
+ dept: startDepartmentInfo[1], //原科室名字
|
|
295
|
+ deptId: startDepartmentInfo[0], //原科室id
|
|
296
|
+ type: startDepartmentInfo[2], //原科室的科室类型id
|
|
297
|
+ matchingDept: endDepartmentInfo[1], //匹配科室名称
|
|
298
|
+ matchingDeptId: endDepartmentInfo[0], //匹配科室id
|
|
299
|
+ code: this.validateForm.controls.keyword.value, //关键字
|
|
300
|
+ };
|
282
|
301
|
} else {
|
283
|
302
|
//编辑
|
284
|
303
|
data = {
|
285
|
304
|
id: this.coopId,
|
286
|
|
- deleted: false,
|
287
|
|
- desc: this.validateForm.controls.endDepartment.value,
|
|
305
|
+ hospitalId: this.hosId,
|
|
306
|
+ deleteFlag: 0, //1是删除,0是不删除
|
|
307
|
+ dept: startDepartmentInfo[1], //原科室名字
|
|
308
|
+ deptId: startDepartmentInfo[0], //原科室id
|
|
309
|
+ type: startDepartmentInfo[2], //原科室的科室类型id
|
|
310
|
+ matchingDept: endDepartmentInfo[1], //匹配科室名称
|
|
311
|
+ matchingDeptId: endDepartmentInfo[0], //匹配科室id
|
|
312
|
+ code: this.validateForm.controls.keyword.value, //关键字
|
288
|
313
|
};
|
289
|
314
|
}
|
290
|
|
- this.mainService.upDictionary(data).subscribe((result: any) => {
|
291
|
|
- this.btnLoading = false;
|
292
|
|
- this.hideAddModal();
|
293
|
|
- this.initForm();
|
294
|
|
- if (result.status == 200) {
|
295
|
|
- this.listLength++;
|
296
|
|
- this.showPromptModal(this.add ? "新增" : "修改", true, "");
|
297
|
|
- } else {
|
298
|
|
- this.showPromptModal(this.add ? "新增" : "修改", false, "");
|
299
|
|
- }
|
300
|
|
- });
|
|
315
|
+ this.mainService
|
|
316
|
+ .simplePost("addData", "inspectDeptAbnormalSettings", data)
|
|
317
|
+ .subscribe((result: any) => {
|
|
318
|
+ this.btnLoading = false;
|
|
319
|
+ this.hideAddModal();
|
|
320
|
+ this.initForm();
|
|
321
|
+ if (result.status == 200) {
|
|
322
|
+ this.listLength++;
|
|
323
|
+ this.showPromptModal(this.add ? "新增" : "修改", true, "");
|
|
324
|
+ } else {
|
|
325
|
+ this.showPromptModal(this.add ? "新增" : "修改", false, "");
|
|
326
|
+ }
|
|
327
|
+ });
|
301
|
328
|
}
|
302
|
329
|
|
303
|
330
|
// 编辑
|
|
@@ -305,62 +332,23 @@ export class CheckDeptExceptionComponent implements OnInit {
|
305
|
332
|
edit(e, data) {
|
306
|
333
|
e.stopPropagation();
|
307
|
334
|
this.add = false;
|
308
|
|
- this.coopId = data[4];
|
309
|
|
- this.validateForm.controls.keyword.setValue(data[2]); //关键字
|
310
|
|
- this.validateForm.controls.endDepartment.setValue(data[3]); //匹配的科室
|
311
|
|
- // --------检查原科室---
|
312
|
|
- let startDeptArr = []; //临时检查原科室数组
|
313
|
|
- let startDept = data[1]; //科室id
|
314
|
|
- let startDeptShow = data[0]; //科室名称
|
315
|
|
- startDeptArr.push({ id: startDept, dept: startDeptShow });
|
316
|
|
- let startDept$ = this.mainService.getFetchDataList("data", "department", {
|
317
|
|
- department: {
|
318
|
|
- hospital: { id: data.hospital },
|
|
335
|
+ this.coopId = data.id;
|
|
336
|
+ this.validateForm.controls.keyword.setValue(data.code); //关键字
|
|
337
|
+ this.department = [
|
|
338
|
+ {
|
|
339
|
+ id: data.deptId,
|
|
340
|
+ dept: data.dept,
|
|
341
|
+ type: { id: data.type },
|
319
|
342
|
},
|
320
|
|
- idx: 0,
|
321
|
|
- sum: 10,
|
322
|
|
- });
|
323
|
|
- // --------/检查原科室---
|
324
|
|
- // --------匹配的科室---
|
325
|
|
- // let targetDeptArr = []; //临时匹配的科室数组
|
326
|
|
- // let targetDept = data.targetDept.split(","); //科室id
|
327
|
|
- // let targetDeptShow = data.targetDeptShow.split(","); //科室名称
|
328
|
|
- // targetDept.forEach((item, index) => {
|
329
|
|
- // targetDeptArr.push({ id: item, dept: targetDeptShow[index] });
|
330
|
|
- // });
|
331
|
|
- // let targetDept$ = this.mainService.getFetchDataList("data", "department", {
|
332
|
|
- // department: {
|
333
|
|
- // hospital: { id: data.hospital },
|
334
|
|
- // type: { id: 282 },
|
335
|
|
- // },
|
336
|
|
- // idx: 0,
|
337
|
|
- // sum: 20,
|
338
|
|
- // });
|
339
|
|
- // --------/匹配的科室---
|
340
|
|
- this.maskFlag = this.message.loading("正在加载中..", {
|
341
|
|
- nzDuration: 0,
|
342
|
|
- }).messageId;
|
343
|
|
- forkJoin(startDept$).subscribe((res) => {
|
344
|
|
- this.message.remove(this.maskFlag);
|
345
|
|
- this.maskFlag = false;
|
346
|
|
- this.modal = true;
|
347
|
|
- //检查原科室
|
348
|
|
- if (res[0]["status"] == 200) {
|
349
|
|
- let add = startDeptArr.filter(
|
350
|
|
- (item) => !res[0]["list"].some((ele) => ele.id == item.id)
|
351
|
|
- ); //过滤掉已有的选项
|
352
|
|
- this.department = add.concat(res[0]["list"]); //拼接数组
|
353
|
|
- this.validateForm.controls.startDepartment.setValue(data[1] + ""); //检查原科室
|
354
|
|
- }
|
355
|
|
- //匹配的科室
|
356
|
|
- // if (res[2]["status"] == 200) {
|
357
|
|
- // let add = targetDeptArr.filter(
|
358
|
|
- // (item) => !res[2]["list"].some((ele) => ele.id == item.id)
|
359
|
|
- // ); //过滤掉已有的选项
|
360
|
|
- // this.department1 = add.concat(res[2]["list"]); //拼接数组
|
361
|
|
- // this.validateForm.controls.endDepartment.setValue(targetDept); //匹配的科室
|
362
|
|
- // }
|
363
|
|
- });
|
|
343
|
+ ];
|
|
344
|
+ this.validateForm.controls.startDepartment.setValue(
|
|
345
|
+ `${data.deptId}&&${data.dept}&&${data.type}`
|
|
346
|
+ ); //检查原科室
|
|
347
|
+ this.department1 = [{ id: data.matchingDeptId, dept: data.matchingDept }];
|
|
348
|
+ this.validateForm.controls.endDepartment.setValue(
|
|
349
|
+ `${data.matchingDeptId}&&${data.matchingDept}`
|
|
350
|
+ ); //匹配的科室
|
|
351
|
+ this.modal = true;
|
364
|
352
|
}
|
365
|
353
|
|
366
|
354
|
// 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
|
|
@@ -406,8 +394,12 @@ export class CheckDeptExceptionComponent implements OnInit {
|
406
|
394
|
this.btnLoading = true;
|
407
|
395
|
if (this.confirmDelType === "del") {
|
408
|
396
|
//删除
|
|
397
|
+ let postData = {
|
|
398
|
+ id: this.coopId,
|
|
399
|
+ deleteFlag: 1,
|
|
400
|
+ };
|
409
|
401
|
this.mainService
|
410
|
|
- .upDictionary({ id: this.coopId, deleted: true })
|
|
402
|
+ .simplePost("addData", "inspectDeptAbnormalSettings", postData)
|
411
|
403
|
.subscribe((data: any) => {
|
412
|
404
|
this.btnLoading = false;
|
413
|
405
|
this.delModal = false;
|