loan : ps

This commit is contained in:
venbatechnologies@gmail.com 2019-01-18 11:24:25 +05:30
parent 968f5fcf4c
commit ef4bde3e57
2 changed files with 49 additions and 16 deletions

View File

@ -143,16 +143,20 @@
<mat-option value="vacant_land">Vacant Land</mat-option>
<mat-option value="others">Others</mat-option>
</mat-select>-->
{{CompanyApplicantGroupList | json}}
{{CompanyApplicantGroupList2 | json}}
<mat-form-field *ngIf="mortageAccess">
<input matInput placeholder="Specify Type of Property" formControlName="property_type_others" autocomplete="off">
</mat-form-field>
<mat-form-field>
<mat-select multiple placeholder="Name of Owner"
formControlName="owner_name">
<mat-optgroup *ngFor="let GROUP of CompanyApplicantGroupList" [label]="GROUP.groupName">
<mat-option *ngFor="let status of applicants" [value]="status.pd_co_applicant_id">{{ status.applicant_name }}</mat-option>
<!-- *ngFor='let data of dataValues' -->
<!-- <mat-optgroup *ngFor="let GROUP of CompanyApplicantGroupList2" [label]="GROUP.groupName">
<mat-option value="owner" *ngFor="let owner of GROUP.groupValues">{{owner.name}}</mat-option>
</mat-optgroup>
</mat-optgroup> -->
</mat-select>
<!-- <mat-select placeholder="Name of Owner" formControlName="owner_name">
<mat-optgroup *ngFor="let group of CompanyApplicantGroupList" [label]="group.groupName">

View File

@ -59,6 +59,7 @@ export class LoanDetailsComponent implements OnInit {
// existCompanyList: any =[];
CompanyApplicantGroupList: any=[];
CompanyApplicantGroupList2: any=[];
loanAmtInWords : any;
balTxrfAmtInWords : any;
@ -84,23 +85,51 @@ export class LoanDetailsComponent implements OnInit {
this.applicants = this.pd_all_details.pdapplicants_detials;
console.log(this.applicants);
// console.log(this.applicants);
let CompanyList : any=[];
let ApplicantList : any=[];
// this.applicants.forEach(val => {
// if(val.applicant_type == 0){
// this.CompanyApplicantGroupList.push({groupName:'APPLICANTS',groupValues:{id:val.pd_co_applicant_id,name:val.applicant_name,group_id:2}})
// }
// if(val.applicant_type == 1){
// this.CompanyApplicantGroupList.push({groupName:'APPLICANTS',groupValues:{id:val.pd_co_applicant_id,name:val.applicant_name,group_id:2}})
// }
// if(val.applicant_type == 2){
// this.CompanyApplicantGroupList.push({groupName:'COMPANIES',groupValues:{id:val.pd_co_applicant_id.toString(),name:val.applicant_name,group_id:1}})
// }
// });
// console.log(this.CompanyApplicantGroupList);
this.applicants.forEach(val => {
if(val.applicant_type == 0){
this.CompanyApplicantGroupList.push({groupName:'APPLICANTS',groupValues:{id:val.pd_co_applicant_id,name:val.applicant_name,group_id:2}})
}
if(val.applicant_type == 1){
this.CompanyApplicantGroupList.push({groupName:'APPLICANTS',groupValues:{id:val.pd_co_applicant_id,name:val.applicant_name,group_id:2}})
}
if(val.applicant_type == 2){
this.CompanyApplicantGroupList.push({groupName:'COMPANIES',groupValues:{id:val.pd_co_applicant_id.toString(),name:val.applicant_name,group_id:1}})
}
if(val.applicant_type == 0){
ApplicantList = {id:val.pd_co_applicant_id,name:val.applicant_name,group_id:2};
this.CompanyApplicantGroupList2.push({groupName:'APPLICANTS',groupValues:ApplicantList})
}
if(val.applicant_type == 1){
ApplicantList = {id:val.pd_co_applicant_id,name:val.applicant_name,group_id:2};
this.CompanyApplicantGroupList2.push({groupName:'APPLICANTS',groupValues:ApplicantList})
}
});
this.applicants.forEach(val => {
if(val.applicant_type == 2){
CompanyList = {id:val.pd_co_applicant_id,name:val.applicant_name,group_id:2};
this.CompanyApplicantGroupList2.push({groupName:'COMPANIES',groupValues:CompanyList});
}
});
console.log(this.CompanyApplicantGroupList);
// console.log(this.CompanyApplicantGroupList2);
// let cal = Object.keys(this.CompanyApplicantGroupList2).map(function(key) {
// return this.CompanyApplicantGroupList2[key];
// });
// console.log(cal);
this.productAbbr = this.pd_all_details.pdmaster_details.product_abbr;
this.productID = this.pd_all_details.pdmaster_details.fk_product_id;
@ -488,9 +517,9 @@ getM_sourceofamount() {
event.forEach(option => {
// let othersData = this.m_endUseofLoad.filter(sub=>sub.subproduct_id==option)[0];
let othersData = this.m_endUseForLoan.filter(sub=>sub.enduse_of_loan_id==option)[0];
console.log(othersData);
// console.log(othersData);
OthersAvaliable = othersData.enduse_of_loan.substr(0,6).toLowerCase();
console.log(OthersAvaliable);
// console.log(OthersAvaliable);
this.endUserList.push({ end_use: option });
});