Commit e9d59a290007f83a57079f059cb525a4bc48bad5
Exists in
master
Merge remote-tracking branch 'upstream/master'
Showing
8 changed files
Show diff stats
gulpfile.js
src/js/app.js
src/js/controller.js
... | ... | @@ -146,18 +146,21 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo |
146 | 146 | } |
147 | 147 | ); |
148 | 148 | modalInstance.result.then(function(transportista) { |
149 | - $scope.selectVehiculo(transportista.COD); | |
149 | + $scope.selectVehiculo(transportista.COD, transportista.NOM); | |
150 | 150 | }); |
151 | 151 | }; |
152 | 152 | |
153 | - $scope.selectVehiculo = function(idTransportista) { | |
154 | - var query = '/vehiculo/transportista/' + idTransportista; | |
155 | - var columnas = { | |
156 | - nombre: ['Código', 'tractor', 'Semi', 'Capacidad'], | |
157 | - propiedad: ['codigo', 'tractor', 'semi', 'capacidadTotalCisternas'] | |
153 | + $scope.selectVehiculo = function(idTransportista, nombreTransportista) { | |
154 | + var parametrosModal = { | |
155 | + columnas: { | |
156 | + nombre: ['Código', 'tractor', 'Semi', 'Capacidad'], | |
157 | + propiedad: ['codigo', 'tractor', 'semi', 'capacidadTotalCisternas'] | |
158 | + }, | |
159 | + query: '/vehiculo/transportista/' + idTransportista, | |
160 | + titulo: 'Búsqueda de vehiculos', | |
161 | + subTitulo: idTransportista + '-' + nombreTransportista | |
158 | 162 | }; |
159 | - var titulo = 'Búsqueda de vehiculos'; | |
160 | - focaModalService.modal(columnas, query, titulo).then( | |
163 | + focaModalService.modal(parametrosModal).then( | |
161 | 164 | function(vehiculo) { |
162 | 165 | var existe = $filter('filter')($scope.vehiculos, {id: vehiculo.id}); |
163 | 166 | if(existe.length) { |
... | ... | @@ -224,8 +227,8 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo |
224 | 227 | } |
225 | 228 | |
226 | 229 | function eliminarVehiculo(vehiculo) { |
227 | - focaLogisticaPedidoRutaService.getRemitos(vehiculo.id).then(function(res) { | |
228 | - if(!focaLogisticaPedidoRutaService.obtenerRemitosDeCarga(res.data).length) { | |
230 | + focaLogisticaPedidoRutaService.getRemitosByIdVehiculo(vehiculo.id).then(function(res) { | |
231 | + if(!res.data.length) { | |
229 | 232 | $scope.vehiculos.splice($scope.vehiculos.indexOf(vehiculo), 1); |
230 | 233 | }else { |
231 | 234 | focaModalService.alert('No ha sido posible eliminar el vehiculo porque ' + |
... | ... | @@ -260,9 +263,8 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo |
260 | 263 | } |
261 | 264 | return false; |
262 | 265 | } |
263 | - // TODO: descomentar en produccion | |
264 | - // $interval(function() { | |
265 | - // getSeguimiento(); | |
266 | - // }, 5000); | |
266 | + $interval(function() { | |
267 | + getSeguimiento(); | |
268 | + }, 5000); | |
267 | 269 | } |
268 | 270 | ]); |
src/js/controllerCerrarVehiculo.js
... | ... | @@ -16,9 +16,10 @@ angular.module('focaLogisticaPedidoRuta') |
16 | 16 | focaLogisticaPedidoRutaService.obtenerVehiculoById(idVehiculo).then(function(res) { |
17 | 17 | $scope.vehiculo = res.data; |
18 | 18 | }); |
19 | - focaLogisticaPedidoRutaService.getRemitos(idVehiculo).then(function(res) { | |
20 | - $scope.remitos = focaLogisticaPedidoRutaService.obtenerRemitosDeCarga(res.data); | |
21 | - }); | |
19 | + focaLogisticaPedidoRutaService.getRemitosByIdVehiculo(idVehiculo, 1, 1).then( | |
20 | + function(res) { | |
21 | + $scope.remitos = res.data; | |
22 | + }); | |
22 | 23 | focaLogisticaPedidoRutaService.numeroHojaRuta().then(function(res) { |
23 | 24 | $scope.sucursal = res.data.sucursal; |
24 | 25 | $scope.numero = res.data.numeroHojaRuta; |
src/js/osm-directive.js
... | ... | @@ -43,12 +43,20 @@ angular.module('focaLogisticaPedidoRuta').directive('focaLogistica', function() |
43 | 43 | observacion += '<br/>Distancia a casa central: ' + |
44 | 44 | marcador.distancia + 'km'; |
45 | 45 | } |
46 | - observacion += '<br/>'; | |
47 | - observacion += '<i class="fa fa-map-marker fa-3x" aria-hidden="true"'+ | |
48 | - 'class="form-control" ondragend="dropEnd()" ondragstart=\'drag(event, '+ | |
49 | - JSON.stringify(marcador)+')\' draggable="true"></i>(Arrastrar icono)'; | |
50 | 46 | var icon; |
51 | 47 | if(marcador.notaPedido.remito.idUsuarioProceso) { |
48 | + observacion += '<br/>'; | |
49 | + observacion += '<strong>'; | |
50 | + observacion += 'Fecha de entrega: ' + marcador.notaPedido.remito | |
51 | + .cisternaMovimientos[0].cisternaCarga.fechaReparto.substring(0, 10); | |
52 | + observacion += '<br/>'; | |
53 | + observacion += 'Vehículo: ' + marcador.notaPedido.remito | |
54 | + .cisternaMovimientos[0].cisternaCarga.cisterna.vehiculo.tractor; | |
55 | + observacion += '<br/>'; | |
56 | + observacion += 'Transportista: ' + marcador.notaPedido.remito | |
57 | + .cisternaMovimientos[0].cisternaCarga.cisterna.vehiculo.transportista | |
58 | + .NOM; | |
59 | + observacion += '</strong>'; | |
52 | 60 | //Asignado ROJO |
53 | 61 | icon = new L.Icon({ |
54 | 62 | iconUrl: 'img/marker-icon-2x-red.png', |
... | ... | @@ -59,6 +67,11 @@ angular.module('focaLogisticaPedidoRuta').directive('focaLogistica', function() |
59 | 67 | shadowSize: [41, 41] |
60 | 68 | }); |
61 | 69 | }else { |
70 | + observacion += '<br/>'; | |
71 | + observacion += '<i class="fa fa-map-marker fa-3x" aria-hidden="true"'+ | |
72 | + 'class="form-control" ondragend="dropEnd()" ondragstart=\'drag(event, '+ | |
73 | + JSON.stringify(marcador)+')\' draggable="true"></i>(Arrastrar icono)'; | |
74 | + | |
62 | 75 | //Sin asignar VERDE |
63 | 76 | icon = new L.Icon({ |
64 | 77 | iconUrl: 'img/marker-icon-2x-green.png', |
... | ... | @@ -71,10 +84,10 @@ angular.module('focaLogisticaPedidoRuta').directive('focaLogistica', function() |
71 | 84 | } |
72 | 85 | $scope.markers.push( |
73 | 86 | L.marker( |
74 | - [marcador.latitud, marcador.longitud], | |
75 | - {icon: icon, draggable: true}) | |
87 | + [marcador.latitud, marcador.longitud], {icon: icon}) | |
76 | 88 | .addTo($scope.map) |
77 | 89 | .bindPopup(observacion) |
90 | + .bindTooltip('Haga click para seleccionar') | |
78 | 91 | ); |
79 | 92 | //abre marcador del primer punto |
80 | 93 | //$scope.markers[0].openPopup(); |
src/js/service.js
... | ... | @@ -33,36 +33,11 @@ angular.module('focaLogisticaPedidoRuta') |
33 | 33 | vehiculoSinRemitos: sinRemitos |
34 | 34 | }); |
35 | 35 | }, |
36 | - obtenerRemitosDeCarga: function(remitos) { | |
37 | - var remitosRes = []; | |
38 | - for(var i = 0; i < remitos.cisternas.length; i++) { | |
39 | - procesoCistena(remitos.cisternas[i], this.fecha.toISOString()); | |
40 | - } | |
41 | - function procesoCistena(cisterna, fecha) { | |
42 | - for(var j = 0; j < cisterna.cisternasCarga.length; j++) { | |
43 | - for(var k = 0; k < cisterna.cisternasCarga[j].cisternaMovimientos | |
44 | - .length; k++) | |
45 | - { | |
46 | - if(cisterna.cisternasCarga[j].fechaReparto.substring(0, 10) === | |
47 | - fecha.substring(0, 10)) | |
48 | - { | |
49 | - procesoMovimiento(cisterna.cisternasCarga[j] | |
50 | - .cisternaMovimientos[k]); | |
51 | - } | |
52 | - } | |
53 | - } | |
54 | - } | |
55 | - function procesoMovimiento(movimiento) { | |
56 | - if(!movimiento.anulado && movimiento.remito && | |
57 | - !movimiento.remito.idHojaRuta) { | |
58 | - var remito = movimiento.remito; | |
59 | - var yaEstaCargado = $filter('filter')(remitosRes, {id: remito.id}); | |
60 | - if(!yaEstaCargado.length && movimiento.metodo === 'carga') { | |
61 | - remitosRes.push(remito); | |
62 | - } | |
63 | - } | |
64 | - } | |
65 | - return remitosRes; | |
36 | + getRemitosByIdVehiculo: function(idVehiculo, sinConfirmar, sinHojaRuta) { | |
37 | + var sinHoja = sinHojaRuta ? '/sinHojaRuta' : ''; | |
38 | + return $http.get(url + '/vehiculo/obtener/remitos/' + | |
39 | + idVehiculo + '/' + this.fecha.toISOString().substring(0, 10) + | |
40 | + '/' + sinConfirmar + sinHoja); | |
66 | 41 | }, |
67 | 42 | getVehiculosByIdUsuario: function() { |
68 | 43 | return $http.get(url + '/vehiculo/usuario/' + this.idUsuario); |
src/views/foca-logistica-pedido-ruta.html
... | ... | @@ -83,14 +83,14 @@ |
83 | 83 | <div class="row px-5"> |
84 | 84 | <div class="col-10"> |
85 | 85 | <foca-logistica |
86 | - latitud="-32.89214159952345" | |
87 | - longitud="-68.84572999101856" | |
88 | - zoom="14" | |
86 | + latitud="-34.7152975" | |
87 | + longitud="-65.9053867" | |
88 | + zoom="5" | |
89 | 89 | marcadores="marcadores" |
90 | 90 | parametros= "datosBuscados" |
91 | 91 | /> |
92 | 92 | </div> |
93 | - <div class="row"> | |
93 | + <div class="row"> | |
94 | 94 | <div |
95 | 95 | class="container col-auto" |
96 | 96 | ng-repeat="vehiculo in vehiculos" |
... | ... | @@ -105,7 +105,18 @@ |
105 | 105 | <span class="progress-right"> |
106 | 106 | <span class="progress-bar"></span> |
107 | 107 | </span> |
108 | - <div class="progress-value">{{vehiculo.codigo}}</div> | |
108 | + <div class="progress-value py-4 px-3 d-flex align-content-between flex-wrap"> | |
109 | + <small class="w-100"> | |
110 | + <small> | |
111 | + <small> | |
112 | + {{vehiculo.transportista.NOM.trim()}} | |
113 | + </small> | |
114 | + </small> | |
115 | + </small> | |
116 | + <small class="w-100"> | |
117 | + {{vehiculo.codigo}} | |
118 | + </small> | |
119 | + </div> | |
109 | 120 | </div> |
110 | 121 | </div> |
111 | 122 | <div class="row ml-2"> |
... | ... | @@ -115,7 +126,7 @@ |
115 | 126 | width="100%"> |
116 | 127 | </div> |
117 | 128 | <div class="col-3" |
118 | - uib-tooltip="Cerrar distribuición" | |
129 | + uib-tooltip="Confirmar distribuición" | |
119 | 130 | ng-click="hacerHojaRuta(vehiculo)"></div> |
120 | 131 | <div class="col-3"> |
121 | 132 | <i |
... | ... | @@ -132,7 +143,7 @@ |
132 | 143 | </div> |
133 | 144 | </div> |
134 | 145 | <div |
135 | - class="ml-1 border border-dark text-center" | |
146 | + class="ml-1 border border-dark text-center w-100" | |
136 | 147 | ng-show="arrastrando" |
137 | 148 | id="{{vehiculo.id}}" |
138 | 149 | ondrop="drop(event)" |
src/views/foca-modal-cerrar-vehiculo.html
1 | 1 | <div class="modal-header"> |
2 | - <h4>Cerrar distribución vehículo</h4> | |
2 | + <h4>Confirmar distribución vehículo</h4> | |
3 | 3 | <div class="row"> |
4 | 4 | <div class="col-6 row"> |
5 | 5 | <label class="col-3 mt-2">Fecha:</label> |
... | ... | @@ -46,7 +46,12 @@ |
46 | 46 | <th>Remito Nº</th> |
47 | 47 | <th>Cliente</th> |
48 | 48 | <th>Domicilio de entrega</th> |
49 | - <th>Eliminar</th> | |
49 | + <th>Eliminar | |
50 | + <i | |
51 | + class="fa fa-info" | |
52 | + uib-tooltip="Los remitos que no se pueden eliminar tienen asignada una hoja de ruta"> | |
53 | + </i> | |
54 | + </th> | |
50 | 55 | </tr> |
51 | 56 | </thead> |
52 | 57 | <tbody> |
... | ... | @@ -65,7 +70,8 @@ |
65 | 70 | type="checkbox" |
66 | 71 | ng-model="remito.checked" |
67 | 72 | class="custom-control-input" |
68 | - id="{{remito.id}}"> | |
73 | + id="{{remito.id}}" | |
74 | + ng-disabled="remito.idHojaRuta"> | |
69 | 75 | <label class="custom-control-label" for="{{remito.id}}"></label> |
70 | 76 | </div> |
71 | 77 | </td> |