changes : ps
This commit is contained in:
parent
cc226275b8
commit
e3a05bbaa2
@ -225,14 +225,17 @@ export class EditPdMasterComponent implements OnInit {
|
||||
|
||||
//get sub product list based on prokduct id
|
||||
getSubproductList(productID:string){
|
||||
this.customerSegmentList=this.customerSegmentAllList;
|
||||
console.log('this.customerSegmentAllList',this.customerSegmentAllList);
|
||||
if(productID != '4'){
|
||||
console.log('if',this.customerSegmentList);
|
||||
this.subProductList= this.productList.filter(item => item.product_id == productID);
|
||||
this.subProductList=this.subProductList[0].subproducts;
|
||||
this.customerSegmentList=this.customerSegmentAllList;
|
||||
}
|
||||
else if(productID == '4'){
|
||||
if(productID == '4'){
|
||||
let filtered = this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self'));
|
||||
this.customerSegmentList = filtered;
|
||||
console.log('else',this.customerSegmentList);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
<h2 mat-dialog-title class="paragraph_change">
|
||||
<div fxFlex="70" align="left" style="padding: 10px !important;">
|
||||
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
|
||||
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} <span *ngIf="subproduct_abbr">- {{subproduct_abbr}} </span></span><br>
|
||||
{{pageTitle}}
|
||||
</div>
|
||||
<div fxFlex="30" align="end" style="padding: 10px !important;">
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
<h2 mat-dialog-title class="paragraph_change">
|
||||
<div fxFlex="70" align="left" style="padding: 10px !important;">
|
||||
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
|
||||
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} <span *ngIf="subproduct_abbr">- {{subproduct_abbr}} </span></span><br>
|
||||
{{pageTitle}}
|
||||
</div>
|
||||
<div fxFlex="30" align="end" style="padding: 10px !important;">
|
||||
|
||||
@ -70,7 +70,7 @@
|
||||
<form [formGroup]="bankingForm" class="bankForm">
|
||||
<h2 mat-dialog-title class="paragraph_change">
|
||||
<div fxFlex="70" align="left" style="padding: 10px !important;">
|
||||
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
|
||||
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} <span *ngIf="subproduct_abbr">- {{subproduct_abbr}} </span></span><br>
|
||||
{{pageTitle}}
|
||||
</div>
|
||||
<div fxFlex="30" align="end" style="padding: 10px !important;">
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<form *ngIf="apiLoadFinish && loadDetails" [formGroup]="_businessAssetsQuesFrom" (submit)="onSubmit()" novalidate>
|
||||
<h2 mat-dialog-title class="paragraph_change">
|
||||
<div fxFlex="70" align="left" style="padding: 10px !important;">
|
||||
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
|
||||
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} <span *ngIf="subproduct_abbr">- {{subproduct_abbr}}</span> </span><br>
|
||||
{{pageTitle}}
|
||||
</div>
|
||||
<div fxFlex="30" align="end" style="padding: 10px !important;">
|
||||
|
||||
@ -295,7 +295,7 @@
|
||||
<div fxFlex="60" class="pb-0 text-sm-left" align="left">
|
||||
<mat-form-field appearance="outline" style="width: 100%">
|
||||
<mat-label>Remarks</mat-label>
|
||||
<textarea matInput placeholder="Remarks" formControlName="employment_remarks" required></textarea>
|
||||
<textarea matInput placeholder="Remarks" formControlName="employment_remarks"></textarea>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex="40" align="end">
|
||||
|
||||
@ -188,7 +188,7 @@ export class EmploymentInfoComponent implements OnInit {
|
||||
bonus_type_other: [''],
|
||||
any_delays: ['', Validators.compose([Validators.required])],
|
||||
// employment_details: this.fb.array([]),
|
||||
employment_remarks: ['', Validators.compose([Validators.required])],
|
||||
employment_remarks: [''],
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<div fxFlex="70" align="left" style="padding: 10px !important;">
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
|
||||
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
|
||||
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} <span *ngIf="subproduct_abbr">- {{subproduct_abbr}} </span></span><br>
|
||||
{{pageTitle}}
|
||||
</div>
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
<h2 mat-dialog-title class="paragraph_change">
|
||||
<div fxFlex="70" align="left" style="padding: 10px !important;">
|
||||
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
|
||||
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} <span *ngIf="subproduct_abbr">- {{subproduct_abbr}} </span></span><br>
|
||||
{{pageTitle}}
|
||||
</div>
|
||||
<div fxFlex="30" align="end" style="padding: 10px !important;">
|
||||
@ -63,16 +63,24 @@
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width:45%">
|
||||
<mat-select placeholder="Income earned by"
|
||||
<!-- <mat-select placeholder="Income earned by"
|
||||
formControlName="income_earned_by">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option value="{{person.applicant_id}}" *ngFor="let person of incomeEarnedBy">
|
||||
{{person.applicant_name}}
|
||||
</mat-option>
|
||||
<mat-option value="others">Others</mat-option>
|
||||
</mat-select> -->
|
||||
<mat-select multiple placeholder="Income earned by" formControlName="income_earned_by"
|
||||
[compareWith]="compareObjects" (selectionChange)="getOtherIncomeEarnedBy($event.value,i)">
|
||||
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
|
||||
<mat-option *ngFor="let val of group.groupValues" [value]="val">
|
||||
{{val.name}}
|
||||
</mat-option>
|
||||
</mat-optgroup>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:45%" *ngIf="details.get('income_earned_by').value == 'others'">
|
||||
<mat-form-field style="width:45%" *ngIf="isIncomeEarnedBy[i]">
|
||||
<input matInput autocomplete="off" placeholder="Specify Income earned by"
|
||||
formControlName="others_income_earned_by">
|
||||
</mat-form-field>
|
||||
|
||||
@ -24,7 +24,7 @@ import {
|
||||
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
|
||||
import { RentalInfoComponent} from './../rental-info/rental-info.component';
|
||||
import { RentalVerificationComponent } from './../rental-verification/rental-verification.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-other-income',
|
||||
@ -53,6 +53,9 @@ export class OtherIncomeComponent implements OnInit {
|
||||
amtInwords : any = [];
|
||||
applicants : any = [];
|
||||
incomeEarnedBy : any = [];
|
||||
existCompanyList: any =[];
|
||||
mergeCompanyApplicant: any=[];
|
||||
isIncomeEarnedBy: any=[];
|
||||
// stringArr = [];
|
||||
|
||||
constructor(notifier: NotifierService,
|
||||
@ -65,13 +68,15 @@ export class OtherIncomeComponent implements OnInit {
|
||||
@Inject(MAT_DIALOG_DATA) public pd_all_details: any)
|
||||
{
|
||||
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
|
||||
this.applicants = this.pd_all_details.pdapplicants_detials;
|
||||
this.form_id = 9;
|
||||
this.notifier = notifier;
|
||||
this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
|
||||
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
|
||||
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
|
||||
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
|
||||
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
|
||||
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
|
||||
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
|
||||
this.applicants = this.pd_all_details.pdapplicants_detials;
|
||||
this.applicants = this.applicants.filter(val=>val.applicant_type==0 || val.applicant_type==1);
|
||||
this.applicants.push({'pd_co_applicant_id':'0','applicant_name':'Others'});
|
||||
}
|
||||
|
||||
public viewerOptions: any = {
|
||||
@ -94,7 +99,30 @@ public viewerOptions: any = {
|
||||
}
|
||||
};
|
||||
ngOnInit() {
|
||||
|
||||
this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
|
||||
if (data.dataStatus) {
|
||||
this.existCompanyList = data.records.filter(val => val.is_active === true);
|
||||
}
|
||||
|
||||
// get company list
|
||||
let modifyCompanyList: any = [];
|
||||
if (this.existCompanyList.length > 0) {
|
||||
modifyCompanyList = this.existCompanyList.map(element => {
|
||||
return { id: element.company_order_id.toString(), name: element.company_name, group_id: 1 };
|
||||
});
|
||||
this.mergeCompanyApplicant.push({ groupName: 'COMPANIES', groupValues: modifyCompanyList })
|
||||
}
|
||||
// get applicant list
|
||||
let modifyApplicantList: any=[];
|
||||
if(this.applicants.length > 0){
|
||||
modifyApplicantList = this.applicants.map(element => {
|
||||
return {id:element.pd_co_applicant_id,name:element.applicant_name,group_id:2};
|
||||
});
|
||||
this.mergeCompanyApplicant.push({groupName:'APPLICANTS',groupValues:modifyApplicantList})
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
this.getFrequency();
|
||||
this.getSourceOtherIncome();
|
||||
this.initOtherincomeForm();
|
||||
@ -124,7 +152,21 @@ public viewerOptions: any = {
|
||||
if (result.length > 0) {
|
||||
result.forEach((val,index) => {
|
||||
this.amtInwords[index] = this._pd.convertNumberToWords(val.amount);
|
||||
// this.getOtherIncomeEarnedBy(val.income_earned_by,index);
|
||||
control.push(this.createDetail());
|
||||
let Avaliablity = 1;
|
||||
if(val.income_earned_by.length>0){
|
||||
val.income_earned_by.forEach(option => {
|
||||
if(option.id == 0 && option.group_id == 2){
|
||||
Avaliablity = option.id;
|
||||
}
|
||||
});
|
||||
}
|
||||
if(Avaliablity == 0){
|
||||
this.isIncomeEarnedBy[index] = true;
|
||||
}else if(Avaliablity == 1){
|
||||
this.isIncomeEarnedBy[index] = false;
|
||||
}
|
||||
});
|
||||
this.otherIncomeForm.controls['income_details'].setValue(result);
|
||||
} else {
|
||||
@ -183,9 +225,18 @@ public viewerOptions: any = {
|
||||
|
||||
data.records.forEach(val => {
|
||||
if (val.isactive == 1) {
|
||||
this.sourceData.push(val);
|
||||
this.sourceData.push(val);
|
||||
}
|
||||
})
|
||||
})
|
||||
if(this.customer_segment_abbr == 'SE-RI'){
|
||||
let inx = this.sourceData.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.sourceData.splice(this.sourceData.map(data => data.name).indexOf("Rental Income"), 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
addIncomeDetails() {
|
||||
@ -250,7 +301,7 @@ public viewerOptions: any = {
|
||||
// dialogRef.afterClosed()
|
||||
// .subscribe(dataresult => {
|
||||
// });
|
||||
const dialogRef = this.dialog.open(RentalInfoComponent, {
|
||||
const dialogRef = this.dialog.open(RentalVerificationComponent, {
|
||||
data: this.pd_all_details,
|
||||
maxWidth: '100vw',
|
||||
maxHeight: '100vh',
|
||||
@ -264,5 +315,43 @@ public viewerOptions: any = {
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// compare objects for merge two master table details
|
||||
compareObjects(o1: any, o2: any) {
|
||||
if(o1.id == o2.id && o1.group_id == o2.group_id)
|
||||
return true;
|
||||
else return false
|
||||
}
|
||||
|
||||
getOtherIncomeEarnedBy(value,i) {
|
||||
// console.log('value',value,'I',i);
|
||||
let Ctrls = <FormArray>this.otherIncomeForm.controls['income_details'];
|
||||
// console.log('ParCtrls',Ctrls);
|
||||
let ChdCtrls:any = <FormArray>Ctrls.controls[i];
|
||||
// console.log('ChdCtrls',ChdCtrls);
|
||||
|
||||
let Avaliablity = 1;
|
||||
console.log('val',value);
|
||||
if(value.length>0){
|
||||
value.forEach(option => {
|
||||
if(option.id == 0 && option.group_id == 2){
|
||||
Avaliablity = option.id;
|
||||
}
|
||||
});
|
||||
}
|
||||
if(Avaliablity == 0){
|
||||
// console.log('if Avaliablity',Avaliablity);
|
||||
ChdCtrls.controls.others_income_earned_by.setValidators([Validators.required]);
|
||||
this.isIncomeEarnedBy[i] = true;
|
||||
}else if(Avaliablity == 1){
|
||||
// console.log('else Avaliablity',Avaliablity);
|
||||
// console.log('esle this.isIncomeEarnedBy[ParInx]',this.isIncomeEarnedBy[i]);
|
||||
ChdCtrls.controls.others_income_earned_by.setValue('');
|
||||
ChdCtrls.controls.others_income_earned_by.clearValidators();
|
||||
this.isIncomeEarnedBy[i] = false;
|
||||
// console.log('else this.isIncomeEarnedBy[ParInx]',this.isIncomeEarnedBy[i]);
|
||||
}
|
||||
|
||||
ChdCtrls.controls.others_income_earned_by.updateValueAndValidity();
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<div fxFlex="70" align="left" style="padding: 10px !important;">
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
|
||||
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
|
||||
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - <span *ngIf="subproduct_abbr">{{subproduct_abbr}}</span> </span><br>
|
||||
{{pageTitle}}
|
||||
</div>
|
||||
|
||||
|
||||
@ -60,6 +60,7 @@ export class RentalVerificationComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
constructor(notifier: NotifierService, private _pd: PdTrigerService ,private _fb: FormBuilder, @Inject(MAT_DIALOG_DATA) public data: any,private dialogRef: MatDialogRef<RentalVerificationComponent>) {
|
||||
console.log('data',data);
|
||||
this.pdid = this.data.pdmaster_details.pd_id;
|
||||
this.notifier = notifier;
|
||||
this.form_id = 17;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user