loan details live issue fix

This commit is contained in:
sriram-at-840620226347 2019-12-11 16:21:59 +05:30
parent 1d5cb10a1f
commit 2dd5af2f36

View File

@ -461,6 +461,7 @@ export class PdQuestionLoansPage {
mortage_type(mortage_value) mortage_type(mortage_value)
{ {
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];
if(mortagetypes != undefined){
let property_name = mortagetypes.property_name.replace(/\s/g, "").toLowerCase(); let property_name = mortagetypes.property_name.replace(/\s/g, "").toLowerCase();
if(property_name=='others(pleasespecify)' || property_name=='others') if(property_name=='others(pleasespecify)' || property_name=='others')
{ {
@ -470,6 +471,9 @@ export class PdQuestionLoansPage {
this.mortageAccess = false; this.mortageAccess = false;
} }
}
} }
compareObjects(o1: any, o2: any){ compareObjects(o1: any, o2: any){
@ -506,6 +510,7 @@ export class PdQuestionLoansPage {
data => { data => {
this.m_endUseForLoan = data['records'].filter(data => data.isactive == 1); this.m_endUseForLoan = data['records'].filter(data => data.isactive == 1);
}); });
this.loanDetailsForm.controls['end_use'].setValue('');
} }
ChangeProperty(subproduct_id){ ChangeProperty(subproduct_id){
@ -537,7 +542,9 @@ export class PdQuestionLoansPage {
//this.endUserList = []; //this.endUserList = [];
event.forEach(option => { event.forEach(option => {
let othresData = this.m_endUseForLoan.filter(sub=>sub.enduse_of_loan_id==option)[0]; let othresData = this.m_endUseForLoan.filter(sub=>sub.enduse_of_loan_id==option)[0];
if(othresData != undefined){
othresData = othresData.enduse_of_loan.substr(0,6).toLowerCase(); othresData = othresData.enduse_of_loan.substr(0,6).toLowerCase();
}
this.endUserList.push({ end_use: option }); this.endUserList.push({ end_use: option });
if (othresData == 'others') { if (othresData == 'others') {
@ -624,9 +631,13 @@ export class PdQuestionLoansPage {
// } // }
// get end user final group data // get end user final group data
let dataEnd_user_data = []; let dataEnd_user_data = [];
console.log(this.loanDetailsForm.controls['end_use'].value.length> 0);
if(this.loanDetailsForm.controls['end_use'].value.length> 0){
this.loanDetailsForm.controls['end_use'].value.forEach(element => { this.loanDetailsForm.controls['end_use'].value.forEach(element => {
dataEnd_user_data.push({end_use: element}) dataEnd_user_data.push({end_use: element})
}); });
}
records.end_use_group = dataEnd_user_data; records.end_use_group = dataEnd_user_data;
if (this.isOtherPurpose) { if (this.isOtherPurpose) {