diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html index 5d93739..852b917 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html @@ -20,7 +20,7 @@ - + Select diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts index 074892a..ba3980d 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts @@ -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); + // } }