Commit 5df5c2a273eae8937686828c9e40fc3b98ba7aab

Authored by Marcelo Puebla
1 parent 61f6d52a80
Exists in master and in 1 other branch develop

Arreglo en buscador en informe productividad.

src/js/controller-productividad.js
... ... @@ -20,7 +20,10 @@ angular.module('focaModalInforme')
20 20 fechaDesde: new Date(fecha.setMonth(fecha.getMonth() - 1)),
21 21 sector: undefined,
22 22 diferenciarProductos: false,
23   - diferenciarMeses: false
  23 + diferenciarMeses: false,
  24 + entidad:{
  25 + label: ''
  26 + }
24 27 };
25 28 $scope.gridOptions = {
26 29 enableGridMenu: true,
... ... @@ -82,39 +85,42 @@ angular.module('focaModalInforme')
82 85 ]
83 86 };
84 87 $scope.seleccionarTipo = function() {
85   - var data = [
86   - {
87   - id: 0,
88   - label: 'Todos'
89   - },
90   - {
91   - id: 1,
92   - label: 'Vendedores'
93   - },
94   - {
95   - id: 2,
96   - label: 'Cobradores'
97   - },
98   - {
99   - id: 3,
100   - label: 'Transportistas'
101   - }
102   - ];
103   - focaModalService.modal({
104   - titulo: 'Seleccionar entidad',
105   - data: data,
  88 + var parametrosModal = {
  89 + searchText: $scope.params.entidad.label,
106 90 columnas: [
107 91 {
108 92 propiedad: 'label',
109 93 nombre: 'Entidad'
110 94 }
111 95 ],
112   - }).then(function(res) {
  96 + titulo: 'Seleccionar entidad',
  97 + size: 'md',
  98 + data: [
  99 + {
  100 + id: 0,
  101 + label: 'Todos'
  102 + },
  103 + {
  104 + id: 1,
  105 + label: 'Vendedores'
  106 + },
  107 + {
  108 + id: 2,
  109 + label: 'Cobradores'
  110 + },
  111 + {
  112 + id: 3,
  113 + label: 'Transportistas'
  114 + }
  115 + ]
  116 + };
  117 +
  118 + focaModalService.modal(parametrosModal).then(function(res) {
113 119 $scope.params.entidad = res;
114 120 });
115 121 };
116 122 $scope.generarInforme = function() {
117   - if (!$scope.params.entidad) {
  123 + if ($scope.params.entidad.id === undefined) {
118 124 focaModalService.alert('Seleccione una entidad');
119 125 return;
120 126 }
... ... @@ -201,7 +207,8 @@ angular.module('focaModalInforme')
201 207 $uibModalInstance.dismiss('Cancelar');
202 208 };
203 209 $scope.clearEntidad = function() {
204   - $scope.params.entidad = undefined;
  210 + $scope.params.entidad.label = '';
  211 + $scope.params.entidad.id = undefined;
205 212 };
206 213 }
207 214 ]
src/views/informe-productividad.html
... ... @@ -56,8 +56,8 @@
56 56 />
57 57 </div>
58 58 <small class="col-md-2 col-4 text-left my-1">Entidad</small>
59   - <div class="col-md-4 col-8 input-group mb-2">
60   - <input type="text" class="form-control" ng-model="params.entidad.label" readonly>
  59 + <div class="col-md-4 col-8 input-group mb-3">
  60 + <input type="text" class="form-control form-control-sm" ng-model="params.entidad.label">
61 61 <button
62 62 ng-show="params.entidad.label.length >= 1"
63 63 type="button"