marger changes: kms

This commit is contained in:
gandhimathi 2018-10-25 18:44:05 +05:30
parent 2b9f8b952e
commit 0ce828ec8a
67 changed files with 4121 additions and 2851 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
<div class="pad-wrap"> <div class="pad-wrap">
<div fxLayout="row wrap"> <!--<div fxLayout="row wrap">
<div fxFlex.gt-sm="100" fxFlex.gt-xs="100" fxFlex="100"> <div fxFlex.gt-sm="100" fxFlex.gt-xs="100" fxFlex="100">
<mat-card> <mat-card>
<mat-card-title>Today's Status</mat-card-title> <mat-card-title>Today's Status</mat-card-title>
@ -15,8 +15,49 @@
</mat-card-content> </mat-card-content>
</mat-card> </mat-card>
</div> </div>
</div> </div> -->
<div fxLayout="row wrap">
<div fxFlex.gt-sm="33.33%" fxFlex="100" class="m-gap">
<mat-card>
<mat-card-title>Full</mat-card-title>
<mat-card-subtitle></mat-card-subtitle>
<hr>
<mat-card-content>
<div class="w-100 h-300px">
<ngx-charts-gauge [view]="view" [scheme]="colorScheme" [results]="full" [min]="0" [max]="100" [angleSpan]="240" [startAngle]="-120" [units]="'PD'" [bigSegments]="10" [smallSegments]="5" >
</ngx-charts-gauge>
</div>
</mat-card-content>
</mat-card>
</div>
<div fxFlex.gt-sm="33.33%" fxFlex="100" class="m-gap">
<mat-card>
<mat-card-title>Smart</mat-card-title>
<mat-card-subtitle></mat-card-subtitle>
<hr>
<mat-card-content>
<div class="w-100 h-300px">
<ngx-charts-gauge [view]="view" [scheme]="colorScheme" [results]="smart" [min]="0" [max]="100" [angleSpan]="240" [startAngle]="-120" [units]="'PD'" [bigSegments]="10" [smallSegments]="5" >
</ngx-charts-gauge>
</div>
</mat-card-content>
</mat-card>
</div>
<div fxFlex.gt-sm="33.33%" fxFlex="100" class="m-gap">
<mat-card>
<mat-card-title>Tele</mat-card-title>
<mat-card-subtitle></mat-card-subtitle>
<hr>
<mat-card-content>
<div class="w-100 h-300px">
<ngx-charts-gauge [view]="view" [scheme]="colorScheme" [results]="tele" [min]="0" [max]="100" [angleSpan]="240" [startAngle]="-120" [units]="'PD'" [bigSegments]="10" [smallSegments]="5" >
</ngx-charts-gauge>
</div>
</mat-card-content>
</mat-card>
</div>
</div>
<!--Lender,Citywise, Same Status--> <!--Lender,Citywise, Same Status-->
<div fxLayout="row wrap"> <div fxLayout="row wrap">
@ -29,7 +70,7 @@
<ng-template let-item let-last="last" ngFor [ngForOf]="lenderpd"> <ng-template let-item let-last="last" ngFor [ngForOf]="lenderpd">
<mat-list-item> <mat-list-item>
<h3 mat-line> {{item.lendername}} / {{item.billingaddr}} </h3> <h3 mat-line> {{item.lendername}} / {{item.billingaddr}} </h3>
<p mat-line> Full -{{item.fullpd}} / Smart -{{item.smartpd}} </p> <p mat-line> Full -{{item.fullpd}} / Smart -{{item.smartpd}} / Tele - {{item.telepd}} </p>
</mat-list-item> </mat-list-item>
</ng-template> </ng-template>
</mat-list> </mat-list>
@ -44,7 +85,7 @@
<ng-template let-item let-last="last" ngFor [ngForOf]="citywisepd"> <ng-template let-item let-last="last" ngFor [ngForOf]="citywisepd">
<mat-list-item> <mat-list-item>
<h3 mat-line> {{item.cityname}} </h3> <h3 mat-line> {{item.cityname}} </h3>
<p mat-line> Full -{{item.fullpd}} / Smart -{{item.smartpd}} </p> <p mat-line> Full -{{item.fullpd}} / Smart -{{item.smartpd}} / Tele - {{item.telepd}}</p>
</mat-list-item> </mat-list-item>
</ng-template> </ng-template>
</mat-list> </mat-list>

View File

