sales PD List added

This commit is contained in:
sriram-at-840620226347 2019-11-18 19:05:54 +05:30
parent 2d9ce4948e
commit 37f41d93f1
16 changed files with 382 additions and 35 deletions

View File

@ -44,6 +44,8 @@ import { NewPasswordDialog, ForgotPass } from './session/login/login.component';
import { AuthGuard } from './_guard/auth.guard';
import { RoleMenuItemsPipe } from './layouts/role-menu-items.pipe';
import { ResizableModule } from 'angular-resizable-element';
import { SalesPdComponent } from './sales-pd/sales-pd.component';
import { PdTrigerService } from './personal-discussion/pd-service/pd-triger.service';
export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http);
}
@ -61,7 +63,7 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
AppComponent,
AdminLayoutComponent,
AuthLayoutComponent,
NewPasswordDialog,ForgotPass,ChangePasswordDialog, RoleMenuItemsPipe,
NewPasswordDialog,ForgotPass,ChangePasswordDialog, RoleMenuItemsPipe, SalesPdComponent,
],
imports: [
BrowserModule,
@ -103,6 +105,7 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
},
AwsService,AuthGuard,
TranslateService,
PdTrigerService,
// {
// provide: PERFECT_SCROLLBAR_CONFIG,
// useValue: DEFAULT_PERFECT_SCROLLBAR_CONFIG

View File

