Sfoglia il codice sorgente

[add]

性別の初期表示を追加
poohr 2 mesi fa
parent
commit
31189db006
1 ha cambiato i file con 17 aggiunte e 3 eliminazioni
  1. 17
    3
      src/app/pages/family-edit/family-edit.ts

+ 17
- 3
src/app/pages/family-edit/family-edit.ts Vedi File

47
           relationship: this.family.relationship,
47
           relationship: this.family.relationship,
48
           birthDate: this.family.birthDate,
48
           birthDate: this.family.birthDate,
49
           note: this.family.note,
49
           note: this.family.note,
50
+          fatherId: this.family.fatherId,
51
+          motherId: this.family.motherId,
52
+          spouseId: this.family.spouseId,
53
+          gender: this.family.gender,
50
         });
54
         });
51
       }
55
       }
52
     }
56
     }
58
     }
62
     }
59
 
63
 
60
     if (!this.familyId && this.relationMode === 'child') {
64
     if (!this.familyId && this.relationMode === 'child') {
61
-      this.familyForm.patchValue({
62
-        fatherId: this.baseFamilyId,
63
-      });
65
+      const baseFamily = this.familyService.getFamilyById(this.baseFamilyId);
66
+
67
+      if (baseFamily?.gender === 'male') {
68
+        this.familyForm.patchValue({
69
+          fatherId: this.baseFamilyId,
70
+        });
71
+      }
72
+
73
+      if (baseFamily?.gender === 'female') {
74
+        this.familyForm.patchValue({
75
+          motherId: this.baseFamilyId,
76
+        });
77
+      }
64
     }
78
     }
65
   }
79
   }
66
 
80
 

Loading…
Annulla
Salva