Issues Fixes : ps
This commit is contained in:
parent
bf386f8eff
commit
8264e96e4a
@ -44,7 +44,7 @@
|
||||
<!-- <mat-error *ngIf="pdMain.lender_contact_person.hasError('required')">Lender Contact Person Required</mat-error> -->
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 28%">
|
||||
<input matInput autocomplete="off" placeholder="Lender's Mobile Number" formControlName="lender_contact_mobile" type="text" OnlyNumber maxlength="10" minlength="10">
|
||||
<input matInput autocomplete="off" placeholder="Lender's Mobile Number" formControlName="lender_contact_mobile" type="text" ForMobileNumbers maxlength="10" minlength="10">
|
||||
<mat-error *ngIf="pdMain.lender_contact_mobile.hasError('maxlength') || pdMain.lender_contact_mobile.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
@ -54,11 +54,11 @@
|
||||
</mat-form-field>-->
|
||||
|
||||
<mat-form-field style="width: 8%">
|
||||
<input matInput autocomplete="off" placeholder="STD Code" formControlName="lender_stdcode" type="text" maxlength="5" OnlyNumber>
|
||||
<input matInput autocomplete="off" placeholder="STD Code" formControlName="lender_stdcode" type="text" maxlength="5" ForMobileNumbers>
|
||||
<mat-error *ngIf="pdMain.lender_stdcode.hasError('maxlength') || pdMain.lender_stdcode.hasError('minlength')">Enter Valid STD Code Number.</mat-error>
|
||||
</mat-form-field> -
|
||||
<mat-form-field style="width: 17%">
|
||||
<input matInput autocomplete="off" placeholder="Landline Number" formControlName="lender_landline" type="text" maxlength="8" OnlyNumber>
|
||||
<input matInput autocomplete="off" placeholder="Landline Number" formControlName="lender_landline" type="text" maxlength="8" ForMobileNumbers>
|
||||
<mat-error *ngIf="pdMain.lender_landline.hasError('maxlength') || pdMain.lender_landline.hasError('minlength')">Enter Valid LandLine Number. </mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
@ -207,17 +207,17 @@
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 38%">
|
||||
<input matInput autocomplete="off" placeholder="Mobile Number" formControlName="mobile_no" type="text" OnlyNumber maxlength="10" minlength="10">
|
||||
<input matInput autocomplete="off" placeholder="Mobile Number" formControlName="mobile_no" type="text" ForMobileNumbers maxlength="10" minlength="10">
|
||||
<mat-error *ngIf="pdMain.mobile_no.hasError('required')">Mobile No is Required . </mat-error>
|
||||
<mat-error *ngIf="pdMain.mobile_no.hasError('maxlength') || pdMain.mobile_no.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 12%">
|
||||
<input matInput autocomplete="off" placeholder="STD Code" formControlName="applicant_stdcode" type="text" OnlyNumber maxlength="5">
|
||||
<input matInput autocomplete="off" placeholder="STD Code" formControlName="applicant_stdcode" type="text" ForMobileNumbers maxlength="5">
|
||||
<mat-error *ngIf="pdMain.applicant_stdcode.hasError('maxlength') || pdMain.applicant_stdcode.hasError('minlength')">Enter Valid STD Code Number. </mat-error>
|
||||
</mat-form-field> -
|
||||
<mat-form-field style="width: 22%">
|
||||
<input matInput autocomplete="off" placeholder="Landline Number" formControlName="applicant_landline" type="text" OnlyNumber maxlength="8">
|
||||
<input matInput autocomplete="off" placeholder="Landline Number" formControlName="applicant_landline" type="text" ForMobileNumbers maxlength="8">
|
||||
<mat-error *ngIf="pdMain.applicant_landline.hasError('maxlength') || pdMain.applicant_landline.hasError('minlength')">Enter Valid LandLine Number. </mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
@ -251,16 +251,16 @@
|
||||
</mat-form-field> -->
|
||||
|
||||
<mat-form-field style="width: 38%">
|
||||
<input matInput placeholder="Mobile Number" formControlName="coapplicant_mobile_no" type="text" maxlength="10" OnlyNumber>
|
||||
<input matInput placeholder="Mobile Number" formControlName="coapplicant_mobile_no" type="text" maxlength="10" ForMobileNumbers>
|
||||
<mat-error *ngIf="coDetails['controls'].coapplicant_mobile_no.hasError('maxlength') || coDetails['controls'].coapplicant_mobile_no.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 12%">
|
||||
<input matInput autocomplete="off" placeholder="STD Code" formControlName="coapplicant_stdcode" type="text" maxlength="5" OnlyNumber>
|
||||
<input matInput autocomplete="off" placeholder="STD Code" formControlName="coapplicant_stdcode" type="text" maxlength="5" ForMobileNumbers>
|
||||
<mat-error *ngIf="coDetails['controls'].coapplicant_stdcode.hasError('maxlength') || coDetails['controls'].coapplicant_stdcode.hasError('minlength')">Enter Valid STD Code. </mat-error>
|
||||
</mat-form-field> -
|
||||
<mat-form-field style="width: 22%">
|
||||
<input matInput autocomplete="off" placeholder="Landline Number" formControlName="coapplicant_landline" type="text" maxlength="8" OnlyNumber>
|
||||
<input matInput autocomplete="off" placeholder="Landline Number" formControlName="coapplicant_landline" type="text" maxlength="8" ForMobileNumbers>
|
||||
<mat-error *ngIf="coDetails['controls'].coapplicant_landline.hasError('maxlength') || coDetails['controls'].coapplicant_landline.hasError('minlength')">Enter Valid Landline Number. </mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
|
||||
@ -35,16 +35,16 @@
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 40%">
|
||||
<input matInput placeholder="Mobile Number" formControlName="mobile_no" type="text" maxlength="10" OnlyNumber required>
|
||||
<input matInput placeholder="Mobile Number" formControlName="mobile_no" type="text" maxlength="10" ForMobileNumbers required>
|
||||
<mat-error *ngIf="pdMainApplicant.mobile_no.hasError('maxlength') || pdMainApplicant.mobile_no.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 15%">
|
||||
<input matInput placeholder="STD Code" formControlName="stdcode" type="text" maxlength="5" OnlyNumber>
|
||||
<input matInput placeholder="STD Code" formControlName="stdcode" type="text" maxlength="5" ForMobileNumbers>
|
||||
<!-- <span matPrefix>+91</span> -->
|
||||
<mat-error *ngIf="pdMainApplicant.stdcode.hasError('maxlength') || pdMainApplicant.stdcode.hasError('minlength')">Enter Valid STD Code. </mat-error>
|
||||
</mat-form-field> -
|
||||
<mat-form-field style="width: 60%">
|
||||
<input matInput placeholder="LandLine Number" formControlName="landline" maxlength="8" type="text" OnlyNumber>
|
||||
<input matInput placeholder="LandLine Number" formControlName="landline" maxlength="8" type="text" ForMobileNumbers>
|
||||
<mat-error *ngIf="pdMainApplicant.landline.hasError('maxlength') || pdMainApplicant.landline.hasError('minlength')">Enter Valid Landline Number. </mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
@ -71,7 +71,7 @@
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 40%">
|
||||
<input matInput placeholder="Mobile Number" formControlName="coapplicant_mobile_no" type="text" maxlength="10" minlength="10" OnlyNumber>
|
||||
<input matInput placeholder="Mobile Number" formControlName="coapplicant_mobile_no" type="text" maxlength="10" minlength="10" ForMobileNumbers>
|
||||
<mat-error *ngIf=" coDetails['controls'].coapplicant_mobile_no.hasError('maxlength') || coDetails['controls'].coapplicant_mobile_no.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
@ -80,12 +80,12 @@
|
||||
<mat-error *ngIf=" coDetails['controls'].coapplicant_landline.hasError('maxlength') || coDetails['controls'].coapplicant_landline.hasError('minlength')">Enter Valid Phone Number. </mat-error>
|
||||
</mat-form-field> -->
|
||||
<mat-form-field style="width: 15%">
|
||||
<input matInput placeholder="STD Code" formControlName="coapplicant_stdcode" type="text" maxlength="5" OnlyNumber>
|
||||
<input matInput placeholder="STD Code" formControlName="coapplicant_stdcode" type="text" maxlength="5" ForMobileNumbers>
|
||||
<!-- <span matPrefix>+91</span> -->
|
||||
<mat-error *ngIf="coDetails['controls'].coapplicant_stdcode.hasError('maxlength') || coDetails['controls'].coapplicant_stdcode.hasError('minlength')">Enter Valid STD Number. </mat-error>
|
||||
</mat-form-field> -
|
||||
<mat-form-field style="width: 60%">
|
||||
<input matInput placeholder="LandLine Number" formControlName="coapplicant_landline" type="text" maxlength="8" OnlyNumber>
|
||||
<input matInput placeholder="LandLine Number" formControlName="coapplicant_landline" type="text" maxlength="8" ForMobileNumbers>
|
||||
<mat-error *ngIf="coDetails['controls'].coapplicant_landline.hasError('maxlength') || coDetails['controls'].coapplicant_landline.hasError('minlength')">Enter Valid Landline Number. </mat-error>
|
||||
</mat-form-field>
|
||||
<!-- <mat-form-field style="width: 82%">
|
||||
|
||||
@ -45,20 +45,20 @@
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 29%">
|
||||
<input matInput placeholder="Lender Mobile Number" formControlName="pd_contact_mobileno"
|
||||
type="text" maxlength="10" OnlyNumber>
|
||||
type="text" maxlength="10" ForMobileNumbers>
|
||||
<mat-error *ngIf="pdMain.pd_contact_mobileno.hasError('pattern') || pdMain.pd_contact_mobileno.hasError('maxlength') || pdMain.pd_contact_mobileno.hasError('minlength')">Enter
|
||||
Valid Mobile Number. </mat-error>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 10%">
|
||||
<input matInput placeholder="STD Code" formControlName="lender_stdcode" type="text" maxlength="5"
|
||||
OnlyNumber>
|
||||
ForMobileNumbers>
|
||||
<!-- <span matPrefix>+91</span> -->
|
||||
<mat-error *ngIf="pdMain.lender_stdcode.hasError('maxlength') || pdMain.lender_stdcode.hasError('minlength')">Enter
|
||||
Valid STD Code. </mat-error>
|
||||
</mat-form-field> -
|
||||
<mat-form-field style="width: 20%">
|
||||
<input matInput placeholder="LandLine Number" formControlName="lender_landline"
|
||||
type="text" maxlength="8" OnlyNumber>
|
||||
type="text" maxlength="8" ForMobileNumbers>
|
||||
<mat-error *ngIf="pdMain.lender_landline.hasError('maxlength') || pdMain.lender_landline.hasError('minlength')">Enter
|
||||
Valid Landline Number. </mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
@ -782,7 +782,7 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
||||
return;
|
||||
} else {
|
||||
return;
|
||||
|
||||
var answerFormValues = this._businessAssetsQuesFrom.value;
|
||||
let dataOwner_name = [];
|
||||
|
||||
|
||||
@ -23,7 +23,8 @@ import {
|
||||
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
import { DatePipe } from '@angular/common';
|
||||
|
||||
/**sweet alert */
|
||||
import Swal from 'sweetalert2';
|
||||
@Component({
|
||||
selector: 'app-business-info',
|
||||
templateUrl: './business-info.component.html',
|
||||
@ -1487,7 +1488,6 @@ export class BusinessInfoComponent implements OnInit {
|
||||
// let shareHoldValidationFlag : number = 0;
|
||||
|
||||
|
||||
|
||||
if (records.partners.length > 0) {
|
||||
let total = records.partners.map(shares => shares.shareholding).reduce((a, b) => a + +b, 0);
|
||||
if (total > 100) {
|
||||
@ -1503,13 +1503,24 @@ export class BusinessInfoComponent implements OnInit {
|
||||
if (records.manufacturing_activity_details.length > 0) {
|
||||
|
||||
records.manufacturing_activity_details.forEach((val, index) => {
|
||||
|
||||
let product = val.main_products;
|
||||
|
||||
if (val.area_of_sale != "Within India") {
|
||||
|
||||
let ManufacturingArray = Object.keys(val.countries_where_export_done).map(function (key) {
|
||||
return val.countries_where_export_done[key];
|
||||
});
|
||||
|
||||
let total = ManufacturingArray.reduce((sum, item) => sum + +item.approx_sale, 0);
|
||||
|
||||
if (total > 100 || total < 100) {
|
||||
validationFlag++;
|
||||
Swal({ title: 'Error...',
|
||||
type: 'error',
|
||||
text: "Approximate sales doesn't add upto 100% for " + product + " in Manufacturing "
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -1521,13 +1532,19 @@ export class BusinessInfoComponent implements OnInit {
|
||||
if (records.wholesale_trading_activity_details.length > 0) {
|
||||
|
||||
records.wholesale_trading_activity_details.forEach((val, index) => {
|
||||
let product = val.main_products;
|
||||
if (val.area_of_sale != "Within India") {
|
||||
let WholesaleTradingArray = Object.keys(val.countries_where_export_done).map(function (key) {
|
||||
return val.countries_where_export_done[key];
|
||||
});
|
||||
let total = WholesaleTradingArray.reduce((sum, item) => sum + +item.approx_sale, 0);
|
||||
let total = WholesaleTradingArray.reduce((sum, item) => sum + +item.approx_sale, 0);
|
||||
if (total > 100 || total < 100) {
|
||||
validationFlag++;
|
||||
Swal({ title: 'Error...',
|
||||
type: 'error',
|
||||
text: "Approximate sales doesn't add upto 100% for " + product + " in Wholesale Trade"
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -1538,13 +1555,20 @@ export class BusinessInfoComponent implements OnInit {
|
||||
if (records.retail_trading_activity_details.length > 0) {
|
||||
|
||||
records.retail_trading_activity_details.forEach((val, index) => {
|
||||
let product = val.main_products;
|
||||
if (val.area_of_sale != "Within India") {
|
||||
let RetailTradingArray = Object.keys(val.countries_where_export_done).map(function (key) {
|
||||
return val.countries_where_export_done[key];
|
||||
});
|
||||
let total = RetailTradingArray.reduce((sum, item) => sum + +item.approx_sale, 0);
|
||||
|
||||
if (total > 100 || total < 100) {
|
||||
validationFlag++;
|
||||
Swal({ title: 'Error...',
|
||||
type: 'error',
|
||||
text: "Approximate sales doesn't add upto 100% for " + product + " in Retail Trading "
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -1556,14 +1580,21 @@ export class BusinessInfoComponent implements OnInit {
|
||||
if (records.service_provider_activity_details.length > 0) {
|
||||
|
||||
records.service_provider_activity_details.forEach((val, index) => {
|
||||
let product = val.main_products;
|
||||
if (val.area_of_sale != "Within India") {
|
||||
|
||||
let ServiceProviderArray = Object.keys(val.countries_where_export_done).map(function (key) {
|
||||
return val.countries_where_export_done[key];
|
||||
});
|
||||
let total = ServiceProviderArray.reduce((sum, item) => sum + +item.approx_sale, 0);
|
||||
|
||||
if (total > 100 || total < 100) {
|
||||
validationFlag++;
|
||||
Swal({ title: 'Error...',
|
||||
type: 'error',
|
||||
text: "Approximate sales doesn't add upto 100% for " + product + " in Service Provider "
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -1572,11 +1603,13 @@ export class BusinessInfoComponent implements OnInit {
|
||||
|
||||
//validationFlag is greater then 0 means its display the notifer as warning
|
||||
if (validationFlag > 0) {
|
||||
this.notifier.notify('warning', "Approximate sales doesn't add upto 100%");
|
||||
// this.notifier.notify('warning', "Approximate sales doesn't add upto 100%");
|
||||
console.log('validationFlag',validationFlag);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
records.select_business_activity_type = records.select_business_activity_type.filter(value => value.exist_status == 1);
|
||||
|
||||
this._pd.saveForm(records).subscribe(data => {
|
||||
this.notifier.notify('success', 'Saved Successfully.');
|
||||
setTimeout(() => {
|
||||
|
||||
@ -359,9 +359,11 @@ export class CurrentLoanComponent implements OnInit {
|
||||
});
|
||||
// this.currentLoanForm.controls['existing_loan'].setValue(arr);
|
||||
}
|
||||
else{
|
||||
this.currentLoanForm.controls['existing_loan'].setValue('No');
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
control.push(this.createLoanDetail(null));
|
||||
}
|
||||
|
||||
@ -410,6 +412,22 @@ export class CurrentLoanComponent implements OnInit {
|
||||
if (e == 'Yes') {
|
||||
|
||||
const control = <FormArray>this.currentLoanForm.controls['loan_details'];
|
||||
// let objs = {
|
||||
// 'label': null,
|
||||
// 'loan_amount': null,
|
||||
// 'frequency': null,
|
||||
// 'other_frequency': null,
|
||||
// 'emi': null,
|
||||
// 'loan_type': null,
|
||||
// 'others_loan_type': null,
|
||||
// 'loan_taken_by': null,
|
||||
// 'others_loan_taken': null,
|
||||
// 'lender': null,
|
||||
// 'others_lender': null,
|
||||
// 'original_tenure': null,
|
||||
// 'current_balance_tenure': null,
|
||||
// 'elapsed_tenure': null
|
||||
// }
|
||||
control.push(this.createLoanDetail(null));
|
||||
|
||||
} else if (e == 'No') {
|
||||
@ -444,19 +462,19 @@ export class CurrentLoanComponent implements OnInit {
|
||||
createLoanDetail(data) {
|
||||
return this.fb.group({
|
||||
label: data == null ? [''] : [data.label],
|
||||
loan_amount: null ? [''] : [data.loan_amount],
|
||||
frequency: null ? [''] : [data.frequency],
|
||||
other_frequency: null ? [''] : [data.other_frequency],
|
||||
emi: null ? [''] : [data.emi],
|
||||
loan_type: null ? [''] : [data.loan_type],
|
||||
others_loan_type: null ? [''] : [data.others_loan_type],
|
||||
loan_taken_by: null ? [''] : [data.loan_taken_by],
|
||||
others_loan_taken: null ? [''] : [data.others_loan_taken],
|
||||
lender: null ? [''] : [data.lender],
|
||||
others_lender: null ? [''] : [data.others_lender],
|
||||
original_tenure: null ? [''] : [data.original_tenure],
|
||||
current_balance_tenure: null ? [''] : [data.current_balance_tenure],
|
||||
elapsed_tenure: null ? [''] : [data.elapsed_tenure]
|
||||
loan_amount: data == null ? [''] : [data.loan_amount],
|
||||
frequency: data == null ? [''] : [data.frequency],
|
||||
other_frequency: data == null ? [''] : [data.other_frequency],
|
||||
emi: data == null ? [''] : [data.emi],
|
||||
loan_type: data == null ? [''] : [data.loan_type],
|
||||
others_loan_type: data == null ? [''] : [data.others_loan_type],
|
||||
loan_taken_by: data == null ? [''] : [data.loan_taken_by],
|
||||
others_loan_taken: data == null ? [''] : [data.others_loan_taken],
|
||||
lender: data == null ? [''] : [data.lender],
|
||||
others_lender: data == null ? [''] : [data.others_lender],
|
||||
original_tenure: data == null ? [''] : [data.original_tenure],
|
||||
current_balance_tenure: data == null ? [''] : [data.current_balance_tenure],
|
||||
elapsed_tenure: data == null ? [''] : [data.elapsed_tenure]
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -85,7 +85,7 @@ export class LoanDetailsComponent implements OnInit {
|
||||
private _pd: PdTrigerService,
|
||||
private dialogRef: MatDialogRef<LoanDetailsComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
|
||||
console.log('this.pd_all_details.pdapplicants_detials',this.pd_all_details.pdapplicants_detials);
|
||||
// console.log('this.pd_all_details.pdapplicants_detials',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 = this.applicants.filter(appt => appt.applicant_type != 2)
|
||||
@ -496,7 +496,7 @@ console.log('this.pd_all_details.pdapplicants_detials',this.pd_all_details.pdapp
|
||||
|
||||
/** Source Changes with Validation */
|
||||
sourceChange(evt) {
|
||||
|
||||
// console.log('sourceChange');
|
||||
this.isOtherSource = evt.some(e => e == 1) // this return true or false Only;
|
||||
|
||||
if (this.isOtherSource) {
|
||||
@ -531,7 +531,7 @@ console.log('this.pd_all_details.pdapplicants_detials',this.pd_all_details.pdapp
|
||||
|
||||
/**For Setting Validations */
|
||||
selectedBalancesTransferChanges(event: any) {
|
||||
|
||||
// console.log('selectedBalancesTransferChanges',event);
|
||||
if (event.value == 'no') {
|
||||
this.loanDetailsForm.controls['source'].setValidators([Validators.required]);
|
||||
this.loanDetailsForm.controls['source'].updateValueAndValidity();
|
||||
@ -548,6 +548,9 @@ console.log('this.pd_all_details.pdapplicants_detials',this.pd_all_details.pdapp
|
||||
|
||||
}
|
||||
else if (event.value == 'yes') {
|
||||
|
||||
// console.log(event.value,'yes');
|
||||
|
||||
this.loanDetailsForm.controls['source'].setValue('');
|
||||
this.loanDetailsForm.controls['source'].clearValidators();
|
||||
this.loanDetailsForm.controls['source'].updateValueAndValidity();
|
||||
@ -612,8 +615,8 @@ console.log('this.pd_all_details.pdapplicants_detials',this.pd_all_details.pdapp
|
||||
|
||||
mortage_type(mortage_value)
|
||||
{
|
||||
console.log('mortage_value',mortage_value);
|
||||
console.log('this.m_mortageTypeProperty',this.m_mortageTypeProperty);
|
||||
// console.log('mortage_value',mortage_value);
|
||||
// console.log('this.m_mortageTypeProperty',this.m_mortageTypeProperty);
|
||||
let mortagetypes = this.m_mortageTypeProperty.filter(mor => mor.mortage_property_id == mortage_value)[0];
|
||||
let property_name = mortagetypes.property_name.replace(/\s/g, "").toLowerCase();
|
||||
if(property_name=='others')
|
||||
@ -654,34 +657,82 @@ console.log('this.pd_all_details.pdapplicants_detials',this.pd_all_details.pdapp
|
||||
}
|
||||
|
||||
/** Validation */
|
||||
validateAllFormFields(formGroup: FormGroup) {
|
||||
validateAllFormFields(formGroup: any) {
|
||||
Object.keys(formGroup.controls).forEach(field => {
|
||||
const control = formGroup.get(field);
|
||||
if (control instanceof FormControl) {
|
||||
control.markAsTouched({ onlySelf: true });
|
||||
} else if (control instanceof FormGroup) {
|
||||
this.validateAllFormFields(control);
|
||||
} else if (control instanceof FormArray) {
|
||||
this.validateAllFormFields(control);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** To save Loan FOrm Details */
|
||||
submitLoanDetails() {
|
||||
// console.log('submitLoanDetails');
|
||||
if(this.isOtherSource == false){
|
||||
this.loanDetailsForm.controls['other_source'].setValue('');
|
||||
this.loanDetailsForm.controls['other_source'].clearValidators();
|
||||
this.loanDetailsForm.controls['other_source'].updateValueAndValidity();
|
||||
}
|
||||
else{
|
||||
this.loanDetailsForm.controls['other_source'].setValidators([Validators.required]);
|
||||
this.loanDetailsForm.controls['other_source'].updateValueAndValidity();
|
||||
}
|
||||
|
||||
if ((this.isContribution == true)) {
|
||||
if(this.isContribution == true) {
|
||||
// console.log('if this.isContribution',this.isContribution);
|
||||
if (this.loanDetailsForm.controls['is_transfer'].value != 'yes') {
|
||||
this.loanDetailsForm.controls['own_contribution'].setValue('');
|
||||
this.loanDetailsForm.controls['own_contribution'].clearValidators();
|
||||
this.loanDetailsForm.controls['own_contribution'].updateValueAndValidity();
|
||||
this.loanDetailsForm.controls['other_source'].setValue('');
|
||||
this.loanDetailsForm.controls['other_source'].clearValidators();
|
||||
this.loanDetailsForm.controls['other_source'].updateValueAndValidity();
|
||||
this.loanDetailsForm.controls['source'].setValue('');
|
||||
this.loanDetailsForm.controls['source'].clearValidators();
|
||||
this.loanDetailsForm.controls['source'].updateValueAndValidity();
|
||||
}
|
||||
else if (this.loanDetailsForm.controls['is_transfer'].value == 'yes') {
|
||||
if (this.loanDetailsForm.controls['end_use_topup'].value == 1) {
|
||||
this.loanDetailsForm.controls['other_end_use_topup'].setValidators([Validators.required]);
|
||||
this.loanDetailsForm.controls['other_end_use_topup'].updateValueAndValidity();
|
||||
}
|
||||
else {
|
||||
this.loanDetailsForm.controls['other_end_use_topup'].setValue('');
|
||||
this.loanDetailsForm.controls['other_end_use_topup'].clearValidators();
|
||||
this.loanDetailsForm.controls['other_end_use_topup'].updateValueAndValidity();
|
||||
}
|
||||
|
||||
if (this.loanDetailsForm.controls['lender'].value == 1) {
|
||||
this.loanDetailsForm.controls['other_bt_lender'].setValidators([Validators.required]);
|
||||
this.loanDetailsForm.controls['other_bt_lender'].updateValueAndValidity();
|
||||
}
|
||||
else {
|
||||
this.loanDetailsForm.controls['other_bt_lender'].setValue('');
|
||||
this.loanDetailsForm.controls['other_bt_lender'].clearValidators();
|
||||
this.loanDetailsForm.controls['other_bt_lender'].updateValueAndValidity();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(this.isContribution == false) {
|
||||
|
||||
if (this.loanDetailsForm.controls['is_transfer'].value != 'yes') {
|
||||
|
||||
this.loanDetailsForm.controls['own_contribution'].setValidators([Validators.required]);
|
||||
this.loanDetailsForm.controls['own_contribution'].updateValueAndValidity();
|
||||
|
||||
this.loanDetailsForm.controls['source'].setValidators([Validators.required]);
|
||||
this.loanDetailsForm.controls['source'].updateValueAndValidity();
|
||||
}
|
||||
else if (this.loanDetailsForm.controls['is_transfer'].value == 'yes') {
|
||||
this.loanDetailsForm.controls['own_contribution'].setValue('');
|
||||
this.loanDetailsForm.controls['own_contribution'].clearValidators();
|
||||
this.loanDetailsForm.controls['own_contribution'].updateValueAndValidity();
|
||||
this.loanDetailsForm.controls['source'].setValue('');
|
||||
this.loanDetailsForm.controls['source'].clearValidators();
|
||||
this.loanDetailsForm.controls['source'].updateValueAndValidity();
|
||||
|
||||
if (this.loanDetailsForm.controls['end_use_topup'].value == 1) {
|
||||
this.loanDetailsForm.controls['other_end_use_topup'].setValidators([Validators.required]);
|
||||
this.loanDetailsForm.controls['other_end_use_topup'].updateValueAndValidity();
|
||||
@ -705,6 +756,7 @@ console.log('this.pd_all_details.pdapplicants_detials',this.pd_all_details.pdapp
|
||||
}
|
||||
|
||||
if (!this.loanDetailsForm.valid) {
|
||||
this.validateAllFormFields(this.loanDetailsForm);
|
||||
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
||||
this.disableAfterSubmit = false;
|
||||
return;
|
||||
|
||||
@ -108,9 +108,11 @@ export class RentalVerificationComponent implements OnInit {
|
||||
let tempArray: any = [];
|
||||
let amt: any = [];
|
||||
this.existing_rental_count_id = rentalVal.length;
|
||||
|
||||
//RIV = Rental Income Verification
|
||||
rentalVal.forEach((RIV, inx) => {
|
||||
let annualRentAmt: any;
|
||||
console.log('RIV.rental_count_id',RIV.rental_count_id);
|
||||
console.log('RIV',RIV,inx);
|
||||
let annualRentAmt: any = 0;
|
||||
// get property unit details
|
||||
if (RIV.property_unit_details) {
|
||||
let selectedUnitDetails = Object.keys(RIV.property_unit_details).map(function (key) {
|
||||
@ -127,6 +129,7 @@ export class RentalVerificationComponent implements OnInit {
|
||||
annualRentAmt = 0;
|
||||
}
|
||||
amt[inx] = annualRentAmt;
|
||||
tempArray = [];
|
||||
}
|
||||
this._pd.getStateCityNamesAndPincode({ "state_id": RIV.state, "city_id": RIV.city, "pincode_id": RIV.pincode }).subscribe(data => {
|
||||
if (data.dataStatus) {
|
||||
|
||||
@ -0,0 +1,19 @@
|
||||
import { Directive, ElementRef, HostListener, Input } from '@angular/core';
|
||||
// import { NgControl } from '@angular/forms';
|
||||
|
||||
@Directive({
|
||||
selector: '[ForMobileNumbers]'
|
||||
})
|
||||
export class ForMobileNumbersDirective {
|
||||
|
||||
constructor(private _el: ElementRef) { }
|
||||
|
||||
@HostListener('input', ['$event']) onInputChange(event) {
|
||||
const initalValue = this._el.nativeElement.value;
|
||||
this._el.nativeElement.value = initalValue.replace(/[^0-9]*/g, '');
|
||||
if ( initalValue !== this._el.nativeElement.value) {
|
||||
event.stopPropagation();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -6,6 +6,7 @@ import { AccordionAnchorDirective, AccordionLinkDirective, AccordionDirective }
|
||||
import { ToggleFullscreenDirective } from './fullscreen/toggle-fullscreen.directive';
|
||||
import { RatingComponent} from './rating/rating.component';
|
||||
import { NumbersOnlyDirective } from './numbers-only/numbers-only.directive';
|
||||
import { ForMobileNumbersDirective } from './for-mobile-numbers/for-mobile-numbers.directive';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
@ -14,7 +15,8 @@ import { NumbersOnlyDirective } from './numbers-only/numbers-only.directive';
|
||||
AccordionDirective,
|
||||
ToggleFullscreenDirective,
|
||||
RatingComponent,
|
||||
NumbersOnlyDirective
|
||||
NumbersOnlyDirective,
|
||||
ForMobileNumbersDirective
|
||||
],
|
||||
exports: [
|
||||
AccordionAnchorDirective,
|
||||
@ -22,7 +24,8 @@ import { NumbersOnlyDirective } from './numbers-only/numbers-only.directive';
|
||||
AccordionDirective,
|
||||
ToggleFullscreenDirective,
|
||||
RatingComponent,
|
||||
NumbersOnlyDirective
|
||||
NumbersOnlyDirective,
|
||||
ForMobileNumbersDirective
|
||||
],
|
||||
providers: [ MenuItems, HorizontalMenuItems ]
|
||||
})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user