This commit is contained in:
sriram-at-840620226347 2019-12-24 11:59:32 +05:30
commit 786ef6304c
13 changed files with 206 additions and 163 deletions

View File

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

View File

@ -13,12 +13,12 @@
<mat-dialog-content> <mat-dialog-content>
<mat-card formArrayName="docs_to_be_collected" *ngFor="let collecteddocs of pdCollectedDocs.controls; let i = index;"> <mat-card formArrayName="docs_to_be_collected" *ngFor="let collecteddocs of pdCollectedDocs.controls; let i = index;">
<mat-card-content [formGroupName]="i"> <mat-card-content [formGroupName]="i" *ngIf="collecteddocs.value.isactive != 0">
<mat-form-field style="width: 90%;"> <mat-form-field style="width: 90%;">
<input matInput placeholder="Documents to be collected" formControlName="doc_name"> <input matInput placeholder="Documents to be collected" formControlName="doc_name">
</mat-form-field> </mat-form-field>
<!-- <button mat-raised-button mat-icon-button color="primary" matTooltip="Delete" matTooltipPosition="above" (click)="removeRequirements(i)" type="button"><mat-icon>delete</mat-icon></button> --> <button mat-raised-button mat-icon-button color="primary" matTooltip="Delete" matTooltipPosition="above" (click)="removeRequirements(i)" type="button"><mat-icon>delete</mat-icon></button>
</mat-card-content> </mat-card-content>
</mat-card> </mat-card>

View File

