famil form changes
This commit is contained in:
parent
02e0e34778
commit
1a8d49560f
@ -88,7 +88,7 @@
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<mat-form-field *ngIf="members['controls'].occupation.value==3">
|
||||
<input matInput placeholder="Retired From"
|
||||
formControlName="retired">
|
||||
</mat-form-field>
|
||||
|
||||
@ -145,7 +145,7 @@ export class FamilyDetailsComponent implements OnInit {
|
||||
return this.fb.group({
|
||||
relationship: ['', Validators.compose([Validators.required])],
|
||||
occupation: ['', Validators.compose([Validators.required])],
|
||||
retired: ['', Validators.compose([Validators.required])],
|
||||
retired: [''],
|
||||
});
|
||||
}
|
||||
|
||||
@ -194,31 +194,38 @@ export class FamilyDetailsComponent implements OnInit {
|
||||
if (!this.familyForm.valid) {
|
||||
return;
|
||||
}
|
||||
console.log('data', this.familyForm.value);
|
||||
let records: any = {};
|
||||
records.no_of_years = this.years.value;
|
||||
if (this.ownership.value == 'Others') {
|
||||
if (this.ownership.value == 4) {
|
||||
records.ownership_others = this.ownershipOther.value;
|
||||
}
|
||||
records.ownership = this.ownership.value;
|
||||
records.residence = this.residence.value;
|
||||
if (this.ownership.value == 'Rented') {
|
||||
if (this.ownership.value == 3) {
|
||||
records.what_rent = this.rent.value;
|
||||
}
|
||||
if (this.person.value == 'Other') {
|
||||
if (this.person.value == 8) {
|
||||
records.person_met_other = this.personOther.value;
|
||||
}
|
||||
records.person_met = this.person.value;
|
||||
records.family_members = this.members.value;
|
||||
records.earning_members = this.familyForm.controls['earningMembers'].value;
|
||||
records.non_earning_members = this.familyForm.controls['nonEarningMembers'].value;
|
||||
// filter retired conditions
|
||||
let non_earning_members_filter = this.familyForm.controls['nonEarningMembers'].value.map(function(obj) {
|
||||
if(obj.occupation==3){
|
||||
return obj;
|
||||
}
|
||||
else{
|
||||
obj.retired='';
|
||||
return obj;
|
||||
}
|
||||
});
|
||||
records.non_earning_members = non_earning_members_filter;
|
||||
records.family_details_form_remark = this.familyForm.controls['family_details_form_remark'].value;
|
||||
records.pdid = this.pdid;
|
||||
records.formid = '6';
|
||||
// records.fk_createdby = '251';
|
||||
console.log('params', records);
|
||||
this._pd.saveForm(records).subscribe(data => {
|
||||
console.log('data', data);
|
||||
this.notifier.notify('success', 'Saved Successfully.');
|
||||
}, error => {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user