merge : kms
This commit is contained in:
parent
920727fe58
commit
52eb2c28f3
@ -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"
|
||||
[formGroupName]="c">
|
||||
<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>
|
||||
|
||||
<mat-label>Countries Where The Export Is Being Done for
|
||||
|
||||
@ -1,26 +1,14 @@
|
||||
import {
|
||||
Component,
|
||||
OnInit,
|
||||
Inject,
|
||||
Input
|
||||
} from '@angular/core';
|
||||
import { Component,OnInit,Inject,Input } from '@angular/core';
|
||||
|
||||
import {
|
||||
FormBuilder,
|
||||
FormGroup,
|
||||
Validators,
|
||||
FormArray, FormControl,
|
||||
} from '@angular/forms';
|
||||
import { FormBuilder,FormGroup,Validators,FormArray, FormControl,} from '@angular/forms';
|
||||
|
||||
import { NotifierService } from 'angular-notifier';
|
||||
|
||||
import {
|
||||
MatDialog,
|
||||
MatDialogRef,
|
||||
MAT_DIALOG_DATA
|
||||
} from '@angular/material';
|
||||
import { MatDialog,MatDialogRef,MAT_DIALOG_DATA } from '@angular/material';
|
||||
|
||||
/** Service */
|
||||
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
|
||||
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
|
||||
@Component({
|
||||
@ -39,9 +27,6 @@ export class CurrentLoanComponent implements OnInit {
|
||||
pdid: number;
|
||||
form_id: number;
|
||||
applicant_details: any;
|
||||
// @Input() pdid: number;
|
||||
// @Input() form_id: number;
|
||||
//@Input() applicant_details: any;
|
||||
lenderData: any = [];
|
||||
frequencyData: any = [];
|
||||
loanTypeData: any = [];
|
||||
@ -69,7 +54,6 @@ export class CurrentLoanComponent implements OnInit {
|
||||
this.notifier = notifier;
|
||||
this.applicants = this.pd_all_details.pdapplicants_detials;
|
||||
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.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
|
||||
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,
|
||||
details: [],
|
||||
owner_name: element.business_name_of_the_owner,
|
||||
other_owner: element.business_name_of_the_other_owner,
|
||||
form_type: 'Data From Bussiness Address'
|
||||
})
|
||||
});
|
||||
@ -209,6 +194,7 @@ export class CurrentLoanComponent implements OnInit {
|
||||
mode_name: element.business_assets_mode_name,
|
||||
details: element.business_details,
|
||||
owner_name: element.business_name_of_the_owner,
|
||||
other_owner: element.business_name_of_the_other_owner,
|
||||
form_type: 'Data From Business Assets'
|
||||
})
|
||||
});
|
||||
@ -221,6 +207,7 @@ export class CurrentLoanComponent implements OnInit {
|
||||
mode_name: element.assets_mode_name,
|
||||
details: element.details,
|
||||
owner_name: element.name_of_the_owner,
|
||||
other_owner: element.other_owner,
|
||||
form_type: 'Data From Other Asset'
|
||||
})
|
||||
});
|
||||
@ -239,7 +226,12 @@ export class CurrentLoanComponent implements OnInit {
|
||||
this.dataFromAssets.forEach((val, index) => {
|
||||
if (val.mode == 0) {
|
||||
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;
|
||||
@ -253,7 +245,8 @@ export class CurrentLoanComponent implements OnInit {
|
||||
});
|
||||
if (val.owner_name.length > 0) {
|
||||
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) {
|
||||
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) {
|
||||
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 + ' )' : '';
|
||||
@ -309,7 +304,8 @@ export class CurrentLoanComponent implements OnInit {
|
||||
});
|
||||
if (val.owner_name.length > 0) {
|
||||
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 + ' )' : '';
|
||||
@ -319,7 +315,8 @@ export class CurrentLoanComponent implements OnInit {
|
||||
let owner: any = "Owner Not Mentioned";
|
||||
if (val.owner_name.length > 0) {
|
||||
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) {
|
||||
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 + ' )' : '';
|
||||
|
||||
@ -134,17 +134,20 @@
|
||||
<mat-form-field style="width: 33%">
|
||||
<input matInput placeholder="Gross Monthly Salary" formControlName="gross_monthly_salary"
|
||||
(keypress)="keyPress($event)" required>
|
||||
<mat-hint align="start" style="font-size:90%" *ngIf="employmentForm.controls['gross_monthly_salary'].value != ''">{{"₹"}} {{employmentForm.controls['gross_monthly_salary'].value | numberToWords}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width:33%">
|
||||
<input matInput placeholder="Net Monthly Salary" formControlName="net_monthly_salary"
|
||||
(keypress)="keyPress($event)" required>
|
||||
<mat-hint align="start" style="font-size:90%" *ngIf="employmentForm.controls['net_monthly_salary'].value != ''">{{"₹"}} {{employmentForm.controls['net_monthly_salary'].value | numberToWords}} Only</mat-hint>
|
||||
<!-- <input matInput placeholder="Net Take Home"
|
||||
formControlName="net_take_home"> -->
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 33%">
|
||||
<input matInput placeholder="Bonus or Incentive" formControlName="bonus_incentive"
|
||||
(keypress)="keyPress($event)" required>
|
||||
<mat-hint align="start" style="font-size:90%" *ngIf="employmentForm.controls['bonus_incentive'].value != ''">{{"₹"}} {{employmentForm.controls['bonus_incentive'].value | numberToWords}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 33%">
|
||||
|
||||
@ -1,240 +1,252 @@
|
||||
<form [formGroup]="_neighbourhoodForm" novalidate>
|
||||
<h2 mat-dialog-title class="paragraph_change">
|
||||
<!-- <div fxFlex="70" align="left"> -->
|
||||
<div fxFlex="70" align="left" style="padding: 10px !important;">
|
||||
<div fxLayout="row wrap">
|
||||
<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>
|
||||
{{pageTitle}}
|
||||
</div>
|
||||
<h2 mat-dialog-title class="paragraph_change">
|
||||
<!-- <div fxFlex="70" align="left"> -->
|
||||
<div fxFlex="70" align="left" style="padding: 10px !important;">
|
||||
<div fxLayout="row wrap">
|
||||
<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>
|
||||
{{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>
|
||||
</mat-card-header>
|
||||
<mat-card-content formArrayName="neighbourhood_list" *ngIf="_neighbourhoodForm.controls.check_type.value==0">
|
||||
<mat-card *ngFor="let neighbourhood of _neighbourhoodForm.controls.neighbourhood_list['controls']; let n = index; let last = last" [formGroupName]="n">
|
||||
<mat-card-content>
|
||||
<mat-form-field style="width: 42%">
|
||||
<input matInput autocomplete="off" placeholder="Neighbour Name" formControlName="neighbourhood_name" type="text">
|
||||
</mat-form-field>
|
||||
<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-form-field style="width: 40%">
|
||||
<!-- Do You Know the Applicant -->
|
||||
<mat-select placeholder=" Do you know about the applicants or their business?" formControlName="do_know">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option value="Yes">Yes</mat-option>
|
||||
<mat-option value="No">No</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-dialog-content>
|
||||
<mat-tab-group mat-align-tabs="center">
|
||||
<mat-tab *ngFor="let types of check_type; let t = index" label="{{types.type_name}}">
|
||||
<ng-template matTabContent>
|
||||
<div *ngIf="types.id==0">
|
||||
<div formArrayName="neighbourhood_list">
|
||||
<mat-card *ngFor="let neighbourhood of _neighbourhoodForm.controls.neighbourhood_list['controls']; let n = index; let last = last"
|
||||
[formGroupName]="n">
|
||||
<mat-card-content>
|
||||
<mat-form-field style="width: 42%">
|
||||
<input matInput autocomplete="off" placeholder="Neighbour Name" formControlName="neighbourhood_name"
|
||||
type="text">
|
||||
</mat-form-field>
|
||||
|
||||
<!-- <mat-form-field style="width: 42%" *ngIf="neighbourhood.controls.do_know.value=='Yes'"> -->
|
||||
<!-- <input matInput autocomplete="off" placeholder="How Long to Know the Applicant " formControlName="how_long_do_know" type="text" OnlyNumber type="text"> -->
|
||||
<!-- </mat-form-field> -->
|
||||
<mat-form-field style="width: 40%">
|
||||
<!-- Do You Know the Applicant -->
|
||||
<mat-select placeholder=" Do you know about the applicants or their business?"
|
||||
formControlName="do_know">
|
||||
<mat-option>Select</mat-option>
|
||||
<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="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 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 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==''">
|
||||
<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-form-field style="width: 40%">
|
||||
<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>
|
||||
<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-raised-button mat-icon-button
|
||||
matTooltip="Remove Neighbourhood" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="n!=0">
|
||||
<mat-icon>delete</mat-icon></button> -->
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div *ngIf="types.id==1">
|
||||
<mat-card-content formArrayName="referencecheck_list">
|
||||
<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%">
|
||||
|
||||
<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>
|
||||
</mat-card-content>
|
||||
<div *ngIf="_neighbourhoodForm.controls.check_type.value==0">
|
||||
<mat-form-field style="width: 40%">
|
||||
<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-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 != ''">{{"₹"}}
|
||||
{{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-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>
|
||||
</mat-card-header>
|
||||
</mat-card> -->
|
||||
</mat-dialog-content>
|
||||
|
||||
<mat-dialog-actions>
|
||||
<div fxFlex="60" class="pb-0 text-sm-left" align="left">
|
||||
<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>
|
||||
<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%">
|
||||
</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-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 != ''">{{"₹"}} {{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>
|
||||
<!-- <button type="button" mat-raised-button mat-icon-button (click)="removeReferencecheck(r)"
|
||||
matTooltip="Remove Reference Check" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="r!=0">
|
||||
<mat-icon>delete</mat-icon></button> -->
|
||||
</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>
|
||||
<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)="_neighbourhoodForm.controls.check_type.value==0 ? addNeighbourhood() : addReferencecheck()" color="primary"><mat-icon>add</mat-icon></button>
|
||||
</mat-card-actions>
|
||||
|
||||
</mat-card>
|
||||
</mat-dialog-content>
|
||||
|
||||
<mat-dialog-actions>
|
||||
<div fxFlex="60" class="pb-0 text-sm-left" align="left">
|
||||
<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>
|
||||
</mat-dialog-actions>
|
||||
</form>
|
||||
<notifier-container></notifier-container>
|
||||
|
||||
@ -4,11 +4,13 @@ import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition} from '@angul
|
||||
import { NotifierService } from 'angular-notifier';
|
||||
import { PdTrigerService } from './../../../../../pd-service/pd-triger.service';
|
||||
import { parse } from 'url';
|
||||
|
||||
@Component({
|
||||
selector: 'app-neighbour-hood',
|
||||
templateUrl: './neighbour-hood.component.html',
|
||||
styleUrls: ['./neighbour-hood.component.scss']
|
||||
})
|
||||
|
||||
export class NeighbourHoodComponent implements OnInit {
|
||||
customer_segment_abbr: any;
|
||||
subproduct_abbr: any;
|
||||
@ -22,7 +24,7 @@ export class NeighbourHoodComponent implements OnInit {
|
||||
form_id:number;
|
||||
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_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"},
|
||||
{'id': 2,'name': "Negative"},
|
||||
{'id': 3,'name': "Insufficient information provided"}];
|
||||
existCompanyList: any =[];
|
||||
mergeCompanyApplicant: any=[];
|
||||
isOrganisationOwner: any=[];
|
||||
amtInwords : any = [];
|
||||
existCompanyList: any =[];
|
||||
mergeCompanyApplicant: any=[];
|
||||
isOrganisationOwner: any=[];
|
||||
amtInwords : any = [];
|
||||
|
||||
// isOtherApplicant: any = [];
|
||||
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.notifier = notifier;
|
||||
this.form_id = 19;
|
||||
this.main_applicant = this.data.pdmaster_details.main_applicant;
|
||||
this.lender_applicant_id = this.data.pdmaster_details.lender_applicant_id;
|
||||
this.subproduct_abbr = this.data.pdmaster_details.subproduct_abbr;
|
||||
this.customer_segment_abbr = this.data.pdmaster_details.customer_segment_abbr;
|
||||
this.applicants = this.data.pdapplicants_detials;
|
||||
this.applicants = this.applicants.filter(appt=>appt.applicant_type != 2);
|
||||
this.applicants.push({'pd_co_applicant_id': 0,'applicant_name': "Others"})
|
||||
|
||||
}
|
||||
this.main_applicant = this.data.pdmaster_details.main_applicant;
|
||||
this.lender_applicant_id = this.data.pdmaster_details.lender_applicant_id;
|
||||
this.subproduct_abbr = this.data.pdmaster_details.subproduct_abbr;
|
||||
this.customer_segment_abbr = this.data.pdmaster_details.customer_segment_abbr;
|
||||
this.applicants = this.data.pdapplicants_detials;
|
||||
this.applicants = this.applicants.filter(appt=>appt.applicant_type != 2);
|
||||
this.applicants.push({'pd_co_applicant_id': 0,'applicant_name': "Others"})
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
|
||||
@ -78,28 +79,29 @@ amtInwords : any = [];
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
this.initFormDetails();
|
||||
|
||||
// call neghbourhhod / reference check changes
|
||||
this._neighbourhoodForm.controls['check_type'].valueChanges.subscribe(value => {
|
||||
const referencecheckControl = <FormArray>this._neighbourhoodForm.controls['referencecheck_list'];
|
||||
const neighbourhoodControl = <FormArray>this._neighbourhoodForm.controls['neighbourhood_list'];
|
||||
if(value==0){
|
||||
referencecheckControl.controls = [];
|
||||
referencecheckControl.setValue([]);
|
||||
if(neighbourhoodControl.value.length==0){
|
||||
neighbourhoodControl.push(this.createNeighbourhood(this.default_neighbourhood_details));
|
||||
}
|
||||
}
|
||||
else {
|
||||
neighbourhoodControl.controls = [];
|
||||
neighbourhoodControl.setValue([]);
|
||||
if(referencecheckControl.value.length==0){
|
||||
referencecheckControl.push(this.createReerenceCheck(this.default_reference_details));
|
||||
}
|
||||
// this._neighbourhoodForm.controls['check_type'].valueChanges.subscribe(value => {
|
||||
// const referencecheckControl = <FormArray>this._neighbourhoodForm.controls['referencecheck_list'];
|
||||
// const neighbourhoodControl = <FormArray>this._neighbourhoodForm.controls['neighbourhood_list'];
|
||||
// if(value==0){
|
||||
// referencecheckControl.controls = [];
|
||||
// referencecheckControl.setValue([]);
|
||||
// if(neighbourhoodControl.value.length==0){
|
||||
// neighbourhoodControl.push(this.createNeighbourhood(this.default_neighbourhood_details));
|
||||
// }
|
||||
// }
|
||||
// else {
|
||||
// neighbourhoodControl.controls = [];
|
||||
// neighbourhoodControl.setValue([]);
|
||||
// if(referencecheckControl.value.length==0){
|
||||
// referencecheckControl.push(this.createReerenceCheck(this.default_reference_details));
|
||||
// }
|
||||
|
||||
}
|
||||
});
|
||||
// }
|
||||
// });
|
||||
|
||||
}
|
||||
|
||||
@ -108,7 +110,7 @@ amtInwords : any = [];
|
||||
this._neighbourhoodForm = this._fb.group({
|
||||
pdid:this.pdid,
|
||||
formid:this.form_id,
|
||||
check_type:0,
|
||||
// check_type:0,
|
||||
neighbourhood_list: this._fb.array([]),
|
||||
neighbourhood_status:'',
|
||||
referencecheck_list: this._fb.array([]),
|
||||
@ -127,15 +129,15 @@ amtInwords : any = [];
|
||||
params.pd_id = this.pdid;
|
||||
params.pd_form_id = '19';
|
||||
let referencecheckControl = <FormArray>this._neighbourhoodForm.controls['referencecheck_list'];
|
||||
referencecheckControl.controls = [];
|
||||
referencecheckControl.controls = [];
|
||||
const neighbourhoodControl = <FormArray>this._neighbourhoodForm.controls['neighbourhood_list'];
|
||||
neighbourhoodControl.controls=[];
|
||||
neighbourhoodControl.controls=[];
|
||||
this._pd.retriveForm(params).subscribe(data => {
|
||||
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_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){
|
||||
exist_neighbourhood_details.forEach((element,index) => {
|
||||
if(exist_neighbourhood_details.length>0){ /** && data.records.check_type==0 */
|
||||
exist_neighbourhood_details.forEach((element,index) => {
|
||||
this.toggleVisibility(element.did_not_know_the_business_operation,index,1);
|
||||
this.toggleVisibility(element.did_not_know_the_owner,index,2);
|
||||
// this.selectedApplicants(referencecheckControl,element.organisation_owner,index);
|
||||
@ -143,23 +145,24 @@ amtInwords : any = [];
|
||||
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) => {
|
||||
this.amtInwords[index] = this._pd.convertNumberToWords(element.business_volume_amount);
|
||||
|
||||
referencecheckControl.push(this.createReerenceCheck(element));
|
||||
});
|
||||
}
|
||||
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['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 {
|
||||
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);
|
||||
}
|
||||
@ -251,51 +254,79 @@ amtInwords : any = [];
|
||||
}
|
||||
|
||||
//save heighbourhood forms
|
||||
tempCount : number = 0;
|
||||
|
||||
saveNeighbourhood(formData:any){
|
||||
let resultMessage:string='';
|
||||
|
||||
// console.log('formData',formData);
|
||||
|
||||
// let resultMessage:string='';
|
||||
// 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;
|
||||
let NbhdCtrlLength: any = neighbourhoodControl.controls.length;
|
||||
|
||||
if(formData.check_type==0){
|
||||
// neighbourhoodControl.contdols['neighbourhood_name'].setValidators([Validators.required]);
|
||||
// neighbourhoodControl.controls['neighbourhood_name'].updateValueAndValidity();
|
||||
if (NbhdCtrlLength > 0) {
|
||||
let Ncnt = 0;
|
||||
while(Ncnt < NbhdCtrlLength){
|
||||
|
||||
// neighbourhoodControl.controls['do_know'].setValidators([Validators.required]);
|
||||
// neighbourhoodControl.controls['do_know'].updateValueAndValidity();
|
||||
// return;
|
||||
let nbhdChildCtrl : any = neighbourhoodControl.controls[Ncnt];
|
||||
|
||||
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){
|
||||
// referencecheckControl.controls['reference_name'].setValidators([Validators.required]);
|
||||
// referencecheckControl.controls['reference_name'].updateValueAndValidity();
|
||||
|
||||
// referencecheckControl.controls['location'].setValidators([Validators.required]);
|
||||
// referencecheckControl.controls['location'].updateValueAndValidity();
|
||||
|
||||
// referencecheckControl.controls['mobile'].setValidators([Validators.required]);
|
||||
// referencecheckControl.controls['mobile'].updateValueAndValidity();
|
||||
|
||||
// referencecheckControl.controls['relationship_with'].setValidators([Validators.required]);
|
||||
// referencecheckControl.controls['relationship_with'].updateValueAndValidity();
|
||||
|
||||
// referencecheckControl.controls['year_relation_applicant'].setValidators([Validators.required]);
|
||||
// referencecheckControl.controls['year_relation_applicant'].updateValueAndValidity();
|
||||
|
||||
// referencecheckControl.controls['business_volume_amount'].setValidators([Validators.required]);
|
||||
// referencecheckControl.controls['business_volume_amount'].updateValueAndValidity();
|
||||
|
||||
// referencecheckControl.controls['business_volume_unit'].setValidators([Validators.required]);
|
||||
// referencecheckControl.controls['business_volume_unit'].updateValueAndValidity();
|
||||
|
||||
// referencecheckControl.controls['reference_final_remarks'].setValidators([Validators.required]);
|
||||
// referencecheckControl.controls['reference_final_remarks'].updateValueAndValidity();
|
||||
|
||||
// referencecheckControl.controls['reference_final_remarks'].updateValueAndValidity()
|
||||
// }
|
||||
|
||||
if (this._neighbourhoodForm.invalid) {
|
||||
this.validateAllFormFields(this._neighbourhoodForm);
|
||||
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
||||
@ -305,7 +336,7 @@ amtInwords : any = [];
|
||||
let saveRecords:any = {}
|
||||
let referencecheck_list:any=[];
|
||||
let neighbourhood_list:any=[];
|
||||
if(formData.check_type==0){
|
||||
// if(formData.check_type==0){
|
||||
formData.neighbourhood_list.forEach((element,key) => {
|
||||
neighbourhood_list.push({
|
||||
"neighbourhood_name":element.neighbourhood_name,
|
||||
@ -320,9 +351,9 @@ amtInwords : any = [];
|
||||
})
|
||||
});
|
||||
saveRecords.neighbourhood_list=neighbourhood_list;
|
||||
resultMessage='Neihbourhood Updated.!'
|
||||
}
|
||||
else{
|
||||
// resultMessage='Neihbourhood Updated.!'
|
||||
// }
|
||||
// else{
|
||||
// this for referencecheck_list for selected
|
||||
formData.referencecheck_list.forEach((element,key) => {
|
||||
referencecheck_list.push({
|
||||
@ -345,10 +376,10 @@ amtInwords : any = [];
|
||||
})
|
||||
});
|
||||
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.formid=formData.formid;
|
||||
saveRecords.neighbourhood_status = formData.check_type == 0 ? formData.neighbourhood_status : '';
|
||||
@ -452,38 +483,36 @@ compareObjects(o1: any, o2: any) {
|
||||
}
|
||||
|
||||
getOtherOrganisationOwner(value,i) {
|
||||
console.log('value',value,'I',i);
|
||||
let Ctrls = <FormArray>this._neighbourhoodForm.controls['neighbourhood_list'];
|
||||
console.log('ParCtrls',Ctrls);
|
||||
let ChdCtrls:any = <FormArray>Ctrls.controls[i];
|
||||
console.log('ChdCtrls',ChdCtrls);
|
||||
// return;
|
||||
|
||||
|
||||
let Avaliablity = 1;
|
||||
console.log('val',value);
|
||||
if(value.length>0){
|
||||
value.forEach(option => {
|
||||
if(option.id == 0 && option.group_id == 2){
|
||||
Avaliablity = option.id;
|
||||
// console.log('value',value,'I',i);
|
||||
let Ctrls = <FormArray>this._neighbourhoodForm.controls['neighbourhood_list'];
|
||||
// console.log('ParCtrls',Ctrls);
|
||||
let ChdCtrls:any = <FormArray>Ctrls.controls[i];
|
||||
// console.log('ChdCtrls',ChdCtrls);
|
||||
// return;
|
||||
let Avaliablity = 1;
|
||||
// console.log('val',value);
|
||||
if(value.length>0){
|
||||
value.forEach(option => {
|
||||
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]);
|
||||
this.isOrganisationOwner[i] = true;
|
||||
}else if(Avaliablity == 1){
|
||||
// console.log('else Avaliablity',Avaliablity);
|
||||
// console.log('esle this.isOrganisationOwner[ParInx]',this.isOrganisationOwner[i]);
|
||||
ChdCtrls.controls.other_organisation_owner.setValue('');
|
||||
ChdCtrls.controls.other_organisation_owner.clearValidators();
|
||||
this.isOrganisationOwner[i] = false;
|
||||
// console.log('else this.isOrganisationOwner[ParInx]',this.isOrganisationOwner[i]);
|
||||
}
|
||||
ChdCtrls.controls.other_organisation_owner.setValidators([Validators.required]);
|
||||
this.isOrganisationOwner[i] = true;
|
||||
}else if(Avaliablity == 1){
|
||||
// console.log('else Avaliablity',Avaliablity);
|
||||
// console.log('esle this.isOrganisationOwner[ParInx]',this.isOrganisationOwner[i]);
|
||||
ChdCtrls.controls.other_organisation_owner.setValue('');
|
||||
ChdCtrls.controls.other_organisation_owner.clearValidators();
|
||||
this.isOrganisationOwner[i] = false;
|
||||
// console.log('else this.isOrganisationOwner[ParInx]',this.isOrganisationOwner[i]);
|
||||
}
|
||||
|
||||
ChdCtrls.controls.other_organisation_owner.updateValueAndValidity();
|
||||
}
|
||||
ChdCtrls.controls.other_organisation_owner.updateValueAndValidity();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -275,7 +275,7 @@
|
||||
<!-- start area covered by the property -->
|
||||
<mat-form-field style="width:35%;" appearance="outline">
|
||||
<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>
|
||||
<!-- end area covered -->
|
||||
|
||||
|
||||
@ -63,7 +63,7 @@ export class RentalVerificationComponent implements OnInit {
|
||||
this.pdid = this.data.pdmaster_details.pd_id;
|
||||
this.notifier = notifier;
|
||||
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.subproduct_abbr = this.data.pdmaster_details.subproduct_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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user