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 1267f20f7..8cc24cb86 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 @@ -38,7 +38,7 @@ -
+ Select @@ -51,10 +51,10 @@ {{person.user_name}} - + - -
+
+ 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 41e1ba1d2..346e4328d 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 @@ -88,7 +88,7 @@ export class AddPdComponent implements OnInit, OnDestroy { lender_sales_person:[null], lender_credit_person:[null], imgc_fin_institute:[null], - lender_contact_person: [null, Validators.compose([Validators.required])], + lender_contact_person: [null], lender_contact_mobile: [null, Validators.compose([Validators.minLength(10), Validators.maxLength(12), Validators.pattern('^[0-9]*$')])], lender_stdcode: [null, Validators.compose([Validators.minLength(3), Validators.maxLength(5), Validators.pattern('^[0-9]*$')])], lender_landline: [null, Validators.compose([Validators.minLength(6), Validators.maxLength(8), Validators.pattern('^[0-9]*$')])], @@ -453,10 +453,10 @@ export class AddPdComponent implements OnInit, OnDestroy { this._PDtriggerForm.controls['fk_lender_id'].updateValueAndValidity(); if(this.sales_and_credit_enable){ - this._PDtriggerForm.controls['lender_sales_person'].setValidators(Validators.compose([Validators.required])) - this._PDtriggerForm.controls['lender_sales_person'].updateValueAndValidity(); - this._PDtriggerForm.controls['lender_credit_person'].setValidators(Validators.compose([Validators.required])) - this._PDtriggerForm.controls['lender_credit_person'].updateValueAndValidity(); + // this._PDtriggerForm.controls['lender_sales_person'].setValidators(Validators.compose([Validators.required])) + // this._PDtriggerForm.controls['lender_sales_person'].updateValueAndValidity(); + // this._PDtriggerForm.controls['lender_credit_person'].setValidators(Validators.compose([Validators.required])) + // this._PDtriggerForm.controls['lender_credit_person'].updateValueAndValidity(); this._PDtriggerForm.controls['imgc_fin_institute'].setValidators(Validators.compose([Validators.required])) this._PDtriggerForm.controls['imgc_fin_institute'].updateValueAndValidity(); } @@ -574,14 +574,17 @@ export class AddPdComponent implements OnInit, OnDestroy { this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!'); return; } + if((this._PDtriggerForm.value.lender_contact_person == '' || this._PDtriggerForm.value.lender_contact_person == null) && (this._PDtriggerForm.value.lender_credit_person== '' || this._PDtriggerForm.value.lender_credit_person == null)){ + this.notifier.notify("warning","Either Lender contact person or Lender credit person Need..!"); + } else { - if ((formValue.lender_contact_mobile == '' || formValue.lender_contact_mobile == null) && (formValue.lender_stdcode == '' || formValue.lender_stdcode == null && formValue.lender_landline == '' || formValue.lender_landline == null) && !this.sales_and_credit_enable) { - this.notifier.notify('warning', 'Either Mobile or Landline Need.!'); - return; - } + // if ((formValue.lender_contact_mobile == '' || formValue.lender_contact_mobile == null) && (formValue.lender_stdcode == '' || formValue.lender_stdcode == null && formValue.lender_landline == '' || formValue.lender_landline == null) && !this.sales_and_credit_enable) { + // this.notifier.notify('warning', 'Either Mobile or Landline Need.!'); + // return; + // } - else if (formValue.mobile_no != null && formValue.mobile_no.length != 10){ + if (formValue.mobile_no != null && formValue.mobile_no.length != 10){ this.notifier.notify('warning', 'Please Check Applicant Mobile Number.!'); return; } @@ -802,7 +805,7 @@ export class AddPdComponent implements OnInit, OnDestroy { getContactPerson(){ - if(this._PDtriggerForm.value.fk_lender_id !=null && this._PDtriggerForm.value.pd_branch_id !=null ){ + if(this._PDtriggerForm.value.fk_lender_id !=null ){ let lender_filter= this.checkLender(this._PDtriggerForm.value.fk_lender_id) if(lender_filter != ''){ @@ -811,8 +814,27 @@ export class AddPdComponent implements OnInit, OnDestroy { this._PDtriggerForm.controls['lender_contact_person'].setValue(null) this._PDtriggerForm.controls['lender_contact_person'].clearValidators() this._PDtriggerForm.controls['lender_contact_person'].updateValueAndValidity() + } + else{ + this.sales_and_credit_enable=false; + // this._PDtriggerForm.controls['lender_sales_person'].setValue(null) + this._PDtriggerForm.controls['lender_sales_person'].clearValidators() + this._PDtriggerForm.controls['lender_sales_person'].updateValueAndValidity() + + // this._PDtriggerForm.controls['lender_credit_person'].setValue(null) + // this._PDtriggerForm.controls['lender_credit_person'].clearValidators() + // this._PDtriggerForm.controls['lender_credit_person'].updateValueAndValidity() + + this._PDtriggerForm.controls['imgc_fin_institute'].setValue(null) + this._PDtriggerForm.controls['imgc_fin_institute'].clearValidators() + this._PDtriggerForm.controls['imgc_fin_institute'].updateValueAndValidity() + + // this._PDtriggerForm.controls['lender_contact_person'].setValidators(Validators.compose([Validators.required])) + // this._PDtriggerForm.controls['lender_contact_person'].updateValueAndValidity(); + + } - +if( this._PDtriggerForm.value.pd_branch_id !=null){ let param={fk_lender_id:this._PDtriggerForm.value.fk_lender_id,pd_branch_id:this._PDtriggerForm.value.pd_branch_id} this._pd.getLenderContactPersons(param).subscribe(result=>{ if(result['dataStatus']){ @@ -830,24 +852,6 @@ export class AddPdComponent implements OnInit, OnDestroy { } },err=>{this.notifier.notify("error","Network Error")}) - } - else{ - this.sales_and_credit_enable=false; - this._PDtriggerForm.controls['lender_sales_person'].setValue(null) - this._PDtriggerForm.controls['lender_sales_person'].clearValidators() - this._PDtriggerForm.controls['lender_sales_person'].updateValueAndValidity() - - this._PDtriggerForm.controls['lender_credit_person'].setValue(null) - this._PDtriggerForm.controls['lender_credit_person'].clearValidators() - this._PDtriggerForm.controls['lender_credit_person'].updateValueAndValidity() - - this._PDtriggerForm.controls['imgc_fin_institute'].setValue(null) - this._PDtriggerForm.controls['imgc_fin_institute'].clearValidators() - this._PDtriggerForm.controls['imgc_fin_institute'].updateValueAndValidity() - - this._PDtriggerForm.controls['lender_contact_person'].setValidators(Validators.compose([Validators.required])) - this._PDtriggerForm.controls['lender_contact_person'].updateValueAndValidity(); - } } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html index 01a01b3ed..9e5d0c543 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html @@ -1,4 +1,4 @@ -
+

@@ -21,7 +21,7 @@ --> - + Select @@ -34,16 +34,44 @@ + + + + + Select + + + {{LB.branch_name}} + + + - + + + + Select + {{person.user_name}} + + + + + Select + {{person.user_name}} + + + + +
+ + + type="text" > - + Enter @@ -56,23 +84,23 @@ Enter Valid STD Code.  -  - + Enter Valid Landline Number. - - + - + 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 3999745d3..16f98c908 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 @@ -38,6 +38,7 @@ export class EditPdMasterComponent implements OnInit { enablePDButton: boolean; currentPDStatus: string; disableAfterSubmit: boolean; + loadControl:boolean=false; pincodeflag : any = []; public _EditPDtriggerForm:FormGroup; @@ -59,6 +60,8 @@ export class EditPdMasterComponent implements OnInit { lenderShortName: any; isSubproductShown: boolean = true; productShortName : any; + sales_and_credit_enable: boolean=false; + sales_and_credit_person: any=[]; constructor(private _fb: FormBuilder, private _pd: PdTrigerService, notifier: NotifierService,private dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: any,private titleCase : TitleCasePipe) { @@ -70,15 +73,16 @@ export class EditPdMasterComponent implements OnInit { } ngOnInit() { + this.getLenderList(); // this.draftStatus="DRAFT"; // this.PDTriggerStatus="TRIGGERED"; this.getCustomerSegmentList(); - this.getLenderList(); - this.getProductsList(); + + // this.getProductsList(); this.getStateCityList(); this.getPDTypeList(); // this.getAddresses(); - this.loadFormData(); + this.applicantLength=this.data.applicantLength; } @@ -96,21 +100,69 @@ export class EditPdMasterComponent implements OnInit { this.filterProductAbbr(x[0]['short_name'],1); } } + this.loadFormData(); } + //, error => this.errorMessage = error); , error => { this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!'); + }); + } - selectedLender(lender){ - // alert(JSON.stringify(lender['branches '])); - this.lenderBranchList = lender['branches']; - this.lenderShortName = lender['short_name']; - this.filterProductAbbr(lender['short_name'],2); - this._EditPDtriggerForm.controls.pd_branch_id.setValue(null); + // selectedLender(lender){ + // // alert(JSON.stringify(lender['branches '])); + // this.lenderBranchList = lender['branches']; + // this.lenderShortName = lender['short_name']; + // this.filterProductAbbr(lender['short_name'],2); + // this._EditPDtriggerForm.controls.pd_branch_id.setValue(null); - } + // } + /** FOR Dropdowns */ + selectedLender(lender) { + // console.log('lender',lender); + this.lenderBranchList = lender['branches']; + this.lenderShortName = lender['short_name']; + // console.log(this.lenderShortName); + this._EditPDtriggerForm.controls.pd_branch_id.setValue(null); + + if(this.lenderShortName == 'CLIX'){ + + let getProductAbbr = this.productAllList.map(dval => dval.product_abbr); + let ClixProductAbbr = ['BL','LAEP']; + let FilteredAbbr: any = []; + FilteredAbbr = ClixProductAbbr.map(x => { + let findIndex = getProductAbbr.indexOf(x); + return this.productAllList[findIndex]; + }); + this.productList = FilteredAbbr.length > 0 ? FilteredAbbr : this.productAllList; + } + else{ + this.productList = this.productAllList; + } + + + + + // console.log(this.productList); + + // console.log('this.productList',this.productList); + this._EditPDtriggerForm.controls['fk_product_id'].setValue(''); + this._EditPDtriggerForm.controls['fk_subproduct_id'].setValue(''); + this._EditPDtriggerForm.controls['fk_pd_type'].setValue(''); + this._EditPDtriggerForm.controls['fk_customer_segment'].setValue(''); + this._EditPDtriggerForm.controls['loan_amount'].setValue(''); + + 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.getSubproductList("3",2) + } + // console.log("len",lender) + } + filterProductAbbr(param,flag){ if(param == 'CLIX'){ // console.log(this.productAllList); @@ -215,8 +267,11 @@ export class EditPdMasterComponent implements OnInit { pd_id: [this.data.records.pd_id], fk_lender_id: [this.data.records.fk_lender_id, Validators.compose([Validators.required])], lender_applicant_id: [this.data.records.lender_applicant_id, Validators.compose([Validators.required])], - pd_branch_id:[this.data.records.pd_branch_id, Validators.compose([Validators.required])], - pd_contact_person: [this.data.records.pd_contact_person, Validators.compose([Validators.required])], + pd_branch_id:[this.data.records.pd_branch_id], + pd_contact_person: [this.data.records.pd_contact_person], + lender_sales_person:[this.data.records.lender_sales_person], + lender_credit_person:[this.data.records.lender_credit_person], + imgc_fin_institute:[this.data.records.imgc_fin_institute], pd_contact_mobileno: [this.data.records.pd_contact_mobileno, Validators.compose([Validators.minLength(10),Validators.maxLength(12),Validators.pattern('^[0-9]*$')])], lender_stdcode: [stdcode, Validators.compose([Validators.minLength(3),Validators.maxLength(5)])], lender_landline: [landline,Validators.compose([Validators.minLength(6),Validators.maxLength(8)])], @@ -233,6 +288,7 @@ export class EditPdMasterComponent implements OnInit { // other_pincode:[this.data.records.other_pincode,Validators.compose([Validators.minLength(6),Validators.maxLength(6),Validators.pattern('^[0-9]*$')])], remarks: [this.data.records.remarks], }); + const addressesArray = this._EditPDtriggerForm.get('addresses') as FormArray; this._pd.getAddressesDetails(this.pdid).subscribe( data => { @@ -268,6 +324,8 @@ export class EditPdMasterComponent implements OnInit { addressesArray.push(this.createAddresses(null)); } }); + this.getContactPerson() + } get pdMain() { return this._EditPDtriggerForm.controls; } @@ -488,6 +546,9 @@ export class EditPdMasterComponent implements OnInit { return; } } + // if((this._EditPDtriggerForm.value.pd_contact_person == '' || this._EditPDtriggerForm.value.pd_contact_person == null) && (this._EditPDtriggerForm.value.lender_credit_person== '' || this._EditPDtriggerForm.value.lender_credit_person == null)){ + // this.notifier.notify("warning","Either Lender contact person or Lender credit person Need..!"); + // } if(this.lenderShortName == 'CLIX'){ @@ -507,11 +568,20 @@ export class EditPdMasterComponent implements OnInit { this._EditPDtriggerForm.controls['fk_product_id'].updateValueAndValidity(); - this._EditPDtriggerForm.controls['pd_branch_id'].setValidators([Validators.required]); - this._EditPDtriggerForm.controls['pd_branch_id'].updateValueAndValidity(); + // this._EditPDtriggerForm.controls['pd_branch_id'].setValidators([Validators.required]); + // this._EditPDtriggerForm.controls['pd_branch_id'].updateValueAndValidity(); - this._EditPDtriggerForm.controls['pd_contact_person'].setValidators([Validators.required]); - this._EditPDtriggerForm.controls['pd_contact_person'].updateValueAndValidity(); + // this._EditPDtriggerForm.controls['pd_contact_person'].setValidators([Validators.required]); + // this._EditPDtriggerForm.controls['pd_contact_person'].updateValueAndValidity(); + + // this._EditPDtriggerForm.controls['lender_sales_person'].setValidators([Validators.required]); + // this._EditPDtriggerForm.controls['lender_sales_person'].updateValueAndValidity(); + + // this._EditPDtriggerForm.controls['lender_credit_person'].setValidators([Validators.required]); + // this._EditPDtriggerForm.controls['lender_credit_person'].updateValueAndValidity(); + + // this._EditPDtriggerForm.controls['imgc_fin_institute'].setValidators([Validators.required]); + // this._EditPDtriggerForm.controls['imgc_fin_institute'].updateValueAndValidity(); this._EditPDtriggerForm.controls['pd_contact_mobileno'].setValidators([Validators.required]); this._EditPDtriggerForm.controls['pd_contact_mobileno'].updateValueAndValidity(); @@ -561,6 +631,9 @@ export class EditPdMasterComponent implements OnInit { "lender_applicant_id": my_array.lender_applicant_id, "pd_branch_id":my_array.pd_branch_id, "pd_contact_person": my_array.pd_contact_person, + "lender_sales_person":my_array.lender_sales_person, + "lender_credit_person":my_array.lender_credit_person, + "imgc_fin_institute":my_array.imgc_fin_institute, "pd_contact_mobileno": my_array.pd_contact_mobileno, "pd_contact_landline": concat_landline, "fk_product_id": my_array.fk_product_id, @@ -630,4 +703,79 @@ validateAllFormFields(formGroup: any) { } }); } + + +getContactPerson(){ + + + if(this._EditPDtriggerForm.value.fk_lender_id !=null ){ + let lender_filter= this.checkLender(this._EditPDtriggerForm.value.fk_lender_id) + if(lender_filter != ''){ + + if(lender_filter=="IMGC"){ + this.sales_and_credit_enable=true; + this._EditPDtriggerForm.controls['pd_contact_person'].setValue(null) + this._EditPDtriggerForm.controls['pd_contact_person'].clearValidators() + this._EditPDtriggerForm.controls['pd_contact_person'].updateValueAndValidity() + } + else{ + this.loadControl=true + this.sales_and_credit_enable=false; + // this._EditPDtriggerForm.controls['lender_sales_person'].setValue(null) + this._EditPDtriggerForm.controls['lender_sales_person'].clearValidators() + this._EditPDtriggerForm.controls['lender_sales_person'].updateValueAndValidity() + + // this._EditPDtriggerForm.controls['lender_credit_person'].setValue(null) + this._EditPDtriggerForm.controls['lender_credit_person'].clearValidators() + this._EditPDtriggerForm.controls['lender_credit_person'].updateValueAndValidity() + + this._EditPDtriggerForm.controls['imgc_fin_institute'].setValue(null) + this._EditPDtriggerForm.controls['imgc_fin_institute'].clearValidators() + this._EditPDtriggerForm.controls['imgc_fin_institute'].updateValueAndValidity() + + // this._EditPDtriggerForm.controls['pd_contact_person'].setValidators(Validators.compose([Validators.required])) + // this._EditPDtriggerForm.controls['pd_contact_person'].updateValueAndValidity(); + + } + + if(this._EditPDtriggerForm.value.pd_branch_id !=null ){ + let param={fk_lender_id:this._EditPDtriggerForm.value.fk_lender_id,pd_branch_id:this._EditPDtriggerForm.value.pd_branch_id} + this._pd.getLenderContactPersons(param).subscribe(result=>{ + if(result['dataStatus']){ + let records=result['records'] + if(records.length >0){ + this.sales_and_credit_person.sales_person=records.filter(val=>val.role_type == "SALES") + this.sales_and_credit_person.credit_person=records.filter(val=>val.role_type == "CREDIT") + } + } + else{ + this._EditPDtriggerForm.controls['lender_sales_person'].setValue(null) + this._EditPDtriggerForm.controls['lender_credit_person'].setValue(null) + this.sales_and_credit_person=[] + this.notifier.notify("warning",result['msg']) + } + this.loadControl=true + },err=>{this.notifier.notify("error","Network Error")}) + + + } + else{ + this.loadControl=true + } + } + else{ + this.loadControl=true + } + +} +else{ + this.loadControl=true +} +this.loadControl=true +} +checkLender(value){ + if(value != null){ + return this.lenderList.filter(val=>val.entity_id == value).map(mapping=>mapping.short_name)[0] + } +} } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts index c08bcfb2d..73e46dc6b 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts @@ -318,6 +318,7 @@ export class GeneralInfoComponent implements OnInit { element.age = '', element.qualification = '', element.course_name = '', + element.relationship='' individualsControl.push(this.createIndividulas(element)); personsWithRelationshipsControl.push(this.createPersonsWithRelationships(element, key)); @@ -370,11 +371,12 @@ export class GeneralInfoComponent implements OnInit { } createPersonsWithRelationships(elementValue: any, indexVal: number) { - // console.log('elementValue.applicant_name', elementValue.applicant_name); + console.log('elementValue.applicant_name', elementValue,indexVal); return this._fb.group({ pd_co_applicant_id: [elementValue.pd_co_applicant_id], applicant_name: [this.titleCase.transform(elementValue.applicant_name)], - relationship: [indexVal === 0 ? '0' : elementValue.relationship], + // relationship: [indexVal === 0 ? '0' : elementValue.relationship], + relationship:[indexVal === 0 && elementValue.relationship== '' ? '0' : elementValue.relationship], relation_to: [elementValue.relation_to], individuals_order_id: [elementValue.individuals_order_id], is_active: [elementValue.is_active] diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts index e20fb3bc0..1b2771c14 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts @@ -68,7 +68,7 @@ export class StartPdComponent implements OnInit, OnDestroy { constructor(notifier: NotifierService, private dialog: MatDialog, private fb: FormBuilder, private route: ActivatedRoute, private router: Router, - private listPDComponent: ListPdComponent, private _pd: PdTrigerService,) { + private listPDComponent: ListPdComponent, private _pd: PdTrigerService) { this.startPD = this.route.snapshot.params['pdid']; this.randomString = this.route.snapshot.params['rdmstr']; // console.log(this.route.snapshot.params['pdid'],this.route.snapshot.params['rdmstr']); @@ -153,7 +153,9 @@ export class StartPdComponent implements OnInit, OnDestroy { else { checkType==1 ? this.router.navigate(['../../viewpd', this.pdMasterList.parent_pd_id], {relativeTo: this.route}) : this.loadTemplates(this.startPD,2,this.randomString); } - + if(checkType == 2){ + this.loadTemplates(this.startPD,2,this.randomString); + } }); } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts index f79d2b1af..6b52b43df 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts @@ -56,12 +56,19 @@ export class ViewPdComponent implements OnInit, OnDestroy { { 'backEnd_FieldName': "pd_contact_mobileno", 'frontEnd_FieldName': "Lender's Mobile Number" }, { 'backEnd_FieldName': "pd_branch_id", 'frontEnd_FieldName': "Branch" }, { 'backEnd_FieldName': "pd_contact_landline", 'frontEnd_FieldName': "Lender's Landline Number" }, - { 'backEnd_FieldName': "main_applicant", 'frontEnd_FieldName': "Applicant Master" }]; + { 'backEnd_FieldName': "main_applicant", 'frontEnd_FieldName': "Applicant Master" }, + { 'backEnd_FieldName': "addressline1", 'frontEnd_FieldName': "Address at which PD is to be done" }, + { 'backEnd_FieldName': "fk_city", 'frontEnd_FieldName': "City" }, + { 'backEnd_FieldName': "fk_state", 'frontEnd_FieldName': "State" }, + { 'backEnd_FieldName': "pincode", 'frontEnd_FieldName': "Pincode" }, + { 'backEnd_FieldName': "lender_sales_person", 'frontEnd_FieldName': "Lender Sales Person" }, + { 'backEnd_FieldName': "lender_credit_person", 'frontEnd_FieldName': "Lender Credit Person" }, + { 'backEnd_FieldName': "imgc_fin_institute", 'frontEnd_FieldName': "Financial Institution" }]; // localAddressMandortyField: any = [ - // { 'backEnd_FieldName': "addressline1", 'frontEnd_FieldName': "Address at which PD is to be done" }, - // { 'backEnd_FieldName': "fk_city", 'frontEnd_FieldName': "City" }, - // { 'backEnd_FieldName': "fk_state", 'frontEnd_FieldName': "State" }, - // { 'backEnd_FieldName': "pincode", 'frontEnd_FieldName': "Pincode" } + // { 'backEnd_FieldName': "addressline1", 'frontEnd_FieldName': "Address at which PD is to be done" }, + // { 'backEnd_FieldName': "fk_city", 'frontEnd_FieldName': "City" }, + // { 'backEnd_FieldName': "fk_state", 'frontEnd_FieldName': "State" }, + // { 'backEnd_FieldName': "pincode", 'frontEnd_FieldName': "Pincode" } // ]; viewID: string; viewParams: any; @@ -125,7 +132,7 @@ export class ViewPdComponent implements OnInit, OnDestroy { if (data.status == 200) { let masterData: any = data.records.pd_master_details; this.pdMasterData.push(masterData[0]); - // this.mandatoryFieldsValidations = masterData[1].mandatory_fields; + this.mandatoryFieldsValidations = masterData[1].mandatory_fields; this.pd_QC_Rating = Number(this.pdMasterData.qc_rating); this.pdApplicantData = data.records.applicants_details; this.pdApplicantData = this.pdApplicantData.filter(appt => appt.applicant_type != 2); @@ -233,8 +240,13 @@ export class ViewPdComponent implements OnInit, OnDestroy { .subscribe(dataresult => { if (flag == 1) { let ffd: any = []; + console.log( this.FilteredFieldNames) + // frontEnd_FieldName this.FilteredFieldNames.forEach(field => { + console.log("field",field) + if(field != undefined){ ffd.push(field.frontEnd_FieldName); + } }); // this.notifier.notify('info', 'Please Fill ' + ffd.join(' , ') + ' Fields.!'); @@ -435,13 +447,18 @@ export class ViewPdComponent implements OnInit, OnDestroy { // direct trigger the pd - directTriggerPD(data: any, masterdetail: any) { + directTriggerPD(data: any, masterdetail: any) { let pdid = masterdetail.pd_id; let getValues = data.filter(val => val).map(Val => Val); - this.FilteredFieldNames = getValues.map(x => { + console.log("getvalues",getValues); + this.FilteredFieldNames = getValues.map(x => { + console.log("x",x) let findIndex = this.localMandatoryFields.map(val => val.backEnd_FieldName).indexOf(x); + console.log("find index",findIndex); + if(findIndex != -1){ return this.localMandatoryFields[findIndex]; + } }); if (data.length > 0) {