employment form field name changes : kdk

This commit is contained in:
dineshkumarkannan 2018-11-15 15:40:14 +05:30
parent 9a1725cb84
commit e5f11136c0
2 changed files with 44 additions and 22 deletions

View File

@ -3,9 +3,18 @@
<mat-form-field>
<input matInput placeholder="Name of employer" formControlName="employer_name">
</mat-form-field>
<div>
<label>Since how long working with this employer?</label>
<br>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field>
<input matInput placeholder="Since how long working with this employer?" formControlName="how_long">
<input matInput type="number" placeholder="Year" formControlName="how_long_year">
</mat-form-field>
<mat-form-field>
<input matInput type="number" placeholder="Month" formControlName="how_long_month">
</mat-form-field>
</div>
</div>
<mat-form-field>
<mat-select placeholder="Was the employer met?"
formControlName="was_met">
@ -13,9 +22,14 @@
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="employmentForm.controls['was_met'].value == 'yes'">
<input matInput placeholder="Name and Designation of person met" formControlName="name_designation">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none" *ngIf="employmentForm.controls['was_met'].value == 'yes'">
<mat-form-field>
<input matInput placeholder="Name of person met" formControlName="name_person_met">
</mat-form-field>
<mat-form-field>
<input matInput placeholder="Designation of person met" formControlName="designation_person_met">
</mat-form-field>
</div>
<mat-form-field>
<mat-select placeholder="Salary amount confirmed ?"
formControlName="confirm_salary">
@ -46,12 +60,12 @@
</mat-card-header>
<mat-card-content class="matcard">
<mat-form-field>
<input matInput placeholder="Gross" formControlName="gross">
<input matInput placeholder="Gross Monthly Salary" formControlName="gross_monthly_salary">
</mat-form-field>
<mat-form-field>
<input matInput placeholder="Net Take home"
formControlName="net_take_home">
<input matInput placeholder="Net Monthly Salary"
formControlName="net_monthly_salary">
</mat-form-field>
<mat-form-field>
<input matInput placeholder="Bonus or incentive"

View File

@ -48,10 +48,14 @@ export class EmploymentInfoComponent implements OnInit {
console.log('value', value);
if (value.status == 200) {
this.employmentForm.controls['employer_name'].setValue(value.records.employer_name);
this.employmentForm.controls['how_long'].setValue(value.records.how_long);
this.employmentForm.controls['how_long_year'].setValue(value.records.how_long_year);
this.employmentForm.controls['how_long_month'].setValue(value.records.how_long_month);
this.employmentForm.controls['was_met'].setValue(value.records.was_met);
if (value.records.name_designation) {
this.employmentForm.controls['name_designation'].setValue(value.records.name_designation);
if (value.records.name_person_met) {
this.employmentForm.controls['name_person_met'].setValue(value.records.name_person_met);
}
if (value.records.designation_person_met) {
this.employmentForm.controls['designation_person_met'].setValue(value.records.designation_person_met);
}
this.employmentForm.controls['confirm_salary'].setValue(value.records.confirm_salary);
if (value.records.confirm_salary_amount) {
@ -59,8 +63,8 @@ export class EmploymentInfoComponent implements OnInit {
}
this.employmentForm.controls['attendance_seen'].setValue(value.records.attendance_seen);
this.employmentForm.controls['sal_reg_seen'].setValue(value.records.sal_reg_seen);
this.employmentForm.controls['gross'].setValue(value.records.gross);
this.employmentForm.controls['net_take_home'].setValue(value.records.net_take_home);
this.employmentForm.controls['gross_monthly_salary'].setValue(value.records.gross_monthly_salary);
this.employmentForm.controls['net_monthly_salary'].setValue(value.records.net_monthly_salary);
this.employmentForm.controls['bonus_incentive'].setValue(value.records.bonus_incentive);
this.employmentForm.controls['any_delays'].setValue(value.records.any_delays);
this.employmentForm.controls['employment_remarks'].setValue(value.records.employment_remarks);
@ -70,15 +74,17 @@ export class EmploymentInfoComponent implements OnInit {
public initemploymentForm(): void {
this.employmentForm = this.fb.group({
employer_name: ['', Validators.compose([Validators.required])],
how_long: ['', Validators.compose([Validators.required])],
how_long_year: ['', Validators.compose([Validators.required])],
how_long_month: ['', Validators.compose([Validators.required])],
was_met: ['', Validators.compose([Validators.required])],
name_designation: [''],
name_person_met: [''],
designation_person_met: [''],
confirm_salary: ['', Validators.compose([Validators.required])],
confirm_salary_amount: [''],
attendance_seen: ['', Validators.compose([Validators.required])],
sal_reg_seen: ['', Validators.compose([Validators.required])],
gross: ['', Validators.compose([Validators.required])],
net_take_home: ['', Validators.compose([Validators.required])],
gross_monthly_salary: ['', Validators.compose([Validators.required])],
net_monthly_salary: ['', Validators.compose([Validators.required])],
bonus_incentive: ['', Validators.compose([Validators.required])],
any_delays: ['', Validators.compose([Validators.required])],
employment_remarks: ['', Validators.compose([Validators.required])],
@ -93,10 +99,12 @@ export class EmploymentInfoComponent implements OnInit {
records.formid = this.form_id;
records.fk_createdby = this.pdid;
records.employer_name = this.employmentForm.controls['employer_name'].value;
records.how_long = this.employmentForm.controls['how_long'].value;
records.how_long_year = this.employmentForm.controls['how_long_year'].value;
records.how_long_month = this.employmentForm.controls['how_long_month'].value;
records.was_met = this.employmentForm.controls['was_met'].value;
if (this.employmentForm.controls['was_met'].value == 'yes') {
records.name_designation = this.employmentForm.controls['name_designation'].value;
records.name_person_met = this.employmentForm.controls['name_person_met'].value;
records.designation_person_met = this.employmentForm.controls['designation_person_met'].value;
}
records.confirm_salary = this.employmentForm.controls['confirm_salary'].value;
if (this.employmentForm.controls['confirm_salary'].value == 'yes') {
@ -104,8 +112,8 @@ export class EmploymentInfoComponent implements OnInit {
}
records.attendance_seen = this.employmentForm.controls['attendance_seen'].value;
records.sal_reg_seen = this.employmentForm.controls['sal_reg_seen'].value;
records.gross = this.employmentForm.controls['gross'].value;
records.net_take_home = this.employmentForm.controls['net_take_home'].value;
records.gross_monthly_salary = this.employmentForm.controls['gross_monthly_salary'].value;
records.net_monthly_salary = this.employmentForm.controls['net_monthly_salary'].value;
records.bonus_incentive = this.employmentForm.controls['bonus_incentive'].value;
records.any_delays = this.employmentForm.controls['any_delays'].value;
records.employment_remarks = this.employmentForm.controls['employment_remarks'].value;