sales PD list added
This commit is contained in:
parent
a03bbf2ca6
commit
11914393e3
@ -770,14 +770,29 @@ adminlistgroup(enitiy){
|
||||
|
||||
}
|
||||
|
||||
adminSetpassword(awsuser){
|
||||
adminSetpassword(awsuser,lenname){
|
||||
// console.log(awsuser,lenname);
|
||||
this.getconfig();
|
||||
var params = {
|
||||
Password: 'temp1234', /* required */
|
||||
UserPoolId: se_poolData.UserPoolId, /* required */
|
||||
Username: awsuser, /* required */
|
||||
Permanent: false
|
||||
};
|
||||
if(lenname == 'SINEEDGE'){
|
||||
var params = {
|
||||
Password: 'temp1234', /* required */
|
||||
UserPoolId: se_poolData.UserPoolId, /* required */
|
||||
Username: awsuser, /* required */
|
||||
Permanent: false
|
||||
};
|
||||
}
|
||||
else{
|
||||
if(lenname == 'LENDER'){
|
||||
var params = {
|
||||
Password: 'temp1234', /* required */
|
||||
UserPoolId: lender_poolData.UserPoolId, /* required */
|
||||
Username: awsuser, /* required */
|
||||
Permanent: false
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return Observable.create(observe=>{
|
||||
let cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider();
|
||||
cognitoidentityserviceprovider.adminSetUserPassword(params, function(err, data) {
|
||||
|
||||
@ -54,6 +54,8 @@ import { AngularFireModule } from '@angular/fire';
|
||||
import { MessagingService } from './shared/messaging.service';
|
||||
import { environment } from '../environments/environment';
|
||||
import { AsyncPipe } from '../../node_modules/@angular/common';
|
||||
import { SalesPdComponent } from './sales-pd/sales-pd.component';
|
||||
import { PdTrigerService } from './personal-discussion/pd-service/pd-triger.service';
|
||||
|
||||
|
||||
export function HttpLoaderFactory(http: HttpClient) {
|
||||
@ -73,7 +75,7 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
|
||||
AppComponent,
|
||||
AdminLayoutComponent,
|
||||
AuthLayoutComponent,
|
||||
NewPasswordDialog,ForgotPass,ChangePasswordDialog, RoleMenuItemsPipe,
|
||||
NewPasswordDialog,ForgotPass,ChangePasswordDialog, RoleMenuItemsPipe, SalesPdComponent,
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
@ -118,6 +120,7 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
|
||||
},
|
||||
AwsService,AuthGuard,
|
||||
TranslateService,
|
||||
PdTrigerService,
|
||||
// {
|
||||
// provide: PERFECT_SCROLLBAR_CONFIG,
|
||||
// useValue: DEFAULT_PERFECT_SCROLLBAR_CONFIG
|
||||
|
||||
@ -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: 'home',
|
||||
@ -30,6 +31,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'
|
||||
|
||||
@ -155,21 +155,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;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
@ -170,21 +170,22 @@ export class EditPdMasterComponent implements OnInit {
|
||||
if(!option){
|
||||
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;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
@ -399,7 +400,7 @@ if(!option){
|
||||
// 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(this.subProductList[0].subproduct_id);
|
||||
// this._EditPDtriggerForm.controls['fk_subproduct_id'].setValue(this.subProductList[0].subproduct_id);
|
||||
this.subProductList=[];
|
||||
this.isSubproductShown = false;
|
||||
break;
|
||||
|
||||
@ -168,7 +168,7 @@
|
||||
<mat-error *ngIf="_generalForm.controls['is_kyc'].hasError('required')">KYC Required</mat-error>
|
||||
</mat-form-field>
|
||||
<mat-form-field class="mt-1" style="width: 60%" *ngIf="_generalForm.controls.is_kyc.value == 'no'">
|
||||
<input matInput placeholder="Name as per KYC and capture the name." formControlName="kyc_and_captur_the_name"
|
||||
<input matInput placeholder="Capture the correct name as per the KYC?" formControlName="kyc_and_captur_the_name"
|
||||
type="text">
|
||||
</mat-form-field>
|
||||
</mat-card>
|
||||
|
||||
@ -184,6 +184,13 @@ export class PdTrigerService {
|
||||
)
|
||||
}
|
||||
|
||||
getSalesPd(): Observable<any> {
|
||||
return this._http.get<any[]>(this.apiUrl + "listSalesPD/any")
|
||||
.pipe(
|
||||
catchError(this.handleError('operation', []))
|
||||
)
|
||||
}
|
||||
|
||||
// get edit row pd details
|
||||
// This function also called in Final Remarks Form
|
||||
// Make sure FinalRemarksForm does not effect. whenever you done any changes onit means
|
||||
|
||||
143
ng6-seed/src/app/sales-pd/sales-pd.component.html
Normal file
143
ng6-seed/src/app/sales-pd/sales-pd.component.html
Normal 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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<mat-form-field style="width:30%">
|
||||
<input matInput type="text" formControlName="pd_applicant_id" placeholder="Applicant Id">
|
||||
</mat-form-field>
|
||||
<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;">
|
||||
<span *ngIf="!details.applicant_name" mat-line>
|
||||
<small>Not Available</small>
|
||||
</span><br>
|
||||
<span *ngIf="details.applicant_name" mat-line>
|
||||
<b>{{details.applicant_name}}</b>
|
||||
</span><br>
|
||||
<span class="fontsize"> {{details.applicant_id}}</span>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="Short Name">
|
||||
<mat-cell class="cell" *matCellDef="let details">
|
||||
<small mat-line>{{details.short_name}}</small>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="Abbr">
|
||||
<mat-cell class="cell" *matCellDef="let details;">
|
||||
<small mat-line>{{details.abbr}}</small>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="Officer Name">
|
||||
<mat-cell class="cell center" *matCellDef="let details;">
|
||||
<span *ngIf="!details.officer_name" mat-line>
|
||||
<small>Not Available</small>
|
||||
</span><br>
|
||||
<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 center" *matCellDef="let details;">
|
||||
<small mat-line>{{details.createdon | date: 'dd/MM/yyyy'}}</small>
|
||||
</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" matTooltip="PDF Download"
|
||||
matTooltipPosition="above" color="primary"><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>
|
||||
20
ng6-seed/src/app/sales-pd/sales-pd.component.scss
Normal file
20
ng6-seed/src/app/sales-pd/sales-pd.component.scss
Normal 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;
|
||||
}
|
||||
25
ng6-seed/src/app/sales-pd/sales-pd.component.spec.ts
Normal file
25
ng6-seed/src/app/sales-pd/sales-pd.component.spec.ts
Normal 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();
|
||||
});
|
||||
});
|
||||
77
ng6-seed/src/app/sales-pd/sales-pd.component.ts
Normal file
77
ng6-seed/src/app/sales-pd/sales-pd.component.ts
Normal file
@ -0,0 +1,77 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/material';
|
||||
import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.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[] = [];
|
||||
|
||||
errorMessage:any[]=[];
|
||||
recordStatus: boolean;
|
||||
|
||||
// pagination variable details
|
||||
length = 5;
|
||||
pageIndex = 0;
|
||||
pageSize = 10;
|
||||
pageEvent: PageEvent;
|
||||
todaydate:Date = new Date();
|
||||
|
||||
constructor(private _pdSales: PdTrigerService) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.loadSalesPDDetails()
|
||||
}
|
||||
|
||||
|
||||
|
||||
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);
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
||||
@ -482,8 +482,8 @@ callrole(flag,type,usersData){
|
||||
|
||||
|
||||
resetAdminPassword(){
|
||||
|
||||
this.AWS.adminSetpassword(this.users.localUserId.aws_name).subscribe(res=>{
|
||||
// console.log(this.types);
|
||||
this.AWS.adminSetpassword(this.users.localUserId.aws_name,this.types[0].name).subscribe(res=>{
|
||||
|
||||
if(res == 'success'){
|
||||
// this.notifier.notify('success','Please Fill all the Fields')
|
||||
|
||||
@ -59,6 +59,12 @@ const HORIZONTALMENUITEMS = [
|
||||
type:'link',
|
||||
icon:'done_all',
|
||||
},
|
||||
{
|
||||
state:'sales-pd-list',
|
||||
name:'Sales PD',
|
||||
type:'link',
|
||||
icon:'work',
|
||||
},
|
||||
{
|
||||
state:'reports',
|
||||
name:'Reports',
|
||||
|
||||
@ -100,6 +100,12 @@ const MENUITEMS : Menu[] = [
|
||||
type:'link',
|
||||
icon:'done_all',
|
||||
},
|
||||
{
|
||||
state:'sales-pd-list',
|
||||
name:'Sales PD',
|
||||
type:'link',
|
||||
icon:'work',
|
||||
},
|
||||
{
|
||||
state:'reports',
|
||||
name:'Reports',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user