Commit 512dca211f55ee58e6f25c7ea405eca2055fd674
1 parent
a0042a4f2e
Exists in
master
linea al final
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
src/js/controllerHojaRuta.js
1 | angular.module('focaLogisticaPedidoRuta') | 1 | angular.module('focaLogisticaPedidoRuta') |
2 | .controller('focaModalCrearHojaRuta', [ | 2 | .controller('focaModalCrearHojaRuta', [ |
3 | '$scope', | 3 | '$scope', |
4 | '$uibModalInstance', | 4 | '$uibModalInstance', |
5 | '$uibModal', | 5 | '$uibModal', |
6 | 'focaLogisticaPedidoRutaService', | 6 | 'focaLogisticaPedidoRutaService', |
7 | 'idVehiculo', | 7 | 'idVehiculo', |
8 | 'idsRemitos', | 8 | 'idsRemitos', |
9 | function($scope, $uibModalInstance, $uibModal, focaLogisticaPedidoRutaService, | 9 | function($scope, $uibModalInstance, $uibModal, focaLogisticaPedidoRutaService, |
10 | idVehiculo, idsRemitos) { | 10 | idVehiculo, idsRemitos) { |
11 | $scope.vehiculo = {}; | 11 | $scope.vehiculo = {}; |
12 | $scope.remitos = []; | 12 | $scope.remitos = []; |
13 | focaLogisticaPedidoRutaService.obtenerVehiculoById(idVehiculo).then(function(res) { | 13 | focaLogisticaPedidoRutaService.obtenerVehiculoById(idVehiculo).then(function(res) { |
14 | $scope.vehiculo = res.data; | 14 | $scope.vehiculo = res.data; |
15 | }); | 15 | }); |
16 | for (var i = 0; i < idsRemitos.length; i++) { | 16 | for (var i = 0; i < idsRemitos.length; i++) { |
17 | focaLogisticaPedidoRutaService.obtenerRemitoById(idsRemitos[i]) | 17 | focaLogisticaPedidoRutaService.obtenerRemitoById(idsRemitos[i]) |
18 | .then(cargarRemito); | 18 | .then(cargarRemito); |
19 | } | 19 | } |
20 | function cargarRemito(res) { | 20 | function cargarRemito(res) { |
21 | $scope.remitos.push(res.data); | 21 | $scope.remitos.push(res.data); |
22 | } | 22 | } |
23 | focaLogisticaPedidoRutaService.numeroHojaRuta().then(function(res) { | 23 | focaLogisticaPedidoRutaService.numeroHojaRuta().then(function(res) { |
24 | $scope.sucursal = res.data.sucursal; | 24 | $scope.sucursal = res.data.sucursal; |
25 | $scope.numero = res.data.numeroHojaRuta; | 25 | $scope.numero = res.data.numeroHojaRuta; |
26 | }); | 26 | }); |
27 | $scope.cancelar = function() { | 27 | $scope.cancelar = function() { |
28 | $uibModalInstance.close(); | 28 | $uibModalInstance.close(); |
29 | }; | 29 | }; |
30 | $scope.aceptar = function() { | 30 | $scope.aceptar = function() { |
31 | $uibModalInstance.close(); | 31 | $uibModalInstance.close(); |
32 | }; | 32 | }; |
33 | $scope.seleccionarChofer = function() { | 33 | $scope.seleccionarChofer = function() { |
34 | var modalInstance = $uibModal.open( | 34 | var modalInstance = $uibModal.open( |
35 | { | 35 | { |
36 | ariaLabelledBy: 'Busqueda de Chofer', | 36 | ariaLabelledBy: 'Busqueda de Chofer', |
37 | templateUrl: 'modal-chofer.html', | 37 | templateUrl: 'modal-chofer.html', |
38 | controller: 'focaModalChoferController', | 38 | controller: 'focaModalChoferController', |
39 | size: 'lg' | 39 | size: 'lg' |
40 | } | 40 | } |
41 | ); | 41 | ); |
42 | 42 | ||
43 | modalInstance.result.then( | 43 | modalInstance.result.then( |
44 | function(chofer) { | 44 | function(chofer) { |
45 | $scope.chofer = chofer; | 45 | $scope.chofer = chofer; |
46 | }, function() { | 46 | }, function() { |
47 | // funcion ejecutada cuando se cancela el modal | 47 | // funcion ejecutada cuando se cancela el modal |
48 | } | 48 | } |
49 | ); | 49 | ); |
50 | }; | 50 | }; |
51 | }]); | ||
51 | }]); |