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 a99dcdcf6..6b85828b2 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 @@ -1019,7 +1019,7 @@
- Cities Where Max Sales Done for + Countries Where Max Sales Done for {{wholesale.value.main_products}} Countries Where The Export Is Being Done for 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 5d34740a4..70ea3f909 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 @@ -1,26 +1,14 @@ -import { - Component, - OnInit, - Inject, - Input -} from '@angular/core'; +import { Component,OnInit,Inject,Input } from '@angular/core'; -import { - FormBuilder, - FormGroup, - Validators, - FormArray, FormControl, -} from '@angular/forms'; +import { FormBuilder,FormGroup,Validators,FormArray, FormControl,} from '@angular/forms'; import { NotifierService } from 'angular-notifier'; -import { - MatDialog, - MatDialogRef, - MAT_DIALOG_DATA -} from '@angular/material'; +import { MatDialog,MatDialogRef,MAT_DIALOG_DATA } from '@angular/material'; + /** Service */ import { PdTrigerService } from '../../../../../pd-service/pd-triger.service'; + import { ActivatedRoute, Router } from "@angular/router"; @Component({ @@ -39,9 +27,6 @@ export class CurrentLoanComponent implements OnInit { pdid: number; form_id: number; applicant_details: any; - // @Input() pdid: number; - // @Input() form_id: number; - //@Input() applicant_details: any; lenderData: any = []; frequencyData: any = []; loanTypeData: any = []; @@ -69,7 +54,6 @@ export class CurrentLoanComponent implements OnInit { this.notifier = notifier; this.applicants = this.pd_all_details.pdapplicants_detials; this.applicants.push({ 'pd_co_applicant_id': '0', 'applicant_name': 'Others' }); - //this.OtherFlag[0] = 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; @@ -197,6 +181,7 @@ export class CurrentLoanComponent implements OnInit { mode_name: element.address_label, details: [], owner_name: element.business_name_of_the_owner, + other_owner: element.business_name_of_the_other_owner, form_type: 'Data From Bussiness Address' }) }); @@ -209,6 +194,7 @@ export class CurrentLoanComponent implements OnInit { mode_name: element.business_assets_mode_name, details: element.business_details, owner_name: element.business_name_of_the_owner, + other_owner: element.business_name_of_the_other_owner, form_type: 'Data From Business Assets' }) }); @@ -221,6 +207,7 @@ export class CurrentLoanComponent implements OnInit { mode_name: element.assets_mode_name, details: element.details, owner_name: element.name_of_the_owner, + other_owner: element.other_owner, form_type: 'Data From Other Asset' }) }); @@ -239,7 +226,12 @@ export class CurrentLoanComponent implements OnInit { this.dataFromAssets.forEach((val, index) => { if (val.mode == 0) { let owner = val.owner_name.map((e => { - return e.name.split(',') + console.log(e.name.split(',')); + console.log(e.name); + + return (e.name == 'Others' ? val.other_owner : e.name).split(','); + + })); // labelarray[index] = ' : '+owner +' - '+ val.mode_name.split("/")[0] + ' ( ' + val.mode_name.split("/")[1] + ' )'; labelarray[index] = ' : ' + owner + ' - ' + val.mode_name; @@ -253,7 +245,8 @@ export class CurrentLoanComponent implements OnInit { }); if (val.owner_name.length > 0) { owner = val.owner_name.map((e => { - return e.name.split(',') + // return e.name.split(',') + return (e.name == 'Others' ? val.other_owner : e.name).split(','); })); } @@ -281,7 +274,8 @@ export class CurrentLoanComponent implements OnInit { } if (val.owner_name.length > 0) { owner = val.owner_name.map((e => { - return e.name.split(',') + // return e.name.split(',') + return (e.name == 'Others' ? val.other_owner : e.name).split(','); })); } @@ -296,7 +290,8 @@ export class CurrentLoanComponent implements OnInit { }); if (val.owner_name.length > 0) { owner = val.owner_name.map((e => { - return e.name.split(',') + // return e.name.split(',') + return (e.name == 'Others' ? val.other_owner : e.name).split(','); })); } let description = data != '' ? ' ( ' + data + ' )' : ''; @@ -309,7 +304,8 @@ export class CurrentLoanComponent implements OnInit { }); if (val.owner_name.length > 0) { owner = val.owner_name.map((e => { - return e.name.split(',') + // return e.name.split(',') + return (e.name == 'Others' ? val.other_owner : e.name).split(','); })); } let description = data != '' ? ' ( ' + data + ' )' : ''; @@ -319,7 +315,8 @@ export class CurrentLoanComponent implements OnInit { let owner: any = "Owner Not Mentioned"; if (val.owner_name.length > 0) { owner = val.owner_name.map((e => { - return e.name.split(',') + // return e.name.split(',') + return (e.name == 'Others' ? val.other_owner : e.name).split(','); })); } @@ -335,7 +332,8 @@ export class CurrentLoanComponent implements OnInit { }); if (val.owner_name.length > 0) { owner = val.owner_name.map((e => { - return e.name.split(',') + // return e.name.split(',') + return (e.name == 'Others' ? val.other_owner : e.name).split(','); })); } let description = data != '' ? '( ' + data + ' )' : ''; diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/employment-info/employment-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/employment-info/employment-info.component.html index 13af86138..9fdec2f52 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/employment-info/employment-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/employment-info/employment-info.component.html @@ -134,17 +134,20 @@ + {{"₹"}} {{employmentForm.controls['gross_monthly_salary'].value | numberToWords}} Only + {{"₹"}} {{employmentForm.controls['net_monthly_salary'].value | numberToWords}} Only + {{"₹"}} {{employmentForm.controls['bonus_incentive'].value | numberToWords}} Only diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.html index 8dcc90882..9a7c908ff 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.html @@ -1,240 +1,252 @@
-

- -
-
-
- {{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}}
- {{pageTitle}} -
- -
+

+ +
+
+
+ {{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - + {{subproduct_abbr}}
+ {{pageTitle}} +
+ +
-
-
- -
-

- - - - -
-
- - {{types.type_name}} -
-
- - - - - - +
+ +
+

- - - - Select - Yes - No - - - - - - + + + + +
+
+ + + + + -
-
- - - - - - - + + + + Select + Yes + No + + + +
+
+ + + + + + + +
+
+ +
+ +
+ +
+
+ +
+ +
+ + + + + {{val.name}} + + + + + + + +
+
+ + + +
+
+ +
+ +
+
+
+ + + + +
-
- -
- -
- -
-
- - - - - - - -
- -
- - - - - - {{val.name}} - - + + + Select + Positive + Negative - - - - -
-
- - - -
-
- -
- -
-
-
-
- - - - - -
- -
- - - Select - Positive - Negative - - -
- - - - - - - - - Enter Valid Mobile Number. - - - - Enter Valid STD Code. - - - - - Enter Valid Landline Number. - - - - - - - - Select - - {{relationship.relation_with_business_name | titlecase}} - - - - - - -

Period of Relationship

- - - - - - - - - {{"₹"}} {{amtInwords[r]}} Only - - - - Select - - {{volume.name | titlecase}} - - - - - - - - - - Select - - {{remark.name}} - - - - - - + +
+
+ + + + + + + + + Enter + Valid Mobile Number. + + + + Enter + Valid STD Code. + - + + + Enter + Valid Landline Number. + + + + + - - - - - - - - - - - - + + Select + + {{relationship.relation_with_business_name | titlecase}} + + + + + + +

Period of Relationship

+ + + + + + + + + {{"₹"}} + {{amtInwords[r]}} Only + + + + Select + + {{volume.name | titlecase}} + + + + + + + + + + Select + + {{remark.name}} + + + + + + + + + + + + + + + +
+ + + + + + - - - - -
- - Remarks - - -
-
- -
- -
+ + + + +
+ + Remarks + + +
+
+ +
+ +
- - \ No newline at end of file + \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts index 67c721c9e..c0d355453 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts @@ -4,11 +4,13 @@ import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition} from '@angul import { NotifierService } from 'angular-notifier'; import { PdTrigerService } from './../../../../../pd-service/pd-triger.service'; import { parse } from 'url'; + @Component({ selector: 'app-neighbour-hood', templateUrl: './neighbour-hood.component.html', styleUrls: ['./neighbour-hood.component.scss'] }) + export class NeighbourHoodComponent implements OnInit { customer_segment_abbr: any; subproduct_abbr: any; @@ -22,7 +24,7 @@ export class NeighbourHoodComponent implements OnInit { form_id:number; private notifier: NotifierService; - check_type:any=[{'id':0,'type_name':'Neighbourhood Check'},{'id':1,'type_name':'Reference Check'}] + check_type:any=[{'id':0,'type_name':'Neighbourhood'},{'id':1,'type_name':'Reference'}] default_reference_details: any= {'reference_name':'','mobile':'','landline':'-','location':'','relationship_with':'','year_relation_applicant':'','months_relation_applicant':'','business_volume_amount':'','business_volume_unit':'','reference_final_remarks':'','positive_remark':'','negative_remark':'','insufficient_info_remark':''}; default_neighbourhood_details: any= {'neighbourhood_name':'','do_know':'','how_long_do_know_in_year':'','how_long_do_know_in_month':'','is_applicant_owner':'','did_not_know_the_business_operation':'','organisation_owner':'','other_organisation_owner':'','did_not_know_the_owner':''}; @@ -33,25 +35,24 @@ export class NeighbourHoodComponent implements OnInit { finalRemarksList : any = [{'id': 1,'name': "Positive"}, {'id': 2,'name': "Negative"}, {'id': 3,'name': "Insufficient information provided"}]; -existCompanyList: any =[]; -mergeCompanyApplicant: any=[]; -isOrganisationOwner: any=[]; -amtInwords : any = []; + existCompanyList: any =[]; + mergeCompanyApplicant: any=[]; + isOrganisationOwner: any=[]; + amtInwords : any = []; // isOtherApplicant: any = []; constructor(notifier: NotifierService, private _pd: PdTrigerService ,private _fb: FormBuilder, @Inject(MAT_DIALOG_DATA) public data: any,private dialogRef: MatDialogRef) { this.pdid = this.data.pdmaster_details.pd_id; this.notifier = notifier; this.form_id = 19; - this.main_applicant = this.data.pdmaster_details.main_applicant; - this.lender_applicant_id = this.data.pdmaster_details.lender_applicant_id; - this.subproduct_abbr = this.data.pdmaster_details.subproduct_abbr; - this.customer_segment_abbr = this.data.pdmaster_details.customer_segment_abbr; - this.applicants = this.data.pdapplicants_detials; - this.applicants = this.applicants.filter(appt=>appt.applicant_type != 2); - this.applicants.push({'pd_co_applicant_id': 0,'applicant_name': "Others"}) - - } + this.main_applicant = this.data.pdmaster_details.main_applicant; + this.lender_applicant_id = this.data.pdmaster_details.lender_applicant_id; + this.subproduct_abbr = this.data.pdmaster_details.subproduct_abbr; + this.customer_segment_abbr = this.data.pdmaster_details.customer_segment_abbr; + this.applicants = this.data.pdapplicants_detials; + this.applicants = this.applicants.filter(appt=>appt.applicant_type != 2); + this.applicants.push({'pd_co_applicant_id': 0,'applicant_name': "Others"}) + } ngOnInit() { this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{ @@ -78,28 +79,29 @@ amtInwords : any = []; } }) + this.initFormDetails(); // call neghbourhhod / reference check changes - this._neighbourhoodForm.controls['check_type'].valueChanges.subscribe(value => { - const referencecheckControl = this._neighbourhoodForm.controls['referencecheck_list']; - const neighbourhoodControl = this._neighbourhoodForm.controls['neighbourhood_list']; - if(value==0){ - referencecheckControl.controls = []; - referencecheckControl.setValue([]); - if(neighbourhoodControl.value.length==0){ - neighbourhoodControl.push(this.createNeighbourhood(this.default_neighbourhood_details)); - } - } - else { - neighbourhoodControl.controls = []; - neighbourhoodControl.setValue([]); - if(referencecheckControl.value.length==0){ - referencecheckControl.push(this.createReerenceCheck(this.default_reference_details)); - } + // this._neighbourhoodForm.controls['check_type'].valueChanges.subscribe(value => { + // const referencecheckControl = this._neighbourhoodForm.controls['referencecheck_list']; + // const neighbourhoodControl = this._neighbourhoodForm.controls['neighbourhood_list']; + // if(value==0){ + // referencecheckControl.controls = []; + // referencecheckControl.setValue([]); + // if(neighbourhoodControl.value.length==0){ + // neighbourhoodControl.push(this.createNeighbourhood(this.default_neighbourhood_details)); + // } + // } + // else { + // neighbourhoodControl.controls = []; + // neighbourhoodControl.setValue([]); + // if(referencecheckControl.value.length==0){ + // referencecheckControl.push(this.createReerenceCheck(this.default_reference_details)); + // } - } - }); + // } + // }); } @@ -108,7 +110,7 @@ amtInwords : any = []; this._neighbourhoodForm = this._fb.group({ pdid:this.pdid, formid:this.form_id, - check_type:0, + // check_type:0, neighbourhood_list: this._fb.array([]), neighbourhood_status:'', referencecheck_list: this._fb.array([]), @@ -127,15 +129,15 @@ amtInwords : any = []; params.pd_id = this.pdid; params.pd_form_id = '19'; let referencecheckControl = this._neighbourhoodForm.controls['referencecheck_list']; - referencecheckControl.controls = []; + referencecheckControl.controls = []; const neighbourhoodControl = this._neighbourhoodForm.controls['neighbourhood_list']; - neighbourhoodControl.controls=[]; + neighbourhoodControl.controls=[]; this._pd.retriveForm(params).subscribe(data => { if(data.dataStatus) { let exist_ref_details = data.records.referencecheck_list ? Object.keys(data.records.referencecheck_list).map((item)=>data.records.referencecheck_list[item]) : []; let exist_neighbourhood_details = data.records.neighbourhood_list ? Object.keys(data.records.neighbourhood_list).map((item)=>data.records.neighbourhood_list[item]) : []; - if(exist_neighbourhood_details.length>0 && data.records.check_type==0){ - exist_neighbourhood_details.forEach((element,index) => { + if(exist_neighbourhood_details.length>0){ /** && data.records.check_type==0 */ + exist_neighbourhood_details.forEach((element,index) => { this.toggleVisibility(element.did_not_know_the_business_operation,index,1); this.toggleVisibility(element.did_not_know_the_owner,index,2); // this.selectedApplicants(referencecheckControl,element.organisation_owner,index); @@ -143,23 +145,24 @@ amtInwords : any = []; this.getOtherOrganisationOwner(element.organisation_owner,index); }); } - else if(exist_ref_details.length>0 && data.records.check_type==1){ + if(exist_ref_details.length>0){ /**&& data.records.check_type==1 */ exist_ref_details.forEach((element,index) => { - this.amtInwords[index] = this._pd.convertNumberToWords(element.business_volume_amount); - + this.amtInwords[index] = this._pd.convertNumberToWords(element.business_volume_amount); referencecheckControl.push(this.createReerenceCheck(element)); }); } this._neighbourhoodForm.controls['neighbourhood_status'].setValue(data.records.check_type==0 ? data.records.neighbourhood_status : ''); this._neighbourhoodForm.controls['neighbour_reference_remark'].setValue(data.records.neighbour_reference_remark ? data.records.neighbour_reference_remark : ''); - this._neighbourhoodForm.controls['check_type'].setValue(data.records.check_type==1 ? 1 : data.records.check_type==0 ? 0 : ''); + // this._neighbourhoodForm.controls['check_type'].setValue(data.records.check_type==1 ? 1 : data.records.check_type==0 ? 0 : ''); } else { - neighbourhoodControl.push(this.createNeighbourhood(this.default_neighbourhood_details)); - - } + console.log('else',data.dataStatus); + console.log('else',data); + neighbourhoodControl.push(this.createNeighbourhood(this.default_neighbourhood_details)); + referencecheckControl.push(this.createReerenceCheck(this.default_reference_details)); + } }, error => this.errorMessage = error); } @@ -251,51 +254,79 @@ amtInwords : any = []; } //save heighbourhood forms + tempCount : number = 0; + saveNeighbourhood(formData:any){ - let resultMessage:string=''; - - + // console.log('formData',formData); + + // let resultMessage:string=''; // const referencecheckControl = this._neighbourhoodForm.controls['referencecheck_list']; - // const referencecheckControl = this._neighbourhoodForm.get('referencecheck_list') as FormControl; + const referencecheckControl = this._neighbourhoodForm.get('referencecheck_list') as FormControl; + // let RefCtrlLength : any = referencecheckControl.controls.length; const neighbourhoodControl : FormGroup = this._neighbourhoodForm.controls['neighbourhood_list'] as FormGroup; + let NbhdCtrlLength: any = neighbourhoodControl.controls.length; - if(formData.check_type==0){ - // neighbourhoodControl.contdols['neighbourhood_name'].setValidators([Validators.required]); - // neighbourhoodControl.controls['neighbourhood_name'].updateValueAndValidity(); + if (NbhdCtrlLength > 0) { + let Ncnt = 0; + while(Ncnt < NbhdCtrlLength){ - // neighbourhoodControl.controls['do_know'].setValidators([Validators.required]); - // neighbourhoodControl.controls['do_know'].updateValueAndValidity(); - // return; + let nbhdChildCtrl : any = neighbourhoodControl.controls[Ncnt]; + + nbhdChildCtrl.controls['neighbourhood_name'].setValidators([Validators.required]); + nbhdChildCtrl.controls['neighbourhood_name'].updateValueAndValidity(); + + nbhdChildCtrl.controls['do_know'].setValidators([Validators.required]); + nbhdChildCtrl.controls['do_know'].updateValueAndValidity(); + // console.log('nbhdChildCtrl.controls.did_not_know_the_business_operation.value',nbhdChildCtrl.controls.did_not_know_the_business_operation.value) + if(nbhdChildCtrl.controls.did_not_know_the_business_operation.value == '' || nbhdChildCtrl.controls.did_not_know_the_business_operation.value == false){ + // console.log('IF nbhdChildCtrl.controls.did_not_know_the_business_operation.value',nbhdChildCtrl.controls.did_not_know_the_business_operation.value) + nbhdChildCtrl.controls['how_long_do_know_in_month'].setValidators([Validators.required]); + nbhdChildCtrl.controls['how_long_do_know_in_month'].updateValueAndValidity(); + nbhdChildCtrl.controls['how_long_do_know_in_year'].setValidators([Validators.required]); + nbhdChildCtrl.controls['how_long_do_know_in_year'].updateValueAndValidity(); + } + else if(nbhdChildCtrl.controls.did_not_know_the_business_operation.value == true){ + // console.log('ELSE nbhdChildCtrl.controls.did_not_know_the_business_operation.value',nbhdChildCtrl.controls.did_not_know_the_business_operation.value) + nbhdChildCtrl.controls['how_long_do_know_in_month'].setValue(''); + nbhdChildCtrl.controls['how_long_do_know_in_month'].clearValidators(); + nbhdChildCtrl.controls['how_long_do_know_in_month'].updateValueAndValidity(); + nbhdChildCtrl.controls['how_long_do_know_in_year'].setValue(''); + nbhdChildCtrl.controls['how_long_do_know_in_year'].clearValidators(); + nbhdChildCtrl.controls['how_long_do_know_in_year'].updateValueAndValidity(); + } + + if(nbhdChildCtrl.controls.did_not_know_the_owner.value == '' || nbhdChildCtrl.controls.did_not_know_the_owner.value == false){ + nbhdChildCtrl.controls['organisation_owner'].setValidators([Validators.required]); + nbhdChildCtrl.controls['organisation_owner'].updateValueAndValidity(); + } + else if(nbhdChildCtrl.controls.did_not_know_the_owner.value == true){ + nbhdChildCtrl.controls['organisation_owner'].setValue(''); + nbhdChildCtrl.controls['organisation_owner'].clearValidators(); + nbhdChildCtrl.controls['organisation_owner'].updateValueAndValidity(); + } + Ncnt++; + } } - - + // } + // if(formData.check_type==1){ // referencecheckControl.controls['reference_name'].setValidators([Validators.required]); // referencecheckControl.controls['reference_name'].updateValueAndValidity(); - // referencecheckControl.controls['location'].setValidators([Validators.required]); // referencecheckControl.controls['location'].updateValueAndValidity(); - // referencecheckControl.controls['mobile'].setValidators([Validators.required]); // referencecheckControl.controls['mobile'].updateValueAndValidity(); - // referencecheckControl.controls['relationship_with'].setValidators([Validators.required]); // referencecheckControl.controls['relationship_with'].updateValueAndValidity(); - // referencecheckControl.controls['year_relation_applicant'].setValidators([Validators.required]); // referencecheckControl.controls['year_relation_applicant'].updateValueAndValidity(); - // referencecheckControl.controls['business_volume_amount'].setValidators([Validators.required]); // referencecheckControl.controls['business_volume_amount'].updateValueAndValidity(); - // referencecheckControl.controls['business_volume_unit'].setValidators([Validators.required]); // referencecheckControl.controls['business_volume_unit'].updateValueAndValidity(); - // referencecheckControl.controls['reference_final_remarks'].setValidators([Validators.required]); - // referencecheckControl.controls['reference_final_remarks'].updateValueAndValidity(); - + // referencecheckControl.controls['reference_final_remarks'].updateValueAndValidity() // } - if (this._neighbourhoodForm.invalid) { this.validateAllFormFields(this._neighbourhoodForm); this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!'); @@ -305,7 +336,7 @@ amtInwords : any = []; let saveRecords:any = {} let referencecheck_list:any=[]; let neighbourhood_list:any=[]; - if(formData.check_type==0){ + // if(formData.check_type==0){ formData.neighbourhood_list.forEach((element,key) => { neighbourhood_list.push({ "neighbourhood_name":element.neighbourhood_name, @@ -320,9 +351,9 @@ amtInwords : any = []; }) }); saveRecords.neighbourhood_list=neighbourhood_list; - resultMessage='Neihbourhood Updated.!' - } - else{ + // resultMessage='Neihbourhood Updated.!' + // } + // else{ // this for referencecheck_list for selected formData.referencecheck_list.forEach((element,key) => { referencecheck_list.push({ @@ -345,10 +376,10 @@ amtInwords : any = []; }) }); saveRecords.referencecheck_list=referencecheck_list; - resultMessage='Reference Check Updated.!' - } + // resultMessage='Reference Check Updated.!' + // } - saveRecords.check_type=formData.check_type; + // saveRecords.check_type=formData.check_type; saveRecords.pdid=formData.pdid; saveRecords.formid=formData.formid; saveRecords.neighbourhood_status = formData.check_type == 0 ? formData.neighbourhood_status : ''; @@ -452,38 +483,36 @@ compareObjects(o1: any, o2: any) { } getOtherOrganisationOwner(value,i) { - console.log('value',value,'I',i); -let Ctrls = this._neighbourhoodForm.controls['neighbourhood_list']; - console.log('ParCtrls',Ctrls); -let ChdCtrls:any = Ctrls.controls[i]; - console.log('ChdCtrls',ChdCtrls); - // return; - - -let Avaliablity = 1; -console.log('val',value); -if(value.length>0){ - value.forEach(option => { - if(option.id == 0 && option.group_id == 2){ - Avaliablity = option.id; + // console.log('value',value,'I',i); + let Ctrls = this._neighbourhoodForm.controls['neighbourhood_list']; + // console.log('ParCtrls',Ctrls); + let ChdCtrls:any = Ctrls.controls[i]; + // console.log('ChdCtrls',ChdCtrls); + // return; + let Avaliablity = 1; + // console.log('val',value); + if(value.length>0){ + value.forEach(option => { + if(option.id == 0 && option.group_id == 2){ + Avaliablity = option.id; + } + }); } - }); -} -if(Avaliablity == 0){ -// console.log('if Avaliablity',Avaliablity); + if(Avaliablity == 0){ + // console.log('if Avaliablity',Avaliablity); - ChdCtrls.controls.other_organisation_owner.setValidators([Validators.required]); - this.isOrganisationOwner[i] = true; -}else if(Avaliablity == 1){ -// console.log('else Avaliablity',Avaliablity); -// console.log('esle this.isOrganisationOwner[ParInx]',this.isOrganisationOwner[i]); - ChdCtrls.controls.other_organisation_owner.setValue(''); - ChdCtrls.controls.other_organisation_owner.clearValidators(); - this.isOrganisationOwner[i] = false; -// console.log('else this.isOrganisationOwner[ParInx]',this.isOrganisationOwner[i]); -} + ChdCtrls.controls.other_organisation_owner.setValidators([Validators.required]); + this.isOrganisationOwner[i] = true; + }else if(Avaliablity == 1){ + // console.log('else Avaliablity',Avaliablity); + // console.log('esle this.isOrganisationOwner[ParInx]',this.isOrganisationOwner[i]); + ChdCtrls.controls.other_organisation_owner.setValue(''); + ChdCtrls.controls.other_organisation_owner.clearValidators(); + this.isOrganisationOwner[i] = false; + // console.log('else this.isOrganisationOwner[ParInx]',this.isOrganisationOwner[i]); + } -ChdCtrls.controls.other_organisation_owner.updateValueAndValidity(); -} + ChdCtrls.controls.other_organisation_owner.updateValueAndValidity(); + } } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.html index e3adb2011..ccb40fa53 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.html @@ -275,7 +275,7 @@ Area Covered by the Property - + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.ts index d9bfc9e7e..2cea54fae 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.ts @@ -63,7 +63,7 @@ export class RentalVerificationComponent implements OnInit { this.pdid = this.data.pdmaster_details.pd_id; this.notifier = notifier; this.form_id = 17; - this.main_applicant = this.data.pdmaster_details.main_applicant; + this.main_applicant = this.data.pdmaster_details.main_applicant; this.lender_applicant_id = this.data.pdmaster_details.lender_applicant_id; this.subproduct_abbr = this.data.pdmaster_details.subproduct_abbr; this.customer_segment_abbr = this.data.pdmaster_details.customer_segment_abbr; @@ -743,6 +743,11 @@ validateAllFormFields(formGroup: any) { }); } +ngOnDestroy() { + // console.log('Component Destoryed'); + const index = this.data.pdapplicants_detials.findIndex(name => name.applicant_name === 'Others'); + this.data.pdapplicants_detials.splice(index, 1); +} }