@ -1,122 +1,154 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core';
@Component({ @Component({
selector: 'app-dashboard', selector: 'app-dashboard',
templateUrl: './dashboard.component.html', templateUrl: './dashboard.component.html',
styleUrls: ['./dashboard.component.scss'] styleUrls: ['./dashboard.component.scss']
}) })
export class DashboardComponent { export class DashboardComponent {
//public single: any[];
//public multi: any[];
public showXAxis = true; public showXAxis = true;
public showYAxis = true; public showYAxis = true;
public gradient = false; public gradient = true;
public showLegend = false; public showLegend = false;
public showXAxisLabel = true; public showXAxisLabel = true;
public xAxisLabel = 'Type'; public xAxisLabel = 'Status';
public showYAxisLabel = true; public showYAxisLabel = true;
public yAxisLabel = 'PD'; public yAxisLabel = 'PD';
view: any[];
width = 350;
height= 250;
public colorScheme = { public colorScheme = {
domain: ['#673ab7', '#f44336', '#009688 ', '#2196f3', '#ffd740 ', '#eb35bb '] domain: ['#673ab7', '#f44336', '#009688 ', '#2196f3', '#234278 ', '#2a1653']
}; };
public autoScale = true;
constructor() { constructor() {
}
} ngOnInit(){
this.view = [this.width, this.height];
}
//Full Pd Data
full: Object[] = [
{
name: 'Triggered',
value: 45
},
{
name: 'Allocated',
value: 50
},
{
name: 'Scheduled',
value: 36
},
{
name: 'InProgress',
value: 90
},
{
name: 'Completed',
value: 56
},
{
name: 'QC Completed',
value: 81
}
];
//smart PD data
smart: Object[] = [
{
name: 'Triggered',
value: 65
},
{
name: 'Allocated',
value: 20
},
{
name: 'Scheduled',
value: 80
},
{
name: 'InProgress',
value: 60
},
{
name: 'Completed',
value: 26
},
{
name: 'QC Completed',
value: 51
}
];
//Tele PD Data
tele: Object[] = [
{
name: 'Triggered',
value: 95
},
{
name: 'Allocated',
value: 59
},
{
name: 'Scheduled',
value: 45
},
{
name: 'InProgress',
value: 25
},
{
name: 'Completed',
value: 36
},
{
name: 'QC Completed',
value: 49
}
];
// //Lender wise PD Triggered // //Lender wise PD Triggered
lenderpd: Object[] = [{ lenderpd: Object[] = [{
lendername:'ICICI', lendername:'ICICI',
billingaddr:'Bangalore', billingaddr:'Bangalore',
fullpd:'9', fullpd:'19',
smartpd:'6', smartpd:'6',
telepd:'10',
}, { }, {
lendername:'IOB', lendername:'IOB',
billingaddr:'Chennai', billingaddr:'Chennai',
fullpd:'10', fullpd:'10',
smartpd:'5', smartpd:'5',
telepd:'7',
}, { }, {
lendername:'SBI', lendername:'SBI',
billingaddr:'Pune', billingaddr:'Pune',
fullpd:'16', fullpd:'16',
smartpd:'3', smartpd:'3',
telepd:'33',
}, ]; }, ];
multi: Object[] = [
{
name: 'Full',
series: [
{
name: 'Triggered',
value: 50
},
{
name: 'Allocated',
value: 29
},
{
name: 'Schudled',
value: 45
},
{
name: 'InProgress',
value: 67
},
{
name: 'Completed',
value: 34
},{
name: 'QC Completed',
value: 22
}
]
},
{
name: 'Smart',
series: [
{
name: 'Triggred',
value: 60
},
{
name: 'Allocated',
value: 33
},
{
name: 'Schudled',
value: 76
},
{
name: 'InProgress',
value: 34
},{
name: 'Completed',
value: 56
},{
name: 'QC Completed',
value: 45
}
]
},
];
//City Wise PD Triggered //City Wise PD Triggered
citywisepd: Object[] = [{ citywisepd: Object[] = [{
cityname: 'Bangalore', cityname: 'Bangalore',
fullpd:'45', fullpd:'45',
smartpd:'17', smartpd:'17',
telepd:'10',
}, { }, {
cityname: 'Chennai', cityname: 'Chennai',
fullpd:'33', fullpd:'33',
smartpd:'16', smartpd:'16',
telepd:'8',
}, { }, {
cityname: 'Salem', cityname: 'Salem',
fullpd:'22', fullpd:'22',
smartpd:'12', smartpd:'12',
telepd:'2',
} ]; } ];
// //Same status // //Same status

View File

@ -1,4 +1,4 @@
<mat-card class="p-1">
<form [formGroup]="_PDtriggerForm" (submit)="submitPdDetails(_PDtriggerForm.value,PDTriggerStatus)"> <form [formGroup]="_PDtriggerForm" (submit)="submitPdDetails(_PDtriggerForm.value,PDTriggerStatus)">
<mat-card-content> <mat-card-content>
@ -212,7 +212,7 @@
<h5>Co-Applicant</h5> <h5>Co-Applicant</h5>
<!-- <button _ngcontent-c29="" class="mr-1 mb-2 mat-fab1 mat-accent" mat-fab="" (click)="addCoApplicant(createWithLongContent)"><span class="mat-button-wrapper"><mat-icon _ngcontent-c29="" class="mat-icon material-icons" role="img" aria-hidden="true">add</mat-icon></span><div class="mat-button-ripple mat-ripple mat-button-ripple-round" matripple=""></div><div class="mat-button-focus-overlay"></div></button> --> <!-- <button _ngcontent-c29="" class="mr-1 mb-2 mat-fab1 mat-accent" mat-fab="" (click)="addCoApplicant(createWithLongContent)"><span class="mat-button-wrapper"><mat-icon _ngcontent-c29="" class="mat-icon material-icons" role="img" aria-hidden="true">add</mat-icon></span><div class="mat-button-ripple mat-ripple mat-button-ripple-round" matripple=""></div><div class="mat-button-focus-overlay"></div></button> -->
<!--<button mat-fab class="mr-1 mb-1" color="primary" (click)="addCoApplicant()"><mat-icon>add</mat-icon></button>--> <!--<button mat-fab class="mr-1 mb-1" color="primary" (click)="addCoApplicant()"><mat-icon>add</mat-icon></button>-->
<button mat-fab class="mr-1 mb-1" color="primary" style="opacity: 0.5;" (click)="addCoApplicant()"><mat-icon>group_add</mat-icon><div class="mat-button-ripple mat-ripple" matripple=""></div><div class="mat-button-focus-overlay"></div></button> <button mat-fab class="mr-1 mb-1" color="primary" style="opacity: 0.5;border:2px;border-radius: 50%;" (click)="addCoApplicant()"><mat-icon>group_add</mat-icon><div class="mat-button-ripple mat-ripple" matripple=""></div><div class="mat-button-focus-overlay"></div></button>
<!-- <button mat-raised-button mat-button-sm color="primary" (click)="addCoApplicant()" type="button">Add More Co-Applicant</button> --> <!-- <button mat-raised-button mat-button-sm color="primary" (click)="addCoApplicant()" type="button">Add More Co-Applicant</button> -->
</mat-card> </mat-card>
@ -267,11 +267,11 @@
(click)="onReset()"><mat-icon>settings_backup_restore</mat-icon></button> (click)="onReset()"><mat-icon>settings_backup_restore</mat-icon></button>
<!-- <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Click To Draft" matTooltipPosition="above" type="button" (click)="addCoApplicant()"><mat-icon>drafts</mat-icon></button> --> <!-- <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Click To Draft" matTooltipPosition="above" type="button" (click)="addCoApplicant()"><mat-icon>drafts</mat-icon></button> -->
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" (click)="submitPdDetails(_PDtriggerForm.value,draftStatus)" matTooltip="PD Draft" matTooltipPosition="above"><mat-icon>drafts</mat-icon></button> <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" (click)="submitPdDetails(_PDtriggerForm.value,draftStatus)" matTooltip="PD Draft" matTooltipPosition="above"><mat-icon>description</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="submit" matTooltip="PD Process" matTooltipPosition="above" [disabled]="!enablePDButton || !_PDtriggerForm.valid "><mat-icon>save</mat-icon></button> <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="submit" matTooltip="PD Process" matTooltipPosition="above" [disabled]="!enablePDButton || !_PDtriggerForm.valid "><mat-icon>save</mat-icon></button>
</mat-card-actions> </mat-card-actions>
</form> </form>
</mat-card>

View File

@ -1,141 +1,147 @@
<mat-card> <mat-card>
<mat-card-content> <mat-card-content>
<div fxLayout="row" *ngIf="viewPdList" fxLayoutAlign="start center" class="filter-header"> <div fxLayout="row" *ngIf="viewPdList" fxLayoutAlign="start center" class="filter-header">
<div *ngIf="!noRecordFound" class="ml-xs mr-xs" style="width: 80%;"> <div *ngIf="!noRecordFound" class="ml-xs mr-xs" style="width: 80%;">
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;"> <mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;">
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Filter"> <input matInput (keyup)="applyFilter($event.target.value)" placeholder="Filter">
</mat-form-field> </mat-form-field>
</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>
<div *ngIf="noRecordFound" class="nocontent ml-xs mr-xs" style="width: 80%;">No records found</div> </div>
<div class="ml-xs mr-xs" style="width: 20%;text-align:right" *ngIf="viewPdList"> <mat-card *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> <mat-tab-group>
<button mat-fab color="primary" (click)="addPdDetails()" class="mr-1 mb-1" matTooltip="Add PD" matTooltipPosition="above"><mat-icon>add</mat-icon></button> <mat-tab>
</div> <ng-template mat-tab-label>All</ng-template>
</div> <mat-card-content>
<mat-card *ngIf="viewPdList"> <mat-table [dataSource]="dataSource" matSort *ngIf="pdList.length > 0" >
<mat-tab-group>
<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>
</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>
</mat-tab>
<mat-tab> <mat-tab>
<ng-template mat-tab-label>All</ng-template> <ng-template mat-tab-label>Scheduled </ng-template>
<mat-card-content> <mat-card-content>
<div class="card-comment-widget"> <!--<mat-grid-list cols="2" rowHeight="fit" [gutterSize]="ratioGutter"
<mat-list *ngIf="pdList.length > 0"> [style.height]="fitListHeight">
<mat-list-item *ngFor="let details of dataSource.connect() | async" style="border-bottom:1px solid #f1f7f5"> <mat-grid-tile *ngFor="let tile of tiles" [style.background]="'#F1EBBA'">
<img mat-list-avatar src="assets/images/lime.jpg" alt=""> {{tile.text}}
<!-- {{details.applicat_details[0].applicant_name}} --> </mat-grid-tile>
<p *ngIf="details.applicat_details" mat-line>{{details.applicat_details[0].applicant_name}} </p> </mat-grid-list>
<div fxLayout="row" fxLayoutAlign="start center" class="mt-2">
<p *ngIf="details.lender_full_name" mat-line><a style="padding-right: 7%;">{{details.lender_full_name}} </a><a style="padding-right: 7%">{{details.lender_applicant_id}}</a>{{details.pd_date_of_initiation}}</p> <mat-form-field>
<p *ngIf="details.product_abbr" mat-line><a style="padding-right: 7%;">{{details.product_abbr}}/{{details.subproduct_abbr}}/{{details.customer_segment_abbr}}</a><a style="padding-right: 7%;"><span *ngIf="details.loan_amount" class="hover-icon"><i class="fa-1x fa fa-rupee">&nbsp;</i>{{details.loan_amount}}</span></a><span class="hover-icon"><i class="fa-1x fa fa-map-marker"> </i> &nbsp;{{details.city_name}}/{{details.state_name}}-{{details.pincode}}</span></p> <input matInput placeholder="Change list height" [(ngModel)]="fitListHeight">
<!-- <span class="text-mat mat-text-muted">Chennai</span> --> </mat-form-field>
<mat-form-field>
<!-- <div class="comment-time"> <input matInput placeholder="Change gutter" type="number" [(ngModel)]="ratioGutter">
<button mat-raised-button mat-icon-button mat-button-sm class="mr-1 mb-1" type="button" color="primary" (click)="editPdDetails(details.pd_id)"><mat-icon>edit</mat-icon></button> </mat-form-field>
</div>-->
</div> --> </mat-card-content>
<div class="comment-time"> </mat-tab>
<!-- <button mat-raised-button mat-icon-button mat-button-sm class="mr-1 mb-1" color="accent" type="button" (click)="viewPdDetails(details.pd_id)"><mat-icon>visibility</mat-icon></button> -->
<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>
</div>
</mat-list-item>
</mat-list>
<mat-list *ngIf="recordStatus">
<mat-list-item>
<p mat-line>No Record Found ...</p>
</mat-list-item>
</mat-list>
</div>
</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, 100]" (page)="pageEvent = $event; pageChange($event)">
</mat-paginator>
</mat-card-actions>
</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> <mat-tab>
<ng-template mat-tab-label>In Progress </ng-template> <ng-template mat-tab-label>Completed </ng-template>
<mat-card-content> <mat-card-content>
<!--<mat-grid-list cols="2" rowHeight="fit" [gutterSize]="ratioGutter" <!--<mat-grid-list cols="2" rowHeight="fit" [gutterSize]="ratioGutter"
[style.height]="fitListHeight"> [style.height]="fitListHeight">
<mat-grid-tile *ngFor="let tile of tiles" [style.background]="'#F1EBBA'"> <mat-grid-tile *ngFor="let tile of tiles" [style.background]="'#F1EBBA'">
{{tile.text}} {{tile.text}}
</mat-grid-tile> </mat-grid-tile>
</mat-grid-list> </mat-grid-list>
<div fxLayout="row" fxLayoutAlign="start center" class="mt-2"> <div fxLayout="row" fxLayoutAlign="start center" class="mt-2">
<mat-form-field> <mat-form-field>
<input matInput placeholder="Change list height" [(ngModel)]="fitListHeight"> <input matInput placeholder="Change list height" [(ngModel)]="fitListHeight">
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input matInput placeholder="Change gutter" type="number" [(ngModel)]="ratioGutter"> <input matInput placeholder="Change gutter" type="number" [(ngModel)]="ratioGutter">
</mat-form-field> </mat-form-field>
</div>--> </div>-->
</mat-card-content> </mat-card-content>
</mat-tab> </mat-tab>
<mat-tab>
<ng-template mat-tab-label>Scheduled </ng-template> </mat-tab-group>
<mat-card-content> </mat-card>
<!--<mat-grid-list cols="2" rowHeight="fit" [gutterSize]="ratioGutter"
[style.height]="fitListHeight"> <notifier-container></notifier-container>
<mat-grid-tile *ngFor="let tile of tiles" [style.background]="'#F1EBBA'"> <router-outlet></router-outlet>
{{tile.text}} </mat-card-content>
</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>
</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>
</mat-tab>
</mat-tab-group>
</mat-card> </mat-card>
<notifier-container></notifier-container>
<router-outlet></router-outlet>
</mat-card-content>
</mat-card>

View File

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

View File

@ -10,6 +10,12 @@ import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/m
encapsulation: ViewEncapsulation.None encapsulation: ViewEncapsulation.None
}) })
export class ListPdComponent implements OnInit, OnDestroy { 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;
private notifier: NotifierService; private notifier: NotifierService;
recordStatus: boolean; recordStatus: boolean;
noRecordFound:boolean; noRecordFound:boolean;
@ -24,10 +30,7 @@ export class ListPdComponent implements OnInit, OnDestroy {
// data source variable details // data source variable details
pdListData = null; pdListData = null;
public dataLength: number;
public dataSource = new MatTableDataSource();
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
pdList:any[] = []; pdList:any[] = [];
constructor( notifier: NotifierService, private route: ActivatedRoute, constructor( notifier: NotifierService, private route: ActivatedRoute,
private router: Router, private _pd: PdTrigerService) { private router: Router, private _pd: PdTrigerService) {

View File

@ -1,75 +1,75 @@
<div fxLayout="row"> <div fxLayout="row">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100"> <div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
<div *ngIf="!noRecordFound" class="ml-xs mr-xs" style="width: 95%;"> <div *ngIf="!noRecordFound" class="ml-xs mr-xs" style="width: 95%;">
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 24%;"> <mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 24%;">
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Filter"> <input matInput (keyup)="applyFilter($event.target.value)" placeholder="Filter">
</mat-form-field> </mat-form-field>
<div style="text-align:right;margin-top: -6%;">
<button mat-fab color="primary" (click)="goList()" class="mr-1 mb-1"><mat-icon>close</mat-icon></button> </div>
<div>
<div style="text-align:right;position:absolute;z-index:2;right:1px">
<button mat-fab color="primary" matTooltip="Close" matTooltipPosition="above" (click)="goList()"><mat-icon>close</mat-icon></button>
</div>
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25" style="position:absolute;z-index:1">
<div [style.overflow]="'auto'" [style.height.px]="'500'" *ngIf="pdList.length > 0">
<mat-expansion-panel>
<mat-expansion-panel-header style="background-color:#f44336;color:#fff">
PD Details
</mat-expansion-panel-header>
<div>
<input style="border-bottom: 1px solid #dcd9d9;padding-top: 5%;" matInput (keyup)="applyFilter($event.target.value)" placeholder="Search">
</div>
<mat-card *ngFor="let details of dataSource.connect() | async">
<mat-card-title *ngIf="details.applicat_details" style="margin-bottom: 0px;">
<div fxLayout="row" fxFlex="100">
<div fxFlex="55">
<span style="font-weight:700">{{details.applicat_details[0].applicant_name}}</span> <br>
<span style="font-size: 13px;" >{{details.lender_full_name}}({{details.lender_applicant_id}})</span><br>
</div>
<div fxFlex="45" style="text-align:right;">
<button mat-raised-button mat-button-sm mat-icon-button class="mr-1 hover-icon" type="button" matTooltip="PD Allocation" matTooltipPosition="above" (click)="pdAllocationTo(details)"><mat-icon>verified_user</mat-icon></button>
<button mat-raised-button mat-button-sm mat-icon-button class=" hover-icon" type="button" matTooltip="Schedule" matTooltipPosition="above" (click)="scheduleDetails(details)"><mat-icon>schedule</mat-icon></button>
</div>
</div>
</mat-card-title>
<mat-card-content style="padding: 2% 0% 0% 7%;">
<span class="hover-icon"><i *ngIf="details.city_name" class="fa-1x fa fa-map-marker">&nbsp;</i>{{details.city_name}}/{{details.state_name}}-{{details.pincode}}</span> <br>
<span *ngIf="details.product_abbr">{{details.product_abbr}}/{{details.subproduct_abbr}}</span><br>
<span> {{details.customer_segment_abbr}}<span *ngIf="details.loan_amount" style="padding-left: 48%;"><i class="fa-1x fa fa-rupee">&nbsp;</i>{{details.loan_amount}}</span></span><br>
<span>{{details.pd_date_of_initiation}}</span>
</mat-card-content>
</mat-card>
<mat-list *ngIf="recordStatus">
<mat-list-item>
<p mat-line>No Record Found ...</p>
</mat-list-item>
</mat-list>
</mat-expansion-panel>
</div>
<!---- <mat-paginator #paginator [length]="pdList.length" [pageIndex]="pageIndex" [pageSize]="pageSize"
[pageSizeOptions]="[5, 10, 25, 100]" (page)="pageEvent = $event; pageChange($event)">
</mat-paginator> -->
</div>
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
<mat-card class="mb-2" *ngIf="pdList.length > 0">
<agm-map [latitude]="lat" [longitude]="lng">
<agm-marker *ngFor="let getMap of mapDetails" [latitude]="getMap.lat" [longitude]="getMap.lng"></agm-marker>
</agm-map>
</mat-card>
</div>
</div> </div>
</div>
</div> </div>
<div class="mb-2" >
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<!-- <mat-expansion-panel *ngFor="let details of dataSource.connect() | async">
<mat-expansion-panel-header>
<mat-panel-title>
<b> {{details.applicat_details[0].applicant_name}} </b>
</mat-panel-title>
<mat-panel-description>
{{details.product_abbr}}/{{details.subproduct_abbr}}
</mat-panel-description>
</mat-expansion-panel-header>
<p mat-line>Lendor ID:{{details.lender_applicant_id}}</p>
<p mat-line>Lendor Name:{{details.lender_full_name}}</p>
<p mat-line>Date Of Initiation:{{details.pd_date_of_initiation}}</p>
<p mat-line class="hover-icon"><i class="fa-1x fa fa-rupee">&nbsp;</i>{{details.loan_amount}}
</p>
<p mat-line>
<button mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="pdAllocationTo(master)"><mat-icon>directions_run</mat-icon></button>
</p>
</mat-expansion-panel> -->
<mat-card [style.overflow]="'auto'" [style.height.px]="'500'" *ngIf="pdList.length > 0">
<mat-card class="mb-1" *ngFor="let details of dataSource.connect() | async">
<mat-card-actions style="text-align:right;">
<button mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="pdAllocationTo(details)"><mat-icon>directions_run</mat-icon></button>
<button mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="scheduleDetails(details)"><mat-icon>schedule</mat-icon></button>
</mat-card-actions>
<mat-card-title *ngIf="details.applicat_details">{{details.applicat_details[0].applicant_name}}</mat-card-title>
<mat-card-content class="mb-1"><p class="hover-icon"><i *ngIf="details.city_name" class="fa-1x fa fa-map-marker">&nbsp;</i>{{details.city_name}}/{{details.state_name}}-{{details.pincode}}</p>
<p>{{details.lender_full_name}}({{details.lender_applicant_id}})</p>
<p *ngIf="details.product_abbr">{{details.product_abbr}}/{{details.subproduct_abbr}}/{{details.customer_segment_abbr}}</p>
<p>{{details.pd_date_of_initiation}} <span *ngIf="details.loan_amount" style="padding-left: 4%;" class="hover-icon"><i class="fa-1x fa fa-rupee">&nbsp;</i>{{details.loan_amount}}</span></p>
</mat-card-content>
</mat-card>
</mat-card>
<mat-list *ngIf="recordStatus">
<mat-list-item>
<p mat-line>No Record Found ...</p>
</mat-list-item>
</mat-list>
<!-- </mat-card-content> -->
<!-- <mat-card-actions *ngIf="!recordStatus"> -->
<mat-paginator #paginator [length]="pdList.length" [pageIndex]="pageIndex" [pageSize]="pageSize"
[pageSizeOptions]="[5, 10, 25, 100]" (page)="pageEvent = $event; pageChange($event)">
</mat-paginator>
<!-- </mat-card-actions>
</mat-card> -->
</div>
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="75" fxFlex.lg="75" fxFlex.xl="75">
<mat-card class="mb-2" *ngIf="pdList.length > 0">
<agm-map [latitude]="lat" [longitude]="lng">
<agm-marker *ngFor="let getMap of mapDetails" [latitude]="getMap.lat" [longitude]="getMap.lng"></agm-marker>
</agm-map>
</mat-card>
</div>
</div>
</div>
</div>

View File

@ -1,9 +1,9 @@
<div style="max-height: 480px;"> <div style="height: 480px;">
<div style="text-align: right"> <div style="text-align: right">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="closeAllocationComponent()"><mat-icon>close</mat-icon></button> <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="closeAllocationComponent()"><mat-icon>close</mat-icon></button>
</div> </div>
<mat-card style="width: 580px; padding: 2px;"> <mat-card style="width: 750px;">
<mat-card-header> <mat-card-header>
<mat-card-title>{{pageTitle}}</mat-card-title> <mat-card-title>{{pageTitle}}</mat-card-title>
</mat-card-header> </mat-card-header>
@ -13,16 +13,12 @@
<mat-list *ngIf="pdOfficerList.length > 0"> <mat-list *ngIf="pdOfficerList.length > 0">
<mat-list-item *ngFor="let officer of pdOfficerList"> <mat-list-item *ngFor="let officer of pdOfficerList">
<p><mat-radio-button (change)="selectPdOfficer(officer)"></mat-radio-button> <p><mat-radio-button (change)="selectPdOfficer(officer)"></mat-radio-button>
{{officer.first_name}} {{officer.first_name}} -
</p>
<p style="padding-left: 8%;">
<span matBadge="{{officer.allocated}}" matBadgeOverlap="false" matBadgeColor="accent">Allocated</span> <span matBadge="{{officer.allocated}}" matBadgeOverlap="false" matBadgeColor="accent">Allocated</span>&nbsp; &nbsp;&nbsp; &nbsp;
</p> <span matBadge="{{officer.scheduled}}" matBadgeOverlap="false" >Scheduled</span>&nbsp;&nbsp;&nbsp; &nbsp;
<p style="padding-left: 8%;"> <span matBadge="{{officer.inprogress}}" matBadgeOverlap="false" matBadgeColor="warn">Inprogress</span>
<span matBadge="{{officer.scheduled}}" matBadgeOverlap="false" >Scheduled</span>
</p>
<p style="padding-left: 8%;">
<span matBadge="{{officer.inprogress}}" matBadgeOverlap="false" matBadgeColor="warn">Inprogress</span>
</p> </p>
</mat-list-item> </mat-list-item>

View File

@ -14,7 +14,7 @@
<mat-list *ngIf="pdOfficerList.length > 0" > <mat-list *ngIf="pdOfficerList.length > 0" >
<mat-radio-group> <mat-radio-group>
<mat-list-item *ngFor="let officer of pdOfficerList; "> <mat-list-item *ngFor="let officer of pdOfficerList; ">
<p><mat-radio-button [value]="officer" (change)="selectPdOfficer(officer)"></mat-radio-button> <!-- <p><mat-radio-button [value]="officer" (change)="selectPdOfficer(officer)"></mat-radio-button>
{{officer.first_name}} {{officer.first_name}}
</p> </p>
<p style="padding-left: 8%;"> <p style="padding-left: 8%;">
@ -26,7 +26,16 @@
<p style="padding-left: 8%;"> <p style="padding-left: 8%;">
<span matBadge="{{officer.inprogress}}" matBadgeOverlap="false" matBadgeColor="warn">Inprogress</span> <span matBadge="{{officer.inprogress}}" matBadgeOverlap="false" matBadgeColor="warn">Inprogress</span>
</p> </p>
-->
<p><mat-radio-button [value]="officer" (change)="selectPdOfficer(officer)"></mat-radio-button>
{{officer.first_name}} -
<span matBadge="{{officer.allocated}}" matBadgeOverlap="false" matBadgeColor="accent">Allocated</span>&nbsp; &nbsp;&nbsp; &nbsp;
<span matBadge="{{officer.scheduled}}" matBadgeOverlap="false" >Scheduled</span>&nbsp;&nbsp;&nbsp; &nbsp;
<span matBadge="{{officer.inprogress}}" matBadgeOverlap="false" matBadgeColor="warn">Inprogress</span>
</p>
</mat-list-item> </mat-list-item>
</mat-radio-group> </mat-radio-group>
</mat-list> </mat-list>

View File

@ -5,10 +5,10 @@
{{master.pd_date_of_initiation}} {{master.pd_date_of_initiation}}
</div> </div>
<div *ngFor="let master of pdMasterData" class="ml-xs mr-xs pt-1" fxFlex="25" style="text-align:right;" > <div *ngFor="let master of pdMasterData" class="ml-xs mr-xs pt-1" fxFlex="25" style="text-align:right;" >
<button *ngIf="master.pd_type_name" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="pdAllocationTo(master)"><mat-icon>directions_run</mat-icon></button> <button *ngIf="master.pd_type_name" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="PD Allocation" matTooltipPosition="above" (click)="pdAllocationTo(master)"><mat-icon>verified_user</mat-icon></button>
<button *ngIf="master.pd_type_name" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="scheduleDetails(master)"><mat-icon>schedule</mat-icon></button> <button *ngIf="master.pd_type_name" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Schedule" matTooltipPosition="above" (click)="scheduleDetails(master)"><mat-icon>schedule</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="getPDStart(viewID)"><mat-icon>question_answer</mat-icon></button> <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="PD Details" matTooltipPosition="above" (click)="getPDStart(viewID)"><mat-icon>question_answer</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="loadPdListCompoent()"><mat-icon>close</mat-icon></button> <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="above" (click)="loadPdListCompoent()"><mat-icon>close</mat-icon></button>
<br><span style="color:red;text-align:center">{{master.pd_allocated_to}} -{{master.pd_status_name}}</span> <br><span style="color:red;text-align:center">{{master.pd_allocated_to}} -{{master.pd_status_name}}</span>
</div> </div>

View File

@ -1,16 +1,14 @@
<div style="max-height: 580px;"> <div style="max-height: 580px;">
<form [formGroup]="_addQuesFrom" (submit)="onSubmit()"> <form [formGroup]="_addQuesFrom" (submit)="onSubmit()">
<mat-card style="padding: 6px;"> <mat-card style="padding: 6px;">
<div class="ml-xs mr-xs" style="width: 100%;" fxLayout="row" fxLayoutAlign="center"> <div class="ml-xs mr-xs" style="width: 100%;" fxLayout="row" fxLayoutAlign="center">
<h2 mat-dialog-title style="width: 50%;">{{pageTitle}}</h2> <h2 mat-dialog-title style="width: 50%;">{{pageTitle}}</h2>
<div style="width: 20%;"></div> <div style="width: 20%;"></div>
<div style="width: 30%;text-align:right;"> <div style="width: 30%;text-align:right;">
<button mat-raised-button mat-icon-button color="primary" class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button> <button mat-raised-button mat-icon-button color="primary" class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above"
type="button" (click)="onNoClick()"><mat-icon>close</mat-icon></button>
</div>
</div> </div>
</div>
<!--<div class="form-group">-->
<div fxLayout="row wrap" fxLayoutGap="32px" fxLayoutAlign="flex-start"> <div fxLayout="row wrap" fxLayoutGap="32px" fxLayoutAlign="flex-start">
<mat-form-field fxFlex="0 1 auto" class="ml-xs"> <mat-form-field fxFlex="0 1 auto" class="ml-xs">
<mat-select placeholder="Select Entity Type" formControlName="fk_entity_type_id"> <mat-select placeholder="Select Entity Type" formControlName="fk_entity_type_id">
@ -18,7 +16,7 @@
</mat-select> </mat-select>
<mat-error *ngIf="submitted && f.fk_entity_type_id.hasError('required')" class="mat-text-warn">You must Select Entity Type.</mat-error> <mat-error *ngIf="submitted && f.fk_entity_type_id.hasError('required')" class="mat-text-warn">You must Select Entity Type.</mat-error>
</mat-form-field> </mat-form-field>
</div> </div>
<div fxLayout="row wrap" fxLayoutGap="32px" fxLayoutAlign="flex-start"> <div fxLayout="row wrap" fxLayoutGap="32px" fxLayoutAlign="flex-start">
<mat-form-field fxFlex="0 1 auto" class="ml-xs"> <mat-form-field fxFlex="0 1 auto" class="ml-xs">
@ -31,164 +29,11 @@
<mat-error *ngIf="submitted && f.short_name.hasError('required')" class="mat-text-warn">You must Include Short Name.</mat-error> <mat-error *ngIf="submitted && f.short_name.hasError('required')" class="mat-text-warn">You must Include Short Name.</mat-error>
</mat-form-field> </mat-form-field>
</div> </div>
<div fxLayout="row wrap" fxLayoutGap="32px" fxLayoutAlign="flex-start">
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<mat-select placeholder="Select Region" formControlName="fk_region">
<mat-option *ngFor="let reg of geoRecords" [value]="reg.region_id" (click)="selectGeoRegionChanges(reg.state_data)">{{ reg.region_name }}</mat-option>
</mat-select>
<mat-error *ngIf="submitted && f.fk_region.hasError('required')" class="mat-text-warn">You must Select Region.</mat-error>
</mat-form-field>
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<mat-select placeholder="Select State" formControlName="fk_state">
<mat-option *ngFor="let st of state_m" [value]="st.state_id" (click)="selectGeoStateChanges(st.city_data)">{{ st.state_name }}</mat-option>
</mat-select>
<mat-error *ngIf="submitted && f.fk_state.hasError('required')" class="mat-text-warn">You must Select State.</mat-error>
</mat-form-field>
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<mat-select placeholder="Select City" formControlName="fk_city">
<mat-option *ngFor="let ct of city_m" [value]="ct.city_id" (click)="selectGeoCityChanges(ct.branch_data)">{{ ct.city_name }}</mat-option>
</mat-select>
<mat-error *ngIf="submitted && f.fk_city.hasError('required')" class="mat-text-warn">You must Select City.</mat-error>
</mat-form-field>
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<mat-select placeholder="Select Branch" formControlName="fk_branch">
<mat-option *ngFor="let brn of branch_m" [value]="brn.branch_id">{{ brn.branch_name }}</mat-option>
</mat-select>
<mat-error *ngIf="submitted && f.fk_branch.hasError('required')" class="mat-text-warn">You must Select Branch.</mat-error>
</mat-form-field>
</div>
<div fxLayout="row wrap" fxLayoutGap="32px" fxLayoutAlign="flex-start">
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="Address 1" formControlName="addressline1">
<mat-error *ngIf="submitted && f.addressline1.hasError('required')" class="mat-text-warn">You must Include Address.</mat-error>
</mat-form-field>
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="Address 2" formControlName="addressline2">
<!--<mat-error *ngIf="submitted && f.addressline2.hasError('required')" class="mat-text-warn">You must Include Address.</mat-error>-->
</mat-form-field>
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="Address 3" formControlName="addressline3">
<!-- <mat-error *ngIf="submitted && f.addressline3.hasError('required')" class="mat-text-warn">You must Include Address.</mat-error>-->
</mat-form-field>
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="Pincode" formControlName="pincode">
<mat-error *ngIf="submitted && f.pincode.hasError('required')" class="mat-text-warn">You must Include Pincode.</mat-error>
</mat-form-field>
</div>
<div fxLayout="row wrap" fxLayoutGap="32px" fxLayoutAlign="flex-start">
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="Official Email" formControlName="official_email">
<mat-error *ngIf="submitted && f.official_email.hasError('required')" class="mat-text-warn">You must Include Official Email.</mat-error>
</mat-form-field>
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="Alternate Email" formControlName="alt_email">
<!-- <mat-error *ngIf="submitted && f.alt_email.hasError('required')" class="mat-text-warn">You must Select Alternet Email.</mat-error>-->
</mat-form-field>
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="Phone Number" formControlName="phone_number">
<mat-error *ngIf="submitted && f.phone_number.hasError('required')" class="mat-text-warn">You must Include Phone Number.</mat-error>
</mat-form-field>
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="Mobile Number" formControlName="mobile_no">
<!-- <mat-error *ngIf="submitted && f.mobile_no.hasError('required')" class="mat-text-warn">You must Include Mobile Number.</mat-error>-->
</mat-form-field>
</div>
<div fxLayout="row wrap" fxLayoutGap="32px" fxLayoutAlign="flex-start">
<mat-form-field fxFlex="0 1 calc(33.3% - 32px)" class="ml-xs">
<textarea matInput placeholder="Remarks" formControlName="remarks"></textarea>
<mat-error *ngIf="submitted && f.remarks.hasError('required')" class="mat-text-warn">You must Include Remarks.</mat-error>
</mat-form-field>
</div>
</mat-card>
<mat-card style="padding: 6px;">
<h2 mat-dialog-title style="width: 50%;">{{subTitle1}}</h2>
<div fxLayout="row wrap" fxLayoutGap="32px" fxLayoutAlign="flex-start">
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="PAN Number" formControlName="pan">
<mat-error *ngIf="submitted && f.pan.hasError('required')" class="mat-text-warn">You must Include Pan Number.</mat-error>
</mat-form-field>
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="GST Number" formControlName="gst_no">
<mat-error *ngIf="submitted && f.gst_no.hasError('required')" class="mat-text-warn">You must Include GST Number.</mat-error>
</mat-form-field>
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="GST State Code" formControlName="gst_state_code">
<mat-error *ngIf="submitted && f.gst_state_code.hasError('required')" class="mat-text-warn">You must Include GST State Code.</mat-error>
</mat-form-field>
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="TAT" formControlName="tat">
<mat-error *ngIf="submitted && f.tat.hasError('required')" class="mat-text-warn">You must Include TAT.</mat-error>
</mat-form-field>
</div>
</mat-card>
<mat-card style="padding: 6px;">
<div fxLayout="row wrap" fxLayoutAlign="start none">
<h2 mat-dialog-title style="width: 50%;">{{subTitle2}}</h2>
<div formArrayName="entity_child" class="example-full-width">
<div *ngFor="let answ of _addQuesFrom.controls.entity_child['controls']; let i=index">
<div [formGroupName]="i">
<div fxLayout="row wrap" style="width: 100%">
<div style="width: 90%">
<div fxLayout="row wrap" fxLayoutGap="32px" fxLayoutAlign="flex-start">
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="Contact Person" formControlName="contact_person">
<!--<mat-error *ngIf="submitted && f.contact_person.hasError('required')" class="mat-text-warn">You must Include Contact Person.</mat-error>-->
</mat-form-field>
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="Email" formControlName="contact_email">
<!--<mat-error *ngIf="submitted && f.contact_email.hasError('required')" class="mat-text-warn">You must Include Email.</mat-error>-->
</mat-form-field>
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="Mobile Number" formControlName="contact_mobile_no">
<!--<mat-error *ngIf="submitted && f.contact_mobile_no.hasError('required')" class="mat-text-warn">You must Include Mobile Number.</mat-error>-->
</mat-form-field>
</div>
</div>
<div style="width:10%">
<span *ngIf="_addQuesFrom.controls.entity_child.controls.length > 1" (click)="removeLanguage(i)">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above"><mat-icon>delete</mat-icon></button>
</span>
</div>
</div>
</div>
</div>
<!-- <button mat-button color="primary" matTooltip="Add More Answer" matTooltipPosition="above" (click)="addLanguage($event); false">Add More</button>-->
<button mat-fab class="mr-1 mb-1" color="primary" matTooltip="Add More Contact Person" matTooltipPosition="above" (click)="addLanguage($event); false"><mat-icon>add</mat-icon></button>
</div>
</div>
<!--Error List Shown Here-->
<!--<ul>
<li *ngFor="let err of errorMessage">
<mat-error>{{err.err}}</mat-error>
</li>
</ul>-->
<div class="row" style="text-align:right;"> <div class="row" style="text-align:right;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset"><mat-icon>settings_backup_restore</mat-icon></button> <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset"><mat-icon>settings_backup_restore</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button> <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button>
</div> </div>
<!--</div>--> </mat-card>
</mat-card> </form>
</form>
</div> </div>
<notifier-container></notifier-container> <notifier-container></notifier-container>

View File

@ -16,11 +16,12 @@ import {
import { NotifierService } from 'angular-notifier'; import { NotifierService } from 'angular-notifier';
// import { import {
// MatDialog, MatDialog,
// MatDialogRef, MatDialogRef,
// MAT_DIALOG_DATA MAT_DIALOG_DATA
// } from '@angular/material'; } from '@angular/material';
/** Service */ /** Service */
import { MastersService } from './../../service/masters/masters.service'; import { MastersService } from './../../service/masters/masters.service';
import { EntityService } from './../../service/entity/entity.service'; import { EntityService } from './../../service/entity/entity.service';
@ -41,10 +42,7 @@ export class EntityAddComponent implements OnInit {
public subTitle2: string = "Contacts"; public subTitle2: string = "Contacts";
public _addQuesFrom: FormGroup; public _addQuesFrom: FormGroup;
public submitted = false; public submitted = false;
public categories: any = [];
public geoRecords: any = [];
public entityOptions: any = []; public entityOptions: any = [];
public questionsOptions: any = [];
errorMessage: string; errorMessage: string;
/** /**
@ -57,7 +55,8 @@ export class EntityAddComponent implements OnInit {
private _formBuilder: FormBuilder, private _formBuilder: FormBuilder,
private masterService: MastersService, private masterService: MastersService,
private entityService: EntityService, private entityService: EntityService,
private router: Router) { private router: Router,
private dialogRef: MatDialogRef<EntityAddComponent>) {
this.notifier = notifier; this.notifier = notifier;
} }
@ -65,96 +64,20 @@ export class EntityAddComponent implements OnInit {
ngOnInit() { ngOnInit() {
/** Questions Form Datas*/ /** Questions Form Datas*/
this._addQuesFrom = this._formBuilder.group({ this._addQuesFrom = this._formBuilder.group({
entity_id: [null],
fk_entity_type_id: [null, Validators.compose([Validators.required])], fk_entity_type_id: [null, Validators.compose([Validators.required])],
full_name: [null, Validators.compose([Validators.required])], full_name: [null, Validators.compose([Validators.required])],
short_name: [null, Validators.compose([Validators.required])], short_name: [null, Validators.compose([Validators.required])],
fk_region: [null, Validators.compose([Validators.required])], remarks: [null],
fk_state: [null, Validators.compose([Validators.required])], isactive: [1]
fk_city: [null, Validators.compose([Validators.required])],
fk_branch: [null, Validators.compose([Validators.required])],
addressline1: [null, Validators.compose([Validators.required])],
pincode: [null, Validators.compose([Validators.required])],
official_email: [null, Validators.compose([Validators.required, Validators.email])],
phone_number: [null, Validators.compose([Validators.required])],
remarks: [null, Validators.compose([Validators.required])],
pan: [null, Validators.compose([Validators.required])],
gst_no: [null, Validators.compose([Validators.required])],
gst_state_code: [null, Validators.compose([Validators.required])],
tat: [null, Validators.compose([Validators.required])],
entity_child: this._formBuilder.array([
this.initAnswers(),
])
}); });
// OnInit Load Geo Details and Question Type Masters
this.getGeoLocationMaster();
this.getEntityOptionsMaster(); this.getEntityOptionsMaster();
} }
// convenience getter for easy access to form fields // convenience getter for easy access to form fields
get f() { return this._addQuesFrom.controls; } get f() { return this._addQuesFrom.controls; }
// Dynamic Form field creation Functionality : START ===>
initAnswers() {
return this._formBuilder.group({
contact_person: ['', Validators.compose([Validators.required])],
contact_email: ['', Validators.compose([Validators.required, Validators.email])],
contact_mobile_no: ['', Validators.compose([Validators.required])],
});
}
addLanguage(e) {
const control = <FormArray>this._addQuesFrom.controls['entity_child'];
control.push(this.initAnswers());
}
removeLanguage(i: number) {
const control = <FormArray>this._addQuesFrom.controls['entity_child'];
control.removeAt(i);
}
// END ===>
public state_m: any = [];
selectGeoRegionChanges(reg){
this._addQuesFrom.controls.fk_state.reset();
this._addQuesFrom.controls.fk_city.reset();
this._addQuesFrom.controls.fk_branch.reset();
this.state_m = [];
this.city_m = [];
this.branch_m = [];
if(reg){
this.state_m = reg;
}
}
public city_m: any = []
selectGeoStateChanges(city) {
this._addQuesFrom.controls.fk_city.reset();
this._addQuesFrom.controls.fk_branch.reset();
this.city_m = [];
this.branch_m = [];
if(city){
this.city_m = city;
}
}
public branch_m: any = [];
selectGeoCityChanges(brn){
this._addQuesFrom.controls.fk_branch.reset();
this.branch_m = [];
if(brn){
this.branch_m = brn;
}
}
getGeoLocationMaster() {
this.entityService.getGeoLocationMasterDetails().subscribe(
data => {
this.geoRecords = data.records;
},
error => {
this.notifier.notify('warning', 'No Geo Location Records Found.!');
this.errorMessage = "No Category Records Found.";
}
)
}
getEntityOptionsMaster() { getEntityOptionsMaster() {
this.masterService.getAllMasterData('ENTITYTYPE').subscribe( this.masterService.getAllMasterData('ENTITYTYPE').subscribe(
data => { data => {
@ -169,8 +92,8 @@ export class EntityAddComponent implements OnInit {
/** For Popup Close Button */ /** For Popup Close Button */
onNoClick(): void { onNoClick(): void {
// this.dialogRef.close(); this.dialogRef.close(null);
this.router.navigate(['/setting/entity/list']); // this.router.navigate(['/setting/entity/list']);
} }
/** To Save/Edited Popup Data */ /** To Save/Edited Popup Data */
@ -192,16 +115,16 @@ export class EntityAddComponent implements OnInit {
if (dataresult.status == 200) { if (dataresult.status == 200) {
console.log(dataresult); console.log(dataresult);
this.notifier.notify('success', 'Record Saved Successfully.!'); this.notifier.notify('success', 'Record Saved Successfully.!');
this.router.navigate(['/setting/entity/list']); this.dialogRef.close(dataresult);
this._addQuesFrom.reset();
} }
else { else {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
this.errorMessage = "Some Thing Wents Wrong Try Again !"; // this.errorMessage = "Some Thing Wents Wrong Try Again !";
} }
}, error => { }, error => {
this.dialogRef.close(null);
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
this.errorMessage = "Something Wents Wrong Try Again !"; // this.errorMessage = "Something Wents Wrong Try Again !";
}); });
} }
} }

View File

@ -0,0 +1,103 @@
<div style="max-height: 480px;">
<div fxLayout="row wrap" fxLayoutAlign="end">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button>
</div>
<mat-card>
<h4>{{editAddType}} - Billing Information Details</h4>
<hr>
<!--{{data | json}}-->
<form [formGroup]="_editEntityBillingInfoFrom" (submit)="onSubmit()">
<div fxLayout="row wrap" fxLayout.xs="column" fxLayoutGap="2%" fxLayoutAlign="start center">
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="Billing Name" formControlName="billing_name">
<mat-error *ngIf="submitted && f.billing_name.hasError('required')" class="mat-text-warn">You must Include Billing Name.</mat-error>
</mat-form-field>
</div>
<div fxLayout="row wrap" fxLayout.xs="column" fxLayoutGap="2%" fxLayoutAlign="start center">
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="Door No./ Street No." formControlName="addressline1">
<mat-error *ngIf="submitted && f.addressline1.hasError('required')" class="mat-text-warn">You must Include Door No./ Street No.</mat-error>
</mat-form-field>
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="Street Name" formControlName="addressline2">
<mat-error *ngIf="submitted && f.addressline2.hasError('required')" class="mat-text-warn">You must Include Street Name.</mat-error>
</mat-form-field>
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="City, State" formControlName="addressline3">
<mat-error *ngIf="submitted && f.addressline3.hasError('required')" class="mat-text-warn">You must Include City, State.</mat-error>
</mat-form-field>
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="Pincode" formControlName="pincode">
<mat-error *ngIf="submitted && f.pincode.hasError('required')" class="mat-text-warn">You must Include Pincode.</mat-error>
</mat-form-field>
</div>
<div fxLayout="row wrap" fxLayout.xs="column" fxLayoutGap="2%" fxLayoutAlign="start center">
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="Email" formControlName="email">
<mat-error *ngIf="submitted && f.email.hasError('required')" class="mat-text-warn">You must Include Email.</mat-error>
</mat-form-field>
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="Mobile" formControlName="mobileno">
<mat-error *ngIf="submitted && f.mobileno.hasError('required')" class="mat-text-warn">You must Include Mobile.</mat-error>
</mat-form-field>
</div>
<div fxLayout="row wrap" fxLayout.xs="column" fxLayoutGap="2%" fxLayoutAlign="start center">
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="GST" formControlName="gstno">
<mat-error *ngIf="submitted && f.gstno.hasError('required')" class="mat-text-warn">You must Include GST.</mat-error>
</mat-form-field>
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="PAN" formControlName="pan">
<mat-error *ngIf="submitted && f.pan.hasError('required')" class="mat-text-warn">You must Include PAN.</mat-error>
</mat-form-field>
</div>
<div>
<div formArrayName="contacts" class="example-full-width">
<div *ngFor="let conts of f_contacts.controls; let i=index">
<div [formGroupName]="i">
<div fxLayout="row wrap" fxLayout.xs="column" fxLayoutGap="2%" fxLayoutAlign="center center">
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="Contact Person Name" formControlName="contact_person">
<mat-error *ngIf="submitted && conts['controls'].contact_person.hasError('required')" class="mat-text-warn">You must Include Person Name.</mat-error>
</mat-form-field>
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="Contact Person Mobile" formControlName="contact_mobile_no">
<mat-error *ngIf="submitted && conts['controls'].contact_mobile_no.hasError('required')" class="mat-text-warn">You must Include Contact Person Mobile.</mat-error>
</mat-form-field>
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="Contact Person Email" formControlName="contact_email">
<mat-error *ngIf="submitted && conts['controls'].contact_email.hasError('required')" class="mat-text-warn">You must Include Contact Person Email.</mat-error>
</mat-form-field>
</div>
</div>
</div>
<button mat-button color="primary" matTooltip="Add More Answer" matTooltipPosition="above" (click)="addContacts(null); false">Add More</button>
<!--<a (click)="addLanguage()" style="cursor: default">Add another Answer </a>-->
</div>
</div>
<div class="row" style="text-align:right;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="button"(click)="onReset()"><mat-icon>settings_backup_restore</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button>
</div>
</form>
</mat-card>
<!--<div *ngIf="noRecordFound">
<mat-card class="listHover" style="width: 580px; padding: 6px;" *ngFor="let question of m_questions">
<span (click)="onNoClick()">{{question.question}}</span>
</mat-card>
</div>
<div *ngIf="!noRecordFound" style="width: 320px;">
<h5 style="color: red;">No Records Found.!</h5>
</div>-->
</div>

View File

@ -0,0 +1,24 @@
<div fxLayout="row wrap" fxLayoutAlign="end">
<button mat-fab class="mr-1 mb-1" color="primary" matTooltip="Add More Contact Person" matTooltipPosition="above" (click)="editDetails(null); false"><mat-icon>add</mat-icon></button>
</div>
<mat-card *ngFor="let data of entityBillingInfoRecord">
<div fxLayout="row wrap" fxLayout.xs="column" fxLayoutGap="2%" fxLayoutAlign="center center">
<div fxFlex="20%">
{{data.billing_name}}
</div>
<div fxFlex="50%">
<div>
{{data.addressline2}}, {{data.addressline3}}
</div>
<div>
Pan: {{data.pan}}, Gst: {{data.gstno}}
</div>
<div>
Contact Person Info, Contact Person Info, Contact Person Info
</div>
</div>
<div fxFlex="20%">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="editDetails(data)"><mat-icon>edit</mat-icon></button>
</div>
</div>
</mat-card>

View File

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

View File

@ -0,0 +1,240 @@
import { Component, ViewChild, OnInit, OnDestroy, Input, Inject } from '@angular/core';
import { MatPaginator, MatSort, MatTableDataSource, MatDialog, MatDialogRef, MAT_DIALOG_DATA, PageEvent } from '@angular/material';
import { FormGroup, FormControl, FormBuilder, Validators, FormArray } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { DataSource } from '@angular/cdk/table';
import { Observable } from 'rxjs/Observable';
import { NotifierService } from 'angular-notifier';
import { MastersService } from './../../../service/masters/masters.service';
import { EntityService } from './../../../service/entity/entity.service';
@Component({
selector: 'app-entity-edit-billing-info',
templateUrl: './entity-edit-billing-info.component.html',
styleUrls: ['./entity-edit-billing-info.component.scss']
})
export class EntityEditBillingInfoComponent implements OnInit {
@Input() public entityId: number;
public entityBillingInfoRecord: any;
public noRecordFound: boolean;
constructor(private dialog: MatDialog,
private entityService: EntityService) { }
ngOnInit() {
this.getEntityIDBillingInfo();
}
getEntityIDBillingInfo() {
this.entityService.getEntityIdBillingInfoDetails(this.entityId).subscribe(
data => {
if (data) {
if (data.records) {
this.noRecordFound = false;
this.entityBillingInfoRecord = data.records;
} else {
this.noRecordFound = true;
}
} else {
this.noRecordFound = true;
}
}
);
}
editDetails(rowDetails: any) {
const dialogRef = this.dialog.open(DialogAddEditBillingInfo, {
data: {'details':rowDetails, entity_id: this.entityId},
disableClose: true
});
dialogRef.afterClosed()
.subscribe(dataresult => {
this.getEntityIDBillingInfo();
});
}
}
@Component({
selector: 'dialog-add-edd-billing-info',
styles: [``
],
templateUrl: './dialog-add-edit-billing-info.component.html'
})
export class DialogAddEditBillingInfo implements OnInit {
public m_questions: any;
public editAddType = 'Edit';
public _editEntityBillingInfoFrom: FormGroup;
errorRecord: string;
noRecordFound: boolean;
public submitted: boolean;
/**
* Notifier service
*/
private notifier: NotifierService;
constructor(
notifier: NotifierService,
private route: ActivatedRoute,
private router: Router,
public dialogRef: MatDialogRef<DialogAddEditBillingInfo>,
@Inject(MAT_DIALOG_DATA) public data: any,
private entityService: EntityService,
private mastersService: MastersService,
private _formBuilder: FormBuilder) {
// this.entity_id = this.route.snapshot.params['entity-id'];
// this.entity_id = this.parent.entityId;
this.notifier = notifier;
}
ngOnInit(): void {
this.loadFormData();
this.loadContactsDetails(this.data.details.contacts);
}
onNoClick(): void {
this.dialogRef.close();
}
// load form data form the master
loadFormData() {
/** Questions Form Datas*/
if(this.data.details == null) {
this._editEntityBillingInfoFrom = this._formBuilder.group({
entity_billing_id: [''],
fk_entity_id: [this.data.entity_id],
billing_name: ['', Validators.compose([Validators.required])],
addressline1: ['', Validators.compose([Validators.required])],
addressline2: ['', Validators.compose([Validators.required])],
addressline3: ['', Validators.compose([Validators.required])],
pincode: ['', Validators.compose([Validators.required])],
email: ['', Validators.compose([Validators.required])],
mobileno: ['', Validators.compose([Validators.required])],
gstno: ['', Validators.compose([Validators.required])],
gststatecode: [''],
pan: ['', Validators.compose([Validators.required])],
contacts: this._formBuilder.array([
this.initContacts(null)
])
});
} else {
let data = this.data.details;
this._editEntityBillingInfoFrom = this._formBuilder.group({
entity_billing_id: [data.entity_billing_id],
fk_entity_id: [data.fk_entity_id],
billing_name: [data.billing_name, Validators.compose([Validators.required])],
addressline1: [data.addressline1, Validators.compose([Validators.required])],
addressline2: [data.addressline2, Validators.compose([Validators.required])],
addressline3: [data.addressline3, Validators.compose([Validators.required])],
pincode: [data.pincode, Validators.compose([Validators.required])],
email: [data.email, Validators.compose([Validators.required])],
mobileno: [data.mobileno, Validators.compose([Validators.required])],
gstno: [data.gstno, Validators.compose([Validators.required])],
gststatecode: [data.gststatecode],
pan: [data.pan, Validators.compose([Validators.required])],
contacts: this._formBuilder.array([
])
});
}
}
loadContactsDetails(record: any) {
if(record == null || record == undefined){
this.addContacts(null);
} else {
if(record.length > 0) {
for (let val of record) {
let vals = val;
this.addContacts(vals);
}
}
}
}
// convenience getter for easy access to form fields
get f() { return this._editEntityBillingInfoFrom.controls; }
// form contacts details access
get f_contacts() { return <FormArray>this._editEntityBillingInfoFrom.get('contacts'); }
// Dynamic Form field creation Functionality : START ===>
initContacts(conts) {
if(conts == null){
return this._formBuilder.group({
entity_billing_contact_id: [null],
fk_entity_billing_id: [null],
contact_person: ['', Validators.compose([Validators.required])],
contact_email: ['', Validators.compose([Validators.required])],
contact_mobile_no: ['', Validators.compose([Validators.required])],
isactive: [1]
});
} else {
return this._formBuilder.group({
entity_billing_contact_id: [conts.entity_billing_contact_id],
fk_entity_billing_id: [conts.fk_entity_billing_id],
contact_person: [conts.contact_person, Validators.compose([Validators.required])],
contact_email: [conts.contact_email, Validators.compose([Validators.required])],
contact_mobile_no: [conts.contact_mobile_no, Validators.compose([Validators.required])],
isactive: [conts.isactive]
});
}
}
addContacts(conts) {
const control = <FormArray>this._editEntityBillingInfoFrom.controls['contacts'];
control.push(this.initContacts(conts));
}
removeContacts(i: number) {
const control = <FormArray>this._editEntityBillingInfoFrom.controls['contacts'];
control.removeAt(i);
}
// END ===>
/** To Save/Edited Popup Data */
onSubmit() {
this.submitted = true;
// stop here if form is invalid
if (this._editEntityBillingInfoFrom.invalid) {
// this.errorMessage = "Please Fill All Mandate Fields.";
return;
} else {
var billingInfoFormValues = this._editEntityBillingInfoFrom.value;
//To Remove The "Null" With Key also
Object.keys(billingInfoFormValues).forEach((key) => (billingInfoFormValues[key] == null) && delete billingInfoFormValues[key]);
alert(billingInfoFormValues);
this.entityService.updateEntityIdBillingInfoDetails(billingInfoFormValues).subscribe(
dataresult => {
if (dataresult.status == 200) {
console.log(dataresult);
this.notifier.notify('success', 'Your Changes Updated.!');
this.dialogRef.close();
}
else {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
}
}, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
this.dialogRef.close();
});
}
}
/** To Reset Popup Data */
onReset() {
this.loadFormData();
this.loadContactsDetails(this.data.details.contacts);
}
}

View File

@ -0,0 +1,3 @@
<p>
entity-edit-price works!
</p>

View File

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

View File

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-entity-edit-price',
templateUrl: './entity-edit-price.component.html',
styleUrls: ['./entity-edit-price.component.scss']
})
export class EntityEditPriceComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}

