Commit fa74a4ac4c426049974b11de3241d805fdc8effe

Authored by Eric Fernandez
1 parent 591880e62b
Exists in master

botones guardar, salir

... ... @@ -932,6 +932,14 @@
932 932 }
933 933 }
934 934 },
  935 + "angular2-ladda": {
  936 + "version": "2.0.1",
  937 + "resolved": "https://registry.npmjs.org/angular2-ladda/-/angular2-ladda-2.0.1.tgz",
  938 + "integrity": "sha512-o0etA77PienX2sHD9fGHjGeg5fmzYpnUPVm/92f6fEVuNQ31OaRxFPVJ8S8ZDEWlq6YFpwkv/ytHFz4NAQ6MdQ==",
  939 + "requires": {
  940 + "ladda": "^2.0.1"
  941 + }
  942 + },
935 943 "ansi": {
936 944 "version": "0.3.1",
937 945 "resolved": "https://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz",
... ... @@ -5545,6 +5553,14 @@
5545 5553 "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==",
5546 5554 "dev": true
5547 5555 },
  5556 + "ladda": {
  5557 + "version": "2.0.1",
  5558 + "resolved": "https://registry.npmjs.org/ladda/-/ladda-2.0.1.tgz",
  5559 + "integrity": "sha512-ynRaMdW9y9ABRdTUWa60HSQjtTkoEZMiQDzzYsX8yxIEm7mxL/sxpvoLutYox1XluRif3DxLDg+3Dl1wurjnJg==",
  5560 + "requires": {
  5561 + "spin.js": "^4.0.0"
  5562 + }
  5563 + },
5548 5564 "lcid": {
5549 5565 "version": "2.0.0",
5550 5566 "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz",
... ... @@ -8546,6 +8562,11 @@
8546 8562 "chalk": "^2.0.1"
8547 8563 }
8548 8564 },
  8565 + "spin.js": {
  8566 + "version": "4.0.0",
  8567 + "resolved": "https://registry.npmjs.org/spin.js/-/spin.js-4.0.0.tgz",
  8568 + "integrity": "sha512-uJN9Q4/I4I7PRZAp1c5reoY89thAfvFB5thbJncAwkPjPhqCfUrCooJc8GMN8q8WKFGIMy+JMf477RW7deCInA=="
  8569 + },
8549 8570 "split-string": {
8550 8571 "version": "3.1.0",
8551 8572 "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz",
... ... @@ -20,6 +20,7 @@
20 20 "@angular/platform-browser-dynamic": "~8.0.0",
21 21 "@angular/router": "~8.0.0",
22 22 "@ng-bootstrap/ng-bootstrap": "^4.2.0",
  23 + "angular2-ladda": "^2.0.1",
23 24 "cordova-android": "^8.0.0",
24 25 "font-awesome": "^4.7.0",
25 26 "rxjs": "~6.4.0",
... ... @@ -55,4 +56,4 @@
55 56 "android"
56 57 ]
57 58 }
58   -}
59 59 \ No newline at end of file
  60 +}
src/app/app.module.ts
... ... @@ -3,26 +3,30 @@ import { NgModule } from '@angular/core';
3 3 import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
4 4 import { HttpClientModule } from '@angular/common/http';
5 5 import { FormsModule } from '@angular/forms';
  6 +import { LaddaModule } from 'angular2-ladda';
6 7  
7 8 import { AppRoutingModule } from './app-routing.module';
8 9 import { AppComponent } from './app.component';
9 10 import { AppBotonera } from './botonera/botonera.component';
10 11 import { ComprobantesComponent } from './comprobantes/comprobantes.component';
11 12 import { NombreEmpresaComponent } from './nombre-empresa/nombre-empresa.component';
  13 +import { AccionesComponent } from './acciones/acciones.component';
