Fairoj : Sales PD List modified

This commit is contained in:
venbatechnologies@gmail.com 2019-12-23 12:05:46 +05:30
parent 2d0c79e91d
commit 1205b5a033
10 changed files with 182 additions and 152 deletions

View File

@ -54,6 +54,7 @@ export class TokenInterceptor implements HttpInterceptor{
private handleError<T> (operation = 'operation', result?: T) {
return (error: any): Observable<T> => {
if(error instanceof HttpErrorResponse){
console.log("Error from interceptor >>>",error)
console.error("Error: " + error.status);
if(error.status == 401){
localStorage.clear();

View File

@ -23,6 +23,7 @@ mat-card .child_mat_card > mat-card {
box-shadow: $base-card-box-shadow;
transform: scale(0.95);
transition: box-shadow 0.5s, transform 0.5s;
border: 1px solid lavender;
&:hover {
cursor: pointer;
// background-color: #e00201 !important;

View File

@ -72,6 +72,7 @@ mat-card .child_mat_card > mat-card {
box-shadow: $base-card-box-shadow;
transform: scale(0.95);
transition: box-shadow 0.5s, transform 0.5s;
border: 1px solid lavender;
&:hover {
cursor: pointer;
// background-color: #e00201 !important;

View File

@ -72,6 +72,7 @@ mat-card .child_mat_card > mat-card {
box-shadow: $base-card-box-shadow;
transform: scale(0.95);
transition: box-shadow 0.5s, transform 0.5s;
border: 1px solid lavender;
&:hover {
cursor: pointer;
// background-color: #e00201 !important;

View File

@ -6,14 +6,14 @@
</mat-form-field>
</div>
</div>
<mat-tab-group class="mt-1">
<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-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> -->
<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>
@ -21,7 +21,7 @@
</mat-toolbar-row>
</mat-panel-title>
</mat-expansion-panel-header>
</mat-expansion-panel-header> -->
<!-- <mat-list class="m-gap p-gap">
<div [formGroup]="searchForm">
<mat-form-field style="width:30%">
@ -77,59 +77,65 @@
</div>
</mat-list> -->
</mat-expansion-panel>
<br/>
<!-- </mat-expansion-panel> -->
<!-- <br/> -->
<mat-table [dataSource]="dataSourceTab4" matSort *ngIf="salesPdData.length > 0" >
<ng-container matColumnDef="SalesPdId">
<mat-cell class="cell" *matCellDef="let details;">
<mat-cell class="cell" *matCellDef="let details;" fxFlex.xs="7" fxFlex.sm="7" fxFlex.md="7" fxFlex.lg="7" fxFlex.xl="10">
<small mat-line>{{details.sales_pd_id}}</small>
</mat-cell>
</ng-container>
<ng-container matColumnDef="SalesPdSno">
<mat-cell class="cell" *matCellDef="let details;">
<mat-cell fxFlex.xs="15" fxFlex.sm="15" fxFlex.md="15" fxFlex.lg="16" fxFlex.xl="15" class="cell" *matCellDef="let details;" style="color:rgb(224, 2, 1);font-weight: bold;text-align: left" >
<small mat-line>{{details.sales_pd_sno}}</small>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Applicant Name">
<mat-cell class="cell" *matCellDef="let details;">
<mat-cell class="cell" *matCellDef="let details;" fxFlex.xs="20" fxFlex.sm="17" fxFlex.md="18" fxFlex.lg="20" fxFlex.xl="18">
<span *ngIf="!details.applicant_name" mat-line>
<small>--</small>
</span>
<span *ngIf="details.applicant_name" mat-line>
<b>{{details.applicant_name}}</b>
</span>
<span class="fontsize"> {{details.applicant_id}}</span>
</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">
<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 class="cell" *matCellDef="let details" fxLayoutAlign="center start" fxFlex.xs="9" fxFlex.sm="9" fxFlex.md="9" fxFlex.lg="9">
<span style="font-weight:500"> <small mat-line>{{details.short_name}}</small></span><br/>
<span style="text-align: center;font-weight:400;font-size: 17px;"> <small mat-line>{{details.abbr}}</small></span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Officer Name">
<mat-cell class="cell center" *matCellDef="let details;">
<mat-cell fxFlex.xs="10" fxFlex.sm="10" fxFlex.md="10" fxFlex.lg="13" 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 *ngIf="details.officer_name" mat-line>
<small mat-line >{{details.officer_name}}</small>
</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="status">
<mat-cell fxFlex.xs="10" fxFlex.sm="15" fxFlex.md="15" fxFlex.lg="18" class="cell" *matCellDef="let details;" style="justify-content: flex-start;;text-align: center;font-weight: bold" fxLayoutAlign="start">
<span *ngIf="!details.status" mat-line>
<small>--</small>
</span>
<span *ngIf="details.status" mat-line>
<small mat-line [ngStyle]="{'color':details.status == 'COMPLETED' ? 'green' :'orange'}">{{details.status}}</small>
</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Create On">
<mat-cell class="cell center" *matCellDef="let details;">
<mat-cell class="cell" *matCellDef="let details;" fxFlex.xs="10" fxFlex.sm="15" fxFlex.md="15" fxFlex.lg="10" fxLayoutAlign="center end">
<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"
<mat-cell class="cell" *matCellDef="let details;" style="justify-content: flex-start">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="PDF Download" [disabled]="details.status != 'COMPLETED'"
matTooltipPosition="above" color="primary" (click)="salesPDpdf(details.sales_pd_id)"><mat-icon>file_download</mat-icon></button>
</mat-cell>
</ng-container>
@ -144,5 +150,5 @@
</mat-paginator>
</mat-tab>
</mat-tab-group>
</mat-tab-group>
</mat-card>

View File

@ -4,7 +4,7 @@
}
.cell{
display:inline !important;
text-align: center !important;
// text-align: center !important;
}
.cellhide{
display: none !important;

View File

@ -1,6 +1,7 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/material';
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',
@ -8,11 +9,10 @@ import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.se
styleUrls: ['./sales-pd.component.scss']
})
export class SalesPdComponent implements OnInit {
public dataLengthTab4: number;
public dataSourceTab4 = new MatTableDataSource();
displayedColumns = ['SalesPdId','SalesPdSno','Applicant Name','Short Name','Abbr','Officer Name','Create On','Action'];
displayedColumns = ['SalesPdId','SalesPdSno','Applicant Name','Short Name','Officer Name','status','Create On','Action'];
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
@ -33,7 +33,7 @@ export class SalesPdComponent implements OnInit {
pageEvent: PageEvent;
todaydate:Date = new Date();
constructor(private _pdSales: PdTrigerService) { }
constructor(private _pdSales: PdTrigerService,private userService:UserService) { }
ngOnInit() {
this.loadSalesPDDetails();
@ -94,5 +94,4 @@ export class SalesPdComponent implements OnInit {
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

@ -189,8 +189,8 @@
overflow-x: hidden;
overflow-y: auto;
position: relative;
padding: 2rem;
margin-bottom: 2rem;
padding: 1.5rem;
// margin-bottom: 2rem;
}
@media(max-width:991px) {
@ -356,7 +356,7 @@
visibility: visible;
}
.mat-list-item>.mat-list-item-content>a>.menu-caret,
.mat-list-item>.mat-list-item-content>a>[fxflex],
.mat-list-item>.mat-list-item-content>a>[fxflex]
{
display: none;
}