add pd branch added : kdk

This commit is contained in:
dineshkumarkannan 2018-12-20 12:27:53 +05:30
parent d8ba6e15b7
commit e91d569bba
3 changed files with 33 additions and 13 deletions

View File

@ -16,18 +16,27 @@
</mat-card-header> </mat-card-header>
<mat-card-content> <mat-card-content>
<mat-form-field style="width: 32%"> <mat-form-field style="width: 32%">
<mat-select placeholder="Lender Name" formControlName="fk_lender_id"> <mat-select placeholder="Lender Name" formControlName="fk_lender_id">
<!-- (selectionChange)="getBillingDetails(pdMain.fk_lender_id.value)" --> <!-- (selectionChange)="getBillingDetails(pdMain.fk_lender_id.value)" -->
<mat-option> <mat-option>
Select Select
</mat-option> </mat-option>
<mat-option *ngFor="let LL of lenderList" [value]="LL.entity_id" > <mat-option (click)="selectedLender(LL)" *ngFor="let LL of lenderList" [value]="LL.entity_id" >
{{LL.full_name}} {{LL.full_name}}
</mat-option> </mat-option>
</mat-select> </mat-select>
<!-- <mat-error *ngIf="pdMain.fk_lender_id.hasError('required')" class="mat-text-warn">Lender Name Required.</mat-error> --> </mat-form-field>
<mat-form-field style="width: 32%">
</mat-form-field> <mat-select placeholder="Branch" formControlName="pd_branch_id">
<!-- (selectionChange)="getBillingDetails(pdMain.fk_lender_id.value)" -->
<mat-option>
Select
</mat-option>
<mat-option *ngFor="let LB of lenderBranchList" [value]="LB.entity_lender_branch_id" >
{{LB.branch_name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 32%"> <mat-form-field style="width: 32%">
<input matInput placeholder="Lender Applicant ID" formControlName="lender_applicant_id" type="text" required> <input matInput placeholder="Lender Applicant ID" formControlName="lender_applicant_id" type="text" required>

View File

@ -25,6 +25,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
productList:any; productList:any;
subProductList:any; subProductList:any;
lenderList:any; lenderList:any;
lenderBranchList: any;
customerSegmentList:any; customerSegmentList:any;
stateList:any; stateList:any;
cityList:any; cityList:any;
@ -62,6 +63,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
loadFormData(){ loadFormData(){
this._PDtriggerForm = this._fb.group({ this._PDtriggerForm = this._fb.group({
fk_lender_id: [null], fk_lender_id: [null],
pd_branch_id: [null],
lender_applicant_id: [null, Validators.compose([Validators.required])], lender_applicant_id: [null, Validators.compose([Validators.required])],
lender_contact_person: [null, Validators.compose([Validators.required])], lender_contact_person: [null, Validators.compose([Validators.required])],
lender_contact_mobile: [null, Validators.compose([Validators.required,Validators.minLength(10),Validators.maxLength(12),Validators.required,Validators.pattern('^[0-9]*$')])], lender_contact_mobile: [null, Validators.compose([Validators.required,Validators.minLength(10),Validators.maxLength(12),Validators.required,Validators.pattern('^[0-9]*$')])],
@ -92,6 +94,14 @@ export class AddPdComponent implements OnInit, OnDestroy {
}); });
} }
selectedLender(lender){
// console.log(JSON.stringify(lender));
// alert(JSON.stringify(lender['branches ']));
this.lenderBranchList = lender['branches'];
this._PDtriggerForm.controls.pd_branch_id.setValue(null);
}
getLenderList(){ getLenderList(){
this._pd.getLenderDetails().subscribe( this._pd.getLenderDetails().subscribe(
data => { data => {
@ -358,6 +368,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
let pd_details:any={ let pd_details:any={
"fk_lender_id":formValue.fk_lender_id, "fk_lender_id":formValue.fk_lender_id,
"lender_applicant_id":formValue.lender_applicant_id, "lender_applicant_id":formValue.lender_applicant_id,
"pd_branch_id":formValue.pd_branch_id,
"pd_contact_person":formValue.lender_contact_person, "pd_contact_person":formValue.lender_contact_person,
"pd_contact_mobileno":formValue.lender_contact_mobile, "pd_contact_mobileno":formValue.lender_contact_mobile,
"fk_product_id":formValue.fk_product_id, "fk_product_id":formValue.fk_product_id,

View File

@ -5,7 +5,7 @@
<mat-card-content style="background:#e00201;"> <mat-card-content style="background:#e00201;">
<div fxLayout="row" fxLayoutAlign="start center" class="filter-header"> <div fxLayout="row" fxLayoutAlign="start center" class="filter-header">
<div *ngFor="let master of pdMasterData" class="ml-xs mr-xs" fxFlex="45" style="color:#fff;"> <div *ngFor="let master of pdMasterData" class="ml-xs mr-xs" fxFlex="45" style="color:#fff;">
<h4>{{master.lender_full_name}} </h4> <h4>{{master.lender_full_name}} - {{master.branch_name}}</h4>
<span *ngIf="master.lender_applicant_id"> {{master.lender_applicant_id}} - </span> {{master.pd_date_of_initiation}} <span *ngIf="master.lender_applicant_id"> {{master.lender_applicant_id}} - </span> {{master.pd_date_of_initiation}}
</div> </div>
<div *ngFor="let master of pdMasterData" class="ml-xs mr-xs pt-1" fxFlex="55" style="text-align:right;" > <div *ngFor="let master of pdMasterData" class="ml-xs mr-xs pt-1" fxFlex="55" style="text-align:right;" >