Commit dadd2b755586191722d1fc7cd299f918d7c2d62d
1 parent
1d2adb367a
Exists in
master
and in
2 other branches
posicion
Showing
2 changed files
with
25 additions
and
28 deletions
Show diff stats
src/js/controller.js
... | ... | @@ -110,37 +110,41 @@ angular.module('focaModalDetalleHojaRuta') |
110 | 110 | |
111 | 111 | var posicion; |
112 | 112 | |
113 | - function getPosition(posicion) { | |
113 | + function getPosition(position) { | |
114 | 114 | |
115 | 115 | posicion = { |
116 | - latitud: posicion.coords.latitude, | |
117 | - longitud: posicion.coords.longitude, | |
116 | + latitud: position.coords.latitude, | |
117 | + longitud: position.coords.longitude, | |
118 | 118 | actividad: 'Entrega de producto', |
119 | 119 | observaciones: $scope.remito.observaciones |
120 | 120 | } |
121 | 121 | } |
122 | 122 | |
123 | + $scope.aDescargar = []; | |
124 | + $scope.remito.observaciones = ''; | |
125 | + $scope.articuloSeleccionado.descargado = true; | |
126 | + | |
127 | + var siguienteArticulo = $scope.remito.articulosRemito.filter( | |
128 | + function(articulo) { | |
129 | + return articulo.id != $scope.articuloSeleccionado.id; | |
130 | + } | |
131 | + ); | |
132 | + | |
133 | + if (siguienteArticulo.length) { | |
134 | + $scope.cambio(siguienteArticulo[0]); | |
135 | + } | |
136 | + | |
137 | + $scope.actualizarPuntoDescarga(); | |
138 | + | |
123 | 139 | focaModalDetalleHojaRutaService |
124 | 140 | .postMovimientoHojaRuta(save) |
125 | - .then(guardarSeguimiento) | |
126 | - .catch(error); | |
141 | + .then(guardarSeguimiento); | |
142 | + | |
143 | + | |
127 | 144 | function guardarSeguimiento(res) { |
128 | 145 | |
129 | 146 | posicion.idComprobante = res.data[0].id; |
130 | - focaModalDetalleHojaRutaService.guardarPosicion(posicion) | |
131 | - | |
132 | - $scope.aDescargar = []; | |
133 | - $scope.remito.observaciones = ''; | |
134 | - $scope.articuloSeleccionado.descargado = true; | |
135 | - var siguienteArticulo = $scope.remito.articulosRemito.filter( | |
136 | - function(articulo) { | |
137 | - return articulo.id != $scope.articuloSeleccionado.id; | |
138 | - } | |
139 | - ); | |
140 | - if(siguienteArticulo.length) { | |
141 | - $scope.cambio(siguienteArticulo[0]); | |
142 | - } | |
143 | - $scope.actualizarPuntoDescarga(); | |
147 | + focaModalDetalleHojaRutaService.guardarPosicion({ posicion: posicion }); | |
144 | 148 | } |
145 | 149 | } |
146 | 150 | }; |
... | ... | @@ -265,11 +269,8 @@ angular.module('focaModalDetalleHojaRuta') |
265 | 269 | } |
266 | 270 | puntoDescarga.latitud = $scope.posicion.latitude; |
267 | 271 | puntoDescarga.longitud = $scope.posicion.longitude; |
268 | - focaModalDetalleHojaRutaService | |
269 | - .guardarPuntoDescarga(puntoDescarga) | |
270 | - .then(function(res) { | |
271 | - $uibModalInstance.close(res.data); | |
272 | - }); | |
272 | + focaModalDetalleHojaRutaService.guardarPuntoDescarga(puntoDescarga); | |
273 | + $uibModalInstance.close(); | |
273 | 274 | }; |
274 | 275 | |
275 | 276 | $scope.guardar = function() { |
src/views/modal-detalle-hoja-ruta.html
... | ... | @@ -45,15 +45,11 @@ |
45 | 45 | <thead> |
46 | 46 | <tr> |
47 | 47 | <th>Nombre</th> |
48 | - <th>Articulo</th> | |
49 | - <th>Cantidad</th> | |
50 | 48 | </tr> |
51 | 49 | </thead> |
52 | 50 | <tbody> |
53 | 51 | <tr ng-repeat="(key, puntoDescarga) in remito.notaPedido.notaPedidoPuntoDescarga"> |
54 | 52 | <td ng-bind="puntoDescarga.puntoDescarga.descripcion"></td> |
55 | - <td ng-bind="puntoDescarga.producto.DetArt"></td> | |
56 | - <td ng-bind="puntoDescarga.cantidad"></td> | |
57 | 53 | </tbody> |
58 | 54 | </table> |
59 | 55 | </div> |