From 15caf265b15f29f7588fa322f99649e2eaed92ca Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Fri, 21 Dec 2018 18:33:34 +0530 Subject: [PATCH] std code changes in neighbour hood --- .../edit-pd-applicant/edit-pd-applicant.component.ts | 2 +- .../forms/neighbour-hood/neighbour-hood.component.html | 10 +++++++--- .../forms/neighbour-hood/neighbour-hood.component.ts | 10 +++++++--- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component.ts index 0cceec89d..247b93d73 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component.ts @@ -43,6 +43,7 @@ export class EditPdApplicantComponent implements OnInit { fk_applicant_primary_id: [null], applicant_name: [null, Validators.compose([Validators.required])], mobile_no: [null, Validators.compose([Validators.required,Validators.minLength(10),Validators.maxLength(12)])], + stdcode: [null, Validators.compose([Validators.minLength(2),Validators.maxLength(4)])], landline: [null, Validators.compose([Validators.minLength(8),Validators.maxLength(12)])], company_name: [null], applicant_type: [1], @@ -54,7 +55,6 @@ export class EditPdApplicantComponent implements OnInit { loadApplicantFormData() { let stdcodesearch = this.mainApplicantData[0].landline.search("-"); let stdcode = this.mainApplicantData[0].landline.substr(0,stdcodesearch); - console.log(stdcode); let landline = this.mainApplicantData[0].landline.substr(+stdcodesearch + 1,8); this._EditApplicantForm = this._fb.group({ fk_applicant_primary_id: [this.mainApplicantData[0].pd_co_applicant_id], 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 e8da740ae..d137527b2 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 @@ -57,11 +57,15 @@ - + Enter Valid Mobile Number. - + + + Enter Valid STD Code. + - + Enter Valid Landline Number. @@ -77,7 +81,7 @@ - +

Period of Relationship

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 9919dd140..ce94b7288 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 @@ -16,7 +16,7 @@ export class NeighbourHoodComponent implements OnInit { form_id:number; private notifier: NotifierService; check_type:any=[{'id':0,'type_name':'Neighbourhood'},{'id':1,'type_name':'Reference Check'}] - default_reference_details: any= {'reference_name':'','mobile':'','landline':'','location':'','relationship_with':'','year_relation_applicant':'','months_relation_applicant':'','business_volume_amount':'','business_volume_unit':''}; + default_reference_details: any= {'reference_name':'','mobile':'','landline':'-','location':'','relationship_with':'','year_relation_applicant':'','months_relation_applicant':'','business_volume_amount':'','business_volume_unit':''}; default_neighbourhood_details: any= {'neighbourhood_name':'','do_know':'','how_long_do_know':'','is_applicant_owner':''}; busineesRelationshipList:any=[]; @@ -128,10 +128,14 @@ export class NeighbourHoodComponent implements OnInit { // create reference check form array createReerenceCheck(elementValue:any){ + let stdcodesearch = elementValue.landline.search("-"); + let stdcode = elementValue.landline.substr(0,stdcodesearch); + let landline = elementValue.landline.substr(+stdcodesearch + 1,8); return this._fb.group({ reference_name: [elementValue.reference_name, Validators.required], mobile: [elementValue.mobile,Validators.compose([Validators.required,Validators.minLength(10),Validators.maxLength(10)])], - landline: [elementValue.landline,Validators.compose([Validators.minLength(6),Validators.maxLength(8)])], + std_code: [stdcode,Validators.compose([Validators.minLength(2),Validators.maxLength(4)])], + landline: [landline,Validators.compose([Validators.minLength(6),Validators.maxLength(8)])], location:[elementValue.location,Validators.required], relationship_with:[elementValue.relationship_with,Validators.required], others: [elementValue.others], @@ -217,7 +221,7 @@ export class NeighbourHoodComponent implements OnInit { referencecheck_list.push({ "reference_name":element.reference_name, "mobile":element.mobile, - "landline":element.landline, + "landline":element.std_code+'-'+element.landline, "location":element.location, "relationship_with":element.relationship_with, "others":element.others,