pd tab listing changes done

This commit is contained in:
gandhimathi 2018-10-27 17:54:02 +05:30
parent a7bf024918
commit 2bb5edb338
23 changed files with 740 additions and 185 deletions

View File

@ -51,7 +51,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
this.PDTriggerStatus="TRIGGERED";
this.enablePDButton=false;
this.cancelStatus = false;
this.ListPdComponent.pdListLoad(false);
this.ListPdComponent.showListView(false);
this.getLenderList();
this.getProductsList();
this.getCustomerSegmentList();
@ -59,7 +59,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
this.getPDTypeList();
this.getRelationMaster();
this.loadFormData();
this.OnChanges();
this.OnChanges();
}

View File

@ -0,0 +1,43 @@
<mat-card-content>
<mat-table [dataSource]="dataSourceTab1" matSort *ngIf="PdListData.length > 0" >
<ng-container matColumnDef="Name">
<mat-cell class="cell" *matCellDef="let details;">
<span *ngIf="details.applicat_details" mat-line><b>{{details.applicat_details[0].applicant_name}}</b></span><br>
<span class="fontsize"> {{details.lender_applicant_id}}</span> <span class="fontsize" *ngIf="details.customer_segment_abbr">-({{details.customer_segment_abbr}} )</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Lenderid">
<mat-cell class="cell" *matCellDef="let details">
<span *ngIf="details.lender_full_name" mat-line> {{details.lender_full_name}} </span><br>
<span *ngIf="details.product_abbr" mat-line class="fontsize"> {{details.product_abbr}}/{{details.subproduct_abbr}}</span> <br>
<span *ngIf="details.loan_amount" class="fontsize"><i class="fa-1x fa fa-rupee"></i> {{details.loan_amount}}</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Address">
<mat-cell class="cell" *matCellDef="let details;">
<span>{{details.pd_date_of_initiation}}</span><br>
<span class="fontsize" *ngIf="details.city_name"> <i class="fa-1x fa fa-map-marker"> </i> {{details.city_name}}-{{details.pincode}} </span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Status">
<mat-cell class="cell center" *matCellDef="let details;">
<span> {{details.pd_status}}</span><br>
<span class="fontsize">{{ (details.scheduled_on) ? (details.scheduled_on | slice:0:10):(details.scheduled_on) }}
</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Action">
<mat-cell class="cell center" *matCellDef="let details;">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="viewPD(details.pd_id)"><mat-icon>visibility</mat-icon></button>
</mat-cell>
</ng-container>
<mat-row style="align-items: normal !important;" *matRowDef="let row; columns: displayedColumns;">
</mat-row>
</mat-table>
</mat-card-content>
<mat-paginator *ngIf="!recordStatus" #paginator class="mat-elevation-z1" [length]="PdListData.length" [pageIndex]="pageIndex" [pageSize]="pageSize"
[pageSizeOptions]="[5, 10, 25,50, 100]" (page)="pageEvent = $event; pageChange($event)" showFirstLastButtons>
</mat-paginator>

View File

