Merge branch 'master' of https://bitbucket.org/sriramv18/sparqsineedge
This commit is contained in:
commit
7df70eb364
@ -43,20 +43,35 @@
|
|||||||
</div>
|
</div>
|
||||||
</mat-tab>
|
</mat-tab>
|
||||||
<mat-tab label="PD Report">
|
<mat-tab label="PD Report">
|
||||||
<div>
|
|
||||||
<div style="text-align: left; margin: 12px;" class="mb-1">
|
|
||||||
<button mat-raised-button color="primary" *ngIf="generateBtn" (click)="generateNewPDReport()">Generate Report</button>
|
|
||||||
<button mat-raised-button color="accent" *ngIf="reGenerateBtn" (click)="reGeneratePFReport()">Re-generate Report</button>
|
|
||||||
</div>
|
|
||||||
<div *ngIf="reGenerateBtn">
|
<div *ngIf="reGenerateBtn">
|
||||||
<div style="text-align: right;">
|
|
||||||
<mat-select style="width: 50%;" placeholder="Select PD Version" >
|
|
||||||
<mat-option>--</mat-option>
|
|
||||||
<mat-option *ngFor="let pd of pdReportVersionList" (click)="changeVersion(pd)" >
|
<mat-card >
|
||||||
{{ pd.doc_name }} <span *ngIf="pd.is_latest == 1" [style.color]="'green'">( Current Version )</span>
|
|
||||||
</mat-option>
|
<mat-card-content>
|
||||||
</mat-select>
|
|
||||||
</div>
|
<mat-sidenav-container class="app-inner background-none shadow-none mail-db">
|
||||||
|
<button matTooltip="Menu" matTooltipPosition="above" (click)="mailnav.toggle()" color="primary" fxHide="false" fxshow.gt-sm mat-icon-button mat-raised-button>
|
||||||
|
<mat-icon style="color: white;">short_text</mat-icon>
|
||||||
|
</button>
|
||||||
|
<mat-sidenav #mailnav [mode]="isOver() ? 'over' : 'side'" [opened]="!isOver()" class="mail-sidebar pl-xs pr-xs">
|
||||||
|
<mat-card style="text-align:center;"> <button mat-raised-button color="red" *ngIf="reGenerateBtn" (click)="reGeneratePFReport()" style="padding: 0 58px !important;">Re-generate Report</button></mat-card>
|
||||||
|
<button mat-menu-item *ngFor="let pd of pdReportVersionList" [ngClass]="{'active': selectedItem == item}" (click)="changeVersion(pd)" style="font-size: 0.9em !important;height:6% !important;line-height: normal !important;">
|
||||||
|
{{ pd.doc_name }}<span *ngIf="pd.is_latest == 1" [style.color]="'green'">( Current Version )</span><br>
|
||||||
|
<span style="color:rgba(117, 115, 115, 0.87)!important;font-size:13px !important;">{{pd.createdby}}</span><br>
|
||||||
|
<span style="color:rgba(117, 115, 115, 0.87)!important;font-size:13px !important;">{{pd.createdon}}</span>
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
</button>
|
||||||
|
|
||||||
|
</mat-sidenav>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="main-content" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
|
||||||
|
|
||||||
|
<figure>
|
||||||
|
|
||||||
<div *ngIf="latestPDDetails">
|
<div *ngIf="latestPDDetails">
|
||||||
<div style="margin: 12px;
|
<div style="margin: 12px;
|
||||||
background: #ddd;
|
background: #ddd;
|
||||||
@ -64,16 +79,38 @@
|
|||||||
<div style="text-align: right;" class="mb-1">
|
<div style="text-align: right;" class="mb-1">
|
||||||
<button mat-raised-button mat-icon-button class="hover-icon " type="button" matTooltip="Edit" matTooltipPosition="above"
|
<button mat-raised-button mat-icon-button class="hover-icon " type="button" matTooltip="Edit" matTooltipPosition="above"
|
||||||
*ngIf="latestPDDetails.is_latest == 1" (click)="addNewQuestion()"><mat-icon>edit</mat-icon></button>
|
*ngIf="latestPDDetails.is_latest == 1" (click)="addNewQuestion()"><mat-icon>edit</mat-icon></button>
|
||||||
<button mat-stroked-button *ngIf="latestPDDetails.is_latest == 0" (click)="changeDocumentEdit()">Enable Editable</button>
|
<button mat-stroked-button *ngIf="latestPDDetails.is_latest == 0" (click)="changeDocumentEdit()">Restore</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div *ngIf="reGenerateBtn">
|
||||||
<pdf-viewer [src]="latestPDDetails.doc_uri" [original-size]="false" [page]="1">
|
<pdf-viewer [src]="latestPDDetails.doc_uri" [original-size]="false" [page]="1">
|
||||||
</pdf-viewer>
|
</pdf-viewer>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</figure>
|
||||||
|
</div>
|
||||||
|
</mat-sidenav-container>
|
||||||
|
|
||||||
|
</mat-card-content>
|
||||||
|
</mat-card>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div *ngIf="generateBtn">
|
||||||
|
<div fxLayout="row wrap">
|
||||||
|
<div class="container" fxLayout fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="10px" fxLayoutGap.xs="0" style="padding: 10%;">
|
||||||
|
<div fxFlex="100">
|
||||||
|
<h5 style="text-align:center;color: black;"> {{message}}</h5>
|
||||||
|
<div style="text-align:center;">
|
||||||
|
<button mat-raised-button color="primary" *ngIf="generateBtn" (click)="generateNewPDReport()">Generate Report</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</mat-tab>
|
</mat-tab>
|
||||||
</mat-tab-group>
|
</mat-tab-group>
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
|
|||||||
@ -0,0 +1,119 @@
|
|||||||
|
@import "./../../../../../assets/styles/scss/components/messages";
|
||||||
|
:host {
|
||||||
|
margin-left: -5px;
|
||||||
|
margin-right: -5px;
|
||||||
|
margin-top: -5px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
:host /deep/ {
|
||||||
|
mat-sidenav {
|
||||||
|
width: 267px;
|
||||||
|
}
|
||||||
|
.mat-sidenav-content {
|
||||||
|
padding: 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
@media (min-width: 959px) {
|
||||||
|
.mat-sidenav-side {
|
||||||
|
background-color: transparent;
|
||||||
|
box-shadow: none!important;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.mat-menu-item-active {
|
||||||
|
color: red !important;
|
||||||
|
}
|
||||||
|
.mat-expansion-panel-header-description {
|
||||||
|
color: rgba(0, 0, 0, 87);
|
||||||
|
}
|
||||||
|
.mat-card-content {
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
|
.mat-card-actions {
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-ellipsis {
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custm-list-item {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$base-card-box-shadow:1.5px 2.6px 24px 0 rgba(0, 35, 136, 0.08) !important;
|
||||||
|
$product-bg-color-hover: rgba(103, 58, 183, 0.7);
|
||||||
|
.p-list-main {
|
||||||
|
background: white;
|
||||||
|
margin: auto;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden !important;
|
||||||
|
border-radius: 10px 10px 10px 10px;
|
||||||
|
box-shadow: $base-card-box-shadow;
|
||||||
|
transform: scale(0.95);
|
||||||
|
transition: box-shadow 0.5s, transform 0.5s;
|
||||||
|
&:hover {
|
||||||
|
transform: scale(1);
|
||||||
|
box-shadow: 5px 20px 30px rgba(0, 0, 0, 0.2);
|
||||||
|
}
|
||||||
|
.p-list {
|
||||||
|
position: relative;
|
||||||
|
.top {
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
// background: url(https://s-media-cache-ak0.pinimg.com/736x/49/80/6f/49806f3f1c7483093855ebca1b8ae2c4.jpg) no-repeat center center;
|
||||||
|
-webkit-background-size: 100%;
|
||||||
|
-moz-background-size: 100%;
|
||||||
|
-o-background-size: 100%;
|
||||||
|
background-size: 100%;
|
||||||
|
}
|
||||||
|
.bottom {
|
||||||
|
width: 200%;
|
||||||
|
height: 15%;
|
||||||
|
transition: transform 0.5s;
|
||||||
|
h1 {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
p {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
.left {
|
||||||
|
height: 100%;
|
||||||
|
width: 50%;
|
||||||
|
background: #f4f4f4;
|
||||||
|
position: relative;
|
||||||
|
float: left;
|
||||||
|
.details {
|
||||||
|
padding: 5px;
|
||||||
|
float: left;
|
||||||
|
// width: calc(70% - 40px);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
.right {
|
||||||
|
width: 50%;
|
||||||
|
background: #A6CDDE;
|
||||||
|
color: white;
|
||||||
|
float: right;
|
||||||
|
height: 200%;
|
||||||
|
overflow: hidden;
|
||||||
|
.details {
|
||||||
|
padding: 20px;
|
||||||
|
float: right;
|
||||||
|
width: calc(70% - 40px);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -32,6 +32,7 @@ export class PdReportComponent implements OnInit {
|
|||||||
// public src;
|
// public src;
|
||||||
pdReportRecords:any;
|
pdReportRecords:any;
|
||||||
latestPDDetails: any;
|
latestPDDetails: any;
|
||||||
|
message:any;
|
||||||
|
|
||||||
private notifier: NotifierService;
|
private notifier: NotifierService;
|
||||||
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
|
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
|
||||||
@ -52,6 +53,36 @@ export class PdReportComponent implements OnInit {
|
|||||||
this.listPDComponent.showListView(false);
|
this.listPDComponent.showListView(false);
|
||||||
this.getPdReportDetails();
|
this.getPdReportDetails();
|
||||||
this.getPdReportVersionList();
|
this.getPdReportVersionList();
|
||||||
|
// start
|
||||||
|
|
||||||
|
// end
|
||||||
|
const elemSidebar = <HTMLElement>document.querySelector('.app-inner .mail-sidebar');
|
||||||
|
const elemContent = <HTMLElement>document.querySelector('.app-inner .main-content');
|
||||||
|
|
||||||
|
if (window.matchMedia(`(min-width: 1560px)`).matches && !this.isMac()) {
|
||||||
|
// Ps.initialize(elemSidebar, { wheelSpeed: 2, suppressScrollX: true });
|
||||||
|
// Ps.initialize(elemContent, { wheelSpeed: 2, suppressScrollX: true });
|
||||||
|
}
|
||||||
|
|
||||||
|
// this.loadTemplates(this.startPD);
|
||||||
|
// this.next = 1;
|
||||||
|
// this.previous = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
isMac(): boolean {
|
||||||
|
let bool = false;
|
||||||
|
if (navigator.platform.toUpperCase().indexOf('MAC') >= 0 || navigator.platform.toUpperCase().indexOf('IPAD') >= 0) {
|
||||||
|
bool = true;
|
||||||
|
}
|
||||||
|
return bool;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
isOver(): boolean {
|
||||||
|
return window.matchMedia(`(max-width: 1560px)`).matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
reGeneratePFReport(){
|
reGeneratePFReport(){
|
||||||
@ -97,6 +128,7 @@ export class PdReportComponent implements OnInit {
|
|||||||
} else {
|
} else {
|
||||||
// this.reGenerateBtn = true;
|
// this.reGenerateBtn = true;
|
||||||
this.generateBtn = true;
|
this.generateBtn = true;
|
||||||
|
this.message= data.msg;
|
||||||
}
|
}
|
||||||
}, err=> {
|
}, err=> {
|
||||||
|
|
||||||
@ -139,6 +171,7 @@ export class PdReportComponent implements OnInit {
|
|||||||
|
|
||||||
changeVersion(pd : any): void {
|
changeVersion(pd : any): void {
|
||||||
this.latestPDDetails = pd;
|
this.latestPDDetails = pd;
|
||||||
|
console.log(this.latestPDDetails);
|
||||||
}
|
}
|
||||||
|
|
||||||
changeDocumentEdit() : void{
|
changeDocumentEdit() : void{
|
||||||
|
|||||||
@ -48,6 +48,9 @@ tr.mat-footer-row {
|
|||||||
mat-form-field {
|
mat-form-field {
|
||||||
margin: 0 2%;
|
margin: 0 2%;
|
||||||
}
|
}
|
||||||
|
::ng-deep .cdk-global-overlay-wrapper{
|
||||||
|
justify-content: center !important;
|
||||||
|
}
|
||||||
$base-card-box-shadow:1.5px 2.6px 24px 0 rgba(0, 35, 136, 0.08) !important;
|
$base-card-box-shadow:1.5px 2.6px 24px 0 rgba(0, 35, 136, 0.08) !important;
|
||||||
$product-bg-color-hover: rgba(103, 58, 183, 0.7);
|
$product-bg-color-hover: rgba(103, 58, 183, 0.7);
|
||||||
.p-list-main {
|
.p-list-main {
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
<form [formGroup]="_neighbourhoodForm" novalidate>
|
<form [formGroup]="_neighbourhoodForm" novalidate>
|
||||||
|
|
||||||
<h2 mat-dialog-title class="paragraph_change">
|
<h2 mat-dialog-title class="paragraph_change">
|
||||||
<div fxFlex="70" align="left" style="padding: 10px !important;">
|
<div fxFlex="70" align="left">
|
||||||
<div fxLayout="row wrap">
|
<div fxLayout="row wrap">
|
||||||
<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">
|
||||||
{{pageTitle}}
|
{{pageTitle}}
|
||||||
@ -10,19 +9,21 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div fxFlex="30" align="end" style="padding: 10px !important;">
|
<div fxFlex="30" align="end">
|
||||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="right" mat-dialog-close><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="right" mat-dialog-close><mat-icon>close</mat-icon></button>
|
||||||
</div>
|
</div>
|
||||||
</h2>
|
</h2>
|
||||||
<h6>
|
|
||||||
|
<mat-dialog-content>
|
||||||
|
<mat-card>
|
||||||
|
<mat-card-header>
|
||||||
<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">
|
||||||
<mat-radio-group formControlName="check_type" class="example-radio-group">
|
<mat-radio-group formControlName="check_type" class="example-radio-group">
|
||||||
<mat-radio-button class="example-radio-button" color="primary" [value]="types.id" *ngFor="let types of check_type; let t = index">{{types.type_name}}</mat-radio-button>
|
<mat-radio-button class="example-radio-button" color="primary" [value]="types.id" *ngFor="let types of check_type; let t = index">{{types.type_name}}</mat-radio-button>
|
||||||
</mat-radio-group>
|
</mat-radio-group>
|
||||||
</div>
|
</div>
|
||||||
</h6>
|
</mat-card-header>
|
||||||
<mat-dialog-content formArrayName="neighbourhood_list" *ngIf="_neighbourhoodForm.controls.check_type.value==0">
|
<mat-card-content formArrayName="neighbourhood_list" *ngIf="_neighbourhoodForm.controls.check_type.value==0">
|
||||||
<mat-card>
|
|
||||||
<mat-card *ngFor="let neighbourhood of _neighbourhoodForm.controls.neighbourhood_list['controls']; let n = index;" [formGroupName]="n">
|
<mat-card *ngFor="let neighbourhood of _neighbourhoodForm.controls.neighbourhood_list['controls']; let n = index;" [formGroupName]="n">
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
<mat-form-field style="width: 42%">
|
<mat-form-field style="width: 42%">
|
||||||
@ -49,15 +50,8 @@
|
|||||||
<mat-icon>delete</mat-icon></button>
|
<mat-icon>delete</mat-icon></button>
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
<mat-dialog-actions>
|
</mat-card-content>
|
||||||
<div fxFlex="100" align="end">
|
<mat-card-content formArrayName="referencecheck_list" *ngIf="_neighbourhoodForm.controls.check_type.value==1">
|
||||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Add More" matTooltipPosition="above" (click)="_neighbourhoodForm.controls.check_type.value==0 ? addNeighbourhood() : addReferencecheck()" color="primary"><mat-icon>add</mat-icon></button>
|
|
||||||
</div>
|
|
||||||
</mat-dialog-actions>
|
|
||||||
</mat-card>
|
|
||||||
</mat-dialog-content>
|
|
||||||
<mat-dialog-content formArrayName="referencecheck_list" *ngIf="_neighbourhoodForm.controls.check_type.value==1">
|
|
||||||
<mat-card>
|
|
||||||
<mat-card *ngFor="let reference of _neighbourhoodForm.controls.referencecheck_list['controls']; let r = index;" [formGroupName]="r">
|
<mat-card *ngFor="let reference of _neighbourhoodForm.controls.referencecheck_list['controls']; let r = index;" [formGroupName]="r">
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
<mat-form-field style="width: 28%">
|
<mat-form-field style="width: 28%">
|
||||||
@ -109,15 +103,18 @@
|
|||||||
<mat-icon>delete</mat-icon></button>
|
<mat-icon>delete</mat-icon></button>
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
<mat-dialog-actions>
|
|
||||||
<div fxFlex="100" align="end">
|
</mat-card-content>
|
||||||
|
<mat-card-actions align="end">
|
||||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Add More" matTooltipPosition="above" (click)="_neighbourhoodForm.controls.check_type.value==0 ? addNeighbourhood() : addReferencecheck()" color="primary"><mat-icon>add</mat-icon></button>
|
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Add More" matTooltipPosition="above" (click)="_neighbourhoodForm.controls.check_type.value==0 ? addNeighbourhood() : addReferencecheck()" color="primary"><mat-icon>add</mat-icon></button>
|
||||||
</div>
|
</mat-card-actions>
|
||||||
</mat-dialog-actions>
|
|
||||||
</mat-card>
|
</mat-card>
|
||||||
|
|
||||||
|
|
||||||
</mat-dialog-content>
|
</mat-dialog-content>
|
||||||
<mat-dialog-actions>
|
|
||||||
|
<mat-dialog-actions>
|
||||||
<div fxFlex="60" class="pb-0 text-sm-left" align="left">
|
<div fxFlex="60" class="pb-0 text-sm-left" align="left">
|
||||||
<mat-form-field appearance="outline" style="width: 100%">
|
<mat-form-field appearance="outline" style="width: 100%">
|
||||||
<mat-label>Remarks</mat-label>
|
<mat-label>Remarks</mat-label>
|
||||||
@ -128,8 +125,6 @@
|
|||||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Save" matTooltipPosition="above" (click)="saveNeighbourhood(_neighbourhoodForm.value)"><mat-icon>save</mat-icon></button>
|
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Save" matTooltipPosition="above" (click)="saveNeighbourhood(_neighbourhoodForm.value)"><mat-icon>save</mat-icon></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</mat-dialog-actions>
|
</mat-dialog-actions>
|
||||||
<notifier-container></notifier-container>
|
<notifier-container></notifier-container>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,11 +1,14 @@
|
|||||||
<form class="example-form">
|
<!--<div *ngIf="listofCity.length > 0">
|
||||||
|
<mat-card *ngFor="let city of listofCity; let i = index;">
|
||||||
|
<h4>{{city.name}}</h4>
|
||||||
|
<div *ngIf="city.branch_details.length > 0">
|
||||||
|
<form class="example-form">
|
||||||
<mat-form-field class="example-full-width">
|
<mat-form-field class="example-full-width">
|
||||||
<input matInput placeholder="Add Branch" name="first" [(ngModel)]="newElement.name">
|
<input matInput placeholder="Add Branch" name="first" [(ngModel)]="newElement[city.name]">
|
||||||
</mat-form-field> <span *ngIf="newElement.name"><mat-icon (click)="addItem()">check</mat-icon></span>
|
</mat-form-field> <span *ngIf="newElement[city.name]"><mat-icon (click)="addItem(city.name)">check</mat-icon></span>
|
||||||
</form>
|
</form>
|
||||||
<div *ngIf="listOfBranch.length > 0">
|
|
||||||
<mat-list role="list" class="inlist">
|
<mat-list role="list" class="inlist">
|
||||||
<ng-container *ngFor="let branch of listOfBranch; let i = index;">
|
<ng-container *ngFor="let branch of city.branch_details; let i = index;">
|
||||||
<mat-list-item role="listitem" *ngIf="branch.isactive == 1" class="list-item" [ngStyle]="{ 'border-color': i === currentElement ? '#f44336' : 'gray'}">
|
<mat-list-item role="listitem" *ngIf="branch.isactive == 1" class="list-item" [ngStyle]="{ 'border-color': i === currentElement ? '#f44336' : 'gray'}">
|
||||||
<label style="width: 80%" [hidden]="currentElement === i">{{branch.branch_name}}</label>
|
<label style="width: 80%" [hidden]="currentElement === i">{{branch.branch_name}}</label>
|
||||||
<input *ngIf="currentElement === i" matInput placeholder="Add Branch" [(ngModel)]="branch.branch_name">
|
<input *ngIf="currentElement === i" matInput placeholder="Add Branch" [(ngModel)]="branch.branch_name">
|
||||||
@ -15,13 +18,56 @@
|
|||||||
</mat-list-item>
|
</mat-list-item>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</mat-list>
|
</mat-list>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="city.branch_details.length == 0">
|
||||||
|
<h2 style="color: #ddd; text-align: center;">No Records Found...</h2>
|
||||||
|
</div>
|
||||||
|
</mat-card>
|
||||||
|
<pre>{{ newElement | json}}</pre>
|
||||||
<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" (click)="reset();false"><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" (click)="reset();false"><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"
|
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="button"
|
||||||
(click)="saveBranch()"><mat-icon>save</mat-icon></button>
|
(click)="saveBranch()"><mat-icon>save</mat-icon></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="listOfBranch.length == 0">
|
<div *ngIf="listofCity.length == 0">
|
||||||
<h2 style="color: #ddd; text-align: center;">No Records Found...</h2>
|
<h2 style="color: #ddd; text-align: center;">No Records Found...</h2>
|
||||||
</div>
|
</div>-->
|
||||||
|
|
||||||
|
<form [formGroup]="_addEntityBranchFrom" (submit)="onSubmit()">
|
||||||
|
<div formArrayName="branch_details" class="example-full-width">
|
||||||
|
<mat-card *ngFor="let region of _addEntityBranchFrom.controls.branch_details['controls']; let i=index">
|
||||||
|
<mat-card-content *ngIf="region.get('isactive').value == 1">
|
||||||
|
<div [formGroupName]="i">
|
||||||
|
<div fxLayout="row wrap" fxLayout.xs="column" fxLayoutGap="2%" fxLayoutAlign="center center">
|
||||||
|
<mat-form-field fxFlex="30%">
|
||||||
|
<input matInput placeholder="Branch Name" name="first" formControlName="branch_name">
|
||||||
|
<mat-error *ngIf="submitted && region['controls'].branch_name.hasError('required')" class="mat-text-warn">Branch Name 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.fk_city_id">{{ city.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>
|
||||||
|
<div fxFlex="30%" style="text-align:center;">
|
||||||
|
<!--<mat-checkbox *ngIf="region.get('entity_lender_branch_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="_addEntityBranchFrom.controls.branch_details.controls.length > 1" (click)="removeLanguage(i)">-->
|
||||||
|
<button (click)="deleteEntityBranch(i, $event); false" 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-content>
|
||||||
|
</mat-card>
|
||||||
|
</div>
|
||||||
|
<div class="row" style="text-align:right;">
|
||||||
|
<button mat-raised-button mat-icon-button class="mr-1 mb-1" color="primary" matTooltip="Add More Region Information" matTooltipPosition="above" (click)="addRegionFormData(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" (click)="reset();false"><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)="saveBranch(); false"><mat-icon>save</mat-icon></button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|||||||
@ -18,9 +18,15 @@ import { EntityService } from './../../../service/entity/entity.service';
|
|||||||
export class EntityBranchAddComponent implements OnInit {
|
export class EntityBranchAddComponent implements OnInit {
|
||||||
|
|
||||||
@Input() public entityId: number;
|
@Input() public entityId: number;
|
||||||
public newElement = { name: '' };
|
public newElement: any= {};
|
||||||
|
public listofCity = [];
|
||||||
public listOfBranch = [];
|
public listOfBranch = [];
|
||||||
|
|
||||||
|
public m_city: any = [];
|
||||||
|
|
||||||
|
public _addEntityBranchFrom: FormGroup;
|
||||||
|
public submitted = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notifier service
|
* Notifier service
|
||||||
*/
|
*/
|
||||||
@ -32,18 +38,89 @@ export class EntityBranchAddComponent implements OnInit {
|
|||||||
private mastersService: MastersService,
|
private mastersService: MastersService,
|
||||||
private _formBuilder: FormBuilder) {
|
private _formBuilder: FormBuilder) {
|
||||||
this.notifier = notifier;
|
this.notifier = notifier;
|
||||||
|
this._addEntityBranchFrom = this._formBuilder.group({
|
||||||
|
branch_details: this._formBuilder.array([
|
||||||
|
// this.addRegionFormData(null, null),
|
||||||
|
])
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.entityService.getEntityBranchList(this.entityId).subscribe(data => {
|
this.entityService.getEntityBranchList(this.entityId).subscribe(data => {
|
||||||
if (data.dataStatus) {
|
if (data.dataStatus) {
|
||||||
this.listOfBranch = data.records;
|
this.listofCity = data.records;
|
||||||
|
this.m_city = data.records.city_master;
|
||||||
|
// this.listOfBranch = data.records;
|
||||||
|
this.setFormDatas(data.records.branch_details);
|
||||||
}
|
}
|
||||||
}, err => {
|
}, err => {
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setFormDatas(record) {
|
||||||
|
if (record.length > 0) {
|
||||||
|
for (let val of record) {
|
||||||
|
let vals = {
|
||||||
|
entity_lender_branch_id: val.entity_lender_branch_id,
|
||||||
|
branch_name: val.branch_name,
|
||||||
|
fk_entity_id: val.fk_entity_id,
|
||||||
|
fk_region_id: val.fk_region_id,
|
||||||
|
fk_city_id: val.fk_city_id,
|
||||||
|
fk_updatedby: val.fk_updatedby,
|
||||||
|
fk_createdby: val.fk_createdby,
|
||||||
|
isactive: val.isactive,
|
||||||
|
};
|
||||||
|
this.addRegionFormData(vals, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// convenience getter for easy access to form fields
|
||||||
|
get f() { return this._addEntityBranchFrom.controls; }
|
||||||
|
|
||||||
|
// Dynamic Form field creation Functionality : START ===>
|
||||||
|
initRegionFormLoad(data) {
|
||||||
|
return this._formBuilder.group({
|
||||||
|
entity_lender_branch_id: [data.entity_lender_branch_id],
|
||||||
|
branch_name: [data.branch_name, Validators.compose([Validators.required])],
|
||||||
|
fk_city_id: [data.fk_city_id, Validators.compose([Validators.required])],
|
||||||
|
fk_entity_id: [data.fk_entity_id],
|
||||||
|
fk_updatedby: [data.fk_updatedby],
|
||||||
|
fk_createdby: [data.fk_createdby],
|
||||||
|
isactive: [data.isactive],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
addRegionFormData(data, e) {
|
||||||
|
if (data == null) {
|
||||||
|
let newDate = {
|
||||||
|
entity_lender_branch_id: null,
|
||||||
|
branch_name:null,
|
||||||
|
fk_entity_id: this.entityId,
|
||||||
|
fk_createdby: null,
|
||||||
|
fk_updatedby: null,
|
||||||
|
fk_city_id: null,
|
||||||
|
isactive: 1,
|
||||||
|
}
|
||||||
|
const control = <FormArray>this._addEntityBranchFrom.controls['branch_details'];
|
||||||
|
control.push(this.initRegionFormLoad(newDate));
|
||||||
|
} else {
|
||||||
|
const control = <FormArray>this._addEntityBranchFrom.controls['branch_details'];
|
||||||
|
control.push(this.initRegionFormLoad(data));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteEntityBranch(inx, e) {
|
||||||
|
e.stopPropagation();
|
||||||
|
const control = <FormArray>this._addEntityBranchFrom.controls['branch_details'];
|
||||||
|
// let dataS = control.controls[inx].value;
|
||||||
|
if(control.controls[inx].value['entity_lender_branch_id'] !== null){
|
||||||
|
console.log( this._addEntityBranchFrom.controls['branch_details']['controls'][inx].controls.isactive);
|
||||||
|
this._addEntityBranchFrom.controls['branch_details']['controls'][inx].controls.isactive.setValue("0");
|
||||||
|
console.log( this._addEntityBranchFrom.controls['branch_details']['controls'][inx].controls.isactive.value);
|
||||||
|
} else {
|
||||||
|
control.removeAt(inx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// public listOfBranch = [
|
// public listOfBranch = [
|
||||||
// {
|
// {
|
||||||
@ -72,17 +149,17 @@ export class EntityBranchAddComponent implements OnInit {
|
|||||||
// }
|
// }
|
||||||
// ];
|
// ];
|
||||||
|
|
||||||
addItem(): void {
|
addItem(prop): void {
|
||||||
let data = {
|
// let data = {
|
||||||
"entity_lender_branch_id": null,
|
// "entity_lender_branch_id": null,
|
||||||
"branch_name": this.newElement.name,
|
// "branch_name": this.newElement.name,
|
||||||
"isactive": "1",
|
// "isactive": "1",
|
||||||
"fk_createdby": null,
|
// "fk_createdby": null,
|
||||||
"fk_updatedby": null,
|
// "fk_updatedby": null,
|
||||||
"fk_entity_id": this.entityId.toString()
|
// "fk_entity_id": this.entityId.toString()
|
||||||
}
|
// }
|
||||||
this.listOfBranch.push(data);
|
// this.listOfBranch.push(data);
|
||||||
this.newElement.name = '';
|
// this.newElement.name = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
public currentElement = -1;
|
public currentElement = -1;
|
||||||
@ -98,8 +175,48 @@ export class EntityBranchAddComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** To Save/Edited Popup Data */
|
||||||
|
onSubmit() {
|
||||||
|
alert();
|
||||||
|
this.submitted = true;
|
||||||
|
// stop here if form is invalid
|
||||||
|
if (this._addEntityBranchFrom.invalid) {
|
||||||
|
// this.errorMessage = "Please Fill All Mandate Fields.";
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
var formValues = this._addEntityBranchFrom.value;
|
||||||
|
//To Remove The "Null" With Key also
|
||||||
|
Object.keys(formValues).forEach((key) => (formValues[key] == null) && delete formValues[key]);
|
||||||
|
alert(JSON.stringify(formValues.branch_details));
|
||||||
|
// 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.!";
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
saveBranch(): void {
|
saveBranch(): void {
|
||||||
this.entityService.updateEntityIdBranchInfoDetails(this.listOfBranch).subscribe(data => {
|
// alert();
|
||||||
|
var formValues = this._addEntityBranchFrom.value;
|
||||||
|
//To Remove The "Null" With Key also
|
||||||
|
Object.keys(formValues).forEach((key) => (formValues[key] == null) && delete formValues[key]);
|
||||||
|
// alert(JSON.stringify(formValues.branch_details));
|
||||||
|
|
||||||
|
this.entityService.updateEntityIdBranchInfoDetails(formValues.branch_details).subscribe(data => {
|
||||||
if (data.dataStatus) {
|
if (data.dataStatus) {
|
||||||
this.notifier.notify('success', 'Your Changes Updated.!');
|
this.notifier.notify('success', 'Your Changes Updated.!');
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -233,12 +233,6 @@
|
|||||||
<app-entity-edit-vendor-city-info [entityId]="entity_id">
|
<app-entity-edit-vendor-city-info [entityId]="entity_id">
|
||||||
</app-entity-edit-vendor-city-info>
|
</app-entity-edit-vendor-city-info>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</mat-tab>
|
|
||||||
<mat-tab label="TAT Information">
|
|
||||||
<ng-template matTabContent>
|
|
||||||
<app-entity-edit-tat [entityId]="entity_id">
|
|
||||||
</app-entity-edit-tat>
|
|
||||||
</ng-template>
|
|
||||||
</mat-tab>
|
</mat-tab>
|
||||||
<mat-tab *ngIf="localEntityType == 2" label="Branch">
|
<mat-tab *ngIf="localEntityType == 2" label="Branch">
|
||||||
<ng-template matTabContent>
|
<ng-template matTabContent>
|
||||||
@ -246,6 +240,12 @@
|
|||||||
</app-entity-branch-add>
|
</app-entity-branch-add>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</mat-tab>
|
</mat-tab>
|
||||||
|
<mat-tab label="TAT Information">
|
||||||
|
<ng-template matTabContent>
|
||||||
|
<app-entity-edit-tat [entityId]="entity_id">
|
||||||
|
</app-entity-edit-tat>
|
||||||
|
</ng-template>
|
||||||
|
</mat-tab>
|
||||||
<!--<mat-tab label="Category">
|
<!--<mat-tab label="Category">
|
||||||
<ng-template matTabContent>
|
<ng-template matTabContent>
|
||||||
<app-template-edit-category [questionId]="question_id">
|
<app-template-edit-category [questionId]="question_id">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user