add pd changes

This commit is contained in:
sriram-at-840620226347 2020-02-13 18:04:26 +05:30
parent 42dba214e9
commit 62f0fff6fa
2 changed files with 26 additions and 16 deletions

View File

@ -20,7 +20,7 @@
</mat-card-header>
<mat-card-content>
<mat-form-field style="width: 28%">
<mat-select placeholder="Lender Name" formControlName="fk_lender_id" (selectionChange)="getContactPerson()">
<mat-select placeholder="Lender Name" formControlName="fk_lender_id" (selectionChange)="getContactPerson();getProCusType($event.value)">
<!-- (selectionChange)="getBillingDetails(pdMain.fk_lender_id.value)" -->
<mat-option> Select </mat-option>
<mat-option (click)="selectedLender(LL)" *ngFor="let LL of lenderList" [value]="LL.entity_id" >

View File

@ -96,16 +96,26 @@ export class AddPdComponent implements OnInit, OnDestroy {
}
getProCusType(){
getProCusType(entity_id,flag?){
console.log("u",this.userDetails)
this._pd.getEntityPreferences(this.userDetails.fk_entity_id).subscribe(Response=>{
this._pd.getEntityPreferences(entity_id).subscribe(Response=>{
if(Response['dataStatus']){
this.pdTypeList=Response['records'].pd_types
this.customerSegmentAllList=Response['records'].customer_segments
this.productAllList=Response['records'].products
this.productList=this.productAllList
this.finInstitutionList=Response['records'].financial_institutions
if(flag == true){
this.loadFormData();
}
this.getSubproductList(Response['records'].default_product)
this._PDtriggerForm.controls['fk_product_id'].setValue(Response['records'].default_product);
this._PDtriggerForm.controls['fk_subproduct_id'].setValue(Response['records'].default_sub_product);
this._PDtriggerForm.controls['fk_customer_segment'].setValue(Response['records'].default_customer_segment);
// this._PDtriggerForm.controls['fk_pd_type'].setValue(Response['records'].default_pd_type);
}
this.loadFormData();
})
}
getUserDetails(){
@ -114,7 +124,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
this.userDetails=res['records'][0];
}
// console.log(this.userDetails)
this.getProCusType()
this.getProCusType(this.userDetails.fk_entity_id,true)
this.sales_and_credit_person.credit_person=[{userid:this.userDetails.userid,user_name:this.userDetails.user_first_name+' '+this.userDetails.user_last_name}]
})
}
@ -211,12 +221,12 @@ export class AddPdComponent implements OnInit, OnDestroy {
this._PDtriggerForm.controls['fk_customer_segment'].setValue('');
this._PDtriggerForm.controls['loan_amount'].setValue('');
if(this.lenderShortName == "IIB"){ //FOR INDUSLAND BANK
// console.log("entered");
this._PDtriggerForm.controls['fk_product_id'].setValue("3")
this._PDtriggerForm.controls['fk_pd_type'].setValue("1");
this.getSubproductList("3")
}
// if(this.lenderShortName == "IIB"){ //FOR INDUSLAND BANK
// // console.log("entered");
// this._PDtriggerForm.controls['fk_product_id'].setValue("3")
// this._PDtriggerForm.controls['fk_pd_type'].setValue("1");
// this.getSubproductList("3")
// }
// console.log("len",lender)
}
@ -315,11 +325,11 @@ export class AddPdComponent implements OnInit, OnDestroy {
break;
}
if(this.lenderShortName == 'CLIX' && productabbr != ''){
this._PDtriggerForm.controls['fk_pd_type'].setValue('1');
this._PDtriggerForm.controls['fk_customer_segment'].setValue('5');
this._PDtriggerForm.controls['loan_amount'].setValue(0);
}
// if(this.lenderShortName == 'CLIX' && productabbr != ''){
// this._PDtriggerForm.controls['fk_pd_type'].setValue('1');
// this._PDtriggerForm.controls['fk_customer_segment'].setValue('5');
// this._PDtriggerForm.controls['loan_amount'].setValue(0);
// }
}