Edit Pd Change For Landline NO : TM

This commit is contained in:
venbatechnologies@gmail.com 2018-12-08 16:13:33 +05:30
parent 5a56ac04a5
commit f8e27953b5
4 changed files with 13 additions and 6 deletions

View File

@ -31,7 +31,11 @@
<input matInput placeholder="Mobile Number" formControlName="mobile_no" type="text" (keypress)="keyPress($event)" required> <input matInput placeholder="Mobile Number" formControlName="mobile_no" type="text" (keypress)="keyPress($event)" required>
<mat-error *ngIf="pdMainApplicant.mobile_no.hasError('maxlength') || pdMainApplicant.mobile_no.hasError('minlength')">Enter Valid Mobile Number. </mat-error> <mat-error *ngIf="pdMainApplicant.mobile_no.hasError('maxlength') || pdMainApplicant.mobile_no.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 40%"> <mat-form-field style="width: 10%">
<input matInput placeholder="LandLine Code" formControlName="statecode" type="text" (keypress)="keyPress($event)">
<mat-error *ngIf="pdMainApplicant.statecode.hasError('maxlength') || pdMainApplicant.statecode.hasError('minlength')">Enter Valid Phone Number. </mat-error>
</mat-form-field> &nbsp;-&nbsp;
<mat-form-field style="width: 25%">
<input matInput placeholder="LandLine Number" formControlName="landline" type="text" (keypress)="keyPress($event)"> <input matInput placeholder="LandLine Number" formControlName="landline" type="text" (keypress)="keyPress($event)">
<mat-error *ngIf="pdMainApplicant.landline.hasError('maxlength') || pdMainApplicant.landline.hasError('minlength')">Enter Valid Phone Number. </mat-error> <mat-error *ngIf="pdMainApplicant.landline.hasError('maxlength') || pdMainApplicant.landline.hasError('minlength')">Enter Valid Phone Number. </mat-error>
</mat-form-field> </mat-form-field>

View File

@ -52,11 +52,16 @@ export class EditPdApplicantComponent implements OnInit {
} }
loadApplicantFormData() { loadApplicantFormData() {
let statecodesearch = this.mainApplicantData[0].landline.search("-");
let statecode = this.mainApplicantData[0].landline.substr(0,statecodesearch);
console.log(statecode);
let landline = this.mainApplicantData[0].landline.substr(+statecodesearch + 1,8);
this._EditApplicantForm = this._fb.group({ this._EditApplicantForm = this._fb.group({
fk_applicant_primary_id: [this.mainApplicantData[0].pd_co_applicant_id], fk_applicant_primary_id: [this.mainApplicantData[0].pd_co_applicant_id],
applicant_name: [this.mainApplicantData[0].applicant_name, Validators.compose([Validators.required])], applicant_name: [this.mainApplicantData[0].applicant_name, Validators.compose([Validators.required])],
mobile_no: [this.mainApplicantData[0].mobile_no, Validators.compose([Validators.required,Validators.required,Validators.minLength(10),Validators.maxLength(12)])], mobile_no: [this.mainApplicantData[0].mobile_no, Validators.compose([Validators.required,Validators.required,Validators.minLength(10),Validators.maxLength(12)])],
landline: [this.mainApplicantData[0].landline, Validators.compose([Validators.minLength(8),Validators.maxLength(12)])], statecode: [statecode, Validators.compose([Validators.minLength(2),Validators.maxLength(4)])],
landline: [landline, Validators.compose([Validators.minLength(6),Validators.maxLength(8)])],
company_name: [this.mainApplicantData[0].company_name], company_name: [this.mainApplicantData[0].company_name],
applicant_type: [this.mainApplicantData[0].applicant_type, Validators.compose([Validators.required])], applicant_type: [this.mainApplicantData[0].applicant_type, Validators.compose([Validators.required])],
coApplicantItems: this._fb.array([]), coApplicantItems: this._fb.array([]),
@ -118,7 +123,7 @@ export class EditPdApplicantComponent implements OnInit {
"applicant_name":formValue.applicant_name, "applicant_name":formValue.applicant_name,
"company_name":formValue.company_name, "company_name":formValue.company_name,
"mobile_no":formValue.mobile_no, "mobile_no":formValue.mobile_no,
"landline":formValue.landline, "landline":formValue.statecode+'-'+formValue.landline,
"applicant_type":formValue.applicant_type, "applicant_type":formValue.applicant_type,
"relation":formValue.relationship, "relation":formValue.relationship,
"isactive":1 "isactive":1

View File

@ -492,6 +492,4 @@ selectedCoApplicantEntityChanges(event: any,c){
} }
} }

View File

@ -1,4 +1,4 @@
export const environment = { export const environment = {
production: true, production: true,
apiEndpoint: 'http://ssa.sineedge.com/sparqtest/api/' apiEndpoint: 'https://ssa.sineedge.com/sparqtest/api/'
}; };