Consolidate sheet : ps

This commit is contained in:
venbatechnologies@gmail.com 2019-06-14 20:02:34 +05:30
parent d6557b316a
commit 5003877721
11 changed files with 159 additions and 86 deletions

View File

@ -34,7 +34,7 @@
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 28%"> <mat-form-field style="width: 28%">
<input matInput autocomplete="off" placeholder=" Loan Application ID" formControlName="lender_applicant_id" type="text" required> <input matInput autocomplete="off" placeholder=" Loan Application ID" formControlName="lender_applicant_id" type="text" required>
<!-- <mat-error *ngIf="pdMain.lender_applicant_id.hasError('required')">Applicant ID Required</mat-error> --> <!-- <mat-error *ngIf="pdMain.lender_applicant_id.hasError('required')">Applicant ID Required</mat-error> -->
</mat-form-field> </mat-form-field>
@ -75,7 +75,7 @@
<!-- <mat-error *ngIf="pdMain.fk_product_id.hasError('required')">Product Required.</mat-error> --> <!-- <mat-error *ngIf="pdMain.fk_product_id.hasError('required')">Product Required.</mat-error> -->
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="pdMain.fk_product_id.value != '4'" style="width: 28%"> <mat-form-field *ngIf="isSubproductShown" style="width: 28%">
<mat-select placeholder="Sub Product Name" formControlName="fk_subproduct_id"> <mat-select placeholder="Sub Product Name" formControlName="fk_subproduct_id">
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
@ -85,7 +85,7 @@
</mat-select> </mat-select>
<!-- <mat-error *ngIf="pdMain.fk_subproduct_id.hasError('required')">Sub Product Required.</mat-error> --> <!-- <mat-error *ngIf="pdMain.fk_subproduct_id.hasError('required')">Sub Product Required.</mat-error> -->
</mat-form-field> </mat-form-field>
<!-- {{customerSegmentList | json}} --> <!-- {{customerSegmentList | json}} -->
<mat-form-field style="width: 28%"> <mat-form-field style="width: 28%">
<mat-select placeholder="Customer Segment" formControlName="fk_customer_segment"> <mat-select placeholder="Customer Segment" formControlName="fk_customer_segment">

View File

