SAL Changes done

This commit is contained in:
sriram-at-840620226347 2020-01-08 17:12:02 +05:30
parent 12d9d941e2
commit 7c04f9800f
2 changed files with 98 additions and 13 deletions

View File

@ -167,7 +167,7 @@
</mat-form-field>
<mat-form-field style="width: 100%" *ngIf="employmentForm.value.designation_person_met == '1'">
<input matInput placeholder="Specify Person Met" formControlName="others_person_met"
autocomplete="off" required>
autocomplete="off">
<mat-error *ngIf="employmentForm.controls['designation_person_met'].hasError('required')">
Specify Person Met Required</mat-error>
</mat-form-field>
@ -201,7 +201,7 @@
</div>
</div>
</div>
<div #attendanceSeenScroll></div>
<ion-row *ngIf="pd_cus_segment!='SAL-CHQ'">
<ion-col>
<p>Attendance register seen ?</p>
@ -209,6 +209,10 @@
<mat-radio-button value="yes">YES</mat-radio-button>
<mat-radio-button value="no">NO</mat-radio-button>
</mat-radio-group>
<mat-error style="color:red;font-size:12px;margin:0;padding:0;font-weight: normal;float:right" *ngIf="employmentForm.controls['attendance_seen'].errors?.required ">Shop and Est Act Cert
is Required</mat-error>
<!-- <mat-error *ngIf="employmentForm.controls['office_imgs'].hasError('required')"> -->
<!-- Attendance register seen Required</mat-error> -->
</ion-col>
<ion-col>
<div float-right *ngIf="employmentForm.controls['attendance_seen'].value == 'yes'" style="width: 20%">
@ -229,7 +233,7 @@
</div>
</ion-col>
</ion-row>
<div #salRegSeenScroll></div>
<ion-row *ngIf="pd_cus_segment!='SAL-CHQ'">
<ion-col>
<div class="radio-margin">
@ -268,7 +272,7 @@
<mat-option value="paid_in_cash">Paid in Cash</mat-option>
<mat-option value="both_bank_transfer_cash">Both Bank Transfer & Cash</mat-option>
</mat-select>
<!-- <mat-error *ngIf="employmentForm.controls['mode_of_getting_salary'].hasError('required')">Mode of getting salary Required</mat-error> -->
<mat-error *ngIf="employmentForm.controls['mode_of_getting_salary'].hasError('required')">Mode of getting salary Required</mat-error>
</mat-form-field>
</mat-card>
@ -307,8 +311,9 @@
<div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width: 100%">
<input matInput placeholder="Net Monthly Salary" formControlName="net_monthly_salary" type="number"
required (keyup)="inWords($event.target.value,3)">
required (keyup)="inWords($event.target.value,3)" (change)="Validategrosssalary()" #grossSalaryFocus>
<mat-hint align="end" *ngIf="employmentForm.value.net_monthly_salary != '' && netMthlySlryAmtInWords!=''">{{"&#8377;"}} {{netMthlySlryAmtInWords}} Only</mat-hint>
<mat-error *ngIf="employmentForm.controls.net_monthly_salary.hasError('max')">Given Value is Maximum of Gross Monthly Salary</mat-error>
</mat-form-field>
</div>
@ -400,6 +405,7 @@
<mat-radio-button value="no">NO</mat-radio-button>
</mat-radio-group>
</div>
<div #idCardIssueScroll></div>
<mat-form-field style="width: 80%">
<mat-select placeholder="ID Card issued by the Company seen ?" formControlName="id_card_issued_company"
(selectionChange)="idcardChange($event,1)" required>
@ -431,14 +437,29 @@
</div>
</div>
<div style="width: 100%;">
<ion-col col-10>
<div #officePhotoScroll></div>
<div *ngIf="employmentForm.controls['office_imgs']">
<ion-row style="width: 100%;">
<ion-col col-6>
<p>Office photographs</p>
</ion-col>
<ion-col col-2>
<ion-icon style="margin-top: 16px;" title="Click Here For Office photographs" name="md-camera"
(click)="ImageUpload(4)"></ion-icon>
<mat-error *ngIf="employmentForm.controls['office_imgs'].hasError('required')">
Office photographs Required</mat-error>
</ion-col>
<ion-col col-2>
<button mini ion-fab color="optblue" slot="fixed" (click)="savePhoto(1)"><ion-icon name="md-camera" style="font-size: 24px"></ion-icon></button>
</ion-col>
</div>
</ion-row>
<ion-row style="width: 100%;">
<ion-col col-5>
<div *ngIf="employmentForm.controls['office_imgs'].value !== ''">
<img src="{{employmentForm.controls['office_imgs'].value}}" imageViewer
style="width: 40px;height: 35px;">
</div>
</ion-col>
</ion-row>
</div>
</mat-card-content>
</mat-card>

