loan details issue fix

This commit is contained in:
sriram-at-840620226347 2019-12-11 20:09:48 +05:30
parent 6934631256
commit cd9a92b1c9
2 changed files with 9 additions and 5 deletions

View File

@ -38,7 +38,7 @@
</mat-form-field> </mat-form-field>
<mat-form-field style="width:64%"> <mat-form-field style="width:64%">
<mat-select placeholder="Sub Product" formControlName="sub_product" <mat-select placeholder="Sub Product" formControlName="sub_product"
(selectionChange)="onChangeSubProduct($event)"> (selectionChange)="onChangeSubProduct($event.value)">
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<mat-option *ngFor="let list of m_endUseofLoad" [value]="list.subproduct_id"> <mat-option *ngFor="let list of m_endUseofLoad" [value]="list.subproduct_id">
{{list.name }} ( {{list.abbr}} ) </mat-option> {{list.name }} ( {{list.abbr}} ) </mat-option>

View File

@ -223,6 +223,7 @@ export class LoanDetailsComponent implements OnInit {
result.forEach(val => { result.forEach(val => {
enduse.push(val.end_use); enduse.push(val.end_use);
}); });
this.onChangeSubProduct(value.records.sub_product);
this.loanDetailsForm.controls['end_use'].setValue(enduse); this.loanDetailsForm.controls['end_use'].setValue(enduse);
this.endUserChange(enduse); this.endUserChange(enduse);
@ -516,8 +517,11 @@ export class LoanDetailsComponent implements OnInit {
} }
onChangeSubProduct(e) { onChangeSubProduct(e) {
let splitted = e.source.triggerValue.split(" ( ", 2); console.log('eeeeeee',e)
this._pd.getEndUseForLoan(this.pdid, e.value).subscribe(data => { // let splitted = e.source.triggerValue.split(" ( ", 2);
let splitted=this.m_endUseofLoad.filter(val=>val.subproduct_id == e).map(res=>res.name)[0]
console.log(splitted);
this._pd.getEndUseForLoan(this.pdid, e).subscribe(data => {
this.m_endUseForLoan = data.records.filter(data => data.isactive == 1); this.m_endUseForLoan = data.records.filter(data => data.isactive == 1);
}); });
if(this.mortageCardAccess == true) { if(this.mortageCardAccess == true) {
@ -530,7 +534,7 @@ export class LoanDetailsComponent implements OnInit {
} }
} }
else if (that.productAbbr == "LAP") { else if (that.productAbbr == "LAP") {
if (data.group_name == that.productAbbr && data.sub_group_name == splitted[0] && data.isactive == 1) { if (data.group_name == that.productAbbr && data.sub_group_name == splitted && data.isactive == 1) {
return data; return data;
} }
else if (data.group_name == that.productAbbr && (data.sub_group_name == null || data.sub_group_name == '') && data.isactive == 1) { else if (data.group_name == that.productAbbr && (data.sub_group_name == null || data.sub_group_name == '') && data.isactive == 1) {