Commit 2b165ae044f8adcbf2f26e6933cdf0767ed1e85c
1 parent
2723a81a46
Exists in
master
detalles, fecha en servicio, servicio vehiculos por fecha
Showing
3 changed files
with
26 additions
and
12 deletions
Show diff stats
src/js/service.js
1 | 1 | angular.module('focaLogisticaPedidoRuta') |
2 | - .service( | |
2 | + .factory( | |
3 | 3 | 'focaLogisticaPedidoRutaService', [ |
4 | 4 | '$http', |
5 | 5 | '$cookies', |
... | ... | @@ -45,13 +45,20 @@ angular.module('focaLogisticaPedidoRuta') |
45 | 45 | obtenerRemitosDeCarga: function(remitos) { |
46 | 46 | var remitosRes = []; |
47 | 47 | for(var i = 0; i < remitos.cisternas.length; i++) { |
48 | - procesoCistena(remitos.cisternas[i]); | |
48 | + procesoCistena(remitos.cisternas[i], this.fecha.toISOString()); | |
49 | 49 | } |
50 | - function procesoCistena(cisterna) { | |
51 | - for(var j = 0; j < cisterna.cisternaCarga.cisternaMovimientos.length; | |
52 | - j++) { | |
53 | - procesoMovimiento( | |
54 | - cisterna.cisternaCarga.cisternaMovimientos[j]); | |
50 | + function procesoCistena(cisterna, fecha) { | |
51 | + for(var j = 0; j < cisterna.cisternasCarga.length; j++) { | |
52 | + for (var k = 0; k < cisterna.cisternasCarga[j].cisternaMovimientos | |
53 | + .length; k++) | |
54 | + { | |
55 | + if(cisterna.cisternasCarga[j].fechaReparto.substring(0, 10) === | |
56 | + fecha.substring(0, 10)) | |
57 | + { | |
58 | + procesoMovimiento(cisterna.cisternasCarga[j] | |
59 | + .cisternaMovimientos[k]); | |
60 | + } | |
61 | + } | |
55 | 62 | } |
56 | 63 | } |
57 | 64 | function procesoMovimiento(movimiento) { |
... | ... | @@ -69,9 +76,16 @@ angular.module('focaLogisticaPedidoRuta') |
69 | 76 | getVehiculosByIdUsuario: function() { |
70 | 77 | return $http.get(API_ENDPOINT.URL + '/vehiculo/usuario/' + this.idUsuario); |
71 | 78 | }, |
72 | - obtenerCisternasPorFecha: function(idVehiculo, fecha) { | |
79 | + obtenerCisternasPorFecha: function(idVehiculo) { | |
73 | 80 | return $http.post(API_ENDPOINT.URL + '/cisterna/listar/fecha', |
74 | - {idVehiculo: idVehiculo, fechaReparto: fecha}); | |
81 | + {idVehiculo: idVehiculo, fechaReparto: this.fecha}); | |
82 | + }, | |
83 | + getUnidadesByFecha: function() { | |
84 | + return $http.post(API_ENDPOINT.URL + '/vehiculo/listar/fecha', | |
85 | + {fecha: this.fecha}); | |
86 | + }, | |
87 | + setFechaReparto: function(fechaReparto) { | |
88 | + this.fecha = fechaReparto; | |
75 | 89 | } |
76 | 90 | }; |
77 | 91 | }]); |
src/views/foca-logistica-pedido-ruta.html
... | ... | @@ -137,8 +137,8 @@ |
137 | 137 | src="img/hojaRutaVolante.png" |
138 | 138 | width="100%"> |
139 | 139 | </div> |
140 | - <div class="col-3" | |
141 | - uib-tooltip="Confeccionar hoja de ruta" | |
140 | + <div class="col-3" | |
141 | + uib-tooltip="Confirmar hoja de ruta" | |
142 | 142 | ng-click="hacerHojaRuta(vehiculo)"></div> |
143 | 143 | <div class="col-3"> |
144 | 144 | <i |
src/views/foca-modal-crear-hoja-ruta.html