@ -50,6 +50,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
dynamicCoApplicant = []; dynamicCoApplicant = [];
disableAfterSubmit: boolean; disableAfterSubmit: boolean;
pincodeflag : any = []; pincodeflag : any = [];
isSubproductShown: boolean = true;
constructor(notifier: NotifierService, private _fb: FormBuilder, private route: ActivatedRoute, constructor(notifier: NotifierService, private _fb: FormBuilder, private route: ActivatedRoute,
private router: Router, private _pd: PdTrigerService, private _aws: AwsService, private ListPdComponent: ListPdComponent, private router: Router, private _pd: PdTrigerService, private _aws: AwsService, private ListPdComponent: ListPdComponent,
private titleCase : TitleCasePipe) { private titleCase : TitleCasePipe) {
@ -117,7 +118,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
this.lenderShortName = lender['short_name']; this.lenderShortName = lender['short_name'];
this._PDtriggerForm.controls.pd_branch_id.setValue(null); this._PDtriggerForm.controls.pd_branch_id.setValue(null);
if(this.lenderShortName = 'CLIX'){ if(this.lenderShortName == 'CLIX'){
let getProductAbbr = this.productAllList.map(dval => dval.product_abbr); let getProductAbbr = this.productAllList.map(dval => dval.product_abbr);
let ClixProductAbbr = ['BL','LAEP']; let ClixProductAbbr = ['BL','LAEP'];
@ -127,7 +128,6 @@ export class AddPdComponent implements OnInit, OnDestroy {
return this.productAllList[findIndex]; return this.productAllList[findIndex];
}); });
this.productList = FilteredAbbr.length > 0 ? FilteredAbbr : this.productAllList; this.productList = FilteredAbbr.length > 0 ? FilteredAbbr : this.productAllList;
} }
else{ else{
this.productList = this.productAllList; this.productList = this.productAllList;
@ -138,7 +138,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
console.log(this.productList); console.log(this.productList);
console.log('this.productList',this.productList); console.log('this.productList',this.productList);
this._PDtriggerForm.controls['fk_product_id'].setValue(''); this._PDtriggerForm.controls['fk_product_id'].setValue('');
this._PDtriggerForm.controls['fk_subproduct_id'].setValue(''); this._PDtriggerForm.controls['fk_subproduct_id'].setValue('');
this._PDtriggerForm.controls['fk_pd_type'].setValue(''); this._PDtriggerForm.controls['fk_pd_type'].setValue('');
@ -201,29 +201,51 @@ export class AddPdComponent implements OnInit, OnDestroy {
//get sub product list based on prokduct id //get sub product list based on prokduct id
getSubproductList(productID: string) { getSubproductList(productID: string) {
// console.log('productID',productID); let productabbr : any;
this.subProductList = this.productList.filter(item => item.product_id == productID); if(productID !== undefined && productID !== null && productID !== '') {
this.subProductList = this.subProductList[0].subproducts; this.subProductList = this.productList.filter(item => item.product_id == productID);
this.subProductList = this.subProductList.filter(item => item.is_others == 0); this.subProductList = this.subProductList[0].subproducts;
let productabbr : any = this.productAllList.filter(item => item.product_id == productID)[0].abbr; this.subProductList = this.subProductList.filter(item => item.is_others == 0);
console.log('productabbr',productabbr); productabbr = this.productAllList.filter(item => item.product_id == productID)[0].abbr;
if(this.lenderShortName == 'CLIX'){
let tempdata = this.subProductList.filter(item => item.subproduct_name == 'Not Applicable'); }
this._PDtriggerForm.controls['fk_subproduct_id'].setValue(tempdata[0].subproduct_id); else{
productabbr = ''
this.subProductList = [];
this._PDtriggerForm.controls['fk_subproduct_id'].setValue('');
this._PDtriggerForm.controls['fk_pd_type'].setValue('');
this._PDtriggerForm.controls['fk_customer_segment'].setValue('');
this._PDtriggerForm.controls['loan_amount'].setValue('');
}
/**customer segment */
switch(productabbr){
case 'BL' :
console.log(1);
this.customerSegmentList = this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self'));
this._PDtriggerForm.controls['fk_subproduct_id'].setValue(null);
this.isSubproductShown = false;
break;
case 'LAEP':
console.log(2);
this.customerSegmentList = this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self'));
this._PDtriggerForm.controls['fk_subproduct_id'].setValue(null);
this.isSubproductShown = false;
break;
default:
console.log(3);
this.customerSegmentList = this.customerSegmentAllList;
this.isSubproductShown = true;
break;
}
if(this.lenderShortName == 'CLIX' && productabbr != ''){
this._PDtriggerForm.controls['fk_pd_type'].setValue('1'); this._PDtriggerForm.controls['fk_pd_type'].setValue('1');
// this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self'))
// console.log('this.customerSegmentAllList',this.customerSegmentAllList);
this._PDtriggerForm.controls['fk_customer_segment'].setValue('5'); this._PDtriggerForm.controls['fk_customer_segment'].setValue('5');
this._PDtriggerForm.controls['loan_amount'].setValue(0); this._PDtriggerForm.controls['loan_amount'].setValue(0);
} }
else{
if(productabbr != 'BL'){this._PDtriggerForm.controls['fk_subproduct_id'].setValue(null)}
}
this.customerSegmentList = (productabbr != 'BL' && productabbr != 'LAEP' )?this.customerSegmentAllList:this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self'));
} }
//get city list details based on state id //get city list details based on state id

View File

@ -75,7 +75,7 @@
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 29%"> <mat-form-field style="width: 29%">
<mat-select placeholder="Product Name" formControlName="fk_product_id" <mat-select placeholder="Product Name" formControlName="fk_product_id"
(selectionChange)="getSubproductList(pdMain.fk_product_id.value)"> (selectionChange)="getSubproductList(pdMain.fk_product_id.value,2)">
<mat-option> <mat-option>
Select Select
</mat-option> </mat-option>
@ -87,7 +87,7 @@
</mat-form-field> </mat-form-field>
<!-- <mat-form-field style="width: 29%"> --> <!-- <mat-form-field style="width: 29%"> -->
<mat-form-field *ngIf="pdMain.fk_product_id.value != '4'" style="width: 29%"> <mat-form-field *ngIf="isSubproductShown" style="width: 29%">
<mat-select placeholder="Sub product Name" formControlName="fk_subproduct_id"> <mat-select placeholder="Sub product Name" formControlName="fk_subproduct_id">
<mat-option>Select</mat-option> <mat-option>Select</mat-option>

View File

@ -54,6 +54,8 @@ export class EditPdMasterComponent implements OnInit {
"QC_COMPLETED" :'QC_COMPLETED', "QC_COMPLETED" :'QC_COMPLETED',
}; };
lenderShortName: any; lenderShortName: any;
isSubproductShown: boolean = true;
productShortName : any;
constructor(private _fb: FormBuilder, constructor(private _fb: FormBuilder,
private _pd: PdTrigerService, notifier: NotifierService,private dialogRef: MatDialogRef<EditPdMasterComponent>, private _pd: PdTrigerService, notifier: NotifierService,private dialogRef: MatDialogRef<EditPdMasterComponent>,
@Inject(MAT_DIALOG_DATA) public data: any,private titleCase : TitleCasePipe) { @Inject(MAT_DIALOG_DATA) public data: any,private titleCase : TitleCasePipe) {
@ -149,7 +151,7 @@ export class EditPdMasterComponent implements OnInit {
// this.productList=data.records // this.productList=data.records
this.productAllList = data.records this.productAllList = data.records
if(this.data.records.fk_product_id){ if(this.data.records.fk_product_id){
this.getSubproductList(this.data.records.fk_product_id); this.getSubproductList(this.data.records.fk_product_id,1);
} }
} }
}, error => this.errorMessage = <any> error); }, error => this.errorMessage = <any> error);
@ -267,28 +269,45 @@ export class EditPdMasterComponent implements OnInit {
get pdMain() { return this._EditPDtriggerForm.controls; } get pdMain() { return this._EditPDtriggerForm.controls; }
//get sub product list based on prokduct id //get sub product list based on prokduct id
getSubproductList(productID:string){ getSubproductList(productID:string,flag:number){
console.log('productID',productID);
this.customerSegmentList=this.customerSegmentAllList; this.customerSegmentList=this.customerSegmentAllList;
let productabbr : any = this.productAllList.filter(item => item.product_id == productID)[0].abbr;
if(this.lenderShortName == 'CLIX'){
this.customerSegmentList = (productabbr != 'BL' && productabbr != 'LAEP' )?this.customerSegmentAllList:this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self')); if (productID !== undefined && productID !== null && productID !== '') {
let tempdata = this.subProductList.filter(item => item.subproduct_name == 'Not Applicable'); this.productShortName = this.productAllList.filter(item => item.product_id == productID)[0].product_abbr;
// this._EditPDtriggerForm.controls['fk_subproduct_id'].setValue(tempdata[0].subproduct_id); this.subProductList=this.productAllList.filter(item => item.product_id == productID);
// this._EditPDtriggerForm.controls['fk_pd_type'].setValue('1');
// this._EditPDtriggerForm.controls['fk_customer_segment'].setValue('5');
// this._EditPDtriggerForm.controls['loan_amount'].setValue(0);
}else{
// if(productID != '4'){
if(productabbr == 'BL'){
this.subProductList= this.productList.filter(item => item.product_id == productID);
this.subProductList=this.subProductList[0].subproducts; this.subProductList=this.subProductList[0].subproducts;
} }
// if(productID == '4'){ else {
if(productabbr == 'BL'){ this.productShortName = '';
let filtered = this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self')); this.subProductList=[];
this.customerSegmentList = filtered; }
} // console.log('this.productAbbr',this.productShortName);
} switch (this.productShortName) {
case 'BL':
console.log(1);
this.customerSegmentList = this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self'));
if(this.lenderShortName == 'CLIX' && flag==2 ){ this._EditPDtriggerForm.controls['fk_customer_segment'].setValue('5'); }
this._EditPDtriggerForm.controls['fk_subproduct_id'].setValue(null);
this.subProductList=[];
this.isSubproductShown = false;
break;
case 'LAEP':
console.log(2);
this.customerSegmentList = this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self'));
this._EditPDtriggerForm.controls['fk_subproduct_id'].setValue(null);
if(this.lenderShortName == 'CLIX' && flag==2 ){ this._EditPDtriggerForm.controls['fk_customer_segment'].setValue('5'); }
this.subProductList=[];
this.isSubproductShown = false;
break;
default:
console.log(3);
this.customerSegmentList = this.customerSegmentAllList;
console.log('productID', productID);
this.isSubproductShown = true;
break;
}
} }
// //get city list details based on state id // //get city list details based on state id
// getCityList(stateID:string){ // getCityList(stateID:string){
@ -420,7 +439,7 @@ export class EditPdMasterComponent implements OnInit {
// this is for clear custom validator required fields // this is for clear custom validator required fields
clearCustomValidatorFields(){ clearCustomValidatorFields(){
console.log('functionclicked 2');
this._EditPDtriggerForm.controls['fk_lender_id'].clearValidators(); this._EditPDtriggerForm.controls['fk_lender_id'].clearValidators();
this._EditPDtriggerForm.controls['fk_lender_id'].updateValueAndValidity(); this._EditPDtriggerForm.controls['fk_lender_id'].updateValueAndValidity();
@ -455,7 +474,6 @@ export class EditPdMasterComponent implements OnInit {
} }
submitPdDetails(formValue: any, status:any) { submitPdDetails(formValue: any, status:any) {
console.log('functionclicked 3');
// let updateStatus = this.currentPDStatus == this.pdStatusCheck.DRAFT ? status : this.currentPDStatus == this.pdStatusCheck.TRIGGERED ? status : this.currentPDStatus; // let updateStatus = this.currentPDStatus == this.pdStatusCheck.DRAFT ? status : this.currentPDStatus == this.pdStatusCheck.TRIGGERED ? status : this.currentPDStatus;
let updateStatus = this.currentPDStatus; let updateStatus = this.currentPDStatus;
@ -466,9 +484,34 @@ export class EditPdMasterComponent implements OnInit {
return; return;
} }
} }
if(this.lenderShortName == 'CLIX'){ if(this.lenderShortName == 'CLIX'){
const control = <FormArray>this._EditPDtriggerForm.controls['addresses'];
let CtrlLength = control.controls.length;
if (CtrlLength > 0) {
let cnt = 0;
while (cnt < CtrlLength) {
let ChildCtrl: any = control.controls[cnt]
ChildCtrl.controls['addressline1'].setValidators([Validators.required]);
ChildCtrl.controls['addressline1'].updateValueAndValidity();
cnt++;
}
this._EditPDtriggerForm.controls['fk_product_id'].setValidators([Validators.required]);
this._EditPDtriggerForm.controls['fk_product_id'].updateValueAndValidity();
this._EditPDtriggerForm.controls['pd_branch_id'].setValidators([Validators.required]);
this._EditPDtriggerForm.controls['pd_branch_id'].updateValueAndValidity();
this._EditPDtriggerForm.controls['pd_contact_person'].setValidators([Validators.required]);
this._EditPDtriggerForm.controls['pd_contact_person'].updateValueAndValidity();
this._EditPDtriggerForm.controls['pd_contact_mobileno'].setValidators([Validators.required]);
this._EditPDtriggerForm.controls['pd_contact_mobileno'].updateValueAndValidity();
this._EditPDtriggerForm.controls['fk_pd_type'].clearValidators(); this._EditPDtriggerForm.controls['fk_pd_type'].clearValidators();
this._EditPDtriggerForm.controls['fk_pd_type'].updateValueAndValidity(); this._EditPDtriggerForm.controls['fk_pd_type'].updateValueAndValidity();
@ -478,7 +521,14 @@ export class EditPdMasterComponent implements OnInit {
this._EditPDtriggerForm.controls['loan_amount'].clearValidators(); this._EditPDtriggerForm.controls['loan_amount'].clearValidators();
this._EditPDtriggerForm.controls['loan_amount'].updateValueAndValidity(); this._EditPDtriggerForm.controls['loan_amount'].updateValueAndValidity();
if(this._EditPDtriggerForm.invalid) {
this.validateAllFormFields(this._EditPDtriggerForm);
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
return;
}
}
} }
return;
let my_array = this._EditPDtriggerForm.value; let my_array = this._EditPDtriggerForm.value;
let concat_landline let concat_landline
if(my_array.lender_stdcode != null && my_array.lender_landline != null){ if(my_array.lender_stdcode != null && my_array.lender_landline != null){

View File

@ -98,7 +98,7 @@
</mat-panel-title> </mat-panel-title>
</mat-expansion-panel-header> </mat-expansion-panel-header>
<mat-form-field> <mat-form-field>
<mat-select placeholder="Account Name" formControlName="applicant_name" <mat-select placeholder="Account Holders Name" formControlName="applicant_name"
[compareWith]="compareObjects"> [compareWith]="compareObjects">
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName"> <mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val"> <mat-option *ngFor="let val of group.groupValues" [value]="val">
@ -109,7 +109,7 @@
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="checkOthers(itemrow.get('applicant_name').value)===true" <mat-form-field *ngIf="checkOthers(itemrow.get('applicant_name').value)===true"
style="width:45%"> style="width:45%">
<input matInput placeholder="Specify Applicant Name" formControlName="other_applicant" <input matInput placeholder="Specify Account Holders Name" formControlName="other_applicant"
autocomplete="off" [value]="itemrow.get('other_applicant').value | titlecase"> autocomplete="off" [value]="itemrow.get('other_applicant').value | titlecase">
<mat-error *ngIf="itemrow.controls['other_applicant'].hasError('required')">Applicant Name Required</mat-error> <mat-error *ngIf="itemrow.controls['other_applicant'].hasError('required')">Applicant Name Required</mat-error>
</mat-form-field> </mat-form-field>

View File

@ -31,7 +31,7 @@
</mat-panel-description> --> </mat-panel-description> -->
</mat-expansion-panel-header> </mat-expansion-panel-header>
<mat-form-field> <mat-form-field>
<mat-select placeholder="Account Name" formControlName="applicant_name" <mat-select placeholder="Account Holders Name" formControlName="applicant_name"
[compareWith]="compareObjects"> [compareWith]="compareObjects">
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName"> <mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val"> <mat-option *ngFor="let val of group.groupValues" [value]="val">
@ -42,7 +42,7 @@
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="checkOthers(itemrow.get('applicant_name').value)===true" <mat-form-field *ngIf="checkOthers(itemrow.get('applicant_name').value)===true"
style="width:45%"> style="width:45%">
<input matInput placeholder="Specify Applicant Name" formControlName="other_applicant" <input matInput placeholder="Specify Account Holders Name" formControlName="other_applicant"
autocomplete="off" [value]="itemrow.get('other_applicant').value | titlecase"> autocomplete="off" [value]="itemrow.get('other_applicant').value | titlecase">
<mat-error *ngIf="itemrow.controls['other_applicant'].hasError('required')">Applicant Name Required</mat-error> <mat-error *ngIf="itemrow.controls['other_applicant'].hasError('required')">Applicant Name Required</mat-error>
</mat-form-field> </mat-form-field>

View File

@ -13,6 +13,7 @@ import { BusinessAssetsInfoComponent } from './../../forms/business-assets-info/
import { BusinessBankingDetailsComponent } from './../../forms/business-banking-details/business-banking-details.component'; import { BusinessBankingDetailsComponent } from './../../forms/business-banking-details/business-banking-details.component';
import { GetAnswerableFormsPipe } from './../../../../../pd-pipes/get-answerable-forms.pipe'; import { GetAnswerableFormsPipe } from './../../../../../pd-pipes/get-answerable-forms.pipe';
import {AssessedIncomeComponent} from './../assessed-income/assessed-income.component'; import {AssessedIncomeComponent} from './../assessed-income/assessed-income.component';
import { FuturePlansAndBusinessEnvironmentComponent } from './../../forms/future-plans-and-business-environment/future-plans-and-business-environment.component';
@Component({ @Component({
selector: 'app-business-info-group', selector: 'app-business-info-group',
@ -30,6 +31,9 @@ export class BusinessInfoGroupComponent implements OnInit {
pdid: number; pdid: number;
form_id: number; form_id: number;
waitLoading:boolean; waitLoading:boolean;
lender_short_name :any;
product_abbr :any;
constructor(notifier: NotifierService, constructor(notifier: NotifierService,
private route: ActivatedRoute, private route: ActivatedRoute,
private router: Router, private router: Router,
@ -42,6 +46,9 @@ export class BusinessInfoGroupComponent implements OnInit {
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id; 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.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr; this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
this.lender_short_name = this.pd_all_details.pdmaster_details.lender_short_name;
this.product_abbr = this.pd_all_details.pdmaster_details.product_abbr;
} }
ngOnInit() { ngOnInit() {
@ -189,6 +196,20 @@ export class BusinessInfoGroupComponent implements OnInit {
.subscribe(dataresult => { .subscribe(dataresult => {
this.getCompanyListForBusiness(); this.getCompanyListForBusiness();
}); });
}else
if((this.lender_short_name == 'CLIX' || this.product_abbr == 'LAEP') && details.form_id==23){
const dialogRef = this.dialog.open(FuturePlansAndBusinessEnvironmentComponent, {
data: this.pd_all_details,
maxWidth: '100vw',
maxHeight: '100vh',
height: '100%',
width: '100%',
disableClose: true
});
dialogRef.afterClosed()
.subscribe(dataresult => {
this.getCompanyListForBusiness();
});
} }
} }

View File

@ -44,7 +44,7 @@ export class FuturePlansAndBusinessEnvironmentComponent implements OnInit {
parent_pdid: string; parent_pdid: string;
pdid: string; pdid: string;
form_id: number; form_id: number;
company_id: any;
public _futurePlansForm: FormGroup; public _futurePlansForm: FormGroup;
public submitted = false; public submitted = false;
@ -63,6 +63,7 @@ export class FuturePlansAndBusinessEnvironmentComponent implements OnInit {
this.parent_pdid = this.pd_all_details.pdmaster_details.parent_pd_id; this.parent_pdid = this.pd_all_details.pdmaster_details.parent_pd_id;
this.pdid = this.pd_all_details.pdmaster_details.pd_id; this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 23; this.form_id = 23;
this.company_id =this.pd_all_details.company_id;
this.notifier = notifier; this.notifier = notifier;
this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant; this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
@ -118,6 +119,7 @@ export class FuturePlansAndBusinessEnvironmentComponent implements OnInit {
params.parent_pdid=this.parent_pdid; params.parent_pdid=this.parent_pdid;
params.pd_id = this.pdid; params.pd_id = this.pdid;
params.pd_form_id = '23'; params.pd_form_id = '23';
params.company_id = this.company_id;
this.pdTrigerService.getPDFormDetailsWithID(params).subscribe(data => { this.pdTrigerService.getPDFormDetailsWithID(params).subscribe(data => {
if (data.dataStatus) { if (data.dataStatus) {
this._futurePlansForm.controls.usp_of_the_business.setValue(data.records.usp_of_the_business); this._futurePlansForm.controls.usp_of_the_business.setValue(data.records.usp_of_the_business);
@ -137,8 +139,8 @@ export class FuturePlansAndBusinessEnvironmentComponent implements OnInit {
}) })
this.pdTrigerService.retriveFile(this.pdid,params.pd_form_id,null).subscribe(data => { this.pdTrigerService.retriveFile(this.pdid,params.pd_form_id,this.company_id).subscribe(data => {
if (data.status == 230) { if (data.status == 200) {
if(data.records.length>0){ if(data.records.length>0){
data.records.forEach((val, index) => { data.records.forEach((val, index) => {
let splitted = val.pd_document_name.split("."); let splitted = val.pd_document_name.split(".");

View File

@ -228,9 +228,9 @@ export class GeneralInfoComponent implements OnInit {
return data.records.persons_with_relationships[key]; return data.records.persons_with_relationships[key];
}); });
if (exist_personsWithRelationships.length > 0) { if (exist_personsWithRelationships.length > 0) {
exist_personsWithRelationships.forEach(element => { exist_personsWithRelationships.forEach((element, index) => {
//individualsControl.push(this.createIndividulas(element)) //individualsControl.push(this.createIndividulas(element))
personsWithRelationshipsControl.push(this.createPersonsWithRelationships(element)); personsWithRelationshipsControl.push(this.createPersonsWithRelationships(element,index));
}); });
} }
if (this.customer_segment_abbr != 'SE-RI') { if (this.customer_segment_abbr != 'SE-RI') {
@ -315,7 +315,7 @@ export class GeneralInfoComponent implements OnInit {
element.qualification = '', element.qualification = '',
element.course_name = '', element.course_name = '',
individualsControl.push(this.createIndividulas(element)); individualsControl.push(this.createIndividulas(element));
personsWithRelationshipsControl.push(this.createPersonsWithRelationships(element)); personsWithRelationshipsControl.push(this.createPersonsWithRelationships(element,key));
//let relationControl = <FormArray>this._generalForm.controls['applicant_relation']; //let relationControl = <FormArray>this._generalForm.controls['applicant_relation'];
// let applicant_details: any= {'pd_co_applicant_id':element.pd_co_applicant_id,'applicant_name':element.applicant_name, 'individula_order_id':relationControl.controls.length+1}; // let applicant_details: any= {'pd_co_applicant_id':element.pd_co_applicant_id,'applicant_name':element.applicant_name, 'individula_order_id':relationControl.controls.length+1};
@ -365,11 +365,11 @@ export class GeneralInfoComponent implements OnInit {
}); });
} }
createPersonsWithRelationships(elementValue: any) { createPersonsWithRelationships(elementValue: any,indexVal:number) {
return this._fb.group({ return this._fb.group({
pd_co_applicant_id: [elementValue.pd_co_applicant_id], pd_co_applicant_id: [elementValue.pd_co_applicant_id],
applicant_name: [this.titleCase.transform(elementValue.applicant_name)], applicant_name: [this.titleCase.transform(elementValue.applicant_name)],
relationship: [elementValue.relationship], relationship: [indexVal === 0 ? '0' : elementValue.relationship],
relation_to: [elementValue.relation_to], relation_to: [elementValue.relation_to],
individuals_order_id: [elementValue.individuals_order_id], individuals_order_id: [elementValue.individuals_order_id],
is_active: [elementValue.is_active] is_active: [elementValue.is_active]
@ -543,8 +543,7 @@ export class GeneralInfoComponent implements OnInit {
individualsControl.push(this.createIndividulas(element)); individualsControl.push(this.createIndividulas(element));
let relationControl = <FormArray>this._generalForm.controls['persons_with_relationships']; let relationControl = <FormArray>this._generalForm.controls['persons_with_relationships'];
let applicant_details: any = { 'pd_co_applicant_id': element.pd_co_applicant_id, 'applicant_name': this.titleCase.transform(element.applicant_name), 'relationship': '', 'relation_to': '', 'individuals_order_id': element.individuals_order_id, 'is_active': element.is_active }; let applicant_details: any = { 'pd_co_applicant_id': element.pd_co_applicant_id, 'applicant_name': this.titleCase.transform(element.applicant_name), 'relationship': '', 'relation_to': '', 'individuals_order_id': element.individuals_order_id, 'is_active': element.is_active };
relationControl.push(this.createPersonsWithRelationships(applicant_details)); relationControl.push(this.createPersonsWithRelationships(applicant_details,individualsControl.controls.length-1));
}); });
} }
@ -613,7 +612,6 @@ export class GeneralInfoComponent implements OnInit {
updatePersonalRelation(indexVal) { updatePersonalRelation(indexVal) {
let control: any = <FormArray>this._generalForm.controls['persons_with_relationships']; let control: any = <FormArray>this._generalForm.controls['persons_with_relationships'];
control.controls[indexVal].value.relationship == 0 ? control.controls[indexVal].controls['relation_to'].setValue('') : control.controls[indexVal].controls['relation_to'].setValue(control.controls[indexVal].value.relation_to); control.controls[indexVal].value.relationship == 0 ? control.controls[indexVal].controls['relation_to'].setValue('') : control.controls[indexVal].controls['relation_to'].setValue(control.controls[indexVal].value.relation_to);
} }
// update company relation // update company relation
updateCompanyRelation(indexVal) { updateCompanyRelation(indexVal) {

View File

@ -63,7 +63,7 @@
formControlName="is_there_total_fund"> formControlName="is_there_total_fund">
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<mat-option value="yes disclose">Yes, Disclosed</mat-option> <mat-option value="yes disclose">Yes, Disclosed</mat-option>
<mat-option value="no not disclosed">No,not Disclosed</mat-option> <mat-option value="no not disclosed">No, Not Disclosed</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<span *ngIf="loanDetailsForm.controls['is_there_total_fund'].value == 'yes disclose'"> <span *ngIf="loanDetailsForm.controls['is_there_total_fund'].value == 'yes disclose'">

View File

@ -29,7 +29,6 @@ import {BusinessInfoGroupComponent } from './forms/business-info-group/business-
import {BusinessAssetsInfoComponent } from './forms/business-assets-info/business-assets-info.component'; import {BusinessAssetsInfoComponent } from './forms/business-assets-info/business-assets-info.component';
import {PdStatusChangeDialogueComponent } from './../pd-status-change-dialogue/pd-status-change-dialogue.component'; import {PdStatusChangeDialogueComponent } from './../pd-status-change-dialogue/pd-status-change-dialogue.component';
import {RentalVerificationComponent} from './forms/rental-verification/rental-verification.component'; import {RentalVerificationComponent} from './forms/rental-verification/rental-verification.component';
import {FuturePlansAndBusinessEnvironmentComponent} from './forms/future-plans-and-business-environment/future-plans-and-business-environment.component';
@Component({ @Component({
selector: 'app-start-pd', selector: 'app-start-pd',
@ -45,8 +44,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
categoryList: any = []; categoryList: any = [];
pdMasterList: any = []; pdMasterList: any = [];
pdFullDetails:any=[]; pdFullDetails:any=[];
lender_short_name :any;
product_abbr :any;
// category static form buttons // category static form buttons
categoryFormButtons: any; categoryFormButtons: any;
formsCategoryEnable: boolean = false; formsCategoryEnable: boolean = false;
@ -108,8 +106,6 @@ export class StartPdComponent implements OnInit, OnDestroy {
data => { data => {
if (data.status == 200) { if (data.status == 200) {
this.pdMasterList=data.records.pdmaster_details; this.pdMasterList=data.records.pdmaster_details;
this.lender_short_name = data.records.pdmaster_details.lender_short_name;
this.product_abbr = data.records.pdmaster_details.product_abbr;
// this.categoryList=data.records.question_answers; // this.categoryList=data.records.question_answers;
let filterApplicantName= data.records.pdapplicants_detials.filter(item => item.applicant_type == 1); let filterApplicantName= data.records.pdapplicants_detials.filter(item => item.applicant_type == 1);
this.mainApplicantName = filterApplicantName.length > 0 ? filterApplicantName[0].applicant_name : ''; this.mainApplicantName = filterApplicantName.length > 0 ? filterApplicantName[0].applicant_name : '';
@ -483,23 +479,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
// this.notifier.notify('success', 'Successfully allocated.!'); // this.notifier.notify('success', 'Successfully allocated.!');
this.loadTemplates(this.startPD,2); this.loadTemplates(this.startPD,2);
}); });
}else
if((this.lender_short_name == 'CLIX' || this.product_abbr == 'LAEP') && this.selectedFormsCategory.form_id==23){
const dialogRef = this.dialog.open(FuturePlansAndBusinessEnvironmentComponent, {
data: this.pdFullDetails,
maxWidth: '100vw',
maxHeight: '100vh',
height: '100%',
width: '100%',
disableClose: true
});
dialogRef.afterClosed()
.subscribe(dataresult => {
this.loadTemplates(this.startPD,2);
});
} }
} }
ngOnDestroy(): void { ngOnDestroy(): void {