add PD changes

This commit is contained in:
sriram-at-840620226347 2020-02-12 11:32:38 +05:30
parent 15976511bd
commit 42dba214e9

View File

@ -121,11 +121,11 @@ export class AddPdComponent implements OnInit, OnDestroy {
// load form data
loadFormData() {
this._PDtriggerForm = this._fb.group({
fk_lender_id: [{value:this.userDetails.fk_entity_id,disabled:true} || ''],
fk_lender_id: [{value:this.userDetails.fk_entity_id,disabled: this.userDetails.short_name != 'CHFPL' && this.userDetails.short_name != 'CLIX' ? true : false} || ''],
pd_branch_id: [null],
lender_applicant_id: [null, Validators.compose([Validators.required])],
lender_sales_person:[null],
lender_credit_person:[{value:this.userDetails.userid,disabled:true} || ''],
lender_credit_person:[{value:this.userDetails.userid,disabled:false} || ''],
imgc_fin_institute:[null],
// lender_contact_person: [null],
// lender_contact_mobile: [null, Validators.compose([Validators.minLength(10), Validators.maxLength(12), Validators.pattern('^[0-9]*$')])],
@ -156,8 +156,12 @@ export class AddPdComponent implements OnInit, OnDestroy {
});
this._pd.getLenderDetails().subscribe(
data => {
if (data.status == 200) {
if (data.status == 200) {
this.lenderList = data.records
if(this.userDetails.short_name == 'CHFPL' || this.userDetails.short_name == 'CLIX'){
this.lenderList = data.records.filter(item=> item.short_name == 'CHFPL' || item.short_name == 'CLIX');
console.log('filter lender',this.lenderList);
}
}
this.loadControl=true
this.selectedLender(this.userDetails.fk_entity_id)