diff --git a/src/js/controller-productividad.js b/src/js/controller-productividad.js index 5c8b9bf..b1a7942 100644 --- a/src/js/controller-productividad.js +++ b/src/js/controller-productividad.js @@ -20,7 +20,10 @@ angular.module('focaModalInforme') fechaDesde: new Date(fecha.setMonth(fecha.getMonth() - 1)), sector: undefined, diferenciarProductos: false, - diferenciarMeses: false + diferenciarMeses: false, + entidad:{ + label: '' + } }; $scope.gridOptions = { enableGridMenu: true, @@ -82,39 +85,42 @@ angular.module('focaModalInforme') ] }; $scope.seleccionarTipo = function() { - var data = [ - { - id: 0, - label: 'Todos' - }, - { - id: 1, - label: 'Vendedores' - }, - { - id: 2, - label: 'Cobradores' - }, - { - id: 3, - label: 'Transportistas' - } - ]; - focaModalService.modal({ - titulo: 'Seleccionar entidad', - data: data, + var parametrosModal = { + searchText: $scope.params.entidad.label, columnas: [ { propiedad: 'label', nombre: 'Entidad' } ], - }).then(function(res) { + titulo: 'Seleccionar entidad', + size: 'md', + data: [ + { + id: 0, + label: 'Todos' + }, + { + id: 1, + label: 'Vendedores' + }, + { + id: 2, + label: 'Cobradores' + }, + { + id: 3, + label: 'Transportistas' + } + ] + }; + + focaModalService.modal(parametrosModal).then(function(res) { $scope.params.entidad = res; }); }; $scope.generarInforme = function() { - if (!$scope.params.entidad) { + if ($scope.params.entidad.id === undefined) { focaModalService.alert('Seleccione una entidad'); return; } @@ -201,7 +207,8 @@ angular.module('focaModalInforme') $uibModalInstance.dismiss('Cancelar'); }; $scope.clearEntidad = function() { - $scope.params.entidad = undefined; + $scope.params.entidad.label = ''; + $scope.params.entidad.id = undefined; }; } ] diff --git a/src/views/informe-productividad.html b/src/views/informe-productividad.html index 22c9e04..8da11ca 100644 --- a/src/views/informe-productividad.html +++ b/src/views/informe-productividad.html @@ -56,8 +56,8 @@ /> Entidad -
- +
+