This commit is contained in:
venbatechnologies@gmail.com 2019-03-29 20:42:14 +05:30
parent 91e43a7e6c
commit 15e9f5a3ab
9 changed files with 323 additions and 219 deletions

File diff suppressed because one or more lines are too long

View File

@ -90,8 +90,7 @@ applicants: any;
this.qustCat.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{ this.qustCat.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
if(data['dataStatus']==true){ if(data['dataStatus']==true){
this.existCompanyList=data['records'].filter(val =>val.is_active===true && val.is_company_applicant===true) this.existCompanyList=data['records'].filter(val =>val.is_active===true )// && val.is_company_applicant===true
} }
let modifyCompanyList : any=[]; let modifyCompanyList : any=[];
if(this.existCompanyList.length>0){ if(this.existCompanyList.length>0){
@ -134,7 +133,6 @@ applicants: any;
if(val =="Yes") if(val =="Yes")
{ {
this.addLoanDetails(); this.addLoanDetails();
} }
@ -368,7 +366,7 @@ submitCurrentloan(answerData) {
} }
}) })
this.currentLoans.controls['loan_details'].setValue(result); this.currentLoans.controls['loan_details'].patchValue(result);
} }
} }

View File

@ -1,194 +1,201 @@
<ion-header> <ion-header>
<ion-navbar color="optblue">
<ion-navbar color="optblue"> <button ion-button menuToggle>
<ion-icon name="menu"></ion-icon>
<button ion-button menuToggle> </button>
<ion-icon name="menu"></ion-icon> <ion-title *ngIf="!viewchange">{{FormId.form_name}}</ion-title>
</button> </ion-navbar>
<ion-title *ngIf="!viewchange">Employee Salary Category</ion-title>
</ion-navbar>
</ion-header> </ion-header>
<ion-content padding> <ion-content padding>
<form [formGroup]="employmentForm"> <form [formGroup]="employmentForm">
<mat-card> <mat-card>
<div fxLayout="column" fxLayoutAlign="start stretch"> <div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width:100%"> <mat-form-field style="width:100%">
<mat-select placeholder="Name of Employer" formControlName="employer_name"> <mat-select placeholder="Name of Employer" formControlName="employer_name" (selectionChange)="checkWithExistYear($event.value)">
<mat-option *ngFor="let cl of company_list" [value]="cl.company_order_id+'-'+cl.company_name">{{ <mat-option *ngFor="let cl of company_list" [value]="cl.company_order_id+'-'+cl.company_name">{{
cl.company_name }}</mat-option> cl.company_name }}</mat-option>
</mat-select>
</mat-form-field>
</div>
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="employmentForm.controls.employer_name.value != ''">
<mat-form-field style="width: 100%" required>
<textarea matInput placeholder="Company Profile in brief" formControlName="employer_in_brief"></textarea>
</mat-form-field>
</div>
<mat-label>Since how long working with this employer?</mat-label>
<div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width: 45%">
<input matInput type="number" formControlName="how_long_year" autocomplete="off" placeholder="Year" min='0'>
</mat-form-field>
&nbsp;&nbsp;&nbsp;
<mat-form-field style="width: 45%">
<input matInput type="number" placeholder="Month" formControlName="how_long_month" min='0' (change)="ConvertMonthintoYear($event.target.value)">
</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" type="number" #workExp
OnlyNumber autocomplete="off" (change)="checkWorkingExperiences()">
<mat-hint style="color: red;" *ngIf="employmentForm.controls.total_business_experience.value !=undefined && this.workExperienceErrorFlag">
Total working Experience is Lower
</mat-hint>
</mat-form-field>
</div>
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="workExperienceFlag" >
<mat-form-field style="width:100%">
<input matInput placeholder="Previous Work Experience Details" formControlName="total_business_previous_experience" (change)="checkWorkingExperiences()">
</mat-form-field>
</div>
<div *ngIf="pd_cus_segment!='SAL-CHQ'">
<p>Was the Employer 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-select>
</mat-form-field> </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>
<div *ngIf="pd_cus_segment!='SAL-CHQ'"> <div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="employmentForm.controls.employer_name.value != ''">
<p>Salary amount confirmed ?</p> <mat-form-field style="width: 100%" required>
<mat-radio-group formControlName="confirm_salary"> <textarea matInput placeholder="Company Profile in brief" formControlName="employer_in_brief"></textarea>
<mat-radio-button value="yes">YES</mat-radio-button> </mat-form-field>
<mat-radio-button value="no">NO</mat-radio-button> </div>
</mat-radio-group>
<div *ngIf="employmentForm.controls.confirm_salary.value == 'yes'">
<div fxLayout="column" fxLayoutAlign="start stretch"> <mat-label>Since how long working with this employer?</mat-label>
<div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width: 45%">
<input matInput type="number" formControlName="how_long_year" autocomplete="off" placeholder="Year"
min='0'>
<mat-error *ngIf="employmentForm.controls.how_long_year.hasError('max')">Higer then business vintage</mat-error>
</mat-form-field>
&nbsp;&nbsp;&nbsp;
<mat-form-field style="width: 45%">
<input matInput type="number" placeholder="Month" formControlName="how_long_month" min='0' (change)="ConvertMonthintoYear($event.target.value)">
<mat-error *ngIf="employmentForm.controls.how_long_month.hasError('max')">Higer then business vintage</mat-error>
</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"
type="number" #workExp OnlyNumber autocomplete="off" (change)="checkWorkingExperiences()">
<!-- <mat-hint style="color: red;" *ngIf="employmentForm.controls.total_business_experience.value !=undefined && this.workExperienceErrorFlag"> -->
<!-- Total working Experience is Lower -->
<!-- </mat-hint> -->
<mat-error *ngIf="employmentForm.controls.total_business_experience.hasError('min')">Total working Experience is Lower</mat-error>
</mat-form-field>
</div>
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="workExperienceFlag">
<mat-form-field style="width:100%">
<input matInput placeholder="Previous Work Experience Details" formControlName="total_business_previous_experience"
(change)="checkWorkingExperiences()">
</mat-form-field>
</div>
<div *ngIf="pd_cus_segment!='SAL-CHQ'">
<p>Was the Employer 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-form-field style="width: 100%">
<input matInput placeholder="What is the salary amount confirmed?" formControlName="confirm_salary_amount" type="number" <mat-select placeholder="Name of Person Met" formControlName="name_person_met" required
OnlyNumber (keyup)="inWords($event.target.value,1)"> (selectionChange)="filtercompanyrelationship(employmentForm.controls.employer_name.value,$event.value)">
<mat-hint align="end" *ngIf="employmentForm.controls.confirm_salary_amount.value != ''">{{"&#8377;"}} {{mthlySlryAmtInWords}} Only</mat-hint> <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> </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> </div>
</div>
<div *ngIf="pd_cus_segment!='SAL-CHQ'"> <div *ngIf="pd_cus_segment!='SAL-CHQ'">
<p>Attendance register seen ?</p> <p>Salary amount confirmed ?</p>
<mat-radio-group name="attendance_seen" formControlName="attendance_seen"> <mat-radio-group formControlName="confirm_salary">
<mat-radio-button value="yes">YES</mat-radio-button> <mat-radio-button value="yes">YES</mat-radio-button>
<mat-radio-button value="no">NO</mat-radio-button> <mat-radio-button value="no">NO</mat-radio-button>
</mat-radio-group> </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>
</div>
</mat-card> <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"
type="number" (keyup)="inWords($event.target.value,1)">
<mat-hint align="end" *ngIf="employmentForm.controls.confirm_salary_amount.value != ''">{{"&#8377;"}}
{{mthlySlryAmtInWords}} Only</mat-hint>
</mat-form-field>
</div>
</div>
</div>
<mat-card> <div *ngIf="pd_cus_segment!='SAL-CHQ'">
<h5>Salary Details</h5> <p>Attendance register seen ?</p>
<mat-card-content> <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>
</div>
</mat-card>
<mat-card>
<h5>Salary Details</h5>
<mat-card-content>
<div fxLayout="column" fxLayoutAlign="start stretch"> <div fxLayout="column" fxLayoutAlign="start stretch">
<p>Date of Salary</p>&nbsp; <p>Date of Salary</p>&nbsp;
<mat-form-field style="width: 35%"> <mat-form-field style="width: 35%">
<mat-select placeholder="From" formControlName="from_date_the_salary_is_rcv" (selectionChange)="formDate($event.value)"> <mat-select placeholder="From" formControlName="from_date_the_salary_is_rcv" (selectionChange)="formDate($event.value)">
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<mat-option *ngFor="let date of dateonly" [value]="date.date" [disabled]="date.isdisabled"> <mat-option *ngFor="let date of dateonly" [value]="date.date" [disabled]="date.isdisabled">
{{date.date}} {{date.date}}
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
<mat-form-field style="width: 35%"> <mat-form-field style="width: 35%">
<mat-select placeholder="To" formControlName="to_date_the_salary_is_rcv"> <mat-select placeholder="To" formControlName="to_date_the_salary_is_rcv">
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<mat-option *ngFor="let date of todate" [value]="date.date" [disabled]="date.isdisabled"> <mat-option *ngFor="let date of todate" [value]="date.date" [disabled]="date.isdisabled">
{{date.date}} {{date.date}}
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</div> </div>
<div fxLayout="column" fxLayoutAlign="start stretch"> <div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<input matInput placeholder="Gross Monthly Salary" formControlName="gross_monthly_salary" type="number" <input matInput placeholder="Gross Monthly Salary" formControlName="gross_monthly_salary" type="number" required (keyup)="inWords($event.target.value,2)">
OnlyNumber required (keyup)="inWords($event.target.value,2)"> <mat-hint align="end" *ngIf="employmentForm.controls.gross_monthly_salary.value != ''">{{"&#8377;"}}
<mat-hint align="end" *ngIf="employmentForm.controls.gross_monthly_salary.value != ''">{{"&#8377;"}} {{grossMthlySlryAmtInWords}} Only</mat-hint> {{grossMthlySlryAmtInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
<div fxLayout="column" fxLayoutAlign="start stretch"> <div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<input matInput placeholder="Net Monthly Salary" formControlName="net_monthly_salary" type="number" <input matInput placeholder="Net Monthly Salary" formControlName="net_monthly_salary" type="number"
OnlyNumber required (keyup)="inWords($event.target.value,3)"> required (keyup)="inWords($event.target.value,3)">
<mat-hint align="end" *ngIf="employmentForm.controls.net_monthly_salary.value != ''">{{"&#8377;"}} {{netMthlySlryAmtInWords}} Only</mat-hint> <mat-hint align="end" *ngIf="employmentForm.controls.net_monthly_salary.value != ''">{{"&#8377;"}}
{{netMthlySlryAmtInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
<div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width: 100%">
<input matInput placeholder="Amount paid in Cash"
formControlName="amount_paid_in_cash" OnlyNumber type="number" autocomplete="off" (keyup)="inWords($event.target.value,6)">
<mat-hint align="end" *ngIf="employmentForm.controls.amount_paid_in_cash.value != ''">{{"&#8377;"}} {{cashAmtInWords}} Only</mat-hint>
</mat-form-field>
</div>
<div fxLayout="column" fxLayoutAlign="start stretch"> <div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<input matInput placeholder="Amount paid through Bank" <input matInput placeholder="Amount paid in Cash" formControlName="amount_paid_in_cash"
formControlName="amount_paid_through_bank" OnlyNumber type="number" autocomplete="off" (keyup)="inWords($event.target.value,5)"> type="number" autocomplete="off" (keyup)="inWords($event.target.value,6)" (change)="ValidateNetSalary()">
<mat-hint align="end" *ngIf="employmentForm.controls.amount_paid_through_bank.value != ''">{{"&#8377;"}} {{bankAmtInWords}} Only</mat-hint> <mat-hint align="end" *ngIf="employmentForm.controls.amount_paid_in_cash.value != ''">{{"&#8377;"}}
</mat-form-field> {{cashAmtInWords}} Only</mat-hint>
<mat-error *ngIf="employmentForm.controls.amount_paid_in_cash.hasError('max')">Given Value is Maximum of Net Salary</mat-error>
</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"
type="number" autocomplete="off" (keyup)="inWords($event.target.value,5)" (change)="ValidateNetSalary()">
<mat-hint align="end" *ngIf="employmentForm.controls.amount_paid_through_bank.value != ''">{{"&#8377;"}}
{{bankAmtInWords}} Only</mat-hint>
<mat-error *ngIf="employmentForm.controls.amount_paid_through_bank.hasError('max')">Given Value is Maximum of Net Salary</mat-error>
</mat-form-field>
</div> </div>
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="employmentForm.controls.amount_paid_in_cash.value != '' && employmentForm.controls.amount_paid_in_cash.value != 0"> <div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="employmentForm.controls.amount_paid_in_cash.value != '' && employmentForm.controls.amount_paid_in_cash.value != 0">
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<mat-select placeholder="Is the Amount is Validated or Not" formControlName="check_validated"> <mat-select placeholder="Is the Amount is Validated or Not" formControlName="check_validated">
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<mat-option value="validated">Validated</mat-option> <mat-option value="validated">Validated</mat-option>
<mat-option value="not validated">Not Validated</mat-option> <mat-option value="not validated">Not Validated</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</div> </div>
@ -200,19 +207,19 @@
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="employmentForm.controls['check_validated'].value == 'not validated'"> <div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="employmentForm.controls['check_validated'].value == 'not validated'">
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<input matInput placeholder="Why was it not Validated" <input matInput placeholder="Why was it not Validated" formControlName="why_was_it_not_validated">
formControlName="why_was_it_not_validated">
</mat-form-field> </mat-form-field>
</div> </div>
<div fxLayout="column" fxLayoutAlign="start stretch"> <div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<input matInput placeholder="Bonus or Incentive" formControlName="bonus_incentive" type="number" <input matInput placeholder="Bonus or Incentive" formControlName="bonus_incentive" type="number"
OnlyNumber required (keyup)="inWords($event.target.value,4)"> required (keyup)="inWords($event.target.value,4)">
<mat-hint align="end" *ngIf="employmentForm.controls.bonus_incentive.value != ''">{{"&#8377;"}} {{bonusIncentiveAmtInWords}} Only</mat-hint> <mat-hint align="end" *ngIf="employmentForm.controls.bonus_incentive.value != ''">{{"&#8377;"}}
</mat-form-field> {{bonusIncentiveAmtInWords}} Only</mat-hint>
</mat-form-field>
</div> </div>
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="employmentForm.controls['bonus_incentive'].value != '' && employmentForm.controls['bonus_incentive'].value != '0' "> <div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="employmentForm.controls['bonus_incentive'].value != '' && employmentForm.controls['bonus_incentive'].value != '0' ">
@ -243,16 +250,16 @@
</mat-form-field> </mat-form-field>
</div> </div>
<P>Any Delays</P> <P>Is there any delay in receiving the salary</P>
<mat-radio-group name="any_delays" formControlName="any_delays"> <mat-radio-group name="any_delays" formControlName="any_delays">
<mat-radio-button value="yes">YES</mat-radio-button> <mat-radio-button value="yes">YES</mat-radio-button>
<mat-radio-button value="no">NO</mat-radio-button> <mat-radio-button value="no">NO</mat-radio-button>
</mat-radio-group> </mat-radio-group>
</mat-card-content>
</mat-card>
<mat-card> </mat-card-content>
</mat-card>
<mat-card>
<div fxLayout="row"> <div fxLayout="row">
<div fxFlex="60" class="pb-0 text-sm-left"> <div fxFlex="60" class="pb-0 text-sm-left">
<mat-form-field appearance="outline" style="width: 100%"> <mat-form-field appearance="outline" style="width: 100%">
@ -263,12 +270,12 @@
</div> </div>
</mat-card> </mat-card>
<ion-row> <ion-row>
</ion-row>
</form> </ion-row>
</form>
</ion-content> </ion-content>
<ion-footer> <ion-footer>
<button ion-button full color="optblue" (click)="saveEmpInfo()"> Save</button> <button ion-button full color="optblue" (click)="saveEmpInfo()"> Save</button>
</ion-footer> </ion-footer>

View File

@ -2,6 +2,9 @@ page-pd-question-emp-info {
mat-hint{ mat-hint{
font-size:11px; font-size:11px;
} }
mat-error{
font-size:11px;
}
mat-card{ mat-card{
margin-bottom: 15px; margin-bottom: 15px;
border-radius: 10px !important; border-radius: 10px !important;

View File

@ -1,6 +1,6 @@
import { Component, ViewChild, ElementRef } from '@angular/core'; import { Component, ViewChild, ElementRef } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular'; import { IonicPage, NavController, NavParams } from 'ionic-angular';
import {FormBuilder,FormControl,FormArray, FormGroup} from '@angular/forms'; import {FormBuilder,FormControl,FormArray, FormGroup,Validators} from '@angular/forms';
import { QuestionCategoryProvider } from '../../../providers/question-category/question-category'; import { QuestionCategoryProvider } from '../../../providers/question-category/question-category';
import { AwsServiceProvider } from '../../../providers/aws-service/aws-service'; import { AwsServiceProvider } from '../../../providers/aws-service/aws-service';
import { ToastProvider } from '../../../providers/common-provider/toast'; import { ToastProvider } from '../../../providers/common-provider/toast';
@ -42,6 +42,8 @@ export class PdQuestionEmpInfoPage {
workExperienceFlag: boolean = false; workExperienceFlag: boolean = false;
workExperienceErrorFlag:boolean = false; workExperienceErrorFlag:boolean = false;
generalExistBusinessYear:any;
generalExistBusinessMonth:any;
public dateonly: any = [{date:1,isdisabled:false},{date:2,isdisabled:false},{date:3,isdisabled:false},{date:4,isdisabled:false},{date:5,isdisabled:false},{date:6,isdisabled:false},{date:7,isdisabled:false},{date:8,isdisabled:false},{date:9,isdisabled:false},{date:10,isdisabled:false},{date:11,isdisabled:false},{date:12,isdisabled:false},{date:13,isdisabled:false},{date:14,isdisabled:false},{date:15,isdisabled:false},{date:16,isdisabled:false},{date:17,isdisabled:false},{date:18,isdisabled:false},{date:19,isdisabled:false},{date:20,isdisabled:false},{date:21,isdisabled:false},{date:22,isdisabled:false},{date:23,isdisabled:false},{date:24,isdisabled:false},{date:25,isdisabled:false},{date:26,isdisabled:false},{date:27,isdisabled:false},{date:28,isdisabled:false},{date:29,isdisabled:false},{date:30,isdisabled:false},{date:31,isdisabled:false}]; public dateonly: any = [{date:1,isdisabled:false},{date:2,isdisabled:false},{date:3,isdisabled:false},{date:4,isdisabled:false},{date:5,isdisabled:false},{date:6,isdisabled:false},{date:7,isdisabled:false},{date:8,isdisabled:false},{date:9,isdisabled:false},{date:10,isdisabled:false},{date:11,isdisabled:false},{date:12,isdisabled:false},{date:13,isdisabled:false},{date:14,isdisabled:false},{date:15,isdisabled:false},{date:16,isdisabled:false},{date:17,isdisabled:false},{date:18,isdisabled:false},{date:19,isdisabled:false},{date:20,isdisabled:false},{date:21,isdisabled:false},{date:22,isdisabled:false},{date:23,isdisabled:false},{date:24,isdisabled:false},{date:25,isdisabled:false},{date:26,isdisabled:false},{date:27,isdisabled:false},{date:28,isdisabled:false},{date:29,isdisabled:false},{date:30,isdisabled:false},{date:31,isdisabled:false}];
public todate: any[] = this.dateonly; public todate: any[] = this.dateonly;
@ -55,6 +57,8 @@ export class PdQuestionEmpInfoPage {
this.pdid=this.pdDetails.pd_id; this.pdid=this.pdDetails.pd_id;
this.customer_segment_abbr = this.pdDetails.customer_segment_abbr; this.customer_segment_abbr = this.pdDetails.customer_segment_abbr;
this.pd_cus_segment = this.pdDetails.customer_segment_abbr.toUpperCase(); this.pd_cus_segment = this.pdDetails.customer_segment_abbr.toUpperCase();
this.generalExistBusinessYear=100;
this.generalExistBusinessMonth=12;
this.getDropDownList(); this.getDropDownList();
this.getCompanyFromGeneralDetails(); this.getCompanyFromGeneralDetails();
this.getEmploymentDetails(); this.getEmploymentDetails();
@ -62,7 +66,11 @@ export class PdQuestionEmpInfoPage {
{ {
employer_name: [''], employer_name: [''],
employer_in_brief:[''], employer_in_brief:[''],
how_long_year: [''],
// members.controls.current_business_experiance_year.setValue(this.generalExistBusinessYear);
// members.controls.current_business_experiance_month.setValue(this.generalExistBusinessMonth);
how_long_year: ['',Validators.max(this.generalExistBusinessYear)],
how_long_month: [''], how_long_month: [''],
total_business_experience: [''], total_business_experience: [''],
total_business_previous_experience: [''], total_business_previous_experience: [''],
@ -141,6 +149,39 @@ export class PdQuestionEmpInfoPage {
} }
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);
if(salary != ''){
let cash_amount = this.employmentForm.controls['amount_paid_in_cash'].value;
// let Bank_amount = this.employmentForm.controls['amount_paid_through_bank'].value;
this.employmentForm.controls['amount_paid_in_cash'].setValidators([Validators.max(salary)]);
this.employmentForm.controls['amount_paid_in_cash'].updateValueAndValidity();
let maxamt = salary-cash_amount
if(maxamt >= 0 ){
this.employmentForm.controls['amount_paid_through_bank'].setValidators([Validators.max(salary-cash_amount)]);
}
else{
this.employmentForm.controls['amount_paid_through_bank'].setValue('0');
this.employmentForm.controls['amount_paid_through_bank'].setValidators([Validators.max(0)]);
}
this.employmentForm.controls['amount_paid_through_bank'].updateValueAndValidity();
}
else{
this.toast.pdTriggerappmessage('Net Monthly Salary Is Empty.!');
this.employmentForm.controls['amount_paid_in_cash'].setValue('');
this.employmentForm.controls['amount_paid_in_cash'].updateValueAndValidity();
this.employmentForm.controls['amount_paid_through_bank'].setValue('');
this.employmentForm.controls['amount_paid_through_bank'].updateValueAndValidity();
return;
}
}
saveEmpInfo(){ saveEmpInfo(){
if (!this.employmentForm.valid) { if (!this.employmentForm.valid) {
this.toast.pdTriggerappmessage('Form Invalid Try Again.!'); this.toast.pdTriggerappmessage('Form Invalid Try Again.!');
@ -242,6 +283,24 @@ export class PdQuestionEmpInfoPage {
} }
} }
checkWithExistYear(e) {
let data1 = this.company_list.filter(c => c.company_name == e.split('-')[1])[0];
// console.log(data1);
console.log('this.generalExistBusinessMonth',this.generalExistBusinessMonth);
console.log('this.generalExistBusinessYear',this.generalExistBusinessYear);
if(data1.business_month != null && data1.business_month != '' && data1.business_month != undefined){
this.generalExistBusinessMonth = data1.business_month
}
if(data1.business_years){
this.generalExistBusinessYear = data1.business_years
}
this.employmentForm.controls['how_long_year'].setValidators([Validators.max(this.generalExistBusinessYear)]);
this.employmentForm.controls['how_long_year'].updateValueAndValidity();
// console.log('this.generalExistBusinessMonth',this.generalExistBusinessMonth);
// console.log('this.generalExistBusinessYear',this.generalExistBusinessYear);
}
ConvertMonthintoYear(e) { ConvertMonthintoYear(e) {
@ -250,24 +309,49 @@ ConvertMonthintoYear(e) {
let converted_month: number = e % 12; let converted_month: number = e % 12;
let converted_year: number = e / 12; let converted_year: number = e / 12;
this.employmentForm.controls.how_long_year.setValue(+how_long_year + +Math.floor(converted_year)); if (how_long_year > this.generalExistBusinessYear) {
this.employmentForm.controls.how_long_month.setValue(Math.floor(converted_month)); this.employmentForm.controls['how_long_year'].setValidators([Validators.max(this.generalExistBusinessYear)]);
this.employmentForm.controls['how_long_year'].updateValueAndValidity();
this.employmentForm.controls['how_long_year'].setValue('');
this.employmentForm.controls['how_long_month'].setValue('');
}
else {
if (how_long_year == this.generalExistBusinessYear && +converted_month > this.generalExistBusinessMonth) {
this.employmentForm.controls['how_long_year'].setValidators([Validators.max(this.generalExistBusinessYear)]);
this.employmentForm.controls['how_long_year'].updateValueAndValidity();
this.employmentForm.controls['how_long_month'].setValidators([Validators.max(this.generalExistBusinessMonth)]);
this.employmentForm.controls['how_long_month'].updateValueAndValidity();
} else {
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));
}
}
} }
checkWorkingExperiences(){ checkWorkingExperiences(){
// this.workExperienceErrorFlag = (+this.employmentForm.controls.total_business_experience.value ) <= (+this.employmentForm.controls.how_long_year.value) ? true : false; // this.workExperienceErrorFlag = (+this.employmentForm.controls.total_business_experience.value ) <= (+this.employmentForm.controls.how_long_year.value) ? true : false;
// this.workExperienceFlag = (+this.employmentForm.controls.total_business_experience.value ) < (+this.employmentForm.controls.how_long_year.value) ? false : true; // this.workExperienceFlag = (+this.employmentForm.controls.total_business_experience.value ) < (+this.employmentForm.controls.how_long_year.value) ? false : true;
if((+this.employmentForm.controls.total_business_experience.value ) < (+this.employmentForm.controls.how_long_year.value)){
console.log(+this.employmentForm.controls.total_business_experience.value , +this.employmentForm.controls.how_long_year.value); this.employmentForm.controls['total_business_experience'].setValidators([Validators.min(+this.employmentForm.controls.how_long_year.value)]);
this.workExperienceFlag = false; this.employmentForm.controls['total_business_experience'].updateValueAndValidity();
this.workExperienceErrorFlag = true;
this.expFocus.nativeElement.focus(); if(!this.employmentForm.controls['total_business_experience'].valid){
this.expFocus.nativeElement.focus();
} }
else{
this.workExperienceFlag = true; this.workExperienceFlag = +this.employmentForm.controls.total_business_experience.value > +this.employmentForm.controls.how_long_year.value ? true : false;
this.workExperienceErrorFlag = false;
if(!this.workExperienceFlag){
this.employmentForm.controls['total_business_previous_experience'].setValue('');
this.employmentForm.controls['total_business_previous_experience'].updateValueAndValidity();
} }
} }
inWords(val,flag:number){ inWords(val,flag:number){

View File

@ -66,6 +66,7 @@ export class PdQuestionLoansPage {
sourceList:any=[]; sourceList:any=[];
pdid:number; pdid:number;
m_endUseForLoan:any; m_endUseForLoan:any;
subProductName : any;
//public filterCtrl:FormControl=new FormControl //public filterCtrl:FormControl=new FormControl
private dbmasters: Dbmaster[]; private dbmasters: Dbmaster[];
/** Subject that emits when the component has been destroyed. */ /** Subject that emits when the component has been destroyed. */
@ -78,6 +79,7 @@ export class PdQuestionLoansPage {
this.applicants = this.pdDetails.applicat_details this.applicants = this.pdDetails.applicat_details
this.applicants = this.applicants.filter(appt => appt.applicant_type != 2); this.applicants = this.applicants.filter(appt => appt.applicant_type != 2);
this.productAbbr = this.pdDetails.product_abbr; this.productAbbr = this.pdDetails.product_abbr;
this.subProductName = this.pdDetails.subproduct_name;
this.users = this.aws.getlocale(); this.users = this.aws.getlocale();
this.pdid=this.pdDetails.pd_id; this.pdid=this.pdDetails.pd_id;
this.getDropdown(); this.getDropdown();
@ -211,9 +213,9 @@ export class PdQuestionLoansPage {
} }
return 0 return 0
}); });
console.log("drop",this.dbmasters)
this.filteredBanks.next(this.dbmasters.slice()) this.filteredBanks.next(this.dbmasters.slice())
console.log("filtere first",this.filteredBanks);
}) })
this.qustCat.getEndUseForLoan(this.pdid,this.pdDetails.fk_subproduct_id).subscribe(data=>{ this.qustCat.getEndUseForLoan(this.pdid,this.pdDetails.fk_subproduct_id).subscribe(data=>{
@ -230,44 +232,27 @@ export class PdQuestionLoansPage {
this.qustCat.getcommondrop('MORTAGEPROPERTIES').subscribe( this.qustCat.getcommondrop('MORTAGEPROPERTIES').subscribe(
data => { data => {
if(data['dataStatus']==true){ if(data['dataStatus']==true){
console.log('data[records]',data['records']);
let that = this; let that = this;
this.m_mortageTypeProperty = data['records'].filter( this.m_mortageTypeProperty = data['records'].filter(
// function(data){
// if(that.pdDetails.product_abbr !="LAP" && data.group_name==that.pdDetails.product_abbr && data.isactive==1 )
// {
// return data;
// }else if(that.pdDetails.product_abbr =="LAP" && data.sub_group_name==that.pdDetails.subproduct_name)
// {
// return data;
// }else
// {
// return ;
// }
// });
function (data) { function (data) {
if (that.pdDetails.product_abbr != "LAP") { if (that.pdDetails.product_abbr != "LAP") {
if (data.group_name == that.pdDetails.product_abbr && data.isactive == 1) { if (data.group_name == that.pdDetails.product_abbr && data.isactive == 1) {
return data; return data;
} }
} }
else if (that.pdDetails.product_abbr == "LAP") { else if (that.pdDetails.product_abbr == "LAP") {
if (data.group_name == that.productAbbr && data.sub_group_name == that.subProductName && data.isactive == 1) {
if (data.group_name == that.pdDetails.product_abbr && data.sub_group_name == that.pdDetails.subproduct_name && data.isactive == 1) {
return data; return data;
} }
else if (data.group_name == that.pdDetails.product_abbr && data.sub_group_name != null && data.isactive == 1) { else if (data.group_name == that.pdDetails.product_abbr && data.sub_group_name == null && data.isactive == 1) {
return data; return data;
} }
} }
}); });
// this.mortage_type(this.propertyType); // this.mortage_type(this.propertyType);
} }
console.log('this.m_mortageTypeProperty',this.m_mortageTypeProperty);
}); });
this.qustCat.getcommondrop('SOURCEOFBALANCETRANSFER').subscribe( this.qustCat.getcommondrop('SOURCEOFBALANCETRANSFER').subscribe(
data => { data => {
@ -362,10 +347,11 @@ export class PdQuestionLoansPage {
mortage_type(mortage_value) mortage_type(mortage_value)
{ {
console.log('mortage_value',mortage_value);
console.log('this.m_mortageTypeProperty',this.m_mortageTypeProperty);
let mortagetypes = this.m_mortageTypeProperty.filter(mor=>mor.mortage_property_id==mortage_value)[0]; let mortagetypes = this.m_mortageTypeProperty.filter(mor=>mor.mortage_property_id==mortage_value)[0];
var property_name=mortagetypes.property_name let property_name = mortagetypes.property_name.replace(/\s/g, "").toLowerCase();
if(property_name=='Others (Please Specify)') if(property_name=='others(pleasespecify)')
{ {
this.mortageAccess = true; this.mortageAccess = true;
}else }else

View File

@ -38,10 +38,14 @@ export class PdQuestionOtherIncomePage {
mergeCompanyApplicant: any=[]; mergeCompanyApplicant: any=[];
applicants: any=[]; applicants: any=[];
isOrganisationOwner: any=[]; isOrganisationOwner: any=[];
customer_segment_abbr: any;
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,public qustCat:QuestionCategoryProvider,public aws:AwsServiceProvider,public toast:ToastProvider, public constant:ConstantsProvider) { constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,public qustCat:QuestionCategoryProvider,public aws:AwsServiceProvider,public toast:ToastProvider, public constant:ConstantsProvider) {
this.pdDetails = this.navParams.get('pdDetails'); this.pdDetails = this.navParams.get('pdDetails');
this.pdid=this.pdDetails.pd_id; this.pdid=this.pdDetails.pd_id;
this.FormId = this.navParams.get('FormId'); this.FormId = this.navParams.get('FormId');
this.customer_segment_abbr = this.pdDetails.customer_segment_abbr;
console.log('this.customer_segment_abbr',this.customer_segment_abbr)
this.applicants=this.pdDetails.applicat_details.filter(val=>val.pd_co_applicant_id != 0) this.applicants=this.pdDetails.applicat_details.filter(val=>val.pd_co_applicant_id != 0)
this.applicants.push({'pd_co_applicant_id': 0,'applicant_name': "Others"}) this.applicants.push({'pd_co_applicant_id': 0,'applicant_name': "Others"})
this.getFrequency(); this.getFrequency();
@ -163,6 +167,15 @@ getFrequency() {
if(res['dataStatus']==true) if(res['dataStatus']==true)
{ {
this.sourceIncome = res['records']; this.sourceIncome = res['records'];
if (this.customer_segment_abbr == 'SE-RI') {
let inx = this.sourceIncome.map(data => data.name).indexOf("Rental Income")
/** -X- Please NOTE THIS :
* inx is '-1' -> this will remove the last item from array
* so that If Condition is given. */
if (inx !== -1) {
this.sourceIncome.splice(this.sourceIncome.map(data => data.name).indexOf("Rental Income"), 1);
}
}
} }
}); });

View File

@ -23,7 +23,11 @@ page-pd-question-rental-info {
mat-select{ mat-select{
margin-top:7px; margin-top:7px;
} }
textarea.mat-input-element {
padding: 0px 0;
margin: 10px 0;
}
input{ input{
height: 30px; height: 32px;
} }
} }

View File

@ -29680,6 +29680,10 @@ page-pd-question-emp-info mat-hint {
font-size: 11px; font-size: 11px;
} }
page-pd-question-emp-info mat-error {
font-size: 11px;
}
page-pd-question-emp-info mat-card { page-pd-question-emp-info mat-card {
margin-bottom: 15px; margin-bottom: 15px;
border-radius: 10px !important; border-radius: 10px !important;
@ -29903,6 +29907,11 @@ page-pd-question-rental-info mat-select {
margin-top: 7px; margin-top: 7px;
} }
page-pd-question-rental-info input { page-pd-question-rental-info textarea.mat-input-element {
height: 30px; padding: 0px 0;
margin: 10px 0;
}
page-pd-question-rental-info input {
height: 32px;
} }