loan details live issue fix

This commit is contained in:
sriram-at-840620226347 2019-12-11 16:29:52 +05:30
parent 20ec4ef299
commit 6934631256

View File

@ -548,9 +548,12 @@ export class LoanDetailsComponent implements OnInit {
event.forEach(option => { event.forEach(option => {
// let othersData = this.m_endUseofLoad.filter(sub=>sub.subproduct_id==option)[0]; // 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]; let othersData = this.m_endUseForLoan.filter(sub => sub.enduse_of_loan_id == option)[0];
console.log('other data',othersData);
OthersAvaliable = othersData.enduse_of_loan.substr(0, 6).toLowerCase(); if(othersData != undefined){
OthersAvaliable = othersData.enduse_of_loan.substr(0, 6).toLowerCase();
}
this.endUserList.push({ end_use: option }); this.endUserList.push({ end_use: option });
}); });
@ -690,20 +693,23 @@ export class LoanDetailsComponent implements OnInit {
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];
let property_name = mortagetypes.property_name.replace(/\s/g, "").toLowerCase(); console.log('mortagettypes',mortagetypes);
if(property_name=='others') if(mortagetypes != undefined){
{ let property_name = mortagetypes.property_name.replace(/\s/g, "").toLowerCase();
this.mortageAccess = true; if(property_name=='others')
this.loanDetailsForm.controls['property_type_others'].setValidators([Validators.required]); {
this.loanDetailsForm.controls['property_type_others'].updateValueAndValidity(); this.mortageAccess = true;
}else this.loanDetailsForm.controls['property_type_others'].setValidators([Validators.required]);
{ this.loanDetailsForm.controls['property_type_others'].updateValueAndValidity();
this.mortageAccess = false; }else
this.loanDetailsForm.controls['property_type_others'].setValue(''); {
this.loanDetailsForm.controls['property_type_others'].clearValidators(); this.mortageAccess = false;
this.loanDetailsForm.controls['property_type_others'].updateValueAndValidity(); this.loanDetailsForm.controls['property_type_others'].setValue('');
} this.loanDetailsForm.controls['property_type_others'].clearValidators();
this.loanDetailsForm.controls['property_type_others'].updateValueAndValidity();
}
}
} }