family details applicant name added : kdk

This commit is contained in:
dineshkumarkannan 2018-12-20 11:27:54 +05:30
parent 98f55b8893
commit d8ba6e15b7
2 changed files with 12 additions and 112 deletions

View File

@ -25,8 +25,8 @@
<div>
<mat-form-field>
<mat-select placeholder="Select a person" formControlName="selected_person" required>
<mat-option value="{{person.id}}" *ngFor="let person of selectPerson">
{{person.name}}
<mat-option value="{{person.pd_co_applicant_id}}" *ngFor="let person of selectPerson">
{{person.applicant_name}}
</mat-option>
</mat-select>
</mat-form-field>
@ -144,102 +144,6 @@
</div>
</div>
<!--<mat-card>
<mat-card-header>
<p>Earning Members
</p>
</mat-card-header>
<div formArrayName="earningMembers">
<div *ngFor="let item of familyForm.controls.earningMembers['controls']; let i=index" [formGroupName]="i">
<mat-card-content class="matcards">
<mat-form-field>
<input matInput placeholder="Name" formControlName="earning_member_name" required>
</mat-form-field>
<mat-form-field>
<input matInput placeholder="Age" (keypress)="keyPress($event)" formControlName="earning_member_age" required>
</mat-form-field>
<mat-form-field>
<mat-select placeholder="Relation" formControlName="relation" required>
<mat-option value="{{relations.relationship_id}}" *ngFor="let relations of relationData">
{{relations.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-select placeholder="Segment" formControlName="segment" required>
<mat-option value="{{cusSeg.customer_segment_id}}" *ngFor="let cusSeg of customerSegData">
{{cusSeg.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<input matInput placeholder="Income / Revenue" formControlName="income" required>
</mat-form-field>
<mat-form-field>
<input matInput placeholder="Name of Employer / Business" formControlName="employer_name" required>
</mat-form-field>
<button type="button" mat-raised-button mat-icon-button *ngIf="i==0" color="primary" matTooltip="Add More Earning Members"
matTooltipPosition="above" (click)="addearningMembers()">
<mat-icon>add</mat-icon>
</button>
<button type="button" mat-raised-button mat-icon-button matTooltip="Delete" matTooltipPosition="above" (click)="deleteEarningMembers(i)"
*ngIf="i>0">
<mat-icon>delete</mat-icon>
</button>
</mat-card-content>
</div>
</div>
</mat-card>
<mat-card>
<mat-card-header>
<p>Non Earning Members
</p>
</mat-card-header>
<div formArrayName="nonEarningMembers">
<div *ngFor="let members of familyForm.controls.nonEarningMembers['controls']; let i=index" [formGroupName]="i">
<mat-card-content class="matcard">
<mat-form-field>
<input matInput placeholder="Name" formControlName="non_earning_member_name" required>
</mat-form-field>
<mat-form-field>
<input matInput placeholder="Age" (keypress)="keyPress($event)" formControlName="non_earning_member_age" required>
</mat-form-field>
<mat-form-field>
<mat-select placeholder="Relation" formControlName="relationship" required>
<mat-option value="{{relation.relationship_id}}" *ngFor="let relation of relationData">
{{relation.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-select placeholder="Occupation" formControlName="occupation" required>
<mat-option value="{{occupation.occupation_non_earning_member_id}}" *ngFor="let occupation of occupationData">{{occupation.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="members['controls'].occupation.value==3">
<input matInput placeholder="Retired From" formControlName="retired">
</mat-form-field>
<mat-form-field *ngIf="members['controls'].occupation.value==9">
<input matInput placeholder="Specify Others Occupation" formControlName="others_occupation">
</mat-form-field>
<button type="button" mat-raised-button mat-icon-button (click)="addMembers()" color="primary" matTooltip="Add More Non Earning Members"
matTooltipPosition="above" *ngIf="i==0">
<mat-icon>add</mat-icon>
</button>
<button type="button" mat-raised-button mat-icon-button (click)="deleteMembers(i)" matTooltip="Delete" matTooltipPosition="above"
*ngIf="i>0">
<mat-icon>delete</mat-icon>
</button>
</mat-card-content>
</div>
</div>
</mat-card>-->
</mat-card-content>
</mat-card>
</div>

View File

@ -36,14 +36,14 @@ export class FamilyDetailsComponent implements OnInit {
private notifier: NotifierService;
public familyForm: FormGroup;
selectPerson = [{
name : 'person 1',
id : 111
}, {
name : 'person 2',
id : 222
}];
public selectPerson;
// selectPerson = [{
// name : 'person 1',
// id : 111
// }, {
// name : 'person 2',
// id : 222
// }];
earningStatus = [{
type: 'Earning',
@ -65,6 +65,8 @@ export class FamilyDetailsComponent implements OnInit {
private router: Router,
private _pd: PdTrigerService,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
console.log(pd_all_details);
this.selectPerson = this.pd_all_details.pdapplicants_detials;
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 6;
this.notifier = notifier;
@ -136,8 +138,6 @@ export class FamilyDetailsComponent implements OnInit {
public initFamilyForm(): void {
this.familyForm = this.fb.group({
selected_person: ['', Validators.compose([Validators.required])],
// personOther: [''],
// members: ['', Validators.compose([Validators.required])],
residence_place: ['', Validators.compose([])],
residence_city: ['', Validators.compose([])],
residence_state: ['', Validators.compose([])],
@ -146,12 +146,8 @@ export class FamilyDetailsComponent implements OnInit {
residence_ownership: ['', Validators.compose([])],
ownershipOther: [''],
rent: [''],
total_number_of_family_members: ['', Validators.compose([Validators.min(1), Validators.max(20)])],
family_members_details: this.fb.array([]),
// earningMembers: this.fb.array([]),
// nonEarningMembers: this.fb.array([]),
family_details_form_remark: ['']
});
}