add pd (remove validation loan amount,loan applicant id)

This commit is contained in:
venbatechnologies@gmail.com 2022-01-04 18:14:52 +05:30
parent a7c6897a5c
commit baae0d0aba
2 changed files with 29 additions and 8 deletions

View File

@ -158,13 +158,21 @@
<!-- <mat-error *ngIf="pdMain.fk_pd_type.hasError('required')">PD Type Required.</mat-error> --> <!-- <mat-error *ngIf="pdMain.fk_pd_type.hasError('required')">PD Type Required.</mat-error> -->
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 60%"> <!--<mat-form-field style="width: 60%">
<mat-label>{{lenderShortName == 'CFPL' ? 'Facility' :'Loan'}} Amount <span *ngIf="pdMain.loan_amount.hasError('required')">*</span></mat-label> <mat-label>{{lenderShortName == 'CFPL' ? 'Facility' :'Loan'}} Amount <span *ngIf="pdMain.loan_amount.hasError('required')">*</span></mat-label>
<input matInput autocomplete="off" placeholder="Enter the amount" formControlName="loan_amount" OnlyNumber autocomplete="off"> <input matInput autocomplete="off" placeholder="Enter the amount" formControlName="loan_amount" OnlyNumber autocomplete="off">
<mat-hint align="start" style="font-size:90%" *ngIf="pdMain.loan_amount.value">{{"&#8377;"}} {{pdMain.loan_amount.value | numberToWords}} Only</mat-hint> <mat-hint align="start" style="font-size:90%" *ngIf="pdMain.loan_amount.value">{{"&#8377;"}} {{pdMain.loan_amount.value | numberToWords}} Only</mat-hint>
<mat-error *ngIf="pdMain.loan_amount.hasError('required')">Required.</mat-error> <mat-error *ngIf="pdMain.loan_amount.hasError('required')">Required.</mat-error>
<mat-error *ngIf="pdMain.loan_amount.hasError('pattern')">Enter valid amount. </mat-error> <mat-error *ngIf="pdMain.loan_amount.hasError('pattern')">Enter valid amount. </mat-error>
</mat-form-field>-->
<mat-form-field style="width: 60%">
<mat-label>{{lenderShortName == 'CFPL' ? 'Facility' :'Loan'}} Amount </mat-label>
<input matInput autocomplete="off" placeholder="Enter the amount" formControlName="loan_amount" OnlyNumber autocomplete="off">
<mat-hint align="start" style="font-size:90%" *ngIf="pdMain.loan_amount.value">{{"&#8377;"}} {{pdMain.loan_amount.value | numberToWords}} Only</mat-hint>
<mat-error *ngIf="pdMain.loan_amount.hasError('required')">Required.</mat-error>
<mat-error *ngIf="pdMain.loan_amount.hasError('pattern')">Enter valid amount. </mat-error>
</mat-form-field> </mat-form-field>
</mat-card-content> </mat-card-content>
</mat-card> </mat-card>

View File

@ -102,14 +102,18 @@ export class AddPdComponent implements OnInit, OnDestroy {
this.filterList() this.filterList()
} }
getProCusPDType(entity_id){ getProCusPDType(entity_id){
console.log(entity_id); console.log(entity_id);
this._pd.getEntityPreferences(entity_id).subscribe(res=>{ this._pd.getEntityPreferences(entity_id).subscribe(res=>{
if(res['dataStatus']){ if(res['dataStatus']){
console.log(res);
console.log('res');
this.productAllList=res['records'].products this.productAllList=res['records'].products
this.pdTypeList=res['records'].pd_types this.pdTypeList=res['records'].pd_types
this.customerSegmentAllList=res['records'].customer_segments this.customerSegmentAllList=res['records'].customer_segments
this.finInstitutionList=res['records'].financial_institutions this.finInstitutionList=res['records'].financial_institutions
let lender_other_config = res['records'].lender_other_config let lender_other_config = res['records'].lender_other_config
lender_other_config = JSON.parse(lender_other_config) lender_other_config = JSON.parse(lender_other_config)
if(lender_other_config != null){ if(lender_other_config != null){
this.removedControl = lender_other_config.non_mandatory_fields this.removedControl = lender_other_config.non_mandatory_fields
@ -117,6 +121,8 @@ export class AddPdComponent implements OnInit, OnDestroy {
console.log('lendercofig',lender_config) console.log('lendercofig',lender_config)
this._PDtriggerForm.controls[lender_config].clearValidators(); this._PDtriggerForm.controls[lender_config].clearValidators();
this._PDtriggerForm.controls[lender_config].updateValueAndValidity() this._PDtriggerForm.controls[lender_config].updateValueAndValidity()
this._PDtriggerForm.controls['loan_amount'].clearValidators();
this._PDtriggerForm.controls['loan_amount'].updateValueAndValidity()
}) })
} }
else{ else{
@ -197,7 +203,14 @@ export class AddPdComponent implements OnInit, OnDestroy {
this._PDtriggerForm.controls.pd_branch_id.setValue(null); this._PDtriggerForm.controls.pd_branch_id.setValue(null);
this.productList = this.productAllList; this.productList = this.productAllList;
// if(this.lenderShortName == 'CLIX')
// {
// this._PDtriggerForm.controls['loan_amount'].setValue(null)
// this._PDtriggerForm.controls['loan_amount'].clearValidators()
// this._PDtriggerForm.controls['loan_amount'].updateValueAndValidity()
// alert('clix');
// }
// if(this.lenderShortName == 'CLIX'){ // if(this.lenderShortName == 'CLIX'){
// let getProductAbbr = this.productAllList.map(dval => dval.product_abbr); // let getProductAbbr = this.productAllList.map(dval => dval.product_abbr);
@ -242,10 +255,10 @@ export class AddPdComponent implements OnInit, OnDestroy {
this._PDtriggerForm.controls['loan_amount'].setValidators([Validators.pattern('^[0-9]*$')]) this._PDtriggerForm.controls['loan_amount'].setValidators([Validators.pattern('^[0-9]*$')])
this._PDtriggerForm.controls['loan_amount'].updateValueAndValidity(); this._PDtriggerForm.controls['loan_amount'].updateValueAndValidity();
} }
else{ // else{
this._PDtriggerForm.controls['loan_amount'].setValidators([Validators.required,Validators.pattern('^[0-9]*$')]); // this._PDtriggerForm.controls['loan_amount'].setValidators([Validators.required,Validators.pattern('^[0-9]*$')]);
this._PDtriggerForm.controls['loan_amount'].updateValueAndValidity(); // this._PDtriggerForm.controls['loan_amount'].updateValueAndValidity();
} // }
// if(this.lenderShortName == "IIB"){ //FOR INDUSLAND BANK // if(this.lenderShortName == "IIB"){ //FOR INDUSLAND BANK
// // console.log("entered"); // // console.log("entered");