Commit 7d2ea6cb17b3410d1e9d53e1dbecc0bfcc2f58f7
1 parent
915a5e6d50
Exists in
master
and in
1 other branch
fix guardar, rutas nuevas
Showing
3 changed files
with
13 additions
and
2 deletions
Show diff stats
src/js/controller.js
... | ... | @@ -59,6 +59,7 @@ angular.module('focaAbmVehiculo') |
59 | 59 | focaAbmVehiculoService |
60 | 60 | .getTransportistaPorId($routeParams.idTransportista) |
61 | 61 | .then(function(res) { |
62 | + $scope.vehiculo.idTransportista = res.data.COD; | |
62 | 63 | $scope.vehiculo.transportista = res.data; |
63 | 64 | }) |
64 | 65 | } |
... | ... | @@ -83,7 +84,8 @@ angular.module('focaAbmVehiculo') |
83 | 84 | } |
84 | 85 | delete $scope.vehiculo.transportista; |
85 | 86 | focaAbmVehiculoService.guerdarVehiculo($scope.vehiculo).then(function(res) { |
86 | - $location.path('/vehiculo/' + res.data.id); | |
87 | + console.log(res.data); | |
88 | + $location.path('/vehiculo/' + res.data.id + '/' + res.data.idTransportista); | |
87 | 89 | }); |
88 | 90 | }; |
89 | 91 | $scope.solicitarConfirmacionCisterna = function(cisterna) { |
src/js/route.js
... | ... | @@ -20,6 +20,15 @@ angular.module('focaAbmVehiculo') |
20 | 20 | .config([ |
21 | 21 | '$routeProvider', |
22 | 22 | function($routeProvider) { |
23 | + $routeProvider.when('/vehiculo/:idVehiculo', { | |
24 | + controller: 'focaAbmVehiculoController', | |
25 | + templateUrl: 'src/views/foca-abm-vehiculos-item.html' | |
26 | + }); | |
27 | + } | |
28 | + ]) | |
29 | + .config([ | |
30 | + '$routeProvider', | |
31 | + function($routeProvider) { | |
23 | 32 | $routeProvider.when('/vehiculo/:idVehiculo/cisterna/:id', { |
24 | 33 | controller: 'focaAbmVehiculoCisternaController', |
25 | 34 | templateUrl: 'src/views/foca-abm-cisterna-item.html' |
src/js/service.js
... | ... | @@ -17,7 +17,7 @@ angular.module('focaAbmVehiculo') |
17 | 17 | return $http.delete(API_ENDPOINT.URL + '/vehiculo/' + id); |
18 | 18 | }, |
19 | 19 | getCisternadoPorVehiculo: function(idVehiculo) { |
20 | - return $http.get(API_ENDPOINT.URL + '/cisterna/listar/vehiculo/' + idVehiculo); | |
20 | + return $http.get(API_ENDPOINT.URL + '/cisterna/listar/' + idVehiculo); | |
21 | 21 | }, |
22 | 22 | getCisterna: function(id) { |
23 | 23 | return $http.get(API_ENDPOINT.URL + '/cisterna/' + id); |