Commit e1f45452b5ea561ee55ff1391ab034ce8f633a3f
1 parent
76b43cb972
Exists in
master
and in
1 other branch
Cambio input de vendedor por un buscador de vendedores.
Showing
2 changed files
with
53 additions
and
2 deletions
Show diff stats
src/js/controller.js
| ... | ... | @@ -469,6 +469,35 @@ angular.module('focaBusquedaCliente') |
| 469 | 469 | }); |
| 470 | 470 | } |
| 471 | 471 | }; |
| 472 | + $scope.seleccionarVendedor = function(key) { | |
| 473 | + if (key === 13) { | |
| 474 | + var parametrosModal = { | |
| 475 | + titulo: 'Búsqueda vendedores', | |
| 476 | + query: '/vendedor', | |
| 477 | + columnas: [ | |
| 478 | + { | |
| 479 | + propiedad: 'NUM', | |
| 480 | + nombre: 'Código', | |
| 481 | + filtro: { | |
| 482 | + nombre: 'rellenarDigitos', | |
| 483 | + parametro: 3 | |
| 484 | + } | |
| 485 | + }, | |
| 486 | + { | |
| 487 | + propiedad: 'NOM', | |
| 488 | + nombre: 'Nombre' | |
| 489 | + } | |
| 490 | + ], | |
| 491 | + size: 'md' | |
| 492 | + }; | |
| 493 | + focaModalService.modal(parametrosModal).then( | |
| 494 | + function(vendedor) { | |
| 495 | + $scope.vendedor = vendedor; | |
| 496 | + }, function() { | |
| 497 | + // funcion ejecutada cuando se cancela el modal | |
| 498 | + }); | |
| 499 | + } | |
| 500 | + }; | |
| 472 | 501 | |
| 473 | 502 | $scope.pasarCampoCuit = function(numeroCuit) { |
| 474 | 503 | if (numeroCuit === 1 && $scope.cliente.cuit1.length === 2) { |
src/views/foca-busqueda-cliente-modal.html
| ... | ... | @@ -352,8 +352,30 @@ |
| 352 | 352 | type="text" |
| 353 | 353 | class="form-control form-control-sm" |
| 354 | 354 | ng-model="vendedor.NOM" |
| 355 | - disabled="true" | |
| 355 | + ng-keypress="seleccionarVendedor($event.keyCode)" | |
| 356 | + placeholder="Seleccione vendedor" | |
| 357 | + ng-focus="focus(9)" | |
| 358 | + foca-focus="focused == 9" | |
| 359 | + teclado-virtual | |
| 356 | 360 | /> |
| 361 | + <button | |
| 362 | + ng-show="vendedor.NOM.length >= 1" | |
| 363 | + type="button" | |
| 364 | + class="clear-input" | |
| 365 | + ng-click="vendedor.NOM = ''" | |
| 366 | + > | |
| 367 | + <i class="fa fa-times"></i> | |
| 368 | + </button> | |
| 369 | + <div class="input-group-append"> | |
| 370 | + <button | |
| 371 | + ladda="searchLoading" | |
| 372 | + class="btn btn-outline-secondary" | |
| 373 | + type="button" | |
| 374 | + ng-click="seleccionarVendedor(13)" | |
| 375 | + > | |
| 376 | + <i class="fa fa-search" aria-hidden="true"></i> | |
| 377 | + </button> | |
| 378 | + </div> | |
| 357 | 379 | </div> |
| 358 | 380 | </div> |
| 359 | 381 | <div class="col-md-6 col-12 mt-2"> |
| ... | ... | @@ -389,7 +411,7 @@ |
| 389 | 411 | </div> |
| 390 | 412 | </div> |
| 391 | 413 | <div class="row"> |
| 392 | - <div class="col-6 d-flex mt-3"> | |
| 414 | + <div class="col-6 d-flex mt-"> | |
| 393 | 415 | <div class="custom-control custom-checkbox mt-auto"> |
| 394 | 416 | <input |
| 395 | 417 | type="checkbox" |