This commit is contained in:
venbatechnologies@gmail.com 2019-01-08 20:21:16 +05:30
commit 5c20c6c4eb
4 changed files with 26 additions and 13 deletions

View File

@ -9,7 +9,7 @@ import { PdTrigerService } from './../../../../../../pd-service/pd-triger.servic
styleUrls: ['./other-applicant-details.component.scss']
})
export class OtherApplicantDetailsComponent implements OnInit {
pageTitle: string ="Add Individual Details";
pageTitle: string ="Add Name of Person(s) Met and Individual Loan Applicant(s) ";
public _OtherForm: FormGroup;
applicantInfo:any={'pd_co_applicant_id':"0",'applicant_name':'','is_applicant':false,'is_person_met':false, applicant_title_name:''};
titleList: any=[];

View File

@ -12,7 +12,7 @@
<!-- individuals details start-->
<mat-card>
<mat-card-header>
<mat-card-title>Individuals</mat-card-title>
<mat-card-title>Name of Person(s) Met and Individual Loan Applicant(s) </mat-card-title>
</mat-card-header>
<mat-card-content>
<mat-table [dataSource]="individualsSource" *ngIf="_generalForm.controls.individuals['controls'].length>0" formArrayName="individuals">
@ -48,7 +48,7 @@
</mat-card-content>
<mat-card-actions align="end">
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="addMoreIndividuals()"
matTooltip="Add More Individual" matTooltipPosition="left" color="primary">
matTooltip="Add More Person(s) Met/Applicant(s) " matTooltipPosition="left" color="primary">
<mat-icon>add</mat-icon>
</button>
</mat-card-actions>
@ -81,7 +81,7 @@
<!-- Person Relationship Starts Here -->
<mat-card>
<mat-card-header>
<mat-card-title> Personal Relationships </mat-card-title>
<mat-card-title> Personal Relationship </mat-card-title>
</mat-card-header>
<mat-card-content>
<mat-table [dataSource]="relationSource" *ngIf="_generalForm.controls.persons_with_relationships['controls'].length>0" formArrayName="persons_with_relationships">
@ -96,8 +96,7 @@
<ng-container matColumnDef="relation">
<mat-header-cell *matHeaderCellDef> Relation </mat-header-cell>
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
<mat-select placeholder="Relation" formControlName="relationship" style="width: 75%;">
<mat-select placeholder="Relation" formControlName="relationship" style="width: 75%;" (selectionChange)="updatePersonalRelation(i)">
<mat-option>Select</mat-option>
<mat-option [value]="member.relationship_id" *ngFor="let member of relationShipList">{{member.name + ' of' | titlecase}}</mat-option>
<mat-option value="0" > Not Applicable </mat-option>
@ -107,9 +106,8 @@
</ng-container>
<ng-container matColumnDef="relation_to">
<mat-header-cell *matHeaderCellDef> Relationship To </mat-header-cell>
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
<mat-select placeholder="Applicant" formControlName="relation_to" style="width: 75%;">
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i" [style.visibility]="_generalForm.controls.persons_with_relationships.value[i].relationship==0 ? 'hidden':'visible'">
<mat-select placeholder="Applicant" formControlName="relation_to" style="width: 75%;" [disabled]="_generalForm.controls.persons_with_relationships.value[i].relationship==0">
<mat-option>Select</mat-option>
<mat-option *ngFor="let appc of individualsList" [value]="appc.pd_co_applicant_id">{{appc.applicant_name | titlecase}}</mat-option>
<mat-option value="0" > Not Applicable </mat-option>
@ -143,7 +141,7 @@
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
<mat-select placeholder="Applicant" formControlName="applicant_name" style="width: 75%;">
<mat-option *ngFor="let appc of individualsList" [value]="appc.pd_co_applicant_id">{{appc.applicant_name | titlecase}}</mat-option>
<mat-option *ngFor="let bothC of individualsListBothCase" [value]="bothC.pd_co_applicant_id">{{bothC.applicant_name | titlecase}}</mat-option>
</mat-select>
</mat-cell>
@ -151,7 +149,7 @@
<ng-container matColumnDef="company_relationship">
<mat-header-cell *matHeaderCellDef> Relation </mat-header-cell>
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
<mat-select placeholder="Relation" formControlName="company_relationship" style="width: 75%;">
<mat-select placeholder="Relation" formControlName="company_relationship" style="width: 75%;" (selectionChange)="updateCompanyRelation(i)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let comrelShip of companyRelationShipList" [value]="comrelShip.company_relationship_id">
{{comrelShip.name + ' of' | titlecase}}
@ -165,7 +163,7 @@
<mat-header-cell *matHeaderCellDef> Company </mat-header-cell>
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
<mat-select placeholder="Company / Firm" formControlName="relation_to_company" style="width: 75%;">
<mat-select placeholder="Company / Firm" formControlName="relation_to_company" style="width: 75%;" [style.visibility]="_generalForm.controls.company_with_relationships.value[i].company_relationship==0 ? 'hidden':'visible'">
<mat-option>Select</mat-option>
<mat-option *ngFor="let comp of companyList" [value]="comp.company_order_id">
{{comp.company_name}}

View File

@ -30,6 +30,7 @@ export class GeneralInfoComponent implements OnInit {
companyRelationShipList:any=[];
errorMessage:any;
individualsList: any=[];
individualsListBothCase: any=[];
companyList: any=[];
@ -51,6 +52,7 @@ export class GeneralInfoComponent implements OnInit {
let control = <FormArray>this._generalForm.controls['individuals'];
this.individualsSource.data =control.controls;
this.individualsList = control.value.filter(element =>element.is_applicant===true);
this.individualsListBothCase = control.value.filter(element =>element.is_applicant===true || element.is_person_met===true);
});
// update company details
this._generalForm.controls['companies'].valueChanges.subscribe(val=>{
@ -426,6 +428,19 @@ export class GeneralInfoComponent implements OnInit {
control.removeAt(findex);
}
// update personal relation
updatePersonalRelation(indexVal) {
let control: any = <FormArray>this._generalForm.controls['persons_with_relationships'];
control.controls[indexVal].value.relationship==0 ? control.controls[indexVal].controls['relation_to'].setValue('') : control.controls[indexVal].controls['relation_to'].setValue(control.controls[indexVal].value.relation_to);
}
// update company relation
updateCompanyRelation(indexVal) {
let control:any = <FormArray>this._generalForm.controls['company_with_relationships'];
control.controls[indexVal].value.company_relationship==0 ? control.controls[indexVal].controls['relation_to_company'].setValue('') : control.controls[indexVal].controls['relation_to_company'].setValue(control.controls[indexVal].value.relation_to_company);
}
// submit form details
submitGeneralForm(formData:any) {
if (this._generalForm.invalid) {
@ -438,7 +453,6 @@ export class GeneralInfoComponent implements OnInit {
// this.notifier.notify('warning', 'Please Choose Name of Person Met.!');
// }
else{
console.log('else',this._generalForm.value);
let saveRecords:any = {}
saveRecords.pdid=formData.pdid;
saveRecords.formid=formData.formid;

View File

@ -114,6 +114,7 @@ export class DialogEntityEditListTatComponent implements OnInit {
tatListEditForm: FormGroup;
tatEditAddForm: FormGroup;
submitted: Boolean = false;
listShow: Boolean = false;
/**
* Notifier service
*/