Commit 9f5b7f9dfd9ab94b1608f27df0e7add15189a908
Exists in
master
and in
2 other branches
Merge branch 'master' into 'master'
Master(efernandez) See merge request !7
Showing
2 changed files
Show diff stats
src/js/controller.js
| ... | ... | @@ -49,35 +49,15 @@ angular.module('focaHojaRuta') |
| 49 | 49 | templateUrl: 'modal-detalle-hoja-ruta.html', |
| 50 | 50 | controller: 'focaModalDetalleHojaRutaController', |
| 51 | 51 | resolve: { |
| 52 | - remito : function() {return remito;} | |
| 52 | + idRemito : function() {return remito.id;} | |
| 53 | 53 | }, |
| 54 | 54 | size: 'lg' |
| 55 | 55 | } |
| 56 | 56 | ); |
| 57 | 57 | modalInstance.result.then(function(detalle) { |
| 58 | 58 | console.log(detalle); |
| 59 | - /*Al guardar los datos del producto entregado logueamos la | |
| 60 | - actividad para su seguimiento. | |
| 61 | - | |
| 62 | - hojaRutaService.postMovimientoHojaRuta(detalle).then(function(movimiento) { | |
| 63 | - console.log(detalle) ; | |
| 64 | - }); | |
| 65 | - var promesaSeguimiento = focaSeguimientoService.posicionCallBack(success); | |
| 66 | - function success(posicion) { | |
| 67 | - var nuevaPosicion = { | |
| 68 | - posicion: { | |
| 69 | - latitud: posicion.coords.latitude, | |
| 70 | - longitud: posicion.coords.longitude, | |
| 71 | - idComprobante: detalle.idRemito, | |
| 72 | - actividad: 'Entrega de producto', | |
| 73 | - observaciones: detalle.observaciones | |
| 74 | - } | |
| 75 | - }; | |
| 76 | - focaSeguimientoService.nuevaPosicion(nuevaPosicion).then(successMark); | |
| 77 | - } | |
| 78 | - function successMark(seguimiento) { | |
| 79 | - console.log(seguimiento); | |
| 80 | - }*/ | |
| 59 | + //función a ejecutar cuando se carga la cisterna | |
| 60 | + //eliminar console log en produccion cuando sea necesario | |
| 81 | 61 | }); |
| 82 | 62 | }; |
| 83 | 63 | |
| ... | ... | @@ -110,17 +90,21 @@ angular.module('focaHojaRuta') |
| 110 | 90 | }; |
| 111 | 91 | |
| 112 | 92 | $scope.terminarHojaRuta = function() { |
| 113 | - hojaRutaService.terminarHojaRuta($scope.hojasRuta.id).then( | |
| 114 | - function() { | |
| 115 | - focaModalService.alert( | |
| 116 | - 'Hoja de ruta ' + | |
| 117 | - $filter('comprobante')([$scope.puntoVenta, $scope.comprobante]) + | |
| 118 | - ' cerrada con éxito' | |
| 119 | - ); | |
| 120 | - $location.path('/'); | |
| 121 | - } | |
| 122 | - ); | |
| 93 | + focaModalService | |
| 94 | + .confirm('¿Desea terminar la hoja de ruta? No podra realizar ninguna ' + | |
| 95 | + 'otra descarga ni modificación') | |
| 96 | + .then(terminar); | |
| 97 | + function terminar() { | |
| 98 | + hojaRutaService.terminarHojaRuta($scope.hojasRuta.id).then( | |
| 99 | + function() { | |
| 100 | + focaModalService.alert( | |
| 101 | + 'Hoja de ruta ' + | |
| 102 | + $filter('comprobante')([$scope.puntoVenta, | |
| 103 | + $scope.comprobante]) + ' cerrada con éxito'); | |
| 104 | + $location.path('/'); | |
| 105 | + } | |
| 106 | + ); | |
| 107 | + } | |
| 123 | 108 | }; |
| 124 | 109 | } |
| 125 | 110 | ]); |
| 126 | - |
src/js/service.js
| ... | ... | @@ -5,9 +5,6 @@ angular.module('focaHojaRuta') |
| 5 | 5 | getHojasRuta: function(chofer) { |
| 6 | 6 | return $http.get(route + '/hoja-ruta/chofer/' + chofer); |
| 7 | 7 | }, |
| 8 | - postMovimientoHojaRuta: function(datos) { | |
| 9 | - return $http.post(route + '/hoja-ruta/movimiento', datos); | |
| 10 | - }, | |
| 11 | 8 | terminarHojaRuta: function(hojaRuta) { |
| 12 | 9 | return $http.get(route + '/hoja-ruta/terminar/' + hojaRuta); |
| 13 | 10 | } |