Commit 37b88002248cd9edd6bc8c37dcc8966d45dc24b6
1 parent
8f4135a078
Exists in
master
and in
2 other branches
correcciones ajustes #7
Showing
2 changed files
with
66 additions
and
39 deletions
Show diff stats
src/js/controller.js
| ... | ... | @@ -138,6 +138,7 @@ angular.module('focaAbmVendedorCobrador') |
| 138 | 138 | $timeout, $uibModal, $location, focaModalService) { |
| 139 | 139 | |
| 140 | 140 | $scope.now = new Date(); |
| 141 | + $scope.focused = 0; | |
| 141 | 142 | $scope.vendedorCobrador = { |
| 142 | 143 | CodVen: 0, |
| 143 | 144 | ES_COBRADOR: false, |
| ... | ... | @@ -151,18 +152,30 @@ angular.module('focaAbmVendedorCobrador') |
| 151 | 152 | NOMBRE: '' |
| 152 | 153 | } |
| 153 | 154 | }; |
| 155 | + $scope.options = [ | |
| 156 | + { | |
| 157 | + label: 'Vendedor', | |
| 158 | + value: null | |
| 159 | + }, | |
| 160 | + { | |
| 161 | + label: 'Cobrador', | |
| 162 | + value: true | |
| 163 | + } | |
| 164 | + ]; | |
| 154 | 165 | //SETEO BOTONERA LATERAL |
| 155 | 166 | $timeout(function() { |
| 156 | 167 | focaBotoneraLateralService.showSalir(false); |
| 157 | 168 | focaBotoneraLateralService.showPausar(true); |
| 158 | - focaBotoneraLateralService.showCancelar(true); | |
| 169 | + focaBotoneraLateralService.showCancelar(false); | |
| 159 | 170 | focaBotoneraLateralService.showGuardar(true, $scope.guardar); |
| 171 | + focaBotoneraLateralService.addCustomButton('Salir', $scope.cancelar); | |
| 160 | 172 | }); |
| 161 | 173 | |
| 162 | 174 | focaAbmVendedorCobradorService |
| 163 | 175 | .getVendedorCobradorById($routeParams.id) |
| 164 | 176 | .then(function(res) { |
| 165 | 177 | if(res.data){ |
| 178 | + console.log(res.data); | |
| 166 | 179 | $scope.vendedorCobrador = res.data; |
| 167 | 180 | delete $scope.vendedorCobrador.FCVEN; |
| 168 | 181 | delete $scope.vendedorCobrador.FEC; |
| ... | ... | @@ -236,10 +249,21 @@ angular.module('focaAbmVendedorCobrador') |
| 236 | 249 | ); |
| 237 | 250 | modalInstance.result.then(function(localidad) { |
| 238 | 251 | $scope.vendedorCobrador.localidad = localidad; |
| 252 | + $timeout(function() { | |
| 253 | + $scope.focused = 6; | |
| 254 | + }); | |
| 239 | 255 | }, function() { |
| 240 | 256 | //TODO: función llamada cuando cancela el modal |
| 241 | 257 | }); |
| 242 | 258 | } |
| 243 | 259 | }; |
| 260 | + | |
| 261 | + $scope.cancelar = function() { | |
| 262 | + $location.path('/vendedor-cobrador'); | |
| 263 | + }; | |
| 264 | + | |
| 265 | + $scope.next = function(key) { | |
| 266 | + if(key === 13) $scope.focused++; | |
| 267 | + }; | |
| 244 | 268 | } |
| 245 | 269 | ]); |
src/views/foca-abm-vendedor-cobrador-item.html
| ... | ... | @@ -9,17 +9,18 @@ |
| 9 | 9 | <div class="col-12 col-md-10 p-0 mt-4 border border-white rounded"> |
| 10 | 10 | <form name="formVendedorCobrador" class="px-3" autocomplete="off"> |
| 11 | 11 | <div class="row mt-3"> |
| 12 | - <div class="form-group d-flex mb-2 col-md-6"> | |
| 13 | - <label class="col-form-label col-md-4">Código</label> | |
| 14 | - <div class="input-group col-md-8 pl-0"> | |
| 15 | - <input | |
| 16 | - class="form-control form-control-sm" | |
| 17 | - type="text" | |
| 18 | - ng-value="vendedorCobrador.CodVen | rellenarDigitos: 4: 0" | |
| 19 | - readonly | |
| 20 | - /> | |
| 21 | - </div> | |
| 12 | + <div class="form-group d-flex mb-2 col-md-6"> | |
| 13 | + <label class="col-form-label col-md-4">Tipo</label> | |
| 14 | + <div class="col-md-8 pl-0"> | |
| 15 | + <select | |
| 16 | + class="form-control form-control-sm" | |
| 17 | + ng-model="vendedorCobrador.ES_COBRADOR" | |
| 18 | + ng-options="option.value as option.label for option in options" | |
| 19 | + foca-focus="focused == 0" | |
| 20 | + ng-focus="focused = 0"> | |
| 21 | + </select> | |
| 22 | 22 | </div> |
| 23 | + </div> | |
| 23 | 24 | <div class="form-group d-flex mb-2 col-md-6"> |
| 24 | 25 | <label class="col-form-label col-md-4">Nombre</label> |
| 25 | 26 | <div class="input-group col-md-8 pl-0"> |
| ... | ... | @@ -28,9 +29,11 @@ |
| 28 | 29 | type="text" |
| 29 | 30 | teclado-virtual |
| 30 | 31 | ng-model="vendedorCobrador.NomVen" |
| 31 | - ng-focus="focused = 3" | |
| 32 | + foca-focus="focused == 1" | |
| 33 | + ng-focus="focused = 1" | |
| 32 | 34 | ng-keypress="next($event.keyCode)" |
| 33 | 35 | autocomplete="off" |
| 36 | + uppercase-only | |
| 34 | 37 | /> |
| 35 | 38 | </div> |
| 36 | 39 | </div> |
| ... | ... | @@ -43,9 +46,11 @@ |
| 43 | 46 | teclado-virtual |
| 44 | 47 | ng-model="vendedorCobrador.DomVen" |
| 45 | 48 | ng-required="true" |
| 46 | - ng-focus="focused = 1" | |
| 49 | + foca-focus="focused == 2" | |
| 50 | + ng-focus="focused = 2" | |
| 47 | 51 | ng-keypress="next($event.keyCode)" |
| 48 | 52 | autocomplete="off" |
| 53 | + uppercase-only | |
| 49 | 54 | /> |
| 50 | 55 | </div> |
| 51 | 56 | </div> |
| ... | ... | @@ -54,13 +59,15 @@ |
| 54 | 59 | <div class="input-group col-md-8 pl-0"> |
| 55 | 60 | <input |
| 56 | 61 | class="form-control form-control-sm" |
| 57 | - type="text" | |
| 62 | + type="number" | |
| 58 | 63 | teclado-virtual |
| 59 | 64 | ng-model="vendedorCobrador.CPoVen" |
| 60 | 65 | ng-required="true" |
| 61 | - ng-focus="focused = 1" | |
| 66 | + foca-focus="focused == 3" | |
| 67 | + ng-focus="focused = 3" | |
| 62 | 68 | ng-keypress="next($event.keyCode)" |
| 63 | 69 | autocomplete="off" |
| 70 | + string-to-number | |
| 64 | 71 | /> |
| 65 | 72 | </div> |
| 66 | 73 | </div> |
| ... | ... | @@ -73,8 +80,8 @@ |
| 73 | 80 | ng-model="vendedorCobrador.provincia.NOMBRE" |
| 74 | 81 | ng-keypress="seleccionarProvincia($event.keyCode)" |
| 75 | 82 | ng-required="true" |
| 76 | - ng-focus="focus(8)" | |
| 77 | - foca-focus="focused == 8" | |
| 83 | + foca-focus="focused == 4" | |
| 84 | + ng-focus="focused = 4" | |
| 78 | 85 | teclado-virtual |
| 79 | 86 | /> |
| 80 | 87 | <div class="input-group-append"> |
| ... | ... | @@ -98,8 +105,8 @@ |
| 98 | 105 | ng-model="vendedorCobrador.localidad.NOMBRE" |
| 99 | 106 | ng-keypress="seleccionarLocalidad($event.keyCode)" |
| 100 | 107 | ng-required="true" |
| 101 | - ng-focus="focus(8)" | |
| 102 | - foca-focus="focused == 8" | |
| 108 | + foca-focus="focused == 5" | |
| 109 | + ng-focus="focused = 5" | |
| 103 | 110 | teclado-virtual |
| 104 | 111 | autocomplete="off" |
| 105 | 112 | /> |
| ... | ... | @@ -120,13 +127,15 @@ |
| 120 | 127 | <div class="input-group col-md-8 pl-0"> |
| 121 | 128 | <input |
| 122 | 129 | class="form-control form-control-sm" |
| 123 | - type="text" | |
| 130 | + type="number" | |
| 124 | 131 | teclado-virtual |
| 125 | 132 | ng-model="vendedorCobrador.TelVen" |
| 126 | 133 | ng-required="true" |
| 127 | - ng-focus="focused = 1" | |
| 134 | + foca-focus="focused == 6" | |
| 135 | + ng-focus="focused = 6" | |
| 128 | 136 | ng-keypress="next($event.keyCode)" |
| 129 | 137 | autocomplete="off" |
| 138 | + string-to-number | |
| 130 | 139 | /> |
| 131 | 140 | </div> |
| 132 | 141 | </div> |
| ... | ... | @@ -135,13 +144,15 @@ |
| 135 | 144 | <div class="input-group col-md-8 pl-0"> |
| 136 | 145 | <input |
| 137 | 146 | class="form-control form-control-sm" |
| 138 | - type="text" | |
| 147 | + type="number" | |
| 139 | 148 | teclado-virtual |
| 140 | 149 | ng-model="vendedorCobrador.DNI" |
| 141 | 150 | ng-required="true" |
| 142 | - ng-focus="focused = 1" | |
| 151 | + foca-focus="focused == 7" | |
| 152 | + ng-focus="focused = 7" | |
| 143 | 153 | ng-keypress="next($event.keyCode)" |
| 144 | 154 | autocomplete="off" |
| 155 | + string-to-number | |
| 145 | 156 | /> |
| 146 | 157 | </div> |
| 147 | 158 | </div> |
| ... | ... | @@ -154,7 +165,8 @@ |
| 154 | 165 | teclado-virtual |
| 155 | 166 | ng-model="vendedorCobrador.ClaVen" |
| 156 | 167 | ng-required="true" |
| 157 | - ng-focus="focused = 4" | |
| 168 | + foca-focus="focused == 8" | |
| 169 | + ng-focus="focused = 8" | |
| 158 | 170 | ng-keypress="next($event.keyCode)" |
| 159 | 171 | autocomplete="off" |
| 160 | 172 | /> |
| ... | ... | @@ -169,7 +181,8 @@ |
| 169 | 181 | teclado-virtual |
| 170 | 182 | ng-model="vendedorCobrador.ClaVen2" |
| 171 | 183 | ng-required="true" |
| 172 | - ng-focus="focused = 2" | |
| 184 | + foca-focus="focused == 9" | |
| 185 | + ng-focus="focused = 9" | |
| 173 | 186 | ng-keypress="next($event.keyCode)" |
| 174 | 187 | autocomplete="off" |
| 175 | 188 | /> |
| ... | ... | @@ -180,28 +193,18 @@ |
| 180 | 193 | <div class="input-group col-md-8 pl-0"> |
| 181 | 194 | <input |
| 182 | 195 | class="form-control form-control-sm" |
| 183 | - type="text" | |
| 196 | + type="number" | |
| 184 | 197 | teclado-virtual |
| 185 | 198 | ng-model="vendedorCobrador.ComVen" |
| 186 | 199 | ng-required="true" |
| 187 | - ng-focus="focused = 2" | |
| 200 | + foca-focus="focused == 10" | |
| 201 | + ng-focus="focused = 10" | |
| 188 | 202 | ng-keypress="next($event.keyCode)" |
| 189 | 203 | autocomplete="off" |
| 204 | + string-to-number | |
| 190 | 205 | /> |
| 191 | 206 | </div> |
| 192 | 207 | </div> |
| 193 | - <div class="form-group d-flex mb-2 col-md-6"> | |
| 194 | - <div class="custom-control custom-checkbox ml-auto"> | |
| 195 | - <input | |
| 196 | - type="checkbox" | |
| 197 | - class="custom-control-input" | |
| 198 | - id="checkCobrador" | |
| 199 | - ng-model="vendedorCobrador.ES_COBRADOR"> | |
| 200 | - <label | |
| 201 | - class="custom-control-label" | |
| 202 | - for="checkCobrador">¿Es cobrador?</label> | |
| 203 | - </div> | |
| 204 | - </div> | |
| 205 | 208 | </div> |
| 206 | 209 | </form> |
| 207 | 210 | </div> |