@ -65,10 +65,19 @@ export class PdCollectedDocsComponent implements OnInit {
} }
} }
// removeRequirements(index: number) { removeRequirements(index: number) {
// const requirement_control = <FormArray>this._EditPDRequirementForm.controls['additional_requirements']; // const requirement_control = <FormArray>this._EditPDCollectedDocsForm.controls['docs_to_be_collected'];
// requirement_control.removeAt(index); // requirement_control.removeAt(index);
// }
const requirement_control = <FormArray>this._EditPDCollectedDocsForm.controls['docs_to_be_collected'];
if(requirement_control.value[index].add_req_id != ''){
requirement_control.controls[index]['controls'].isactive.setValue(0)
}
else{
requirement_control.removeAt(index);
}
}
updatePDCollectedDocs(formValue: any) { updatePDCollectedDocs(formValue: any) {
if(this._EditPDCollectedDocsForm.invalid) { if(this._EditPDCollectedDocsForm.invalid) {

View File

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

View File

@ -1390,7 +1390,7 @@
</div> </div>
<div fxLayout="row" class="tab_class"> <div fxLayout="row" class="tab_class">
<div fxFlex="100" align="center"> <div fxFlex="100" align="center">
<button type="button" mat-flat-button (click)="removeServiceState(sp,c,'2')" <button type="button" mat-flat-button (click)="addServiceMoreState(sp,'2')"
matTooltip="Add More Country" matTooltipPosition="right" matTooltip="Add More Country" matTooltipPosition="right"
color="primary"> color="primary">
<strong>Add More Country</strong> <strong>Add More Country</strong>

View File

@ -134,19 +134,22 @@ export class RentalVerificationComponent implements OnInit {
amt[inx] = annualRentAmt; amt[inx] = annualRentAmt;
tempArray = []; tempArray = [];
} }
this._pd.getStateCityNamesAndPincode({ "state_id": RIV.state, "city_id": RIV.city, "pincode_id": RIV.pincode }).subscribe(data => { this._pd.getStateCityNamesAndPincode({ "state_id": RIV.state, "city_id": RIV.city, "pincode_id": RIV.pincode }).subscribe(data_2 => {
if (data.dataStatus) { if (data_2.dataStatus) {
let objs = { let objs = {
'address': RIV.address_property, 'address': RIV.address_property,
'applicants_rent': amt[inx], 'applicants_rent': amt[inx],
'state': data.records.state_name, 'state': data_2.records.state_name,
'city': data.records.city_name, 'city': data_2.records.city_name,
'pincode': data.records.pincode, 'pincode': data_2.records.pincode,
'rental_count_id': RIV.rental_count_id, 'rental_count_id': RIV.rental_count_id,
'rental_existing_data': RIV 'rental_existing_data': RIV
} }
this.existing_rental_list.push(objs); this.existing_rental_list.push(objs);
this.existing_rental_list=this.existing_rental_list.sort((a,b)=>{
console.log(a,b)
return a.rental_count_id - b.rental_count_id
})
} }
}); });

View File

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

View File

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

View File

@ -10,9 +10,10 @@
<mat-tab> <mat-tab>
<ng-template mat-tab-label>Sales PD</ng-template> <ng-template mat-tab-label>Sales PD</ng-template>
<mat-card-content> <mat-card-content>
<!-- <mat-expansion-panel [(expanded)]="xpandStatus"> <!-- <mat-expansion-panel [(expanded)]="xpandStatus"> -->
<mat-expansion-panel-header> <!-- <mat-expansion-panel-header>
<mat-panel-title class="text-xs-left"> <mat-panel-title class="text-xs-left">
<h6 class="mt-0"><mat-icon>filter_list</mat-icon> Filter</h6>
<mat-toolbar-row> <mat-toolbar-row>
<mat-icon>filter_list</mat-icon> <mat-icon>filter_list</mat-icon>
<span class="toolbar-space"></span> <span class="toolbar-space"></span>
@ -20,8 +21,8 @@
</mat-toolbar-row> </mat-toolbar-row>
</mat-panel-title> </mat-panel-title>
</mat-expansion-panel-header> </mat-expansion-panel-header> -->
<mat-list class="m-gap p-gap"> <!-- <mat-list class="m-gap p-gap">
<div [formGroup]="searchForm"> <div [formGroup]="searchForm">
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<mat-select multiple formControlName="pd_type" placeholder="PD Type"> <mat-select multiple formControlName="pd_type" placeholder="PD Type">
@ -74,61 +75,67 @@
</button> </button>
</div> </div>
</div> </div>
</mat-list> </mat-list> -->
</mat-expansion-panel> <!-- </mat-expansion-panel> -->
<br/>--> <!-- <br/> -->
<mat-table [dataSource]="dataSourceTab4" matSort *ngIf="salesPdData.length > 0" > <mat-table [dataSource]="dataSourceTab4" matSort *ngIf="salesPdData.length > 0" >
<ng-container matColumnDef="SalesPdId"> <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> <small mat-line>{{details.sales_pd_id}}</small>
</mat-cell> </mat-cell>
</ng-container> </ng-container>
<ng-container matColumnDef="SalesPdSno"> <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> <small mat-line>{{details.sales_pd_sno}}</small>
</mat-cell> </mat-cell>
</ng-container> </ng-container>
<ng-container matColumnDef="Applicant Name"> <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> <span *ngIf="!details.applicant_name" mat-line>
<small>--</small> <small>--</small>
</span> </span>
<span *ngIf="details.applicant_name" mat-line> <span *ngIf="details.applicant_name" mat-line>
<b>{{details.applicant_name}}</b> <b>{{details.applicant_name}}</b>
</span><br> </span><br>
<span class="fontsize"> {{details.applicant_id}}</span> <span class="fontsize" mat-line> {{details.applicant_id}}</span>
</mat-cell> </mat-cell>
</ng-container> </ng-container>
<ng-container matColumnDef="Short Name"> <ng-container matColumnDef="Short Name">
<mat-cell class="cell" *matCellDef="let details"> <mat-cell class="cell" *matCellDef="let details" fxLayoutAlign="center start" fxFlex.xs="9" fxFlex.sm="9" fxFlex.md="9" fxFlex.lg="9">
<small mat-line>{{details.short_name}}</small> <span style="font-weight:500"> <small mat-line>{{details.short_name}}</small></span><br/>
</mat-cell> <span style="text-align: center;font-weight:400;font-size: 17px;"> <small mat-line>{{details.abbr}}</small></span>
</ng-container>
<ng-container matColumnDef="Abbr">
<mat-cell class="cell" *matCellDef="let details;">
<small mat-line>{{details.abbr}}</small>
</mat-cell> </mat-cell>
</ng-container> </ng-container>
<ng-container matColumnDef="Officer Name"> <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> <span *ngIf="!details.officer_name" mat-line>
<small>--</small> <small>--</small>
</span> </span>
<span *ngIf="details.applicant_name" mat-line> <span *ngIf="details.officer_name" mat-line>
<small mat-line >{{details.officer_name}}</small> <small mat-line >{{details.officer_name}}</small>
</span> </span>
</mat-cell> </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>
<ng-container matColumnDef="Create On"> <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> <small mat-line>{{details.createdon | date: 'dd/MM/yyyy'}}</small>
</mat-cell> </mat-cell>
</ng-container> </ng-container>
<ng-container matColumnDef="Action"> <ng-container matColumnDef="Action">
<mat-cell class="cell center" *matCellDef="let details;"> <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" <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> matTooltipPosition="above" color="primary" (click)="salesPDpdf(details.sales_pd_id)"><mat-icon>file_download</mat-icon></button>
</mat-cell> </mat-cell>
</ng-container> </ng-container>

View File

@ -1,6 +1,7 @@
import { Component, OnInit, ViewChild } from '@angular/core'; 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 { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.service';
import { UserService } from 'app/settings/service/user.service';
@Component({ @Component({
selector: 'app-sales-pd', selector: 'app-sales-pd',
@ -8,11 +9,10 @@ import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.se
styleUrls: ['./sales-pd.component.scss'] styleUrls: ['./sales-pd.component.scss']
}) })
export class SalesPdComponent implements OnInit { export class SalesPdComponent implements OnInit {
public dataLengthTab4: number; public dataLengthTab4: number;
public dataSourceTab4 = new MatTableDataSource(); 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(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort; @ViewChild(MatSort) sort: MatSort;
@ -33,7 +33,7 @@ export class SalesPdComponent implements OnInit {
pageEvent: PageEvent; pageEvent: PageEvent;
todaydate:Date = new Date(); todaydate:Date = new Date();
constructor(private _pdSales: PdTrigerService) { } constructor(private _pdSales: PdTrigerService,private userService:UserService) { }
ngOnInit() { ngOnInit() {
this.loadSalesPDDetails(); this.loadSalesPDDetails();
@ -94,5 +94,4 @@ export class SalesPdComponent implements OnInit {
applyFilter(filterValue: string) { applyFilter(filterValue: string) {
this.dataSourceTab4.filter = filterValue.trim().toLowerCase(); 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-x: hidden;
overflow-y: auto; overflow-y: auto;
position: relative; position: relative;
padding: 2rem; padding: 1.5rem;
margin-bottom: 2rem; // margin-bottom: 2rem;
} }
@media(max-width:991px) { @media(max-width:991px) {
@ -356,7 +356,7 @@
visibility: visible; visibility: visible;
} }
.mat-list-item>.mat-list-item-content>a>.menu-caret, .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; display: none;
} }