No automatic signout

Voucher basic working
running tables shifted to cards from buttons, this gives us immense styling oportunities
This commit is contained in:
Amritanshu
2019-07-12 12:36:38 +05:30
parent 4513e8b263
commit bcad4cdae3
31 changed files with 1085 additions and 713 deletions

View File

@ -13,6 +13,6 @@ export class RunningTablesResolver implements Resolve<Table[]> {
}
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<Table[]> {
return this.ser.list();
return this.ser.running();
}
}

View File

@ -1,5 +1,23 @@
.running {
background-color: green;
}
.printed {
background-color: firebrick;
}
.square-button {
min-width: 150px;
max-width: 150px;
min-height: 150px;
max-height: 150px;
margin: 20px;
}
.item-name {
text-align: center;
padding: 0.5rem;
}
.center {
text-align: center;
}

View File

@ -3,7 +3,13 @@
<mat-card-title>Running Tables</mat-card-title>
</mat-card-title-group>
<mat-card-content fxLayout="row wrap" fxLayoutGap="grid 20px">
<button mat-raised-button class="square-button"
*ngFor="let table of list" [routerLink]="['../bill']" [queryParams]="{table: table.id}" queryParamsHandling="merge">{{table.name}}</button>
<mat-card fxLayout="column" class="square-button"
*ngFor="let table of list" (click)="navigateToBill(table)"
[class.running]="table.status === 'running'" [class.printed]="table.status === 'printed'">
<h3 class="item-name">{{table.name}}</h3>
<span class="center">{{table.pax || 0}} / {{table.seats}} Seats</span>
<span class="center" *ngIf="table.date">{{table.date}}</span>
<span class="center" *ngIf="table.amount">{{table.amount}}</span>
</mat-card>
</mat-card-content>
</mat-card>

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
import { Table } from '../../core/table';
@Component({
@ -10,7 +10,7 @@ import { Table } from '../../core/table';
export class RunningTablesComponent implements OnInit {
list: Table[];
constructor(private route: ActivatedRoute) {
constructor(private router: Router, private route: ActivatedRoute) {
}
ngOnInit() {
@ -19,4 +19,17 @@ export class RunningTablesComponent implements OnInit {
this.list = data.list;
});
}
navigateToBill(table: Table): void {
let qp = {table: table.id};
if (table.voucherId) {
qp["voucher"] = table.voucherId;
}
let navigationExtras: NavigationExtras = {
queryParams: qp,
queryParamsHandling: 'merge',
preserveFragment: true
};
this.router.navigate(['/sales', 'bill'], navigationExtras);
}
}