|
@@ -411,6 +411,36 @@ import Neditor from '@/components/Neditor'
|
411
|
411
|
this.form.illness = res.data.orginfo.illness;
|
412
|
412
|
this.form.illness_list = [];
|
413
|
413
|
this.form.org_gallery = res.data.orginfo.org_gallery;
|
|
414
|
+
|
|
415
|
+ this.orgtypes = [];
|
|
416
|
+ this.orgtypesMap ={},
|
|
417
|
+ this.childtypes = [];
|
|
418
|
+ var orgtypes = res.data.orgtypes;
|
|
419
|
+ for (const index in orgtypes) {
|
|
420
|
+ if(orgtypes[index].pid>0) {
|
|
421
|
+ if(!(orgtypes[index].pid in this.orgtypesMap)) {
|
|
422
|
+ this.orgtypesMap[orgtypes[index].pid] = [];
|
|
423
|
+ }
|
|
424
|
+ this.orgtypesMap[orgtypes[index].pid].push(orgtypes[index]);
|
|
425
|
+ if(orgtypes[index].id == this.form.org_type) {
|
|
426
|
+ this.form.child_type = orgtypes[index].id;
|
|
427
|
+ this.form.parent_type = orgtypes[index].pid;
|
|
428
|
+ }
|
|
429
|
+ }else {
|
|
430
|
+ this.orgtypes.push(orgtypes[index]);
|
|
431
|
+ if(orgtypes[index].id == this.form.org_type) {
|
|
432
|
+ this.form.parent_type = orgtypes[index].id;
|
|
433
|
+ }
|
|
434
|
+ }
|
|
435
|
+ }
|
|
436
|
+ if (this.form.parent_type in this.orgtypesMap) {
|
|
437
|
+ this.childtypes = this.orgtypesMap[this.form.parent_type];
|
|
438
|
+ }else {
|
|
439
|
+ this.childtypes = [];
|
|
440
|
+ }
|
|
441
|
+ console.log("机构",this.orgtypesMap)
|
|
442
|
+ this.illnessOptions = res.data.illness?res.data.illness:[];
|
|
443
|
+ console.log("疾病类型",this.illnessOptions)
|
414
|
444
|
this.fileList = [];
|
415
|
445
|
var gallery = res.data.orginfo.org_gallery
|
416
|
446
|
console.log("haaaaaaaaaaaaaaaaaa",gallery)
|
|
@@ -466,33 +496,6 @@ import Neditor from '@/components/Neditor'
|
466
|
496
|
this.citys = res.data.citys?res.data.citys:[];
|
467
|
497
|
this.districts = res.data.districts?res.data.districts:[];
|
468
|
498
|
|
469
|
|
- this.orgtypes = [];
|
470
|
|
- this.orgtypesMap ={},
|
471
|
|
- this.childtypes = [];
|
472
|
|
- var orgtypes = res.data.orgtypes;
|
473
|
|
- for (const index in orgtypes) {
|
474
|
|
- if(orgtypes[index].pid>0) {
|
475
|
|
- if(!(orgtypes[index].pid in this.orgtypesMap)) {
|
476
|
|
- this.orgtypesMap[orgtypes[index].pid] = [];
|
477
|
|
- }
|
478
|
|
- this.orgtypesMap[orgtypes[index].pid].push(orgtypes[index]);
|
479
|
|
- if(orgtypes[index].id == this.form.org_type) {
|
480
|
|
- this.form.child_type = orgtypes[index].id;
|
481
|
|
- this.form.parent_type = orgtypes[index].pid;
|
482
|
|
- }
|
483
|
|
- }else {
|
484
|
|
- this.orgtypes.push(orgtypes[index]);
|
485
|
|
- if(orgtypes[index].id == this.form.org_type) {
|
486
|
|
- this.form.parent_type = orgtypes[index].id;
|
487
|
|
- }
|
488
|
|
- }
|
489
|
|
- }
|
490
|
|
- if (this.form.parent_type in this.orgtypesMap) {
|
491
|
|
- this.childtypes = this.orgtypesMap[this.form.parent_type];
|
492
|
|
- }else {
|
493
|
|
- this.childtypes = [];
|
494
|
|
- }
|
495
|
|
- this.illnessOptions = res.data.illness?res.data.illness:[];
|
496
|
499
|
|
497
|
500
|
} else {
|
498
|
501
|
this.formloading = false;
|