@ -4,6 +4,7 @@ import { AdminLayoutComponent } from './layouts/admin/admin-layout.component';
import { AuthLayoutComponent } from './layouts/auth/auth-layout.component';
import { CognitoService} from './AwsService/cognito.service';
import { AuthGuard } from './_guard/auth.guard';
import { SalesPdComponent } from './sales-pd/sales-pd.component';
export const AppRoutes: Routes = [{
path: '',
redirectTo: 'personal_discussion',
@ -28,6 +29,10 @@ export const AppRoutes: Routes = [{
path:'quality_check_discussion',
loadChildren:'./quality-check/quality-check.module#QualityCheckModule'
},
{
path:'sales-pd-list',
component:SalesPdComponent
},
{
path:'reports',
loadChildren:'./reports/reports.module#ReportsModule'

View File

@ -61,6 +61,8 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
if(this.currentUser.dataStatus == true){
this.currentUser = this.currentUser.records[0];
localStorage.setItem("LocalSetEntity",this.currentUser.fk_entity_id);
this.fullName = this.currentUser.user_first_name +' '+this.currentUser.user_last_name;
this.roleName = this.currentUser.role_name;

View File

@ -128,7 +128,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
//lender_billing: [null],
fk_product_id: [null],
fk_subproduct_id: [null],
fk_pd_type: [null],
fk_pd_type: ['1'],
fk_customer_segment: [null],
loan_amount: [null, Validators.compose([Validators.pattern('^[0-9]*$')])],
applicant_title_name: [''],
@ -171,21 +171,23 @@ export class AddPdComponent implements OnInit, OnDestroy {
this.lenderShortName = lender['short_name'];
// console.log(this.lenderShortName);
this._PDtriggerForm.controls.pd_branch_id.setValue(null);
if(this.lenderShortName == 'CLIX'){
let getProductAbbr = this.productAllList.map(dval => dval.product_abbr);
let ClixProductAbbr = ['BL','LAEP'];
let FilteredAbbr: any = [];
FilteredAbbr = ClixProductAbbr.map(x => {
let findIndex = getProductAbbr.indexOf(x);
return this.productAllList[findIndex];
});
this.productList = FilteredAbbr.length > 0 ? FilteredAbbr : this.productAllList;
}
else{
this.productList = this.productAllList;
}
// if(this.lenderShortName == 'CLIX'){
// let getProductAbbr = this.productAllList.map(dval => dval.product_abbr);
// let ClixProductAbbr = ['BL','LAEP'];
// let FilteredAbbr: any = [];
// FilteredAbbr = ClixProductAbbr.map(x => {
// let findIndex = getProductAbbr.indexOf(x);
// return this.productAllList[findIndex];
// });
// this.productList = FilteredAbbr.length > 0 ? FilteredAbbr : this.productAllList;
// }
// else{
// this.productList = this.productAllList;
// }
@ -195,7 +197,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
// console.log('this.productList',this.productList);
this._PDtriggerForm.controls['fk_product_id'].setValue('');
this._PDtriggerForm.controls['fk_subproduct_id'].setValue('');
this._PDtriggerForm.controls['fk_pd_type'].setValue('');
// this._PDtriggerForm.controls['fk_pd_type'].setValue('');
this._PDtriggerForm.controls['fk_customer_segment'].setValue('');
this._PDtriggerForm.controls['loan_amount'].setValue('');

View File

@ -168,21 +168,23 @@ export class EditPdMasterComponent implements OnInit {
this.lenderShortName = lender['short_name'];
// console.log(this.lenderShortName);
this._EditPDtriggerForm.controls.pd_branch_id.setValue(null);
if(this.lenderShortName == 'CLIX'){
let getProductAbbr = this.productAllList.map(dval => dval.product_abbr);
let ClixProductAbbr = ['BL','LAEP'];
let FilteredAbbr: any = [];
FilteredAbbr = ClixProductAbbr.map(x => {
let findIndex = getProductAbbr.indexOf(x);
return this.productAllList[findIndex];
});
this.productList = FilteredAbbr.length > 0 ? FilteredAbbr : this.productAllList;
}
else{
this.productList = this.productAllList;
}
// if(this.lenderShortName == 'CLIX'){
// let getProductAbbr = this.productAllList.map(dval => dval.product_abbr);
// let ClixProductAbbr = ['BL','LAEP'];
// let FilteredAbbr: any = [];
// FilteredAbbr = ClixProductAbbr.map(x => {
// let findIndex = getProductAbbr.indexOf(x);
// return this.productAllList[findIndex];
// });
// this.productList = FilteredAbbr.length > 0 ? FilteredAbbr : this.productAllList;
// }
// else{
// this.productList = this.productAllList;
// }
@ -218,9 +220,9 @@ export class EditPdMasterComponent implements OnInit {
return this.productAllList[findIndex];
});
// console.log('FilteredAbbr',FilteredAbbr);
this.productList = FilteredAbbr.length > 0 ? FilteredAbbr : this.productAllList;
// this.productList = FilteredAbbr.length > 0 ? FilteredAbbr : this.productAllList;
// this.productList = this.productAllList;
this.productList = this.productAllList;
}
else{
this.productList = this.productAllList;
@ -401,14 +403,14 @@ export class EditPdMasterComponent implements OnInit {
// console.log(1);
this.customerSegmentList = this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self'));
if(this.lenderShortName == 'CLIX' && flag==2 ){ this._EditPDtriggerForm.controls['fk_customer_segment'].setValue('5'); }
this._EditPDtriggerForm.controls['fk_subproduct_id'].setValue(null);
// this._EditPDtriggerForm.controls['fk_subproduct_id'].setValue(null);
this.subProductList=[];
this.isSubproductShown = false;
break;
case 'LAEP':
// console.log(2);
this.customerSegmentList = this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self'));
this._EditPDtriggerForm.controls['fk_subproduct_id'].setValue(null);
// this._EditPDtriggerForm.controls['fk_subproduct_id'].setValue(null);
if(this.lenderShortName == 'CLIX' && flag==2 ){ this._EditPDtriggerForm.controls['fk_customer_segment'].setValue('5'); }
this.subProductList=[];
this.isSubproductShown = false;

View File

@ -537,6 +537,21 @@ export class PdTrigerService {
catchError(this.handleError('operation', []))
)
}
getSalesPd(): Observable<any> {
var value= localStorage.getItem('LocalSetEntity')
console.log('555',value);
return this._http.get<any[]>(this.apiUrl + "listSalesPD/" + value)
.pipe(
catchError(this.handleError('operation', []))
)
}
getSalesPdpdf(pdfdetail): Observable<any> {
return this._http.get<any[]>(this.apiUrl + "downloadSalesPDReport/" + pdfdetail)
.pipe(
catchError(this.handleError('operation', []))
)
}
/* To get TypeofActivity's Product From About Business,

View File

@ -0,0 +1,143 @@
<mat-card class="p-2" style="box-shadow: 0 0 1px rgba(0,0,0,.18), 0 0 1px rgba(0,0,0,.15) !important">
<div fxLayout="row">
<div fxFlex="50" class="pb-0 text-sm-left">
<mat-form-field dividerColor="primary" style="width: 50%;">
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Filter">
</mat-form-field>
</div>
</div>
<mat-tab-group class="mt-1">
<mat-tab>
<ng-template mat-tab-label>Sales PD</ng-template>
<mat-card-content>
<mat-expansion-panel [(expanded)]="xpandStatus">
<mat-expansion-panel-header>
<mat-panel-title class="text-xs-left">
<!-- <h6 class="mt-0"><mat-icon>filter_list</mat-icon> Filter</h6> -->
<mat-toolbar-row>
<mat-icon>filter_list</mat-icon>
<span class="toolbar-space"></span>
<span>Advance Filter</span>
</mat-toolbar-row>
</mat-panel-title>
</mat-expansion-panel-header>
<!-- <mat-list class="m-gap p-gap">
<div [formGroup]="searchForm">
<mat-form-field style="width:30%">
<mat-select multiple formControlName="pd_type" placeholder="PD Type">
<mat-option *ngFor="let type of PDType" [value]="type.pd_type_id">{{type.type_name}}</mat-option>
</mat-select>
</mat-form-field> &nbsp; &nbsp;
<mat-form-field style="width:30%">
<input matInput [max]="todaydate" [matDatepicker]="picker" (blur)="checkDate($event)" formControlName="pd_from_date" placeholder="Choose a From date">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker></mat-datepicker>
</mat-form-field> &nbsp; &nbsp;
<mat-form-field style="width:30%">
<input matInput [max]="todaydate" [matDatepicker]="picker1" [min]="searchForm.get('pd_from_date').value" formControlName="pd_to_date" placeholder="Choose a To date">
<mat-datepicker-toggle matSuffix [for]="picker1"></mat-datepicker-toggle>
<mat-datepicker #picker1></mat-datepicker>
</mat-form-field>
<mat-form-field style="width:30%">
<mat-select multiple formControlName="pd_products" placeholder="Products">
<mat-option *ngFor="let pro of PRODUCTS" [value]="pro.product_id">{{pro.name}}</mat-option>
</mat-select>
</mat-form-field> &nbsp; &nbsp;
<mat-form-field style="width:30%">
<mat-select multiple formControlName="pd_city" placeholder="City">
<mat-option *ngFor="let city of CITY" [value]="city.city_id">{{city.name}}</mat-option>
</mat-select>
</mat-form-field> &nbsp; &nbsp;
<mat-form-field style="width:30%">
<mat-select multiple formControlName="pd_lender" placeholder="Lender Name">
<mat-option *ngFor="let ent of ENTITY" [value]="ent.entity_id">{{ent.full_name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:30%">
<input matInput type="text" formControlName="pd_name" placeholder="Applicant Name">
</mat-form-field> &nbsp; &nbsp;
<mat-form-field style="width:30%">
<input matInput type="text" formControlName="pd_applicant_id" placeholder="Applicant Id">
</mat-form-field>&nbsp; &nbsp;
<mat-form-field style="width: 30%">
<input matInput type="text" formControlName="pd_officer" placeholder="PD Officer Name" >
</mat-form-field>
<div align="right">
<button type="button" mat-raised-button mat-icon-button (click)="onReset()"
matTooltip="Reset" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary">
<mat-icon>settings_backup_restore</mat-icon>
</button>
<button type="button" mat-raised-button mat-icon-button (click)="searchItem()"
matTooltip="Search" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" type="button">
<mat-icon>search</mat-icon>
</button>
</div>
</div>
</mat-list> -->
</mat-expansion-panel>
<br/>
<mat-table [dataSource]="dataSourceTab4" matSort *ngIf="salesPdData.length > 0" >
<ng-container matColumnDef="SalesPdId">
<mat-cell class="cell" *matCellDef="let details;">
<small mat-line>{{details.sales_pd_id}}</small>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Applicant Name">
<mat-cell class="cell" *matCellDef="let details;" fxLayoutAlign="center start">
<span *ngIf="!details.applicant_name" mat-line>
<small>--</small>
</span>
<span *ngIf="details.applicant_name" mat-line>
<b>{{details.applicant_name}}</b>
</span><br>
<span class="fontsize" mat-line> {{details.applicant_id}}</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Short Name">
<mat-cell class="cell" *matCellDef="let details" fxLayoutAlign="center start">
<small mat-line>{{details.short_name}}</small>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Abbr">
<mat-cell class="cell" *matCellDef="let details;" fxLayoutAlign="center start">
<small mat-line>{{details.abbr}}</small>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Officer Name">
<mat-cell class="cell" *matCellDef="let details;" fxLayoutAlign="center start">
<span *ngIf="!details.officer_name" mat-line>
<small>--</small>
</span>
<span *ngIf="details.applicant_name" mat-line>
<small mat-line>{{details.officer_name}}</small>
</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Create On">
<mat-cell class="cell" *matCellDef="let details;" fxLayoutAlign="center start">
<small mat-line>{{details.createdon | date: 'dd/MM/yyyy'}}</small>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Action">
<mat-cell class="cell" *matCellDef="let details;" fxLayoutAlign="center start">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="PDF Download"
matTooltipPosition="above" color="primary" (click)="salesPDpdf(details.sales_pd_id)"><mat-icon>file_download</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]="salesPdData.length" [pageIndex]="pageIndex" [pageSize]="pageSize"
[pageSizeOptions]="[5, 10, 25,50, 100]" (page)="pageEvent = $event; pageChange($event)" showFirstLastButtons>
</mat-paginator>
</mat-tab>
</mat-tab-group>
</mat-card>

View File

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

View File

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

View File

@ -0,0 +1,97 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { MatTableDataSource, MatPaginator, MatSort, PageEvent } from '@angular/material';
import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.service';
import { UserService } from 'app/settings/service/user.service';
@Component({
selector: 'app-sales-pd',
templateUrl: './sales-pd.component.html',
styleUrls: ['./sales-pd.component.scss']
})
export class SalesPdComponent implements OnInit {
public dataLengthTab4: number;
public dataSourceTab4 = new MatTableDataSource();
displayedColumns = ['SalesPdId','Applicant Name','Short Name','Abbr','Officer Name','Create On','Action'];
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
// data source variable details
salesPdData:any[] = [];
salesPdpdf:any[] = [];
errorMessage:any[]=[];
recordStatus: boolean;
xpandStatus: boolean = false;
// pagination variable details
length = 5;
pageIndex = 0;
pageSize = 10;
pageEvent: PageEvent;
todaydate:Date = new Date();
constructor(private _pdSales: PdTrigerService,private userService:UserService) { }
ngOnInit() {
this.loadSalesPDDetails();
// this.salesPDpdf();
}
loadSalesPDDetails() {
this._pdSales.getSalesPd()
.subscribe(
data => {
if (data.status == 200) {
this.salesPdData = data.records;
this.dataLengthTab4 = data.records.length;
this.dataSourceTab4.data = this.salesPdData;
}
else{
this.salesPdData=[];
this.dataLengthTab4= null;
this.recordStatus=true;
}
}
// , error => this.errorMessage = <any> error);
,error => {
this.errorMessage.push(error);
// this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!');
alert(error.html_format);
});
}
salesPDpdf(pdfdetail){
this._pdSales.getSalesPdpdf(pdfdetail)
.subscribe(
data => {
if (data.status == 200) {
// window.location.href=data.records;
window.open(data.records, '_blank');
}
}
// , error => this.errorMessage = <any> error);
,error => {
this.errorMessage.push(error);
// this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!');
alert(error.html_format);
});
}
pageChange(e) {
console.log(e);
}
ngAfterViewInit() {
this.dataSourceTab4.paginator = this.paginator;
this.dataSourceTab4.sort = this.sort;
}
applyFilter(filterValue: string) {
this.dataSourceTab4.filter = filterValue.trim().toLowerCase();
}
}

View File

@ -0,0 +1,12 @@
import { TestBed } from '@angular/core/testing';
import { SalesPdService } from './sales-pd.service';
describe('SalesPdService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: SalesPdService = TestBed.get(SalesPdService);
expect(service).toBeTruthy();
});
});

View File

@ -0,0 +1,9 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class SalesPdService {
constructor() { }
}

View File

@ -140,7 +140,7 @@ const confirmPassword = new FormControl('', CustomValidators.equalTo(newpassword
<input matInput placeholder="ConfirmPassword" #confirmPassword type="password" style="width: 100%;">
</mat-form-field>
<small *ngIf="confirmPassword.value !='' && newpassword.value != confirmPassword.value" class="mat-text-warn">Passwords do not math.</small>
<small *ngIf="confirmPassword.value !='' && newpassword.value != confirmPassword.value" class="mat-text-warn">Passwords do not match.</small>
<br>

View File

@ -98,7 +98,7 @@ export class UserProfileComponent implements OnInit {
<input matInput placeholder="Confirm Password" [(ngModel)]="pass.confirmPassword" type="password" style="width: 100%;">
</mat-form-field>
<small *ngIf="pass.confirmPassword !='' && pass.newPassword != pass.confirmPassword" class="mat-text-warn">Passwords do not math.</small>
<small *ngIf="pass.confirmPassword !='' && pass.newPassword != pass.confirmPassword" class="mat-text-warn">Passwords do not match.</small>
<br>

View File

@ -38,6 +38,12 @@ const HORIZONTALMENUITEMS = [
// {state:'pdtriggerlist',name:'Pd Trigger Listing'}
// ]
},
{
state:'sales-pd-list',
name:'Sales PD',
type:'link',
icon:'work',
},
// {
// state:'quality_check_discussion',
// name:'Quality Check',

View File

@ -79,6 +79,12 @@ const MENUITEMS : Menu[] = [
// {state:'pdtriggerlist',name:'Pd Trigger Listing'}
// ]
},
{
state:'sales-pd-list',
name:'Sales PD',
type:'link',
icon:'work',
},
// {
// state:'quality_check_discussion',
// name:'Quality Check',