merge : kms

This commit is contained in:
gandhimathi 2019-03-13 11:22:42 +05:30
parent 920727fe58
commit 52eb2c28f3
7 changed files with 411 additions and 364 deletions

View File

@ -1019,7 +1019,7 @@
<div fxLayout="row wrap" class="tab_class" *ngFor="let countryList of wholesale.get('countries_where_export_done').controls; let c = index" <div fxLayout="row wrap" class="tab_class" *ngFor="let countryList of wholesale.get('countries_where_export_done').controls; let c = index"
[formGroupName]="c"> [formGroupName]="c">
<mat-form-field style="width:70%;"> <mat-form-field style="width:70%;">
<mat-label>Cities Where Max Sales Done for <mat-label>Countries Where Max Sales Done for
{{wholesale.value.main_products}}</mat-label> {{wholesale.value.main_products}}</mat-label>
<mat-label>Countries Where The Export Is Being Done for <mat-label>Countries Where The Export Is Being Done for

View File

@ -1,26 +1,14 @@
import { import { Component,OnInit,Inject,Input } from '@angular/core';
Component,
OnInit,
Inject,
Input
} from '@angular/core';
import { import { FormBuilder,FormGroup,Validators,FormArray, FormControl,} from '@angular/forms';
FormBuilder,
FormGroup,
Validators,
FormArray, FormControl,
} from '@angular/forms';
import { NotifierService } from 'angular-notifier'; import { NotifierService } from 'angular-notifier';
import { import { MatDialog,MatDialogRef,MAT_DIALOG_DATA } from '@angular/material';
MatDialog,
MatDialogRef,
MAT_DIALOG_DATA
} from '@angular/material';
/** Service */ /** Service */
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service'; import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
import { ActivatedRoute, Router } from "@angular/router"; import { ActivatedRoute, Router } from "@angular/router";
@Component({ @Component({
@ -39,9 +27,6 @@ export class CurrentLoanComponent implements OnInit {
pdid: number; pdid: number;
form_id: number; form_id: number;
applicant_details: any; applicant_details: any;
// @Input() pdid: number;
// @Input() form_id: number;
//@Input() applicant_details: any;
lenderData: any = []; lenderData: any = [];
frequencyData: any = []; frequencyData: any = [];
loanTypeData: any = []; loanTypeData: any = [];
@ -69,7 +54,6 @@ export class CurrentLoanComponent implements OnInit {
this.notifier = notifier; this.notifier = notifier;
this.applicants = this.pd_all_details.pdapplicants_detials; this.applicants = this.pd_all_details.pdapplicants_detials;
this.applicants.push({ 'pd_co_applicant_id': '0', 'applicant_name': 'Others' }); this.applicants.push({ 'pd_co_applicant_id': '0', 'applicant_name': 'Others' });
//this.OtherFlag[0] = false;
this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant; this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id; this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr; this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
@ -197,6 +181,7 @@ export class CurrentLoanComponent implements OnInit {
mode_name: element.address_label, mode_name: element.address_label,
details: [], details: [],
owner_name: element.business_name_of_the_owner, owner_name: element.business_name_of_the_owner,
other_owner: element.business_name_of_the_other_owner,
form_type: 'Data From Bussiness Address' form_type: 'Data From Bussiness Address'
}) })
}); });
@ -209,6 +194,7 @@ export class CurrentLoanComponent implements OnInit {
mode_name: element.business_assets_mode_name, mode_name: element.business_assets_mode_name,
details: element.business_details, details: element.business_details,
owner_name: element.business_name_of_the_owner, owner_name: element.business_name_of_the_owner,
other_owner: element.business_name_of_the_other_owner,
form_type: 'Data From Business Assets' form_type: 'Data From Business Assets'
}) })
}); });
@ -221,6 +207,7 @@ export class CurrentLoanComponent implements OnInit {
mode_name: element.assets_mode_name, mode_name: element.assets_mode_name,
details: element.details, details: element.details,
owner_name: element.name_of_the_owner, owner_name: element.name_of_the_owner,
other_owner: element.other_owner,
form_type: 'Data From Other Asset' form_type: 'Data From Other Asset'
}) })
}); });
@ -239,7 +226,12 @@ export class CurrentLoanComponent implements OnInit {
this.dataFromAssets.forEach((val, index) => { this.dataFromAssets.forEach((val, index) => {
if (val.mode == 0) { if (val.mode == 0) {
let owner = val.owner_name.map((e => { let owner = val.owner_name.map((e => {
return e.name.split(',') console.log(e.name.split(','));
console.log(e.name);
return (e.name == 'Others' ? val.other_owner : e.name).split(',');
})); }));
// labelarray[index] = ' : '+owner +' - '+ val.mode_name.split("/")[0] + ' ( ' + val.mode_name.split("/")[1] + ' )'; // labelarray[index] = ' : '+owner +' - '+ val.mode_name.split("/")[0] + ' ( ' + val.mode_name.split("/")[1] + ' )';
labelarray[index] = ' : ' + owner + ' - ' + val.mode_name; labelarray[index] = ' : ' + owner + ' - ' + val.mode_name;
@ -253,7 +245,8 @@ export class CurrentLoanComponent implements OnInit {
}); });
if (val.owner_name.length > 0) { if (val.owner_name.length > 0) {
owner = val.owner_name.map((e => { owner = val.owner_name.map((e => {
return e.name.split(',') // return e.name.split(',')
return (e.name == 'Others' ? val.other_owner : e.name).split(',');
})); }));
} }
@ -281,7 +274,8 @@ export class CurrentLoanComponent implements OnInit {
} }
if (val.owner_name.length > 0) { if (val.owner_name.length > 0) {
owner = val.owner_name.map((e => { owner = val.owner_name.map((e => {
return e.name.split(',') // return e.name.split(',')
return (e.name == 'Others' ? val.other_owner : e.name).split(',');
})); }));
} }
@ -296,7 +290,8 @@ export class CurrentLoanComponent implements OnInit {
}); });
if (val.owner_name.length > 0) { if (val.owner_name.length > 0) {
owner = val.owner_name.map((e => { owner = val.owner_name.map((e => {
return e.name.split(',') // return e.name.split(',')
return (e.name == 'Others' ? val.other_owner : e.name).split(',');
})); }));
} }
let description = data != '' ? ' ( ' + data + ' )' : ''; let description = data != '' ? ' ( ' + data + ' )' : '';
@ -309,7 +304,8 @@ export class CurrentLoanComponent implements OnInit {
}); });
if (val.owner_name.length > 0) { if (val.owner_name.length > 0) {
owner = val.owner_name.map((e => { owner = val.owner_name.map((e => {
return e.name.split(',') // return e.name.split(',')
return (e.name == 'Others' ? val.other_owner : e.name).split(',');
})); }));
} }
let description = data != '' ? ' ( ' + data + ' )' : ''; let description = data != '' ? ' ( ' + data + ' )' : '';
@ -319,7 +315,8 @@ export class CurrentLoanComponent implements OnInit {
let owner: any = "Owner Not Mentioned"; let owner: any = "Owner Not Mentioned";
if (val.owner_name.length > 0) { if (val.owner_name.length > 0) {
owner = val.owner_name.map((e => { owner = val.owner_name.map((e => {
return e.name.split(',') // return e.name.split(',')
return (e.name == 'Others' ? val.other_owner : e.name).split(',');
})); }));
} }
@ -335,7 +332,8 @@ export class CurrentLoanComponent implements OnInit {
}); });
if (val.owner_name.length > 0) { if (val.owner_name.length > 0) {
owner = val.owner_name.map((e => { owner = val.owner_name.map((e => {
return e.name.split(',') // return e.name.split(',')
return (e.name == 'Others' ? val.other_owner : e.name).split(',');
})); }));
} }
let description = data != '' ? '( ' + data + ' )' : ''; let description = data != '' ? '( ' + data + ' )' : '';

