others field changes : ps

This commit is contained in:
venbatechnologies@gmail.com 2019-04-15 13:55:18 +05:30
parent f505fd1b60
commit 270004fea2
6 changed files with 21 additions and 10 deletions

View File

@ -436,6 +436,7 @@ export class AddressComponent implements OnInit {
} }
if (!this.addressForm.valid) { if (!this.addressForm.valid) {
this.validateAllFormFields(this.addressForm);
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!'); this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
this.disableAfterSubmit = false; this.disableAfterSubmit = false;
return; return;
@ -485,16 +486,18 @@ export class AddressComponent implements OnInit {
/** To validate All Form Fields */ /** To validate All Form Fields */
validateAllFormFields(formGroup: FormGroup) { validateAllFormFields(formGroup: any) {
Object.keys(formGroup.controls).forEach(field => { Object.keys(formGroup.controls).forEach(field => {
const control = formGroup.get(field); const control = formGroup.get(field);
if (control instanceof FormControl) { if (control instanceof FormControl) {
control.markAsTouched({ onlySelf: true }); control.markAsTouched({ onlySelf: true });
} else if (control instanceof FormGroup) { } else if (control instanceof FormGroup) {
this.validateAllFormFields(control);
} else if (control instanceof FormArray) {
this.validateAllFormFields(control); this.validateAllFormFields(control);
} }
}); });
} }
/** For DOCS Tab */ /** For DOCS Tab */
public viewerOptions: any = { public viewerOptions: any = {

View File

@ -604,13 +604,10 @@ export class GeneralInfoComponent implements OnInit {
temp: number = 0; temp: number = 0;
submitGeneralForm(formData: any) { submitGeneralForm(formData: any) {
// console.log('formData',formData); // console.log('formData',formData);
if (formData.individuals.length > 0) { if (formData.individuals.length > 0) {
formData.individuals.forEach((val, index) => { formData.individuals.forEach((val, index) => {
if (val.is_person_met == false) { if (val.is_person_met == false) {
this.temp++; this.temp++;
} }
@ -618,11 +615,12 @@ export class GeneralInfoComponent implements OnInit {
if (this.temp == formData.individuals.length) { if (this.temp == formData.individuals.length) {
this.notifier.notify('warning', 'Please Choose Name of Person Met.!'); this.notifier.notify('warning', 'Please Choose Name of Person Met.!');
this.temp = 0; this.temp = 0;
return; return;
} }
else if(this.temp <= formData.individuals.length){
this.temp = 0;
}
let individualCtrl: any = this._generalForm.get('individuals') as FormArray; let individualCtrl: any = this._generalForm.get('individuals') as FormArray;
let individualCtrlLength: any = individualCtrl.controls.length; let individualCtrlLength: any = individualCtrl.controls.length;

View File

@ -40,11 +40,13 @@
<input matInput placeholder="What is the name of lender representative who accompanies the PD officer, If any?" <input matInput placeholder="What is the name of lender representative who accompanies the PD officer, If any?"
formControlName="lender_representative_who_accompanies" formControlName="lender_representative_who_accompanies"
required> required>
<mat-error *ngIf="details.controls['lender_representative_who_accompanies'].hasError('required')">Lender Name Required</mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input matInput placeholder="Did the lender representative carry the loan file during PD?" <input matInput placeholder="Did the lender representative carry the loan file during PD?"
formControlName="lender_representative_carry_loan_files" formControlName="lender_representative_carry_loan_files"
required> required>
<mat-error *ngIf="details.controls['lender_representative_carry_loan_files'].hasError('required')">Did the lender representative carry the loan file during PD? Required</mat-error>
</mat-form-field> </mat-form-field>
</div> </div>
</div> </div>

View File

@ -176,13 +176,15 @@ export class LenderRepresentativeComponent implements OnInit {
this.disableAfterSubmit = false; this.disableAfterSubmit = false;
}) })
} }
validateAllFormFields(formGroup: FormGroup) { validateAllFormFields(formGroup: any) {
Object.keys(formGroup.controls).forEach(field => { Object.keys(formGroup.controls).forEach(field => {
const control = formGroup.get(field); const control = formGroup.get(field);
if (control instanceof FormControl) { if (control instanceof FormControl) {
control.markAsTouched({ onlySelf: true }); control.markAsTouched({ onlySelf: true });
} else if (control instanceof FormGroup) { } else if (control instanceof FormGroup) {
this.validateAllFormFields(control); this.validateAllFormFields(control);
} else if (control instanceof FormArray) {
this.validateAllFormFields(control);
} }
}); });
} }

View File

@ -55,6 +55,7 @@
<mat-form-field *ngIf="isOtherPurpose" style="width: 28%"> <mat-form-field *ngIf="isOtherPurpose" style="width: 28%">
<input matInput placeholder="Specify End Use *" formControlName="end_use_other" <input matInput placeholder="Specify End Use *" formControlName="end_use_other"
autocomplete="off"> autocomplete="off">
<mat-error *ngIf="loanDetailsForm.controls['end_use_other'].hasError('required')">End Use Required</mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 64%"> <mat-form-field style="width: 64%">
<mat-select placeholder="Is there a balance transfer ? " (selectionChange)="selectedBalancesTransferChanges($event)" <mat-select placeholder="Is there a balance transfer ? " (selectionChange)="selectedBalancesTransferChanges($event)"
@ -87,6 +88,7 @@
<mat-form-field *ngIf="loanDetailsForm.controls['lender'].value == 1" style="width: 28%"> <mat-form-field *ngIf="loanDetailsForm.controls['lender'].value == 1" style="width: 28%">
<input matInput placeholder="Specify Others Lender *" formControlName="other_bt_lender" <input matInput placeholder="Specify Others Lender *" formControlName="other_bt_lender"
autocomplete="off"> autocomplete="off">
<mat-error *ngIf="loanDetailsForm.controls['other_bt_lender'].hasError('required')">Lender Required</mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 64%"> <mat-form-field style="width: 64%">
@ -109,6 +111,7 @@
style="width: 28%"> style="width: 28%">
<input matInput placeholder="Specify End Use of Top Up *" <input matInput placeholder="Specify End Use of Top Up *"
formControlName="other_end_use_topup" autocomplete="off"> formControlName="other_end_use_topup" autocomplete="off">
<mat-error *ngIf="loanDetailsForm.controls['other_end_use_topup'].hasError('required')">End Use of Top Up Required</mat-error>
</mat-form-field> </mat-form-field>
</span> </span>
<span *ngIf="loanDetailsForm.controls['is_transfer'].value != 'yes' && loanDetailsForm.controls['is_transfer'].value != '' && !isContribution"> <span *ngIf="loanDetailsForm.controls['is_transfer'].value != 'yes' && loanDetailsForm.controls['is_transfer'].value != '' && !isContribution">
@ -136,6 +139,7 @@
<mat-form-field *ngIf="isOtherSource" style="width: 28%"> <mat-form-field *ngIf="isOtherSource" style="width: 28%">
<input matInput placeholder="Specify Other Sources *" formControlName="other_source" <input matInput placeholder="Specify Other Sources *" formControlName="other_source"
autocomplete="off"> autocomplete="off">
<mat-error *ngIf="loanDetailsForm.controls['other_source'].hasError('required')">Sources Required</mat-error>
</mat-form-field> </mat-form-field>
</span> </span>
@ -166,6 +170,7 @@
<mat-form-field *ngIf="mortageAccess" style="width:46%;"> <mat-form-field *ngIf="mortageAccess" style="width:46%;">
<input matInput placeholder="Specify Type of Property *" formControlName="property_type_others" <input matInput placeholder="Specify Type of Property *" formControlName="property_type_others"
autocomplete="off"> autocomplete="off">
<mat-error *ngIf="loanDetailsForm.controls['property_type_others'].hasError('required')">Type of Property Required</mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:46%;"> <mat-form-field style="width:46%;">
@ -177,6 +182,7 @@
</mat-option> </mat-option>
</mat-optgroup> </mat-optgroup>
</mat-select> </mat-select>
<mat-error *ngIf="loanDetailsForm.controls['owner_name'].hasError('required')">Owner Required</mat-error>
</mat-form-field> </mat-form-field>
<!-- <mat-select multiple placeholder="Name of Owner" <!-- <mat-select multiple placeholder="Name of Owner"

View File

@ -617,7 +617,7 @@
<!-- start validate appplicant/agreement payment options --> <!-- start validate appplicant/agreement payment options -->
<span *ngIf="units.controls['paid_monthly_rent_per_met'] && units.controls['payment_mode'] && units.controls['monthly_rent_amount'] && units.controls['payment_mode_per_met']"> <span *ngIf="units.controls['paid_monthly_rent_per_met'] && units.controls['payment_mode'] && units.controls['monthly_rent_amount'] && units.controls['payment_mode_per_met']">
<mat-form-field style="width:100% !important" appearance="outline" *ngIf="(units.value.monthly_rent_amount>0 && units.value.paid_monthly_rent_per_met>0 && units.value.payment_mode!='' && units.value.payment_mode_per_met!='') && (units.value.monthly_rent_amount!=units.value.paid_monthly_rent_per_met) || units.value.payment_mode_per_met.id != 2 "><!-- || units.value.payment_mode.id!=units.value.payment_mode_per_met.id --> <mat-form-field style="width: 28.2rem !important;" appearance="outline" *ngIf="(units.value.monthly_rent_amount>0 && units.value.paid_monthly_rent_per_met>0 && units.value.payment_mode!='' && units.value.payment_mode_per_met!='') && (units.value.monthly_rent_amount!=units.value.paid_monthly_rent_per_met) || units.value.payment_mode_per_met.id != 2 "><!-- || units.value.payment_mode.id!=units.value.payment_mode_per_met.id -->
<mat-label>What is the Reason for Difference in Rent Amount</mat-label><!-- or Mode of Payment --> <mat-label>What is the Reason for Difference in Rent Amount</mat-label><!-- or Mode of Payment -->
<input matInput autocomplete="off" placeholder="" formControlName="payment_difference_per_met"> <input matInput autocomplete="off" placeholder="" formControlName="payment_difference_per_met">
</mat-form-field> </mat-form-field>