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 3f32855f9..28e4b660b 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 @@ -102,6 +102,11 @@ export class AddPdComponent implements OnInit, OnDestroy { console.log(selectLender); this.selectedLender(selectLender) + this._PDtriggerForm.controls['fk_product_id'].setValue(res['records'].default_product); + this._PDtriggerForm.controls['fk_customer_segment'].setValue(res['records'].default_customer_segment); + this._PDtriggerForm.controls['fk_pd_type'].setValue(res['records'].default_pd_type); + this.getSubproductList(res['records'].default_product) + } else{ this.notifier.notify("success","Something went wrong Reopen the window and Try again"); @@ -185,12 +190,20 @@ 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") + // } + // else if(this.lenderShortName == 'HHFL'){ + // this.getSubproductList("1") + // this._PDtriggerForm.controls['fk_product_id'].setValue('1'); + // this._PDtriggerForm.controls['fk_subproduct_id'].setValue('1'); + // this._PDtriggerForm.controls['fk_customer_segment'].setValue('5'); + // this._PDtriggerForm.controls['fk_pd_type'].setValue('1'); + // this._PDtriggerForm.controls['loan_amount'].setValue(0); + // } // console.log("len",lender) } @@ -252,8 +265,9 @@ export class AddPdComponent implements OnInit, OnDestroy { // console.log(productID) let productabbr : any; // console.log('productID',productID); - if(productID !== undefined && productID !== null && productID !== '') { + if(productID !== undefined && productID !== null && productID !== '' && this.productList.length > 0) { this.subProductList = this.productList.filter(item => item.product_id == productID); + console.log('sub products',this.subProductList,this.productList,productID) this.subProductList = this.subProductList[0].subproducts; this.subProductList = this.subProductList.filter(item => item.is_others == 0); productabbr = this.productAllList.filter(item => item.product_id == productID)[0].product_abbr; @@ -289,11 +303,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); + // } } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts index 5f03f3f23..714ea98d7 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts @@ -73,6 +73,7 @@ export class AddressComponent implements OnInit { pincodeDataList: any = []; product_abbr: any; split_customer_abbr: any; + prod_catagory: any; /**Constructor of the class */ constructor(private el: ElementRef, notifier: NotifierService, @@ -95,7 +96,8 @@ export class AddressComponent implements OnInit { this.lender_short_name=this.pd_all_details.pdmaster_details.lender_short_name this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr; this.product_abbr = this.pd_all_details.pdmaster_details.product_abbr; - console.log(this.product_abbr); + this.prod_catagory = this.pd_all_details.pdmaster_details.prod_catagory; + console.log('prod catagory',this.prod_catagory); this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr; this.split_customer_abbr = this.customer_segment_abbr.split('-') if(this.split_customer_abbr.length > 0){ @@ -194,7 +196,7 @@ export class AddressComponent implements OnInit { } } - if(this.lender_short_name != 'CLIX' && this.product_abbr != 'BL') { + if(this.lender_short_name != 'CLIX' && this.prod_catagory != 'BL') { this.addressForm.controls.estimated_area.setValue(datas.estimated_area ? datas.estimated_area : '') this.addressForm.controls.uom.setValue(datas.uom); @@ -237,7 +239,7 @@ export class AddressComponent implements OnInit { // was_the_company_name_board_sighted:['', Validators.compose([Validators.required])], address_form_remark: [''] }); - if(this.lender_short_name == 'CLIX' || this.product_abbr == 'BL'){ + if(this.lender_short_name == 'CLIX' || this.prod_catagory == 'BL'){ this.addressForm.removeControl('estimated_area'); this.addressForm.removeControl('uom'); } @@ -552,7 +554,7 @@ export class AddressComponent implements OnInit { records.addresses[0].locality_mixuse = this.addressForm.controls.locality_mixuse.value; records.addresses[0].pd_location = this.addressForm.controls.pd_location.value; records.addresses[0].comment_locality = this.addressForm.controls.comment_locality.value; - if(this.lender_short_name != 'CLIX' && this.product_abbr != 'BL') { + if(this.lender_short_name != 'CLIX' && this.prod_catagory != 'BL') { records.addresses[0].estimated_area = this.addressForm.controls.estimated_area.value records.addresses[0].uom = this.addressForm.controls.uom.value; if (this.addressForm.controls.uom.value == 1) { @@ -577,7 +579,7 @@ export class AddressComponent implements OnInit { records.alternative_addresses[0].locality_mixuse = this.addressForm.controls.locality_mixuse.value; records.alternative_addresses[0].pd_location = this.addressForm.controls.pd_location.value; records.alternative_addresses[0].comment_locality = this.addressForm.controls.comment_locality.value; - if(this.lender_short_name != 'CLIX' && this.product_abbr != 'BL') { + if(this.lender_short_name != 'CLIX' && this.prod_catagory != 'BL') { records.alternative_addresses[0].estimated_area = this.addressForm.controls.estimated_area.value records.alternative_addresses[0].uom = this.addressForm.controls.uom.value; if (this.addressForm.controls.uom.value == 1) { @@ -758,7 +760,7 @@ export class AddressComponent implements OnInit { this.addressForm.controls.locality_others.setValue(datas.locality_others); } - if(this.lender_short_name != 'CLIX' && this.product_abbr != 'BL'){ + if(this.lender_short_name != 'CLIX' && this.prod_catagory != 'BL'){ this.addressForm.controls.estimated_area.setValue(datas.estimated_area ? datas.estimated_area : '') this.addressForm.controls.uom.setValue(datas.uom) this.setOthers(datas.uom, '', 5); @@ -831,7 +833,7 @@ export class AddressComponent implements OnInit { this.addressForm.controls.locality_others.setValue(datas.locality_others); } - if(this.lender_short_name != 'CLIX' && this.product_abbr != 'BL'){ + if(this.lender_short_name != 'CLIX' && this.prod_catagory != 'BL'){ this.addressForm.controls.estimated_area.setValue(datas.estimated_area); this.addressForm.controls.uom.setValue(datas.uom); this.setOthers(datas.uom, '', 5); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html index 84e35ccce..755f79edc 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html @@ -80,7 +80,7 @@ -
+
@@ -358,7 +358,7 @@ -->
- + Age of Asset in Years -
+
Asset Owned by Required - -
+ +
Age of Asset in Years - +
@@ -417,7 +417,7 @@ *ngIf="sup.controls['business_name_of_the_other_owner'].hasError('required')">Asset Owned by is Required -
+
Age of Asset in Years + *ngIf="(sup.get('business_assets_mode').value != '') && sup.get('business_ownership_type').value == 'owned' && (lender_short_name != 'CLIX' && lender_short_name != 'MWISE' || prod_catagory === 'LFMP')">
appt.applicant_type != 2) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.ts index d38e040bb..fbcf39528 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.ts @@ -33,6 +33,7 @@ export class BusinessInfoGroupComponent implements OnInit { waitLoading:boolean; lender_short_name :any; product_abbr :any; + prod_catagory: any; constructor(notifier: NotifierService, private route: ActivatedRoute, @@ -43,13 +44,14 @@ export class BusinessInfoGroupComponent implements OnInit { this.form_id = 13; // this.waitLoading=false; this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant; - this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id; - this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr; - this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr; - this.lender_short_name = this.pd_all_details.pdmaster_details.lender_short_name; - console.log(this.lender_short_name); - this.product_abbr = this.pd_all_details.pdmaster_details.product_abbr; - console.log(this.product_abbr); + this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id; + this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr; + this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr; + this.lender_short_name = this.pd_all_details.pdmaster_details.lender_short_name; + console.log(this.lender_short_name); + this.product_abbr = this.pd_all_details.pdmaster_details.product_abbr; + console.log(this.product_abbr); + this.prod_catagory = this.pd_all_details.pdmaster_details.prod_catagory; } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html index 02b9af431..cd17ba64a 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html @@ -1810,7 +1810,7 @@
-
+
Yes diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts index f06081857..de775335d 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts @@ -103,6 +103,7 @@ export class BusinessInfoComponent implements OnInit { temp_additiondetailofposmachine: any = []; image_doc_params: { pdid: number; form_id: number; company_id: String; }; @ViewChild('business_activity_type') business_activity_type_scroll : ElementRef + prod_catagory: any; constructor(notifier: NotifierService, @@ -133,6 +134,7 @@ export class BusinessInfoComponent implements OnInit { console.log(this.lender_short_name); this.product_abbr = this.pd_all_details.pdmaster_details.product_abbr; console.log(this.product_abbr); + this.prod_catagory = this.pd_all_details.pdmaster_details.prod_catagory; console.log("com",this.company_id) this.image_doc_params={pdid:this.pdid,form_id:this.form_id,company_id:this.company_id} this.getActivity(); @@ -396,15 +398,15 @@ export class BusinessInfoComponent implements OnInit { }); if (selectedRetail.length > 0) { selectedRetail.length > 0 ? this.businessForm.addControl('export_import_cert', new FormControl('', Validators.required)) : this.businessForm.removeControl('export_import_cert'); - if( !(this.lender_short_name == 'CLIX' && this.product_abbr == 'BL') && !(this.lender_short_name == 'MWISE' && this.product_abbr == 'BL')){ - console.log('###PAY');console.log(this.lender_short_name,this.product_abbr) + if( !(this.lender_short_name == 'CLIX' && this.prod_catagory == 'BL') && !(this.lender_short_name == 'MWISE' && this.prod_catagory == 'BL')){ + console.log('###PAY');console.log(this.lender_short_name,this.prod_catagory) selectedRetail.length > 0 ? this.businessForm.addControl('applicant_use_mobile_wallets', new FormControl('')) : this.businessForm.removeControl('applicant_use_mobile_wallets'); selectedRetail.length > 0 ? this.businessForm.addControl('applicant_use_pos_machines', new FormControl('')) : this.businessForm.removeControl('applicant_use_pos_machines'); selectedRetail.length > 0 && businessVal.applicant_use_pos_machines == 'yes' ? this.businessForm.addControl('no_of_pos_machines', new FormControl('')) : this.businessForm.removeControl('no_of_pos_machines'); selectedRetail.length > 0 && businessVal.applicant_use_pos_machines == 'yes' ? this.businessForm.addControl('pos_machines_details', this.fb.array([])) : this.businessForm.removeControl('pos_machines_details'); } else{ - console.log('###ELSE');console.log(this.lender_short_name,this.product_abbr) + console.log('###ELSE');console.log(this.lender_short_name,this.prod_catagory) } selectedRetail.forEach((element, index) => { @@ -467,7 +469,7 @@ export class BusinessInfoComponent implements OnInit { }); if (selectedWholesale.length > 0) { selectedWholesale.length > 0 ? this.businessForm.addControl('export_import_cert', new FormControl('', Validators.required)) : this.businessForm.removeControl('export_import_cert'); - if(!(this.lender_short_name == 'CLIX' && this.product_abbr == 'BL') && !(this.lender_short_name == 'MWISE' && this.product_abbr == 'BL')){ + if(!(this.lender_short_name == 'CLIX' && this.prod_catagory == 'BL') && !(this.lender_short_name == 'MWISE' && this.prod_catagory == 'BL')){ selectedWholesale.length > 0 ? this.businessForm.addControl('applicant_use_mobile_wallets', new FormControl('')) : this.businessForm.removeControl('applicant_use_mobile_wallets'); selectedWholesale.length > 0 ? this.businessForm.addControl('applicant_use_pos_machines', new FormControl('')) : this.businessForm.removeControl('applicant_use_pos_machines'); selectedWholesale.length > 0 && businessVal.applicant_use_pos_machines == 'yes' ? this.businessForm.addControl('no_of_pos_machines', new FormControl('')) : this.businessForm.removeControl('no_of_pos_machines'); @@ -536,7 +538,7 @@ export class BusinessInfoComponent implements OnInit { }); if (selectedService.length > 0) { selectedService.length > 0 ? this.businessForm.addControl('practice_cert', new FormControl('', Validators.required)) : this.businessForm.removeControl('practice_cert'); - if(!(this.lender_short_name == 'CLIX' && this.product_abbr == 'BL') && !(this.lender_short_name == 'MWISE' && this.product_abbr == 'BL')){ + if(!(this.lender_short_name == 'CLIX' && this.prod_catagory == 'BL') && !(this.lender_short_name == 'MWISE' && this.prod_catagory == 'BL')){ selectedService.length > 0 ? this.businessForm.addControl('applicant_use_mobile_wallets', new FormControl('')) : this.businessForm.removeControl('applicant_use_mobile_wallets'); selectedService.length > 0 ? this.businessForm.addControl('applicant_use_pos_machines', new FormControl('')) : this.businessForm.removeControl('applicant_use_pos_machines'); selectedService.length > 0 && businessVal.applicant_use_pos_machines == 'yes' ? this.businessForm.addControl('no_of_pos_machines', new FormControl('')) : this.businessForm.removeControl('no_of_pos_machines'); @@ -627,7 +629,7 @@ export class BusinessInfoComponent implements OnInit { } } // this.businessForm.setValue(businessVal); - // this.lender_short_name == 'CLIX' || this.product_abbr == 'LAEP' ? this.businessForm.addControl('fire_noc', new FormControl('', Validators.required)) : this.businessForm.removeControl('fire_noc'); + // this.lender_short_name == 'CLIX' || this.prod_catagory == 'LAEP' ? this.businessForm.addControl('fire_noc', new FormControl('', Validators.required)) : this.businessForm.removeControl('fire_noc'); if(data.records.gst_Regn_cert =='yes'){ this.businessForm.addControl('gst_Regn_cert_pic', new FormControl('')); }else{ this.businessForm.removeControl('gst_Regn_cert_pic');} if(data.records.factory_cert =='yes'){ this.businessForm.addControl('factory_cert_pic', new FormControl('')); }else{ this.businessForm.removeControl('factory_cert_pic');} if(data.records.practice_cert =='yes'){ this.businessForm.addControl('practice_cert_pic', new FormControl('')); }else{ this.businessForm.removeControl('practice_cert_pic');} @@ -661,7 +663,7 @@ export class BusinessInfoComponent implements OnInit { // load exist company list from master // this.existCompanyList = this.pd_all_details.pdapplicants_detials.filter(item=>item.company_name!=null).map(mapItem=>mapItem.company_name); - this.product_abbr == 'LAEP' ? this.businessForm.addControl('fire_noc', new FormControl('', Validators.required)) : this.businessForm.removeControl('fire_noc'); + this.prod_catagory == 'LAEP' ? this.businessForm.addControl('fire_noc', new FormControl('', Validators.required)) : this.businessForm.removeControl('fire_noc'); if(this.lender_short_name != 'CLIX'){ // change relation with businees update dat sorce table @@ -806,11 +808,11 @@ export class BusinessInfoComponent implements OnInit { this.businessForm.value.service_provider_activity_details.length > 0 ? this.businessForm.addControl('practice_cert', new FormControl(this.businessForm.value.practice_cert, Validators.required)) : this.businessForm.removeControl('practice_cert'); // check activity for extra question make dynamic - if(!(this.lender_short_name == 'CLIX' && this.product_abbr == 'BL') && !(this.lender_short_name == 'MWISE' && this.product_abbr == 'BL')){ + if(!(this.lender_short_name == 'CLIX' && this.prod_catagory == 'BL') && !(this.lender_short_name == 'MWISE' && this.prod_catagory == 'BL')){ this.businessForm.value.service_provider_activity_details.length > 0 || this.businessForm.value.retail_trading_activity_details.length > 0 || this.businessForm.value.wholesale_trading_activity_details.length > 0 ? this.businessForm.addControl('applicant_use_mobile_wallets', new FormControl(this.businessForm.value.applicant_use_mobile_wallets)) : this.businessForm.removeControl('applicant_use_mobile_wallets'); this.businessForm.value.service_provider_activity_details.length > 0 || this.businessForm.value.retail_trading_activity_details.length > 0 || this.businessForm.value.wholesale_trading_activity_details.length > 0 ? this.businessForm.addControl('applicant_use_pos_machines', new FormControl(this.businessForm.value.applicant_use_pos_machines)) : this.businessForm.removeControl('applicant_use_pos_machines'); if (this.businessForm.value.service_provider_activity_details.length > 0 || this.businessForm.value.retail_trading_activity_details.length > 0 || this.businessForm.value.wholesale_trading_activity_details.length > 0) { - if(this.businessForm.controls['applicant_use_pos_machines'] && this.product_abbr == 'LAEP'){ + if(this.businessForm.controls['applicant_use_pos_machines'] && this.prod_catagory == 'LAEP'){ this.businessForm.controls['applicant_use_pos_machines'].setValue('yes'); } this.changePOSMachinesAvailablity(this.businessForm.value.applicant_use_pos_machines, 2); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html index ca3ec0070..a3e6d7ede 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html @@ -35,7 +35,7 @@ No - + Select diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts index 2dad8f960..4cf481e3a 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts @@ -46,6 +46,7 @@ export class CurrentLoanComponent implements OnInit { isOtherLoanTakenBy:any = []; image_doc_params: { pdid: number; form_id: number; company_id: string; }; product_abbr: any; + prod_catagory: any; constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, private router: Router, @@ -64,7 +65,8 @@ export class CurrentLoanComponent implements OnInit { this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr; this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr; this.image_doc_params={pdid:this.pdid,form_id:this.form_id,company_id:''} - this.product_abbr=this.pd_all_details.pdmaster_details.product_abbr + this.product_abbr=this.pd_all_details.pdmaster_details.product_abbr; + this.prod_catagory = this.pd_all_details.pdmaster_details.prod_catagory; } pdf(fileURL){ window.open(fileURL); @@ -430,7 +432,7 @@ export class CurrentLoanComponent implements OnInit { public initCurrentloanForm(): void { this.currentLoanForm = this.fb.group({ existing_loan: [''], - loan_info_available:[this.product_abbr == 'BL' || this.product_abbr == 'LAEP' ? '' : 'Yes'], + loan_info_available:[this.prod_catagory == 'BL' || this.prod_catagory == 'LAEP' ? '' : 'Yes'], currentloan_remarks: [''], loan_details: this.fb.array([]), }); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html index 74b487329..352104970 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html @@ -139,7 +139,7 @@
--> -
+
@@ -278,7 +278,7 @@
-
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts index a1056220a..e8902ae60 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts @@ -69,6 +69,7 @@ export class FamilyDetailsComponent implements OnInit { pincodeDataList: any = []; product_abbr: any; addressList: any = []; + prod_catagory: any; /** constructor Of the class */ constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, @@ -84,6 +85,7 @@ export class FamilyDetailsComponent implements OnInit { this.parent_pdid = this.pd_all_details.pdmaster_details.parent_pd_id; this.lender_short_name=this.pd_all_details.pdmaster_details.lender_short_name; this.product_abbr = this.pd_all_details.pdmaster_details.product_abbr; + this.prod_catagory = this.pd_all_details.pdmaster_details.prod_catagory; this.pdid = this.pd_all_details.pdmaster_details.pd_id; this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant; this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id; diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.html index f42d6df83..337dd5a9f 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.html @@ -156,11 +156,11 @@ Specify the Mode of Transport Used to Visit the PD address Required - + CLIX MWISE - + Select diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.ts index 4d6351459..d49cc2676 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.ts @@ -56,6 +56,7 @@ export class FinalRemarksComponent implements OnInit { public documentsAndFilesList = []; private notifier: NotifierService; image_doc_params: { pdid: string; form_id: number; company_id: string; }; + prod_catagory: any; constructor( notifier: NotifierService, @@ -75,6 +76,7 @@ export class FinalRemarksComponent implements OnInit { this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr; this.lender_short_name = this.pd_all_details.pdmaster_details.lender_short_name; this.product_abbr = this.pd_all_details.pdmaster_details.product_abbr; + this.prod_catagory = this.pd_all_details.pdmaster_details.prod_catagory; this._finalRemarkForm = this._formBuilder.group({ parent_pdid: [this.parent_pdid], @@ -104,8 +106,8 @@ export class FinalRemarksComponent implements OnInit { final_form_remarks: [''] }); - if(this.lender_short_name == 'CLIX' || this.lender_short_name == 'MWISE' || this.product_abbr == 'LAEP'){ - this.product_abbr == 'LAEP' ? this._finalRemarkForm.addControl('outlet_location', new FormControl('', Validators.required)) : this._finalRemarkForm.removeControl('outlet_location'); + if(this.lender_short_name == 'CLIX' || this.lender_short_name == 'MWISE' || this.prod_catagory == 'LAEP'){ + this.prod_catagory == 'LAEP' ? this._finalRemarkForm.addControl('outlet_location', new FormControl('', Validators.required)) : this._finalRemarkForm.removeControl('outlet_location'); this._finalRemarkForm.addControl('is_competition', new FormControl('')); this._finalRemarkForm.addControl('sealing_activity', new FormControl('')); this._finalRemarkForm.addControl('demolition_activity', new FormControl('')); @@ -116,7 +118,7 @@ export class FinalRemarksComponent implements OnInit { this._finalRemarkForm.removeControl('sealing_activity'); this._finalRemarkForm.removeControl('demolition_activity'); } - // if(this.product_abbr != 'LAEP'){ + // if(this.prod_catagory != 'LAEP'){ // this._finalRemarkForm.controls['final_form_remarks'].setValidators(Validators.compose([Validators.required])) // } // else{ @@ -244,9 +246,9 @@ export class FinalRemarksComponent implements OnInit { this._finalRemarkForm.controls.market_intelligence.setValue(data.records.market_intelligence || ''); - if(this.lender_short_name == 'CLIX' || this.lender_short_name == 'MWISE' || this.product_abbr == 'LAEP'){ + if(this.lender_short_name == 'CLIX' || this.lender_short_name == 'MWISE' || this.prod_catagory == 'LAEP'){ - if(this.product_abbr == 'LAEP') {this._finalRemarkForm.controls.outlet_location.setValue(this.product_abbr == 'LAEP' ? data.records.outlet_location : ''); } + if(this.prod_catagory == 'LAEP') {this._finalRemarkForm.controls.outlet_location.setValue(this.prod_catagory == 'LAEP' ? data.records.outlet_location : ''); } this._finalRemarkForm.controls.is_competition.setValue(data.records.is_competition); this._finalRemarkForm.controls.sealing_activity.setValue(data.records.sealing_activity); this._finalRemarkForm.controls.demolition_activity.setValue(data.records.demolition_activity); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html index c5132d759..b452c903f 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html @@ -477,7 +477,7 @@ formControlName="estimate_reason_for_loss">
- + {{"₹"}} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts index 9c1cd75e0..f1c0c8d00 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts @@ -84,6 +84,7 @@ export class FinancialInfoComponent implements OnInit { // values = [0, 1, 2, 3]; documentsAndFilesList: any = []; image_doc_params: { pdid: string; form_id: number; company_id: string; }; + prod_catagory: any; constructor(notifier: NotifierService, private fb: FormBuilder, @@ -103,6 +104,7 @@ export class FinancialInfoComponent implements OnInit { this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id; this.lender_short_name = this.pd_all_details.pdmaster_details.lender_short_name; this.product_abbr = this.pd_all_details.pdmaster_details.product_abbr; + this.prod_catagory = this.pd_all_details.pdmaster_details.prod_catagory; this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr; this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr; let x = this.customer_segment_abbr.split("-"); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/future-plans-and-business-environment/future-plans-and-business-environment.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/future-plans-and-business-environment/future-plans-and-business-environment.component.ts index a8512f860..c829dd325 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/future-plans-and-business-environment/future-plans-and-business-environment.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/future-plans-and-business-environment/future-plans-and-business-environment.component.ts @@ -54,6 +54,7 @@ export class FuturePlansAndBusinessEnvironmentComponent implements OnInit { public documentsAndFilesList = []; private notifier: NotifierService; image_doc_params: { pdid: string; form_id: number; company_id: any; }; + prod_catagory: any; constructor( notifier: NotifierService, @@ -75,6 +76,7 @@ export class FuturePlansAndBusinessEnvironmentComponent implements OnInit { this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr; this.lender_short_name = this.pd_all_details.pdmaster_details.lender_short_name; this.product_abbr = this.pd_all_details.pdmaster_details.product_abbr; + this.prod_catagory = this.pd_all_details.pdmaster_details.prod_catagory; this._futurePlansForm = this._formBuilder.group({ parent_pdid: [this.parent_pdid], @@ -89,7 +91,7 @@ export class FuturePlansAndBusinessEnvironmentComponent implements OnInit { remarks: [''] }); - if(this.lender_short_name == 'CLIX' || this.product_abbr == 'LAEP'){ } + if(this.lender_short_name == 'CLIX' || this.prod_catagory == 'LAEP'){ } else{ } this.image_doc_params={pdid:this.pdid,form_id:this.form_id,company_id:this.company_id} } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html index 703ef49ff..f41f6e3d1 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html @@ -58,7 +58,7 @@ End Use Required - + Select @@ -76,7 +76,7 @@ -
+
@@ -119,7 +119,7 @@ - + Select @@ -166,7 +166,7 @@ - + {{"₹"}} {{ loanDetailsForm.controls['emi_level'].value | numberToWords }} Only @@ -175,7 +175,7 @@ - +

Details of Property being Mortgaged

@@ -246,7 +246,7 @@ {{"₹"}} {{ loanDetailsForm.controls['emv_per_customer'].value | numberToWords }} Only
- + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts index 6d3d8f6f7..3ba4e70a7 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts @@ -94,6 +94,7 @@ export class LoanDetailsComponent implements OnInit { address_placeholder: string; image_doc_params: { pdid: number; form_id: number; company_id: string; }; addressList: any = []; + prod_catagory: any; @@ -112,6 +113,7 @@ export class LoanDetailsComponent implements OnInit { this.applicants = this.applicants.filter(appt => appt.applicant_type != 2) // this.companies = this.pd_all_details.pdapplicants_detials.filter(appt=>appt.applicant_type == 2 ) this.productAbbr = this.pd_all_details.pdmaster_details.product_abbr; + this.prod_catagory = this.pd_all_details.pdmaster_details.prod_catagory; this.productID = this.pd_all_details.pdmaster_details.fk_product_id; this.subProductName = this.pd_all_details.pdmaster_details.subproduct_name; this.exist_loan_amt = this.pd_all_details.pdmaster_details.loan_amount != '' ? this.pd_all_details.pdmaster_details.loan_amount : ''; @@ -126,10 +128,10 @@ export class LoanDetailsComponent implements OnInit { this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr; this.lenderShortName = this.pd_all_details.pdmaster_details.lender_short_name; - if (this.productAbbr == 'PL' || this.productAbbr == 'BL' || this.productAbbr == 'LAP' || this.productAbbr == 'LFMP') { + if (this.prod_catagory == 'PL' || this.prod_catagory == 'BL' || this.prod_catagory == 'LAP' || this.prod_catagory == 'LFMP') { this.isContribution = true; } - if(this.productAbbr == 'HL' || this.productAbbr == 'NRPL' || this.productAbbr == 'LL'){ + if(this.prod_catagory == 'HL' || this.prod_catagory == 'NRPL' || this.prod_catagory == 'LL'){ this.Owner_placeholder="Name of the proposed owner" this.address_placeholder="Address of the proposed property" } @@ -183,7 +185,7 @@ export class LoanDetailsComponent implements OnInit { // this.listOfLanguagues.splice(this.listOfLanguagues.indexOf(languague), 1); } - if (this.productAbbr != 'LAP') { + if (this.prod_catagory != 'LAP') { this.mergeCompanyApplicant.push({ groupName: 'OTHERS', groupValues: [{ id: 0, name: 'Not Yet Finalised', group_id: 2 }] }) } @@ -198,7 +200,7 @@ export class LoanDetailsComponent implements OnInit { params.pd_id = this.pdid; params.pd_form_id = this.form_id; this._pd.retriveForm(params).subscribe(value => { - // *ngIf="productAbbr === 'HL' || productAbbr === 'LL' || productAbbr === 'LAP' " + // *ngIf="prod_catagory === 'HL' || prod_catagory === 'LL' || prod_catagory === 'LAP' " if (value.status == 200) { let result = Object.keys(value.records.end_use_group).map(function (key) { return value.records.end_use_group[key]; @@ -319,10 +321,10 @@ export class LoanDetailsComponent implements OnInit { this.loanDetailsForm.controls['emv_per_customer'].setValue(value.records.emv_per_customer); // this.emvAmtInWords = this._pd.convertNumberToWords(value.records.emv_per_customer); } - console.log("product abbr",this.productAbbr); + console.log("product abbr",this.prod_catagory); console.log("value",value) - this.loanDetailsForm.controls['property_seller'].setValue(this.productAbbr != 'LAP' ? value.records.property_seller || null : ''); + this.loanDetailsForm.controls['property_seller'].setValue(this.prod_catagory != 'LAP' ? value.records.property_seller || null : ''); this.loanDetailsForm.controls['address'].setValue(value.records.address || null); this.loanDetailsForm.controls['state'].setValue(value.records.state || null ); if(value.records.state != ''){this.getCityAndPincodeDetails(value.records.state);} @@ -346,7 +348,7 @@ export class LoanDetailsComponent implements OnInit { } }) - if (this.productAbbr == 'BL' || this.productAbbr == 'PL' || this.productAbbr == 'LAEP') { + if (this.prod_catagory == 'BL' || this.prod_catagory == 'PL' || this.prod_catagory == 'LAEP') { this.mortageCardAccess = false; this.loanDetailsForm.controls['owner_name'].setValue(''); this.loanDetailsForm.controls['owner_name'].clearValidators(); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html index f2d0bdc25..f48d11150 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html @@ -46,7 +46,7 @@ Stock Required -
+
@@ -141,7 +141,7 @@ -
+
-
+
-
+
-
+
data.records.template_forms[item]).filter(item=>item.isAnswerable===true); this.lender_short_name = data.records.pdmaster_details.lender_short_name; this.product_abbr = data.records.pdmaster_details.product_abbr; + this.prod_catagory = data.records.pdmaster_details.prod_catagory; // this.categoryFormButtons = this.categoryFormButtons.filter(item=>item.isAnswerable===true); this.actualQuestions = this.categoryFormButtons.length; let getAnsweredFormsCount = this.categoryFormButtons.filter(item=>item.isAnswered===true); @@ -445,21 +447,22 @@ export class QcStartComponent implements OnInit, OnDestroy { .subscribe(dataresult => { this.loadTemplates(this.startPD,2,this.randomString); }); - }else - if((this.lender_short_name == 'CLIX' || this.product_abbr == 'LAEP') && this.selectedFormsCategory.form_id==23){ - const dialogRef = this.dialog.open(FuturePlansAndBusinessEnvironmentComponent, { - data: this.pdFullDetails, - maxWidth: '100vw', - maxHeight: '100vh', - height: '100%', - width: '100%', - disableClose: true - }); - dialogRef.afterClosed() - .subscribe(dataresult => { - this.loadTemplates(this.startPD,2,this.randomString); - }); } + // else + // if((this.lender_short_name == 'CLIX' || this.product_abbr == 'LAEP') && this.selectedFormsCategory.form_id==23){ + // const dialogRef = this.dialog.open(FuturePlansAndBusinessEnvironmentComponent, { + // data: this.pdFullDetails, + // maxWidth: '100vw', + // maxHeight: '100vh', + // height: '100%', + // width: '100%', + // disableClose: true + // }); + // dialogRef.afterClosed() + // .subscribe(dataresult => { + // this.loadTemplates(this.startPD,2,this.randomString); + // }); + // } else if(this.selectedFormsCategory.form_id==24){ const dialogRef = this.dialog.open(QueriesDocsComponent, { diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-other-preference/entity-other-preference.component.html b/ng6-seed/src/app/settings/entity/entity-edit/entity-other-preference/entity-other-preference.component.html index f7cfadd1b..eee013730 100644 --- a/ng6-seed/src/app/settings/entity/entity-edit/entity-other-preference/entity-other-preference.component.html +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-other-preference/entity-other-preference.component.html @@ -1,26 +1,45 @@
- + Products - Select All - {{option.product_name}} + Select All Default + + {{option.product_name}} + + + + + + + + Customer Segments Select All - {{option.customer_segment}} + + {{option.customer_segment}} + + + + - + PD Types Select All - {{option.type_name}} + + {{option.type_name}} + + + + diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-other-preference/entity-other-preference.component.ts b/ng6-seed/src/app/settings/entity/entity-edit/entity-other-preference/entity-other-preference.component.ts index d283c03f1..8f0de0ade 100644 --- a/ng6-seed/src/app/settings/entity/entity-edit/entity-other-preference/entity-other-preference.component.ts +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-other-preference/entity-other-preference.component.ts @@ -1,8 +1,9 @@ import { Component, OnInit, Input } from '@angular/core'; -import { FormGroup, FormBuilder } from '@angular/forms'; +import { FormGroup, FormBuilder, FormArray, FormControl } from '@angular/forms'; import { EntityService } from 'app/settings/service/entity/entity.service'; import { NotifierService } from 'angular-notifier'; import { AwsService } from 'app/AwsService/aws.service'; +import { MatSlideToggleChange } from '@angular/material'; @Component({ selector: 'app-entity-other-preference', @@ -21,24 +22,56 @@ export class EntityOtherPreferenceComponent implements OnInit { constructor(private entityService:EntityService,private _fb:FormBuilder,notifier:NotifierService,private awsService:AwsService) { this.notifier=notifier this.users=this.awsService.getlocale() + this.getDropdownValues() } ngOnInit() { - this.getDropdownValues() + this._otherPreferenceForm=this._fb.group({ products:[''], customer_segments:[''], pd_types:[''], fk_entity_id:[this.entityId], fk_createdby:[this.users], - fk_updatedby:[this.users] + fk_updatedby:[this.users], + products_default:this._fb.array([]), + customer_segments_default:this._fb.array([]), + pd_types_default:this._fb.array([]) }) + setTimeout(() => { this.getvalueFromApi() + }); + } getvalueFromApi(){ this.entityService.getEntityOtherPreferences(this.entityId).subscribe(res=>{ if(res['dataStatus']){ - this._otherPreferenceForm.patchValue(res['records']) + this.productList.forEach((element,index) => { + if(element.product_id == res['records'].products_default){ + let event={checked:true} + this.default_toggle(event,element.product_id,index,1) + } + }); + this.customerSegmentList.forEach((element,index) => { + if(element.customer_segment_id == res['records'].customer_segments_default){ + let event={checked:true} + this.default_toggle(event,element.customer_segment_id,index,2) + } + }); + this.pdTypeList.forEach((element,index) => { + if(element.pd_type_id == res['records'].pd_types_default){ + let event={checked:true} + this.default_toggle(event,element.pd_type_id,index,3) + } + }); + delete res['records'].products_default + delete res['records'].customer_segments_default + delete res['records'].pd_types_default + console.log(this._otherPreferenceForm.value); + setTimeout(() => { + this._otherPreferenceForm.patchValue(res['records']) + }); + } }) } @@ -46,16 +79,22 @@ export class EntityOtherPreferenceComponent implements OnInit { this.entityService.getListOfProducts().subscribe(res=>{ if(res['dataStatus']){ this.productList=res['records'] + this.initslidetoggle(1) + console.log(this._otherPreferenceForm.value); } }) this.entityService.getListOfCustomerSegments().subscribe(res=>{ if(res['dataStatus']){ this.customerSegmentList=res['records'] + this.initslidetoggle(2) + console.log(this._otherPreferenceForm.value); } }) this.entityService.getListOfPDAllocationTypes().subscribe(res=>{ if(res['dataStatus']){ this.pdTypeList=res['records'].pd_type + this.initslidetoggle(3) + console.log(this._otherPreferenceForm.value); } }) @@ -77,6 +116,8 @@ export class EntityOtherPreferenceComponent implements OnInit { } } else{ + let array_name = option+'_default' + this.changeToogletoFalse(array_name) this._otherPreferenceForm.controls[option].patchValue('') this.selectedAll[option]=false } @@ -87,6 +128,25 @@ export class EntityOtherPreferenceComponent implements OnInit { console.log(this._otherPreferenceForm.value) let records=this._otherPreferenceForm.value records.fk_updatedby=this.users + records.products_default = records.products_default.filter(prod_filter =>prod_filter != false) + if(records.products_default.length > 0){ + records.products_default=records.products_default[0] + }else{ + records.products_default= null + } + records.customer_segments_default = records.customer_segments_default.filter(prod_filter =>prod_filter != false) + if(records.customer_segments_default.length > 0){ + records.customer_segments_default=records.customer_segments_default[0] + }else{ + records.customer_segments_default= null + } + records.pd_types_default = records.pd_types_default.filter(prod_filter =>prod_filter != false) + if(records.pd_types_default.length > 0){ + records.pd_types_default=records.pd_types_default[0] + }else{ + records.pd_types_default= null + } + console.log('records',records); this.entityService.saveEntityOtherPreferences(records).subscribe(res=>{ if(res['dataStatus']){ this.notifier.notify("success","Saved Successfully..!"); @@ -97,5 +157,65 @@ export class EntityOtherPreferenceComponent implements OnInit { }) } + default_toggle(event,prod_id,index,flag){ + console.log(event.checked,prod_id,this._otherPreferenceForm.value.products_default,index) + if(flag == 1){ + if(event.checked){ + this.changeToogletoFalse('products_default') + const control=this._otherPreferenceForm.controls['products_default']['controls'][index] + control.setValue(prod_id) + console.log("set true",this._otherPreferenceForm.value.products_default) + } + } + if(flag == 2){ + if(event.checked){ + this.changeToogletoFalse('customer_segments_default') + const control=this._otherPreferenceForm.controls['customer_segments_default']['controls'][index] + control.setValue(prod_id) + console.log("set true",this._otherPreferenceForm.value.customer_segments_default) + } + } + if(flag == 3){ + if(event.checked){ + this.changeToogletoFalse('pd_types_default') + const control=this._otherPreferenceForm.controls['pd_types_default']['controls'][index] + control.setValue(prod_id) + console.log("set true",this._otherPreferenceForm.value.pd_types_default) + } + } + + } + changeToogletoFalse(array_name){ + const control=this._otherPreferenceForm.controls[array_name]['controls'] + console.log(control) + control.forEach((val,index)=>{ + control[index].setValue(false) + }) + console.log("set False",this._otherPreferenceForm.value[array_name]) + } + initslidetoggle(flag){ + if(flag == 1){ + const formArray = this._otherPreferenceForm.get('products_default') as FormArray; + this.productList.forEach(x => formArray.push(new FormControl(false))); + } + if(flag == 2){ + const formArray = this._otherPreferenceForm.get('customer_segments_default') as FormArray; + this.customerSegmentList.forEach(x => formArray.push(new FormControl(false))); + } + if(flag == 3){ + const formArray = this._otherPreferenceForm.get('pd_types_default') as FormArray; + this.pdTypeList.forEach(x => formArray.push(new FormControl(false))); + } + + } + checkDisableToggle(select_value, curr_id){ + // console.log("bvvvv",select_value,select_value.length > 0) + if(select_value.length > 0){ + return select_value.filter(val=>val == curr_id).length == 0 + } + else{ + return true + } + } }