Commit 35667eb7c50ae2bedfedd5355b6b3849f41472d8
1 parent
bbb0a9f674
Exists in
master
primer búsqueda sucede en promesa de consulta cumplida
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
src/views/modal-busqueda-productos.html
1 | <div class="modal-header py-1"> | 1 | <div class="modal-header py-1"> |
2 | <h5 class="modal-title">Busqueda de Productos</h5> | 2 | <h5 class="modal-title">Busqueda de Productos</h5> |
3 | </div> | 3 | </div> |
4 | <div class="modal-body" id="modal-body"> | 4 | <div class="modal-body" id="modal-body"> |
5 | <div class="input-group"> | 5 | <div class="input-group"> |
6 | <input | 6 | <input |
7 | type="text" | 7 | type="text" |
8 | class="form-control" | 8 | class="form-control" |
9 | placeholder="Busqueda" | 9 | placeholder="Busqueda" |
10 | ng-model="filters" | 10 | ng-model="filters" |
11 | ng-change="search()" | 11 | ng-change="search()" |
12 | ng-keydown="busquedaDown($event.keyCode)" | 12 | ng-keydown="busquedaDown($event.keyCode)" |
13 | ng-keypress="busquedaPress($event.keyCode)" | 13 | ng-keypress="busquedaPress($event.keyCode)" |
14 | foca-focus="selectedProducto == -1" | 14 | foca-focus="selectedProducto == -1" |
15 | ng-focus="selectedProducto = -1" | 15 | ng-focus="selectedProducto = -1" |
16 | > | 16 | > |
17 | <div class="input-group-append"> | 17 | <div class="input-group-append"> |
18 | <button class="btn btn-outline-secondary" type="button" ng-click="busquedaPress(13)"> | 18 | <button class="btn btn-outline-secondary" type="button" ng-click="busquedaPress(13)"> |
19 | <i class="fa fa-search" aria-hidden="true"></i> | 19 | <i class="fa fa-search" aria-hidden="true"></i> |
20 | </button> | 20 | </button> |
21 | </div> | 21 | </div> |
22 | </div> | 22 | </div> |
23 | <table ng-show="primerBusqueda" class="table table-striped table-sm"> | 23 | <table ng-show="primerBusqueda" class="table table-striped table-sm"> |
24 | <thead> | 24 | <thead> |
25 | <tr> | 25 | <tr> |
26 | <th>Sec.</th> | 26 | <th>Sec.</th> |
27 | <th>Cod.</th> | 27 | <th>Cod.</th> |
28 | <th>Descripción</th> | 28 | <th>Descripción</th> |
29 | <th>P. Base</th> | 29 | <th>P. Base</th> |
30 | <th></th> | 30 | <th></th> |
31 | </tr> | 31 | </tr> |
32 | </thead> | 32 | </thead> |
33 | <tbody> | 33 | <tbody> |
34 | <tr ng-show="currentPageProductos.length == 0"> | 34 | <tr ng-show="currentPageProductos.length == 0 && primerBusqueda"> |
35 | <td colspan="5"> | 35 | <td colspan="5"> |
36 | No se encontraron resultados. | 36 | No se encontraron resultados. |
37 | </td> | 37 | </td> |
38 | </tr> | 38 | </tr> |
39 | <tr class="selectable" | 39 | <tr class="selectable" |
40 | ng-repeat="(key,producto) in currentPageProductos" | 40 | ng-repeat="(key,producto) in currentPageProductos" |
41 | ng-click="select(producto)"> | 41 | ng-click="select(producto)"> |
42 | <td ng-bind="producto.sector"></td> | 42 | <td ng-bind="producto.sector"></td> |
43 | <td ng-bind="producto.codigo"></td> | 43 | <td ng-bind="producto.codigo"></td> |
44 | <td ng-bind="producto.descripcion"></td> | 44 | <td ng-bind="producto.descripcion"></td> |
45 | <td ng-bind="producto.precio | currency"></td> | 45 | <td ng-bind="producto.precio | currency"></td> |
46 | <td> | 46 | <td> |
47 | <button | 47 | <button |
48 | type="button" | 48 | type="button" |
49 | class="btn btn-xs p-1 float-right" | 49 | class="btn btn-xs p-1 float-right" |
50 | ng-class="{ | 50 | ng-class="{ |
51 | 'btn-secondary': selectedProducto != key, | 51 | 'btn-secondary': selectedProducto != key, |
52 | 'btn-primary': selectedProducto == key | 52 | 'btn-primary': selectedProducto == key |
53 | }" | 53 | }" |
54 | foca-focus="selectedProducto == {{key}}" | 54 | foca-focus="selectedProducto == {{key}}" |
55 | ng-keydown="itemProducto($event.keyCode)" | 55 | ng-keydown="itemProducto($event.keyCode)" |
56 | > | 56 | > |
57 | <i class="fa fa-arrow-right" aria-hidden="true"></i> | 57 | <i class="fa fa-arrow-right" aria-hidden="true"></i> |
58 | </button> | 58 | </button> |
59 | </td> | 59 | </td> |
60 | </tr> | 60 | </tr> |
61 | </tbody> | 61 | </tbody> |
62 | </table> | 62 | </table> |
63 | <nav ng-show="currentPageProductos.length > 0 && primerBusqueda"> | 63 | <nav ng-show="currentPageProductos.length > 0 && primerBusqueda"> |
64 | <ul class="pagination pagination-sm justify-content mb-0"> | 64 | <ul class="pagination pagination-sm justify-content mb-0"> |
65 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> | 65 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> |
66 | <a class="page-link" href="#" ng-click="selectPage(currentPage - 1)"> | 66 | <a class="page-link" href="#" ng-click="selectPage(currentPage - 1)"> |
67 | <span aria-hidden="true">«</span> | 67 | <span aria-hidden="true">«</span> |
68 | <span class="sr-only">Anterior</span> | 68 | <span class="sr-only">Anterior</span> |
69 | </a> | 69 | </a> |
70 | </li> | 70 | </li> |
71 | <li | 71 | <li |
72 | class="page-item" | 72 | class="page-item" |
73 | ng-repeat="pagina in paginas" | 73 | ng-repeat="pagina in paginas" |
74 | ng-class="{'active': pagina == currentPage}" | 74 | ng-class="{'active': pagina == currentPage}" |
75 | > | 75 | > |
76 | <a | 76 | <a |
77 | class="page-link" | 77 | class="page-link" |
78 | href="#" | 78 | href="#" |
79 | ng-click="selectPage(pagina)" | 79 | ng-click="selectPage(pagina)" |
80 | ng-bind="pagina" | 80 | ng-bind="pagina" |
81 | ></a> | 81 | ></a> |
82 | </li> | 82 | </li> |
83 | <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> | 83 | <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> |
84 | <a class="page-link" href="#" ng-click="selectPage(currentPage + 1)"> | 84 | <a class="page-link" href="#" ng-click="selectPage(currentPage + 1)"> |
85 | <span aria-hidden="true">»</span> | 85 | <span aria-hidden="true">»</span> |
86 | <span class="sr-only">Siguiente</span> | 86 | <span class="sr-only">Siguiente</span> |
87 | </a> | 87 | </a> |
88 | </li> | 88 | </li> |
89 | </ul> | 89 | </ul> |
90 | </nav> | 90 | </nav> |
91 | </div> | 91 | </div> |
92 | <div class="modal-footer py-1"> | 92 | <div class="modal-footer py-1"> |
93 | <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button> | 93 | <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button> |
94 | </div> | 94 | </div> |
95 | 95 |