Salaried Added

This commit is contained in:
sriram-at-840620226347 2019-12-24 20:05:44 +05:30
parent b1bf5fbd96
commit dc053cc6a7
7 changed files with 370 additions and 28 deletions

View File

@ -355,6 +355,7 @@
<input matInput placeholder="Specify Comment on Locality" name="other_comment_locality" formControlName="other_comment_locality" autocomplete="off">
</mat-form-field>
</div>
<span *ngIf="split_customer_abbr != 'SAL'">
<mat-form-field style="width: 100%" *ngIf="pdQuestionAddress.controls['estimated_area']">
<input matInput [placeholder]="placeholderName[i] ? placeholderName[i] : 'Estimated area of the (Address Type)' " formControlName="estimated_area"
type="number">
@ -372,6 +373,7 @@
autocomplete="off">
</mat-form-field>
</div>
</span>
<!--

View File

@ -97,6 +97,8 @@ export class PdQuestionAddressPage {
pd_value_params:any;
@ViewChild('childComp') child: PdGeneralImagesPage
customer_segment_abbr: any;
split_customer_abbr: any;
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,
public qustCat:QuestionCategoryProvider,public aws:AwsServiceProvider,
@ -110,6 +112,14 @@ export class PdQuestionAddressPage {
this.FormId = this.navParams.get('FormId');
this.lender_short_name=this.pdDetails.lender_short_name
this.product_abbr=this.pdDetails.product_abbr
this.customer_segment_abbr=this.pdDetails.customer_segment_abbr
this.split_customer_abbr = this.customer_segment_abbr.split('-')
if(this.split_customer_abbr.length > 0){
this.split_customer_abbr = this.split_customer_abbr[0];
console.log(this.split_customer_abbr)
}
this.users = localStorage.getItem('pd_user_details')
this.users=JSON.parse(this.users).userid

View File

@ -138,21 +138,35 @@
<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
<input matInput placeholder="Name of Person Met" formControlName="name_person_met" required>
<!-- <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-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>
<!-- <input matInput placeholder="Designation of Person Met" formControlName="designation_person_met"
required> -->
<mat-select placeholder="Designation of Person Met" formControlName="designation_person_met" required>
<mat-option>Select</mat-option>
<mat-option *ngFor="let deslist of designationdatalist" [value]="deslist.designation_id">
{{deslist.designation}}
</mat-option>
</mat-select>
<mat-error *ngIf="employmentForm.controls['designation_person_met'].hasError('required')">Designation of Person Met Required</mat-error>
</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>
<mat-error *ngIf="employmentForm.controls['designation_person_met'].hasError('required')">
Specify Person Met Required</mat-error>
</mat-form-field>
</div>
</div>
</div>
@ -163,6 +177,11 @@
<mat-radio-button value="yes">YES</mat-radio-button>
<mat-radio-button value="no">NO</mat-radio-button>
</mat-radio-group>
<mat-form-field appearance="outline" style="width: 100%" *ngIf="employmentForm.controls['confirm_salary'].value == 'no'">
<!-- <mat-label>why salary amount was not confirmed</mat-label> -->
<textarea matInput placeholder="why salary amount was not confirmed" formControlName="sal_amount_was_not_confirmed"></textarea>
<!-- <mat-error *ngIf="employmentForm.controls['sal_amount_was_not_confirmed'].hasError('required')">why salary amount was not confirmed Required</mat-error> -->
</mat-form-field>
<div *ngIf="employmentForm.controls.confirm_salary.value == 'yes'">
@ -177,21 +196,72 @@
</div>
</div>
<div *ngIf="pd_cus_segment!='SAL-CHQ'">
<ion-row *ngIf="pd_cus_segment!='SAL-CHQ'">
<ion-col>
<p>Attendance register seen ?</p>
<mat-radio-group name="attendance_seen" formControlName="attendance_seen">
<mat-radio-group name="attendance_seen" formControlName="attendance_seen" (change)="idcardChange($event,2)">
<mat-radio-button value="yes">YES</mat-radio-button>
<mat-radio-button value="no">NO</mat-radio-button>
</mat-radio-group>
</div>
</ion-col>
<ion-col>
<div float-right *ngIf="employmentForm.controls['attendance_seen'].value == 'yes'" style="width: 20%">
<br>
<div *ngIf="employmentForm.controls['attendance_seen_pic']">
<div *ngIf="employmentForm.controls['attendance_seen_pic'].value !== ''">
<img src="{{employmentForm.controls['attendance_seen_pic'].value}}" imageViewer
style="width: 40px;height: 35px;">
</div>
<!-- <div *ngIf="employmentForm.controls['eb_bill_pic'].value === ''">
<label style="display: block; text-align: center !important;"> Electricity Bill Image </label>
</div> -->
<div style="text-align: -webkit-center;">
<ion-icon title="Click Here For ID Card Issued Image" name="md-camera"
(click)="ImageUpload(2)"></ion-icon>
</div>
</div>
</div>
</ion-col>
</ion-row>
<div *ngIf="pd_cus_segment!='SAL-CHQ'">
<ion-row *ngIf="pd_cus_segment!='SAL-CHQ'">
<ion-col>
<P>Salary register seen ?</P>
<mat-radio-group name="sal_reg_seen" formControlName="sal_reg_seen">
<mat-radio-group name="sal_reg_seen" formControlName="sal_reg_seen" (change)="idcardChange($event,3)">
<mat-radio-button value="yes">YES</mat-radio-button>
<mat-radio-button value="no">NO</mat-radio-button>
</mat-radio-group>
</div>
</ion-col>
<ion-col>
<div float-right *ngIf="employmentForm.controls['sal_reg_seen'].value == 'yes'" style="width: 20%">
<br>
<div *ngIf="employmentForm.controls['sal_reg_seen_pic']">
<div *ngIf="employmentForm.controls['sal_reg_seen_pic'].value !== ''">
<img src="{{employmentForm.controls['sal_reg_seen_pic'].value}}" imageViewer
style="width: 40px;height: 35px;">
</div>
<!-- <div *ngIf="employmentForm.controls['eb_bill_pic'].value === ''">
<label style="display: block; text-align: center !important;"> Electricity Bill Image </label>
</div> -->
<div style="text-align: -webkit-center;">
<ion-icon title="Click Here For ID Card Issued Image" name="md-camera"
(click)="ImageUpload(3)"></ion-icon>
</div>
</div>
</div>
</ion-col>
</ion-row>
<mat-form-field style="width: 100%">
<mat-select placeholder="Mode of getting salary" formControlName="mode_of_getting_salary"
required>
<mat-option>Select</mat-option>
<mat-option value="bank_transfer">Bank Transfer</mat-option>
<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-form-field>
</mat-card>
@ -234,7 +304,7 @@
</mat-form-field>
</div>
<div fxLayout="column" fxLayoutAlign="start stretch">
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="employmentForm.value.mode_of_getting_salary == 'paid_in_cash' || employmentForm.value.mode_of_getting_salary == 'both_bank_transfer_cash'">
<mat-form-field style="width: 100%">
<input matInput placeholder="Amount paid in Cash" formControlName="amount_paid_in_cash"
type="number" autocomplete="off" (keyup)="inWords($event.target.value,6)" (change)="ValidateNetSalary()" #cashPaidFocus>
@ -244,7 +314,7 @@
</mat-form-field>
</div>
<div fxLayout="column" fxLayoutAlign="start stretch">
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="employmentForm.value.mode_of_getting_salary == 'bank_transfer' || employmentForm.value.mode_of_getting_salary == 'both_bank_transfer_cash'">
<mat-form-field style="width: 100%">
<input matInput placeholder="Amount paid through Bank" formControlName="amount_paid_through_bank"
type="number" autocomplete="off" (keyup)="inWords($event.target.value,5)" (change)="ValidateNetSalary()">
@ -321,6 +391,46 @@
<mat-radio-button value="yes">YES</mat-radio-button>
<mat-radio-button value="no">NO</mat-radio-button>
</mat-radio-group>
<br>
<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>
<mat-option>Select</mat-option>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
<mat-error *ngIf="employmentForm.controls['id_card_issued_company'].hasError('required')">ID Card issued by the Company seen ? Required</mat-error>
</mat-form-field>
<mat-form-field appearance="outline" style="width: 100%" *ngIf="employmentForm.controls['id_card_issued_company'].value == 'no'">
<!-- <mat-label>why salary amount was not confirmed</mat-label> -->
<textarea matInput placeholder="why companys ID proof is not available." formControlName="why_company_id_proof_not_available"></textarea>
<mat-error *ngIf="employmentForm.controls['why_company_id_proof_not_available'].hasError('required')">why companys ID proof is not available Required</mat-error>
</mat-form-field>
<div float-right *ngIf="employmentForm.controls['id_card_issued_company'].value == 'yes'" style="width: 20%">
<div *ngIf="employmentForm.controls['id_card_image']">
<div *ngIf="employmentForm.controls['id_card_image'].value !== ''">
<img src="{{employmentForm.controls['id_card_image'].value}}" imageViewer
style="width: 40px;height: 35px;">
</div>
<!-- <div *ngIf="employmentForm.controls['eb_bill_pic'].value === ''">
<label style="display: block; text-align: center !important;"> Electricity Bill Image </label>
</div> -->
<div style="text-align: -webkit-center;">
<ion-icon title="Click Here For ID Card Issued Image" name="md-camera"
(click)="ImageUpload(1)"></ion-icon>
</div>
</div>
</div>
<div style="width: 100%;">
<ion-col col-10>
<p>Office photographs</p>
</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>
</mat-card-content>
</mat-card>

View File

@ -63,6 +63,9 @@ export class PdQuestionEmpInfoPage {
pd_value_params:any;
@ViewChild('childComp') child: PdGeneralImagesPage
split_customer_abbr: any;
designationdatalist: any [];
@ViewChild('docsSightedScroll') docsSightedScroll: ElementRef
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,
public qustCat:QuestionCategoryProvider,public aws: AwsServiceProvider,
@ -77,6 +80,11 @@ export class PdQuestionEmpInfoPage {
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.split_customer_abbr = this.customer_segment_abbr.split('-')
if(this.split_customer_abbr.length > 0){
this.split_customer_abbr = this.split_customer_abbr[0];
console.log(this.split_customer_abbr)
}
this.generalExistBusinessYear=100;
this.generalExistBusinessMonth=12;
this.getDropDownList();
@ -97,7 +105,9 @@ export class PdQuestionEmpInfoPage {
was_met: [this.pd_cus_segment == 'SAL-CHQ' ? 'No' : ''],
name_person_met: [''],
designation_person_met: [''],
others_person_met:[],
confirm_salary: [this.pd_cus_segment == 'SAL-CHQ' ? 'No' : ''],
sal_amount_was_not_confirmed: [''],
confirm_salary_amount: [''],
attendance_seen: [this.pd_cus_segment == 'SAL-CHQ' ? 'No' : ''],
sal_reg_seen: [this.pd_cus_segment == 'SAL-CHQ' ? 'No' : ''],
@ -107,6 +117,7 @@ export class PdQuestionEmpInfoPage {
net_monthly_salary: [''],
amount_paid_in_cash: [''],
amount_paid_through_bank: [''],
mode_of_getting_salary: [''],
check_validated:[''],
how_was_it_validated: [''],
why_was_it_not_validated: [''],
@ -114,6 +125,8 @@ export class PdQuestionEmpInfoPage {
bonus_frequency: [''],
bonus_type: [''],
bonus_type_other: [''],
id_card_issued_company:[''],
why_company_id_proof_not_available: [''],
any_delays: [''],
employment_remarks: [''],
// nameOfEmp:[null],
@ -166,6 +179,17 @@ this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId.form_id,com
}
});
this.qustCat.getcommondrop('DESIGNATION').subscribe(
data => {
if (data.status == 200) {
console.log('DESIGNATION',data);
this.designationdatalist = data.records;
this.designationdatalist = this.designationdatalist.filter(des => des.isactive == 1);
}
});
this.qustCat.getcommondrop('COMPANYRELATIONSHIPS').subscribe(
data => {
if(data['dataStatus']==true){
@ -256,6 +280,8 @@ this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId.form_id,com
this.toast.pdTriggerappmessage('Form Invalid Try Again.!');
return;
}
let records: any = {};
@ -273,21 +299,55 @@ this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId.form_id,com
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;
if(records.designation_person_met == '1'){
records.others_person_met = this.employmentForm.controls['others_person_met'].value;
}
}else{
records.name_person_met = '';
records.designation_person_met = '';
records.others_person_met = '';
}
records.confirm_salary = this.employmentForm.controls['confirm_salary'].value;
if(records.confirm_salary == 'no'){
records.sal_amount_was_not_confirmed = this.employmentForm.controls['sal_amount_was_not_confirmed'].value;
}
records.confirm_salary_amount = this.employmentForm.controls['confirm_salary'].value == 'yes' ? this.employmentForm.controls['confirm_salary_amount'].value : '';
records.attendance_seen = this.employmentForm.controls['attendance_seen'].value;
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 seen pic is required");
this.docsSightedScroll.nativeElement.scrollIntoView({behavior:"smooth",block:"start"})
return;
}else {
records.attendance_seen_pic = this.employmentForm.controls['attendance_seen_pic'].value;
}
}
records.sal_reg_seen = this.employmentForm.controls['sal_reg_seen'].value;
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.docsSightedScroll.nativeElement.scrollIntoView({behavior:"smooth",block:"start"})
return;
}else {
records.sal_reg_seen_pic = this.employmentForm.controls['sal_reg_seen_pic'].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.amount_paid_in_cash = this.employmentForm.controls['amount_paid_in_cash'].value;
records.amount_paid_through_bank = this.employmentForm.controls['amount_paid_through_bank'].value;
records.mode_of_getting_salary = this.employmentForm.controls['mode_of_getting_salary'].value;
if(records.mode_of_getting_salary == 'paid_in_cash' || records.mode_of_getting_salary == 'both_bank_transfer_cash'){
records.amount_paid_in_cash = this.employmentForm.controls['amount_paid_in_cash'].value;
}
if(records.mode_of_getting_salary == 'bank_transfer' || records.mode_of_getting_salary == 'both_bank_transfer_cash'){
records.amount_paid_through_bank = this.employmentForm.controls['amount_paid_through_bank'].value;
}
records.check_validated = this.employmentForm.controls['check_validated'].value;
records.how_was_it_validated = this.employmentForm.controls['check_validated'].value == 'validated' ? this.employmentForm.controls['how_was_it_validated'].value : '';
records.why_was_it_not_validated = this.employmentForm.controls['check_validated'].value != 'validated' ? this.employmentForm.controls['why_was_it_not_validated'].value : '';
@ -299,9 +359,29 @@ this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId.form_id,com
records.bonus_type = this.employmentForm.controls['bonus_type'].value;
records.bonus_type_other = this.employmentForm.controls['bonus_type_other'].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;
}
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 pic is required");
this.docsSightedScroll.nativeElement.scrollIntoView({behavior:"smooth",block:"start"})
return;
}else {
records.id_card_image = this.employmentForm.controls['id_card_image'].value;
}
}
records.employment_remarks = this.employmentForm.controls['employment_remarks'].value;
this.spinner_access=true;
this.qustCat.saveForm(records).subscribe(data => {
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' :''
this.qustCat.saveForm(records).subscribe(data => {
if(data['dataStatus']== true){
@ -475,8 +555,14 @@ inWords(val,flag:number){
}
if (Emp.designation_person_met) {
this.employmentForm.controls['designation_person_met'].setValue(Emp.designation_person_met);
if(Emp.designation_person_met == '1'){
this.employmentForm.controls['others_person_met'].setValue(Emp.others_person_met);
}
}
this.employmentForm.controls['confirm_salary'].setValue(Emp.confirm_salary);
if(Emp.confirm_salary == 'no'){
this.employmentForm.controls['sal_amount_was_not_confirmed'].setValue(Emp.sal_amount_was_not_confirmed);
}
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);
@ -484,13 +570,35 @@ inWords(val,flag:number){
}
this.employmentForm.controls['attendance_seen'].setValue(Emp.attendance_seen);
if(Emp.attendance_seen == 'yes'){
if (Emp.attendance_seen == 'yes') {
this.employmentForm.addControl('attendance_seen_pic', new FormControl('', Validators.compose([Validators.required])));
} else {
this.employmentForm.removeControl('attendance_seen_pic');
}
this.employmentForm.controls['attendance_seen_pic'].setValue(Emp.attendance_seen_pic);
}
this.employmentForm.controls['sal_reg_seen'].setValue(Emp.sal_reg_seen);
if(Emp.sal_reg_seen == 'yes'){
if (Emp.sal_reg_seen == 'yes') {
this.employmentForm.addControl('sal_reg_seen_pic', new FormControl('', Validators.compose([Validators.required])));
} else {
this.employmentForm.removeControl('sal_reg_seen_pic');
}
this.employmentForm.controls['sal_reg_seen_pic'].setValue(Emp.sal_reg_seen_pic);
}
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['amount_paid_in_cash'].setValue(Emp.amount_paid_in_cash);
this.employmentForm.controls['amount_paid_through_bank'].setValue(Emp.amount_paid_through_bank);
this.employmentForm.controls['mode_of_getting_salary'].setValue(Emp.mode_of_getting_salary);
if(Emp.mode_of_getting_salary == 'paid_in_cash' || Emp.mode_of_getting_salary == 'both_bank_transfer_cash'){
this.employmentForm.controls['amount_paid_in_cash'].setValue(Emp.amount_paid_in_cash);
}
if(Emp.mode_of_getting_salary == 'bank_transfer' || Emp.mode_of_getting_salary == 'both_bank_transfer_cash'){
this.employmentForm.controls['amount_paid_through_bank'].setValue(Emp.amount_paid_through_bank);
}
this.employmentForm.controls['check_validated'].setValue(Emp.check_validated);
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);
@ -498,6 +606,18 @@ 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['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);
}
if(Emp.id_card_issued_company == 'yes'){
if (Emp.id_card_issued_company == 'yes') {
this.employmentForm.addControl('id_card_image', new FormControl('', Validators.compose([Validators.required])));
} else {
this.employmentForm.removeControl('id_card_image');
}
this.employmentForm.controls['id_card_image'].setValue(Emp.id_card_image);
}
this.employmentForm.controls['any_delays'].setValue(Emp.any_delays);
this.employmentForm.controls['employment_remarks'].setValue(Emp.employment_remarks);
@ -612,5 +732,65 @@ inWords(val,flag:number){
})
}
ImageUpload(Flag: any) {
let img_name
this.cameraProvider.getpicture().then(res => {
if(res != 'error'){
let geoCoordinates=localStorage.getItem('current_coordinates')
// this.cons.getGeoTag().then(geoCoordinates=>{
this.cameraProvider.addWatermarks(res).then(watermarkedImage=>{
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);}
let bucket:any=[]
bucket.push({ 'image': watermarkedImage, 'Name': img_name, 'link': geoCoordinates });
let records: any = {
'pd_id': this.pdDetails.pd_id,
'formid': this.FormId.form_id,
'images': bucket,
'company_id': '',
}
console.log("params savePDImage",JSON.stringify(records))
this.qustCat.savePDImages(records).subscribe(result=>{
if(result['dataStatus']){
console.log("img saved successfully",this.pdDetails.pd_id,this.FormId.form_id,this.imageBucket,'');
}
})
})
// })
}
}, error => {
console.log("Camera Error ", JSON.stringify(error));
})
}
idcardChange(event, Flag) {
console.log(event)
if (Flag == 1) { event.value == 'yes' ? this.employmentForm.addControl('id_card_image', new FormControl('', Validators.compose([Validators.required]))) : this.employmentForm.removeControl('id_card_image'); }
if (Flag == 2) { event.value == 'yes' ? this.employmentForm.addControl('attendance_seen_pic', new FormControl('', Validators.compose([Validators.required]))) : this.employmentForm.removeControl('attendance_seen_pic'); }
if (Flag == 3) { event.value == 'yes' ? this.employmentForm.addControl('sal_reg_seen_pic', new FormControl('', Validators.compose([Validators.required]))) : this.employmentForm.removeControl('sal_reg_seen_pic'); }
}
savePhoto(flag){
this.tab='1';
// const modalOption:ModalOptions={
// cssClass:'imageNameModal'
// }
// let records:any={form_id:'5',doc_name:''}
// const modalCtrl=this.modalCtrl.create(ImageNameModelPage,{'FormDet':records},modalOption)
// modalCtrl.present();
setTimeout(()=>{
if(flag == 1){
this.child.capture()
// this.imageDisplay.push({'image':this.base64,'Name':''})
}
})
}
}