View File

@ -57,6 +57,7 @@ export class PdQuestionEmpInfoPage {
public todate: any[] = this.dateonly;
@ViewChild('workExp') expFocus: ElementRef
@ViewChild('cashPaidFocus') inputCashPaidFocus :ElementRef
@ViewChild('grossSalaryFocus') inputGrossSalaryFocus :ElementRef
@ViewChild('yearFocus') inputYearFocus :ElementRef
complete_status: boolean = false;
spinner_access:boolean=false;
@ -66,6 +67,10 @@ export class PdQuestionEmpInfoPage {
split_customer_abbr: any;
designationdatalist: any [];
@ViewChild('docsSightedScroll') docsSightedScroll: ElementRef
@ViewChild('attendanceSeenScroll') attendanceSeenScroll: ElementRef
@ViewChild('salRegSeenScroll') salRegSeenScroll: ElementRef
@ViewChild('idCardIssueScroll') idCardIssueScroll: ElementRef
@ViewChild('officePhotoScroll') officePhotoScroll: ElementRef
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,
public qustCat:QuestionCategoryProvider,public aws: AwsServiceProvider,
@ -126,6 +131,7 @@ export class PdQuestionEmpInfoPage {
bonus_type: [''],
bonus_type_other: [''],
id_card_issued_company:[''],
office_imgs:[''],
why_company_id_proof_not_available: [''],
any_delays: [''],
employment_remarks: [''],
@ -223,7 +229,14 @@ this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId.form_id,com
})
}
Validategrosssalary(){
let salary = this.employmentForm.controls['gross_monthly_salary'];
console.log('gross salary checking',salary);
this.employmentForm.controls['net_monthly_salary'].setValidators([Validators.max(salary.value)]);
this.employmentForm.controls['net_monthly_salary'].updateValueAndValidity();
}
ValidateNetSalary(){
let salary = this.employmentForm.controls['net_monthly_salary'].value;
console.log('this.employmentForm.controls[amount_paid_in_cash].value',this.employmentForm.controls['amount_paid_in_cash'].value);
@ -282,6 +295,53 @@ this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId.form_id,com
this.inputCashPaidFocus.nativeElement.focus();
return
}
if(this.employmentForm.controls['net_monthly_salary'].hasError('max')){
this.toast.pdTriggerappmessage("Given Value is Maximum of Gross Monthly Salary")
this.inputGrossSalaryFocus.nativeElement.focus();
return
}
if (this.employmentForm.controls['attendance_seen'].invalid) {
this.toast.pdTriggerappmessage("Attendance Seen is required");
this.attendanceSeenScroll.nativeElement.scrollIntoView({behavior:"smooth",block:"start"})
return;
}
if (this.employmentForm.controls['attendance_seen_pic'] && this.employmentForm.value.attendance_seen == 'yes') {
if (this.employmentForm.controls['attendance_seen_pic'].invalid) {
this.toast.pdTriggerappmessage("Attendance pic is required");
this.attendanceSeenScroll.nativeElement.scrollIntoView({behavior:"smooth",block:"start"})
return;
}
}
if (this.employmentForm.controls['sal_reg_seen'].invalid) {
this.toast.pdTriggerappmessage("Salary register seen is required");
this.salRegSeenScroll.nativeElement.scrollIntoView({behavior:"smooth",block:"start"})
return;
}
if (this.employmentForm.controls['sal_reg_seen_pic'] && this.employmentForm.value.sal_reg_seen == 'yes') {
if (this.employmentForm.controls['sal_reg_seen_pic'].invalid) {
this.toast.pdTriggerappmessage("Salary register seen pic is required");
this.salRegSeenScroll.nativeElement.scrollIntoView({behavior:"smooth",block:"start"})
return;
}
}
if (this.employmentForm.controls['id_card_issued_company'].invalid) {
this.toast.pdTriggerappmessage("ID Card Issued Company is required");
this.idCardIssueScroll.nativeElement.scrollIntoView({behavior:"smooth",block:"start"})
return;
}
if (this.employmentForm.controls['id_card_image'] && this.employmentForm.value.id_card_issued_company == 'yes') {
if (this.employmentForm.controls['id_card_image'].invalid) {
this.toast.pdTriggerappmessage("ID Card issued Image is required");
this.idCardIssueScroll.nativeElement.scrollIntoView({behavior:"smooth",block:"start"})
return;
}
}
if (this.employmentForm.controls['office_imgs'].invalid) {
this.toast.pdTriggerappmessage("Office Photographs is required");
this.officePhotoScroll.nativeElement.scrollIntoView({behavior:"smooth",block:"start"})
return;
}
if (!this.employmentForm.valid) {
this.toast.pdTriggerappmessage('Form Invalid Try Again.!');
@ -369,7 +429,8 @@ this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId.form_id,com
records.bonus_frequency = this.employmentForm.controls['bonus_frequency'].value;
records.bonus_type = this.employmentForm.controls['bonus_type'].value;
records.bonus_type_other = this.employmentForm.controls['bonus_type_other'].value;
records.office_imgs = this.employmentForm.controls['office_imgs'].value;
records.id_card_issued_company = this.employmentForm.controls['id_card_issued_company'].value;
if(records.id_card_issued_company == 'no'){
records.why_company_id_proof_not_available = this.employmentForm.controls['why_company_id_proof_not_available'].value;
@ -391,6 +452,7 @@ this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId.form_id,com
records.hasOwnProperty('id_card_image') && records.id_card_image != '' ? records.id_card_image = 'SAVED' :''
records.hasOwnProperty('attendance_seen_pic') && records.attendance_seen_pic != '' ? records.attendance_seen_pic = 'SAVED' :''
records.hasOwnProperty('sal_reg_seen_pic') && records.sal_reg_seen_pic != '' ? records.sal_reg_seen_pic = 'SAVED' :''
records.hasOwnProperty('office_imgs') && records.sal_reg_seen_pic != '' ? records.office_imgs = 'SAVED' :''
this.qustCat.saveForm(records).subscribe(data => {
@ -625,6 +687,7 @@ inWords(val,flag:number){
this.employmentForm.controls['bonus_frequency'].setValue(Emp.bonus_frequency);
this.employmentForm.controls['bonus_type'].setValue(Emp.bonus_type);
this.employmentForm.controls['bonus_type_other'].setValue(Emp.bonus_type_other);
this.employmentForm.controls['office_imgs'].setValue(Emp.office_imgs);
this.employmentForm.controls['id_card_issued_company'].setValue(Emp.id_card_issued_company);
if(Emp.id_card_issued_company == 'no'){
this.employmentForm.controls['why_company_id_proof_not_available'].setValue(Emp.why_company_id_proof_not_available);
@ -768,6 +831,7 @@ inWords(val,flag:number){
if (Flag == 1) { this.employmentForm.controls.id_card_image.setValue(res != 'error' ? watermarkedImage : ''); img_name="id_card_image"}//alert('Inside Mobile Upload Function' + Flag);}
if (Flag == 2) { this.employmentForm.controls.attendance_seen_pic.setValue(res != 'error' ? watermarkedImage : ''); img_name="attendance_seen_pic"}//alert('Inside Mobile Upload Function' + Flag);}
if (Flag == 3) { this.employmentForm.controls.sal_reg_seen_pic.setValue(res != 'error' ? watermarkedImage : ''); img_name="sal_reg_seen_pic"}//alert('Inside Mobile Upload Function' + Flag);}
if (Flag == 4) { this.employmentForm.controls.office_imgs.setValue(res != 'error' ? watermarkedImage : ''); img_name="office_imgs"}//alert('Inside Mobile Upload Function' + Flag);}
let bucket:any=[]
bucket.push({ 'image': watermarkedImage, 'Name': img_name, 'link': geoCoordinates });