FAIROOJ AI CHANGES
This commit is contained in:
commit
6800fd46fd
File diff suppressed because one or more lines are too long
2038
package-lock.json
generated
2038
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,79 +1,230 @@
|
||||
<ion-header>
|
||||
|
||||
<ion-navbar color="optblue">
|
||||
|
||||
<button ion-button menuToggle>
|
||||
<ion-icon name="menu"></ion-icon>
|
||||
</button>
|
||||
<ion-title *ngIf="!viewchange">Employee Salary Category</ion-title>
|
||||
|
||||
<ion-title *ngIf="!viewchange">Employee Salary Category</ion-title>
|
||||
|
||||
</ion-navbar>
|
||||
|
||||
</ion-header>
|
||||
|
||||
<ion-content padding>
|
||||
<form [formGroup]="empInfo">
|
||||
<form [formGroup]="employmentForm">
|
||||
<mat-card>
|
||||
|
||||
<div fxLayout="column" fxLayoutAlign="start stretch">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Name Of Emp" type="text" name="nameOfEmp" formControlName="nameOfEmp">
|
||||
<!-- <mat-error *ngIf="pdforms.controls['lenAppID'].hasError('required')">Applicant ID Required</mat-error> -->
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:100%">
|
||||
<mat-select placeholder="Name of Employer" formControlName="employer_name">
|
||||
<mat-option *ngFor="let cl of company_list" [value]="cl.company_order_id+'-'+cl.company_name">{{
|
||||
cl.company_name }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxLayout="column" fxLayoutAlign="start stretch">
|
||||
<mat-form-field style="width: 100%">
|
||||
<!-- <mat-label>How many yrs with this emp</mat-label> -->
|
||||
<input matInput placeholder="How many yrs with this emp" type="text" name="yearWithEmp" formControlName="yearWithEmp">
|
||||
<!-- <mat-error *ngIf="pdforms.controls['lenAppID'].hasError('required')">Applicant ID Required</mat-error> -->
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<mat-list>
|
||||
<p mat-subheader>Emp Met</p>
|
||||
<mat-radio-group name="empMet" formControlName="empMet">
|
||||
<mat-radio-button value="YES">YES</mat-radio-button>
|
||||
<mat-radio-button value="NO">NO</mat-radio-button>
|
||||
</mat-radio-group>
|
||||
</mat-list>
|
||||
|
||||
|
||||
|
||||
<div fxLayout="column" fxLayoutAlign="start stretch">
|
||||
<mat-form-field style="width: 100%">
|
||||
<!-- <mat-label>How many yrs with this emp</mat-label> -->
|
||||
<input matInput placeholder="Name and Designation of person met" type="text" name="designationOfEmp" formControlName="designationOfEmp">
|
||||
<!-- <mat-error *ngIf="pdforms.controls['lenAppID'].hasError('required')">Applicant ID Required</mat-error> -->
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<mat-list>
|
||||
<p mat-subheader>Salary amt confirmed</p>
|
||||
<mat-radio-group name="salaryConfirm" formControlName="salaryConfirm">
|
||||
<mat-radio-button value="YES">YES</mat-radio-button>
|
||||
<mat-radio-button value="NO">NO</mat-radio-button>
|
||||
</mat-radio-group>
|
||||
</mat-list>
|
||||
|
||||
<div fxLayout="column" fxLayoutAlign="start stretch">
|
||||
<mat-form-field style="width: 100%">
|
||||
<!-- <mat-label>How many yrs with this emp</mat-label> -->
|
||||
<input matInput placeholder="What is the salary amt confirmed" type="text" name="actualSalary" formControlName="actualSalary">
|
||||
<!-- <mat-error *ngIf="pdforms.controls['lenAppID'].hasError('required')">Applicant ID Required</mat-error> -->
|
||||
<mat-label>How many yrs with this emp</mat-label>
|
||||
<div fxLayout="column" fxLayoutAlign="start stretch">
|
||||
<mat-form-field style="width: 48%">
|
||||
<input matInput type="text" formControlName="how_long_year" autocomplete="off" placeholder="Year" min='0'>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 48%">
|
||||
<input matInput type="text" placeholder="Month" formControlName="how_long_month" min='0' (change)="ConvertMonthintoYear($event.target.value)">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<mat-list>
|
||||
<p mat-subheader>Attendance Register seen</p>
|
||||
<mat-radio-group name="attRegisterSeen" formControlName="attRegisterSeen">
|
||||
<mat-radio-button value="YES">YES</mat-radio-button>
|
||||
<mat-radio-button value="NO">NO</mat-radio-button>
|
||||
</mat-radio-group>
|
||||
</mat-list>
|
||||
|
||||
<mat-list>
|
||||
<P mat-subheader>Salary register seen</P>
|
||||
<mat-radio-group name="salaryRegisterSeen" formControlName="salaryRegisterSeen">
|
||||
<mat-radio-button value="YES">YES</mat-radio-button>
|
||||
<mat-radio-button value="NO">NO</mat-radio-button>
|
||||
<div *ngIf="pd_cus_segment!='SAL-CHQ'">
|
||||
<p>Emp Met</p>
|
||||
<mat-radio-group name="was_met" formControlName="was_met"><!-- //(change)="checkotherDetails($event.value)" -->
|
||||
<mat-radio-button value="yes">YES</mat-radio-button>
|
||||
<mat-radio-button value="no">NO</mat-radio-button>
|
||||
</mat-radio-group>
|
||||
<!-- *ngIf="otherIncomeForm.controls.other_income.value == 'Yes'" -->
|
||||
|
||||
|
||||
<div *ngIf="employmentForm.controls.was_met.value == 'yes'">
|
||||
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="pd_cus_segment!='SAL-CHQ'">
|
||||
<mat-form-field style="width: 100%">
|
||||
<mat-select placeholder="Name of Person Met" formControlName="name_person_met"
|
||||
required (selectionChange)="filtercompanyrelationship(employmentForm.controls.employer_name.value,$event.value)">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let person of person_met_list" [value]="person.pd_co_applicant_id">
|
||||
{{person.applicant_name | titlecase}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="pd_cus_segment!='SAL-CHQ'">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Designation of Person Met" formControlName="designation_person_met"
|
||||
required>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="pd_cus_segment!='SAL-CHQ'">
|
||||
<p>Salary amt confirmed</p>
|
||||
<mat-radio-group formControlName="confirm_salary">
|
||||
<mat-radio-button value="yes">YES</mat-radio-button>
|
||||
<mat-radio-button value="no">NO</mat-radio-button>
|
||||
</mat-radio-group>
|
||||
|
||||
|
||||
<div *ngIf="employmentForm.controls.confirm_salary.value == 'yes'">
|
||||
<div fxLayout="column" fxLayoutAlign="start stretch">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="What is the salary amount confirmed?" formControlName="confirm_salary_amount"
|
||||
OnlyNumber (keyup)="inWords($event.target.value,1)">
|
||||
<mat-hint align="end" *ngIf="employmentForm.controls.confirm_salary_amount.value != ''">{{"₹"}} {{mthlySlryAmtInWords}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div fxLayout="column" fxLayoutAlign="start stretch">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Total Work Experience" formControlName="total_business_experience"
|
||||
OnlyNumber autocomplete="off">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="employmentForm.controls['total_business_experience'].value > employmentForm.controls['how_long_year'].value">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Previous Work Experience Details" formControlName="total_business_previous_experience">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="pd_cus_segment!='SAL-CHQ'">
|
||||
<p>Attendance Register seen</p>
|
||||
<mat-radio-group name="attendance_seen" formControlName="attendance_seen">
|
||||
<mat-radio-button value="yes">YES</mat-radio-button>
|
||||
<mat-radio-button value="no">NO</mat-radio-button>
|
||||
</mat-radio-group>
|
||||
</div>
|
||||
|
||||
<div *ngIf="pd_cus_segment!='SAL-CHQ'">
|
||||
<P >Salary register seen</P>
|
||||
<mat-radio-group name="sal_reg_seen" formControlName="sal_reg_seen">
|
||||
<mat-radio-button value="yes">YES</mat-radio-button>
|
||||
<mat-radio-button value="no">NO</mat-radio-button>
|
||||
</mat-radio-group>
|
||||
</mat-list>
|
||||
</div>
|
||||
|
||||
</mat-card>
|
||||
|
||||
<mat-card>
|
||||
<h5>Salary Details</h5>
|
||||
<mat-card-content>
|
||||
<div fxLayout="column" fxLayoutAlign="start stretch">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="From Date of Salary" formControlName="from_date_the_salary_is_rcv"
|
||||
OnlyNumber type="number" min='1' max='31'>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxLayout="column" fxLayoutAlign="start stretch">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="To Date of Salary" formControlName="to_date_the_salary_is_rcv"
|
||||
OnlyNumber type="number" min='1' max='31'>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div fxLayout="column" fxLayoutAlign="start stretch">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Gross Monthly Salary" formControlName="gross_monthly_salary"
|
||||
OnlyNumber required (keyup)="inWords($event.target.value,2)">
|
||||
<mat-hint align="end" *ngIf="employmentForm.controls.gross_monthly_salary.value != ''">{{"₹"}} {{grossMthlySlryAmtInWords}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxLayout="column" fxLayoutAlign="start stretch">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Net Monthly Salary" formControlName="net_monthly_salary"
|
||||
OnlyNumber required (keyup)="inWords($event.target.value,3)">
|
||||
<mat-hint align="end" *ngIf="employmentForm.controls.net_monthly_salary.value != ''">{{"₹"}} {{netMthlySlryAmtInWords}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxLayout="column" fxLayoutAlign="start stretch">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Bonus or Incentive" formControlName="bonus_incentive"
|
||||
OnlyNumber required (keyup)="inWords($event.target.value,4)">
|
||||
<mat-hint align="end" *ngIf="employmentForm.controls.bonus_incentive.value != ''">{{"₹"}} {{bonusIncentiveAmtInWords}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div fxLayout="column" fxLayoutAlign="start stretch">
|
||||
<mat-form-field style="width: 100%">
|
||||
<mat-select placeholder="Amount paid in Cash ?" formControlName="amount_paid_in_cash">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option value="validated">Validated</mat-option>
|
||||
<mat-option value="not validated">Not Validated</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="employmentForm.controls['amount_paid_in_cash'].value == 'validated'">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="How was it Validated" formControlName="how_was_it_validated">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="employmentForm.controls['amount_paid_in_cash'].value == 'not validated'">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Why was it not Validated"
|
||||
formControlName="why_was_it_not_validated">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div fxLayout="column" fxLayoutAlign="start stretch">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Amount paid through Bank"
|
||||
formControlName="amount_paid_through_bank">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="employmentForm.controls['bonus_incentive'].value != '' && employmentForm.controls['bonus_incentive'].value != '0' ">
|
||||
<mat-form-field style="width: 100%">
|
||||
<mat-select placeholder="Bonus Frequency" formControlName="bonus_frequency">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let fd of frequency_data" [value]="fd.frequency_id">{{
|
||||
fd.name }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="employmentForm.controls['bonus_incentive'].value != '' && employmentForm.controls['bonus_incentive'].value != '0' ">
|
||||
<mat-form-field style="width: 100%">
|
||||
<mat-select placeholder="Type of Bonus" formControlName="bonus_type">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option value="fixed">Fixed</mat-option>
|
||||
<mat-option value="variable depending on performance">Variable
|
||||
depending on performance</mat-option>
|
||||
<mat-option value="others">Others</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="employmentForm.controls['bonus_type'].value == 'others'">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Bonus Type Others" formControlName="bonus_type_other">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<P>Any Delays</P>
|
||||
<mat-radio-group name="any_delays" formControlName="any_delays">
|
||||
<mat-radio-button value="yes">YES</mat-radio-button>
|
||||
<mat-radio-button value="no">NO</mat-radio-button>
|
||||
</mat-radio-group>
|
||||
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
|
||||
<ion-row>
|
||||
<button ion-button full color="optblue" (click)="saveEmpInfo()"> Save</button>
|
||||
</ion-row>
|
||||
|
||||
</form>
|
||||
</ion-content>
|
||||
@ -1,3 +1,16 @@
|
||||
page-pd-question-emp-info {
|
||||
|
||||
mat-hint{
|
||||
font-size:11px;
|
||||
}
|
||||
mat-card{
|
||||
margin-bottom: 15px;
|
||||
border-radius: 10px !important;
|
||||
box-shadow: 0 16px 38px -12px rgba(0, 0, 0, 0.56), 0 4px 25px 0 rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.2) !important;
|
||||
}
|
||||
.mat-card-content{
|
||||
margin-bottom: 0px !important;
|
||||
}
|
||||
.scroll-content{
|
||||
background-color: #eee;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { IonicPage, NavController, NavParams } from 'ionic-angular';
|
||||
import {FormBuilder,FormControl,FormArray, FormGroup} from '@angular/forms';
|
||||
|
||||
import { QuestionCategoryProvider } from '../../../providers/question-category/question-category';
|
||||
import { AwsServiceProvider } from '../../../providers/aws-service/aws-service';
|
||||
import { ToastProvider } from '../../../providers/common-provider/toast';
|
||||
import { ConstantsProvider } from '../../../providers/constants/constants';
|
||||
/**
|
||||
* Generated class for the PdQuestionEmpInfoPage page.
|
||||
*
|
||||
@ -17,22 +20,72 @@ import {FormBuilder,FormControl,FormArray, FormGroup} from '@angular/forms';
|
||||
export class PdQuestionEmpInfoPage {
|
||||
questionDetails: any;
|
||||
pdDetails: any;
|
||||
empInfo:FormGroup;
|
||||
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder) {
|
||||
employmentForm:FormGroup;
|
||||
FormId: any;
|
||||
pd_cus_segment: string;
|
||||
customer_segment_abbr: string;
|
||||
users: any;
|
||||
pdid: any;
|
||||
frequency_data: any[];
|
||||
company_list: any[];
|
||||
person_met_list: any[];
|
||||
company_related_applicants_list: any[];
|
||||
company_relationship_list: any[];
|
||||
filtered_company_relationship_list: any[];
|
||||
|
||||
mthlySlryAmtInWords
|
||||
grossMthlySlryAmtInWords
|
||||
netMthlySlryAmtInWords
|
||||
bonusIncentiveAmtInWords
|
||||
|
||||
|
||||
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,public qustCat:QuestionCategoryProvider,public aws: AwsServiceProvider, public toast: ToastProvider,public constant:ConstantsProvider) {
|
||||
this.FormId = this.navParams.get('FormId');
|
||||
this.questionDetails = this.navParams.get('questionDetails');
|
||||
this.pdDetails = this.navParams.get('pdDetails');
|
||||
|
||||
this.empInfo = this.fb.group(
|
||||
this.users = this.aws.getlocale();
|
||||
this.pdid=this.pdDetails.pd_id;
|
||||
this.customer_segment_abbr = this.pdDetails.customer_segment_abbr;
|
||||
this.pd_cus_segment = this.pdDetails.customer_segment_abbr.toUpperCase();
|
||||
this.getDropDownList();
|
||||
this.getCompanyFromGeneralDetails();
|
||||
this.getEmploymentDetails();
|
||||
this.employmentForm = this.fb.group(
|
||||
{
|
||||
nameOfEmp:[null],
|
||||
yearWithEmp:[null],
|
||||
empMet:[null],
|
||||
designationOfEmp:[null],
|
||||
salaryConfirm:[null],
|
||||
actualSalary:[null],
|
||||
attRegisterSeen:[null],
|
||||
salaryRegisterSeen:[null]
|
||||
employer_name: [''],
|
||||
how_long_year: [''],
|
||||
how_long_month: [''],
|
||||
was_met: [this.pd_cus_segment == 'SAL-CHQ' ? 'No' : ''],
|
||||
name_person_met: [''],
|
||||
designation_person_met: [''],
|
||||
confirm_salary: [this.pd_cus_segment == 'SAL-CHQ' ? 'No' : ''],
|
||||
confirm_salary_amount: [''],
|
||||
total_business_experience: [''],
|
||||
total_business_previous_experience: [''],
|
||||
attendance_seen: [this.pd_cus_segment == 'SAL-CHQ' ? 'No' : ''],
|
||||
sal_reg_seen: [this.pd_cus_segment == 'SAL-CHQ' ? 'No' : ''],
|
||||
from_date_the_salary_is_rcv: [''],
|
||||
to_date_the_salary_is_rcv: [''],
|
||||
gross_monthly_salary: [''],
|
||||
net_monthly_salary: [''],
|
||||
bonus_incentive: [''],
|
||||
amount_paid_in_cash: [''],
|
||||
how_was_it_validated: [''],
|
||||
why_was_it_not_validated: [''],
|
||||
amount_paid_through_bank: [''],
|
||||
bonus_frequency: [''],
|
||||
bonus_type: [''],
|
||||
bonus_type_other: [''],
|
||||
any_delays: [''],
|
||||
employment_remarks: [''],
|
||||
// nameOfEmp:[null],
|
||||
// yearWithEmp:[null],
|
||||
// empMet:[null],
|
||||
// designationOfEmp:[null],
|
||||
// salaryConfirm:[null],
|
||||
// actualSalary:[null],
|
||||
// attRegisterSeen:[null],
|
||||
// salaryRegisterSeen:[null]
|
||||
})
|
||||
}
|
||||
|
||||
@ -40,6 +93,199 @@ export class PdQuestionEmpInfoPage {
|
||||
console.log('ionViewDidLoad PdQuestionEmpInfoPage');
|
||||
}
|
||||
|
||||
getDropDownList()
|
||||
{
|
||||
|
||||
this.qustCat.getcommondrop('FREQUENCY').subscribe(
|
||||
data => {
|
||||
if(data['dataStatus']==true){
|
||||
this.frequency_data = data['records'];
|
||||
this.frequency_data = this.frequency_data.filter(freq => freq.isactive == 1);
|
||||
}
|
||||
});
|
||||
|
||||
this.qustCat.getcommondrop('COMPANYRELATIONSHIPS').subscribe(
|
||||
data => {
|
||||
if(data['dataStatus']==true){
|
||||
this.company_relationship_list = data['records'].filter(item => item.isactive == 1);
|
||||
this.company_relationship_list = data['records'].filter(item => item.name != 'Others');
|
||||
this.company_relationship_list.push({ 'company_relationship_id': 0, 'name': 'Not Applicable' });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
getCompanyFromGeneralDetails(){
|
||||
|
||||
let records = { 'pd_id': this.pdDetails.pd_id, 'pd_form_id': '18' };
|
||||
|
||||
this.qustCat.retiverForm(records).subscribe(value => {
|
||||
if (value['dataStatus'] == true) {
|
||||
this.company_list = value['records'].companies.filter(com => com.is_active == true);
|
||||
this.person_met_list = value['records'].individuals.filter(app => app.is_person_met == true && app.is_active == true);
|
||||
this.company_related_applicants_list = value['records'].company_with_relationships;
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
saveEmpInfo(){
|
||||
if (!this.employmentForm.valid) {
|
||||
this.toast.pdTriggerappmessage('Form Invalid Try Again.!');
|
||||
return;
|
||||
}
|
||||
|
||||
let records: any = {};
|
||||
records.pdid = this.pdDetails.pd_id;
|
||||
records.formid = this.FormId.form_id;
|
||||
records.fk_createdby = this.users;
|
||||
records.employer_name = this.employmentForm.controls['employer_name'].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_person_met = this.employmentForm.controls['name_person_met'].value;
|
||||
records.designation_person_met = this.employmentForm.controls['designation_person_met'].value;
|
||||
}else{
|
||||
records.name_person_met = '';
|
||||
records.designation_person_met = '';
|
||||
}
|
||||
records.confirm_salary = this.employmentForm.controls['confirm_salary'].value;
|
||||
if (this.employmentForm.controls['confirm_salary'].value == 'yes') {
|
||||
records.confirm_salary_amount = this.employmentForm.controls['confirm_salary_amount'].value;
|
||||
records.total_business_experience = this.employmentForm.controls['total_business_experience'].value;
|
||||
records.total_business_previous_experience = this.employmentForm.controls['total_business_previous_experience'].value;
|
||||
}
|
||||
else{
|
||||
records.confirm_salary_amount = '';
|
||||
records.total_business_experience = '';
|
||||
records.total_business_previous_experience = '';
|
||||
}
|
||||
records.attendance_seen = this.employmentForm.controls['attendance_seen'].value;
|
||||
records.sal_reg_seen = this.employmentForm.controls['sal_reg_seen'].value;
|
||||
records.from_date_the_salary_is_rcv = this.employmentForm.controls['from_date_the_salary_is_rcv'].value;
|
||||
records.to_date_the_salary_is_rcv = this.employmentForm.controls['to_date_the_salary_is_rcv'].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.amount_paid_in_cash = this.employmentForm.controls['amount_paid_in_cash'].value;
|
||||
records.how_was_it_validated = this.employmentForm.controls['how_was_it_validated'].value;
|
||||
records.why_was_it_not_validated = this.employmentForm.controls['why_was_it_not_validated'].value;
|
||||
records.amount_paid_through_bank = this.employmentForm.controls['amount_paid_through_bank'].value;
|
||||
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.any_delays = this.employmentForm.controls['any_delays'].value;
|
||||
records.employment_remarks = this.employmentForm.controls['employment_remarks'].value;
|
||||
|
||||
this.qustCat.saveForm(records).subscribe(data => {
|
||||
|
||||
|
||||
if(data['dataStatus']== true){
|
||||
this.toast.pdTriggerappmessage('Record Saved Successfully.!');
|
||||
setTimeout(()=>{
|
||||
this.navCtrl.pop();
|
||||
},2000);
|
||||
}
|
||||
else {
|
||||
this.toast.pdTriggerappmessage('Something Wents Wrong Try Again.!');
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
filtercompanyrelationship(companyid, applicantid) {
|
||||
var array = companyid.split("-");
|
||||
let data = this.company_related_applicants_list.filter(cmpy => cmpy.relation_to_company == array[0] && cmpy.applicant_name == applicantid);
|
||||
if (data.length > 0) {
|
||||
this.filtered_company_relationship_list = this.company_relationship_list.filter(freq => freq.company_relationship_id == data[0].company_relationship);
|
||||
this.employmentForm.controls['designation_person_met'].setValue(this.filtered_company_relationship_list[0]['name'] + ' ' + array[1]);
|
||||
}
|
||||
else {
|
||||
this.employmentForm.controls['designation_person_met'].setValue('');
|
||||
}
|
||||
}
|
||||
|
||||
ConvertMonthintoYear(e) {
|
||||
|
||||
let how_long_year = this.employmentForm.controls.how_long_year.value;
|
||||
|
||||
let converted_month: number = e % 12;
|
||||
let converted_year: number = e / 12;
|
||||
|
||||
this.employmentForm.controls.how_long_year.setValue(+how_long_year + +Math.floor(converted_year));
|
||||
this.employmentForm.controls.how_long_month.setValue(Math.floor(converted_month));
|
||||
|
||||
}
|
||||
|
||||
inWords(val,flag:number){
|
||||
switch(flag){
|
||||
case 1 :
|
||||
this.mthlySlryAmtInWords= this.constant.convertNumberToWords(val);
|
||||
break;
|
||||
case 2 :
|
||||
this.grossMthlySlryAmtInWords = this.constant.convertNumberToWords(val);
|
||||
break;
|
||||
case 3 :
|
||||
this.netMthlySlryAmtInWords = this.constant.convertNumberToWords(val);
|
||||
break;
|
||||
case 4 :
|
||||
this.bonusIncentiveAmtInWords = this.constant.convertNumberToWords(val);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
getEmploymentDetails(){
|
||||
|
||||
let records = { 'pd_id': this.pdDetails.pd_id, 'pd_form_id': this.FormId.form_id };
|
||||
|
||||
this.qustCat.retiverForm(records).subscribe(value => {
|
||||
if (value['dataStatus'] == true) {
|
||||
let Emp = value['records'];
|
||||
console.log('emp',Emp);
|
||||
this.employmentForm.controls['employer_name'].setValue(Emp.employer_name);
|
||||
this.employmentForm.controls['how_long_year'].setValue(Emp.how_long_year);
|
||||
this.employmentForm.controls['how_long_month'].setValue(Emp.how_long_month);
|
||||
this.employmentForm.controls['was_met'].setValue(Emp.was_met);
|
||||
if (Emp.name_person_met) {
|
||||
this.employmentForm.controls['name_person_met'].setValue(Emp.name_person_met);
|
||||
}
|
||||
if (Emp.designation_person_met) {
|
||||
this.employmentForm.controls['designation_person_met'].setValue(Emp.designation_person_met);
|
||||
}
|
||||
this.employmentForm.controls['confirm_salary'].setValue(Emp.confirm_salary);
|
||||
console.log('Emp.confirm_salary_amount',Emp.confirm_salary_amount,Emp.confirm_salary);
|
||||
if (Emp.confirm_salary) {
|
||||
this.employmentForm.controls['confirm_salary_amount'].setValue(Emp.confirm_salary_amount);
|
||||
this.inWords(Emp.confirm_salary_amount,1);
|
||||
this.employmentForm.controls['total_business_experience'].setValue(Emp.total_business_experience);
|
||||
this.employmentForm.controls['total_business_previous_experience'].setValue(Emp.total_business_previous_experience);
|
||||
}
|
||||
this.employmentForm.controls['attendance_seen'].setValue(Emp.attendance_seen);
|
||||
this.employmentForm.controls['sal_reg_seen'].setValue(Emp.sal_reg_seen);
|
||||
this.employmentForm.controls['from_date_the_salary_is_rcv'].setValue(Emp.from_date_the_salary_is_rcv);
|
||||
this.employmentForm.controls['to_date_the_salary_is_rcv'].setValue(Emp.to_date_the_salary_is_rcv);
|
||||
this.employmentForm.controls['gross_monthly_salary'].setValue(Emp.gross_monthly_salary);
|
||||
this.employmentForm.controls['net_monthly_salary'].setValue(Emp.net_monthly_salary);
|
||||
this.employmentForm.controls['bonus_incentive'].setValue(Emp.bonus_incentive);
|
||||
this.employmentForm.controls['amount_paid_in_cash'].setValue(Emp.amount_paid_in_cash);
|
||||
this.employmentForm.controls['how_was_it_validated'].setValue(Emp.how_was_it_validated);
|
||||
this.employmentForm.controls['why_was_it_not_validated'].setValue(Emp.why_was_it_not_validated);
|
||||
this.employmentForm.controls['amount_paid_through_bank'].setValue(Emp.amount_paid_through_bank);
|
||||
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['any_delays'].setValue(Emp.any_delays);
|
||||
this.employmentForm.controls['employment_remarks'].setValue(Emp.employment_remarks);
|
||||
|
||||
this.inWords(Emp.gross_monthly_salary,2);
|
||||
this.inWords(Emp.net_monthly_salary,3);
|
||||
this.inWords(Emp.bonus_incentive,4);
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -824,6 +824,7 @@ getDateObjects(values: any, controlIndex) {
|
||||
}
|
||||
|
||||
}
|
||||
temp: number = 0;
|
||||
submitData(answerData)
|
||||
{
|
||||
|
||||
@ -855,6 +856,25 @@ getDateObjects(values: any, controlIndex) {
|
||||
})
|
||||
}
|
||||
|
||||
if (valuesData_indi.length > 0) {
|
||||
|
||||
valuesData_indi.forEach((val, index) => {
|
||||
|
||||
if (val.is_person_met == false) {
|
||||
|
||||
this.temp++;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
if (this.temp == valuesData_indi.length) {
|
||||
this.toast.pdTriggerappmessage('Please Choose Name of Person Met.!');
|
||||
this.temp = 0;
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
saveRecords.individuals=valuesData_indi;
|
||||
saveRecords.companies=valuesData
|
||||
saveRecords.pdid=answerData.pdid;
|
||||
|
||||
@ -29571,6 +29571,25 @@ page-pd-question-current-loans .mat-card-content {
|
||||
margin-bottom: 0px !important;
|
||||
}
|
||||
|
||||
page-pd-question-emp-info mat-hint {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
page-pd-question-emp-info mat-card {
|
||||
margin-bottom: 15px;
|
||||
border-radius: 10px !important;
|
||||
-webkit-box-shadow: 0 16px 38px -12px rgba(0, 0, 0, 0.56), 0 4px 25px 0 rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.2) !important;
|
||||
box-shadow: 0 16px 38px -12px rgba(0, 0, 0, 0.56), 0 4px 25px 0 rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.2) !important;
|
||||
}
|
||||
|
||||
page-pd-question-emp-info .mat-card-content {
|
||||
margin-bottom: 0px !important;
|
||||
}
|
||||
|
||||
page-pd-question-emp-info .scroll-content {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
page-pd-question-family mat-form-field {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -84392,6 +84392,7 @@ var Geolocation = (function (_super) {
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(5);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__image_viewer__ = __webpack_require__(400);
|
||||
<<<<<<< HEAD
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__image_viewer_component__ = __webpack_require__(207);
|
||||
var __assign = (this && this.__assign) || Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
@ -84448,6 +84449,64 @@ var ImageViewerController = (function () {
|
||||
return ImageViewerController;
|
||||
}());
|
||||
|
||||
=======
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__image_viewer_component__ = __webpack_require__(206);
|
||||
var __assign = (this && this.__assign) || Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var ImageViewerController = (function () {
|
||||
function ImageViewerController(_app, config, deepLinker) {
|
||||
this._app = _app;
|
||||
this.config = config;
|
||||
this.deepLinker = deepLinker;
|
||||
}
|
||||
/**
|
||||
* Create a image-viewer instance to display. See below for options.
|
||||
*
|
||||
* @param {object} imageElement The image element
|
||||
* @param {object} opts ImageViewer options
|
||||
*/
|
||||
/**
|
||||
* Create a image-viewer instance to display. See below for options.
|
||||
*
|
||||
* @param {object} imageElement The image element
|
||||
* @param {object} opts ImageViewer options
|
||||
*/
|
||||
ImageViewerController.prototype.create = /**
|
||||
* Create a image-viewer instance to display. See below for options.
|
||||
*
|
||||
* @param {object} imageElement The image element
|
||||
* @param {object} opts ImageViewer options
|
||||
*/
|
||||
function (imageElement, opts) {
|
||||
if (opts === void 0) { opts = {}; }
|
||||
var image = imageElement.src;
|
||||
var position = imageElement.getBoundingClientRect();
|
||||
var options = __assign({ image: image, position: position }, opts);
|
||||
return new __WEBPACK_IMPORTED_MODULE_2__image_viewer__["a" /* ImageViewer */](this._app, __WEBPACK_IMPORTED_MODULE_3__image_viewer_component__["a" /* ImageViewerComponent */], options, this.config, this.deepLinker);
|
||||
};
|
||||
ImageViewerController.decorators = [
|
||||
{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["B" /* Injectable */] },
|
||||
];
|
||||
/** @nocollapse */
|
||||
ImageViewerController.ctorParameters = function () { return [
|
||||
{ type: __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["c" /* App */], },
|
||||
{ type: __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["d" /* Config */], },
|
||||
{ type: __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["f" /* DeepLinker */], },
|
||||
]; };
|
||||
return ImageViewerController;
|
||||
}());
|
||||
|
||||
>>>>>>> 92c96afbb0bc945d81513ecd7a4105d7d089977a
|
||||
//# sourceMappingURL=image-viewer.controller.js.map
|
||||
|
||||
/***/ }),
|
||||
@ -115369,6 +115428,7 @@ var FingerprintAIO = (function (_super) {
|
||||
"use strict";
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ImageViewerDirective; });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
|
||||
<<<<<<< HEAD
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__image_viewer_controller__ = __webpack_require__(206);
|
||||
|
||||
|
||||
@ -115404,6 +115464,43 @@ var ImageViewerDirective = (function () {
|
||||
return ImageViewerDirective;
|
||||
}());
|
||||
|
||||
=======
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__image_viewer_controller__ = __webpack_require__(205);
|
||||
|
||||
|
||||
var ImageViewerDirective = (function () {
|
||||
function ImageViewerDirective(_el, imageViewerCtrl) {
|
||||
this._el = _el;
|
||||
this.imageViewerCtrl = imageViewerCtrl;
|
||||
this.close = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["w" /* EventEmitter */]();
|
||||
}
|
||||
ImageViewerDirective.prototype.onClick = function (event) {
|
||||
var _this = this;
|
||||
event.stopPropagation();
|
||||
var element = this._el.nativeElement;
|
||||
var onCloseCallback = function () { return _this.close.emit(); };
|
||||
var imageViewer = this.imageViewerCtrl.create(element, { fullResImage: this.src, onCloseCallback: onCloseCallback });
|
||||
imageViewer.present();
|
||||
};
|
||||
ImageViewerDirective.decorators = [
|
||||
{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
|
||||
selector: '[imageViewer]'
|
||||
},] },
|
||||
];
|
||||
/** @nocollapse */
|
||||
ImageViewerDirective.ctorParameters = function () { return [
|
||||
{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
|
||||
{ type: __WEBPACK_IMPORTED_MODULE_1__image_viewer_controller__["a" /* ImageViewerController */], },
|
||||
]; };
|
||||
ImageViewerDirective.propDecorators = {
|
||||
"src": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["E" /* Input */], args: ['imageViewer',] },],
|
||||
"close": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["P" /* Output */] },],
|
||||
"onClick": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["z" /* HostListener */], args: ['click', ['$event'],] },],
|
||||
};
|
||||
return ImageViewerDirective;
|
||||
}());
|
||||
|
||||
>>>>>>> 92c96afbb0bc945d81513ecd7a4105d7d089977a
|
||||
//# sourceMappingURL=image-viewer.directive.js.map
|
||||
|
||||
/***/ }),
|
||||
@ -198238,6 +198335,7 @@ function supportsWebAnimations() {
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(5);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__image_viewer_directive__ = __webpack_require__(399);
|
||||
<<<<<<< HEAD
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__image_viewer_component__ = __webpack_require__(207);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__image_viewer_controller__ = __webpack_require__(206);
|
||||
|
||||
@ -198265,6 +198363,35 @@ var IonicImageViewerModule = (function () {
|
||||
return IonicImageViewerModule;
|
||||
}());
|
||||
|
||||
=======
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__image_viewer_component__ = __webpack_require__(206);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__image_viewer_controller__ = __webpack_require__(205);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var IonicImageViewerModule = (function () {
|
||||
function IonicImageViewerModule() {
|
||||
}
|
||||
IonicImageViewerModule.decorators = [
|
||||
{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["J" /* NgModule */], args: [{
|
||||
imports: [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["m" /* IonicModule */]],
|
||||
declarations: [
|
||||
__WEBPACK_IMPORTED_MODULE_3__image_viewer_component__["a" /* ImageViewerComponent */],
|
||||
__WEBPACK_IMPORTED_MODULE_2__image_viewer_directive__["a" /* ImageViewerDirective */]
|
||||
],
|
||||
providers: [__WEBPACK_IMPORTED_MODULE_4__image_viewer_controller__["a" /* ImageViewerController */]],
|
||||
exports: [__WEBPACK_IMPORTED_MODULE_2__image_viewer_directive__["a" /* ImageViewerDirective */]],
|
||||
entryComponents: [__WEBPACK_IMPORTED_MODULE_3__image_viewer_component__["a" /* ImageViewerComponent */]]
|
||||
},] },
|
||||
];
|
||||
/** @nocollapse */
|
||||
IonicImageViewerModule.ctorParameters = function () { return []; };
|
||||
return IonicImageViewerModule;
|
||||
}());
|
||||
|
||||
>>>>>>> 92c96afbb0bc945d81513ecd7a4105d7d089977a
|
||||
//# sourceMappingURL=module.js.map
|
||||
|
||||
/***/ }),
|
||||
@ -198571,6 +198698,7 @@ var ImageViewerTransitionGesture = (function (_super) {
|
||||
"use strict";
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ImageViewerZoomGesture; });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_ionic_angular__ = __webpack_require__(5);
|
||||
<<<<<<< HEAD
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular_gestures_hammer__ = __webpack_require__(326);
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
@ -198688,6 +198816,125 @@ var ImageViewerZoomGesture = (function (_super) {
|
||||
return ImageViewerZoomGesture;
|
||||
}(__WEBPACK_IMPORTED_MODULE_0_ionic_angular__["h" /* Gesture */]));
|
||||
|
||||
=======
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular_gestures_hammer__ = __webpack_require__(325);
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
|
||||
|
||||
var MAX_SCALE = 3;
|
||||
var ImageViewerZoomGesture = (function (_super) {
|
||||
__extends(ImageViewerZoomGesture, _super);
|
||||
function ImageViewerZoomGesture(component, element, platform, renderer) {
|
||||
var _this = _super.call(this, element.nativeElement) || this;
|
||||
_this.component = component;
|
||||
_this.platform = platform;
|
||||
_this.renderer = renderer;
|
||||
_this.adjustScale = 1;
|
||||
_this.adjustDeltaX = 0;
|
||||
_this.adjustDeltaY = 0;
|
||||
_this.currentScale = 1;
|
||||
_this.currentDeltaX = 0;
|
||||
_this.currentDeltaY = 0;
|
||||
_this.allowedXMargin = 0;
|
||||
_this.allowedYMargin = 0;
|
||||
// Force both directions after super to avoid override allowing only one direction
|
||||
// Force both directions after super to avoid override allowing only one direction
|
||||
_this.options({ direction: __WEBPACK_IMPORTED_MODULE_1_ionic_angular_gestures_hammer__["a" /* DIRECTION_HORIZONTAL */] | __WEBPACK_IMPORTED_MODULE_1_ionic_angular_gestures_hammer__["b" /* DIRECTION_VERTICAL */] });
|
||||
_this.listen();
|
||||
_this.on('pinch', function (e) { return _this.onPinch(e); });
|
||||
_this.on('pinchend', function (e) { return _this.onPinchEnd(e); });
|
||||
_this.on('panstart', function (e) { return _this.onPanStart(e); });
|
||||
_this.on('pan', function (e) { return _this.onPan(e); });
|
||||
_this.on('panend', function (e) { return _this.onPanEnd(e); });
|
||||
_this.on('doubletap', function (e) { return _this.onDoubleTap(e); });
|
||||
return _this;
|
||||
}
|
||||
ImageViewerZoomGesture.prototype.onPinch = function (event) {
|
||||
this.component.dragGesture.abort(event);
|
||||
this.currentScale = Math.max(1, Math.min(MAX_SCALE, this.adjustScale * event.scale));
|
||||
this.currentDeltaX = this.adjustDeltaX + (event.deltaX / this.currentScale);
|
||||
this.currentDeltaY = this.adjustDeltaY + (event.deltaY / this.currentScale);
|
||||
this.setImageContainerTransform();
|
||||
};
|
||||
ImageViewerZoomGesture.prototype.onPinchEnd = function (event) {
|
||||
this.component.isZoomed = (this.currentScale !== 1);
|
||||
if (!this.component.isZoomed) {
|
||||
new __WEBPACK_IMPORTED_MODULE_0_ionic_angular__["b" /* Animation */](this.platform, this.element)
|
||||
.fromTo('translateX', this.currentDeltaX + "px", '0')
|
||||
.fromTo('translateY', this.currentDeltaY + "px", '0')
|
||||
.easing('ease-in')
|
||||
.duration(50)
|
||||
.play();
|
||||
this.currentDeltaX = 0;
|
||||
this.currentDeltaY = 0;
|
||||
}
|
||||
// Saving the final transforms for adjustment next time the user interacts.
|
||||
this.adjustScale = this.currentScale;
|
||||
this.adjustDeltaX = this.currentDeltaX;
|
||||
this.adjustDeltaY = this.currentDeltaY;
|
||||
};
|
||||
ImageViewerZoomGesture.prototype.onPanStart = function (event) {
|
||||
if (!this.component.isZoomed) {
|
||||
return;
|
||||
}
|
||||
var originalImageWidth = this.element.offsetWidth;
|
||||
var originalImageHeight = this.element.offsetHeight;
|
||||
this.allowedXMargin = ((originalImageWidth * this.currentScale) - originalImageWidth) / 4;
|
||||
this.allowedYMargin = ((originalImageHeight * this.currentScale) - originalImageHeight) / 4;
|
||||
};
|
||||
ImageViewerZoomGesture.prototype.onPan = function (event) {
|
||||
if (!this.component.isZoomed) {
|
||||
return;
|
||||
}
|
||||
this.currentDeltaX = this.boundAdjustement(Math.floor(this.adjustDeltaX + event.deltaX / this.currentScale), this.allowedXMargin);
|
||||
this.currentDeltaY = this.boundAdjustement(Math.floor(this.adjustDeltaY + event.deltaY / this.currentScale), this.allowedYMargin);
|
||||
this.setImageContainerTransform();
|
||||
};
|
||||
ImageViewerZoomGesture.prototype.boundAdjustement = function (adjustement, bound) {
|
||||
if (adjustement > bound || adjustement < -bound) {
|
||||
return Math.min(bound, Math.max(adjustement, -bound));
|
||||
}
|
||||
return adjustement;
|
||||
};
|
||||
ImageViewerZoomGesture.prototype.onPanEnd = function (event) {
|
||||
if (!this.component.isZoomed) {
|
||||
return;
|
||||
}
|
||||
this.adjustDeltaX = this.currentDeltaX;
|
||||
this.adjustDeltaY = this.currentDeltaY;
|
||||
};
|
||||
ImageViewerZoomGesture.prototype.onDoubleTap = function (event) {
|
||||
this.component.isZoomed = !this.component.isZoomed;
|
||||
if (this.component.isZoomed) {
|
||||
this.currentScale = 2;
|
||||
}
|
||||
else {
|
||||
this.currentScale = 1;
|
||||
this.adjustDeltaX = this.currentDeltaX = 0;
|
||||
this.adjustDeltaY = this.currentDeltaY = 0;
|
||||
}
|
||||
this.adjustScale = this.currentScale;
|
||||
this.setImageContainerTransform();
|
||||
};
|
||||
ImageViewerZoomGesture.prototype.setImageContainerTransform = function () {
|
||||
var transforms = [];
|
||||
transforms.push("scale(" + this.currentScale + ")");
|
||||
transforms.push("translate(" + this.currentDeltaX + "px, " + this.currentDeltaY + "px)");
|
||||
this.renderer.setElementStyle(this.element, this.platform.Css.transform, transforms.join(' '));
|
||||
};
|
||||
return ImageViewerZoomGesture;
|
||||
}(__WEBPACK_IMPORTED_MODULE_0_ionic_angular__["h" /* Gesture */]));
|
||||
|
||||
>>>>>>> 92c96afbb0bc945d81513ecd7a4105d7d089977a
|
||||
//# sourceMappingURL=image-viewer-zoom-gesture.js.map
|
||||
|
||||
/***/ })
|
||||
|
||||
Loading…
Reference in New Issue
Block a user