Commit 0542a9dfd4f1c26bb6ad81693d5b26eb4efb49ae
1 parent
a410b1873c
Exists in
master
La fila es seleccionable
Showing
1 changed file
with
6 additions
and
5 deletions
Show diff stats
src/views/modal-busqueda-productos.html
| 1 | <div class="modal-header"> | 1 | <div class="modal-header"> |
| 2 | <h3 class="modal-title">Busqueda de Productos</h3> | 2 | <h3 class="modal-title">Busqueda de Productos</h3> |
| 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 mb-3"> | 5 | <div class="input-group mb-3"> |
| 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 | <table class="table table-striped table-sm"> | 17 | <table class="table table-striped table-sm"> |
| 18 | <thead> | 18 | <thead> |
| 19 | <tr> | 19 | <tr> |
| 20 | <th>Sec.</th> | 20 | <th>Sec.</th> |
| 21 | <th>Cod.</th> | 21 | <th>Cod.</th> |
| 22 | <th>Descripción</th> | 22 | <th>Descripción</th> |
| 23 | <th>P. Base</th> | 23 | <th>P. Base</th> |
| 24 | <th></th> | 24 | <th></th> |
| 25 | </tr> | 25 | </tr> |
| 26 | </thead> | 26 | </thead> |
| 27 | <tbody> | 27 | <tbody> |
| 28 | <tr ng-repeat="(key,producto) in currentPageProductos"> | 28 | <tr class="selectable" |
| 29 | ng-repeat="(key,producto) in currentPageProductos" | ||
| 30 | ng-click="select(producto)"> | ||
| 29 | <td ng-bind="producto.sector"></td> | 31 | <td ng-bind="producto.sector"></td> |
| 30 | <td ng-bind="producto.codigo"></td> | 32 | <td ng-bind="producto.codigo"></td> |
| 31 | <td ng-bind="producto.descripcion"></td> | 33 | <td ng-bind="producto.descripcion"></td> |
| 32 | <td ng-bind="producto.precio | currency"></td> | 34 | <td ng-bind="producto.precio | currency"></td> |
| 33 | <td> | 35 | <td> |
| 34 | <button | 36 | <button |
| 35 | type="button" | 37 | type="button" |
| 36 | class="btn p-2 float-right" | 38 | class="btn p-2 float-right" |
| 37 | ng-class="{ | 39 | ng-class="{ |
| 38 | 'btn-secondary': selectedProducto != key, | 40 | 'btn-secondary': selectedProducto != key, |
| 39 | 'btn-primary': selectedProducto == key | 41 | 'btn-primary': selectedProducto == key |
| 40 | }" | 42 | }" |
| 41 | ng-click="select(producto)" | ||
| 42 | foca-focus="selectedProducto == {{key}}" | 43 | foca-focus="selectedProducto == {{key}}" |
| 43 | ng-keydown="itemProducto($event.keyCode)" | 44 | ng-keydown="itemProducto($event.keyCode)" |
| 44 | > | 45 | > |
| 45 | <i class="fa fa-arrow-right" aria-hidden="true"></i> | 46 | <i class="fa fa-arrow-right" aria-hidden="true"></i> |
| 46 | </button> | 47 | </button> |
| 47 | </td> | 48 | </td> |
| 48 | </tr> | 49 | </tr> |
| 49 | </tbody> | 50 | </tbody> |
| 50 | </table> | 51 | </table> |
| 51 | <nav> | 52 | <nav> |
| 52 | <ul class="pagination justify-content-end"> | 53 | <ul class="pagination justify-content-end"> |
| 53 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> | 54 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> |
| 54 | <a class="page-link" href="#" ng-click="selectPage(currentPage - 1)"> | 55 | <a class="page-link" href="#" ng-click="selectPage(currentPage - 1)"> |
| 55 | <span aria-hidden="true">«</span> | 56 | <span aria-hidden="true">«</span> |
| 56 | <span class="sr-only">Anterior</span> | 57 | <span class="sr-only">Anterior</span> |
| 57 | </a> | 58 | </a> |
| 58 | </li> | 59 | </li> |
| 59 | <li | 60 | <li |
| 60 | class="page-item" | 61 | class="page-item" |
| 61 | ng-repeat="pagina in paginas" | 62 | ng-repeat="pagina in paginas" |
| 62 | ng-class="{'active': pagina == currentPage}" | 63 | ng-class="{'active': pagina == currentPage}" |
| 63 | > | 64 | > |
| 64 | <a | 65 | <a |
| 65 | class="page-link" | 66 | class="page-link" |
| 66 | href="#" | 67 | href="#" |
| 67 | ng-click="selectPage(pagina)" | 68 | ng-click="selectPage(pagina)" |
| 68 | ng-bind="pagina" | 69 | ng-bind="pagina" |
| 69 | ></a> | 70 | ></a> |
| 70 | </li> | 71 | </li> |
| 71 | <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> | 72 | <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> |
| 72 | <a class="page-link" href="#" ng-click="selectPage(currentPage + 1)"> | 73 | <a class="page-link" href="#" ng-click="selectPage(currentPage + 1)"> |
| 73 | <span aria-hidden="true">»</span> | 74 | <span aria-hidden="true">»</span> |
| 74 | <span class="sr-only">Siguiente</span> | 75 | <span class="sr-only">Siguiente</span> |
| 75 | </a> | 76 | </a> |
| 76 | </li> | 77 | </li> |
| 77 | </ul> | 78 | </ul> |
| 78 | </nav> | 79 | </nav> |
| 79 | </div> | 80 | </div> |
| 80 | </div> | 81 | </div> |
| 81 | <div class="modal-footer"> | 82 | <div class="modal-footer"> |
| 82 | <button class="btn btn-secondary" type="button" ng-click="cancel()">Cancelar</button> | 83 | <button class="btn btn-secondary" type="button" ng-click="cancel()">Cancelar</button> |
| 83 | </div> | 84 | </div> |