Commit 94dc34b5e1c9a9b6d8a63a5f5e48249e747bd718

Authored by Eric Fernandez
1 parent 521305bca4
Exists in master

reemplazo modal vehículo por modal parametrizable

Showing 1 changed file with 8 additions and 15 deletions   Show diff stats
src/js/controller.js
... ... @@ -145,19 +145,13 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo
145 145 };
146 146  
147 147 $scope.seleccionarVehiculo = function(idTransportista) {
148   - var modalInstance = $uibModal.open(
149   - {
150   - ariaLabelledBy: 'Busqueda de Vehiculo',
151   - templateUrl: 'modal-vehiculo.html',
152   - controller: 'focaModalVehiculoController',
153   - size: 'lg',
154   - resolve: {
155   - idTransportista: function() {return idTransportista;}
156   - }
157   - }
158   - );
159   -
160   - modalInstance.result.then(
  148 + var query = '/vehiculo/transportista/' + idTransportista;
  149 + var columnas = {
  150 + nombre: ['Código', 'tractor', 'Semi', 'Capacidad'],
  151 + propiedad: ['codigo', 'tractor', 'semi', 'capacidadTotalCisternas']
  152 + };
  153 + var titulo = 'Búsqueda de vehiculos';
  154 + focaModalService.modal(columnas, query, titulo).then(
161 155 function(vehiculo) {
162 156 var existe = $filter('filter')($scope.vehiculos, {id: vehiculo.id});
163 157 if(existe.length) {
... ... @@ -171,8 +165,7 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo
171 165 $scope.vehiculos.push(vehiculo);
172 166 }, function() {
173 167 // funcion ejecutada cuando se cancela el modal
174   - }
175   - );
  168 + });
176 169 };
177 170  
178 171 function getSeguimiento() {