View File

@ -268,9 +268,8 @@
<input matInput placeholder="Month" formControlName="rental_income_rcv_in_month" autocomplete="off"
type="number" (change)="ConvertMonthintoYearforBusiness($event.target.value,'',2)">
</mat-form-field>
</mat-card>
<mat-card>
</mat-card>
<mat-card *ngIf="checksalaried == false">
<mat-form-field style="width:100%" class="mt-1">
<mat-select placeholder="Is the applicant name same as per KYC"
formControlName="is_kyc" (selectionChange)="kycchange($event.value)" required>
@ -370,7 +369,10 @@
<br />
<mat-form-field style="width:100%">
<mat-select #focusBusiness [placeholder]="customer_segment_abbr == 'SEP_INDV' ? 'Entity Type' : 'Business Entity Type'" formControlName="business_entity_type" required>
<mat-label *ngIf="customer_segment_abbr == 'SEP_INDV' && split_customer_abbr != 'SAL'">Entity type</mat-label>
<mat-label *ngIf="customer_segment_abbr != 'SEP_INDV' && split_customer_abbr != 'SAL'">Business Entity Type</mat-label>
<mat-label *ngIf="split_customer_abbr == 'SAL'">Company/Firm Entity Type</mat-label>
<mat-select #focusBusiness formControlName="business_entity_type" required>
<mat-option>Select</mat-option>
<mat-option *ngFor="let business of businessEntityTypeList" [value]="business.business_entity_type_id">
{{business.business_entity_type_name}}
@ -384,8 +386,9 @@
<input matInput type="text" placeholder="Please Specity Others" formControlName="business_entity_type_other">
</mat-form-field>
<p>
<span *ngIf="customer_segment_abbr == 'SEP_INDV'">Number of Years in Current Profession</span>
<span *ngIf="customer_segment_abbr != 'SEP_INDV'">Number of Years For Which The Business Has Been Running</span></p>
<span *ngIf="customer_segment_abbr == 'SEP_INDV' && split_customer_abbr != 'SAL'">Number of Years in Current Profession</span>
<span *ngIf="customer_segment_abbr != 'SEP_INDV' && split_customer_abbr != 'SAL'">Number of Years For Which The Business Has Been Running</span>
<span *ngIf="split_customer_abbr == 'SAL'">Number of Years For Which The Company/Firm Has Been Running</span></p>
<mat-form-field style="width:100%">
<mat-label>Year</mat-label>
<input matInput type="number" placeholder="No of Years (Eg. 20)" formControlName="business_years" autocomplete="off">

