UI Changes

This commit is contained in:
venbatechnologies@gmail.com 2019-02-02 18:15:56 +05:30
parent 2ab032fec9
commit 95d7d7db52
4 changed files with 50 additions and 27 deletions

View File

@ -330,7 +330,7 @@
</mat-form-field> --> </mat-form-field> -->
<mat-form-field> <mat-form-field>
<input matInput placeholder="Number of yrs" formControlName="residence_No_of_years" type="number" required> <input matInput placeholder="Number of yrs" formControlName="residence_No_of_years" (keypress)="keyPress($event)" required>
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
@ -345,8 +345,9 @@
<input matInput placeholder="Please specify" formControlName="ownershipOther"> <input matInput placeholder="Please specify" formControlName="ownershipOther">
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="sup.get('residence_ownership').value == 3"> <mat-form-field *ngIf="sup.get('residence_ownership').value == 3" style="width:43%;">
<input matInput placeholder="Rent Amount" formControlName="rent"> <input matInput placeholder="Rent Amount" formControlName="rent" (keypress)="keyPress($event)" (keyup)="inWords($event,1,i)">
<mat-hint align="start" style="font-size:90%" *ngIf="sup.get('rent').value != ''">{{"&#8377;"}} {{RentAmount[i]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
<!-- <div> <!-- <div>
@ -385,23 +386,24 @@
</mat-form-field> </mat-form-field>
</div> </div>
<div *ngIf="item.get('family_member_earning_status').value == 1"> <div *ngIf="item.get('family_member_earning_status').value == 1">
<mat-form-field> <mat-form-field style="width:45%;">
<mat-select placeholder="Segment" formControlName="earning_segment" required> <mat-select placeholder="Segment" formControlName="earning_segment" required>
<mat-option value="{{earn.earning_member_status_id}}" *ngFor="let earn of earningData"> <mat-option value="{{earn.earning_member_status_id}}" *ngFor="let earn of earningData">
{{earn.earning_member_status}} {{earn.earning_member_status}}
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="item.get('earning_segment').value==1"> <mat-form-field style="width:45%;" *ngIf="item.get('earning_segment').value==1">
<input matInput placeholder="Specify Others" formControlName="earning_if_others_segment"> <input matInput placeholder="Specify Others" formControlName="earning_if_others_segment">
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field style="width:45%;">
<input matInput placeholder="Income Per Month" formControlName="earning_gross_income_per_month" required> <input matInput placeholder="Income Per Month" formControlName="earning_gross_income_per_month" (keypress)="keyPress($event)" (keyup)="inWords($event,2,i)" required>
<mat-hint align="start" style="font-size:90%" *ngIf="item.get('earning_gross_income_per_month').value != ''">{{"&#8377;"}} {{IncomePerMonth[i]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field style="width:45%;">
<input matInput placeholder="Name of the Employer/Business" formControlName="earning_name_of_the_employer_or_business" required> <input matInput placeholder="Name of the Employer/Business" formControlName="earning_name_of_the_employer_or_business" required>
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field style="width:45%;">
<input matInput placeholder="No. of years in Employer/Business" formControlName="earning_number_of_years_in_employment_or_business" <input matInput placeholder="No. of years in Employer/Business" formControlName="earning_number_of_years_in_employment_or_business"
required> required>
</mat-form-field> </mat-form-field>
@ -426,18 +428,18 @@
</mat-form-field> </mat-form-field>
</div> </div>
<mat-card-actions> <mat-card-actions>
<div align="center">
<button type="button" mat-flat-button (click)="addFamilyMembers(i)"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Family Members </strong>
</button>
</div>
<div align="right"> <div align="right">
<button type="button" mat-raised-button mat-icon-button (click)="removeFamilyMembers(i)" <button type="button" mat-raised-button mat-icon-button (click)="removeFamilyMembers(i)"
matTooltip="Delete Family Members" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="!last"> matTooltip="Delete Family Members" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="!last">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> </button>
</div> </div>
<div align="center">
<button type="button" mat-flat-button (click)="addFamilyMembers(i)"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Family Members </strong>
</button>
</div>
</mat-card-actions> </mat-card-actions>
</mat-card> </mat-card>
</div> </div>

View File

@ -295,6 +295,8 @@ import { ActivatedRoute, Router } from "@angular/router";
styleUrls: ['./family-details.component.scss'] styleUrls: ['./family-details.component.scss']
}) })
export class FamilyDetailsComponent implements OnInit { export class FamilyDetailsComponent implements OnInit {
IncomePerMonth: any =[];
RentAmount: any = [];
//@Input() pdid: number; //@Input() pdid: number;
pageTitle: string = "Family Details"; pageTitle: string = "Family Details";
pdid: string; pdid: string;
@ -563,6 +565,7 @@ export class FamilyDetailsComponent implements OnInit {
control.push(formData); control.push(formData);
} else { } else {
records.forEach((val,index) => { records.forEach((val,index) => {
this.RentAmount[index] = this._pd.convertNumberToWords(val.rent);
//for (let val of records) //for (let val of records)
this.getCity(val.residence_state,index); this.getCity(val.residence_state,index);
let formData: FormGroup = this.fb.group({ let formData: FormGroup = this.fb.group({
@ -592,7 +595,9 @@ export class FamilyDetailsComponent implements OnInit {
addFamilyMemberDetailsWithData(inx, val): void { addFamilyMemberDetailsWithData(inx, val): void {
const control = <FormArray>this.familyForm.controls['family_details']['controls'][inx].controls.family_members_details; const control = <FormArray>this.familyForm.controls['family_details']['controls'][inx].controls.family_members_details;
for (let vals of val) { val.forEach((vals,index) => {
// for (let vals of val) {
this.IncomePerMonth[index] = this._pd.convertNumberToWords(vals.earning_gross_income_per_month);
let datas = this.fb.group({ let datas = this.fb.group({
family_member_name: [vals.family_member_name || null, Validators.compose([])], family_member_name: [vals.family_member_name || null, Validators.compose([])],
family_member_relationship: [vals.family_member_relationship || null, Validators.compose([])], family_member_relationship: [vals.family_member_relationship || null, Validators.compose([])],
@ -609,7 +614,7 @@ export class FamilyDetailsComponent implements OnInit {
non_earning_if_schoolorcollege: [vals.non_earning_if_schoolorcollege || null], non_earning_if_schoolorcollege: [vals.non_earning_if_schoolorcollege || null],
}); });
control.push(datas); control.push(datas);
} });
} }
addFamilyMemberDetails() { addFamilyMemberDetails() {
@ -661,6 +666,7 @@ export class FamilyDetailsComponent implements OnInit {
} }
addFamilyMembers(inx) { addFamilyMembers(inx) {
console.log(inx);
const control = <FormArray>this.familyForm.controls['family_details']['controls'][inx].controls.family_members_details; const control = <FormArray>this.familyForm.controls['family_details']['controls'][inx].controls.family_members_details;
control.push(this.generateFamilyMembersDetailsGet()); control.push(this.generateFamilyMembersDetailsGet());
} }
@ -798,14 +804,28 @@ removeFamilyMembers(index) {
// }); // });
// } // }
// /** On Key Press Event For Age */ /** On Key Press Event For Age */
// keyPress(event: any) { keyPress(event: any) {
// const pattern = /[0-9]/; const pattern = /[0-9]/;
// let inputChar = String.fromCharCode(event.charCode); let inputChar = String.fromCharCode(event.charCode);
// if (event.keyCode != 8 && !pattern.test(inputChar)) { if (event.keyCode != 8 && !pattern.test(inputChar)) {
// event.preventDefault(); event.preventDefault();
// } }
// } }
/** To Convert Amount into Words */
inWords(e,flag:number,i){
switch(flag){
case 1 :
this.RentAmount[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 2 :
this.IncomePerMonth[i] = this._pd.convertNumberToWords(e.target.value);
break;
default:
break;
}
}
} }

View File

@ -10,12 +10,12 @@ import { parse } from 'url';
styleUrls: ['./neighbour-hood.component.scss'] styleUrls: ['./neighbour-hood.component.scss']
}) })
export class NeighbourHoodComponent implements OnInit { export class NeighbourHoodComponent implements OnInit {
pageTitle: string ="Neighbourhood / Reference Check"; pageTitle: string ="Neighbourhood Check / Reference Check";
public _neighbourhoodForm: FormGroup; public _neighbourhoodForm: FormGroup;
pdid : string; pdid : string;
form_id:number; form_id:number;
private notifier: NotifierService; private notifier: NotifierService;
check_type:any=[{'id':0,'type_name':'Neighbourhood'},{'id':1,'type_name':'Reference Check'}] check_type:any=[{'id':0,'type_name':'Neighbourhood Check'},{'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':'','reference_final_remarks':'','positive_remark':'','negative_remark':'','insufficient_info_remark':''}; 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':''}; default_neighbourhood_details: any= {'neighbourhood_name':'','do_know':'','how_long_do_know_in_year':'','how_long_do_know_in_month':'','is_applicant_owner':''};

View File

@ -33,3 +33,4 @@
<button matTooltip="Complete Question" matTooltipPosition="above" [disabled]="actualQuestions==0 || actualQuestions!=answeredQuestions || currentPDStatus===false" mat-raised-button color="primary" (click)="changePDStatus(pdStatusCheck.COMPLETED);"><span>{{currentPDStatus === true ? 'COMPLETE':'COMPLETED' }}</span></button> <button matTooltip="Complete Question" matTooltipPosition="above" [disabled]="actualQuestions==0 || actualQuestions!=answeredQuestions || currentPDStatus===false" mat-raised-button color="primary" (click)="changePDStatus(pdStatusCheck.COMPLETED);"><span>{{currentPDStatus === true ? 'COMPLETE':'COMPLETED' }}</span></button>
</mat-card-actions> </mat-card-actions>
</mat-card> </mat-card>
<notifier-container></notifier-container>