View File

@ -0,0 +1,51 @@
<form [formGroup]="_editEntityRegionFrom" (submit)="onSubmit()">
<div formArrayName="region_lender" class="example-full-width">
<mat-card *ngFor="let region of _editEntityRegionFrom.controls.region_lender['controls']; let i=index">
<div [formGroupName]="i">
<div fxLayout="row wrap" fxLayout.xs="column" fxLayoutGap="2%" fxLayoutAlign="center center">
<mat-form-field fxFlex="30%">
<mat-select placeholder="Region *" formControlName="fk_region_id">
<mat-option *ngFor="let reg of m_region" [value]="reg.region_id">{{ reg.name }}</mat-option>
</mat-select>
<mat-error *ngIf="submitted && region['controls'].fk_region_id.hasError('required')" class="mat-text-warn">Region Required.!</mat-error>
</mat-form-field>
<mat-form-field fxFlex="30%">
<mat-select placeholder="City *" formControlName="fk_city_id">
<mat-option *ngFor="let city of m_city" [value]="city.city_id">{{ city.city_name }}({{city.state_name}})</mat-option>
</mat-select>
<mat-error *ngIf="submitted && region['controls'].fk_city_id.hasError('required')" class="mat-text-warn">City Required.!</mat-error>
</mat-form-field>
<!--<mat-form-field fxFlex="18%">
<mat-select placeholder="State *" formControlName="fk_state_id">
<mat-option *ngFor="let state of m_state" [value]="state.state_id">{{ state.name }}</mat-option>
</mat-select>
<mat-error *ngIf="submitted && region['controls'].fk_state_id.hasError('required')" class="mat-text-warn">State Required.!</mat-error>
</mat-form-field>
<mat-form-field fxFlex="18%">
<mat-select placeholder="Branch *" formControlName="fk_branch_id">
<mat-option *ngFor="let branch of m_branch" [value]="branch.branch_id">{{ branch.name }}</mat-option>
</mat-select>
<mat-error *ngIf="submitted && region['controls'].fk_branch_id.hasError('required')" class="mat-text-warn">Branch Required.!</mat-error>
</mat-form-field>-->
<div fxFlex="30%">
<mat-checkbox *ngIf="region.get('entity_region_map_id').value != null" formControlName="isactive" [ngModel]="region.get('isactive').value == 1 ? true : region.get('isactive').value == 0 ? false : null"
(ngModelChange)="region.get('isactive').value = $event ? 1 : 0"></mat-checkbox>
<span *ngIf="_editEntityRegionFrom.controls.region_lender.controls.length > 1" (click)="removeLanguage(i)">
<button *ngIf="region.get('entity_region_map_id').value == null" mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above"><mat-icon>delete</mat-icon></button>
</span>
</div>
</div>
</div>
</mat-card>
<button mat-fab class="mr-1 mb-1" color="primary" matTooltip="Add More Contact Person" matTooltipPosition="above" (click)="addRegionFormData(null, $event); false"><mat-icon>add</mat-icon></button>
</div>
<div class="row" style="text-align:right;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset"><mat-icon>settings_backup_restore</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button>
</div>
</form>

View File

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

View File

@ -0,0 +1,229 @@
import { Component, ViewChild, OnInit, OnDestroy, Input, Inject } from '@angular/core';
import { MatPaginator, MatSort, MatTableDataSource, MatDialog, MatDialogRef, MAT_DIALOG_DATA, PageEvent } from '@angular/material';
import { FormGroup, FormControl, FormBuilder, Validators, FormArray } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { DataSource } from '@angular/cdk/table';
import { Observable } from 'rxjs/Observable';
import { NotifierService } from 'angular-notifier';
import { MastersService } from './../../../service/masters/masters.service';
import { EntityService } from './../../../service/entity/entity.service';
@Component({
selector: 'app-entity-edit-region',
templateUrl: './entity-edit-region.component.html',
styleUrls: ['./entity-edit-region.component.scss']
})
export class EntityEditRegionComponent implements OnInit {
@Input() public entityId: number;
public noRocordsFound: boolean;
public entityRegionRecord: any;
public errorMessage;
public m_region: any = [];
public m_city: any = [];
public m_state: any = [];
public m_branch: any = [];
public _editEntityRegionFrom: FormGroup;
public submitted = false;
/**
* Notifier service
*/
private notifier: NotifierService;
constructor(
notifier: NotifierService,
private entityService: EntityService,
private mastersService: MastersService,
private _formBuilder: FormBuilder) {
this.notifier = notifier;
}
ngOnInit() {
this.getEntityIDRegionInfoDetails();
this.getCityHierarchyMaster();
this.getRegionMasters();
// this.getCustomerSegmentMasters();
this._editEntityRegionFrom = this._formBuilder.group({
region_lender: this._formBuilder.array([
// this.addRegionFormData(null, null),
])
})
// this.addRegionFormData(null, null);
}
setFormDatas(record) {
if (record.length > 0) {
for (let val of record) {
let vals = {
entity_region_map_id: val.entity_region_map_id,
fk_entity_id: val.fk_entity_id,
fk_region_id: val.fk_region_id,
fk_city_id: val.fk_city_id,
// fk_state_id: null,
// fk_branch_id: null,
isactive: val.isactive,
};
this.addRegionFormData(vals, null);
}
}
}
getEntityIDRegionInfoDetails() {
this.entityService.getEntityIdRegionInfoDetails(this.entityId).subscribe(
data => {
if (data) {
if (data.records) {
this.noRocordsFound = false;
this.entityRegionRecord = data.records;
this.setFormDatas(this.entityRegionRecord);
} else {
this.noRocordsFound = true;
}
} else {
this.noRocordsFound = true;
}
}
);
}
getCityHierarchyMaster() {
this.entityService.getCityHierarchyMaster().subscribe(
data => {
this.m_city = data.records;
},
error => {
this.notifier.notify('warning', 'No City Master Records Found.!');
// this.errorMessage = "No Lender Master Record Found.";
}
);
}
getRegionMasters() {
this.mastersService.getAllMasterData('REGIONS').subscribe(
data => {
this.m_region = data.records;
},
error => {
this.notifier.notify('warning', 'No Region Master Records Found.!');
// this.errorMessage = "No Region Master Record Found.";
}
);
}
// getCustomerSegmentMasters() {
// this.templatesService.getCustomerSegmentsMasterListDetails().subscribe(
// data => {
// this.m_customerSegment = data.records;
// },
// error => {
// this.notifier.notify('warning', 'No Customer Segment Master Records Found.!');
// this.errorMessage = "No Customer Segment Master Record Found.";
// }
// );
// }
// convenience getter for easy access to form fields
get f() { return this._editEntityRegionFrom.controls; }
// Dynamic Form field creation Functionality : START ===>
initRegionFormLoad(data) {
return this._formBuilder.group({
entity_region_map_id: [data.entity_region_map_id],
fk_entity_id: [data.fk_entity_id],
fk_region_id: [data.fk_region_id, Validators.compose([Validators.required])],
fk_city_id: [data.fk_city_id, Validators.compose([Validators.required])],
// fk_state_id: [data.fk_state_id, Validators.compose([Validators.required])],
// fk_branch_id: [data.fk_branch_id, Validators.compose([Validators.required])],
isactive: [data.isactive],
});
}
addRegionFormData(data, e) {
if (data == null) {
let newDate = {
entity_region_map_id: null,
fk_entity_id: this.entityId,
fk_region_id: null,
fk_city_id: null,
// fk_state_id: null,
// fk_branch_id: null,
isactive: 1,
}
const control = <FormArray>this._editEntityRegionFrom.controls['region_lender'];
control.push(this.initRegionFormLoad(newDate));
} else {
const control = <FormArray>this._editEntityRegionFrom.controls['region_lender'];
control.push(this.initRegionFormLoad(data));
}
}
removeLanguage(i: number) {
const control = <FormArray>this._editEntityRegionFrom.controls['region_lender'];
control.removeAt(i);
}
// END ===>
/** To Save/Edited Popup Data */
onSubmit() {
this.submitted = true;
// stop here if form is invalid
if (this._editEntityRegionFrom.invalid) {
this.errorMessage = "Please Fill All Mandate Fields.";
return;
} else {
var formValues = this._editEntityRegionFrom.value;
//To Remove The "Null" With Key also
Object.keys(formValues).forEach((key) => (formValues[key] == null) && delete formValues[key]);
// alert(JSON.stringify(formValues.temp_lender));
if (!this.checkDuplicateInObject(formValues.region_lender)) {
this.entityService.updateEntityIdRegionInfoDetails(formValues.region_lender).subscribe(
dataresult => {
if (dataresult.status == 200) {
console.log(dataresult);
this.notifier.notify('success', 'Your Changes Updated.!');
const arr = <FormArray>this._editEntityRegionFrom.controls.region_lender;
arr.controls.splice(0);
this.getEntityIDRegionInfoDetails();
}
else {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
this.errorMessage = "Something Wents Wrong Try Again.!";
}
}, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
this.errorMessage = "Some Thing Wents Wrong Try Again.!";
});
} else {
this.notifier.notify('warning', 'duplication records occured.!');
}
}
}
checkDuplicateInObject(inputArray) {
let seenDuplicate = false;
inputArray.map(function (item, index) {
let currentVal = inputArray[index];
for (let i = index + 1; i < inputArray.length; i++) {
if (currentVal.fk_region_id === inputArray[i].fk_region_id
&& currentVal.fk_city_id === inputArray[i].fk_city_id) {
console.log('duplication: ' + i);
seenDuplicate = true;
}
}
console.log(index);
});
return seenDuplicate;
}
ngOnDestroy(): void {
}
}

