diff --git a/src/js/controller.js b/src/js/controller.js index 297bd93..a909dde 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -34,9 +34,10 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo focaBotoneraLateralService.showPausar(false); focaBotoneraLateralService.showGuardar(false); - focaLogisticaPedidoRutaService.getVehiculosByIdUsuario().then(function(res) { - $scope.vehiculos = res.data; - }); + // TODO: obtener vehiculos con remitos cargados para esa fecha que no han sido confirmados + // focaLogisticaPedidoRutaService.getVehiculosByIdUsuario().then(function(res) { + // $scope.vehiculos = res.data; + // }); $scope.general = function() { $scope.idVendedor = 0; @@ -49,6 +50,10 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo }; $scope.cargar = function(idVehiculo, punto) { + if(!$scope.fechaReparto) { + focaModalService.alert('elija primero una fecha de reparto'); + return; + } var idRemito; if(punto === -1) { idRemito = -1; @@ -63,7 +68,8 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo size: 'lg', resolve: { idVehiculo: function() {return idVehiculo;}, - idRemito: function() {return idRemito;} + idRemito: function() {return idRemito;}, + fechaReparto: function() {return $scope.fechaReparto;} } } ); @@ -177,6 +183,7 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo label: 'Fecha:', valor: fecha.toLocaleDateString() }); + $scope.fechaReparto = fecha; }); };