View File

@ -134,17 +134,20 @@
<mat-form-field style="width: 33%"> <mat-form-field style="width: 33%">
<input matInput placeholder="Gross Monthly Salary" formControlName="gross_monthly_salary" <input matInput placeholder="Gross Monthly Salary" formControlName="gross_monthly_salary"
(keypress)="keyPress($event)" required> (keypress)="keyPress($event)" required>
<mat-hint align="start" style="font-size:90%" *ngIf="employmentForm.controls['gross_monthly_salary'].value != ''">{{"&#8377;"}} {{employmentForm.controls['gross_monthly_salary'].value | numberToWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:33%"> <mat-form-field style="width:33%">
<input matInput placeholder="Net Monthly Salary" formControlName="net_monthly_salary" <input matInput placeholder="Net Monthly Salary" formControlName="net_monthly_salary"
(keypress)="keyPress($event)" required> (keypress)="keyPress($event)" required>
<mat-hint align="start" style="font-size:90%" *ngIf="employmentForm.controls['net_monthly_salary'].value != ''">{{"&#8377;"}} {{employmentForm.controls['net_monthly_salary'].value | numberToWords}} Only</mat-hint>
<!-- <input matInput placeholder="Net Take Home" <!-- <input matInput placeholder="Net Take Home"
formControlName="net_take_home"> --> formControlName="net_take_home"> -->
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 33%"> <mat-form-field style="width: 33%">
<input matInput placeholder="Bonus or Incentive" formControlName="bonus_incentive" <input matInput placeholder="Bonus or Incentive" formControlName="bonus_incentive"
(keypress)="keyPress($event)" required> (keypress)="keyPress($event)" required>
<mat-hint align="start" style="font-size:90%" *ngIf="employmentForm.controls['bonus_incentive'].value != ''">{{"&#8377;"}} {{employmentForm.controls['bonus_incentive'].value | numberToWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 33%"> <mat-form-field style="width: 33%">

View File

@ -1,240 +1,252 @@
<form [formGroup]="_neighbourhoodForm" novalidate> <form [formGroup]="_neighbourhoodForm" novalidate>
<h2 mat-dialog-title class="paragraph_change"> <h2 mat-dialog-title class="paragraph_change">
<!-- <div fxFlex="70" align="left"> --> <!-- <div fxFlex="70" align="left"> -->
<div fxFlex="70" align="left" style="padding: 10px !important;"> <div fxFlex="70" align="left" style="padding: 10px !important;">
<div fxLayout="row wrap"> <div fxLayout="row wrap">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100"> <div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} <span *ngIf="subproduct_abbr">- {{subproduct_abbr}} </span></span><br> <span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} <span *ngIf="subproduct_abbr">-
{{pageTitle}} {{subproduct_abbr}} </span></span><br>
</div> {{pageTitle}}
</div>
</div>
</div>
</div>
<div fxFlex="30" align="end" style="padding: 10px !important;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="right" mat-dialog-close><mat-icon>close</mat-icon></button>
</div>
</h2>
<mat-dialog-content>
<mat-card>
<mat-card-header>
<br>
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
<mat-radio-group formControlName="check_type" class="example-radio-group">
<mat-radio-button class="example-radio-button" color="primary" [value]="types.id" *ngFor="let types of check_type; let t = index">{{types.type_name}}</mat-radio-button>
</mat-radio-group>
</div> </div>
</mat-card-header> <div fxFlex="30" align="end" style="padding: 10px !important;">
<mat-card-content formArrayName="neighbourhood_list" *ngIf="_neighbourhoodForm.controls.check_type.value==0"> <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close"
<mat-card *ngFor="let neighbourhood of _neighbourhoodForm.controls.neighbourhood_list['controls']; let n = index; let last = last" [formGroupName]="n"> matTooltipPosition="right" mat-dialog-close>
<mat-card-content> <mat-icon>close</mat-icon>
<mat-form-field style="width: 42%"> </button>
<input matInput autocomplete="off" placeholder="Neighbour Name" formControlName="neighbourhood_name" type="text"> </div>
</mat-form-field> </h2>
<mat-form-field style="width: 40%"> <mat-dialog-content>
<!-- Do You Know the Applicant --> <mat-tab-group mat-align-tabs="center">
<mat-select placeholder=" Do you know about the applicants or their business?" formControlName="do_know"> <mat-tab *ngFor="let types of check_type; let t = index" label="{{types.type_name}}">
<mat-option>Select</mat-option> <ng-template matTabContent>
<mat-option value="Yes">Yes</mat-option> <div *ngIf="types.id==0">
<mat-option value="No">No</mat-option> <div formArrayName="neighbourhood_list">
</mat-select> <mat-card *ngFor="let neighbourhood of _neighbourhoodForm.controls.neighbourhood_list['controls']; let n = index; let last = last"
</mat-form-field> [formGroupName]="n">
<mat-card-content>
<!-- <mat-form-field style="width: 42%" *ngIf="neighbourhood.controls.do_know.value=='Yes'"> --> <mat-form-field style="width: 42%">
<!-- <input matInput autocomplete="off" placeholder="How Long to Know the Applicant " formControlName="how_long_do_know" type="text" OnlyNumber type="text"> --> <input matInput autocomplete="off" placeholder="Neighbour Name" formControlName="neighbourhood_name"
<!-- </mat-form-field> --> type="text">
</mat-form-field>
<div fxLayout="row wrap" *ngIf="neighbourhood.controls.do_know.value!=''"> <mat-form-field style="width: 40%">
<div fxFlex="80"> <!-- Do You Know the Applicant -->
<label>As per you how long has this business been in operation?</label> <mat-select placeholder=" Do you know about the applicants or their business?"
<mat-form-field *ngIf="!this.isDisplay[n]"> formControlName="do_know">
<input matInput autocomplete="off" placeholder="Year(s)" formControlName="how_long_do_know_in_year" OnlyNumber type="text"> <mat-option>Select</mat-option>
</mat-form-field> <mat-option value="Yes">Yes</mat-option>
<mat-form-field *ngIf="!this.isDisplay[n]"> <mat-option value="No">No</mat-option>
<input matInput autocomplete="off" placeholder="Month(s)" formControlName="how_long_do_know_in_month" OnlyNumber type="text" (change)="ConvertMonthintoYear(neighbourhood,$event.target.value,1)"> </mat-select>
</mat-form-field> </mat-form-field>
<div fxLayout="row wrap" *ngIf="neighbourhood.controls.do_know.value!=''">
<div fxFlex="80">
<label>As per you how long has this business been in operation?</label>
<mat-form-field *ngIf="!this.isDisplay[n]">
<input matInput autocomplete="off" placeholder="Year(s)" formControlName="how_long_do_know_in_year"
OnlyNumber type="text">
</mat-form-field>
<mat-form-field *ngIf="!this.isDisplay[n]">
<input matInput autocomplete="off" placeholder="Month(s)" formControlName="how_long_do_know_in_month"
OnlyNumber type="text" (change)="ConvertMonthintoYear(neighbourhood,$event.target.value,1)">
</mat-form-field>
</div>
<div fxFlex="10" style="text-align: center;">
<label>Do not know</label>
<div>
<mat-checkbox color="primary" formControlName="did_not_know_the_business_operation"
(change)="toggleVisibility($event.checked,n,1)"></mat-checkbox>
</div>
</div>
</div>
<div fxLayout="row wrap" *ngIf="neighbourhood.controls.do_know.value!=''">
<div fxFlex="60">
<mat-form-field style="width: 95%" *ngIf="neighbourhood.controls.do_know.value!='' && !isDisplay2[n] ; else OtherCondition;">
<mat-select multiple placeholder="Who is the owner of the organisation?"
formControlName="organisation_owner" [compareWith]="compareObjects"
(selectionChange)="getOtherOrganisationOwner($event.value,n)">
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val">
{{val.name}}
</mat-option>
</mat-optgroup>
</mat-select>
</mat-form-field>
<ng-template #OtherCondition>
<label>Who is the owner of the organisation?</label>
</ng-template>
</div>
<div fxFlex="20">
<mat-form-field style="width: 95%" *ngIf="isOrganisationOwner[n]">
<input matInput autocomplete="off" placeholder="Specify Owner name" formControlName="other_organisation_owner"
type="text">
</mat-form-field>
</div>
<div fxFlex="10" style="text-align: center;">
<label>Do not know</label>
<div>
<mat-checkbox color="primary" formControlName="did_not_know_the_owner" (change)="toggleVisibility($event.checked,n,2)"></mat-checkbox>
</div>
</div>
</div>
</mat-card-content>
<mat-card-actions align="center">
<button type="button" mat-flat-button (click)="removeNeighbourhood(n)" *ngIf="_neighbourhoodForm.controls.neighbourhood_list.controls.length > 1"
matTooltip="Delete" matTooltipPosition="left" color="primary">
<strong>Delete Neighbourhood </strong>
</button>
</mat-card-actions>
</mat-card>
</div> </div>
<div fxFlex="10" style="text-align: center;"> <mat-form-field style="width: 40%">
<label>Do not know</label> <mat-select placeholder="Status of the check as per PD officer?" formControlName="neighbourhood_status">
<div> <mat-option>Select</mat-option>
<mat-checkbox color="primary" formControlName="did_not_know_the_business_operation" (change)="toggleVisibility($event.checked,n,1)"></mat-checkbox> <mat-option value="Positive">Positive</mat-option>
</div> <mat-option value="Negative">Negative</mat-option>
</div>
</div>
<!-- <div fxLayout="row wrap" *ngIf="neighbourhood.controls.do_know.value==''">
<mat-form-field>
<input matInput autocomplete="off" placeholder="Who is the owner of the organisation?" formControlName="how_long_do_know_in_year">
</mat-form-field>
</div> -->
<!-- <mat-form-field style="width: 42%" *ngIf="neighbourhood.controls.do_know.value!=''">
<mat-select placeholder="Is the Applicant Owner" formControlName="is_applicant_owner">
<mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option>
</mat-select>
</mat-form-field> -->
<div fxLayout="row wrap" *ngIf="neighbourhood.controls.do_know.value!=''">
<div fxFlex="60">
<mat-form-field style="width: 95%" *ngIf="neighbourhood.controls.do_know.value!='' && !isDisplay2[n] ; else OtherCondition;">
<!-- <mat-select placeholder="Who is the owner of the organisation?" formControlName="organisation_owner">
<mat-option>Select</mat-option>
<mat-option *ngFor="let list of applicants" [value]="list.pd_co_applicant_id">{{list.applicant_name}}</mat-option>
</mat-select> -->
<mat-select multiple placeholder="Who is the owner of the organisation?" formControlName="organisation_owner" [compareWith]="compareObjects" (selectionChange)="getOtherOrganisationOwner($event.value,n)">
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val">
{{val.name}}
</mat-option>
</mat-optgroup>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<ng-template #OtherCondition> </div>
<label>Who is the owner of the organisation?</label> <div *ngIf="types.id==1">
</ng-template> <mat-card-content formArrayName="referencecheck_list">
</div> <mat-card *ngFor="let reference of _neighbourhoodForm.controls.referencecheck_list['controls']; let r = index;let last =last"
<div fxFlex="20"> [formGroupName]="r">
<mat-form-field style="width: 95%" *ngIf="isOrganisationOwner[n]"> <mat-card-content>
<input matInput autocomplete="off" placeholder="Specify Owner name" formControlName="other_organisation_owner" type="text"> <mat-form-field style="width: 25%">
</mat-form-field> <input matInput autocomplete="off" placeholder="Name" formControlName="reference_name" type="text">
</div> </mat-form-field>
<div fxFlex="10" style="text-align: center;"> <mat-form-field style="width: 24%">
<label>Do not know</label> <input matInput autocomplete="off" placeholder="Mobile Number" formControlName="mobile"
<div> type="text" OnlyNumber type="text">
<mat-checkbox color="primary" formControlName="did_not_know_the_owner" (change)="toggleVisibility($event.checked,n,2)"></mat-checkbox> <mat-error *ngIf="reference['controls'].mobile.hasError('maxlength') || reference['controls'].mobile.hasError('minlength')">Enter
</div> Valid Mobile Number. </mat-error>
</div> </mat-form-field>
</div> <mat-form-field style="width: 12%">
</mat-card-content> <input matInput autocomplete="off" placeholder=" STD " formControlName="std_code" type="text"
<mat-card-actions align="center"> OnlyNumber type="text">
<!-- <button type="button" mat-raised-button mat-icon-button <mat-error *ngIf="reference['controls'].std_code.hasError('maxlength') || reference['controls'].std_code.hasError('minlength')">Enter
matTooltip="Remove Neighbourhood" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="n!=0"> Valid STD Code. </mat-error>
<mat-icon>delete</mat-icon></button> --> </mat-form-field> <span>-</span>
<mat-form-field style="width: 20%">
<button type="button" mat-flat-button (click)="removeNeighbourhood(n)" *ngIf="_neighbourhoodForm.controls.neighbourhood_list.controls.length > 1" <input matInput autocomplete="off" placeholder="Landline Number" formControlName="landline"
matTooltip="Delete"matTooltipPosition="left" color="primary"> type="text" OnlyNumber type="text">
<strong>Delete Neighbourhood </strong> <mat-error *ngIf="reference['controls'].landline.hasError('maxlength') || reference['controls'].landline.hasError('minlength')">Enter
</button> Valid Landline Number. </mat-error>
</mat-card-actions> </mat-form-field>
</mat-card> <mat-form-field style="width: 28%">
</mat-card-content> <textarea matInput autocomplete="off" placeholder="Location" formControlName="location"></textarea>
<div *ngIf="_neighbourhoodForm.controls.check_type.value==0"> </mat-form-field>
<mat-form-field style="width: 40%"> <mat-form-field style="width: 28%">
<mat-select placeholder="Status of the check as per PD officer?" formControlName="neighbourhood_status">
<mat-option>Select</mat-option>
<mat-option value="Positive">Positive</mat-option>
<mat-option value="Negative">Negative</mat-option>
</mat-select>
</mat-form-field>
</div>
<mat-card-content formArrayName="referencecheck_list" *ngIf="_neighbourhoodForm.controls.check_type.value==1">
<mat-card *ngFor="let reference of _neighbourhoodForm.controls.referencecheck_list['controls']; let r = index;let last =last" [formGroupName]="r">
<mat-card-content>
<mat-form-field style="width: 25%">
<input matInput autocomplete="off" placeholder="Name" formControlName="reference_name" type="text">
</mat-form-field>
<mat-form-field style="width: 24%">
<input matInput autocomplete="off" placeholder="Mobile Number" formControlName="mobile" type="text" OnlyNumber type="text">
<mat-error *ngIf="reference['controls'].mobile.hasError('maxlength') || reference['controls'].mobile.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</mat-form-field>
<mat-form-field style="width: 12%">
<input matInput autocomplete="off" placeholder=" STD " formControlName="std_code" type="text" OnlyNumber type="text">
<mat-error *ngIf="reference['controls'].std_code.hasError('maxlength') || reference['controls'].std_code.hasError('minlength')">Enter Valid STD Code. </mat-error>
</mat-form-field> <span>-</span>
<mat-form-field style="width: 20%">
<input matInput autocomplete="off" placeholder="Landline Number" formControlName="landline" type="text" OnlyNumber type="text">
<mat-error *ngIf="reference['controls'].landline.hasError('maxlength') || reference['controls'].landline.hasError('minlength')">Enter Valid Landline Number. </mat-error>
</mat-form-field>
<mat-form-field style="width: 28%">
<textarea matInput autocomplete="off" placeholder="Location" formControlName="location"></textarea>
</mat-form-field>
<mat-form-field style="width: 28%">
<mat-select placeholder="Relation With Business" formControlName="relationship_with">
<mat-option>Select</mat-option>
<mat-option *ngFor="let relationship of busineesRelationshipList" [value]="relationship.relation_with_business_id">
{{relationship.relation_with_business_name | titlecase}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 30%" *ngIf="reference.controls.relationship_with.value==1">
<input matInput autocomplete="off" placeholder="Specify Business Relation" formControlName="others" type="text">
</mat-form-field>
<p #period_paragraph>Period of Relationship</p>
<mat-form-field style="width: 12%">
<input matInput autocomplete="off" placeholder="Year(s)" formControlName="year_relation_applicant" OnlyNumber type="text">
</mat-form-field>
<mat-form-field style="width: 12%">
<input matInput autocomplete="off" placeholder="Month(s)" formControlName="months_relation_applicant" OnlyNumber type="text" (change)="ConvertMonthintoYear(reference,$event.target.value,2)">
</mat-form-field>
<mat-form-field style="width: 28%">
<input matInput autocomplete="off" [placeholder]="reference.controls.relationship_with.value ==4 ? 'Rent Amount' : 'Volume of Business'" formControlName="business_volume_amount" type="text" OnlyNumber type="text" (keyup)="inWords($event,r)">
<mat-hint align="start" style="font-size:70%" *ngIf="reference.controls.business_volume_amount.value != ''">{{"&#8377;"}} {{amtInwords[r]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width: 22%">
<mat-select placeholder="Unit" formControlName="business_volume_unit">
<mat-option>Select</mat-option>
<mat-option *ngFor="let volume of volumeunitList" [value]="volume.frequency_id">
{{volume.name | titlecase}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 30%" *ngIf="reference.controls.business_volume_unit.value==1">
<input matInput autocomplete="off" placeholder="Specify Unit" formControlName="others_unit" type="text">
</mat-form-field>
<span style="width:100%">
<mat-form-field style="width: 55%">
<mat-select placeholder=" Final remarks of PD officer on Reference Check done" formControlName="reference_final_remarks">
<mat-option>Select</mat-option>
<mat-option *ngFor="let remark of finalRemarksList" [value]="remark.id">
{{remark.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 30%" *ngIf="reference.controls.reference_final_remarks.value != '' ">
<input matInput autocomplete="off" placeholder="Specify Remarks" formControlName="specify_final_remark" type="text">
</mat-form-field>
</span> <mat-select placeholder="Relation With Business" formControlName="relationship_with">
<!-- <button type="button" mat-raised-button mat-icon-button (click)="removeReferencecheck(r)" <mat-option>Select</mat-option>
matTooltip="Remove Reference Check" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="r!=0"> <mat-option *ngFor="let relationship of busineesRelationshipList" [value]="relationship.relation_with_business_id">
<mat-icon>delete</mat-icon></button> --> {{relationship.relation_with_business_name | titlecase}}
</mat-card-content> </mat-option>
<mat-card-actions align="center"> </mat-select>
<button type="button" mat-flat-button (click)="removeReferencecheck(r)" *ngIf="_neighbourhoodForm.controls.referencecheck_list.controls.length > 1" </mat-form-field>
matTooltip="Delete"matTooltipPosition="left" color="primary"> <mat-form-field style="width: 30%" *ngIf="reference.controls.relationship_with.value==1">
<strong>Delete Reference Check </strong> <input matInput autocomplete="off" placeholder="Specify Business Relation" formControlName="others"
</button> type="text">
</mat-card-actions> </mat-form-field>
</mat-card> <p #period_paragraph>Period of Relationship</p>
<mat-form-field style="width: 12%">
</mat-card-content> <input matInput autocomplete="off" placeholder="Year(s)" formControlName="year_relation_applicant"
<mat-card-actions align="end"> OnlyNumber type="text">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Add More" matTooltipPosition="above" (click)="_neighbourhoodForm.controls.check_type.value==0 ? addNeighbourhood() : addReferencecheck()" color="primary"><mat-icon>add</mat-icon></button> </mat-form-field>
</mat-card-actions> <mat-form-field style="width: 12%">
<input matInput autocomplete="off" placeholder="Month(s)" formControlName="months_relation_applicant"
OnlyNumber type="text" (change)="ConvertMonthintoYear(reference,$event.target.value,2)">
</mat-form-field>
<mat-form-field style="width: 28%">
<input matInput autocomplete="off" [placeholder]="reference.controls.relationship_with.value ==4 ? 'Rent Amount' : 'Volume of Business'"
formControlName="business_volume_amount" type="text" OnlyNumber type="text" (keyup)="inWords($event,r)">
<mat-hint align="start" style="font-size:70%" *ngIf="reference.controls.business_volume_amount.value != ''">{{"&#8377;"}}
{{amtInwords[r]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width: 22%">
<mat-select placeholder="Unit" formControlName="business_volume_unit">
<mat-option>Select</mat-option>
<mat-option *ngFor="let volume of volumeunitList" [value]="volume.frequency_id">
{{volume.name | titlecase}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 30%" *ngIf="reference.controls.business_volume_unit.value==1">
<input matInput autocomplete="off" placeholder="Specify Unit" formControlName="others_unit"
type="text">
</mat-form-field>
<span style="width:100%">
<mat-form-field style="width: 55%">
<mat-select placeholder=" Final remarks of PD officer on Reference Check done"
formControlName="reference_final_remarks">
<mat-option>Select</mat-option>
<mat-option *ngFor="let remark of finalRemarksList" [value]="remark.id">
{{remark.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 30%" *ngIf="reference.controls.reference_final_remarks.value != '' ">
<input matInput autocomplete="off" placeholder="Specify Remarks" formControlName="specify_final_remark"
type="text">
</mat-form-field>
</span>
</mat-card-content>
<mat-card-actions align="center">
<button type="button" mat-flat-button (click)="removeReferencecheck(r)" *ngIf="_neighbourhoodForm.controls.referencecheck_list.controls.length > 1"
matTooltip="Delete" matTooltipPosition="left" color="primary">
<strong>Delete Reference Check </strong>
</button>
</mat-card-actions>
</mat-card>
</mat-card-content>
</div>
<mat-card-actions align="end">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Add More"
matTooltipPosition="above" (click)="types.id==0 ? addNeighbourhood() : addReferencecheck()"
color="primary">
<mat-icon>add</mat-icon>
</button>
</mat-card-actions>
</ng-template>
</mat-tab>
</mat-tab-group>
</mat-card> <!-- <mat-card>
</mat-dialog-content> <mat-card-header>
<br>
<mat-dialog-actions> <div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
<div fxFlex="60" class="pb-0 text-sm-left" align="left"> <mat-radio-group formControlName="check_type" class="example-radio-group">
<mat-form-field appearance="outline" style="width: 100%"> <mat-radio-button class="example-radio-button" color="primary" [value]="types.id" *ngFor="let types of check_type; let t = index">{{types.type_name}}</mat-radio-button>
<mat-label>Remarks</mat-label> </mat-radio-group>
<textarea matInput autocomplete="off" placeholder="Remarks" formControlName="neighbour_reference_remark" ></textarea> </div>
</mat-form-field> </mat-card-header>
</div> </mat-card> -->
<div fxFlex="40" align="end"> </mat-dialog-content>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Save" matTooltipPosition="above" (click)="saveNeighbourhood(_neighbourhoodForm.value)"><mat-icon>save</mat-icon></button>
</div> <mat-dialog-actions>
<div fxFlex="60" class="pb-0 text-sm-left" align="left">
</mat-dialog-actions> <mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label>
<textarea matInput autocomplete="off" placeholder="Remarks" formControlName="neighbour_reference_remark"></textarea>
</mat-form-field>
</div>
<div fxFlex="40" align="end">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Save"
matTooltipPosition="above" (click)="saveNeighbourhood(_neighbourhoodForm.value)">
<mat-icon>save</mat-icon>
</button>
</div>
</mat-dialog-actions>
</form> </form>
<notifier-container></notifier-container> <notifier-container></notifier-container>

View File

@ -4,11 +4,13 @@ import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition} from '@angul
import { NotifierService } from 'angular-notifier'; import { NotifierService } from 'angular-notifier';
import { PdTrigerService } from './../../../../../pd-service/pd-triger.service'; import { PdTrigerService } from './../../../../../pd-service/pd-triger.service';
import { parse } from 'url'; import { parse } from 'url';
@Component({ @Component({
selector: 'app-neighbour-hood', selector: 'app-neighbour-hood',
templateUrl: './neighbour-hood.component.html', templateUrl: './neighbour-hood.component.html',
styleUrls: ['./neighbour-hood.component.scss'] styleUrls: ['./neighbour-hood.component.scss']
}) })
export class NeighbourHoodComponent implements OnInit { export class NeighbourHoodComponent implements OnInit {
customer_segment_abbr: any; customer_segment_abbr: any;
subproduct_abbr: any; subproduct_abbr: any;
@ -22,7 +24,7 @@ export class NeighbourHoodComponent implements OnInit {
form_id:number; form_id:number;
private notifier: NotifierService; private notifier: NotifierService;
check_type:any=[{'id':0,'type_name':'Neighbourhood Check'},{'id':1,'type_name':'Reference Check'}] check_type:any=[{'id':0,'type_name':'Neighbourhood'},{'id':1,'type_name':'Reference'}]
default_reference_details: any= {'reference_name':'','mobile':'','landline':'-','location':'','relationship_with':'','year_relation_applicant':'','months_relation_applicant':'','business_volume_amount':'','business_volume_unit':'','reference_final_remarks':'','positive_remark':'','negative_remark':'','insufficient_info_remark':''}; default_reference_details: any= {'reference_name':'','mobile':'','landline':'-','location':'','relationship_with':'','year_relation_applicant':'','months_relation_applicant':'','business_volume_amount':'','business_volume_unit':'','reference_final_remarks':'','positive_remark':'','negative_remark':'','insufficient_info_remark':''};
default_neighbourhood_details: any= {'neighbourhood_name':'','do_know':'','how_long_do_know_in_year':'','how_long_do_know_in_month':'','is_applicant_owner':'','did_not_know_the_business_operation':'','organisation_owner':'','other_organisation_owner':'','did_not_know_the_owner':''}; default_neighbourhood_details: any= {'neighbourhood_name':'','do_know':'','how_long_do_know_in_year':'','how_long_do_know_in_month':'','is_applicant_owner':'','did_not_know_the_business_operation':'','organisation_owner':'','other_organisation_owner':'','did_not_know_the_owner':''};
@ -33,25 +35,24 @@ export class NeighbourHoodComponent implements OnInit {
finalRemarksList : any = [{'id': 1,'name': "Positive"}, finalRemarksList : any = [{'id': 1,'name': "Positive"},
{'id': 2,'name': "Negative"}, {'id': 2,'name': "Negative"},
{'id': 3,'name': "Insufficient information provided"}]; {'id': 3,'name': "Insufficient information provided"}];
existCompanyList: any =[]; existCompanyList: any =[];
mergeCompanyApplicant: any=[]; mergeCompanyApplicant: any=[];
isOrganisationOwner: any=[]; isOrganisationOwner: any=[];
amtInwords : any = []; amtInwords : any = [];
// isOtherApplicant: any = []; // isOtherApplicant: any = [];
constructor(notifier: NotifierService, private _pd: PdTrigerService ,private _fb: FormBuilder, @Inject(MAT_DIALOG_DATA) public data: any,private dialogRef: MatDialogRef<NeighbourHoodComponent>) { constructor(notifier: NotifierService, private _pd: PdTrigerService ,private _fb: FormBuilder, @Inject(MAT_DIALOG_DATA) public data: any,private dialogRef: MatDialogRef<NeighbourHoodComponent>) {
this.pdid = this.data.pdmaster_details.pd_id; this.pdid = this.data.pdmaster_details.pd_id;
this.notifier = notifier; this.notifier = notifier;
this.form_id = 19; this.form_id = 19;
this.main_applicant = this.data.pdmaster_details.main_applicant; this.main_applicant = this.data.pdmaster_details.main_applicant;
this.lender_applicant_id = this.data.pdmaster_details.lender_applicant_id; this.lender_applicant_id = this.data.pdmaster_details.lender_applicant_id;
this.subproduct_abbr = this.data.pdmaster_details.subproduct_abbr; this.subproduct_abbr = this.data.pdmaster_details.subproduct_abbr;
this.customer_segment_abbr = this.data.pdmaster_details.customer_segment_abbr; this.customer_segment_abbr = this.data.pdmaster_details.customer_segment_abbr;
this.applicants = this.data.pdapplicants_detials; this.applicants = this.data.pdapplicants_detials;
this.applicants = this.applicants.filter(appt=>appt.applicant_type != 2); this.applicants = this.applicants.filter(appt=>appt.applicant_type != 2);
this.applicants.push({'pd_co_applicant_id': 0,'applicant_name': "Others"}) this.applicants.push({'pd_co_applicant_id': 0,'applicant_name': "Others"})
}
}
ngOnInit() { ngOnInit() {
this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{ this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
@ -78,28 +79,29 @@ amtInwords : any = [];
} }
}) })
this.initFormDetails(); this.initFormDetails();
// call neghbourhhod / reference check changes // call neghbourhhod / reference check changes
this._neighbourhoodForm.controls['check_type'].valueChanges.subscribe(value => { // this._neighbourhoodForm.controls['check_type'].valueChanges.subscribe(value => {
const referencecheckControl = <FormArray>this._neighbourhoodForm.controls['referencecheck_list']; // const referencecheckControl = <FormArray>this._neighbourhoodForm.controls['referencecheck_list'];
const neighbourhoodControl = <FormArray>this._neighbourhoodForm.controls['neighbourhood_list']; // const neighbourhoodControl = <FormArray>this._neighbourhoodForm.controls['neighbourhood_list'];
if(value==0){ // if(value==0){
referencecheckControl.controls = []; // referencecheckControl.controls = [];
referencecheckControl.setValue([]); // referencecheckControl.setValue([]);
if(neighbourhoodControl.value.length==0){ // if(neighbourhoodControl.value.length==0){
neighbourhoodControl.push(this.createNeighbourhood(this.default_neighbourhood_details)); // neighbourhoodControl.push(this.createNeighbourhood(this.default_neighbourhood_details));
} // }
} // }
else { // else {
neighbourhoodControl.controls = []; // neighbourhoodControl.controls = [];
neighbourhoodControl.setValue([]); // neighbourhoodControl.setValue([]);
if(referencecheckControl.value.length==0){ // if(referencecheckControl.value.length==0){
referencecheckControl.push(this.createReerenceCheck(this.default_reference_details)); // referencecheckControl.push(this.createReerenceCheck(this.default_reference_details));
} // }
} // }
}); // });
} }
@ -108,7 +110,7 @@ amtInwords : any = [];
this._neighbourhoodForm = this._fb.group({ this._neighbourhoodForm = this._fb.group({
pdid:this.pdid, pdid:this.pdid,
formid:this.form_id, formid:this.form_id,
check_type:0, // check_type:0,
neighbourhood_list: this._fb.array([]), neighbourhood_list: this._fb.array([]),
neighbourhood_status:'', neighbourhood_status:'',
referencecheck_list: this._fb.array([]), referencecheck_list: this._fb.array([]),
@ -127,15 +129,15 @@ amtInwords : any = [];
params.pd_id = this.pdid; params.pd_id = this.pdid;
params.pd_form_id = '19'; params.pd_form_id = '19';
let referencecheckControl = <FormArray>this._neighbourhoodForm.controls['referencecheck_list']; let referencecheckControl = <FormArray>this._neighbourhoodForm.controls['referencecheck_list'];
referencecheckControl.controls = []; referencecheckControl.controls = [];
const neighbourhoodControl = <FormArray>this._neighbourhoodForm.controls['neighbourhood_list']; const neighbourhoodControl = <FormArray>this._neighbourhoodForm.controls['neighbourhood_list'];
neighbourhoodControl.controls=[]; neighbourhoodControl.controls=[];
this._pd.retriveForm(params).subscribe(data => { this._pd.retriveForm(params).subscribe(data => {
if(data.dataStatus) { if(data.dataStatus) {
let exist_ref_details = data.records.referencecheck_list ? Object.keys(data.records.referencecheck_list).map((item)=>data.records.referencecheck_list[item]) : []; let exist_ref_details = data.records.referencecheck_list ? Object.keys(data.records.referencecheck_list).map((item)=>data.records.referencecheck_list[item]) : [];
let exist_neighbourhood_details = data.records.neighbourhood_list ? Object.keys(data.records.neighbourhood_list).map((item)=>data.records.neighbourhood_list[item]) : []; let exist_neighbourhood_details = data.records.neighbourhood_list ? Object.keys(data.records.neighbourhood_list).map((item)=>data.records.neighbourhood_list[item]) : [];
if(exist_neighbourhood_details.length>0 && data.records.check_type==0){ if(exist_neighbourhood_details.length>0){ /** && data.records.check_type==0 */
exist_neighbourhood_details.forEach((element,index) => { exist_neighbourhood_details.forEach((element,index) => {
this.toggleVisibility(element.did_not_know_the_business_operation,index,1); this.toggleVisibility(element.did_not_know_the_business_operation,index,1);
this.toggleVisibility(element.did_not_know_the_owner,index,2); this.toggleVisibility(element.did_not_know_the_owner,index,2);
// this.selectedApplicants(referencecheckControl,element.organisation_owner,index); // this.selectedApplicants(referencecheckControl,element.organisation_owner,index);
@ -143,23 +145,24 @@ amtInwords : any = [];
this.getOtherOrganisationOwner(element.organisation_owner,index); this.getOtherOrganisationOwner(element.organisation_owner,index);
}); });
} }
else if(exist_ref_details.length>0 && data.records.check_type==1){ if(exist_ref_details.length>0){ /**&& data.records.check_type==1 */
exist_ref_details.forEach((element,index) => { exist_ref_details.forEach((element,index) => {
this.amtInwords[index] = this._pd.convertNumberToWords(element.business_volume_amount); this.amtInwords[index] = this._pd.convertNumberToWords(element.business_volume_amount);
referencecheckControl.push(this.createReerenceCheck(element)); referencecheckControl.push(this.createReerenceCheck(element));
}); });
} }
this._neighbourhoodForm.controls['neighbourhood_status'].setValue(data.records.check_type==0 ? data.records.neighbourhood_status : ''); this._neighbourhoodForm.controls['neighbourhood_status'].setValue(data.records.check_type==0 ? data.records.neighbourhood_status : '');
this._neighbourhoodForm.controls['neighbour_reference_remark'].setValue(data.records.neighbour_reference_remark ? data.records.neighbour_reference_remark : ''); this._neighbourhoodForm.controls['neighbour_reference_remark'].setValue(data.records.neighbour_reference_remark ? data.records.neighbour_reference_remark : '');
this._neighbourhoodForm.controls['check_type'].setValue(data.records.check_type==1 ? 1 : data.records.check_type==0 ? 0 : ''); // this._neighbourhoodForm.controls['check_type'].setValue(data.records.check_type==1 ? 1 : data.records.check_type==0 ? 0 : '');
} }
else { else {
neighbourhoodControl.push(this.createNeighbourhood(this.default_neighbourhood_details)); console.log('else',data.dataStatus);
console.log('else',data);
} neighbourhoodControl.push(this.createNeighbourhood(this.default_neighbourhood_details));
referencecheckControl.push(this.createReerenceCheck(this.default_reference_details));
}
}, error => this.errorMessage = <any> error); }, error => this.errorMessage = <any> error);
} }
@ -251,51 +254,79 @@ amtInwords : any = [];
} }
//save heighbourhood forms //save heighbourhood forms
tempCount : number = 0;
saveNeighbourhood(formData:any){ saveNeighbourhood(formData:any){
let resultMessage:string=''; // console.log('formData',formData);
// let resultMessage:string='';
// const referencecheckControl = <FormGroup>this._neighbourhoodForm.controls['referencecheck_list']; // const referencecheckControl = <FormGroup>this._neighbourhoodForm.controls['referencecheck_list'];
// const referencecheckControl = this._neighbourhoodForm.get('referencecheck_list') as FormControl; const referencecheckControl = this._neighbourhoodForm.get('referencecheck_list') as FormControl;
// let RefCtrlLength : any = referencecheckControl.controls.length;
const neighbourhoodControl : FormGroup = this._neighbourhoodForm.controls['neighbourhood_list'] as FormGroup; const neighbourhoodControl : FormGroup = this._neighbourhoodForm.controls['neighbourhood_list'] as FormGroup;
let NbhdCtrlLength: any = neighbourhoodControl.controls.length;
if(formData.check_type==0){ if (NbhdCtrlLength > 0) {
// neighbourhoodControl.contdols['neighbourhood_name'].setValidators([Validators.required]); let Ncnt = 0;
// neighbourhoodControl.controls['neighbourhood_name'].updateValueAndValidity(); while(Ncnt < NbhdCtrlLength){
// neighbourhoodControl.controls['do_know'].setValidators([Validators.required]); let nbhdChildCtrl : any = neighbourhoodControl.controls[Ncnt];
// neighbourhoodControl.controls['do_know'].updateValueAndValidity();
// return; nbhdChildCtrl.controls['neighbourhood_name'].setValidators([Validators.required]);
nbhdChildCtrl.controls['neighbourhood_name'].updateValueAndValidity();
nbhdChildCtrl.controls['do_know'].setValidators([Validators.required]);
nbhdChildCtrl.controls['do_know'].updateValueAndValidity();
// console.log('nbhdChildCtrl.controls.did_not_know_the_business_operation.value',nbhdChildCtrl.controls.did_not_know_the_business_operation.value)
if(nbhdChildCtrl.controls.did_not_know_the_business_operation.value == '' || nbhdChildCtrl.controls.did_not_know_the_business_operation.value == false){
// console.log('IF nbhdChildCtrl.controls.did_not_know_the_business_operation.value',nbhdChildCtrl.controls.did_not_know_the_business_operation.value)
nbhdChildCtrl.controls['how_long_do_know_in_month'].setValidators([Validators.required]);
nbhdChildCtrl.controls['how_long_do_know_in_month'].updateValueAndValidity();
nbhdChildCtrl.controls['how_long_do_know_in_year'].setValidators([Validators.required]);
nbhdChildCtrl.controls['how_long_do_know_in_year'].updateValueAndValidity();
}
else if(nbhdChildCtrl.controls.did_not_know_the_business_operation.value == true){
// console.log('ELSE nbhdChildCtrl.controls.did_not_know_the_business_operation.value',nbhdChildCtrl.controls.did_not_know_the_business_operation.value)
nbhdChildCtrl.controls['how_long_do_know_in_month'].setValue('');
nbhdChildCtrl.controls['how_long_do_know_in_month'].clearValidators();
nbhdChildCtrl.controls['how_long_do_know_in_month'].updateValueAndValidity();
nbhdChildCtrl.controls['how_long_do_know_in_year'].setValue('');
nbhdChildCtrl.controls['how_long_do_know_in_year'].clearValidators();
nbhdChildCtrl.controls['how_long_do_know_in_year'].updateValueAndValidity();
}
if(nbhdChildCtrl.controls.did_not_know_the_owner.value == '' || nbhdChildCtrl.controls.did_not_know_the_owner.value == false){
nbhdChildCtrl.controls['organisation_owner'].setValidators([Validators.required]);
nbhdChildCtrl.controls['organisation_owner'].updateValueAndValidity();
}
else if(nbhdChildCtrl.controls.did_not_know_the_owner.value == true){
nbhdChildCtrl.controls['organisation_owner'].setValue('');
nbhdChildCtrl.controls['organisation_owner'].clearValidators();
nbhdChildCtrl.controls['organisation_owner'].updateValueAndValidity();
}
Ncnt++;
}
} }
// }
// if(formData.check_type==1){ // if(formData.check_type==1){
// referencecheckControl.controls['reference_name'].setValidators([Validators.required]); // referencecheckControl.controls['reference_name'].setValidators([Validators.required]);
// referencecheckControl.controls['reference_name'].updateValueAndValidity(); // referencecheckControl.controls['reference_name'].updateValueAndValidity();
// referencecheckControl.controls['location'].setValidators([Validators.required]); // referencecheckControl.controls['location'].setValidators([Validators.required]);
// referencecheckControl.controls['location'].updateValueAndValidity(); // referencecheckControl.controls['location'].updateValueAndValidity();
// referencecheckControl.controls['mobile'].setValidators([Validators.required]); // referencecheckControl.controls['mobile'].setValidators([Validators.required]);
// referencecheckControl.controls['mobile'].updateValueAndValidity(); // referencecheckControl.controls['mobile'].updateValueAndValidity();
// referencecheckControl.controls['relationship_with'].setValidators([Validators.required]); // referencecheckControl.controls['relationship_with'].setValidators([Validators.required]);
// referencecheckControl.controls['relationship_with'].updateValueAndValidity(); // referencecheckControl.controls['relationship_with'].updateValueAndValidity();
// referencecheckControl.controls['year_relation_applicant'].setValidators([Validators.required]); // referencecheckControl.controls['year_relation_applicant'].setValidators([Validators.required]);
// referencecheckControl.controls['year_relation_applicant'].updateValueAndValidity(); // referencecheckControl.controls['year_relation_applicant'].updateValueAndValidity();
// referencecheckControl.controls['business_volume_amount'].setValidators([Validators.required]); // referencecheckControl.controls['business_volume_amount'].setValidators([Validators.required]);
// referencecheckControl.controls['business_volume_amount'].updateValueAndValidity(); // referencecheckControl.controls['business_volume_amount'].updateValueAndValidity();
// referencecheckControl.controls['business_volume_unit'].setValidators([Validators.required]); // referencecheckControl.controls['business_volume_unit'].setValidators([Validators.required]);
// referencecheckControl.controls['business_volume_unit'].updateValueAndValidity(); // referencecheckControl.controls['business_volume_unit'].updateValueAndValidity();
// referencecheckControl.controls['reference_final_remarks'].setValidators([Validators.required]); // referencecheckControl.controls['reference_final_remarks'].setValidators([Validators.required]);
// referencecheckControl.controls['reference_final_remarks'].updateValueAndValidity(); // referencecheckControl.controls['reference_final_remarks'].updateValueAndValidity()
// } // }
if (this._neighbourhoodForm.invalid) { if (this._neighbourhoodForm.invalid) {
this.validateAllFormFields(this._neighbourhoodForm); this.validateAllFormFields(this._neighbourhoodForm);
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!'); this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
@ -305,7 +336,7 @@ amtInwords : any = [];
let saveRecords:any = {} let saveRecords:any = {}
let referencecheck_list:any=[]; let referencecheck_list:any=[];
let neighbourhood_list:any=[]; let neighbourhood_list:any=[];
if(formData.check_type==0){ // if(formData.check_type==0){
formData.neighbourhood_list.forEach((element,key) => { formData.neighbourhood_list.forEach((element,key) => {
neighbourhood_list.push({ neighbourhood_list.push({
"neighbourhood_name":element.neighbourhood_name, "neighbourhood_name":element.neighbourhood_name,
@ -320,9 +351,9 @@ amtInwords : any = [];
}) })
}); });
saveRecords.neighbourhood_list=neighbourhood_list; saveRecords.neighbourhood_list=neighbourhood_list;
resultMessage='Neihbourhood Updated.!' // resultMessage='Neihbourhood Updated.!'
} // }
else{ // else{
// this for referencecheck_list for selected // this for referencecheck_list for selected
formData.referencecheck_list.forEach((element,key) => { formData.referencecheck_list.forEach((element,key) => {
referencecheck_list.push({ referencecheck_list.push({
@ -345,10 +376,10 @@ amtInwords : any = [];
}) })
}); });
saveRecords.referencecheck_list=referencecheck_list; saveRecords.referencecheck_list=referencecheck_list;
resultMessage='Reference Check Updated.!' // resultMessage='Reference Check Updated.!'
} // }
saveRecords.check_type=formData.check_type; // saveRecords.check_type=formData.check_type;
saveRecords.pdid=formData.pdid; saveRecords.pdid=formData.pdid;
saveRecords.formid=formData.formid; saveRecords.formid=formData.formid;
saveRecords.neighbourhood_status = formData.check_type == 0 ? formData.neighbourhood_status : ''; saveRecords.neighbourhood_status = formData.check_type == 0 ? formData.neighbourhood_status : '';
@ -452,38 +483,36 @@ compareObjects(o1: any, o2: any) {
} }
getOtherOrganisationOwner(value,i) { getOtherOrganisationOwner(value,i) {
console.log('value',value,'I',i); // console.log('value',value,'I',i);
let Ctrls = <FormArray>this._neighbourhoodForm.controls['neighbourhood_list']; let Ctrls = <FormArray>this._neighbourhoodForm.controls['neighbourhood_list'];
console.log('ParCtrls',Ctrls); // console.log('ParCtrls',Ctrls);
let ChdCtrls:any = <FormArray>Ctrls.controls[i]; let ChdCtrls:any = <FormArray>Ctrls.controls[i];
console.log('ChdCtrls',ChdCtrls); // console.log('ChdCtrls',ChdCtrls);
// return; // return;
let Avaliablity = 1;
// console.log('val',value);
let Avaliablity = 1; if(value.length>0){
console.log('val',value); value.forEach(option => {
if(value.length>0){ if(option.id == 0 && option.group_id == 2){
value.forEach(option => { Avaliablity = option.id;
if(option.id == 0 && option.group_id == 2){ }
Avaliablity = option.id; });
} }
}); if(Avaliablity == 0){
} // console.log('if Avaliablity',Avaliablity);
if(Avaliablity == 0){
// console.log('if Avaliablity',Avaliablity);
ChdCtrls.controls.other_organisation_owner.setValidators([Validators.required]); ChdCtrls.controls.other_organisation_owner.setValidators([Validators.required]);
this.isOrganisationOwner[i] = true; this.isOrganisationOwner[i] = true;
}else if(Avaliablity == 1){ }else if(Avaliablity == 1){
// console.log('else Avaliablity',Avaliablity); // console.log('else Avaliablity',Avaliablity);
// console.log('esle this.isOrganisationOwner[ParInx]',this.isOrganisationOwner[i]); // console.log('esle this.isOrganisationOwner[ParInx]',this.isOrganisationOwner[i]);
ChdCtrls.controls.other_organisation_owner.setValue(''); ChdCtrls.controls.other_organisation_owner.setValue('');
ChdCtrls.controls.other_organisation_owner.clearValidators(); ChdCtrls.controls.other_organisation_owner.clearValidators();
this.isOrganisationOwner[i] = false; this.isOrganisationOwner[i] = false;
// console.log('else this.isOrganisationOwner[ParInx]',this.isOrganisationOwner[i]); // console.log('else this.isOrganisationOwner[ParInx]',this.isOrganisationOwner[i]);
} }
ChdCtrls.controls.other_organisation_owner.updateValueAndValidity(); ChdCtrls.controls.other_organisation_owner.updateValueAndValidity();
} }
} }

View File

@ -275,7 +275,7 @@
<!-- start area covered by the property --> <!-- start area covered by the property -->
<mat-form-field style="width:35%;" appearance="outline"> <mat-form-field style="width:35%;" appearance="outline">
<mat-label>Area Covered by the Property</mat-label> <mat-label>Area Covered by the Property</mat-label>
<input matInput OnlyNumber autocomplete="off" placeholder="" maxlength="3" formControlName="property_cover_area" required> <input matInput OnlyNumber autocomplete="off" placeholder="" formControlName="property_cover_area" required><!--maxlength="3"-->
</mat-form-field> </mat-form-field>
<!-- end area covered --> <!-- end area covered -->

View File

@ -63,7 +63,7 @@ export class RentalVerificationComponent implements OnInit {
this.pdid = this.data.pdmaster_details.pd_id; this.pdid = this.data.pdmaster_details.pd_id;
this.notifier = notifier; this.notifier = notifier;
this.form_id = 17; this.form_id = 17;
this.main_applicant = this.data.pdmaster_details.main_applicant; this.main_applicant = this.data.pdmaster_details.main_applicant;
this.lender_applicant_id = this.data.pdmaster_details.lender_applicant_id; this.lender_applicant_id = this.data.pdmaster_details.lender_applicant_id;
this.subproduct_abbr = this.data.pdmaster_details.subproduct_abbr; this.subproduct_abbr = this.data.pdmaster_details.subproduct_abbr;
this.customer_segment_abbr = this.data.pdmaster_details.customer_segment_abbr; this.customer_segment_abbr = this.data.pdmaster_details.customer_segment_abbr;
@ -743,6 +743,11 @@ validateAllFormFields(formGroup: any) {
}); });
} }
ngOnDestroy() {
// console.log('Component Destoryed');
const index = this.data.pdapplicants_detials.findIndex(name => name.applicant_name === 'Others');
this.data.pdapplicants_detials.splice(index, 1);
}
} }