12 14  
13 15 @NgModule({
14 16 declarations: [
15 17 AppComponent,
16 18 AppBotonera,
17 19 ComprobantesComponent,
18   - NombreEmpresaComponent
  20 + NombreEmpresaComponent,
  21 + AccionesComponent
19 22 ],
20 23 imports: [
21 24 BrowserModule,
22 25 AppRoutingModule,
23 26 NgbModule,
24 27 HttpClientModule,
25   - FormsModule
  28 + FormsModule,
  29 + LaddaModule
26 30 ],
27 31 providers: [],
28 32 bootstrap: [AppComponent]
src/app/comprobantes/comprobantes.component.html
... ... @@ -28,138 +28,140 @@
28 28 </div>
29 29 </div>
30 30 </div>
31   -
32   -<form>
33   - <div class="row border">
34   - <div class="col-6 col-sm-3 d-flex">
35   - <strong>Letra Factura:&nbsp;</strong>
36   - <label>{{cabecera.TIP}}</label>
37   - </div>
38   - <div class="col-6 col-sm-3 d-flex">
39   - <strong>Tipo Factura:&nbsp;</strong>
40   - <label>{{cabecera.TCO}}</label>
41   - </div>
42   - <div class="col-6 col-sm-3 d-flex">
43   - <strong>Sucursal:&nbsp;</strong>
44   - <label>{{cabecera.SUC}}</label>
45   - </div>
46   - <div class="col-6 col-sm-3 d-flex">
47   - <strong>Número:&nbsp;</strong>
48   - <label>{{cabecera.NCO}}</label>
49   - </div>
50   - <div class="col-6 col-sm-3 d-flex">
51   - <strong>Cuit:&nbsp;</strong>
52   - <label>{{cabecera.CUI}}</label>
53   - </div>
54   - <div class="col-12 col-sm-3 d-flex">
55   - <strong>Nombre:&nbsp;</strong>
56   - <label>{{cabecera.NOM}}</label>
  31 +<div class="row">
  32 + <form class="col-12 col-sm-10">
  33 + <div class="row border">
  34 + <div class="col-6 col-sm-3 d-flex">
  35 + <strong>Letra Factura:&nbsp;</strong>
  36 + <label>{{cabecera.TIP}}</label>
  37 + </div>
  38 + <div class="col-6 col-sm-3 d-flex">
  39 + <strong>Tipo Factura:&nbsp;</strong>
  40 + <label>{{cabecera.TCO}}</label>
  41 + </div>
  42 + <div class="col-6 col-sm-3 d-flex">
  43 + <strong>Sucursal:&nbsp;</strong>
  44 + <label>{{cabecera.SUC}}</label>
  45 + </div>
  46 + <div class="col-6 col-sm-3 d-flex">
  47 + <strong>Número:&nbsp;</strong>
  48 + <label>{{cabecera.NCO}}</label>
  49 + </div>
  50 + <div class="col-6 col-sm-3 d-flex">
  51 + <strong>Cuit:&nbsp;</strong>
  52 + <label>{{cabecera.CUI}}</label>
  53 + </div>
  54 + <div class="col-12 col-sm-3 d-flex">
  55 + <strong>Nombre:&nbsp;</strong>
  56 + <label>{{cabecera.NOM}}</label>
  57 + </div>
57 58 </div>
58   - </div>
59   - <div class="row border">
60   - <div class="col-4">
61   - <button
  59 + <div class="row border">
  60 + <div class="col-4">
  61 + <button
62 62 type="button"
63 63 class="btn btn-outline-secondary btn-sm"
64 64 [ngClass]="{'active': estadoArticulos == 'pendiente'}"
65 65 (click)="estadoArticulos = 'pendiente'; paginaActiva = 1; filter = '';">
66   - Pendientes&nbsp;({{getCantidadArticulosByEstado('pendiente')}})
  66 + Pendientes&nbsp;({{getCantidadArticulosByEstado('pendiente')}})
67 67 </button>
68 68 </div>
69 69 <div class="col-4">
70 70 <button
71   - type="button"
72   - class="btn btn-outline-success btn-sm"
73   - [ngClass]="{'active': estadoArticulos == 'aprobado'}"
74   - (click)="estadoArticulos = 'aprobado'; paginaActiva = 1; filter = '';">
75   - Aprobados&nbsp;({{getCantidadArticulosByEstado('aprobado')}})
  71 + type="button"
  72 + class="btn btn-outline-success btn-sm"
  73 + [ngClass]="{'active': estadoArticulos == 'aprobado'}"
  74 + (click)="estadoArticulos = 'aprobado'; paginaActiva = 1; filter = '';">
  75 + Aprobados&nbsp;({{getCantidadArticulosByEstado('aprobado')}})
76 76 </button>
77 77 </div>
78 78 <div class="col-4">
79 79 <button
80   - type="button"
81   - class="btn btn-outline-danger btn-sm"
82   - [ngClass]="{'active': estadoArticulos == 'rechazado'}"
83   - (click)="estadoArticulos = 'rechazado'; paginaActiva = 1; filter = '';">
84   - Rechazados&nbsp;({{getCantidadArticulosByEstado('rechazado')}})
85   - </button>
86   - </div>
  80 + type="button"
  81 + class="btn btn-outline-danger btn-sm"
  82 + [ngClass]="{'active': estadoArticulos == 'rechazado'}"
  83 + (click)="estadoArticulos = 'rechazado'; paginaActiva = 1; filter = '';">
  84 + Rechazados&nbsp;({{getCantidadArticulosByEstado('rechazado')}})
  85 + </button>
87 86 </div>
88   - <div class="row">
89   - <input
  87 +</div>
  88 +<div class="row">
  89 + <input
90 90 type="text"
91 91 class="form-control-sm col-12"
92 92 placeholder="Busque producto por nombre, codigo"
93 93 [(ngModel)]="filter"
94 94 [ngModelOptions]="{standalone: true}"/>
95   - </div>
96   - <div class="row">
97   - <table class="table table-dark">
98   - <thead>
99   - <tr>
100   - <th *ngIf="estadoArticulos != 'rechazado'">Rechazar</th>
101   - <th>Producto</th>
102   - <th>Cantidad</th>
103   - <th *ngIf="estadoArticulos != 'aprobado'">Aceptar</th>
104   - </tr>
105   - </thead>
106   - <tbody>
107   - <tr *ngFor="let articulo of getPaginaFiltro()" [ngClass]="{'bg-success': articulo.estado == 'aprobado'}">
108   - <th *ngIf="estadoArticulos != 'rechazado'"><button type="button" class="" (click)="articulo.estado = 'rechazado'">
109   - <i class="fa fa-window-close"></i>
110   - </button></th>
111   - <th>{{articulo.LI0}}</th>
112   - <th *ngIf="!articulo.input" (click)="articulo.input = true">
113   - {{articulo.recibido ? articulo.recibido + '/' : ''}}{{articulo.CAN}}</th>
114   - <th *ngIf="articulo.input">
115   - <input
116   - class="form-control-sm col-12"
117   - type="number"
118   - (keyup.enter)="articulo.input = false"
119   - [(ngModel)]="articulo.recibido"
120   - [ngModelOptions]="{standalone: true}"
121   - autofocus/>
122   - /{{articulo.CAN}}
123   - </th>
124   - <th *ngIf="estadoArticulos != 'aprobado'">
125   - <button type="button" class="" (click)="articulo.estado = 'aprobado'">
126   - <i class="fa fa-check"></i>
127   - </button>
128   - </th>
129   - </tr>
130   - <tr>
131   - <th colspan="3" *ngIf="articulosFiltro.length == 0">Por el momento no hay elementos aquí</th>
132   - </tr>
133   - </tbody>
134   - <tfoot>
135   - <nav *ngIf="articulosFiltro.length > 0" class="mr-auto position-absolute">
136   - <ul class="pagination pagination-sm justify-content mb-0">
137   - <li class="page-item" [ngClass]="{'disabled': paginaActiva == 1}">
138   - <a class="page-link" href="javascript:void();" (click)="paginaActiva = paginaActiva - 1">
139   - <span aria-hidden="true">&laquo;</span>
140   - <span class="sr-only">Anterior</span>
141   - </a>
142   - </li>
143   - <li
144   - class="page-item"
145   - *ngFor="let pagina of paginas; index as i"
146   - [ngClass]="{'active': pagina == paginaActiva}"
147   - >
148   - <a
149   - class="page-link"
150   - href="javascript:void();"
151   - (click)="paginaActiva = pagina"
152   - >{{pagina}}</a>
153   - </li>
154   - <li class="page-item" [ngClass]="{'disabled': paginaActiva == paginas.length}">
155   - <a class="page-link" href="javascript:void();" (click)="paginaActiva = paginaActiva + 1">
156   - <span aria-hidden="true">&raquo;</span>
157   - <span class="sr-only">Siguiente</span>
158   - </a>
159   - </li>
160   - </ul>
161   - </nav>
162   - </tfoot>
163   - </table>
164   - </div>
165   -</form>
  95 + </div>
  96 + <div class="row">
  97 + <table class="table table-dark">
  98 + <thead>
  99 + <tr>
  100 + <th *ngIf="estadoArticulos != 'rechazado'">Rechazar</th>
  101 + <th>Producto</th>
  102 + <th>Cantidad</th>
  103 + <th *ngIf="estadoArticulos != 'aprobado'">Aceptar</th>
  104 + </tr>
  105 + </thead>
  106 + <tbody>
  107 + <tr *ngFor="let articulo of getPaginaFiltro()" [ngClass]="{'bg-success': articulo.estado == 'aprobado'}">
  108 + <th *ngIf="estadoArticulos != 'rechazado'"><button type="button" class="" (click)="articulo.estado = 'rechazado'">
  109 + <i class="fa fa-window-close"></i>
  110 + </button></th>
  111 + <th>{{articulo.LI0}}</th>
  112 + <th *ngIf="!articulo.input" (click)="articulo.input = true">
  113 + {{articulo.recibido ? articulo.recibido + '/' : ''}}{{articulo.CAN}}</th>
  114 + <th *ngIf="articulo.input">
  115 + <input
  116 + class="form-control-sm col-12"
  117 + type="number"
  118 + (keyup.enter)="articulo.input = false"
  119 + [(ngModel)]="articulo.recibido"
  120 + [ngModelOptions]="{standalone: true}"
  121 + autofocus/>
  122 + /{{articulo.CAN}}
  123 + </th>
  124 + <th *ngIf="estadoArticulos != 'aprobado'">
  125 + <button type="button" class="" (click)="articulo.estado = 'aprobado'">
  126 + <i class="fa fa-check"></i>
  127 + </button>
  128 + </th>
  129 + </tr>
  130 + <tr>
  131 + <th colspan="3" *ngIf="articulosFiltro.length == 0">Por el momento no hay elementos aquí</th>
  132 + </tr>
  133 + </tbody>
  134 + <tfoot>
  135 + <nav *ngIf="articulosFiltro.length > 0" class="mr-auto position-absolute mb-5">
  136 + <ul class="pagination pagination-sm justify-content mb-0">
  137 + <li class="page-item" [ngClass]="{'disabled': paginaActiva == 1}">
  138 + <a class="page-link" href="javascript:void();" (click)="paginaActiva = paginaActiva - 1">
  139 + <span aria-hidden="true">&laquo;</span>
  140 + <span class="sr-only">Anterior</span>
  141 + </a>
  142 + </li>
  143 + <li
  144 + class="page-item"
  145 + *ngFor="let pagina of paginas; index as i"
  146 + [ngClass]="{'active': pagina == paginaActiva}"
  147 + >
  148 + <a
  149 + class="page-link"
  150 + href="javascript:void();"
  151 + (click)="paginaActiva = pagina"
  152 + >{{pagina}}</a>
  153 + </li>
  154 + <li class="page-item" [ngClass]="{'disabled': paginaActiva == paginas.length}">
  155 + <a class="page-link" href="javascript:void();" (click)="paginaActiva = paginaActiva + 1">
  156 + <span aria-hidden="true">&raquo;</span>
  157 + <span class="sr-only">Siguiente</span>
  158 + </a>
  159 + </li>
  160 + </ul>
  161 + </nav>
  162 + </tfoot>
  163 + </table>
  164 + </div>
  165 + </form>
  166 + <app-acciones (guardar)="guardarComprobante()"></app-acciones>
  167 +</div>
src/app/comprobantes/comprobantes.component.ts
... ... @@ -52,6 +52,10 @@ export class ComprobantesComponent implements OnInit {
52 52 }).length;
53 53 }
54 54  
  55 + guardarComprobante(event: any) {
  56 + alert('Guardando');
  57 + }
  58 +
55 59 obtenerConsulta() {
56 60  
57 61 setTimeout(() => {
... ... @@ -8,7 +8,7 @@
8 8 <meta name="viewport" content="width=device-width, initial-scale=1">
9 9 <link rel="icon" type="image/x-icon" href="assets/img/logo.png">
10 10 <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
11   -
  11 +
12 12 <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
13 13  
14 14 <script type="text/javascript" src="cordova.js"></script>
1 1 /* You can add global styles to this file, and also import other style files */
2 2 @import '../node_modules/font-awesome/css/font-awesome.min.css';
  3 +@import '../node_modules/ladda/dist/ladda.min.css';
3 4  
4 5 body {
5 6 background-color: #cccccc;