diff --git a/src/pages/pd-question/pd-question-emp-info/pd-question-emp-info.html b/src/pages/pd-question/pd-question-emp-info/pd-question-emp-info.html index 440fb87c..a25c6f16 100755 --- a/src/pages/pd-question/pd-question-emp-info/pd-question-emp-info.html +++ b/src/pages/pd-question/pd-question-emp-info/pd-question-emp-info.html @@ -167,7 +167,7 @@ + autocomplete="off"> Specify Person Met Required @@ -201,7 +201,7 @@ - +

Attendance register seen ?

@@ -209,6 +209,10 @@ YES NO + Shop and Est Act Cert + is Required + +
@@ -229,7 +233,7 @@
- +
@@ -268,7 +272,7 @@ Paid in Cash Both Bank Transfer & Cash - + Mode of getting salary Required @@ -307,8 +311,9 @@
+ required (keyup)="inWords($event.target.value,3)" (change)="Validategrosssalary()" #grossSalaryFocus> {{"₹"}} {{netMthlySlryAmtInWords}} Only + Given Value is Maximum of Gross Monthly Salary
@@ -400,6 +405,7 @@ NO
+
@@ -431,14 +437,29 @@ -
- +
+
+ +

Office photographs

+
+ + + + Office photographs Required - - - -
+ + + +
+ +
+ +
+
+
diff --git a/src/pages/pd-question/pd-question-emp-info/pd-question-emp-info.ts b/src/pages/pd-question/pd-question-emp-info/pd-question-emp-info.ts index b431560d..a9ed4d4d 100755 --- a/src/pages/pd-question/pd-question-emp-info/pd-question-emp-info.ts +++ b/src/pages/pd-question/pd-question-emp-info/pd-question-emp-info.ts @@ -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 });