diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts index 23982b0f8..bab96ca38 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts @@ -68,7 +68,7 @@ export class EditPdMasterComponent implements OnInit { }; lenderShortName: any; isSubproductShown: boolean = true; - productShortName : any; + prod_catagory : any; sales_and_credit_enable: boolean=false; sales_and_credit_person: any=[]; finInstitutionList: any; @@ -118,6 +118,14 @@ export class EditPdMasterComponent implements OnInit { let selectLender=this.lenderList.filter(val=>val.entity_id == entity_id)[0] console.log(selectLender); this.selectedLender(selectLender,option) + if(option != 'start'){ + this.getSubproductList(res['records'].default_product,1); + this._EditPDtriggerForm.controls['fk_product_id'].setValue(res['records'].default_product); + this._EditPDtriggerForm.controls['fk_subproduct_id'].setValue(res['records'].default_sub_product); + this._EditPDtriggerForm.controls['fk_customer_segment'].setValue(res['records'].default_customer_segment); + this._EditPDtriggerForm.controls['fk_pd_type'].setValue(res['records'].default_pd_type); + } + } else{ @@ -202,8 +210,8 @@ if(!option){ if(this.lenderShortName == "IIB"){ //FOR INDUSLAND BANK // console.log("entered"); - this._EditPDtriggerForm.controls['fk_product_id'].setValue("3") - this._EditPDtriggerForm.controls['fk_pd_type'].setValue("1"); + // this._EditPDtriggerForm.controls['fk_product_id'].setValue("3") + // this._EditPDtriggerForm.controls['fk_pd_type'].setValue("1"); this.getSubproductList("3",2) } // console.log("len",lender) @@ -385,20 +393,20 @@ if(!option){ if (productID !== undefined && productID !== null && productID !== '') { - this.productShortName = this.productAllList.filter(item => item.product_id == productID)[0].product_abbr; + this.prod_catagory = this.productAllList.filter(item => item.product_id == productID)[0].prod_catagory; this.subProductList=this.productAllList.filter(item => item.product_id == productID); this.subProductList=this.subProductList[0].subproducts; console.log("dd sub",this.subProductList) } else { - this.productShortName = ''; + this.prod_catagory = ''; this.subProductList=[]; } - // console.log('this.productAbbr',this.productShortName); - switch (this.productShortName) { + // console.log('this.productAbbr',this.prod_catagory); + switch (this.prod_catagory) { case 'BL': // console.log(1); - this.customerSegmentList = this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self')); + this.customerSegmentList = this.customerSegmentAllList; if(this.lenderShortName == 'CLIX' && flag==2 ){ this._EditPDtriggerForm.controls['fk_customer_segment'].setValue('5'); } // this._EditPDtriggerForm.controls['fk_subproduct_id'].setValue(this.subProductList[0].subproduct_id); this.subProductList=[]; @@ -406,7 +414,7 @@ if(!option){ break; case 'LAEP': // console.log(2); - this.customerSegmentList = this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self')); + this.customerSegmentList = this.customerSegmentAllList; // this._EditPDtriggerForm.controls['fk_subproduct_id'].setValue(this.subProductList[0].subproduct_id); if(this.lenderShortName == 'CLIX' && flag==2 ){ this._EditPDtriggerForm.controls['fk_customer_segment'].setValue('5'); } this.subProductList=[];