View File

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

View File

@ -0,0 +1,87 @@
import { Component, ViewChild, OnInit, OnDestroy, Input, Inject } from '@angular/core';
import { MatPaginator, MatSort, MatTableDataSource, MatDialog, MatDialogRef, MAT_DIALOG_DATA, PageEvent } from '@angular/material';
import { FormGroup, FormControl, FormBuilder, Validators, FormArray } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { DataSource } from '@angular/cdk/table';
import { Observable } from 'rxjs/Observable';
import { NotifierService } from 'angular-notifier';
import { MastersService } from './../../../service/masters/masters.service';
import { EntityService } from './../../../service/entity/entity.service';
@Component({
selector: 'app-entity-edit-tat',
templateUrl: './entity-edit-tat.component.html',
styleUrls: ['./entity-edit-tat.component.scss']
})
export class EntityEditTatComponent implements OnInit {
public noRocordsFound: boolean;
public entityVendorCityRecord: any;
public errorMessage;
@Input() public entityId: number;
public m_city: any = [];
public selectedArr: any = [];
toppings1 = new FormControl();
toppingList1: any[] = [{'id': 1,'name':'Extra cheese'}, {'id': 2, 'name':'Mushroom'}, { 'id': 3, 'name':'Onion'}];
/**
* Notifier service
*/
private notifier: NotifierService;
constructor(notifier: NotifierService,
private entityService: EntityService,
private mastersService: MastersService,
private _formBuilder: FormBuilder) {
this.notifier = notifier;
}
ngOnInit() {
this.getEntityIdCityDetails();
this.getCityMasters();
this.toppings1.setValue([3]);
}
selectedItem: any;
selected(e){
this.selectedArr = [...e.value];
this.selectedItem = this.m_city.filter(val => this.selectedArr.indexOf(val.city_id) > -1)
}
getEntityIdCityDetails(){
this.entityService.getEntityIdCityInfoDetails(this.entityId).subscribe(
data => {
if (data) {
if (data.records) {
this.noRocordsFound = false;
this.entityVendorCityRecord = data.records;
} else {
this.noRocordsFound = true;
}
} else {
this.noRocordsFound = true;
}
}
);
}
getCityMasters() {
this.mastersService.getAllMasterData('CITY').subscribe(
data => {
this.m_city = data.records;
},
error => {
this.notifier.notify('warning', 'No City Master Records Found.!');
// this.errorMessage = "No Region Master Record Found.";
}
);
}
}

View File

@ -0,0 +1,17 @@
<mat-form-field>
<mat-select (selectionChange)="selected($event)" placeholder="Toppings" [formControl]="toppings1" multiple>
<mat-option *ngFor="let city of m_city" [value]="city.city_id">{{city.name}}</mat-option>
</mat-select>
</mat-form-field>
<!--
{{ selectedCityName | json }}-->
<mat-chip-list>
<mat-chip *ngFor="let cit of selectedCityName" >{{cit.name}}</mat-chip>
</mat-chip-list>
<div class="row" style="text-align:right;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="button" (click)="onReset()"><mat-icon>settings_backup_restore</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="button" (click)="onSubmit()"><mat-icon>save</mat-icon></button>
</div>

View File

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

View File

@ -0,0 +1,149 @@
import { Component, ViewChild, OnInit, OnDestroy, Input, Inject } from '@angular/core';
import { MatPaginator, MatSort, MatTableDataSource, MatDialog, MatDialogRef, MAT_DIALOG_DATA, PageEvent } from '@angular/material';
import { FormGroup, FormControl, FormBuilder, Validators, FormArray } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { DataSource } from '@angular/cdk/table';
import { Observable } from 'rxjs/Observable';
import { NotifierService } from 'angular-notifier';
import { MastersService } from './../../../service/masters/masters.service';
import { EntityService } from './../../../service/entity/entity.service';
@Component({
selector: 'app-entity-edit-vendor-city-info',
templateUrl: './entity-edit-vendor-city-info.component.html',
styleUrls: ['./entity-edit-vendor-city-info.component.scss']
})
export class EntityEditVendorCityInfoComponent implements OnInit {
public noRocordsFound: boolean;
public entityVendorCityRecord: any;
public errorMessage;
@Input() public entityId: number;
public m_city: any = [];
public selectedArr: any = [];
toppings1 = new FormControl();
toppingList1: any[] = [{'id': 1,'name':'Extra cheese'}, {'id': 2, 'name':'Mushroom'}, { 'id': 3, 'name':'Onion'}];
/**
* Notifier service
*/
private notifier: NotifierService;
constructor(notifier: NotifierService,
private entityService: EntityService,
private mastersService: MastersService,
private _formBuilder: FormBuilder) {
this.notifier = notifier;
}
ngOnInit() {
this.getEntityIdCityDetails();
this.getCityMasters();
// this.toppings1.setValue(['1']);
}
selectedItem: any;
selected(e){
this.selectedArr = [...e.value];
this.getNameofCityId(e.value);
// this.selectedItem = this.m_city.filter(val => this.selectedArr.indexOf(val.city_id) > -1)
}
getEntityIdCityDetails(){
this.entityService.getEntityIdCityInfoDetails(this.entityId).subscribe(
data => {
if (data) {
if (data.records) {
this.noRocordsFound = false;
if(data.records[0]){
this.entityVendorCityRecord = data.records[0];
let arr: string[] = this.entityVendorCityRecord.fk_city_id.split(',');
let arrVal = arr.map(val => val);
this.getNameofCityId(arrVal);
this.toppings1.setValue(arrVal);
} else {
this.toppings1.setValue(null);
}
} else {
this.noRocordsFound = true;
}
} else {
this.noRocordsFound = true;
}
}
);
}
selectedCityName:any;
getNameofCityId(arg) {
let arrs = [...arg];
this.selectedCityName = this.m_city.filter(val => arrs.indexOf(val.city_id) > -1)
}
getCityMasters() {
this.mastersService.getAllMasterData('CITY').subscribe(
data => {
this.m_city = data.records;
},
error => {
this.notifier.notify('warning', 'No City Master Records Found.!');
// this.errorMessage = "No Region Master Record Found.";
}
);
}
onSubmit() {
let cityArr: any[] = this.toppings1.value;
if(cityArr.length > 0) {
let Records:any;
if(this.entityVendorCityRecord){
Records = {
"vendor_city_map_id": this.entityVendorCityRecord.vendor_city_map_id || '',
"fk_vendor_id": this.entityVendorCityRecord.fk_vendor_id || this.entityId,
"fk_city_id": cityArr.toString(),
}
} else {
Records = {
"vendor_city_map_id": '',
"fk_vendor_id": this.entityId,
"fk_city_id": cityArr.toString(),
}
}
this.entityService.updateEntityIdCityInfoDetails(Records).subscribe(
dataresult => {
if (dataresult.status == 200) {
console.log(dataresult);
this.notifier.notify('success', 'Your Changes Updated.!');
// const arr = <FormArray>this._editEntityRegionFrom.controls.region_lender;
// arr.controls.splice(0);
// this.getEntityIDRegionInfoDetails();
}
else {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
this.errorMessage = "Something Wents Wrong Try Again.!";
}
}, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
this.errorMessage = "Some Thing Wents Wrong Try Again.!";
});
}else {
this.notifier.notify('warning', 'City Should Selected.!');
}
}
onReset() {
this.getEntityIdCityDetails();
}
}

View File

@ -1,4 +1,4 @@
<div style="max-height: 580px;"> <!--<div style="max-height: 580px;">
<form [formGroup]="_addQuesFrom" (submit)="onSubmit()"> <form [formGroup]="_addQuesFrom" (submit)="onSubmit()">
<mat-card style="padding: 6px;"> <mat-card style="padding: 6px;">
<div class="ml-xs mr-xs" style="width: 100%;" fxLayout="row" fxLayoutAlign="center"> <div class="ml-xs mr-xs" style="width: 100%;" fxLayout="row" fxLayoutAlign="center">
@ -9,8 +9,7 @@
</div> </div>
</div> </div>
<!--<div class="form-group">--> <div fxLayout="row wrap" fxLayoutGap="32px" fxLayoutAlign="flex-start" style="padding: 6px 4px;">
<div fxLayout="row wrap" fxLayoutGap="32px" fxLayoutAlign="flex-start" style="padding: 6px 4px;">
<mat-form-field fxFlex="0 1 auto" class="ml-xs"> <mat-form-field fxFlex="0 1 auto" class="ml-xs">
<mat-select placeholder="Select Entity Type" formControlName="fk_entity_type_id"> <mat-select placeholder="Select Entity Type" formControlName="fk_entity_type_id">
@ -70,12 +69,10 @@
</mat-form-field> </mat-form-field>
<mat-form-field fxFlex="0 1 auto" class="ml-xs"> <mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="Address 2" formControlName="addressline2"> <input matInput placeholder="Address 2" formControlName="addressline2">
<!--<mat-error *ngIf="submitted && f.addressline2.hasError('required')" class="mat-text-warn">You must Include Address.</mat-error>--> </mat-form-field>
</mat-form-field>
<mat-form-field fxFlex="0 1 auto" class="ml-xs"> <mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="Address 3" formControlName="addressline3"> <input matInput placeholder="Address 3" formControlName="addressline3">
<!--<mat-error *ngIf="submitted && f.addressline3.hasError('required')" class="mat-text-warn">You must Include Address.</mat-error>--> </mat-form-field>
</mat-form-field>
<mat-form-field fxFlex="0 1 auto" class="ml-xs"> <mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="Pincode" formControlName="pincode"> <input matInput placeholder="Pincode" formControlName="pincode">
<mat-error *ngIf="submitted && f.pincode.hasError('required')" class="mat-text-warn">You must Include Pincode.</mat-error> <mat-error *ngIf="submitted && f.pincode.hasError('required')" class="mat-text-warn">You must Include Pincode.</mat-error>
@ -91,8 +88,7 @@
<mat-form-field fxFlex="0 1 auto" class="ml-xs"> <mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="Alternate Email" formControlName="alt_email"> <input matInput placeholder="Alternate Email" formControlName="alt_email">
<!-- <mat-error *ngIf="submitted && f.alt_email.hasError('required')" class="mat-text-warn">You must Select Alternet Email.</mat-error>--> </mat-form-field>
</mat-form-field>
<mat-form-field fxFlex="0 1 auto" class="ml-xs"> <mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="Phone Number" formControlName="phone_number"> <input matInput placeholder="Phone Number" formControlName="phone_number">
@ -101,7 +97,6 @@
<mat-form-field fxFlex="0 1 auto" class="ml-xs"> <mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="Mobile Number" formControlName="mobile_no"> <input matInput placeholder="Mobile Number" formControlName="mobile_no">
<!-- <mat-error *ngIf="submitted && f.mobile_no.hasError('required')" class="mat-text-warn">You must Include Mobile Number.</mat-error>-->
</mat-form-field> </mat-form-field>
</div> </div>
@ -148,17 +143,14 @@
<div fxLayout="row wrap" fxLayoutGap="32px" fxLayoutAlign="flex-start"> <div fxLayout="row wrap" fxLayoutGap="32px" fxLayoutAlign="flex-start">
<mat-form-field fxFlex="0 1 auto" class="ml-xs"> <mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="Contact Person" formControlName="contact_person"> <input matInput placeholder="Contact Person" formControlName="contact_person">
<!--<mat-error *ngIf="submitted && f.contact_person.hasError('required')" class="mat-text-warn">You must Include Contact Person.</mat-error>-->
</mat-form-field> </mat-form-field>
<mat-form-field fxFlex="0 1 auto" class="ml-xs"> <mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="Email" formControlName="contact_email"> <input matInput placeholder="Email" formControlName="contact_email">
<!--<mat-error *ngIf="submitted && f.contact_email.hasError('required')" class="mat-text-warn">You must Include Email.</mat-error>--> </mat-form-field>
</mat-form-field>
<mat-form-field fxFlex="0 1 auto" class="ml-xs"> <mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput placeholder="Mobile Number" formControlName="contact_mobile_no"> <input matInput placeholder="Mobile Number" formControlName="contact_mobile_no">
<!--<mat-error *ngIf="submitted && f.contact_mobile_no.hasError('required')" class="mat-text-warn">You must Include Mobile Number.</mat-error>--> </mat-form-field>
</mat-form-field>
</div> </div>
</div> </div>
@ -177,18 +169,86 @@
</div> </div>
</div> </div>
<!--Error List Shown Here-->
<!--<ul>
<li *ngFor="let err of errorMessage">
<mat-error>{{err.err}}</mat-error>
</li>
</ul>-->
<div class="row" style="text-align:right;"> <div class="row" style="text-align:right;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="button" <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="button"
(click)="onReset()"><mat-icon>settings_backup_restore</mat-icon></button><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button> (click)="onReset()"><mat-icon>settings_backup_restore</mat-icon></button><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button>
</div> </div>
<!--</div>-->
</mat-card> </mat-card>
</form> </form>
</div> </div>-->
<!--{{ _editEntityNameFrom | json}}-->
<mat-card style="padding: 6px;">
<div fxLayout="row" fxLayoutAlign="end start">
<button mat-raised-button mat-icon-button color="primary" class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above"
(click)="backToList()"><mat-icon>close</mat-icon></button>
</div>
<mat-card style="padding: 6px;" *ngIf="entityNameRecord">
<h6>Entity Details ({{this.entityNameRecord.entity_name}})</h6>
<form [formGroup]="_editEntityNameFrom" (submit)="onSubmit()">
<hr>
<div>
<div fxLayout="row wrap" fxLayout.xs="column" fxLayoutGap="2%" fxLayoutAlign="center center">
<div fxFlex="30%">
<mat-form-field class="ml-xs">
<input matInput placeholder="Entity Full Name" formControlName="full_name">
<mat-error *ngIf="submitted && f.full_name.hasError('required')" class="mat-text-warn">You must Include Entity Full Name.</mat-error>
</mat-form-field>
</div>
<div fxFlex="30%">
<mat-form-field class="ml-xs">
<input matInput placeholder="Entity Short Name" formControlName="short_name">
<mat-error *ngIf="submitted && f.short_name.hasError('required')" class="mat-text-warn">You must Include Entity Short Name.</mat-error>
</mat-form-field>
</div>
<div fxFlex="30%">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="button"
(click)="onReset()"><mat-icon>settings_backup_restore</mat-icon></button>
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button>
</div>
</div>
</div>
<div *ngIf="noEntityNameFound"> No Template Name Found.</div>
</form>
</mat-card>
<mat-card>
<mat-tab-group *ngIf="entityNameRecord && !noEntityNameFound">
<mat-tab label="Billing Information">
<ng-template matTabContent>
<app-entity-edit-billing-info [entityId]="entity_id">
</app-entity-edit-billing-info>
</ng-template>
</mat-tab>
<mat-tab *ngIf="localEntityType == 2" label="Region Information">
<ng-template matTabContent>
<app-entity-edit-region [entityId]="entity_id">
</app-entity-edit-region>
</ng-template>
</mat-tab>
<mat-tab *ngIf="localEntityType == 3" label="Cities Information">
<ng-template matTabContent>
<app-entity-edit-vendor-city-info [entityId]="entity_id">
</app-entity-edit-vendor-city-info>
</ng-template>
</mat-tab>
<!--<mat-tab label="Category">
<ng-template matTabContent>
<app-template-edit-category [questionId]="question_id">
</app-template-edit-category>
</ng-template>
</mat-tab>
<mat-tab label="Questions / Answers">
<ng-template matTabContent>
<app-template-edit-question-answer [questionId]="question_id">
</app-template-edit-question-answer>
</ng-template>
</mat-tab>-->
</mat-tab-group>
</mat-card>
</mat-card>
<!--https://stackoverflow.com/questions/51233913/how-to-save-selected-object-using-mat-chip-and-autocomplete-in-angular-material/51239619-->
<!--https://stackblitz.com/angular/yjpbqxmqvppe?file=app%2Fchips-autocomplete-example.html-->

View File

