add and edit pd mandatory removed

This commit is contained in:
sriram-at-840620226347 2020-03-21 14:53:38 +05:30
parent 7a0a05f609
commit 3eea355963
5 changed files with 44 additions and 3 deletions

View File

@ -44,7 +44,7 @@
</mat-form-field>
<mat-form-field style="width: 28%">
<input matInput autocomplete="off" placeholder=" Loan Application ID" formControlName="lender_applicant_id" type="text" required (change)="checkExistPd($event.target.value,1)">
<input matInput autocomplete="off" placeholder="Loan Application ID" formControlName="lender_applicant_id" type="text" (change)="checkExistPd($event.target.value,1)">
<!-- <mat-error *ngIf="pdMain.lender_applicant_id.hasError('required')">Applicant ID Required</mat-error> -->
</mat-form-field>
<!-- <div *ngIf="sales_and_credit_enable"> -->

View File

@ -64,6 +64,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
cityData: any=[];
stateData: any=[];
billingtolist: any;
removedControl: any = [];
constructor(notifier: NotifierService, private _fb: FormBuilder, private route: ActivatedRoute,
private router: Router, private _pd: PdTrigerService, private _aws: AwsService, private ListPdComponent: ListPdComponent,
private titleCase : TitleCasePipe) {
@ -99,6 +100,25 @@ export class AddPdComponent implements OnInit, OnDestroy {
this.pdTypeList=res['records'].pd_types
this.customerSegmentAllList=res['records'].customer_segments
this.finInstitutionList=res['records'].financial_institutions
let lender_other_config = res['records'].lender_other_config
lender_other_config = JSON.parse(lender_other_config)
if(lender_other_config != null){
this.removedControl = lender_other_config.non_mandatory_fields
lender_other_config.non_mandatory_fields.forEach(lender_config=>{
console.log('lendercofig',lender_config)
this._PDtriggerForm.controls[lender_config].clearValidators();
this._PDtriggerForm.controls[lender_config].updateValueAndValidity()
})
}
else{
if(this.removedControl.length > 0) {
this.removedControl.forEach(lender_set_config=>{
console.log('lendercofig',lender_set_config)
this._PDtriggerForm.controls[lender_set_config].setValidators(Validators.compose([Validators.required]));
this._PDtriggerForm.controls[lender_set_config].updateValueAndValidity()
})
}
}
let selectLender=this.lenderList.filter(val=>val.entity_id == entity_id)[0]
console.log(selectLender);
this.selectedLender(selectLender)

View File

@ -60,7 +60,7 @@
<mat-form-field style="width: 29%">
<input matInput placeholder=" Loan Application ID" formControlName="lender_applicant_id"
type="text" required (change)="checkExistPd($event.target.value)">
type="text" (change)="checkExistPd($event.target.value)">
</mat-form-field>
<!-- <div *ngIf="sales_and_credit_enable"> -->
<mat-form-field style="width: 28%">

View File

@ -73,6 +73,7 @@ export class EditPdMasterComponent implements OnInit {
sales_and_credit_person: any=[];
finInstitutionList: any;
billingtolist: any;
removedControl: any = [];
constructor(private _fb: FormBuilder,
private _pd: PdTrigerService, notifier: NotifierService,private dialogRef: MatDialogRef<EditPdMasterComponent>,
@Inject(MAT_DIALOG_DATA) public data: any,private titleCase : TitleCasePipe) {
@ -112,6 +113,26 @@ export class EditPdMasterComponent implements OnInit {
this.customerSegmentAllList=res['records'].customer_segments
this.finInstitutionList=res['records'].financial_institutions
let lender_other_config = res['records'].lender_other_config
lender_other_config = JSON.parse(lender_other_config)
if(lender_other_config != null){
this.removedControl = lender_other_config.non_mandatory_fields
lender_other_config.non_mandatory_fields.forEach(lender_config=>{
console.log('lendercofig',lender_config)
this._EditPDtriggerForm.controls[lender_config].clearValidators();
this._EditPDtriggerForm.controls[lender_config].updateValueAndValidity()
})
}
else{
if(this.removedControl.length > 0) {
this.removedControl.forEach(lender_set_config=>{
console.log('lendercofig',lender_set_config)
this._EditPDtriggerForm.controls[lender_set_config].setValidators(Validators.compose([Validators.required]));
this._EditPDtriggerForm.controls[lender_set_config].updateValueAndValidity()
})
}
}
if(this.data.records.fk_product_id && option == 'start'){
this.getSubproductList(this.data.records.fk_product_id,1);
}

View File

@ -12,7 +12,7 @@ export const environment = {
// apiEndpoint: 'https://demo.pdgenie.com/sparqtest/api/',
// apiEndpoint: 'https://demo.pdgenie.com/sparqapi/api/',
apiEndpoint:'https://apitest.pdgenie.com/sparqapi/api/',
apiEndpoint:'https://apitest.pdgenie.com/sparqtest/api/',
// apiEndpoint:'http://localhost/sineEdge/sparqapi/api/',
authorization: 'sparqvenba2018',