std code changes in neighbour hood

This commit is contained in:
gandhimathi 2018-12-21 18:33:34 +05:30
parent e945a07cbf
commit 15caf265b1
3 changed files with 15 additions and 7 deletions

View File

@ -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],

View File

@ -57,11 +57,15 @@
<mat-form-field style="width: 28%">
<input matInput placeholder="Name" formControlName="reference_name" type="text">
</mat-form-field>
<mat-form-field style="width: 28%">
<mat-form-field style="width: 24%">
<input matInput placeholder="Mobile Number" formControlName="mobile" type="text" (keypress)="keyPress($event)">
<mat-error *ngIf="reference['controls'].mobile.hasError('maxlength') || reference['controls'].mobile.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</mat-form-field>
<mat-form-field style="width: 28%">
<mat-form-field style="width: 10%">
<input matInput placeholder="STD" formControlName="std_code" type="text" (keypress)="keyPress($event)">
<mat-error *ngIf="reference['controls'].std_code.hasError('maxlength') || reference['controls'].std_code.hasError('minlength')">Enter Valid STD Code. </mat-error>
</mat-form-field><span>-</span>
<mat-form-field style="width: 20%">
<input matInput placeholder="Landline Number" formControlName="landline" type="text" (keypress)="keyPress($event)">
<mat-error *ngIf="reference['controls'].landline.hasError('maxlength') || reference['controls'].landline.hasError('minlength')">Enter Valid Landline Number. </mat-error>
</mat-form-field>
@ -77,7 +81,7 @@
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 28%" *ngIf="reference.controls.relationship_with.value==5">
<mat-form-field style="width: 30%" *ngIf="reference.controls.relationship_with.value==5">
<input matInput placeholder="Others" formControlName="others" type="text">
</mat-form-field>
<p #period_paragraph>Period of Relationship</p>

View File

@ -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,