@ -2,6 +2,7 @@
import { import {
Component, Component,
OnInit, OnInit,
OnDestroy,
Inject, Inject,
ViewChild, ViewChild,
Input Input
@ -13,12 +14,14 @@ import {
Validators, Validators,
FormArray, FormArray,
} from '@angular/forms'; } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { NotifierService } from 'angular-notifier'; import { NotifierService } from 'angular-notifier';
/** Service */ /** Service */
import { MastersService } from './../../service/masters/masters.service'; import { MastersService } from './../../service/masters/masters.service';
import { EntityService } from './../../service/entity/entity.service'; import { EntityService } from './../../service/entity/entity.service';
import { EntityListComponent } from './../entity-list/entity.list.component'; import { EntityListComponent } from './../entity-list/entity.list.component';
/* /*
* Question master details edit component * Question master details edit component
@ -27,22 +30,19 @@ import { EntityListComponent } from './../entity-list/entity.list.component';
@Component({ @Component({
selector: 'app-entity-edit', selector: 'app-entity-edit',
templateUrl: './entity.edit.component.html', templateUrl: './entity.edit.component.html',
// styleUrls: ['./edit.component.scss'] // styleUrls: ['./edit.component.scss']
}) })
export class EntityEditComponent implements OnInit{ export class EntityEditComponent implements OnInit, OnDestroy {
@Input() public childMessage: any; @Input() public childMessage: any;
public pageTitle: string = "Entity"; public entity_id: number;
public subTitle1: string = "Tax Info"; public _editEntityNameFrom: FormGroup;
public subTitle2: string = "Contacts";
public _addQuesFrom: FormGroup;
public submitted = false; public submitted = false;
public categories: any = [];
public geoRecords: any = [];
public entityOptions: any = [];
public questionsOptions: any = [];
errorMessage: string; errorMessage: string;
public noEntityNameFound: boolean;
public entityNameRecord: any;
/** /**
* Notifier service * Notifier service
@ -51,188 +51,86 @@ public pageTitle: string = "Entity";
constructor( constructor(
notifier: NotifierService, notifier: NotifierService,
private route: ActivatedRoute,
private router: Router,
private _formBuilder: FormBuilder, private _formBuilder: FormBuilder,
private masterService: MastersService, private masterService: MastersService,
private entityService: EntityService, private entityService: EntityService,
private entityListComponent: EntityListComponent) { private entityListComponent: EntityListComponent) {
this.notifier = notifier; this.notifier = notifier;
this.entity_id = this.route.snapshot.params['entity-id'];
this.getEntityIdDetails();
// this._editEntityNameFrom = this._formBuilder.group({
// full_name: ['', Validators.compose([Validators.required]) ]
// })
} }
ngOnInit() { ngOnInit() {
this.loadFormData(); this.entityListComponent.showListView(false);
/** Questions Form Datas*/
if (this.childMessage["0"].length > 0) {
for (let val of this.childMessage["0"]) {
// alert(JSON.stringify(val));
let vals = val;
this.addLanguage(vals['contact_person'], vals['contact_email'], vals['contact_mobile_no'], vals['entity_child_id'], vals['isactive'], null);
}
}
// OnInit Load Geo Details and Question Type Masters
this.getGeoLocationMaster();
this.getEntityOptionsMaster();
} }
// load answer details list public localEntityType: number;
loadAnsData() {
if (this.childMessage["0"].length > 0) { getEntityIdDetails() {
for (let val of this.childMessage["0"]) { this.entityService.getEntityIdNameDetails(this.entity_id).subscribe(
// alert(JSON.stringify(val)); data => {
let vals = val; if (data) {
this.addLanguage(vals['contact_person'], vals['contact_email'], vals['contact_mobile_no'], vals['entity_child_id'], vals['isactive'], null); if (data.records) {
} this.noEntityNameFound = false;
} this.entityNameRecord = data.records.data[0];
} this.localEntityType = this.entityNameRecord.fk_entity_type_id;
this.setFormDatas();
} else {
this.noEntityNameFound = true;
}
} else {
this.noEntityNameFound = true;
}
}
);
}
setFormDatas(){
// alert(this.templateNameDetails.template_name);
this._editEntityNameFrom = this._formBuilder.group({
entity_id: [this.entityNameRecord.entity_id],
full_name: [this.entityNameRecord.full_name, Validators.compose([Validators.required]) ],
short_name: [this.entityNameRecord.short_name, Validators.compose([Validators.required]) ],
// entity_name: [this.entityNameRecord.entity_name],
fk_entity_type_id: [this.entityNameRecord.fk_entity_type_id],
isactive: [this.entityNameRecord.isactive]
})
}
loadFormData() {
this._addQuesFrom = this._formBuilder.group({
entity_id: [this.childMessage.entity_id],
fk_entity_type_id: [this.childMessage.fk_entity_type_id, Validators.compose([Validators.required])],
full_name: [this.childMessage.full_name, Validators.compose([Validators.required])],
short_name: [this.childMessage.short_name, Validators.compose([Validators.required])],
fk_region: [this.childMessage.fk_region, Validators.compose([Validators.required])],
fk_state: [this.childMessage.fk_state, Validators.compose([Validators.required])],
fk_city: [this.childMessage.fk_city, Validators.compose([Validators.required])],
fk_branch: [this.childMessage.fk_branch, Validators.compose([Validators.required])],
addressline1: [this.childMessage.addressline1, Validators.compose([Validators.required])],
pincode: [this.childMessage.pincode, Validators.compose([Validators.required])],
official_email: [this.childMessage.official_email, Validators.compose([Validators.required, Validators.email])],
phone_number: [this.childMessage.phone_number, Validators.compose([Validators.required])],
remarks: [this.childMessage.remarks, Validators.compose([Validators.required])],
pan: [this.childMessage.pan, Validators.compose([Validators.required])],
gst_no: [this.childMessage.gst_no, Validators.compose([Validators.required])],
gst_state_code: [this.childMessage.gst_state_code, Validators.compose([Validators.required])],
tat: [this.childMessage.tat, Validators.compose([Validators.required])],
entity_child: this._formBuilder.array([
// this.initAnswers(),
])
});
}
// convenience getter for easy access to form fields // convenience getter for easy access to form fields
get f() { return this._addQuesFrom.controls; } get f() { return this._editEntityNameFrom.controls; }
// form entity_child details access
get f_ans() { return <FormArray>this._addQuesFrom.get('entity_child'); }
// Dynamic Form field creation Functionality : START ===> backToList() {
initAnswers(c_person, c_email, e_phn, fk_id, isAct, e) { this.entityListComponent.showListView(true);
isAct = isAct == null ? 1 : isAct; this.router.navigate(['../../'], { relativeTo: this.route });
return this._formBuilder.group({
contact_person: [c_person, Validators.compose([Validators.required])],
contact_email: [c_email, Validators.compose([Validators.required, Validators.email])],
contact_mobile_no: [e_phn, Validators.compose([Validators.required])],
entity_child_id: [fk_id],
isactive: [isAct]
});
}
addLanguage(c_person, c_email, e_phn, fk_id, isAct, e) {
const control = <FormArray>this._addQuesFrom.controls['entity_child'];
control.push(this.initAnswers(c_person, c_email, e_phn, fk_id, isAct, e));
}
removeLanguage(i: number) {
const control = <FormArray>this._addQuesFrom.controls['entity_child'];
control.removeAt(i);
}
// END ===>
public state_m: any = [];
selectGeoRegionChanges(reg){
this._addQuesFrom.controls.fk_state.reset();
this._addQuesFrom.controls.fk_city.reset();
this._addQuesFrom.controls.fk_branch.reset();
this.state_m = [];
this.city_m = [];
this.branch_m = [];
if(reg){
this.state_m = reg;
}
}
public city_m: any = []
selectGeoStateChanges(city) {
this._addQuesFrom.controls.fk_city.reset();
this._addQuesFrom.controls.fk_branch.reset();
this.city_m = [];
this.branch_m = [];
if(city){
this.city_m = city;
}
}
public branch_m: any = [];
selectGeoCityChanges(brn){
this._addQuesFrom.controls.fk_branch.reset();
this.branch_m = [];
if(brn){
this.branch_m = brn;
}
}
getGeoLocationMaster() {
this.entityService.getGeoLocationMasterDetails().subscribe(
data => {
this.geoRecords = data.records;
this.setGeoEditSelectDetails();
},
error => {
this.notifier.notify('warning', 'No Geo Location Records Found.!');
this.errorMessage = "No Category Records Found.";
}
)
}
setGeoEditSelectDetails() {
let state = this.geoRecords.filter(data=>{if(data.region_id === this.childMessage.fk_region){ return data.state_data;}});
this.state_m = state[0].state_data;
let city = this.state_m.filter(data=>{if(data.state_id === this.childMessage.fk_state){ return data.city_data;}});
this.city_m = city[0].city_data;
let branch = this.city_m.filter(data=>{if(data.city_id === this.childMessage.fk_city){ return data.branch_data;}});
// alert(JSON.stringify(branch));
this.branch_m = branch[0].branch_data;
}
getEntityOptionsMaster() {
this.masterService.getAllMasterData('ENTITYTYPE').subscribe(
data => {
this.entityOptions = data.records.filter(data => data.entity_type_id != 1);
},
error => {
this.notifier.notify('warning', 'No Answer Type Records Found.!');
this.errorMessage = "No Answer Type Record Found.";
}
)
}
/** For Popup Close Button */
onNoClick(): void {
this.entityListComponent.changeListView();
// this.dialogRef.close();
} }
/** To Save/Edited Popup Data */ /** To Save/Edited Popup Data */
onSubmit() { onSubmit() {
this.submitted = true; this.submitted = true;
// stop here if form is invalid // stop here if form is invalid
if (this._addQuesFrom.invalid) { if (this._editEntityNameFrom.invalid) {
this.errorMessage = "Please Fill All Mandate Fields."; this.errorMessage = "Please Fill All Mandate Fields.";
return; return;
} else { } else {
var entityFormValues = this._addQuesFrom.value; var entityFormValues = this._editEntityNameFrom.value;
//To Remove The "Null" With Key also
Object.keys(entityFormValues).forEach((key) => (entityFormValues[key] == null) && delete entityFormValues[key]); Object.keys(entityFormValues).forEach((key) => (entityFormValues[key] == null) && delete entityFormValues[key]);
//Add BRANCH data with help Service File
this.entityService.updateEntityMasterDetails(entityFormValues).subscribe( this.entityService.updateEntityMasterDetails(entityFormValues).subscribe(
dataresult => { dataresult => {
if (dataresult.status == 200) { if (dataresult.status == 200) {
console.log(dataresult); console.log(dataresult);
this.notifier.notify('success', 'Record Updated Successfully.!'); this.notifier.notify('success', 'Record Updated Successfully.!');
this._addQuesFrom.reset(); this.getEntityIdDetails();
this.entityListComponent.changeListView();
} }
else { else {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
@ -247,7 +145,12 @@ public pageTitle: string = "Entity";
/** To Reset Popup Data */ /** To Reset Popup Data */
onReset() { onReset() {
this.loadFormData(); this.getEntityIdDetails();
this.loadAnsData(); }
ngOnDestroy(): void {
//Called once, before the instance is destroyed.
//Add 'implements OnDestroy' to the class.
this.entityListComponent.showListView(true);
} }
} }

View File

@ -1,42 +1,16 @@
<div *ngIf="listView"> <div *ngIf="listView">
<mat-card> <mat-card>
<div style="margin: 6px; padding: 4px;">
<div class="p_title" style="font-size: 26px; font-style: bold;">Entity Master</div>
<div style="margin: 6px; padding: 4px;"> <hr>
<div class="p_title" style="font-size: 26px; font-style: bold;">Entity Master</div> </div>
<!--<div class="sub_title" style="font-size: 11px;">List of Entity Master Details</div>--> <div fxLayout="row" fxLayout.xs="column" fxLayoutWrap fxLayoutAlign="center none">
<hr> <div fxFlex="80%">
</div>
<div fxLayout="row" fxLayout.xs="column" fxLayoutWrap fxLayoutAlign="center none" >
<div fxFlex="80%">
<!--<form [formGroup]="filterFormGroupCtrl">
<div fxLayout="row" fxLayout.xs="column" fxLayoutWrap fxLayoutGap="0.5px" fxLayoutAlign="start none" style="padding: 6px;">
<mat-select placeholder="Category" formControlName="category">
<mat-option *ngFor="let cat of categories" [value]="cat.question_categroy_id" (click)="getQuestionsMasters()">
{{cat.categroy_name}}
</mat-option>
</mat-select>
</div>
</form>-->
</div>
<div fxFlex="20%">
<!--<a [routerLink]="['/'+'setting/entity/add' ]">-->
<!--<button mat-stroked-button color="primary" (click)="addNewQuestion()">Add New Entity</button>-->
<button mat-fab class="mr-1 mb-1" color="primary" (click)="addNewQuestion()"><mat-icon>add</mat-icon></button>
<!--</a>-->
</div>
</div>
<!--</mat-card-content>-->
<!--
<mat-card class="mat-elevation-z1">
<div style="margin: 6px; padding: 4px;">
<div class="p_title" style="font-size: 16px; font-style: bold;">Entity Master</div>
<div class="sub_title" style="font-size: 11px;">List of Entity Master Details</div>
</div> </div>
</mat-card>--> <div fxFlex="20%">
<button mat-fab class="mr-1 mb-1" color="primary" (click)="addNewEntity()"><mat-icon>add</mat-icon></button>
</div>
</div>
<ng-container *ngIf="enityList.length > 0"> <ng-container *ngIf="enityList.length > 0">
<div style="padding: 0 12px;"> <div style="padding: 0 12px;">
<mat-card class="product-card" *ngFor="let product of dataSource.connect() | async"> <mat-card class="product-card" *ngFor="let product of dataSource.connect() | async">
@ -76,9 +50,9 @@
</mat-paginator> </mat-paginator>
</mat-card> </mat-card>
</div> </div>
<div *ngIf="!listView">
<app-entity-edit [childMessage]="parentMessage"></app-entity-edit> <div>
<router-outlet></router-outlet>
</div> </div>
<notifier-container></notifier-container> <notifier-container></notifier-container>

View File

@ -51,6 +51,7 @@ export class EntityListComponent implements OnInit {
constructor(private dialog: MatDialog, constructor(private dialog: MatDialog,
private masterService: MastersService, private masterService: MastersService,
private _formBuilder: FormBuilder, private _formBuilder: FormBuilder,
private route: ActivatedRoute,
private router: Router, private router: Router,
private entityService: EntityService) { private entityService: EntityService) {
// this.filterFormGroupCtrl = this._formBuilder.group({ // this.filterFormGroupCtrl = this._formBuilder.group({
@ -132,10 +133,22 @@ export class EntityListComponent implements OnInit {
public parentMessage: any = []; public parentMessage: any = [];
editEntity(detail){ editEntity(detail){
this.parentMessage = detail; this.parentMessage = detail;
this.router.navigate([ '../list/edit', detail.entity_id ], { relativeTo: this.route });
this.listView = false; this.listView = false;
} }
// goToEdit(template_id : number){
// this.router.navigate([ '../list/edit', template_id ], { relativeTo: this.route });
// this.listView = false;
// }
showListView(status: boolean){
// alert(2);
this.listView = status;
}
changeListView(){ changeListView(){
this.getEntityListMasters(); this.getEntityListMasters();
this.listView = true; this.listView = true;
} }
@ -159,6 +172,25 @@ export class EntityListComponent implements OnInit {
console.log(e); console.log(e);
} }
addNewEntity(): void {
const dialogRef = this.dialog.open(EntityAddComponent, {
disableClose: true,
data: { }
});
dialogRef.afterClosed().subscribe(result => {
if(result != null) {
this.getEntityListMasters();
this.editEntity({'entity_id':result.record});
} else {
}
console.log('The dialog was closed');
// alert(result);
});
}
} }
// {"dataStatus":true,"status":200,"records": // {"dataStatus":true,"status":200,"records":

View File

@ -12,7 +12,9 @@ import {
MatProgressBarModule,MatDialogModule, MatSortModule, MatProgressBarModule,MatDialogModule, MatSortModule,
MatToolbarModule,MatSelectModule, MatToolbarModule,MatSelectModule,
MatListModule, MatMenuModule, MatListModule, MatMenuModule,
MatCheckboxModule MatCheckboxModule,MatTabsModule,
MatExpansionModule,
MatChipsModule
} from '@angular/material'; } from '@angular/material';
import {MatSlideToggleModule} from '@angular/material/slide-toggle'; import {MatSlideToggleModule} from '@angular/material/slide-toggle';
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FormsModule, ReactiveFormsModule } from '@angular/forms';
@ -26,6 +28,14 @@ import { EntityAddComponent } from './entity-add/entity.add.component';
import { EntityEditComponent } from './entity-edit/entity.edit.component'; import { EntityEditComponent } from './entity-edit/entity.edit.component';
import { EntityService } from './../service/entity/entity.service'; import { EntityService } from './../service/entity/entity.service';
import { EntityEditRegionComponent } from './entity-edit/entity-edit-region/entity-edit-region.component';
import { EntityEditTatComponent } from './entity-edit/entity-edit-tat/entity-edit-tat.component';
import { EntityEditPriceComponent } from './entity-edit/entity-edit-price/entity-edit-price.component';
import { EntityEditBillingInfoComponent } from './entity-edit/entity-edit-billing-info/entity-edit-billing-info.component';
import { DialogAddEditBillingInfo } from './entity-edit/entity-edit-billing-info/entity-edit-billing-info.component';
import { EntityEditVendorCityInfoComponent } from './entity-edit/entity-edit-vendor-city-info/entity-edit-vendor-city-info.component';
/** /**
* Custom angular notifier options * Custom angular notifier options
*/ */
@ -83,6 +93,9 @@ const customNotifierOptions: NotifierOptions = {
MatProgressBarModule,MatDialogModule, MatSortModule, MatProgressBarModule,MatDialogModule, MatSortModule,
MatToolbarModule,MatSelectModule,MatListModule, MatMenuModule, MatToolbarModule,MatSelectModule,MatListModule, MatMenuModule,
MatCheckboxModule, MatCheckboxModule,
MatTabsModule,
MatChipsModule,
MatExpansionModule,
MatSlideToggleModule, MatSlideToggleModule,
FormsModule, FormsModule,
ReactiveFormsModule ReactiveFormsModule
@ -91,10 +104,18 @@ const customNotifierOptions: NotifierOptions = {
EntityComponent, EntityComponent,
EntityListComponent, EntityListComponent,
EntityEditComponent, EntityEditComponent,
EntityAddComponent EntityAddComponent,
EntityEditRegionComponent,
EntityEditTatComponent,
EntityEditPriceComponent,
EntityEditBillingInfoComponent,
DialogAddEditBillingInfo,
EntityEditVendorCityInfoComponent
], ],
entryComponents: [ entryComponents: [
// EntityEditComponent // EntityEditComponent
DialogAddEditBillingInfo,
EntityAddComponent
], ],
providers : [ providers : [
EntityService EntityService

View File

@ -19,15 +19,19 @@ const routes: Routes = [
{ {
path: 'list', path: 'list',
component: EntityListComponent, component: EntityListComponent,
children: [{
path: 'edit/:entity-id',
component: EntityEditComponent,
}]
}, },
{ // {
path: 'add', // path: 'add',
component: EntityAddComponent, // component: EntityAddComponent,
}, // },
{ // {
path: 'edit', // path: 'edit',
component: EntityEditComponent, // component: EntityEditComponent,
} // }
] ]
} }
]; ];

View File

@ -1,6 +1,6 @@
<mat-card>
<mat-card-content> <mat-card-content>
<h2> Company &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</h2>
<form [formGroup]="_companyForm" (submit)="onSubmit()"> <form [formGroup]="_companyForm" (submit)="onSubmit()">
<div class="form-group"> <div class="form-group">
@ -16,21 +16,21 @@
<div class="ml-xs mr-xs"> <div class="ml-xs mr-xs">
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<input matInput type="text" placeholder="Addressline1" required formControlName="addressline1"> <input matInput type="text" placeholder="Address line 1" required formControlName="addressline1">
<!-- <mat-error *ngIf="!_companyForm.controls['addressline1'].valid && _companyForm.controls['addressline1'].touched" class="mat-text-warn">You must include a addressline1.</mat-error> --> <!-- <mat-error *ngIf="!_companyForm.controls['addressline1'].valid && _companyForm.controls['addressline1'].touched" class="mat-text-warn">You must include a addressline1.</mat-error> -->
</mat-form-field> </mat-form-field>
</div> </div>
<div class="ml-xs mr-xs"> <div class="ml-xs mr-xs">
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<input matInput type="text" placeholder="Addressline2" formControlName="addressline2"> <input matInput type="text" placeholder="Address line 2" formControlName="addressline2">
<!-- <mat-error *ngIf="!_companyForm.controls['addressline2'].valid && _companyForm.controls['addressline2'].touched" class="mat-text-warn">You must include a Name.</mat-error> --> <!-- <mat-error *ngIf="!_companyForm.controls['addressline2'].valid && _companyForm.controls['addressline2'].touched" class="mat-text-warn">You must include a Name.</mat-error> -->
</mat-form-field> </mat-form-field>
</div> </div>
<div class="ml-xs mr-xs"> <div class="ml-xs mr-xs">
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<input matInput type="text" placeholder="Addressline3" formControlName="addressline3"> <input matInput type="text" placeholder="Address line 3" formControlName="addressline3">
<!-- <mat-error *ngIf="!_companyForm.controls['addressline3'].valid && _companyForm.controls['addressline3'].touched" class="mat-text-warn">You must include a Name.</mat-error> --> <!-- <mat-error *ngIf="!_companyForm.controls['addressline3'].valid && _companyForm.controls['addressline3'].touched" class="mat-text-warn">You must include a Name.</mat-error> -->
</mat-form-field> </mat-form-field>
</div> </div>
@ -48,7 +48,7 @@
<div class="ml-xs mr-xs"> <div class="ml-xs mr-xs">
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<mat-select placeholder="State" formControlName="state" [disabled]="true"> <mat-select placeholder="State" formControlName="state" >
<mat-option *ngFor="let sd of stateDatas" [value]="sd.state_id">{{ sd.name }}</mat-option> <mat-option *ngFor="let sd of stateDatas" [value]="sd.state_id">{{ sd.name }}</mat-option>
</mat-select> </mat-select>
<!-- <mat-error *ngIf="!_companyForm.controls['state'].valid && _companyForm.controls['state'].touched" class="mat-text-warn">You must Pickup a State.</mat-error> --> <!-- <mat-error *ngIf="!_companyForm.controls['state'].valid && _companyForm.controls['state'].touched" class="mat-text-warn">You must Pickup a State.</mat-error> -->
@ -58,7 +58,7 @@
<div class="ml-xs mr-xs"> <div class="ml-xs mr-xs">
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<input matInput type="text" placeholder="Pin code" required formControlName="pincode"> <input matInput type="text" placeholder="Pin code" required formControlName="pincode">
<mat-hint>pincode should be in 6 digit format</mat-hint> <mat-hint>Pincode should be in 6 digit format</mat-hint>
<!-- <mat-error *ngIf="_companyForm.controls['pincode'].hasError('required') && _companyForm.controls['pincode'].touched" class="mat-text-warn">You must include phone number.</mat-error> --> <!-- <mat-error *ngIf="_companyForm.controls['pincode'].hasError('required') && _companyForm.controls['pincode'].touched" class="mat-text-warn">You must include phone number.</mat-error> -->
<!-- <mat-error *ngIf="!_companyForm.controls['pincode'].valid && _companyForm.controls['pincode'].touched" class="mat-text-warn">You must include a pincode number.</mat-error> --> <!-- <mat-error *ngIf="!_companyForm.controls['pincode'].valid && _companyForm.controls['pincode'].touched" class="mat-text-warn">You must include a pincode number.</mat-error> -->
<!-- <mat-error *ngIf="_companyForm.controls['pincode'].hasError('minlength') && _companyForm.controls['pincode'].touched" class="mat-text-warn">Your pincode must be at least 5 characters long.</mat-error> <!-- <mat-error *ngIf="_companyForm.controls['pincode'].hasError('minlength') && _companyForm.controls['pincode'].touched" class="mat-text-warn">Your pincode must be at least 5 characters long.</mat-error>
@ -79,4 +79,5 @@
</div> </div>
</form> </form>
</mat-card-content> </mat-card-content>
</mat-card>
<notifier-container></notifier-container> <notifier-container></notifier-container>

View File

@ -119,7 +119,7 @@
</mat-cell> </mat-cell>
</ng-container> --> </ng-container> -->
<button mat-icon-button color="primary" class="hover-icon" matTooltip="Save Data" matTooltipPosition="above" (click)="SaveData(dataSource)"><mat-icon>save</mat-icon></button> <!-- <button mat-icon-button color="primary" class="hover-icon" matTooltip="Save Data" matTooltipPosition="above" (click)="SaveData(dataSource)"><mat-icon>save</mat-icon></button> -->
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row> <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row> <mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
</mat-table> </mat-table>

View File

@ -2,10 +2,10 @@
<form [formGroup]="_pdTeamForm" (submit)="onSubmit()"> <form [formGroup]="_pdTeamForm" (submit)="onSubmit()">
<mat-card style="padding: 6px;"> <mat-card style="padding: 6px;">
<div class="ml-xs mr-xs" style="width: 100%;" fxLayout="row" fxLayoutAlign="center"> <div class="ml-xs mr-xs" style="width: 100%;" fxLayout="row" fxLayoutAlign="center">
<h2 mat-dialog-title style="width: 50%;">PD TEAM</h2> <h2 mat-dialog-title style="width: 50%;">Add New PD Team</h2>
<div style="width: 20%;"></div> <div style="width: 20%;"></div>
<div style="width: 30%;text-align:right;"> <div style="width: 30%;text-align:right;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button> <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()" [color]="color"><mat-icon>close</mat-icon></button>
</div> </div>
</div> </div>
@ -36,17 +36,17 @@
<mat-error *ngIf="!_pdTeamForm.controls['fk_city'].valid && _pdTeamForm.controls['fk_city'].touched" class="mat-text-warn">City Name Requried.</mat-error> <mat-error *ngIf="!_pdTeamForm.controls['fk_city'].valid && _pdTeamForm.controls['fk_city'].touched" class="mat-text-warn">City Name Requried.</mat-error>
</mat-form-field> </mat-form-field>
<span fxFlex="0 1 auto" class="ml-xs"> <span fxFlex="0 1 auto" class="ml-xs">
<h6> The Selected Cities are., </h6> <h6 *ngIf="selectedCityDatas.length != 0"> The Selected Cities are </h6>
<ul *ngFor="let data of selectedCityDatas"> <ul *ngFor="let data of selectedCityDatas">
<!-- <h6> The Selected Cities are </h6> -->
<li>{{data}}</li> <li>{{data}}</li>
</ul> </ul>
</span> </span>
</div> </div>
<h6>Products</h6><hr><br> <h6>Products</h6> <hr> <br>
<div fxLayout="row wrap" fxLayoutGap="32px" fxLayoutAlign="flex-start"> <div fxLayout="row wrap" fxLayoutGap="32px" fxLayoutAlign="flex-start">
<mat-form-field fxFlex="0 1 auto" class="ml-xs"> <mat-form-field fxFlex="0 1 auto" class="ml-xs">
<mat-select placeholder="Product" required formControlName="fk_product" multiple> <mat-select placeholder="Product" required formControlName="fk_product" multiple>
@ -56,8 +56,9 @@
<mat-error *ngIf="!_pdTeamForm.controls['fk_product'].valid && _pdTeamForm.controls['fk_product'].touched" class="mat-text-warn">Product Name Requried.</mat-error> <mat-error *ngIf="!_pdTeamForm.controls['fk_product'].valid && _pdTeamForm.controls['fk_product'].touched" class="mat-text-warn">Product Name Requried.</mat-error>
</mat-form-field> </mat-form-field>
<span fxFlex="0 1 auto" class="ml-xs"> <span fxFlex="0 1 auto" class="ml-xs">
<h6> The Selected Products are., </h6> <h6 *ngIf="selectedProductDatas.length != 0"> The Selected Products are </h6>
<ul *ngFor="let data of selectedProductDatas"> <ul *ngFor="let data of selectedProductDatas">
<!-- <h6> The Selected Products are </h6> -->
<li>{{data}}</li> <li>{{data}}</li>
</ul> </ul>
</span> </span>
@ -75,8 +76,9 @@
</mat-form-field> </mat-form-field>
<span fxFlex="0 1 auto" class="ml-xs"> <span fxFlex="0 1 auto" class="ml-xs">
<h6> The Selected Customer segment are., </h6> <h6 *ngIf="selectedSegmentDatas.length != 0"> The Selected Customer segment are </h6>
<ul *ngFor="let data of selectedSegmentDatas"> <ul *ngFor="let data of selectedSegmentDatas">
<!-- <h6> The Selected Customer segment are </h6> -->
<li>{{data}}</li> <li>{{data}}</li>
</ul> </ul>
</span> </span>

View File

@ -24,7 +24,6 @@ export class PdTeamAddComponent implements OnInit {
public _pdTeamForm: FormGroup; public _pdTeamForm: FormGroup;
private notifier: NotifierService; private notifier: NotifierService;
//public submitted = false;
color = 'primary'; color = 'primary';
errorMessage:string; errorMessage:string;
@ -36,25 +35,24 @@ customerSegmentdatas: any[];
//This Type Of Array Declaration //This Type Of Array Declaration
pdTeamCityArray:any= []; pdTeamCityArray:any= [];
pdTeamProductArray: Array<{teamid: number, productid: number}> = []; CityValidation:any= [];
pdTeamCustomerSegmentArray: Array<{teamid: number, customerid: number}> = [];
//This Type Of Array Declaration for Local Purpose and List the data in html page //This Type Of Array Declaration for Local Purpose and List the data in html page
selectedCityDatas : any=[]; selectedCityDatas : any=[];
selectedProductDatas : any=[]; selectedProductDatas : any=[];
selectedSegmentDatas : any=[]; selectedSegmentDatas : any=[];
constructor(private _formBuilder: FormBuilder, constructor(private _formBuilder: FormBuilder,
notifier: NotifierService, private _notifier: NotifierService,
private _pdTeamService: PdTeamService, private _pdTeamService: PdTeamService,
private _router: Router, private _router: Router,
private _masterService: MastersService) private _masterService: MastersService)
{ {
this.notifier = notifier; this.notifier = _notifier;
} }
ngOnInit() { ngOnInit() {
//console.log(this.notifier);
this.PdTeamFormDatas(); this.PdTeamFormDatas();
/** For Checking City Validation datas - checking purpose - Already exists are not */ /** For Checking City Validation datas - checking purpose - Already exists are not */
@ -71,7 +69,7 @@ this._pdTeamService.getAllPdTeamCityMapping()
/** To Display The City Data For City DropDown */ /** To Display The City Data For City DropDown */
this._masterService.getAllMasterData('CITY').subscribe( this._masterService.getAllMasterData('CITY').subscribe(
dataresult => { dataresult => {
if (dataresult.status == 200) { if(dataresult.dataStatus == true){
this.citydatas = dataresult.records; this.citydatas = dataresult.records;
this.citydatas = this.citydatas.filter(city=>city.isactive == 1 ); this.citydatas = this.citydatas.filter(city=>city.isactive == 1 );
} }
@ -81,7 +79,7 @@ this._masterService.getAllMasterData('CITY').subscribe(
/** To Display The Entities Data For Entities DropDown */ /** To Display The Entities Data For Entities DropDown */
this._masterService.getAllMasterData('ENTITY').subscribe( this._masterService.getAllMasterData('ENTITY').subscribe(
dataresult => { dataresult => {
if (dataresult.status == 200) { if(dataresult.dataStatus == true){
this.lenderdatas = dataresult.records; this.lenderdatas = dataresult.records;
this.lenderdatas = this.lenderdatas.filter(entity=>entity.isactive == 1 ); this.lenderdatas = this.lenderdatas.filter(entity=>entity.isactive == 1 );
} }
@ -90,7 +88,7 @@ this._masterService.getAllMasterData('ENTITY').subscribe(
/** To Display The Entities Data For Entities DropDown */ /** To Display The Entities Data For Entities DropDown */
this._masterService.getAllMasterData('PRODUCTS').subscribe( this._masterService.getAllMasterData('PRODUCTS').subscribe(
dataresult => { dataresult => {
if (dataresult.status == 200) { if(dataresult.dataStatus == true) {
this.productdatas = dataresult.records; this.productdatas = dataresult.records;
this.productdatas = this.productdatas.filter(product=>product.isactive == 1 ); this.productdatas = this.productdatas.filter(product=>product.isactive == 1 );
} }
@ -99,7 +97,7 @@ this._masterService.getAllMasterData('PRODUCTS').subscribe(
/** To Display The Entities Data For Entities DropDown */ /** To Display The Entities Data For Entities DropDown */
this._masterService.getAllMasterData('CUSTOMERSEGMENT').subscribe( this._masterService.getAllMasterData('CUSTOMERSEGMENT').subscribe(
dataresult => { dataresult => {
if (dataresult.status == 200) { if(dataresult.dataStatus == true) {
this.customerSegmentdatas = dataresult.records; this.customerSegmentdatas = dataresult.records;
this.customerSegmentdatas = this.customerSegmentdatas.filter(segment=>segment.isactive == 1 ); this.customerSegmentdatas = this.customerSegmentdatas.filter(segment=>segment.isactive == 1 );
} }
@ -144,11 +142,11 @@ onSubmit() {
this._pdTeamService.addPdTeamDetail(this._pdTeamForm.value).subscribe( this._pdTeamService.addPdTeamDetail(this._pdTeamForm.value).subscribe(
dataresult => { dataresult => {
if (dataresult.status == 200) { if(dataresult.dataStatus == true) {
//this.notifier.notify('success', 'Record Saved Successfully.!'); this.notifier.notify('success', 'Record Saved Successfully.!');
Swal('Record Saved Successfully.!','success'); Swal('Record Saved Successfully.!','success');
this._pdTeamForm.reset();
this._router.navigate(['/setting/pdteam/pdteamlist']); this._router.navigate(['/setting/pdteam/pdteamlist']);
} }
else { else {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
@ -176,41 +174,84 @@ onChangeCustomerSegmentDatas($event){
} }
/**on change function for City to display the as List in html page */ /**on change function for City to display the as List in html page */
onChangeCityDatas($event){ // onChangeCityDatas($event){
var mycheck = 0 ; // var mycheck = 0 ;
//let cityName = $event.source.value; // //let cityName = $event.source.value;
let cityName = this.citydatas.filter(city=>city.city_id == $event.source.value)[0]; // let cityName = this.citydatas.filter(city=>city.city_id == $event.source.value)[0];
if($event.source._selected === true ){ // if($event.source._selected === true ){
for(let Duplication_City of this.pdTeamCityArray){ // for(let Duplication_City of this.pdTeamCityArray){
let teamname = Duplication_City.team_name; // let teamname = Duplication_City.team_name;
let dup_cityname = Duplication_City.CITYMAP.filter(city=>city.city_id == $event.source.value); // let dup_cityname = Duplication_City.CITYMAP.filter(city=>city.city_id == $event.source.value);
if(dup_cityname != ''){ // if(dup_cityname != ''){
for(let data of dup_cityname){ // for(let data of dup_cityname){
if(data.name == cityName.name){ // if(data.name == cityName.name){
alert('"'+data.name+'" Already Existing with "'+ teamname +'"'); // alert('"'+data.name+'" Already Existing with "'+ teamname +'"');
$event.source._selected = false; // $event.source._selected = false;
mycheck++; // mycheck++;
} // }
} // }
} // }
} // }
if(mycheck == 0){ // if(mycheck == 0){
this.selectedCityDatas.push(cityName.name); // this.selectedCityDatas.push(cityName.name);
} // }
// }
// else if($event.source._selected === false ){
// let index = this.selectedCityDatas.indexOf(cityName.name);
// this.selectedCityDatas.splice(index,1);
// }
// }
onChangeCityDatas($event){
var mycheck = 0 ;
let lenderId = this._pdTeamForm.value['fk_lender'];
if(lenderId != null){
let cityName = this.citydatas.filter(city=>city.city_id == $event.source.value)[0];//city array
// console.log(cityName);
// console.log($event.source.value);
if($event.source._selected === true ){
this._pdTeamService.getLenderData(lenderId).subscribe(
dataresult => {
if(dataresult.dataStatus == true) {
this.CityValidation = dataresult.records;
}
}, error => this.errorMessage = <any> error);
if(this.CityValidation != ''){
for(let data of this.CityValidation){
if(data['fk_city_id'] == $event.source.value){
Swal('<h5>"'+data['city_name']+'" already existing with "'+ data['team_name'] +'"</h5>');
$event.source._selected = false;
mycheck = 1;
}
}
}
if(mycheck == 0){
this.selectedCityDatas.push(cityName.name);
}
} }
else if($event.source._selected === false ){ else if($event.source._selected === false ){
$event.source._selected = false;
let index = this.selectedCityDatas.indexOf(cityName.name); let index = this.selectedCityDatas.indexOf(cityName.name);
this.selectedCityDatas.splice(index,1); this.selectedCityDatas.splice(index,1);
} }
}
else{
Swal('Pick Up The Lender Name');
$event.source._selected = false;
}
} }
/**on change function for Product to display the data as List in html page */ /**on change function for Product to display the data as List in html page */

View File

@ -2,10 +2,11 @@
<form [formGroup]="_pdTeamForm" (submit)="onSubmit()"> <form [formGroup]="_pdTeamForm" (submit)="onSubmit()">
<mat-card style="padding: 6px;"> <mat-card style="padding: 6px;">
<div class="ml-xs mr-xs" style="width: 100%;" fxLayout="row" fxLayoutAlign="center"> <div class="ml-xs mr-xs" style="width: 100%;" fxLayout="row" fxLayoutAlign="center">
<h2 mat-dialog-title style="width: 50%;">PD TEAM</h2> <h2 mat-dialog-title style="width: 50%;">Edit PD Team</h2>
<div style="width: 20%;"></div> <div style="width: 20%;"></div>
<div style="width: 30%;text-align:right;"> <div style="width: 30%;text-align:right;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button> <!-- <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button> -->
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" type="button" (click)="onNoClick()" [color]="color"><mat-icon>close</mat-icon></button>
</div> </div>
</div> </div>
@ -13,14 +14,16 @@
<div fxLayout="row wrap" fxLayoutGap="32px" fxLayoutAlign="flex-start"> <div fxLayout="row wrap" fxLayoutGap="32px" fxLayoutAlign="flex-start">
<mat-form-field fxFlex="0 1 auto" class="ml-xs"> <mat-form-field fxFlex="0 1 auto" class="ml-xs">
<input matInput type="text" placeholder="Team Name" required formControlName="team_name"> <input matInput type="text" placeholder="Team Name" required formControlName="team_name">
<mat-error *ngIf="submitted && f.team_name.hasError('required')" class="mat-text-warn">You must Include Team Name.</mat-error> <!-- <mat-error *ngIf="submitted && f.team_name.hasError('required')" class="mat-text-warn">You must Include Team Name.</mat-error> -->
<mat-error *ngIf="!_pdTeamForm.controls['team_name'].valid && _pdTeamForm.controls['team_name'].touched" class="mat-text-warn">Team Name Requried.</mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field fxFlex="0 1 auto" class="ml-xs"> <mat-form-field fxFlex="0 1 auto" class="ml-xs">
<mat-select placeholder="Lender" required formControlName="fk_lender"> <mat-select placeholder="Lender" required formControlName="fk_lender">
<mat-option *ngFor="let ld of lenderdatas" [value]="ld.entity_id" >{{ ld.short_name }} {{ ld.full_name }} </mat-option> <mat-option *ngFor="let ld of lenderdatas" [value]="ld.entity_id" >{{ ld.short_name }} {{ ld.full_name }} </mat-option>
</mat-select> </mat-select>
<mat-error *ngIf="submitted && f.fk_lender.hasError('required')" class="mat-text-warn">You must Select Lender Name.</mat-error> <!-- <mat-error *ngIf="submitted && f.fk_lender.hasError('required')" class="mat-text-warn">You must Select Lender Name.</mat-error> -->
<mat-error *ngIf="!_pdTeamForm.controls['fk_lender'].valid && _pdTeamForm.controls['fk_lender'].touched" class="mat-text-warn">Lender Name Requried.</mat-error>
</mat-form-field> </mat-form-field>
</div> </div>
@ -29,12 +32,15 @@
<mat-form-field fxFlex="0 1 auto" class="ml-xs"> <mat-form-field fxFlex="0 1 auto" class="ml-xs">
<mat-select placeholder="City" required formControlName="fk_city" multiple> <mat-select placeholder="City" required formControlName="fk_city" multiple>
<mat-option *ngFor="let cd of citydatas " [value]="cd.city_id" (onSelectionChange)="onChangeCityDatas($event)" >{{ cd.name }} </mat-option> <mat-option *ngFor="let cd of citydatas " [value]="cd.city_id" (onSelectionChange)="onChangeCityDatas($event)" >{{ cd.name }} </mat-option>
</mat-select> </mat-select>
<mat-error *ngIf="submitted && f.fk_city.hasError('required')" class="mat-text-warn">You must Select Cities.</mat-error> <!-- <mat-error *ngIf="submitted && f.fk_city.hasError('required')" class="mat-text-warn">You must Select Cities.</mat-error> -->
<mat-error *ngIf="!_pdTeamForm.controls['fk_city'].valid && _pdTeamForm.controls['fk_city'].touched" class="mat-text-warn">City Name Requried.</mat-error>
</mat-form-field> </mat-form-field>
<span fxFlex="0 1 auto" class="ml-xs"> <span fxFlex="0 1 auto" class="ml-xs">
<h6> The Selected Cities are., </h6> <h6 *ngIf="selectedCityDatas.length != 0"> The Selected Cities are </h6>
<ul *ngFor="let data of selectedCityDatas"> <ul *ngFor="let data of selectedCityDatas">
<li>{{data}}</li> <li>{{data}}</li>
</ul> </ul>
</span> </span>
@ -49,11 +55,13 @@
<mat-select placeholder="Product" required formControlName="fk_product" multiple> <mat-select placeholder="Product" required formControlName="fk_product" multiple>
<mat-option *ngFor="let pd of productdatas " [value]="pd.product_id" (onSelectionChange)="onChangeProductDatas($event)" >{{ pd.name }} </mat-option> <mat-option *ngFor="let pd of productdatas " [value]="pd.product_id" (onSelectionChange)="onChangeProductDatas($event)" >{{ pd.name }} </mat-option>
</mat-select> </mat-select>
<mat-error *ngIf="submitted && f.fk_product.hasError('required')" class="mat-text-warn">You must Select Product.</mat-error> <!-- <mat-error *ngIf="submitted && f.fk_product.hasError('required')" class="mat-text-warn">You must Select Product.</mat-error> -->
<mat-error *ngIf="!_pdTeamForm.controls['fk_product'].valid && _pdTeamForm.controls['fk_product'].touched" class="mat-text-warn">Product Name Requried.</mat-error>
</mat-form-field> </mat-form-field>
<span fxFlex="0 1 auto" class="ml-xs"> <span fxFlex="0 1 auto" class="ml-xs">
<h6> The Selected Products are., </h6> <h6 *ngIf="selectedProductDatas.length != 0"> The Selected Products are </h6>
<ul *ngFor="let data of selectedProductDatas"> <ul *ngFor="let data of selectedProductDatas">
<li>{{data}}</li> <li>{{data}}</li>
</ul> </ul>
</span> </span>
@ -66,11 +74,13 @@
<mat-select placeholder="Customer Segment" required formControlName="fk_customer_segment" multiple> <mat-select placeholder="Customer Segment" required formControlName="fk_customer_segment" multiple>
<mat-option *ngFor="let csd of customerSegmentdatas" [value]="csd.customer_segment_id" (onSelectionChange)="onChangeCustomerSegmentDatas($event)">{{csd.name}}</mat-option> <mat-option *ngFor="let csd of customerSegmentdatas" [value]="csd.customer_segment_id" (onSelectionChange)="onChangeCustomerSegmentDatas($event)">{{csd.name}}</mat-option>
</mat-select> </mat-select>
<mat-error *ngIf="submitted && f.fk_customer_segment.hasError('required')" class="mat-text-warn">You must Select Customer Segment.</mat-error> <!-- <mat-error *ngIf="submitted && f.fk_customer_segment.hasError('required')" class="mat-text-warn">You must Select Customer Segment.</mat-error> -->
<mat-error *ngIf="!_pdTeamForm.controls['fk_customer_segment'].valid && _pdTeamForm.controls['fk_customer_segment'].touched" class="mat-text-warn">CustomerSegment Name Requried.</mat-error>
</mat-form-field> </mat-form-field>
<span fxFlex="0 1 auto" class="ml-xs"> <span fxFlex="0 1 auto" class="ml-xs">
<h6> The Selected Customer segment are., </h6> <h6 *ngIf="selectedSegmentDatas.length != 0"> The Selected Customer segment are </h6>
<ul *ngFor="let data of selectedSegmentDatas"> <ul *ngFor="let data of selectedSegmentDatas">
<li>{{data}}</li> <li>{{data}}</li>
</ul> </ul>
</span> </span>
@ -79,7 +89,8 @@
<div class="row" style="text-align:right;"> <div class="row" style="text-align:right;">
<!-- <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset"><mat-icon>settings_backup_restore</mat-icon></button> --> <!-- <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset"><mat-icon>settings_backup_restore</mat-icon></button> -->
<!-- <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="button" (click)="onResetForEdit($event)" ><mat-icon>settings_backup_restore</mat-icon></button> --> <!-- <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="button" (click)="onResetForEdit($event)" ><mat-icon>settings_backup_restore</mat-icon></button> -->
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button> <!-- <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button> -->
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit" [disabled]="!_pdTeamForm.valid"><mat-icon>save</mat-icon></button>
</div> </div>
</mat-card> </mat-card>
</form> </form>

View File

@ -1,16 +1,12 @@
import { Component, OnInit, Input } from '@angular/core'; import { Component, OnInit, Input } from '@angular/core';
import { FormBuilder, import { FormBuilder,
FormGroup, FormGroup,
Validators, Validators,
FormControl } from '@angular/forms'; FormControl } from '@angular/forms';
/** Service */ /** Service */
import { MastersService } from '../../service/masters/masters.service'; import { MastersService } from '../../service/masters/masters.service';
import { PdTeamService } from '../../service/masters/pd-team.service'; import { PdTeamService } from '../../service/masters/pd-team.service';
import { NotifierService } from 'angular-notifier'; import { NotifierService } from 'angular-notifier';
/** Here this component is like as a partent component */ /** Here this component is like as a partent component */
import { PdTeamListComponent } from './../pd-team-list/pd-team-list.component'; import { PdTeamListComponent } from './../pd-team-list/pd-team-list.component';
/**sweet alert */ /**sweet alert */
@ -25,6 +21,7 @@ export class PdTeamEditComponent implements OnInit {
public _pdTeamForm: FormGroup; public _pdTeamForm: FormGroup;
public submitted = false; public submitted = false;
public listView: any = true;
private notifier: NotifierService; private notifier: NotifierService;
color = 'primary'; color = 'primary';
errorMessage:string; errorMessage:string;
@ -40,9 +37,15 @@ export class PdTeamEditComponent implements OnInit {
//This Type Of Array Declaration for Validation //This Type Of Array Declaration for Validation
pdTeamCityArray:any= []; pdTeamCityArray:any= [];
pdTeamProductArray: Array<{teamid: number, productid: number}> = []; CityValidation:any= [];
pdTeamCustomerSegmentArray: Array<{teamid: number, customerid: number}> = []; //pdTeamProductArray: Array<{teamid: number, productid: number}> = [];
//pdTeamCustomerSegmentArray: Array<{teamid: number, customerid: number}> = [];
//This Type Of Array Declaration to Check the Existing Data
DBCityDatas:any=[];
DBProductDatas:any=[];
DBCustomerSegmentDatas:any=[];
//This Type Of Array Declaration for Local Purpose and List the data in html page //This Type Of Array Declaration for Local Purpose and List the data in html page
selectedCityDatas : any=[]; selectedCityDatas : any=[];
selectedProductDatas : any=[]; selectedProductDatas : any=[];
@ -133,22 +136,42 @@ export class PdTeamEditComponent implements OnInit {
} }
let PdTeamProduct:any = []; let PdTeamProduct:any = [];
for(let ptp of this.childMessage[0].PRODUCTS){ // for(let ptp of this.childMessage[0].PRODUCTS){
PdTeamProduct.push(ptp.product_id); // PdTeamProduct.push(ptp.product_id);
} // }
this._pdTeamService.getProductData(this.childMessage[0].pdteam_id).subscribe(
dataresult => {
if (dataresult.dataStatus == true) {
for(let ptp of dataresult.records){
this.DBProductDatas.push(ptp.fk_product_id);
this.selectedProductDatas.push(ptp.name);
this._pdTeamForm.controls['fk_product'].setValue(this.DBProductDatas);
}
}
}, error => this.errorMessage = <any> error);
let PdTeamCS:any = []; let PdTeamCS:any = [];
for(let ptcs of this.childMessage[0].CUSTOMERSEGMENT){ // for(let ptcs of this.childMessage[0].CUSTOMERSEGMENT){
PdTeamCS.push(ptcs.customer_segment_id); // PdTeamCS.push(ptcs.customer_segment_id);
} // }
this._pdTeamService.getCustomerSegmentData(this.childMessage[0].pdteam_id).subscribe(
dataresult => {
if (dataresult.dataStatus == true) {
for(let ptcs of dataresult.records){
this.DBCustomerSegmentDatas.push(ptcs.customer_segment_id);
this.selectedSegmentDatas.push(ptcs.name);
this._pdTeamForm.controls['fk_customer_segment'].setValue(this.DBCustomerSegmentDatas);
}
}
}, error => this.errorMessage = <any> error);
this._pdTeamForm = this._formBuilder.group({ this._pdTeamForm = this._formBuilder.group({
pdteam_id: [this.childMessage[0].pdteam_id, Validators.compose([Validators.required])], pdteam_id: [this.childMessage[0].pdteam_id, Validators.compose([Validators.required])],
team_name: [this.childMessage[0].team_name, Validators.compose([Validators.required])], team_name: [this.childMessage[0].team_name, Validators.compose([Validators.required])],
fk_lender: [this.childMessage[0].fk_lender_id, Validators.compose([Validators.required])], fk_lender: [this.childMessage[0].fk_lender_id, Validators.compose([Validators.required])],
fk_city: [PdTeamCity, Validators.compose([Validators.required])], fk_city: [PdTeamCity, Validators.compose([Validators.required])],
fk_customer_segment: [PdTeamCS, Validators.compose([Validators.required])], fk_customer_segment: [this.DBCustomerSegmentDatas, Validators.compose([Validators.required])],
fk_product:[PdTeamProduct, Validators.compose([Validators.required])], fk_product:[this.DBProductDatas, Validators.compose([Validators.required])],
}); });
@ -166,73 +189,189 @@ export class PdTeamEditComponent implements OnInit {
// onResetForEdit(){ // onResetForEdit(){
// this.PdTeamFormDatas(); // this.PdTeamFormDatas();
// } // }
/**on change function for customer segment to dispaly the as List in html page */ /**on change function for customer segment to dispaly the as List in html page */
onChangeCustomerSegmentDatas($event){ onChangeCustomerSegmentDatas($event){
//let CustomerSegmentName = $event.source.value.name; if($event.isUserInput != false){
let CustomerSegmentName = this.customerSegmentdatas.filter(cs=>cs.customer_segment_id == $event.source.value)[0]; let CustomerSegmentName = this.customerSegmentdatas.filter(cs=>cs.customer_segment_id == $event.source.value)[0];
if($event.source._selected === true ){
this.selectedSegmentDatas.push(CustomerSegmentName.name); if($event.source._selected === true ){
}
else if($event.source._selected === false ){ this.selectedSegmentDatas.push(CustomerSegmentName.name);
}
else if($event.isUserInput != false && $event.source._selected === false ){
let index = this.selectedSegmentDatas.indexOf(CustomerSegmentName.name); let index = this.selectedSegmentDatas.indexOf(CustomerSegmentName.name);
this.selectedSegmentDatas.splice(index,1); this.selectedSegmentDatas.splice(index,1);
let data;
this._masterService.getAllMasterData('PDTEAMCUSTOMERSEGMENT').subscribe(
dataresult => {
if (dataresult.dataStatus == true) {
data = dataresult.records;
data = data.filter(pdteamcustomer=>pdteamcustomer.fk_cs_id == $event.source.value && pdteamcustomer.isactive == 1);
data = data.filter(pdteamcustomer=>pdteamcustomer.fk_pdteam_id == this._pdTeamForm.value.pdteam_id)[0];
let ActiveDatas = { 'pdteam_customer_segment_id':data.pdteam_customer_segment_id,'isactive': '0'} ;
this._pdTeamService.editPdTeamchildDetails(ActiveDatas,'PDTEAMCUSTOMERSEGMENT')
.subscribe(dataresult=>{
if (dataresult.dataStatus == true){
//alert('InActive Changes Done in cs');
let index = this.selectedSegmentDatas.indexOf(CustomerSegmentName.name);
this.selectedSegmentDatas.splice(index,1);
}else{}
});
}
}, error => this.errorMessage = <any> error);
}
} }
} }
/**on change function for City to display the as List in html page */ /**on change function for City to display the as List in html page */
onChangeCityDatas($event){ // onChangeCityDatas($event){
var mycheck = 0 ; // var mycheck = 0 ;
let cityName = this.citydatas.filter(city=>city.city_id == $event.source.value)[0]; // let cityName = this.citydatas.filter(city=>city.city_id == $event.source.value)[0];
if($event.source._selected == true ){ // if($event.source._selected == true ){
for(let Duplication_City of this.pdTeamCityArray){ // for(let Duplication_City of this.pdTeamCityArray){
let teamname = Duplication_City.team_name; // let teamname = Duplication_City.team_name;
let dup_cityname = Duplication_City.CITYMAP.filter(city=>city.city_id == $event.source.value); // let dup_cityname = Duplication_City.CITYMAP.filter(city=>city.city_id == $event.source.value);
if(dup_cityname != ''){ // if(dup_cityname != ''){
for(let data of dup_cityname){ // for(let data of dup_cityname){
if(data.name == cityName.name){ // if(data.name == cityName.name){
Swal('<h5>"'+data.name+'" already existing with "'+ teamname +'"</h5>'); // Swal('<h5>"'+data.name+'" already existing with "'+ teamname +'"</h5>');
$event.source._selected = false; // $event.source._selected = false;
mycheck=1; // mycheck=1;
} // }
} // }
} // }
} // }
if(mycheck == 0){ // if(mycheck == 0){
this.selectedCityDatas.push(cityName.name); // this.selectedCityDatas.push(cityName.name);
} // }
// }
// else if($event.source._selected === false ){
// let index = this.selectedCityDatas.indexOf(cityName.name);
// this.selectedCityDatas.splice(index,1);
// }
// }
onChangeCityDatas($event){
//console.log('inside the function Event');
var mycheck = 0 ;
let lenderId = this._pdTeamForm.value['fk_lender'];
let cityName = this.citydatas.filter(city=>city.city_id == $event.source.value)[0];//city array
if($event.isUserInput != false){
// console.log(cityName);
// console.log($event.source.value);
if($event.source._selected === true ){
this._pdTeamService.getLenderData(lenderId).subscribe(
dataresult => {
if(dataresult.dataStatus == true){
this.CityValidation = dataresult.records;
}
}, error => this.errorMessage = <any> error);
if(this.CityValidation != ''){
for(let data of this.CityValidation){
if(data['fk_city_id'] == $event.source.value){
Swal('<h5>"'+data['city_name']+'" already existing with "'+ data['team_name'] +'"</h5>');
$event.source._selected = false;
mycheck = 1;
}
}
}
if(mycheck == 0){
this.selectedCityDatas.push(cityName.name);
}
} }
else if($event.source._selected === false ){ else if($event.source._selected === false ){
let index = this.selectedCityDatas.indexOf(cityName.name);
this.selectedCityDatas.splice(index,1); console.log('Return False for city Selection Data');
} let index = this.selectedCityDatas.indexOf(cityName.name);
} this.selectedCityDatas.splice(index,1);
//$event.source._selected = false;
let data;
this._masterService.getAllMasterData('PDTEAMCITY').subscribe(
dataresult => {
if (dataresult.dataStatus == true) {
data = dataresult.records;
console.log('data',data);
data = data.filter(pdteamcity=>pdteamcity.fk_city_id == $event.source.value);
data = data.filter(pdteamcity=>pdteamcity.fk_pdteam_id == this._pdTeamForm.value.pdteam_id)[0];
console.log(data.pdteam_city_id);
this._pdTeamService.deletePDteamCity($event.source.value).subscribe(data=>{
if (dataresult.dataStatus == true) {//alert('Deleted');
let index = this.selectedCityDatas.indexOf(cityName.name);
this.selectedCityDatas.splice(index,1);
//this._PdTeamListComponent.changeListView();
}
});
}
}, error => this.errorMessage = <any> error);
//console.log(data);
}
}
else if($event.isUserInput != true && $event.source._selected == true) {
this.selectedCityDatas.push(cityName.name);
}
}
/**on change function for Product to display the data as List in html page */ /**on change function for Product to display the data as List in html page */
onChangeProductDatas($event){ onChangeProductDatas($event){
if($event.isUserInput != false){
//let productName = $event.source.value.name; //let productName = $event.source.value.name;
let productName = this.productdatas.filter(product=>product.product_id == $event.source.value )[0]; let productName = this.productdatas.filter(product=>product.product_id == $event.source.value )[0];
if($event.source._selected === true ){
this.selectedProductDatas.push(productName.name); if($event.source._selected === true ){
this.selectedProductDatas.push(productName.name);
}
else if($event.isUserInput != false && $event.source._selected === false ){
let index = this.selectedProductDatas.indexOf(productName.name);
this.selectedProductDatas.splice(index,1);
let data;
this._masterService.getAllMasterData('PDTEAMPRODUCT').subscribe(
dataresult => {
if (dataresult.dataStatus == true) {
data = dataresult.records;
console.log('data',data);
data = data.filter(pdteamproduct=>pdteamproduct.fk_product_id == $event.source.value && pdteamproduct.isactive == 1);
data = data.filter(pdteamcity=>pdteamcity.fk_pdteam_id == this._pdTeamForm.value.pdteam_id)[0];
console.log(data.pdteam_city_id);
let ActiveDatas = { 'pdteam_product_id':data.pdteam_product_id,'isactive': '0'} ;
this._pdTeamService.editPdTeamchildDetails(ActiveDatas,'PDTEAMPRODUCT')
.subscribe(dataresult=>{
if (dataresult.dataStatus == true){
//alert('InActive Changes Done in product');
let index = this.selectedProductDatas.indexOf(productName.name);
this.selectedProductDatas.splice(index,1);
}
else{
//alert("Sorry Try Again !");
}
});
}
}, error => this.errorMessage = <any> error);
}
} }
else if($event.source._selected === false ){
let index = this.selectedProductDatas.indexOf(productName.name);
this.selectedProductDatas.splice(index,1);
}
} }
/** To Edited form Data */ /** To Edited form Data */
@ -242,18 +381,17 @@ export class PdTeamEditComponent implements OnInit {
Object.keys(pdTeamFormValues).forEach( Object.keys(pdTeamFormValues).forEach(
(key) => ( pdTeamFormValues[key] == null) && delete pdTeamFormValues[key]); (key) => ( pdTeamFormValues[key] == null) && delete pdTeamFormValues[key]);
this._pdTeamService.editPdTeamDetail(pdTeamFormValues).subscribe( this._pdTeamService.editPdTeamDetail(pdTeamFormValues).subscribe(
dataresult=>{
dataresult=>{ if (dataresult.dataStatus == true){
if (dataresult.dataStatus == true){ Swal("Data Edited Successfully");
Swal("Data Edited Successfully"); this.notifier.notify('success', 'Record Edited Successfully.!');
this.notifier.notify('success', 'Record Edited Successfully.!'); }
} else{
else{ Swal("SomeThing Wents Wrong Try Again !");
Swal("SomeThing Wents Wrong Try Again !"); this.notifier.notify('warning', 'SomeThing Wents Wrong Try Again !');
this.notifier.notify('warning', 'SomeThing Wents Wrong Try Again !'); }
} });
});
} }

View File

@ -2,7 +2,7 @@
<mat-card> <mat-card>
<div fxLayout="row" fxLayoutAlign="start center" class="mb-1"> <div fxLayout="row" fxLayoutAlign="start center" class="mb-1">
<div class="ml-xs mr-xs" style="width: 30%;"> <div class="ml-xs mr-xs" style="width: 30%;">
<mat-card-title><span> PD Team Master</span></mat-card-title> <mat-card-title><span> PD Team</span></mat-card-title>
</div> </div>
</div> </div>
<mat-card-content> <mat-card-content>

View File

@ -149,8 +149,11 @@ isactivePdTeam(id: number,isactive : number) {
/** For Display Tables Pagination And Sorting */ /** For Display Tables Pagination And Sorting */
ngAfterViewInit() { ngAfterViewInit() {
//alert('ngAfterViewInit()');
this.dataSource.paginator = this.paginator; this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort; this.dataSource.sort = this.sort;
//alert('pagintor'+this.dataSource.paginator);
//alert('sort'+this.dataSource.sort);
} }
/** For Display Tables Filtering */ /** For Display Tables Filtering */

View File

@ -7,7 +7,7 @@
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button> <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button>
</div> </div>
</div> </div>
<mat-card>
<mat-card-content> <mat-card-content>
<!-- <div *ngIf="loader"> <!-- <div *ngIf="loader">
<mat-progress-bar mode="indeterminate" color="primary" class="mb-1"></mat-progress-bar> <mat-progress-bar mode="indeterminate" color="primary" class="mb-1"></mat-progress-bar>
@ -19,12 +19,12 @@
<div fxLayout="row wrap"> <div fxLayout="row wrap">
<div fxFlex.gt-sm="33" fxFlex.gt-xs="33" fxFlex="50" *ngFor="let pdteamdetails of pdTeamManageData; let i = index;" > <div fxFlex.gt-sm="33" fxFlex.gt-xs="33" fxFlex="50" *ngFor="let pdteamdetails of pdTeamManageData; let i = index;" >
<mat-card class="mb-1"> <mat-card class="mb-1">
<mat-card-title style="margin-bottom:0px!important;font-size:19px;font-weight:800;" ><span fxFlex="80">{{pdteamdetails.team_name | titlecase}}</span> <mat-icon (click)="cityinfo(pdteamdetails.pdteam_id)" color="primary" matTooltip="Click for more info" matTooltipPosition="above" fxFlex="16" style="text-align:right;">info</mat-icon></mat-card-title>
<mat-card-subtitle >{{pdteamdetails.short_name}}</mat-card-subtitle> <mat-card-title style="margin-bottom:0px!important;font-size:19px;font-weight:800;background-color:#f44336;color:#fff" ><span fxFlex="80">{{pdteamdetails.team_name | titlecase}}</span> <mat-icon (click)="cityinfo(pdteamdetails.pdteam_id)" matTooltip="Click for more info" matTooltipPosition="above" fxFlex="16" style="text-align:right;">info</mat-icon></mat-card-title>
<hr> <mat-card-subtitle style="background-color:#f44336;color:#fff;margin-bottom:0px !important;;line-height: 2 !important;">{{pdteamdetails.short_name}}</mat-card-subtitle>
<mat-list class='bag' [dragula]='"bag"' [dragulaModel]="pdteamdetails.USERPROFILE" [attr.data-id]="pdteamdetails.pdteam_id" > <mat-list class='bag' [dragula]='"bag"' [dragulaModel]="pdteamdetails.USERPROFILE" [attr.data-id]="pdteamdetails.pdteam_id" >
@ -53,6 +53,6 @@
<span>{{pdTeamManageData}}</span> <span>{{pdTeamManageData}}</span>
</div> </div>
</mat-card-content> </mat-card-content>
</mat-card>
</mat-card> </mat-card>

View File

@ -73,7 +73,7 @@ export class EntityService {
updateEntityMasterDetails(Records: any): Observable<any> { updateEntityMasterDetails(Records: any): Observable<any> {
Records.fk_updatedby = this._aws.getlocale();//to get user id for who is created the Record Records.fk_updatedby = this._aws.getlocale();//to get user id for who is created the Record
Records.updatedon = currentdate;//to get Current date and Time for when the Record is created Records.updatedon = currentdate;//to get Current date and Time for when the Record is created
return this._http.post<any>(this.apiUrl + "saveExistEntity", { 'records': Records}) return this._http.post<any>(this.apiUrl + "saveNewEntity", { 'records': Records})
.pipe( .pipe(
catchError(this.handleError('role', [])) catchError(this.handleError('role', []))
) )
@ -88,6 +88,84 @@ export class EntityService {
) )
} }
// =========================================== Entity New Details
getEntityIdNameDetails(entity_id: any): Observable<any>{
// Add safe, URL encoded search parameter if there is a search term
const options = entity_id ?
{ params: new HttpParams().set('eid', entity_id) } : {};
return this._http.get<any[]>(this.apiUrl + "getEntityMasterInfo", options);
}
updateEntityIdNameDetails(Records: any): Observable<any>{
let records = Records.map(item=>{
item.updatedby = this._aws.getlocale();//to get user id for who is created the Record
item.updatedon = currentdate;//to get Current date and Time for when the Record is created
return item;
});
return this._http.post<any[]>(this.apiUrl + "saveTemplateLenderDetails", {'records': records });
}
getEntityIdBillingInfoDetails(entity_id: any): Observable<any>{
// Add safe, URL encoded search parameter if there is a search term
const options = entity_id ?
{ params: new HttpParams().set('eid', entity_id) } : {};
return this._http.get<any[]>(this.apiUrl + "getEntityBillingInfo", options);
}
updateEntityIdBillingInfoDetails(Records: any): Observable<any>{
Records.updatedby = this._aws.getlocale();//to get user id for who is created the Record
Records.updatedon = currentdate;//to get Current date and Time for when the Record is created
return this._http.post<any[]>(this.apiUrl + "saveEntityBillingInfo", {'records': Records });
}
getEntityIdRegionInfoDetails(entity_id: any): Observable<any>{
// Add safe, URL encoded search parameter if there is a search term
const options = entity_id ?
{ params: new HttpParams().set('entityid', entity_id) } : {};
return this._http.get<any[]>(this.apiUrl + "getEntityRegionCityMap", options);
}
updateEntityIdRegionInfoDetails(Records: any): Observable<any>{
let records = Records.map(item=>{
item.fk_updatedby = this._aws.getlocale();//to get user id for who is created the Record
item.updatedon = currentdate;//to get Current date and Time for when the Record is created
item.createdon = item.createdon == null ? currentdate : item.createdon;
item.fk_createdby = item.fk_createdby == null ? this._aws.getlocale() : item.fk_createdby;
return item;
});
return this._http.post<any[]>(this.apiUrl + "saveEntityRegionMapping", {'records': records });
}
getCityHierarchyMaster() : Observable<any>{
return this._http.get<any[]>(this.apiUrl + "getCityHierarchy");
}
getEntityIdCityInfoDetails(entity_id: any): Observable<any>{
// Add safe, URL encoded search parameter if there is a search term
const options = entity_id ?
{ params: new HttpParams().set('entityid', entity_id) } : {};
return this._http.get<any[]>(this.apiUrl + "getVendorCityMap", options);
}
updateEntityIdCityInfoDetails(Records: any): Observable<any>{
Records.fk_updatedby = this._aws.getlocale();//to get user id for who is created the Record
Records.updatedon = currentdate;//to get Current date and Time for when the Record is created
return this._http.post<any[]>(this.apiUrl + "saveVendorCityMapping", {'records': Records });
}
/** /**
* TO Handle The Error * TO Handle The Error
*/ */

View File

@ -65,12 +65,24 @@ return this._http.post<any>(this.apiUrl+"savePDTeam", ArrayData)
var ArrayData = { "records": Records } var ArrayData = { "records": Records }
console.log(ArrayData); console.log(ArrayData);
return this._http.post(this.apiUrl+'savePDTeam',ArrayData) //return this._http.post(this.apiUrl+'savePDTeam',ArrayData)
return this._http.post<any>(this.apiUrl+"savePDTeam", ArrayData)
.pipe( .pipe(
catchError(this.handleError('role', [])) catchError(this.handleError('role', []))
) )
} }
editPdTeamchildDetails(Records: any,MasterName:string): Observable<any> {
var ArrayData = { "master_name":MasterName,
"records": Records }
var data = this._http.post(this.apiUrl+'saveMaster',ArrayData);
return data;
}
/** /**
@ -99,21 +111,66 @@ return this._http.post<any>(this.apiUrl+"savePDTeam", ArrayData)
// } // }
//To delete PDTeam Mapping Details //To delete PDTeam Mapping Details
deletePdTeamMapDetails(Records:any){ deletePDteamCity(id:any): Observable<any> {
Records.fk_updatedby = this._aws.getlocale();//to get user id for who is update the record
Records.updatedon = currentdate;//to get Current date and Time for when the Record is updated var ArrayData = { "pdteam_city_id": id};
console.log('service data',ArrayData);
var ArrayData = { "records": [Records]};
return this._http.post<any>(this.apiUrl+"deletePdTeamMapping", ArrayData).pipe(
// console.log(ArrayData);
// console.log('PdTeamMapDetails in service');
return this._http.post(this.apiUrl+"deletePdTeamMapping",ArrayData).pipe(
catchError(this.handleError('role', [])) catchError(this.handleError('role', []))
); );
}
// deletePdTeamMapDetails(Records:any){
// Records.fk_updatedby = this._aws.getlocale();//to get user id for who is update the record
// Records.updatedon = currentdate;//to get Current date and Time for when the Record is updated
// var ArrayData = { "records": [Records]};
// // console.log(ArrayData);
// // console.log('PdTeamMapDetails in service');
// return this._http.post(this.apiUrl+"deletePdTeamMapping",ArrayData).pipe(
// catchError(this.handleError('role', []))
// );
// }
getLenderData(lenderId: any): Observable<any> {
var ArrayData = {"lender_id":lenderId }
return this._http.post(this.apiUrl+"getLender",ArrayData)
.pipe(
catchError(this.handleError('role', []))
)
}
getProductData(TeamId: any): Observable<any> {
var ArrayData = {"team_id":TeamId }
return this._http.post(this.apiUrl+"getProduct",ArrayData)
.pipe(
catchError(this.handleError('role', []))
)
}
getCustomerSegmentData(TeamId: any): Observable<any> {
var ArrayData = {"team_id":TeamId }
return this._http.post(this.apiUrl+"getCustomerSegment",ArrayData)
.pipe(
catchError(this.handleError('role', []))
)
}
getExistingCityDatas(){
return this._http.get<any>(this.apiUrl+'getExistingCityDatas')
.pipe(
catchError(this.handleError('role', []))
)
} }
@ -143,7 +200,7 @@ return this._http.post<any>(this.apiUrl+"savePDTeam", ArrayData)
) )
} }
getAllPDTeamWithPDTeamID(Primarykey): Observable<any> { getAllPDTeamWithPDTeamID(Primarykey: any): Observable<any> {
var pk = { "primary_key":Primarykey } var pk = { "primary_key":Primarykey }
return this._http.post<any>(this.apiUrl+'getListOfPDTeam',pk) return this._http.post<any>(this.apiUrl+'getListOfPDTeam',pk)
@ -153,7 +210,7 @@ return this._http.post<any>(this.apiUrl+"savePDTeam", ArrayData)
} }
// /** Get All PD Team Child Data using API call Based on Primary Key */ // /** Get All PD Team Child Data using API call Based on Primary Key */
getAllPdTeamMapListWithPK(Primarykey): Observable<any> { getAllPdTeamMapListWithPK(Primarykey: any): Observable<any> {
var pk = { "primary_key":Primarykey } var pk = { "primary_key":Primarykey }
//var Primar = Primarykey //var Primar = Primarykey

View File

@ -353,7 +353,7 @@ this.loader = true;
let users= { let users= {
'userid':this.usersData.userid, 'userid':this.usersData.userid,
'entityid':this.usersData.fk_entity_id, 'entityid':this.usersData.fk_entity_type_id,
'profilepic':this.usersData.profilepic 'profilepic':this.usersData.profilepic
} }
this.profileaccess = false; this.profileaccess = false;

View File

@ -64,7 +64,8 @@ const MENUITEMS : Menu[] = [
type: 'sub', type: 'sub',
icon: 'art_track', icon: 'art_track',
children: [ children: [
{state: 'questions', name: 'Questions'} {state: 'questions', name: 'Questions'},
{state: 'templates', name: 'Templates'}
] ]
} }
] ]

View File

@ -57,7 +57,8 @@
</div> </div>
</div> </div>
</div> </div>
<button mat-button color="primary" matTooltip="Add More Answer" matTooltipPosition="above" (click)="addLanguage($event); false">Add More</button> <button mat-raised-button mat-icon-button mat-button color="primary" matTooltip="Add More Answer" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" (click)="addLanguage($event); false"><mat-icon>add</mat-icon></button>
<!-- <button mat-button color="primary" matTooltip="Add More Answer" matTooltipPosition="above" (click)="addLanguage($event); false">Add More</button> -->
<!--<a (click)="addLanguage()" style="cursor: default">Add another Answer </a>--> <!--<a (click)="addLanguage()" style="cursor: default">Add another Answer </a>-->
</div> </div>
</div> </div>

View File

@ -60,7 +60,8 @@
</div> </div>
</div> </div>
</div> </div>
<button mat-button color="primary" matTooltip="Add More Answer" matTooltipPosition="above" (click)="addLanguage(null, null, null, $event); false">Add More</button> <button mat-raised-button mat-icon-button mat-button color="primary" matTooltip="Add More Answer" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" (click)="addLanguage(null, null, null, $event); false"><mat-icon>add</mat-icon></button>
<!-- <button mat-button color="primary" matTooltip="Add More Answer" matTooltipPosition="above" (click)="addLanguage(null, null, null, $event); false">Add More</button> -->
<!--<a (click)="addLanguage()" style="cursor: default">Add another Answer </a>--> <!--<a (click)="addLanguage()" style="cursor: default">Add another Answer </a>-->
</div> </div>
</div> </div>

View File

@ -1,12 +1,13 @@
<div> <div>
<mat-card> <mat-card>
<mat-card class="mat-elevation-z1"> <div fxLayout="row" fxLayoutAlign="start center" class="mb-1">
<div style="margin: 6px; padding: 4px;"> <div class="ml-xs mr-xs" style="width: 30%;">
<div class="p_title" style="font-size: 16px; font-style: bold;">Questions Master</div> <mat-card-title><span> Questions Master</span></mat-card-title>
<div class="sub_title" style="font-size: 11px;">List of Questions</div> </div>
</div> </div>
<div fxLayout="row" fxLayout.xs="column" fxLayoutWrap fxLayoutAlign="center none"> <div fxLayout="row" fxLayout.xs="column" fxLayoutWrap fxLayoutAlign="center none">
<div fxFlex="80%">
<div fxflexoffset="30%" fxFlex="40%">
<form [formGroup]="filterFormGroupCtrl"> <form [formGroup]="filterFormGroupCtrl">
<div fxLayout="row" fxLayout.xs="column" fxLayoutWrap fxLayoutGap="0.5px" fxLayoutAlign="start none" style="padding: 6px;"> <div fxLayout="row" fxLayout.xs="column" fxLayoutWrap fxLayoutGap="0.5px" fxLayoutAlign="start none" style="padding: 6px;">
@ -19,12 +20,12 @@
</div> </div>
</form> </form>
</div> </div>
<div fxFlex="20%"> <div fxFlex="30%" style="text-align:right">
<button mat-stroked-button color="primary" (click)="addNewQuestion()">Add Questions</button> <button mat-fab class="mr-1 mb-1" color="primary" (click)="addNewQuestion()" matTooltip="Add Questions" matTooltipPosition="above"><mat-icon>add</mat-icon></button>
</div> </div>
</div> </div>
<!--</mat-card-content>--> <!--</mat-card-content>-->
</mat-card>
<ng-container *ngIf="productList.length > 0"> <ng-container *ngIf="productList.length > 0">
<div style="padding: 0 12px;"> <div style="padding: 0 12px;">
@ -46,7 +47,7 @@
</div> </div>
</div> </div>
<div fxFlex="10%"> <div fxFlex="10%">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="editQuestion(product)"><mat-icon>edit</mat-icon></button> <button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editQuestion(product)"><mat-icon>edit</mat-icon></button>
<!--<button mat-icon-button [matMenuTriggerFor]="menu"> <!--<button mat-icon-button [matMenuTriggerFor]="menu">
<mat-icon>more_vert</mat-icon> <mat-icon>more_vert</mat-icon>
</button> </button>
@ -78,7 +79,7 @@
</mat-card> </mat-card>
<mat-paginator #paginator class="mat-elevation-z1" [length]="productList.length" [pageIndex]="pageIndex" [pageSize]="pageSize" <mat-paginator #paginator class="mat-elevation-z1" [length]="productList.length" [pageIndex]="pageIndex" [pageSize]="pageSize"
[pageSizeOptions]="[5, 10, 25, 100]" (page)="pageEvent = $event; pageChange($event)"> [pageSizeOptions]="[5, 10, 25, 50, 100]" (page)="pageEvent = $event; pageChange($event)" showFirstLastButtons>
</mat-paginator> </mat-paginator>
<!--<mat-card> <!--<mat-card>
<div class="example-container mat-elevation-z8"> <div class="example-container mat-elevation-z8">

View File

@ -15,7 +15,9 @@
font-size: 14px; font-size: 14px;
// width: 100%; // width: 100%;
} }
.mat-card-title{
font-size:24px !important;
}
.mat-table { .mat-table {
overflow: auto; overflow: auto;
max-height: 500px; max-height: 500px;

View File

@ -14,6 +14,7 @@ import {
MatListModule, MatMenuModule, MatListModule, MatMenuModule,
MatCheckboxModule MatCheckboxModule
} from '@angular/material'; } from '@angular/material';
import { MatTooltipModule } from '@angular/material/tooltip';
import {MatSlideToggleModule} from '@angular/material/slide-toggle'; import {MatSlideToggleModule} from '@angular/material/slide-toggle';
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
@ -88,6 +89,7 @@ const customNotifierOptions: NotifierOptions = {
MatToolbarModule,MatSelectModule,MatListModule, MatMenuModule, MatToolbarModule,MatSelectModule,MatListModule, MatMenuModule,
MatSlideToggleModule, MatSlideToggleModule,
MatCheckboxModule, MatCheckboxModule,
MatTooltipModule,
FormsModule, FormsModule,
ReactiveFormsModule, ReactiveFormsModule,
QuestionsRouting QuestionsRouting

View File

@ -5,7 +5,7 @@
<div [formGroupName]="i"> <div [formGroupName]="i">
<div fxLayout="row wrap" fxLayout.xs="column" fxLayoutGap="2%" fxLayoutAlign="center center"> <div fxLayout="row wrap" fxLayout.xs="column" fxLayoutGap="2%" fxLayoutAlign="center center">
<div fxFlex="30%"> <div fxFlex="30%">
<mat-form-field> <mat-form-field style="width:275px">
<mat-select placeholder="Category *" formControlName="fk_question_category_id"> <mat-select placeholder="Category *" formControlName="fk_question_category_id">
<mat-option *ngFor="let category of m_category" [value]="category.question_category_id">{{ category.category_name }}</mat-option> <mat-option *ngFor="let category of m_category" [value]="category.question_category_id">{{ category.category_name }}</mat-option>
</mat-select> </mat-select>
@ -27,10 +27,9 @@
<mat-error *ngIf="submitted && i == dublicateRerdIndex "> This Category Already Exist.!</mat-error> <mat-error *ngIf="submitted && i == dublicateRerdIndex "> This Category Already Exist.!</mat-error>
</mat-card> </mat-card>
</div> </div>
<div>
<button mat-fab class="mr-1 mb-1" color="primary" matTooltip="Add More Contact Person" matTooltipPosition="above" (click)="addLanguage(null, $event); false"><mat-icon>add</mat-icon></button>
</div>
<div class="row" style="text-align:right;"> <div class="row" style="text-align:right;">
<button mat-raised-button mat-icon-button color="primary" class="mr-1 mb-1 hover-icon" matTooltip="Add More Category" matTooltipPosition="above" (click)="addLanguage(null, $event); false"><mat-icon>add</mat-icon></button>
<!--<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset"><mat-icon>settings_backup_restore</mat-icon></button>--> <!--<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset"><mat-icon>settings_backup_restore</mat-icon></button>-->
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button> <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button>
</div> </div>

View File

@ -1,30 +1,38 @@
<form [formGroup]="_editTempLenderFrom" (submit)="onSubmit()"> <form [formGroup]="_editTempLenderFrom" (submit)="onSubmit()">
<div formArrayName="temp_lender" class="example-full-width"> <div formArrayName="temp_lender" class="example-full-width">
<mat-card *ngFor="let answ of _editTempLenderFrom.controls.temp_lender['controls']; let i=index"> <mat-card *ngFor="let answ of _editTempLenderFrom.controls.temp_lender['controls']; let i=index">
<div [formGroupName]="i"> <div [formGroupName]="i">
<div fxLayout="row wrap" fxLayout.xs="column" fxLayoutGap="2%" fxLayoutAlign="center center"> <div class="p-1" fxLayout="row wrap" fxLayout.xs="column" fxLayoutGap="2%" fxLayoutAlign="center center">
<mat-form-field fxFlex="20%"> <div fxFlex="22%">
<mat-select placeholder="Lender *" formControlName="fk_lender_id"> <mat-form-field >
<mat-option *ngFor="let lend of m_lender" [value]="lend.entity_id">{{ lend.full_name }}</mat-option> <mat-select placeholder="Lender *" formControlName="fk_lender_id">
</mat-select> <mat-option *ngFor="let lend of m_lender" [value]="lend.entity_id">{{ lend.full_name }}</mat-option>
<mat-error *ngIf="submitted && answ['controls'].fk_lender_id.hasError('required')" class="mat-text-warn">Lender Type Required.!</mat-error> </mat-select>
</mat-form-field> <mat-error *ngIf="submitted && answ['controls'].fk_lender_id.hasError('required')" class="mat-text-warn">Lender Type Required.!</mat-error>
</mat-form-field>
</div>
<div fxFlex="22%">
<mat-form-field >
<mat-select placeholder="Product *" formControlName="fk_product_id">
<mat-option *ngFor="let prcd of m_product" [value]="prcd.product_id">{{ prcd.product_name }}</mat-option>
</mat-select>
<mat-error *ngIf="submitted && answ['controls'].fk_product_id.hasError('required')" class="mat-text-warn">Product Required.!</mat-error>
</mat-form-field>
</div>
<mat-form-field fxFlex="20%">
<mat-select placeholder="Product *" formControlName="fk_product_id"> <div fxFlex="22%">
<mat-option *ngFor="let prcd of m_product" [value]="prcd.product_id">{{ prcd.product_name }}</mat-option> <mat-form-field >
</mat-select> <mat-select placeholder="Customer Segment *" formControlName="fk_customer_segment">
<mat-error *ngIf="submitted && answ['controls'].fk_product_id.hasError('required')" class="mat-text-warn">Product Required.!</mat-error> <mat-option *ngFor="let cusSeg of m_customerSegment" [value]="cusSeg.customer_segment_id">{{ cusSeg.customer_segment }}</mat-option>
</mat-form-field> </mat-select>
<mat-error *ngIf="submitted && answ['controls'].fk_customer_segment.hasError('required')" class="mat-text-warn">Customer Segment Required.!</mat-error>
<mat-form-field fxFlex="20%"> </mat-form-field>
<mat-select placeholder="Customer Segment *" formControlName="fk_customer_segment"> </div>
<mat-option *ngFor="let cusSeg of m_customerSegment" [value]="cusSeg.customer_segment_id">{{ cusSeg.customer_segment }}</mat-option>
</mat-select>
<mat-error *ngIf="submitted && answ['controls'].fk_customer_segment.hasError('required')" class="mat-text-warn">Customer Segment Required.!</mat-error>
</mat-form-field>
<div fxFlex="20%"> <div fxFlex="22%">
<mat-checkbox *ngIf="answ.get('template_lender_map_id').value != null" formControlName="isactive" [ngModel]="answ.get('isactive').value == 1 ? true : answ.get('isactive').value == 0 ? false : null" <mat-checkbox *ngIf="answ.get('template_lender_map_id').value != null" formControlName="isactive" [ngModel]="answ.get('isactive').value == 1 ? true : answ.get('isactive').value == 0 ? false : null"
(ngModelChange)="answ.get('isactive').value = $event ? 1 : 0"></mat-checkbox> (ngModelChange)="answ.get('isactive').value = $event ? 1 : 0"></mat-checkbox>
@ -36,9 +44,10 @@
</div> </div>
</div> </div>
</mat-card> </mat-card>
<button mat-fab class="mr-1 mb-1" color="primary" matTooltip="Add More Contact Person" matTooltipPosition="above" (click)="addLanguage(null, $event); false"><mat-icon>add</mat-icon></button> </div>
</div>
<div class="row" style="text-align:right;"> <div class="row" style="text-align:right;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" color="primary" matTooltip="Add More Lender Details" matTooltipPosition="above" (click)="addLanguage(null, $event); false"><mat-icon>add</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset"><mat-icon>settings_backup_restore</mat-icon></button> <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset"><mat-icon>settings_backup_restore</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button> <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button>
</div> </div>

View File

@ -1,27 +1,28 @@
<form [formGroup]="_editquestionAnswerForm" (submit)="onSubmit()"> <form [formGroup]="_editquestionAnswerForm" (submit)="onSubmit()">
<div formArrayName="temp_questions" class="example-full-width"> <div formArrayName="temp_questions" class="example-full-width">
<table> <table style="width:100%">
<tr *ngFor="let ques of _editquestionAnswerForm.controls.temp_questions['controls']; let i=index ; let last = last;"> <tr *ngFor="let ques of _editquestionAnswerForm.controls.temp_questions['controls']; let i=index ; let last = last;">
<td> <td>
<mat-card> <mat-card>
<div [formGroupName]="i"> <div [formGroupName]="i">
<div fxLayout="row" fxLayout.xs="column" fxLayoutWrap fxLayoutGap="5%" fxLayoutAlign="start center"> <div fxLayout="row" fxLayout.xs="column" fxLayoutWrap fxLayoutGap="5%" fxLayoutAlign="start center">
<div fxFlex="1 1 auto" class="ml-xs" fxFlex="60%"> <div fxFlex="1 1 auto" class="ml-xs" fxFlex="70%">
<span>{{i+1}}</span> ) <label>{{ques.get('question').value}}</label> <span>{{i+1}}</span> ) <label>{{ques.get('question').value}}</label>
</div> </div>
<div fxFlex="1 1 auto" class="ml-xs" fxFlex="20%"> <div fxFlex="1 1 auto" class="ml-xs" fxFlex="20%">
<mat-form-field style="width: 45px; text-align: center" appearance="outline"> <mat-form-field style="width: 35%; text-align: center" appearance="outline">
<input matInput formControlName="question_weightage"> <input matInput formControlName="question_weightage">
</mat-form-field> <span> % </span> </mat-form-field> <span> % </span>
<mat-error *ngIf="submitted && ques['controls'].question_weightage.hasError('required')" class="mat-text-warn">Ques. WT is Required.!</mat-error> <mat-error *ngIf="submitted && ques['controls'].question_weightage.hasError('required')" class="mat-text-warn">Ques. WT is Required.!</mat-error>
</div> </div>
<div fxFlex="0 1 auto" class="ml-xs" fxFlex="20%"> <div fxFlex="0 1 auto" class="ml-xs" fxFlex="10%">
<button (click)="removeLanguage(i)" mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above" <button (click)="removeLanguage(i)" mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above"
type="button"><mat-icon>delete</mat-icon></button> type="button"><mat-icon>delete</mat-icon></button>
</div> </div>
</div> </div>
<div formArrayName="answers" class="example-full-width"> <div formArrayName="answers" class="example-full-width">
<div fxLayout="row wrap" fxLayout.xs="column" fxLayoutWrap fxLayoutGap="0.5%" fxLayoutAlign="center"> <div fxLayout="row wrap" fxLayout.xs="column" fxLayoutWrap fxLayoutGap="0.5%" fxLayoutAlign="center">
<div fxFlex.gt-xs="50%" [fxFlex.gt-md]="regularDistribution" *ngFor="let answ of ques['controls'].answers['controls']; let i_ans = index ; let Ans_last = last;"> <div fxFlex.gt-xs="50%" [fxFlex.gt-md]="regularDistribution" *ngFor="let answ of ques['controls'].answers['controls']; let i_ans = index ; let Ans_last = last;">
<div [formGroupName]="i_ans"> <div [formGroupName]="i_ans">
<div fxLayout="row" fxLayout.xs="column" fxLayoutGap="0.5%" fxLayoutAlign="start center"> <div fxLayout="row" fxLayout.xs="column" fxLayoutGap="0.5%" fxLayoutAlign="start center">
@ -55,10 +56,9 @@
</tr> </tr>
</table> </table>
</div> </div>
<div fxLayout="row" fxLayoutAlign="start">
<button mat-fab class="mr-1 mb-1" color="primary" matTooltip="Add More Contact Person" matTooltipPosition="above" (click)="openDialog(); false"><mat-icon>add</mat-icon></button>
</div>
<div class="row" style="text-align:right;"> <div class="row" style="text-align:right;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Add More Question and Answer" matTooltipPosition="above" color="primary" (click)="openDialog(); false"><mat-icon>add</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button> <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button>
</div> </div>
</form> </form>

View File

@ -5,9 +5,9 @@
(click)="backToList()"><mat-icon>close</mat-icon></button> (click)="backToList()"><mat-icon>close</mat-icon></button>
</div> </div>
<mat-card style="padding: 6px;"> <mat-card style="padding: 6px;">
<h6>Template Name</h6> <!--<h6>Template Name</h6>
<hr> <hr>
<!----> -->
<div *ngIf="templateNameRecord"> <div *ngIf="templateNameRecord">
<form [formGroup]="_editTempNameFrom" (submit)="onSubmit()"> <form [formGroup]="_editTempNameFrom" (submit)="onSubmit()">
<div fxLayout="row" fxLayoutWrap fxLayoutGap="0.5%" fxLayoutAlign="start center"> <div fxLayout="row" fxLayoutWrap fxLayoutGap="0.5%" fxLayoutAlign="start center">

View File

@ -1,13 +1,16 @@
<div style="width: 320px;"> <div style="width: 320px;">
<div fxLayout="row" fxLayoutAlign="end start"> <div fxLayout="row">
<button mat-raised-button mat-icon-button color="primary" class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" <div style="width:100%"> <h5>Add New Template</h5>
(click)="onClose()"><mat-icon>close</mat-icon></button> </div>
<div > <button mat-raised-button mat-icon-button color="primary" class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above"
(click)="onClose()"><mat-icon>close</mat-icon></button>
</div>
</div> </div>
<mat-card style="padding: 4px;">
<h5>Add New Template</h5> <form [formGroup]="_addTemplateFrom" (submit)="onSubmit()">
<hr> <div fxLayout="row" >
<form [formGroup]="_addTemplateFrom" (submit)="onSubmit()">
<div fxLayout="row" fxLayoutAlign="center">
<mat-form-field class="ml-xs example-full-width"> <mat-form-field class="ml-xs example-full-width">
<textarea matInput placeholder="Template Name" formControlName="template_name"></textarea> <textarea matInput placeholder="Template Name" formControlName="template_name"></textarea>
<mat-error *ngIf="submitted && f.template_name.hasError('required')" class="mat-text-warn">You must Include Template Name.</mat-error> <mat-error *ngIf="submitted && f.template_name.hasError('required')" class="mat-text-warn">You must Include Template Name.</mat-error>
@ -18,5 +21,6 @@
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button> <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button>
</div> </div>
</form> </form>
</mat-card>
</div> </div>

View File

@ -1,15 +1,13 @@
<div *ngIf="listView"> <div *ngIf="listView">
<!--========================== Template List View--> <!--========================== Template List View-->
<div> <div>
<mat-card> <mat-card>
<mat-card class="mat-elevation-z1">
<div style="margin: 6px; padding: 4px;"> <div class="p-1" fxLayout="row" fxLayout.xs="column" fxLayoutWrap fxLayoutAlign="center none">
<div class="p_title" style="font-size: 16px; font-style: bold;">Template Master</div>
<div class="sub_title" style="font-size: 11px;">List of Templates</div>
</div>
<div fxLayout="row" fxLayout.xs="column" fxLayoutWrap fxLayoutAlign="center none">
<div fxFlex="80%"> <div fxFlex="80%">
<mat-card-title><span style="font-size:24px"> Template Master</span></mat-card-title>
<!--<form [formGroup]="filterFormGroupCtrl"> <!--<form [formGroup]="filterFormGroupCtrl">
<div fxLayout="row" fxLayout.xs="column" fxLayoutWrap fxLayoutGap="0.5px" fxLayoutAlign="start none" style="padding: 6px;"> <div fxLayout="row" fxLayout.xs="column" fxLayoutWrap fxLayoutGap="0.5px" fxLayoutAlign="start none" style="padding: 6px;">
<mat-select placeholder="Category" formControlName="category"> <mat-select placeholder="Category" formControlName="category">
@ -20,12 +18,11 @@
</div> </div>
</form>--> </form>-->
</div> </div>
<div fxFlex="20%"> <div fxFlex="20%" style="text-align:right;">
<button mat-stroked-button color="primary" (click)="addNewTemplate()">Add New Template</button> <button mat-fab color="primary" (click)="addNewTemplate()" matTooltip="Add Template" matTooltipPosition="above"><mat-icon>add</mat-icon></button>
<!--<button mat-stroked-button color="primary" (click)="addNewQuestion()">Add Questions</button>--> <!--<button mat-stroked-button color="primary" (click)="addNewQuestion()">Add Questions</button>-->
</div> </div>
</div> </div>
</mat-card>
<ng-container *ngIf="templateList.length > 0"> <ng-container *ngIf="templateList.length > 0">
<div style="padding: 0 12px;"> <div style="padding: 0 12px;">
<mat-card class="product-card" *ngFor="let template of dataSource.connect() | async"> <mat-card class="product-card" *ngFor="let template of dataSource.connect() | async">
@ -45,7 +42,7 @@
</div> </div>
</div> </div>
<div fxFlex="10%"> <div fxFlex="10%">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="goToEdit(template.template_id)"><mat-icon>edit</mat-icon></button> <button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="goToEdit(template.template_id)"><mat-icon>edit</mat-icon></button>
</div> </div>
</div> </div>
</mat-card> </mat-card>
@ -56,7 +53,7 @@
</mat-card> </mat-card>
<mat-paginator #paginator class="mat-elevation-z1" [length]="templateList.length" [pageIndex]="pageIndex" [pageSize]="pageSize" <mat-paginator #paginator class="mat-elevation-z1" [length]="templateList.length" [pageIndex]="pageIndex" [pageSize]="pageSize"
[pageSizeOptions]="[5, 10, 25, 100]" (page)="pageEvent = $event; pageChange($event)"> [pageSizeOptions]="[5, 10, 25, 50, 100]" (page)="pageEvent = $event; pageChange($event)" showFirstLastButtons>
</mat-paginator> </mat-paginator>
</mat-card> </mat-card>
</div> </div>

View File

@ -15,6 +15,7 @@ import {
MatCheckboxModule, MatStepperModule, MatTabsModule, MatCheckboxModule, MatStepperModule, MatTabsModule,
MatExpansionModule MatExpansionModule
} from '@angular/material'; } from '@angular/material';
import { MatTooltipModule } from '@angular/material/tooltip';
import {MatSlideToggleModule} from '@angular/material/slide-toggle'; import {MatSlideToggleModule} from '@angular/material/slide-toggle';
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
@ -100,6 +101,7 @@ const customNotifierOptions: NotifierOptions = {
MatTabsModule, MatTabsModule,
MatSlideToggleModule, MatSlideToggleModule,
MatCheckboxModule, MatCheckboxModule,
MatTooltipModule,
FormsModule, FormsModule,
ReactiveFormsModule, ReactiveFormsModule,
TemplatesRouting TemplatesRouting

View File

@ -121,11 +121,11 @@
transform: scale3D(0, 0, 1); transform: scale3D(0, 0, 1);
} }
} }
.mat-cell{ .mat-cell,.mat-form-field{
font-size:1.2em !important; font-size:1.2rem !important;
} }
.mat-header-cell{ .mat-header-cell{
font-size:1.2em !important; font-size:1.2rem !important;
font-weight:800 !important; font-weight:800 !important;
} }