diff --git a/src/js/controller.js b/src/js/controller.js index 80e9039..2973a56 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -469,6 +469,35 @@ angular.module('focaBusquedaCliente') }); } }; + $scope.seleccionarVendedor = function(key) { + if (key === 13) { + var parametrosModal = { + titulo: 'Búsqueda vendedores', + query: '/vendedor', + columnas: [ + { + propiedad: 'NUM', + nombre: 'Código', + filtro: { + nombre: 'rellenarDigitos', + parametro: 3 + } + }, + { + propiedad: 'NOM', + nombre: 'Nombre' + } + ], + size: 'md' + }; + focaModalService.modal(parametrosModal).then( + function(vendedor) { + $scope.vendedor = vendedor; + }, function() { + // funcion ejecutada cuando se cancela el modal + }); + } + }; $scope.pasarCampoCuit = function(numeroCuit) { if (numeroCuit === 1 && $scope.cliente.cuit1.length === 2) { diff --git a/src/views/foca-busqueda-cliente-modal.html b/src/views/foca-busqueda-cliente-modal.html index de122fa..8a69f89 100644 --- a/src/views/foca-busqueda-cliente-modal.html +++ b/src/views/foca-busqueda-cliente-modal.html @@ -352,8 +352,30 @@ type="text" class="form-control form-control-sm" ng-model="vendedor.NOM" - disabled="true" + ng-keypress="seleccionarVendedor($event.keyCode)" + placeholder="Seleccione vendedor" + ng-focus="focus(9)" + foca-focus="focused == 9" + teclado-virtual /> + +
+ +
@@ -389,7 +411,7 @@
-
+