|
@@ -227,6 +227,7 @@ export class PathologyAddComponent implements OnInit {
|
227
|
227
|
|
228
|
228
|
// 获取标本-标本名称
|
229
|
229
|
getSpNameData(id,item,type){
|
|
230
|
+ this.selectItem = this.specimenData.find(i=>i.id == this.validateForm.value.specimenGenre)
|
230
|
231
|
let postData: any = {
|
231
|
232
|
idx: 0,
|
232
|
233
|
sum: 9999,
|
|
@@ -235,16 +236,17 @@ export class PathologyAddComponent implements OnInit {
|
235
|
236
|
parent:id,
|
236
|
237
|
key: 'pathology_specimen',
|
237
|
238
|
deleted: 0,
|
|
239
|
+ extra1:'',
|
238
|
240
|
},
|
239
|
241
|
};
|
240
|
|
- this.mainService
|
241
|
|
- .getFetchDataList("simple/data", "dictionaryTree", postData)
|
242
|
|
- .subscribe((data) => {
|
243
|
|
- this.specimenNameList = data.list;
|
244
|
|
- // this.specimenNameList.push({
|
245
|
|
- // name:'其他',
|
246
|
|
- // id:'qita'
|
247
|
|
- // })
|
|
242
|
+
|
|
243
|
+ if(this.selectType){
|
|
244
|
+ postData.dictionaryTree.key = 'cell_specimen'
|
|
245
|
+ postData.dictionaryTree.extra1 = this.selectItem.value
|
|
246
|
+ delete postData.dictionaryTree.parent
|
|
247
|
+ delete postData.dictionaryTree.level
|
|
248
|
+ this.mainService.getFetchDataList("simple/data", "dictionaryTree", postData).subscribe((res) => {
|
|
249
|
+ this.specimenNameList = res.list;
|
248
|
250
|
if(type=='edit'){
|
249
|
251
|
if(item.sample){
|
250
|
252
|
this.validateSpecimenForm = this.fb.group({
|
|
@@ -258,21 +260,43 @@ export class PathologyAddComponent implements OnInit {
|
258
|
260
|
this.specimenNameId = Number(item.sample.id);
|
259
|
261
|
this.validateSpecimenForm.controls.specimenName.setValue(item.specimenName);
|
260
|
262
|
},100)
|
261
|
|
- }else{
|
262
|
|
- // this.validateSpecimenForm = this.fb.group({
|
263
|
|
- // remark: [null, []],
|
264
|
|
- // specimenName: [null, [Validators.required]]
|
265
|
|
- // });
|
266
|
|
- // this.specimenNameIndex = this.specimenNameList.length-1
|
267
|
|
- // // this.specimenNameName = 'qita'
|
268
|
|
- // this.validateSpecimenForm.controls.specimenName.setValue(item.specimenName);
|
269
|
263
|
}
|
270
|
264
|
setTimeout(_=>{
|
271
|
265
|
this.validateSpecimenForm.controls.remark.setValue(item.remark);
|
272
|
266
|
this.specimenModal = true
|
273
|
267
|
},50)
|
274
|
268
|
}
|
275
|
|
- });
|
|
269
|
+ });
|
|
270
|
+ }else{
|
|
271
|
+ postData.dictionaryTree.key = 'pathology_specimen'
|
|
272
|
+ postData.dictionaryTree.parent = id
|
|
273
|
+ postData.dictionaryTree.level = 3
|
|
274
|
+ delete postData.dictionaryTree.extra1
|
|
275
|
+ this.mainService.getFetchDataList("simple/data", "dictionaryTree", postData)
|
|
276
|
+ .subscribe((data) => {
|
|
277
|
+ this.specimenNameList = data.list;
|
|
278
|
+ if(type=='edit'){
|
|
279
|
+ if(item.sample){
|
|
280
|
+ this.validateSpecimenForm = this.fb.group({
|
|
281
|
+ remark: [null, []],
|
|
282
|
+ specimenName: [null, [Validators.required]]
|
|
283
|
+ });
|
|
284
|
+ setTimeout(_=>{
|
|
285
|
+ let index4 = this.specimenNameList.findIndex(i=>i.id==item.sample.id)
|
|
286
|
+ this.specimenNameIndex = index4
|
|
287
|
+ this.specimenNameName = item.sample.name
|
|
288
|
+ this.specimenNameId = Number(item.sample.id);
|
|
289
|
+ this.validateSpecimenForm.controls.specimenName.setValue(item.specimenName);
|
|
290
|
+ },100)
|
|
291
|
+ }
|
|
292
|
+ setTimeout(_=>{
|
|
293
|
+ this.validateSpecimenForm.controls.remark.setValue(item.remark);
|
|
294
|
+ this.specimenModal = true
|
|
295
|
+ },50)
|
|
296
|
+ }
|
|
297
|
+ });
|
|
298
|
+ }
|
|
299
|
+
|
276
|
300
|
}
|
277
|
301
|
|
278
|
302
|
// 删除标本
|
|
@@ -311,18 +335,28 @@ export class PathologyAddComponent implements OnInit {
|
311
|
335
|
specimenDetailId:any = null;
|
312
|
336
|
specimenEdit(e,item,index){
|
313
|
337
|
this.specimenDetailId = item.id
|
314
|
|
- let index1 = this.placeList.findIndex(i=>i.id==item.partSource.id)
|
315
|
|
- this.placeIndex = index1
|
316
|
|
- this.placeId = Number(item.partSource.id)
|
317
|
|
- let index2 = this.systemList.findIndex(i=>i.id==item.system.id)
|
318
|
|
- this.systemIndex = index2
|
319
|
|
- this.systemId = Number(item.system.id)
|
320
|
|
- this.getApparatusData(item.system.id,item,'edit')
|
321
|
|
- this.getSpNameData(item.organ.id,item,'edit')
|
|
338
|
+ if(item.system && item.organ){
|
|
339
|
+ this.selectType = false
|
|
340
|
+ let index1 = this.placeList.findIndex(i=>i.id==item.partSource.id)
|
|
341
|
+ this.placeIndex = index1
|
|
342
|
+ this.placeId = Number(item.partSource.id)
|
|
343
|
+ let index2 = this.systemList.findIndex(i=>i.id==item.system.id)
|
|
344
|
+ this.systemIndex = index2
|
|
345
|
+ this.systemId = Number(item.system.id)
|
|
346
|
+ this.getApparatusData(item.system.id,item,'edit')
|
|
347
|
+ this.getSpNameData(item.organ.id,item,'edit')
|
|
348
|
+ }else{
|
|
349
|
+ this.selectType = true
|
|
350
|
+ this.getSpNameData(item.specimenId,item,'edit')
|
|
351
|
+ }
|
322
|
352
|
}
|
323
|
353
|
|
324
|
354
|
// 选择标本
|
|
355
|
+ selectItem:any;
|
|
356
|
+ selectType:any = false;
|
325
|
357
|
openSpecimen(){
|
|
358
|
+ this.selectItem = this.specimenData.find(i=>i.id == this.validateForm.value.specimenGenre)
|
|
359
|
+ console.log(this.selectItem.value) //20 21 22 24 60 80
|
326
|
360
|
this.validateSpecimenForm = this.fb.group({
|
327
|
361
|
remark: [null, []],
|
328
|
362
|
specimenName:[null, [Validators.required]],
|
|
@@ -340,10 +374,19 @@ export class PathologyAddComponent implements OnInit {
|
340
|
374
|
this.systemList=[]; //系统数据
|
341
|
375
|
this.apparatusList=[]; //器官数据
|
342
|
376
|
this.specimenNameList=[]; //标本名称数据
|
343
|
|
- this.specimenNameName = null;
|
344
|
|
- this.getSourceData()
|
345
|
|
- this.getSysData()
|
|
377
|
+ this.specimenNameName = null
|
346
|
378
|
this.specimenModal = true
|
|
379
|
+ if(this.selectItem.value==20 || this.selectItem.value==21 ||
|
|
380
|
+ this.selectItem.value==22 || this.selectItem.value==23 ||
|
|
381
|
+ this.selectItem.value==24 || this.selectItem.value==60 ||
|
|
382
|
+ this.selectItem.value==70 || this.selectItem.value==80){
|
|
383
|
+ this.selectType = true
|
|
384
|
+ this.getSpNameData('',{},'select')
|
|
385
|
+ }else{
|
|
386
|
+ this.selectType = false
|
|
387
|
+ this.getSourceData()
|
|
388
|
+ this.getSysData()
|
|
389
|
+ }
|
347
|
390
|
}
|
348
|
391
|
|
349
|
392
|
// 选择位置来源
|
|
@@ -393,17 +436,6 @@ export class PathologyAddComponent implements OnInit {
|
393
|
436
|
specimenNameClick(e,item,index){
|
394
|
437
|
this.specimenNameIndex = index
|
395
|
438
|
let remark = this.validateSpecimenForm.value.remark
|
396
|
|
- // if(item.id == 'qita'){
|
397
|
|
- // this.validateSpecimenForm = this.fb.group({
|
398
|
|
- // remark: [remark?remark:null, []],
|
399
|
|
- // specimenName: [null, [Validators.required]]
|
400
|
|
- // });
|
401
|
|
- // this.specimenNameId = 'null'
|
402
|
|
- // this.specimenNameName = 'qita'
|
403
|
|
- // }else{
|
404
|
|
- // this.validateSpecimenForm = this.fb.group({
|
405
|
|
- // remark: [remark?remark:null, []],
|
406
|
|
- // });
|
407
|
439
|
this.specimenNameId = item.id
|
408
|
440
|
this.specimenNameName = item.name
|
409
|
441
|
if(this.validateSpecimenForm.value.specimenName && this.validateSpecimenForm.value.specimenName.length){
|
|
@@ -413,10 +445,6 @@ export class PathologyAddComponent implements OnInit {
|
413
|
445
|
}
|
414
|
446
|
}
|
415
|
447
|
|
416
|
|
- // if(this.validateSpecimenForm.value.specimenName && this.validateSpecimenForm.value.specimenName.length>15){
|
417
|
|
- // this.message.error('字符长度不能超过15个')
|
418
|
|
- // return
|
419
|
|
- // }
|
420
|
448
|
let namn = null
|
421
|
449
|
if(this.validateSpecimenForm.value.specimenName){
|
422
|
450
|
namn = this.validateSpecimenForm.value.specimenName + '、'+ item.name
|
|
@@ -424,7 +452,6 @@ export class PathologyAddComponent implements OnInit {
|
424
|
452
|
namn = item.name
|
425
|
453
|
}
|
426
|
454
|
this.validateSpecimenForm.controls.specimenName.setValue(namn);
|
427
|
|
- // }
|
428
|
455
|
}
|
429
|
456
|
|
430
|
457
|
// 保存标本
|
|
@@ -432,19 +459,22 @@ export class PathologyAddComponent implements OnInit {
|
432
|
459
|
addSpLoading:boolean = false;
|
433
|
460
|
addMadal:boolean = false;
|
434
|
461
|
submitSpecimen(type){
|
435
|
|
- if(this.placeIndex==null){
|
436
|
|
- this.message.error('请选择位置来源')
|
437
|
|
- return
|
438
|
|
- }
|
439
|
|
- if(this.systemIndex==null){
|
440
|
|
- this.message.error('请选择系统')
|
441
|
|
- return
|
442
|
|
- }
|
443
|
|
- if(this.apparatusIndex==null){
|
444
|
|
- this.message.error('请选择器官')
|
445
|
|
- return
|
|
462
|
+ if(!this.selectType){
|
|
463
|
+ if(this.placeIndex==null){
|
|
464
|
+ this.message.error('请选择位置来源')
|
|
465
|
+ return
|
|
466
|
+ }
|
|
467
|
+ if(this.systemIndex==null){
|
|
468
|
+ this.message.error('请选择系统')
|
|
469
|
+ return
|
|
470
|
+ }
|
|
471
|
+ if(this.apparatusIndex==null){
|
|
472
|
+ this.message.error('请选择器官')
|
|
473
|
+ return
|
|
474
|
+ }
|
446
|
475
|
}
|
447
|
|
- if(this.specimenNameIndex==null){
|
|
476
|
+
|
|
477
|
+ if(this.specimenNameIndex==null && this.validateSpecimenForm.value.specimenName == ''){
|
448
|
478
|
this.message.error('请选择标本名称')
|
449
|
479
|
return
|
450
|
480
|
}
|
|
@@ -480,12 +510,6 @@ export class PathologyAddComponent implements OnInit {
|
480
|
510
|
id:'',
|
481
|
511
|
remark:this.validateSpecimenForm.value.remark
|
482
|
512
|
};
|
483
|
|
- // if(this.specimenNameName == 'qita'){
|
484
|
|
- // delete data.sample
|
485
|
|
- // data.specimenName = this.validateSpecimenForm.value.specimenName
|
486
|
|
- // }else{
|
487
|
|
- // data.specimenName = this.specimenNameName
|
488
|
|
- // }
|
489
|
513
|
let queryType = null
|
490
|
514
|
if(this.specimenDetailId){
|
491
|
515
|
queryType = 'updData'
|
|
@@ -504,10 +528,8 @@ export class PathologyAddComponent implements OnInit {
|
504
|
528
|
setTimeout(_=>{
|
505
|
529
|
this.closeSpecimenModel()
|
506
|
530
|
},200)
|
507
|
|
- // this.showSpecimenModal("操作", true, "");
|
508
|
531
|
} else {
|
509
|
532
|
this.message.error(res.msg)
|
510
|
|
- // this.showSpecimenModal("操作", false, res.msg);
|
511
|
533
|
}
|
512
|
534
|
});
|
513
|
535
|
}
|
|
@@ -534,12 +556,6 @@ export class PathologyAddComponent implements OnInit {
|
534
|
556
|
id:'',
|
535
|
557
|
remark:this.validateSpecimenForm.value.remark
|
536
|
558
|
};
|
537
|
|
- // if(this.specimenNameName == 'qita'){
|
538
|
|
- // delete data.sample
|
539
|
|
- // data.specimenName = this.validateSpecimenForm.value.specimenName
|
540
|
|
- // }else{
|
541
|
|
- // data.specimenName = this.specimenNameName
|
542
|
|
- // }
|
543
|
559
|
let queryType = null
|
544
|
560
|
if(this.specimenDetailId){
|
545
|
561
|
queryType = 'updData'
|
|
@@ -548,11 +564,9 @@ export class PathologyAddComponent implements OnInit {
|
548
|
564
|
queryType = 'addData'
|
549
|
565
|
delete data.id
|
550
|
566
|
}
|
551
|
|
- // this.btnSpLoading = true;
|
552
|
567
|
this.mainService
|
553
|
568
|
.simplePost(queryType, "pathologySpecimen", data)
|
554
|
569
|
.subscribe((res) => {
|
555
|
|
- // this.btnSpLoading = false;
|
556
|
570
|
if (res.status == 200) {
|
557
|
571
|
this.message.success('操作成功')
|
558
|
572
|
this.validateSpecimenForm = this.fb.group({
|
|
@@ -565,10 +579,6 @@ export class PathologyAddComponent implements OnInit {
|
565
|
579
|
|
566
|
580
|
this.placeIndex = null;
|
567
|
581
|
this.placeId = null;
|
568
|
|
-
|
569
|
|
- // this.specimenNameList=[]; //标本名称数据
|
570
|
|
- // this.specimenNameName = null;
|
571
|
|
-
|
572
|
582
|
this.addSpLoading = false;
|
573
|
583
|
this.addMadal = false;
|
574
|
584
|
|
|
@@ -615,11 +625,22 @@ export class PathologyAddComponent implements OnInit {
|
615
|
625
|
let str = []
|
616
|
626
|
if(res.list.length>0){
|
617
|
627
|
for(let i of res.list){
|
618
|
|
- str.push(i.system.name + '-' + i.organ.name)
|
|
628
|
+ if(i.system && i.organ){
|
|
629
|
+ str.push(i.system.name + '-' + i.organ.name)
|
|
630
|
+ }else{
|
|
631
|
+ str.push(i.specimenName)
|
|
632
|
+ }
|
619
|
633
|
}
|
620
|
634
|
const newStr = new Set(str);
|
621
|
635
|
const newData = Array.from(newStr);
|
622
|
636
|
this.validateForm.controls.takePart.setValue(newData.join('、'));
|
|
637
|
+ // if(this.selectType){
|
|
638
|
+ // this.validateForm.controls.takePart.setValue(
|
|
639
|
+ // this.validateSpecimenForm.controls.specimenName
|
|
640
|
+ // )
|
|
641
|
+ // }else{
|
|
642
|
+
|
|
643
|
+ // }
|
623
|
644
|
}
|
624
|
645
|
}
|
625
|
646
|
this.validateForm.controls.specimenNum.setValue(this.specimenList.length);
|