Commit 4f696483ae02ebf3e6cf9c7d56584cb92f65ab48
1 parent
fc40aa4296
Exists in
master
obtengo vehiculos por fecha
Showing
1 changed file
with
11 additions
and
6 deletions
Show diff stats
src/js/controller.js
... | ... | @@ -16,7 +16,7 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo |
16 | 16 | label: 'Fecha Reparto', |
17 | 17 | image: 'abmChofer.png' |
18 | 18 | }; |
19 | - $scope.botonera = [transportista, fecha]; | |
19 | + $scope.botonera = [fecha, transportista]; | |
20 | 20 | var cabecera = ''; |
21 | 21 | $scope.now = new Date(); |
22 | 22 | $scope.idVendedor = 0; |
... | ... | @@ -34,10 +34,7 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo |
34 | 34 | focaBotoneraLateralService.showPausar(false); |
35 | 35 | focaBotoneraLateralService.showGuardar(false); |
36 | 36 | |
37 | - // TODO: obtener vehiculos con remitos cargados para esa fecha que no han sido confirmados | |
38 | - // focaLogisticaPedidoRutaService.getVehiculosByIdUsuario().then(function(res) { | |
39 | - // $scope.vehiculos = res.data; | |
40 | - // }); | |
37 | + | |
41 | 38 | |
42 | 39 | $scope.general = function() { |
43 | 40 | $scope.idVendedor = 0; |
... | ... | @@ -51,7 +48,7 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo |
51 | 48 | |
52 | 49 | $scope.cargar = function(idVehiculo, punto) { |
53 | 50 | if(!$scope.fechaReparto) { |
54 | - focaModalService.alert('elija primero una fecha de reparto'); | |
51 | + focaModalService.alert('Primero seleccione fecha de reparto'); | |
55 | 52 | return; |
56 | 53 | } |
57 | 54 | var idRemito; |
... | ... | @@ -86,6 +83,10 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo |
86 | 83 | }; |
87 | 84 | |
88 | 85 | $scope.hacerHojaRuta = function(vehiculo) { |
86 | + if(!$scope.fechaReparto) { | |
87 | + focaModalService.alert('Primero seleccione fecha de reparto'); | |
88 | + return; | |
89 | + } | |
89 | 90 | var modalInstance = $uibModal.open( |
90 | 91 | { |
91 | 92 | ariaLabelledBy: 'Creación hoja ruta', |
... | ... | @@ -184,6 +185,10 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo |
184 | 185 | valor: fecha.toLocaleDateString() |
185 | 186 | }); |
186 | 187 | $scope.fechaReparto = fecha; |
188 | + focaLogisticaPedidoRutaService.setFechaReparto(fecha); | |
189 | + focaLogisticaPedidoRutaService.getUnidadesByFecha(fecha).then(function(res) { | |
190 | + $scope.vehiculos = res.data; | |
191 | + }); | |
187 | 192 | }); |
188 | 193 | }; |
189 | 194 |