View File

@ -92,6 +92,8 @@ export class PdQuestionGeneralInfoPage {
@ViewChild('individualPersonScroll') individualPersonScroll:ElementRef
@ViewChild('companyScroll') companyScroll:ElementRef
public KYC: any = [{value:"yes",isdisplayvalue:"Yes"},{value:"no",isdisplayvalue:"No"}];
split_customer_abbr: any;
checksalaried: boolean = false;
constructor(public navCtrl: NavController, public navParams: NavParams,
public aws:AwsServiceProvider,public qustCat:QuestionCategoryProvider,
@ -109,6 +111,11 @@ export class PdQuestionGeneralInfoPage {
//this.maxDate=new Date(get_max_date)
this.FormId = this.navParams.get('FormId');
this.customer_segment_abbr = this.pdDetails.customer_segment_abbr;
this.split_customer_abbr = this.customer_segment_abbr.split('-')
if(this.split_customer_abbr.length > 0){
this.split_customer_abbr = this.split_customer_abbr[0];
console.log(this.split_customer_abbr)
}
// console.log('this.customer_segment_abbr',this.customer_segment_abbr)
this.users = localStorage.getItem('pd_user_details')
this.users=JSON.parse(this.users).userid
@ -676,6 +683,9 @@ dataobj:any;
// console.log(this.generalForm.controls['company_value']['controls'][this.updateIndex_comp])
}
}
if(this.split_customer_abbr == 'SAL'){
this.salariedcheck();
}
}
@ -734,7 +744,9 @@ dataobj:any;
this.initCompanyValue(this.generalForm.value.companies,'ins')
}
}
if(this.split_customer_abbr == 'SAL'){
this.salariedcheck();
}
}
saveApplicants(datas,purpose){
this.applicant_spinner_access=true
@ -1119,7 +1131,7 @@ console.log('1)',this.temp);
// console.log('3)',this.temp);
});
// console.log('4)',this.temp,'length',valuesData_indi.length);
if (this.temp == valuesData_indi.length) {
if (this.temp == valuesData_indi.length && this.split_customer_abbr != 'SAL') {
// console.log('5)',this.temp);
this.toast.pdTriggerappmessage('Please Choose Name of Person Met.!');
this.temp = 0;
@ -1329,6 +1341,9 @@ console.log('1)',this.temp);
// if(this.data_all.company_with_relationships != ''){
// this.initCompanyRelationShip(this.data_all.company_with_relationships);
// }
if(this.split_customer_abbr == 'SAL'){
this.salariedcheck();
}
}
else{
@ -1585,5 +1600,25 @@ console.log('1)',this.temp);
kycchange(event){
console.log(event);
event =='no' ? this.generalForm.addControl('kyc_and_captur_the_name', new FormControl('')) : this.generalForm.removeControl('kyc_and_captur_the_name');
}
}
salariedcheck(){
console.log('checkbox',this.generalForm)
// this._generalForm.value.list_value.forEach((valueChanges) => {
// console.log(valueChanges);
// if(valueChanges.is_applicant == false || valueChanges.is_person_met == false){
// this.checksalaried = false;
// }else {
// this.checksalaried = true;
// }
// console.log('check box status',this.checksalaried);
// })
let control_value=this.generalForm.value.list_value
control_value=control_value.filter(val=>val.is_applicant == false || val.is_person_met == false)
console.log(control_value.length >0)
this.checksalaried = control_value.length > 0
}
}

View File

@ -148,11 +148,13 @@ stockFormAccess(pdid: any,companyid: any) {
/*****Save Images */
savePDImages(imagesDetails)
{
console.log('savepdimg',imagesDetails);
let record = {'records':imagesDetails};
return this.http.post(this.apiurl+'savePDPhotos',record)
.map(response=>{
console.log(response);
console.log('img response',response);
this.checkSavedPics(response['dataStatus'],imagesDetails)
console.log('check Img',this.checkSavedPics);
return response;
},err=>{
console.log("Error in savePDImages",err)