Commit cddf2033974b3dc6443f0130124960a91475b31a
Exists in
master
Merge branch 'develop' of git.focasoftware.com:angular/autoservicio
Showing
3 changed files
Show diff stats
src/app/components/configuracion/configuracion.component.ts
... | ... | @@ -5,6 +5,7 @@ import { PuntoVenta } from 'src/app/wrappers/puntoVenta'; |
5 | 5 | import { ImpresoraService } from 'src/app/services/impresora.service'; |
6 | 6 | import { Impresora } from 'src/app/wrappers/impresora'; |
7 | 7 | import { FormGroup, FormControl } from '@angular/forms'; |
8 | +import { Router } from '@angular/router'; | |
8 | 9 | |
9 | 10 | @Component({ |
10 | 11 | selector: 'app-configuracion', |
... | ... | @@ -16,11 +17,13 @@ export class ConfiguracionComponent implements OnInit { |
16 | 17 | puntosVenta: PuntoVenta[] = []; |
17 | 18 | impresoras: Impresora[] = []; |
18 | 19 | form: FormGroup; |
20 | + reiniciar: boolean = false; | |
19 | 21 | |
20 | 22 | constructor( |
21 | 23 | private activeModal: BsModalRef, |
22 | 24 | private puntoVentaService: PuntoVentaService, |
23 | 25 | private impresoraService: ImpresoraService, |
26 | + private router: Router | |
24 | 27 | ) { } |
25 | 28 | |
26 | 29 | ngOnInit() { |
... | ... | @@ -50,9 +53,13 @@ export class ConfiguracionComponent implements OnInit { |
50 | 53 | close() { |
51 | 54 | |
52 | 55 | this.activeModal.hide(); |
56 | + if (this.reiniciar) { | |
57 | + this.router.navigate(['inicio']); | |
58 | + } | |
53 | 59 | } |
54 | 60 | |
55 | 61 | acept() { |
62 | + this.reiniciar = !localStorage.getItem('impresoraPVE') ? true : false; | |
56 | 63 | |
57 | 64 | let auxPuntoVenta = this.puntosVenta.find(p => p.ID === this.form.get('puntoVenta').value); |
58 | 65 | let auxImpresora = this.impresoras.find(p => p.PVE === this.form.get('impresora').value); |
src/app/components/inicio/inicio.component.html
1 | -<div class="row m-0 fade-in"> | |
1 | +<div class="row m-0 fade-in" [hidden]="!mostrarPantalla"> | |
2 | 2 | <div class="col-12 p-0"> |
3 | 3 | |
4 | 4 | <!-- NOMBRE DE SECCION --> |
... | ... | @@ -209,3 +209,7 @@ |
209 | 209 | |
210 | 210 | </div> |
211 | 211 | </div> |
212 | + | |
213 | +<div class="row m-0 fade-in" [hidden]="mostrarPantalla"> | |
214 | + <p class="w-100 text-center">No esá configurado el punto de venta</p> | |
215 | +</div> |
src/app/components/inicio/inicio.component.ts
... | ... | @@ -22,6 +22,7 @@ export class InicioComponent implements OnInit, AfterViewInit { |
22 | 22 | private promociones: Producto[] = []; |
23 | 23 | private sinonimos: Sinonimo[] = []; |
24 | 24 | private apiImagenes: string = APP_SETTINGS.apiImagenes; |
25 | + private mostrarPantalla : boolean = false; | |
25 | 26 | |
26 | 27 | @ViewChild('pop', { static: false }) popoverDirective: PopoverDirective; |
27 | 28 | |
... | ... | @@ -44,6 +45,7 @@ export class InicioComponent implements OnInit, AfterViewInit { |
44 | 45 | |
45 | 46 | this.productoAcargar = this.productoService.productoAcargar; |
46 | 47 | this.getProductos(); |
48 | + this.mostrarPantalla = localStorage.getItem('impresoraPVE') ? true : false; | |
47 | 49 | } |
48 | 50 | |
49 | 51 | ngAfterViewInit() { |