changes:ps
This commit is contained in:
parent
f9dcea67f3
commit
780845b532
@ -89,79 +89,6 @@ export class CurrentLoanComponent implements OnInit {
|
||||
this.getMasterDetails('FREQUENCY',2);
|
||||
this.getMasterDetails('EXISTINGLOANTYPES',3);
|
||||
this.initCurrentloanForm();
|
||||
|
||||
this._pd.getAssetsWithLoanFromBusiness(this.pdid).subscribe(data=>{
|
||||
// console.log(data);
|
||||
|
||||
if(data.dataStatus == true){
|
||||
// console.log(data.record);
|
||||
this.dataFromAssets = data.record;
|
||||
if(this.dataFromAssets.length > 0){
|
||||
let labelarray : any = [];
|
||||
|
||||
this.dataFromAssets.forEach((val,index) => {
|
||||
|
||||
if(val.business_assets_mode == 1){
|
||||
let data;
|
||||
val.business_details.forEach((v,index) => {
|
||||
|
||||
data = v.any_other_assets;
|
||||
});
|
||||
labelarray[index] = val.business_name_of_the_owner +' - '+ data;
|
||||
}
|
||||
if(val.business_assets_mode == 2){
|
||||
let data;
|
||||
val.business_details.forEach((v,index) => {
|
||||
data = v.property_type_name;
|
||||
});
|
||||
labelarray[index] = val.business_name_of_the_owner +' - '+ data;
|
||||
}
|
||||
if(val.business_assets_mode == 3){
|
||||
let data;
|
||||
val.business_details.forEach((v,index) => {
|
||||
data = v.manufacturer_model_vehicle;
|
||||
});
|
||||
labelarray[index] = val.business_name_of_the_owner +' - '+ data;
|
||||
}
|
||||
if(val.business_assets_mode == 4){
|
||||
let data;
|
||||
val.business_details.forEach((v,index) => {
|
||||
data = v.equipment_manufacturing_description;
|
||||
});
|
||||
labelarray[index] = val.business_name_of_the_owner +' - '+ data;
|
||||
}
|
||||
|
||||
});
|
||||
const control = <FormArray>this.currentLoanForm.controls['loan_details'];
|
||||
this.labelArr = labelarray;
|
||||
let arr : any = [];
|
||||
if(this.labelArr.length > 0){
|
||||
this.currentLoanForm.controls['existing_loan'].setValue('Yes');
|
||||
this.labelArr.forEach((v,index) => {
|
||||
arr = {
|
||||
'label': v,
|
||||
'loan_amount': '',
|
||||
'frequency':'',
|
||||
'other_frequency':'',
|
||||
'emi': '',
|
||||
'loan_type': '',
|
||||
'others_loan_type': '',
|
||||
'loan_taken_by':'',
|
||||
'others_loan_taken':'',
|
||||
'lender': '',
|
||||
'others_lender':'',
|
||||
'original_tenure': '',
|
||||
'current_balance_tenure': '',
|
||||
'elapsed_tenure':''
|
||||
}
|
||||
control.push(this.createLoanDetail(arr));
|
||||
});
|
||||
// this.currentLoanForm.controls['existing_loan'].setValue(arr);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
|
||||
if(data.dataStatus){
|
||||
this.existCompanyList = data.records.filter(val =>val.is_active===true);
|
||||
@ -194,7 +121,7 @@ export class CurrentLoanComponent implements OnInit {
|
||||
// console.log('value', value);
|
||||
const control = <FormArray>this.currentLoanForm.controls['loan_details'];
|
||||
if (value.status == 200) {
|
||||
|
||||
// console.log(value.status);
|
||||
this.currentLoanForm.controls['existing_loan'].setValue(value.records.existing_loan);
|
||||
this.currentLoanForm.controls['currentloan_remarks'].setValue(value.records.currentloan_remarks);
|
||||
|
||||
@ -216,9 +143,78 @@ export class CurrentLoanComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// console.log('overall else');
|
||||
console.log('else part',value.status);
|
||||
this._pd.getAssetsWithLoanFromBusiness(this.pdid).subscribe(data=>{
|
||||
// console.log(data);
|
||||
|
||||
// control.push(this.createLoanDetail());
|
||||
if(data.dataStatus == true){
|
||||
// console.log(data.record);
|
||||
this.dataFromAssets = data.record;
|
||||
if(this.dataFromAssets.length > 0){
|
||||
let labelarray : any = [];
|
||||
|
||||
this.dataFromAssets.forEach((val,index) => {
|
||||
|
||||
if(val.business_assets_mode == 1){
|
||||
let data;
|
||||
val.business_details.forEach((v,index) => {
|
||||
|
||||
data = v.any_other_assets;
|
||||
});
|
||||
labelarray[index] = val.business_name_of_the_owner +' - '+ data;
|
||||
}
|
||||
if(val.business_assets_mode == 2){
|
||||
let data;
|
||||
val.business_details.forEach((v,index) => {
|
||||
data = v.property_type_name;
|
||||
});
|
||||
labelarray[index] = val.business_name_of_the_owner +' - '+ data;
|
||||
}
|
||||
if(val.business_assets_mode == 3){
|
||||
let data;
|
||||
val.business_details.forEach((v,index) => {
|
||||
data = v.manufacturer_model_vehicle;
|
||||
});
|
||||
labelarray[index] = val.business_name_of_the_owner +' - '+ data;
|
||||
}
|
||||
if(val.business_assets_mode == 4){
|
||||
let data;
|
||||
val.business_details.forEach((v,index) => {
|
||||
data = v.equipment_manufacturing_description;
|
||||
});
|
||||
labelarray[index] = val.business_name_of_the_owner +' - '+ data;
|
||||
}
|
||||
|
||||
});
|
||||
const control = <FormArray>this.currentLoanForm.controls['loan_details'];
|
||||
this.labelArr = labelarray;
|
||||
let arr : any = [];
|
||||
if(this.labelArr.length > 0){
|
||||
this.currentLoanForm.controls['existing_loan'].setValue('Yes');
|
||||
this.labelArr.forEach((v,index) => {
|
||||
arr = {
|
||||
'label': v,
|
||||
'loan_amount': '',
|
||||
'frequency':'',
|
||||
'other_frequency':'',
|
||||
'emi': '',
|
||||
'loan_type': '',
|
||||
'others_loan_type': '',
|
||||
'loan_taken_by':'',
|
||||
'others_loan_taken':'',
|
||||
'lender': '',
|
||||
'others_lender':'',
|
||||
'original_tenure': '',
|
||||
'current_balance_tenure': '',
|
||||
'elapsed_tenure':''
|
||||
}
|
||||
control.push(this.createLoanDetail(arr));
|
||||
});
|
||||
// this.currentLoanForm.controls['existing_loan'].setValue(arr);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user