Commit 1b698f1371aab2584367b5adbc01e1ab9b8d645c
Exists in
master
and in
1 other branch
Merge branch 'master' into 'master'
buscador en header, paginado en footer, cambio icons, focus no results focus no results: Hace focus en el input de busqueda cuando no encuentra resultados See merge request !1
Showing
3 changed files
Show diff stats
package.json
| 1 | { | 1 | { |
| 2 | "name": "foca-modal-nota-pedido", | 2 | "name": "foca-modal-nota-pedido", |
| 3 | "version": "0.0.1", | 3 | "version": "0.0.1", |
| 4 | "description": "Modal para seleccion de notasPedido", | 4 | "description": "Modal para seleccion de notasPedido", |
| 5 | "scripts": { | 5 | "scripts": { |
| 6 | "test": "echo \"Error: no test specified\" && exit 1", | 6 | "test": "echo \"Error: no test specified\" && exit 1", |
| 7 | "gulp-pre-commit": "gulp pre-commit", | 7 | "gulp-pre-commit": "gulp pre-commit", |
| 8 | "compile": "gulp uglify", | 8 | "compile": "gulp uglify", |
| 9 | "postinstall": "npm run compile && gulp clean-post-install", | 9 | "postinstall": "npm run compile && gulp clean-post-install", |
| 10 | "install-dev": "npm install -D angular angular-ladda ladda@1.0.6 bootstrap font-awesome gulp gulp-angular-templatecache gulp-concat gulp-connect gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-uglify gulp-clean jasmine-core jquery jshint pre-commit pump ui-bootstrap4 && npm i -D git+https://debo.suite.repo/modulos-npm/foca-directivas" | 10 | "install-dev": "npm install -D angular angular-ladda ladda@1.0.6 bootstrap font-awesome gulp gulp-angular-templatecache gulp-concat gulp-connect gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-uglify gulp-clean jasmine-core jquery jshint pre-commit pump ui-bootstrap4 && npm i -D git+ssh://git@git.focasoftware.com:npm/foca-directivas" |
| 11 | }, | 11 | }, |
| 12 | "pre-commit": [ | 12 | "pre-commit": [ |
| 13 | "gulp-pre-commit" | 13 | "gulp-pre-commit" |
| 14 | ], | 14 | ], |
| 15 | "repository": { | 15 | "repository": { |
| 16 | "type": "git", | 16 | "type": "git", |
| 17 | "url": "https://debo.suite.repo/modulos-npm/foca-modal-nota-pedido" | 17 | "url": "https://debo.suite.repo/modulos-npm/foca-modal-nota-pedido" |
| 18 | }, | 18 | }, |
| 19 | "author": "Nicolás Guarnieri", | 19 | "author": "Nicolás Guarnieri", |
| 20 | "license": "ISC", | 20 | "license": "ISC", |
| 21 | "peerDependencies": { | 21 | "peerDependencies": { |
| 22 | "angular": "^1.7.4", | 22 | "angular": "^1.7.4", |
| 23 | "bootstrap": "^4.1.3", | 23 | "bootstrap": "^4.1.3", |
| 24 | "font-awesome": "^4.7.0", | 24 | "font-awesome": "^4.7.0", |
| 25 | "ui-bootstrap4": "^3.0.4", | 25 | "ui-bootstrap4": "^3.0.4", |
| 26 | "gulp": "^3.9.1", | 26 | "gulp": "^3.9.1", |
| 27 | "gulp-angular-templatecache": "^2.2.1", | 27 | "gulp-angular-templatecache": "^2.2.1", |
| 28 | "gulp-concat": "^2.6.1", | 28 | "gulp-concat": "^2.6.1", |
| 29 | "gulp-connect": "^5.6.1", | 29 | "gulp-connect": "^5.6.1", |
| 30 | "gulp-htmlmin": "^5.0.1", | 30 | "gulp-htmlmin": "^5.0.1", |
| 31 | "gulp-rename": "^1.4.0", | 31 | "gulp-rename": "^1.4.0", |
| 32 | "gulp-replace": "^1.0.0", | 32 | "gulp-replace": "^1.0.0", |
| 33 | "gulp-uglify": "^3.0.1", | 33 | "gulp-uglify": "^3.0.1", |
| 34 | "jquery": "^3.3.1", | 34 | "jquery": "^3.3.1", |
| 35 | "pump": "^3.0.0", | 35 | "pump": "^3.0.0", |
| 36 | "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas" | 36 | "foca-directivas": "git+ssh://git@git.focasoftware.com:npm/foca-directivas" |
| 37 | }, | 37 | }, |
| 38 | "devDependencies": { | 38 | "devDependencies": { |
| 39 | "angular": "^1.7.5", | 39 | "angular": "^1.7.5", |
| 40 | "angular-ladda": "^0.4.3", | 40 | "angular-ladda": "^0.4.3", |
| 41 | "bootstrap": "^4.1.3", | 41 | "bootstrap": "^4.1.3", |
| 42 | "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas", | 42 | "foca-directivas": "git+ssh://git@git.focasoftware.com:npm/foca-directivas", |
| 43 | "font-awesome": "^4.7.0", | 43 | "font-awesome": "^4.7.0", |
| 44 | "gulp": "^3.9.1", | 44 | "gulp": "^3.9.1", |
| 45 | "gulp-angular-templatecache": "^2.2.3", | 45 | "gulp-angular-templatecache": "^2.2.3", |
| 46 | "gulp-clean": "^0.4.0", | 46 | "gulp-clean": "^0.4.0", |
| 47 | "gulp-concat": "^2.6.1", | 47 | "gulp-concat": "^2.6.1", |
| 48 | "gulp-connect": "^5.6.1", | 48 | "gulp-connect": "^5.6.1", |
| 49 | "gulp-htmlmin": "^5.0.1", | 49 | "gulp-htmlmin": "^5.0.1", |
| 50 | "gulp-jshint": "^2.1.0", | 50 | "gulp-jshint": "^2.1.0", |
| 51 | "gulp-rename": "^1.4.0", | 51 | "gulp-rename": "^1.4.0", |
| 52 | "gulp-replace": "^1.0.0", | 52 | "gulp-replace": "^1.0.0", |
| 53 | "gulp-uglify": "^3.0.1", | 53 | "gulp-uglify": "^3.0.1", |
| 54 | "jasmine-core": "^3.3.0", | 54 | "jasmine-core": "^3.3.0", |
| 55 | "jquery": "^3.3.1", | 55 | "jquery": "^3.3.1", |
| 56 | "jshint": "^2.9.6", | 56 | "jshint": "^2.9.6", |
| 57 | "ladda": "1.0.6", | 57 | "ladda": "1.0.6", |
| 58 | "pre-commit": "^1.2.2", | 58 | "pre-commit": "^1.2.2", |
| 59 | "pump": "^3.0.0", | 59 | "pump": "^3.0.0", |
| 60 | "ui-bootstrap4": "^3.0.5" | 60 | "ui-bootstrap4": "^3.0.5" |
| 61 | } | 61 | } |
| 62 | } | 62 | } |
| 63 | 63 |
src/js/controller.js
| 1 | angular.module('focaModalNotaPedido') | 1 | angular.module('focaModalNotaPedido') |
| 2 | .controller('focaModalNotaPedidoController', | 2 | .controller('focaModalNotaPedidoController', |
| 3 | [ | 3 | [ |
| 4 | '$timeout', | ||
| 4 | '$filter', | 5 | '$filter', |
| 5 | '$scope', | 6 | '$scope', |
| 6 | '$uibModalInstance', | 7 | '$uibModalInstance', |
| 7 | 'focaModalNotaPedidoService', | 8 | 'focaModalNotaPedidoService', |
| 8 | 'usadoPor', | 9 | 'usadoPor', |
| 9 | function($filter, $scope, $uibModalInstance, | 10 | function($timeout, $filter, $scope, $uibModalInstance, |
| 10 | focaModalNotaPedidoService, usadoPor | 11 | focaModalNotaPedidoService, usadoPor |
| 11 | ) { | 12 | ) { |
| 12 | var fecha = new Date(); | 13 | var fecha = new Date(); |
| 13 | $scope.fechaHasta = new Date(); | 14 | $scope.fechaHasta = new Date(); |
| 14 | $scope.fechaDesde = new Date(fecha.setMonth(fecha.getMonth() - 1)); | 15 | $scope.fechaDesde = new Date(fecha.setMonth(fecha.getMonth() - 1)); |
| 15 | $scope.filters = ''; | 16 | $scope.filters = ''; |
| 16 | $scope.notasPedido = []; | 17 | $scope.notasPedido = []; |
| 17 | $scope.primerBusqueda = false; | 18 | $scope.primerBusqueda = false; |
| 18 | $scope.searchLoading = false; | 19 | $scope.searchLoading = false; |
| 19 | // pagination | 20 | // pagination |
| 20 | $scope.numPerPage = 10; | 21 | $scope.numPerPage = 10; |
| 21 | $scope.currentPage = 1; | 22 | $scope.currentPage = 1; |
| 22 | $scope.filteredNotasPedido = []; | 23 | $scope.filteredNotasPedido = []; |
| 23 | $scope.currentPageNotasPedido = []; | 24 | $scope.currentPageNotasPedido = []; |
| 24 | $scope.selectedNotaPedido = -1; | 25 | $scope.selectedNotaPedido = -1; |
| 25 | 26 | ||
| 26 | //METODOS | 27 | //METODOS |
| 27 | $scope.busquedaPress = function(key) { | 28 | $scope.busquedaPress = function(key) { |
| 28 | if (key === 13) { | 29 | if (key === 13) { |
| 29 | //TODO Validaciones con alertas | 30 | //TODO Validaciones con alertas |
| 30 | if(!$scope.fechaDesde) { | 31 | if(!$scope.fechaDesde) { |
| 31 | alert('INGRESE FECHA DESDE'); | 32 | alert('INGRESE FECHA DESDE'); |
| 32 | return; | 33 | return; |
| 33 | } | 34 | } |
| 34 | if(!$scope.fechaHasta) { | 35 | if(!$scope.fechaHasta) { |
| 35 | alert('INGRESE FECHA HASTA'); | 36 | alert('INGRESE FECHA HASTA'); |
| 36 | return; | 37 | return; |
| 37 | } | 38 | } |
| 38 | if($scope.fechaDesde > $scope.fechaHasta) { | 39 | if($scope.fechaDesde > $scope.fechaHasta) { |
| 39 | alert('La fecha desde no puede ser mayor a la fecha hasta'); | 40 | alert('La fecha desde no puede ser mayor a la fecha hasta'); |
| 40 | return; | 41 | return; |
| 41 | } | 42 | } |
| 42 | $scope.searchLoading = true; | 43 | $scope.searchLoading = true; |
| 43 | //TODO hacer filtro de fecha | 44 | //TODO hacer filtro de fecha |
| 44 | focaModalNotaPedidoService | 45 | focaModalNotaPedidoService |
| 45 | .getNotasPedido(usadoPor, $scope.fechaDesde.toISOString().split('.')[0], | 46 | .getNotasPedido(usadoPor, $scope.fechaDesde.toISOString().split('.')[0], |
| 46 | $scope.fechaHasta.toISOString().split('.')[0]) | 47 | $scope.fechaHasta.toISOString().split('.')[0]) |
| 47 | .then(llenarDatos); | 48 | .then(llenarDatos); |
| 48 | } | 49 | } |
| 49 | }; | 50 | }; |
| 50 | function llenarDatos(res) { | 51 | function llenarDatos(res) { |
| 51 | $scope.notasPedido = []; | 52 | $scope.notasPedido = []; |
| 52 | $scope.filteredNotasPedido = []; | 53 | $scope.filteredNotasPedido = []; |
| 53 | $scope.currentPageNotasPedido = []; | 54 | $scope.currentPageNotasPedido = []; |
| 54 | $scope.selectedNotaPedido = -1; | 55 | $scope.selectedNotaPedido = -1; |
| 55 | $scope.searchLoading = false; | 56 | $scope.searchLoading = false; |
| 56 | $scope.primerBusqueda = true; | 57 | $scope.primerBusqueda = true; |
| 57 | $scope.notasPedido = res.data; | 58 | $scope.notasPedido = res.data; |
| 58 | $scope.search(); | 59 | $scope.search(true); |
| 59 | primera(); | 60 | primera(); |
| 60 | } | 61 | } |
| 61 | $scope.search = function() { | 62 | $scope.search = function(pressed) { |
| 62 | if($scope.notasPedido.length > 0) { | 63 | if($scope.notasPedido.length > 0) { |
| 63 | $scope.filteredNotasPedido = $filter('filter')( | 64 | $scope.filteredNotasPedido = $filter('filter')( |
| 64 | $scope.notasPedido, | 65 | $scope.notasPedido, |
| 65 | {$: $scope.filters} | 66 | {$: $scope.filters} |
| 66 | ); | 67 | ); |
| 67 | 68 | ||
| 68 | $scope.lastPage = Math.ceil( | 69 | $scope.lastPage = Math.ceil( |
| 69 | $scope.filteredNotasPedido.length / $scope.numPerPage | 70 | $scope.filteredNotasPedido.length / $scope.numPerPage |
| 70 | ); | 71 | ); |
| 71 | 72 | ||
| 72 | $scope.resetPage(); | 73 | $scope.resetPage(); |
| 74 | if(pressed && $scope.filteredNotasPedido.length === 0){ | ||
| 75 | $timeout(function() { | ||
| 76 | angular.element('#search')[0].focus(); | ||
| 77 | $scope.filters = ''; | ||
| 78 | }); | ||
| 79 | } | ||
| 73 | } | 80 | } |
| 74 | }; | 81 | }; |
| 75 | 82 | ||
| 76 | $scope.resetPage = function() { | 83 | $scope.resetPage = function() { |
| 77 | $scope.currentPage = 1; | 84 | $scope.currentPage = 1; |
| 78 | $scope.selectPage(1); | 85 | $scope.selectPage(1); |
| 79 | }; | 86 | }; |
| 80 | 87 | ||
| 81 | $scope.selectPage = function(page) { | 88 | $scope.selectPage = function(page) { |
| 82 | var start = (page - 1) * $scope.numPerPage; | 89 | var start = (page - 1) * $scope.numPerPage; |
| 83 | var end = start + $scope.numPerPage; | 90 | var end = start + $scope.numPerPage; |
| 84 | $scope.paginas = []; | 91 | $scope.paginas = []; |
| 85 | $scope.paginas = calcularPages(page); | 92 | $scope.paginas = calcularPages(page); |
| 86 | $scope.currentPageNotasPedido = $scope.filteredNotasPedido.slice(start, end); | 93 | $scope.currentPageNotasPedido = $scope.filteredNotasPedido.slice(start, end); |
| 87 | $scope.currentPage = page; | 94 | $scope.currentPage = page; |
| 88 | }; | 95 | }; |
| 89 | 96 | ||
| 90 | $scope.select = function(notaPedido) { | 97 | $scope.select = function(notaPedido) { |
| 91 | $uibModalInstance.close(notaPedido); | 98 | $uibModalInstance.close(notaPedido); |
| 92 | }; | 99 | }; |
| 93 | 100 | ||
| 94 | $scope.cancel = function() { | 101 | $scope.cancel = function() { |
| 95 | $uibModalInstance.dismiss('cancel'); | 102 | $uibModalInstance.dismiss('cancel'); |
| 96 | }; | 103 | }; |
| 97 | 104 | ||
| 98 | $scope.busquedaDown = function(key) { | 105 | $scope.busquedaDown = function(key) { |
| 99 | if (key === 40) { | 106 | if (key === 40) { |
| 100 | primera(key); | 107 | primera(key); |
| 101 | } | 108 | } |
| 102 | }; | 109 | }; |
| 103 | 110 | ||
| 104 | $scope.itemNotaPedido = function(key) { | 111 | $scope.itemNotaPedido = function(key) { |
| 105 | if (key === 38) { | 112 | if (key === 38) { |
| 106 | anterior(key); | 113 | anterior(key); |
| 107 | } | 114 | } |
| 108 | 115 | ||
| 109 | if (key === 40) { | 116 | if (key === 40) { |
| 110 | siguiente(key); | 117 | siguiente(key); |
| 111 | } | 118 | } |
| 112 | 119 | ||
| 113 | if (key === 37) { | 120 | if (key === 37) { |
| 114 | retrocederPagina(); | 121 | retrocederPagina(); |
| 115 | } | 122 | } |
| 116 | 123 | ||
| 117 | if (key === 39) { | 124 | if (key === 39) { |
| 118 | avanzarPagina(); | 125 | avanzarPagina(); |
| 119 | } | 126 | } |
| 120 | }; | 127 | }; |
| 121 | 128 | ||
| 122 | function calcularPages(paginaActual) { | 129 | function calcularPages(paginaActual) { |
| 123 | var paginas = []; | 130 | var paginas = []; |
| 124 | paginas.push(paginaActual); | 131 | paginas.push(paginaActual); |
| 125 | 132 | ||
| 126 | if (paginaActual - 1 > 1) { | 133 | if (paginaActual - 1 > 1) { |
| 127 | 134 | ||
| 128 | paginas.unshift(paginaActual - 1); | 135 | paginas.unshift(paginaActual - 1); |
| 129 | if (paginaActual - 2 > 1) { | 136 | if (paginaActual - 2 > 1) { |
| 130 | paginas.unshift(paginaActual - 2); | 137 | paginas.unshift(paginaActual - 2); |
| 131 | } | 138 | } |
| 132 | } | 139 | } |
| 133 | 140 | ||
| 134 | if (paginaActual + 1 < $scope.lastPage) { | 141 | if (paginaActual + 1 < $scope.lastPage) { |
| 135 | paginas.push(paginaActual + 1); | 142 | paginas.push(paginaActual + 1); |
| 136 | if (paginaActual + 2 < $scope.lastPage) { | 143 | if (paginaActual + 2 < $scope.lastPage) { |
| 137 | paginas.push(paginaActual + 2); | 144 | paginas.push(paginaActual + 2); |
| 138 | } | 145 | } |
| 139 | } | 146 | } |
| 140 | 147 | ||
| 141 | if (paginaActual !== 1) { | 148 | if (paginaActual !== 1) { |
| 142 | paginas.unshift(1); | 149 | paginas.unshift(1); |
| 143 | } | 150 | } |
| 144 | 151 | ||
| 145 | if (paginaActual !== $scope.lastPage) { | 152 | if (paginaActual !== $scope.lastPage) { |
| 146 | paginas.push($scope.lastPage); | 153 | paginas.push($scope.lastPage); |
| 147 | } | 154 | } |
| 148 | 155 | ||
| 149 | return paginas; | 156 | return paginas; |
| 150 | } | 157 | } |
| 151 | 158 | ||
| 152 | function primera() { | 159 | function primera() { |
| 153 | $scope.selectedNotaPedido = 0; | 160 | $scope.selectedNotaPedido = 0; |
| 154 | } | 161 | } |
| 155 | 162 | ||
| 156 | function anterior() { | 163 | function anterior() { |
| 157 | if ($scope.selectedNotaPedido === 0 && $scope.currentPage > 1) { | 164 | if ($scope.selectedNotaPedido === 0 && $scope.currentPage > 1) { |
| 158 | retrocederPagina(); | 165 | retrocederPagina(); |
| 159 | } else { | 166 | } else { |
| 160 | $scope.selectedNotaPedido--; | 167 | $scope.selectedNotaPedido--; |
| 161 | } | 168 | } |
| 162 | } | 169 | } |
| 163 | 170 | ||
| 164 | function siguiente() { | 171 | function siguiente() { |
| 165 | if ($scope.selectedNotaPedido < $scope.currentPageNotasPedido.length - 1 ) { | 172 | if ($scope.selectedNotaPedido < $scope.currentPageNotasPedido.length - 1 ) { |
| 166 | $scope.selectedNotaPedido++; | 173 | $scope.selectedNotaPedido++; |
| 167 | } else { | 174 | } else { |
| 168 | avanzarPagina(); | 175 | avanzarPagina(); |
| 169 | } | 176 | } |
| 170 | } | 177 | } |
| 171 | 178 | ||
| 172 | function retrocederPagina() { | 179 | function retrocederPagina() { |
| 173 | if ($scope.currentPage > 1) { | 180 | if ($scope.currentPage > 1) { |
| 174 | $scope.selectPage($scope.currentPage - 1); | 181 | $scope.selectPage($scope.currentPage - 1); |
| 175 | $scope.selectedNotaPedido = $scope.numPerPage - 1; | 182 | $scope.selectedNotaPedido = $scope.numPerPage - 1; |
| 176 | } | 183 | } |
| 177 | } | 184 | } |
| 178 | 185 | ||
| 179 | function avanzarPagina() { | 186 | function avanzarPagina() { |
| 180 | if ($scope.currentPage < $scope.lastPage) { | 187 | if ($scope.currentPage < $scope.lastPage) { |
| 181 | $scope.selectPage($scope.currentPage + 1); | 188 | $scope.selectPage($scope.currentPage + 1); |
| 182 | $scope.selectedNotaPedido = 0; | 189 | $scope.selectedNotaPedido = 0; |
| 183 | } | 190 | } |
| 184 | } | 191 | } |
| 185 | } | 192 | } |
| 186 | ] | 193 | ] |
| 187 | ); | 194 | ); |
| 188 | 195 |
src/views/foca-modal-nota-pedido.html
| 1 | <div class="modal-header py-1"> | 1 | <div class="modal-header py-1"> |
| 2 | <h5 class="modal-title">Busqueda de Nota de Pedido</h5> | 2 | <div class="row w-100"> |
| 3 | <div class="col-lg-6"> | ||
| 4 | <h5 class="modal-title my-1">Búsqueda de Nota de Pedido</h5> | ||
| 5 | </div> | ||
| 6 | <div class="input-group col-lg-6 pr-0 my-2"> | ||
| 7 | <input | ||
| 8 | ladda="searchLoading" | ||
| 9 | type="text" | ||
| 10 | class="form-control form-control-sm" | ||
| 11 | id="search" | ||
| 12 | placeholder="Razón social" | ||
| 13 | ng-model="filters" | ||
| 14 | ng-change="search()" | ||
| 15 | ng-keydown="busquedaDown($event.keyCode)" | ||
| 16 | ng-keypress="busquedaPress($event.keyCode)" | ||
| 17 | foca-focus="selectedNotaPedido == -1" | ||
| 18 | ng-focus="selectedNotaPedido = -1" | ||
| 19 | teclado-virtual | ||
| 20 | /> | ||
| 21 | <div class="input-group-append"> | ||
| 22 | <button | ||
| 23 | ladda="searchLoading" | ||
| 24 | class="btn btn-outline-secondary" | ||
| 25 | type="button" | ||
| 26 | ng-click="busquedaPress(13)" | ||
| 27 | > | ||
| 28 | <i class="fa fa-search" aria-hidden="true"></i> | ||
| 29 | </button> | ||
| 30 | </div> | ||
| 31 | </div> | ||
| 32 | </div> | ||
| 3 | </div> | 33 | </div> |
| 4 | <div class="modal-body" id="modal-body"> | 34 | <div class="modal-body" id="modal-body"> |
| 35 | |||
| 5 | <div class="input-group row"> | 36 | <div class="input-group row"> |
| 6 | <small class="col-md-2 col-4 text-left my-1">Fecha Desde</small> | 37 | <small class="col-md-2 col-4 text-left my-1">Fecha Desde</small> |
| 7 | <div class="col-md-4 col-8 input-group mb-2"> | 38 | <div class="col-md-4 col-8 input-group mb-2"> |
| 8 | <div class="input-group-prepend"> | 39 | <div class="input-group-prepend"> |
| 9 | <div class="input-group-text form-control-sm"> | 40 | <div class="input-group-text form-control-sm"> |
| 10 | <i class="fa fa-calendar"></i> | 41 | <i class="fa fa-calendar"></i> |
| 11 | </div> | 42 | </div> |
| 12 | </div> | 43 | </div> |
| 13 | <input | 44 | <input |
| 14 | class="form-control form-control-sm" | 45 | class="form-control form-control-sm" |
| 15 | id="inlineFormInputGroup" | 46 | id="inlineFormInputGroup" |
| 16 | ladda="searchLoading" | 47 | ladda="searchLoading" |
| 17 | type="date" | 48 | type="date" |
| 18 | ng-model="fechaDesde" | 49 | ng-model="fechaDesde" |
| 19 | hasta-hoy | 50 | hasta-hoy |
| 20 | ng-required="true" | 51 | ng-required="true" |
| 21 | /> | 52 | /> |
| 22 | </div> | 53 | </div> |
| 23 | <small class="col-md-2 col-4 text-left my-1">Fecha Hasta</small> | 54 | <small class="col-md-2 col-4 text-left my-1">Fecha Hasta</small> |
| 24 | <div class="col-md-4 col-8 input-group mb-2"> | 55 | <div class="col-md-4 col-8 input-group mb-2"> |
| 25 | <div class="input-group-prepend"> | 56 | <div class="input-group-prepend"> |
| 26 | <div class="input-group-text form-control-sm"> | 57 | <div class="input-group-text form-control-sm"> |
| 27 | <i class="fa fa-calendar"></i> | 58 | <i class="fa fa-calendar"></i> |
| 28 | </div> | 59 | </div> |
| 29 | </div> | 60 | </div> |
| 30 | <input | 61 | <input |
| 31 | class="form-control form-control-sm" | 62 | class="form-control form-control-sm" |
| 32 | id="inlineFormInputGroup" | 63 | id="inlineFormInputGroup" |
| 33 | ladda="searchLoading" | 64 | ladda="searchLoading" |
| 34 | type="date" | 65 | type="date" |
| 35 | ng-model="fechaHasta" | 66 | ng-model="fechaHasta" |
| 36 | ng-required="true" | 67 | ng-required="true" |
| 37 | hasta-hoy | 68 | hasta-hoy |
| 38 | /> | 69 | /> |
| 39 | </div> | 70 | </div> |
| 40 | </div> | 71 | </div> |
| 41 | <div class="input-group"> | ||
| 42 | <input | ||
| 43 | ladda="searchLoading" | ||
| 44 | type="text" | ||
| 45 | class="form-control form-control-sm" | ||
| 46 | placeholder="Busqueda" | ||
| 47 | ng-model="filters" | ||
| 48 | ng-change="search()" | ||
| 49 | ng-keydown="busquedaDown($event.keyCode)" | ||
| 50 | ng-keypress="busquedaPress($event.keyCode)" | ||
| 51 | foca-focus="selectedNotaPedido == -1" | ||
| 52 | ng-focus="selectedNotaPedido = -1" | ||
| 53 | teclado-virtual | ||
| 54 | /> | ||
| 55 | <div class="input-group-append"> | ||
| 56 | <button | ||
| 57 | ladda="searchLoading" | ||
| 58 | class="btn btn-outline-secondary" | ||
| 59 | type="button" | ||
| 60 | ng-click="busquedaPress(13)" | ||
| 61 | > | ||
| 62 | <i class="fa fa-search" aria-hidden="true"></i> | ||
| 63 | </button> | ||
| 64 | </div> | ||
| 65 | </div> | ||
| 66 | <table ng-show="primerBusqueda" class="table table-striped table-sm"> | 72 | <table ng-show="primerBusqueda" class="table table-striped table-sm"> |
| 67 | <thead> | 73 | <thead> |
| 68 | <tr> | 74 | <tr> |
| 69 | <th>Fecha</th> | 75 | <th>Fecha</th> |
| 70 | <th>Cliente</th> | 76 | <th>Cliente</th> |
| 71 | <th>Comprobante</th> | 77 | <th>Comprobante</th> |
| 72 | <th></th> | 78 | <th></th> |
| 73 | </tr> | 79 | </tr> |
| 74 | </thead> | 80 | </thead> |
| 75 | <tbody> | 81 | <tbody> |
| 76 | <tr ng-show="currentPageNotasPedido.length == 0 && primerBusqueda"> | 82 | <tr ng-show="currentPageNotasPedido.length == 0 && primerBusqueda"> |
| 77 | <td colspan="5"> | 83 | <td colspan="5"> |
| 78 | No se encontraron resultados. | 84 | No se encontraron resultados. |
| 79 | </td> | 85 | </td> |
| 80 | </tr> | 86 | </tr> |
| 81 | <tr class="selectable" | 87 | <tr class="selectable" |
| 82 | ng-repeat="(key,notaPedido) in currentPageNotasPedido" | 88 | ng-repeat="(key,notaPedido) in currentPageNotasPedido" |
| 83 | ng-click="select(notaPedido)"> | 89 | ng-click="select(notaPedido)"> |
| 84 | <td ng-bind="notaPedido.fechaCarga | date : 'dd/MM/yyyy'"></td> | 90 | <td ng-bind="notaPedido.fechaCarga | date : 'dd/MM/yyyy'"></td> |
| 85 | <td ng-bind="notaPedido.nombreCliente"></td> | 91 | <td ng-bind="notaPedido.nombreCliente"></td> |
| 86 | <td ng-bind="[notaPedido.sucursal, notaPedido.numeroNotaPedido] | comprobante"></td> | 92 | <td ng-bind="[notaPedido.sucursal, notaPedido.numeroNotaPedido] | comprobante"></td> |
| 87 | <td> | 93 | <td> |
| 88 | <button | 94 | <button |
| 89 | type="button" | 95 | type="button" |
| 90 | class="btn btn-xs p-1 float-right" | 96 | class="btn btn-xs p-1 float-right" |
| 91 | ng-class="{ | 97 | ng-class="{ |
| 92 | 'btn-secondary': selectedNotaPedido != key, | 98 | 'btn-secondary': selectedNotaPedido != key, |
| 93 | 'btn-primary': selectedNotaPedido == key | 99 | 'btn-primary': selectedNotaPedido == key |
| 94 | }" | 100 | }" |
| 95 | foca-focus="selectedNotaPedido == {{key}}" | 101 | foca-focus="selectedNotaPedido == {{key}}" |
| 96 | ng-keydown="itemNotaPedido($event.keyCode)" | 102 | ng-keydown="itemNotaPedido($event.keyCode)" |
| 97 | > | 103 | > |
| 98 | <i class="fa fa-arrow-right" aria-hidden="true"></i> | 104 | <i class="fa fa-circle-thin" aria-hidden="true"></i> |
| 99 | </button> | 105 | </button> |
| 100 | </td> | 106 | </td> |
| 101 | </tr> | 107 | </tr> |
| 102 | </tbody> | 108 | </tbody> |
| 103 | </table> | 109 | </table> |
| 104 | <nav ng-show="currentPageNotasPedido.length > 0 && primerBusqueda"> | 110 | </div> |
| 111 | <div class="modal-footer py-1"> | ||
| 112 | <nav ng-show="currentPageNotasPedido.length > 0 && primerBusqueda" class="mr-auto"> | ||
| 105 | <ul class="pagination pagination-sm justify-content mb-0"> | 113 | <ul class="pagination pagination-sm justify-content mb-0"> |
| 106 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> | 114 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> |
| 107 | <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage - 1)"> | 115 | <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage - 1)"> |
| 108 | <span aria-hidden="true">«</span> | 116 | <span aria-hidden="true">«</span> |
| 109 | <span class="sr-only">Anterior</span> | 117 | <span class="sr-only">Anterior</span> |