@ -0,0 +1,16 @@
.ic-change:hover {
transform: scale(1.1);
color: green;
}
.cell{
display:inline !important;
}
.cellhide{
display: none !important;
}
.center{
text-align:center;
}
.fontsize{
font-size:14px;
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AllPdComponent } from './all-pd.component';
describe('AllPdComponent', () => {
let component: AllPdComponent;
let fixture: ComponentFixture<AllPdComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AllPdComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AllPdComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,85 @@
import { Component,ViewChild, OnInit, ViewEncapsulation, Input, Output, EventEmitter, OnDestroy, AfterViewInit, OnChanges, SimpleChanges } from '@angular/core';
import { PdTrigerService } from './../../../pd-service/pd-triger.service';
import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/material';
@Component({
selector: 'app-all-pd',
templateUrl: './all-pd.component.html',
styleUrls: ['./all-pd.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class AllPdComponent implements OnInit, OnChanges {
recordStatus: boolean;
errorMessage:any[]=[];
tabStatus:string="ALL";
public dataLengthTab1: number;
public dataSourceTab1 = new MatTableDataSource();
displayedColumns = ['Name','Lenderid','Address','Status','Action'];
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
@Input() bindFilterValue: string;
@Output() loadPdView = new EventEmitter<string>();
// data source variable details
PdListData:any[] = [];
// pagination variable details
length = 50;
pageIndex = 0;
pageSize = 10;
pageEvent: PageEvent;
constructor(private _pd: PdTrigerService) {
}
ngOnInit() {
this.recordStatus=false;
// this.loadPDDetails();
}
ngAfterViewInit() {
this.dataSourceTab1.paginator = this.paginator;
this.dataSourceTab1.sort = this.sort;
}
// get changes for filter from parent componnet filter
ngOnChanges(changes: SimpleChanges) {
let filteredText = changes.bindFilterValue.currentValue ? changes.bindFilterValue.currentValue.trim() : changes.bindFilterValue.currentValue;
filteredText = filteredText ? filteredText.toLowerCase() : filteredText;
this.dataSourceTab1.filter = filteredText;
}
// load inprogress pd list
loadPDDetails() {
//this._pd.getTabStatusPdDetails(this.tabStatus)
this._pd.getPdDetails()
.subscribe(
data => {
if (data.status == 200) {
this.PdListData = data.records;
this.dataLengthTab1 = data.records.length;
this.dataSourceTab1.data = this.PdListData;
}
else{
this.PdListData=[];
this.dataSourceTab1 = null;
this.recordStatus=true;
}
}, error => this.errorMessage = <any> error);
}
pageChange(e) {
console.log(e);
}
viewPD(pdid:string){
this.loadPdView.next(pdid);
}
}

View File

@ -0,0 +1,43 @@
<mat-card-content>
<mat-table [dataSource]="dataSourceTab4" matSort *ngIf="completedPdListData.length > 0" >
<ng-container matColumnDef="Name">
<mat-cell class="cell" *matCellDef="let details;">
<span *ngIf="details.applicat_details" mat-line><b>{{details.applicat_details[0].applicant_name}}</b></span><br>
<span class="fontsize"> {{details.lender_applicant_id}}</span> <span class="fontsize" *ngIf="details.customer_segment_abbr">-({{details.customer_segment_abbr}} )</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Lenderid">
<mat-cell class="cell" *matCellDef="let details">
<span *ngIf="details.lender_full_name" mat-line> {{details.lender_full_name}} </span><br>
<span *ngIf="details.product_abbr" mat-line class="fontsize"> {{details.product_abbr}}/{{details.subproduct_abbr}}</span> <br>
<span *ngIf="details.loan_amount" class="fontsize"><i class="fa-1x fa fa-rupee"></i> {{details.loan_amount}}</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Address">
<mat-cell class="cell" *matCellDef="let details;">
<span>{{details.pd_date_of_initiation}}</span><br>
<span class="fontsize" *ngIf="details.city_name"> <i class="fa-1x fa fa-map-marker"> </i> {{details.city_name}}-{{details.pincode}} </span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Status">
<mat-cell class="cell center" *matCellDef="let details;">
<span> {{details.pd_status}}</span><br>
<span class="fontsize">{{ (details.scheduled_on)? (details.scheduled_on | slice:0:10):(details.scheduled_on) }}
</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Action">
<mat-cell class="cell center" *matCellDef="let details;">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="viewPD(details.pd_id)"><mat-icon>visibility</mat-icon></button>
</mat-cell>
</ng-container>
<mat-row style="align-items: normal !important;" *matRowDef="let row; columns: displayedColumns;">
</mat-row>
</mat-table>
</mat-card-content>
<mat-paginator *ngIf="!recordStatus" #paginator class="mat-elevation-z1" [length]="completedPdListData.length" [pageIndex]="pageIndex" [pageSize]="pageSize"
[pageSizeOptions]="[5, 10, 25,50, 100]" (page)="pageEvent = $event; pageChange($event)" showFirstLastButtons>
</mat-paginator>

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { CompletedPdComponent } from './completed-pd.component';
describe('CompletedPdComponent', () => {
let component: CompletedPdComponent;
let fixture: ComponentFixture<CompletedPdComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CompletedPdComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(CompletedPdComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,85 @@
import { Component,ViewChild, OnInit, ViewEncapsulation, Input, Output, EventEmitter, OnDestroy, AfterViewInit, OnChanges, SimpleChanges } from '@angular/core';
import { PdTrigerService } from './../../../pd-service/pd-triger.service';
import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/material';
@Component({
selector: 'app-completed-pd',
templateUrl: './completed-pd.component.html',
styleUrls: ['./completed-pd.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class CompletedPdComponent implements OnInit, OnChanges {
recordStatus: boolean;
errorMessage:any[]=[];
tabStatus:string="COMPLETED";
public dataLengthTab4: number;
public dataSourceTab4 = new MatTableDataSource();
displayedColumns = ['Name','Lenderid','Address','Status','Action'];
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
@Input() bindFilterValue: string;
@Output() loadPdView = new EventEmitter<string>();
// data source variable details
completedPdListData:any[] = [];
// pagination variable details
length = 50;
pageIndex = 0;
pageSize = 10;
pageEvent: PageEvent;
constructor(private _pd: PdTrigerService) {
}
ngOnInit() {
this.recordStatus=false;
// this.loadPDDetails();
}
ngAfterViewInit() {
this.dataSourceTab4.paginator = this.paginator;
this.dataSourceTab4.sort = this.sort;
}
// get changes for filter from parent componnet filter
ngOnChanges(changes: SimpleChanges) {
let filteredText = changes.bindFilterValue.currentValue;
filteredText = filteredText ? filteredText.trim() : filteredText;
filteredText = filteredText ? filteredText.toLowerCase() : filteredText;
this.dataSourceTab4.filter = filteredText;
}
// load inprogress pd list
loadPDDetails() {
this._pd.getTabStatusPdDetails(this.tabStatus)
.subscribe(
data => {
if (data.status == 200) {
this.completedPdListData = data.records;
this.dataLengthTab4 = data.records.length;
this.dataSourceTab4.data = this.completedPdListData;
}
else{
this.completedPdListData=[];
this.dataLengthTab4= null;
this.recordStatus=true;
}
}, error => this.errorMessage = <any> error);
}
pageChange(e) {
console.log(e);
}
viewPD(pdid:string){
this.loadPdView.next(pdid);
}
}

View File

@ -0,0 +1,43 @@
<mat-card-content>
<mat-table [dataSource]="dataSourceTab2" matSort *ngIf="progressPdListData.length > 0" >
<ng-container matColumnDef="Name">
<mat-cell class="cell" *matCellDef="let details;">
<span *ngIf="details.applicat_details" mat-line><b>{{details.applicat_details[0].applicant_name}}</b></span><br>
<span class="fontsize"> {{details.lender_applicant_id}}</span> <span class="fontsize" *ngIf="details.customer_segment_abbr">-({{details.customer_segment_abbr}} )</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Lenderid">
<mat-cell class="cell" *matCellDef="let details">
<span *ngIf="details.lender_full_name" mat-line> {{details.lender_full_name}} </span><br>
<span *ngIf="details.product_abbr" mat-line class="fontsize"> {{details.product_abbr}}/{{details.subproduct_abbr}}</span> <br>
<span *ngIf="details.loan_amount" class="fontsize"><i class="fa-1x fa fa-rupee"></i> {{details.loan_amount}}</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Address">
<mat-cell class="cell" *matCellDef="let details;">
<span>{{details.pd_date_of_initiation}}</span><br>
<span class="fontsize" *ngIf="details.city_name"> <i class="fa-1x fa fa-map-marker"> </i> {{details.city_name}}-{{details.pincode}} </span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Status">
<mat-cell class="cell center" *matCellDef="let details;">
<span> {{details.pd_status}}</span><br>
<span class="fontsize">{{ (details.scheduled_on)? (details.scheduled_on | slice:0:10):(details.scheduled_on) }}
</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Action">
<mat-cell class="cell center" *matCellDef="let details;">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="viewPD(details.pd_id)"><mat-icon>visibility</mat-icon></button>
</mat-cell>
</ng-container>
<mat-row style="align-items: normal !important;" *matRowDef="let row; columns: displayedColumns;">
</mat-row>
</mat-table>
</mat-card-content>
<mat-paginator *ngIf="!recordStatus" #paginator class="mat-elevation-z1" [length]="progressPdListData.length" [pageIndex]="pageIndex" [pageSize]="pageSize"
[pageSizeOptions]="[5, 10, 25,50, 100]" (page)="pageEvent = $event; pageChange($event)" showFirstLastButtons>
</mat-paginator>

View File

@ -0,0 +1,16 @@
.ic-change:hover {
transform: scale(1.1);
color: green;
}
.cell{
display:inline !important;
}
.cellhide{
display: none !important;
}
.center{
text-align:center;
}
.fontsize{
font-size:14px;
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { InprogressPdComponent } from './inprogress-pd.component';
describe('InprogressPdComponent', () => {
let component: InprogressPdComponent;
let fixture: ComponentFixture<InprogressPdComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ InprogressPdComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(InprogressPdComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,81 @@
import { Component,ViewChild, OnInit, ViewEncapsulation, Input, Output, EventEmitter, OnDestroy, AfterViewInit, OnChanges, SimpleChanges } from '@angular/core';
import { PdTrigerService } from './../../../pd-service/pd-triger.service';
import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/material';
@Component({
selector: 'app-inprogress-pd',
templateUrl: './inprogress-pd.component.html',
styleUrls: ['./inprogress-pd.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class InprogressPdComponent implements OnInit, OnChanges {
recordStatus: boolean;
errorMessage:any[]=[];
tabStatus:string="INPROGRESS";
public dataLengthTab2: number;
public dataSourceTab2 = new MatTableDataSource();
displayedColumns = ['Name','Lenderid','Address','Status','Action'];
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
@Input() bindFilterValue: string;
@Output() loadPdView = new EventEmitter<string>();
// data source variable details
progressPdListData:any[] = [];
// pagination variable details
length = 50;
pageIndex = 0;
pageSize = 10;
pageEvent: PageEvent;
constructor(private _pd: PdTrigerService) {
}
ngOnInit() {
this.recordStatus=false;
// this.loadPDDetails();
}
ngAfterViewInit() {
this.dataSourceTab2.paginator = this.paginator;
this.dataSourceTab2.sort = this.sort;
}
// get changes for filter from parent componnet filter
ngOnChanges(changes: SimpleChanges) {
let filteredText = changes.bindFilterValue.currentValue;
filteredText = filteredText ? filteredText.trim() : filteredText;
filteredText = filteredText ? filteredText.toLowerCase() : filteredText;
this.dataSourceTab2.filter = filteredText;
}
// load inprogress pd list
loadPDDetails() {
this._pd.getTabStatusPdDetails(this.tabStatus)
.subscribe(
data => {
if (data.status == 200) {
this.progressPdListData = data.records;
this.dataLengthTab2 = data.records.length;
this.dataSourceTab2.data = this.progressPdListData;
}
else{
this.progressPdListData=[];
this.dataLengthTab2 = null;
this.recordStatus=true;
}
}, error => this.errorMessage = <any> error);
}
pageChange(e) {
console.log(e);
}
viewPD(pdid:string){
this.loadPdView.next(pdid);
}
}

View File

@ -1,147 +1,46 @@
<mat-card>
<mat-card-content>
<div fxLayout="row" *ngIf="viewPdList" fxLayoutAlign="start center" class="filter-header">
<div *ngIf="!noRecordFound" class="ml-xs mr-xs" style="width: 80%;">
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;">
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Filter">
</mat-form-field>
<mat-card-content [style.display]="viewPdList ? 'block' : 'none'">
<div fxLayout="row">
<div fxFlex="50" class="pb-0 text-sm-left">
<mat-form-field dividerColor="primary" style="width: 50%;">
<input matInput [(ngModel)]="filterValue" placeholder="Filter">
</mat-form-field>
</div>
<div fxFlex="50" class="pb-0 text-sm-right">
<button mat-fab color="primary" (click)="viewMapPdDetails()" class="mr-1 mb-1" matTooltip="Map view" matTooltipPosition="above"><mat-icon>map</mat-icon></button>
<button mat-fab color="primary" (click)="addPdDetails()" class="mr-1 mb-1" matTooltip="Add PD" matTooltipPosition="above"><mat-icon>add</mat-icon></button>
</div>
<div *ngIf="noRecordFound" class="nocontent ml-xs mr-xs" style="width: 80%;">No records found</div>
<div class="ml-xs mr-xs" style="width: 20%;text-align:right" *ngIf="viewPdList">
<button mat-fab color="primary" (click)="viewMapPdDetails()" class="mr-1 mb-1" matTooltip="Map view" matTooltipPosition="above"><mat-icon>map</mat-icon></button>
<button mat-fab color="primary" (click)="addPdDetails()" class="mr-1 mb-1" matTooltip="Add PD" matTooltipPosition="above"><mat-icon>add</mat-icon></button>
</div>
</div>
<mat-card *ngIf="viewPdList">
<mat-tab-group>
<mat-tab>
<mat-card>
<mat-tab-group (selectedTabChange)="onTabClick($event)">
<mat-tab >
<ng-template mat-tab-label>All</ng-template>
<mat-card-content>
<mat-table [dataSource]="dataSource" matSort *ngIf="pdList.length > 0" >
<ng-container matColumnDef="Name">
<mat-cell class="cell" *matCellDef="let details;">
<span *ngIf="details.applicat_details" mat-line><b>{{details.applicat_details[0].applicant_name}}</b></span><br>
<span class="fontsize"> {{details.lender_applicant_id}}</span> <span class="fontsize" *ngIf="details.customer_segment_abbr">-({{details.customer_segment_abbr}} )</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Lenderid">
<mat-cell class="cell" *matCellDef="let details">
<span *ngIf="details.lender_full_name" mat-line> {{details.lender_full_name}} </span><br>
<span *ngIf="details.product_abbr" mat-line class="fontsize"> {{details.product_abbr}}/{{details.subproduct_abbr}}</span> <br>
<span *ngIf="details.loan_amount" class="fontsize"><i class="fa-1x fa fa-rupee"></i> {{details.loan_amount}}</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Address">
<mat-cell class="cell" *matCellDef="let details;">
<span>{{details.pd_date_of_initiation}}</span><br>
<span class="fontsize" *ngIf="details.city_name"> <i class="fa-1x fa fa-map-marker"> </i> {{details.city_name}}-{{details.pincode}} </span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Status">
<mat-cell class="cell center" *matCellDef="let details;">
<span> Triggered</span><br>
<span class="fontsize"> 25/10/2018 </span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Action">
<mat-cell class="cell center" *matCellDef="let details;">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="viewPDDetails(details.pd_id)"><mat-icon>visibility</mat-icon></button>
</mat-cell>
</ng-container>
<!---- <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>-->
<mat-row style="align-items: normal !important;" *matRowDef="let row; columns: displayedColumns;">
</mat-row>
</mat-table>
</mat-card-content>
<mat-card-actions *ngIf="!recordStatus">
<mat-paginator #paginator class="mat-elevation-z1" [length]="pdList.length" [pageIndex]="pageIndex" [pageSize]="pageSize"
[pageSizeOptions]="[5, 10, 25,50, 100]" (page)="pageEvent = $event; pageChange($event)">
</mat-paginator>
</mat-card-actions>
<app-all-pd [bindFilterValue]="filterValue" (loadPdView)="viewPDDetails($event)"></app-all-pd>
</mat-tab>
<!-- <mat-tab>
<ng-template mat-tab-label>Confirmed PD Details</ng-template>
<mat-card-content>
<mat-grid-list cols="2" [rowHeight]="ratio" gutterSize="4px">
<mat-grid-tile *ngFor="let tile of tiles" [style.background]="'lightblue'">
{{tile.text}}
</mat-grid-tile>
</mat-grid-list>
<div fxLayout="row" fxLayoutAlign="start center" class="mt-2">
<mat-form-field>
<input matInput placeholder="Change ratio" [(ngModel)]="ratio">
</mat-form-field>
</div>
</mat-card-content>
</mat-tab>-->
<mat-tab>
<ng-template mat-tab-label>In Progress </ng-template>
<mat-card-content>
<!--<mat-grid-list cols="2" rowHeight="fit" [gutterSize]="ratioGutter"
[style.height]="fitListHeight">
<mat-grid-tile *ngFor="let tile of tiles" [style.background]="'#F1EBBA'">
{{tile.text}}
</mat-grid-tile>
</mat-grid-list>
<div fxLayout="row" fxLayoutAlign="start center" class="mt-2">
<mat-form-field>
<input matInput placeholder="Change list height" [(ngModel)]="fitListHeight">
</mat-form-field>
<mat-form-field>
<input matInput placeholder="Change gutter" type="number" [(ngModel)]="ratioGutter">
</mat-form-field>
</div>-->
</mat-card-content>
<app-inprogress-pd [bindFilterValue]="filterValue" (loadPdView)="viewPDDetails($event)"></app-inprogress-pd>
</mat-tab>
<mat-tab>
<ng-template mat-tab-label>Scheduled </ng-template>
<mat-card-content>
<!--<mat-grid-list cols="2" rowHeight="fit" [gutterSize]="ratioGutter"
[style.height]="fitListHeight">
<mat-grid-tile *ngFor="let tile of tiles" [style.background]="'#F1EBBA'">
{{tile.text}}
</mat-grid-tile>
</mat-grid-list>
<div fxLayout="row" fxLayoutAlign="start center" class="mt-2">
<mat-form-field>
<input matInput placeholder="Change list height" [(ngModel)]="fitListHeight">
</mat-form-field>
<mat-form-field>
<input matInput placeholder="Change gutter" type="number" [(ngModel)]="ratioGutter">
</mat-form-field>
</div>-->
</mat-card-content>
<app-scheduled-pd [bindFilterValue]="filterValue" (loadPdView)="viewPDDetails($event)"></app-scheduled-pd>
</mat-tab>
<mat-tab>
<ng-template mat-tab-label>Completed </ng-template>
<mat-card-content>
<!--<mat-grid-list cols="2" rowHeight="fit" [gutterSize]="ratioGutter"
[style.height]="fitListHeight">
<mat-grid-tile *ngFor="let tile of tiles" [style.background]="'#F1EBBA'">
{{tile.text}}
</mat-grid-tile>
</mat-grid-list>
<div fxLayout="row" fxLayoutAlign="start center" class="mt-2">
<mat-form-field>
<input matInput placeholder="Change list height" [(ngModel)]="fitListHeight">
</mat-form-field>
<mat-form-field>
<input matInput placeholder="Change gutter" type="number" [(ngModel)]="ratioGutter">
</mat-form-field>
</div>-->
</mat-card-content>
<app-completed-pd [bindFilterValue]="filterValue" (loadPdView)="viewPDDetails($event)"></app-completed-pd>
</mat-tab>
</mat-tab-group>
</mat-card>
<notifier-container></notifier-container>
<router-outlet></router-outlet>
</mat-card-content>
</mat-card>
<notifier-container></notifier-container>
<router-outlet></router-outlet>

View File

@ -1,8 +1,14 @@
import { Component,ViewChild, OnInit, ViewEncapsulation, OnDestroy } from '@angular/core';
import { Component,ViewChild, OnInit, ViewEncapsulation, OnDestroy, OnChanges } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { NotifierService } from 'angular-notifier';
import { PdTrigerService } from '../../pd-service/pd-triger.service';
import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/material';
import { MatPaginator, MatSort, MatTableDataSource, PageEvent, MatTabChangeEvent } from '@angular/material';
import { AllPdComponent } from './all-pd/all-pd.component';
import { InprogressPdComponent } from './inprogress-pd/inprogress-pd.component';
import { ScheduledPdComponent } from './scheduled-pd/scheduled-pd.component';
import { CompletedPdComponent } from './completed-pd/completed-pd.component';
@Component({
selector: 'app-list-pd',
templateUrl: './list-pd.component.html',
@ -10,28 +16,24 @@ import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/m
encapsulation: ViewEncapsulation.None
})
export class ListPdComponent implements OnInit, OnDestroy {
public dataLength: number;
public dataSource = new MatTableDataSource();
displayedColumns = ['Name','Lenderid','Address','Status','Action'];
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
public filterValue: string;
private notifier: NotifierService;
recordStatus: boolean;
noRecordFound:boolean;
viewPdList:boolean;
viewMapPdList:boolean;
errorMessage: any;
// pagination variable details
length = 50;
pageIndex = 0;
pageSize = 10;
pageEvent: PageEvent;
public allTab:boolean;
public inprogressTab:boolean = false;
public scheduledTab:boolean = false;
public completedTab:boolean = false;
public getTabIndex:number=0;
@ViewChild(AllPdComponent) allTabC:AllPdComponent;
@ViewChild(InprogressPdComponent) inprogressTabC: InprogressPdComponent;
@ViewChild(ScheduledPdComponent) scheduledTabC:ScheduledPdComponent;
@ViewChild(CompletedPdComponent) completedTabC: CompletedPdComponent;
// data source variable details
pdListData = null;
pdList:any[] = [];
constructor( notifier: NotifierService, private route: ActivatedRoute,
private router: Router, private _pd: PdTrigerService) {
this.notifier = notifier;
@ -40,34 +42,14 @@ export class ListPdComponent implements OnInit, OnDestroy {
ngOnInit() {
this.viewPdList = true;
this.recordStatus=false;
this.loadPDDetails();
this.allTab=true;
}
// after view call all tabs component
ngAfterViewInit() {
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
}
//load pd details
loadPDDetails() {
this._pd.getPdDetails()
.subscribe(
data => {
if (data.status == 200) {
this.pdList = data.records;
this.pdListData = data.records;
this.dataLength = data.records.length;
this.dataSource.data = this.pdListData;
}
else{
this.pdList=[];
this.dataLength = null;
this.recordStatus=true;
}
}, error => this.errorMessage = <any> error);
}
pageChange(e) {
console.log(e);
this.allTabC.loadPDDetails();
}
// view pd list in map view
viewMapPdDetails(){
this.viewPdList = !this.viewPdList;
@ -82,22 +64,24 @@ export class ListPdComponent implements OnInit, OnDestroy {
}
showListView(status: boolean){
this.viewPdList = status;
}
pdListLoad(status: boolean){
this.viewPdList = status;
this.loadPDDetails();
this.getTabIndex==0 ? this.allTabC.loadPDDetails() : this.getTabIndex==1 ? this.inprogressTabC.loadPDDetails() : this.getTabIndex==2 ? this.scheduledTabC.loadPDDetails() : this.completedTabC.loadPDDetails();
}
viewPDDetails(pdid:string){
this.viewPdList = !this.viewPdList;
this.router.navigate([ '../pdlist/viewpd',pdid], { relativeTo: this.route });
}
//Global filter
applyFilter(filterValue: string) {
filterValue = filterValue.trim(); // Remove whitespace
filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches
this.dataSource.filter = filterValue;
//get tab changes
onTabClick(event: MatTabChangeEvent) {
this.getTabIndex=event.index;
this.getTabIndex==0 ? this.allTabC.loadPDDetails() : this.getTabIndex==1 ? this.inprogressTabC.loadPDDetails() : this.getTabIndex==2 ? this.scheduledTabC.loadPDDetails() : this.completedTabC.loadPDDetails();
}
ngOnDestroy(): void {
this.viewPdList=false;
}

View File

@ -0,0 +1,44 @@
<mat-card-content>
<mat-table [dataSource]="dataSourceTab3" matSort *ngIf="scheduledPdListData.length > 0" >
<ng-container matColumnDef="Name">
<mat-cell class="cell" *matCellDef="let details;">
<span *ngIf="details.applicat_details" mat-line><b>{{details.applicat_details[0].applicant_name}}</b></span><br>
<span class="fontsize"> {{details.lender_applicant_id}}</span> <span class="fontsize" *ngIf="details.customer_segment_abbr">-({{details.customer_segment_abbr}} )</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Lenderid">
<mat-cell class="cell" *matCellDef="let details">
<span *ngIf="details.lender_full_name" mat-line> {{details.lender_full_name}} </span><br>
<span *ngIf="details.product_abbr" mat-line class="fontsize"> {{details.product_abbr}}/{{details.subproduct_abbr}}</span> <br>
<span *ngIf="details.loan_amount" class="fontsize"><i class="fa-1x fa fa-rupee"></i> {{details.loan_amount}}</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Address">
<mat-cell class="cell" *matCellDef="let details;">
<span>{{details.pd_date_of_initiation}}</span><br>
<span class="fontsize" *ngIf="details.city_name"> <i class="fa-1x fa fa-map-marker"> </i> {{details.city_name}}-{{details.pincode}} </span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Status">
<mat-cell class="cell center" *matCellDef="let details;">
<span> {{details.pd_status}}</span><br>
<span class="fontsize">{{ (details.scheduled_on)? (details.scheduled_on | slice:0:10):(details.scheduled_on) }}
</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Action">
<mat-cell class="cell center" *matCellDef="let details;">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="viewPD(details.pd_id)"><mat-icon>visibility</mat-icon></button>
</mat-cell>
</ng-container>
<mat-row style="align-items: normal !important;" *matRowDef="let row; columns: displayedColumns;">
</mat-row>
</mat-table>
</mat-card-content>
<mat-paginator *ngIf="!recordStatus" #paginator class="mat-elevation-z1" [length]="scheduledPdListData.length" [pageIndex]="pageIndex" [pageSize]="pageSize"
[pageSizeOptions]="[5, 10, 25,50, 100]" (page)="pageEvent = $event; pageChange($event)" showFirstLastButtons>
</mat-paginator>

View File

@ -0,0 +1,16 @@
.ic-change:hover {
transform: scale(1.1);
color: green;
}
.cell{
display:inline !important;
}
.cellhide{
display: none !important;
}
.center{
text-align:center;
}
.fontsize{
font-size:14px;
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ScheduledPdComponent } from './scheduled-pd.component';
describe('ScheduledPdComponent', () => {
let component: ScheduledPdComponent;
let fixture: ComponentFixture<ScheduledPdComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ScheduledPdComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ScheduledPdComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,82 @@
import { Component,ViewChild, OnInit, ViewEncapsulation, Input, Output, EventEmitter, OnDestroy, AfterViewInit, OnChanges, SimpleChanges } from '@angular/core';
import { PdTrigerService } from './../../../pd-service/pd-triger.service';
import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/material';
@Component({
selector: 'app-scheduled-pd',
templateUrl: './scheduled-pd.component.html',
styleUrls: ['./scheduled-pd.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class ScheduledPdComponent implements OnInit, OnChanges {
recordStatus: boolean;
errorMessage:any[]=[];
tabStatus:string="SCHEDULED";
public dataLengthTab3: number;
public dataSourceTab3 = new MatTableDataSource();
displayedColumns = ['Name','Lenderid','Address','Status','Action'];
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
@Input() bindFilterValue: string;
@Output() loadPdView = new EventEmitter<string>();
// data source variable details
scheduledPdListData:any[] = [];
// pagination variable details
length = 50;
pageIndex = 0;
pageSize = 10;
pageEvent: PageEvent;
constructor(private _pd: PdTrigerService) {
}
ngOnInit() {
this.recordStatus=false;
// this.loadPDDetails();
}
ngAfterViewInit() {
this.dataSourceTab3.paginator = this.paginator;
this.dataSourceTab3.sort = this.sort;
}
// get changes for filter from parent componnet filter
ngOnChanges(changes: SimpleChanges) {
let filteredText = changes.bindFilterValue.currentValue;
filteredText = filteredText ? filteredText.trim() : filteredText;
filteredText = filteredText ? filteredText.toLowerCase() : filteredText;
this.dataSourceTab3.filter = filteredText;
}
// load inprogress pd list
loadPDDetails() {
this._pd.getTabStatusPdDetails(this.tabStatus)
.subscribe(
data => {
if (data.status == 200) {
this.scheduledPdListData = data.records;
this.dataLengthTab3 = data.records.length;
this.dataSourceTab3.data = this.scheduledPdListData;
}
else{
this.scheduledPdListData=[];
this.dataLengthTab3 = null;
this.recordStatus=true;
}
}, error => this.errorMessage = <any> error);
}
pageChange(e) {
console.log(e);
}
viewPD(pdid:string){
this.loadPdView.next(pdid);
}
}

View File

@ -130,10 +130,7 @@
<mat-card>
<mat-card-content><p>No History</p></mat-card-content>
</mat-card>
</ng-template>
</ng-template>
</div>
</div>

View File

@ -28,6 +28,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
applicantPDLogsData: any=[];
viewID:string;
viewParams:any;
destroyType:number=1;
// @Input() childData: string;
// @Output() loadParent = new EventEmitter<string>();
public _EditPDtriggerForm:FormGroup;
@ -37,7 +38,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
}
ngOnInit() {
this.ListPdComponent.pdListLoad(false);
this.ListPdComponent.showListView(false);
this.route.params.subscribe(params => {
this.viewID = params['pdid'];
});
@ -58,8 +59,9 @@ export class ViewPdComponent implements OnInit, OnDestroy {
}
loadPdListCompoent() {
this.destroyType=2;
this.router.navigate([ '../../' ], { relativeTo: this.route });
this.ListPdComponent.showListView(true);
this.ListPdComponent.pdListLoad(true);
}
editPdMaster(masterData:any){
@ -137,6 +139,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
// start pd
getPDStart(pdID:any){
this.destroyType=3;
this.router.navigate([ '../../../pdlist/startpd',pdID], { relativeTo: this.route });
}
@ -154,6 +157,10 @@ export class ViewPdComponent implements OnInit, OnDestroy {
// this.viewPdDetails(this.childData);
// }
ngOnDestroy(): void {
this.ListPdComponent.showListView(true); }
if(this.destroyType==1){
this.ListPdComponent.pdListLoad(true);
}
}
}

View File

@ -35,6 +35,10 @@ import { SchedulePdComponent } from './list-pd/schedule-pd/schedule-pd.component
import { EditPdApplicantComponent } from './list-pd/edit-pd-applicant/edit-pd-applicant.component';
import { EditPdMasterComponent } from './list-pd/edit-pd-master/edit-pd-master.component';
import { StartPdComponent } from './list-pd/start-pd/start-pd.component';
import { InprogressPdComponent } from './list-pd/inprogress-pd/inprogress-pd.component';
import { AllPdComponent } from './list-pd/all-pd/all-pd.component';
import { ScheduledPdComponent } from './list-pd/scheduled-pd/scheduled-pd.component';
import { CompletedPdComponent } from './list-pd/completed-pd/completed-pd.component';
/**
* Custom angular notifier options
*/
@ -104,7 +108,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}),OwlDateTimeModule,
OwlNativeDateTimeModule,
],
declarations: [ListPdComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent],
declarations: [ListPdComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent],
providers: [PdTrigerService, GetGeometricLocationService],
entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent]
})

View File

@ -94,6 +94,16 @@ export class PdTrigerService {
)
}
// get status based pd list
getTabStatusPdDetails(status:string): Observable<any> {
const tabStatus = status ?
{ params: new HttpParams().set('status', status) } : {};
return this._http.get<any[]>(this.apiUrl+"listLessPDDetails/get",tabStatus)
.pipe(
catchError(this.handleError('operation', []))
)
}
// get edit row pd details
editPdDetails(editId:string):Observable<any>{
let httpParams = new HttpParams().set('pdid', editId);
@ -177,8 +187,8 @@ export class PdTrigerService {
// save pd answers
savePDQuestions(saveData: any): Observable<any> {
saveData[0].createdby = this._aws.getlocale();
saveData[0].fk_createdon = currentdate;
saveData.createdby = this._aws.getlocale();
saveData.fk_createdon = currentdate;
// saveData[0].fk_updatedby = this._aws.getlocale();
// saveData[0].updatedon = currentdate;