Commit 6a7d373bab7564fe4b6e6a09cf56dac1ff2aff93
Exists in
master
Merge remote-tracking branch 'upstream/master'
Showing
7 changed files
Show diff stats
src/js/controller.js
... | ... | @@ -40,17 +40,14 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo |
40 | 40 | $scope.idVendedor = 0; |
41 | 41 | getSeguimiento(); |
42 | 42 | $scope.$broadcast('removeCabecera', cabecera); |
43 | - $scope.$broadcast('addCabecera',{ | |
43 | + $scope.$broadcast('addCabecera', { | |
44 | 44 | label: 'General', |
45 | 45 | valor: '' |
46 | 46 | }); |
47 | 47 | }; |
48 | 48 | |
49 | 49 | $scope.cargar = function(idVehiculo, punto) { |
50 | - if(!$scope.fechaReparto) { | |
51 | - focaModalService.alert('Primero seleccione fecha de reparto'); | |
52 | - return; | |
53 | - } | |
50 | + if(!eligioFecha()) return; | |
54 | 51 | var idRemito; |
55 | 52 | if(punto === -1) { |
56 | 53 | idRemito = -1; |
... | ... | @@ -76,21 +73,7 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo |
76 | 73 | }; |
77 | 74 | |
78 | 75 | $scope.quitarVehiculo = function(vehiculo) { |
79 | - //TODO: Pasar validación a función | |
80 | - $scope.fechaReparto.setHours(0, 0, 0, 0); | |
81 | - var idUsuario = focaLogisticaPedidoRutaService.idUsuario; | |
82 | - for(var i = 0; i < vehiculo.cisternas.length; i++) { | |
83 | - for(var j = 0; j < vehiculo.cisternas[i].cisternasCarga.length; j++) { | |
84 | - var cisternaCarga = vehiculo.cisternas[i].cisternasCarga[j]; | |
85 | - if(cisternaCarga.fechaReparto.substring(0, 10) === $scope.fechaReparto | |
86 | - .toISOString().substring(0, 10) && cisternaCarga.idUsuarioProceso !== | |
87 | - idUsuario) | |
88 | - { | |
89 | - focaModalService.alert('El vehículo está siendo usado por otro usuario'); | |
90 | - return; | |
91 | - } | |
92 | - } | |
93 | - } | |
76 | + if(!eligioFecha() || vehiculoEnUso(vehiculo)) return; | |
94 | 77 | focaModalService.confirm('Esta seguro que desea eliminar el vehículo ' + |
95 | 78 | vehiculo.codigo + '?').then(function() { |
96 | 79 | eliminarVehiculo(vehiculo); |
... | ... | @@ -98,25 +81,7 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo |
98 | 81 | }; |
99 | 82 | |
100 | 83 | $scope.hacerHojaRuta = function(vehiculo) { |
101 | - if(!$scope.fechaReparto) { | |
102 | - focaModalService.alert('Primero seleccione fecha de reparto'); | |
103 | - return; | |
104 | - } | |
105 | - //TODO: Pasar validación a función | |
106 | - $scope.fechaReparto.setHours(0, 0, 0, 0); | |
107 | - var idUsuario = focaLogisticaPedidoRutaService.idUsuario; | |
108 | - for(var i = 0; i < vehiculo.cisternas.length; i++) { | |
109 | - for(var j = 0; j < vehiculo.cisternas[i].cisternasCarga.length; j++) { | |
110 | - var cisternaCarga = vehiculo.cisternas[i].cisternasCarga[j]; | |
111 | - if(cisternaCarga.fechaReparto.substring(0, 10) === $scope.fechaReparto | |
112 | - .toISOString().substring(0, 10) && cisternaCarga.idUsuarioProceso !== | |
113 | - idUsuario) | |
114 | - { | |
115 | - focaModalService.alert('El vehículo está siendo usado por otro usuario'); | |
116 | - return; | |
117 | - } | |
118 | - } | |
119 | - } | |
84 | + if(!eligioFecha() || vehiculoEnUso(vehiculo)) return; | |
120 | 85 | var modalInstance = $uibModal.open( |
121 | 86 | { |
122 | 87 | ariaLabelledBy: 'Creación hoja ruta', |
... | ... | @@ -124,7 +89,8 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo |
124 | 89 | controller: 'focaModalCerrarVehiculo', |
125 | 90 | size: 'lg', |
126 | 91 | resolve: { |
127 | - idVehiculo: function() {return vehiculo.id;} | |
92 | + idVehiculo: function() {return vehiculo.id;}, | |
93 | + fechaReparto: function() {return $scope.fechaReparto;} | |
128 | 94 | } |
129 | 95 | } |
130 | 96 | ); |
... | ... | @@ -269,8 +235,34 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo |
269 | 235 | } |
270 | 236 | }); |
271 | 237 | } |
272 | - $interval(function() { | |
273 | - getSeguimiento(); | |
274 | - }, 5000); | |
238 | + | |
239 | + function eligioFecha() { | |
240 | + if(!$scope.fechaReparto) { | |
241 | + focaModalService.alert('Primero seleccione fecha de reparto'); | |
242 | + return false; | |
243 | + } | |
244 | + return true; | |
245 | + } | |
246 | + | |
247 | + function vehiculoEnUso(vehiculo) { | |
248 | + var idUsuario = focaLogisticaPedidoRutaService.idUsuario; | |
249 | + for(var i = 0; i < vehiculo.cisternas.length; i++) { | |
250 | + for(var j = 0; j < vehiculo.cisternas[i].cisternasCarga.length; j++) { | |
251 | + var cisternaCarga = vehiculo.cisternas[i].cisternasCarga[j]; | |
252 | + if(cisternaCarga.fechaReparto.substring(0, 10) === $scope.fechaReparto | |
253 | + .toISOString().substring(0, 10) && cisternaCarga.idUsuarioProceso && | |
254 | + cisternaCarga.idUsuarioProceso !== idUsuario) | |
255 | + { | |
256 | + focaModalService.alert('El vehículo está siendo usado por otro usuario'); | |
257 | + return true; | |
258 | + } | |
259 | + } | |
260 | + } | |
261 | + return false; | |
262 | + } | |
263 | + // TODO: descomentar en produccion | |
264 | + // $interval(function() { | |
265 | + // getSeguimiento(); | |
266 | + // }, 5000); | |
275 | 267 | } |
276 | 268 | ]); |
src/js/controllerCerrarVehiculo.js
... | ... | @@ -7,11 +7,12 @@ angular.module('focaLogisticaPedidoRuta') |
7 | 7 | 'idVehiculo', |
8 | 8 | 'focaModalService', |
9 | 9 | '$filter', |
10 | + 'fechaReparto', | |
10 | 11 | function($scope, $uibModalInstance, $uibModal, focaLogisticaPedidoRutaService, |
11 | - idVehiculo, focaModalService, $filter) { | |
12 | + idVehiculo, focaModalService, $filter, fechaReparto) { | |
12 | 13 | $scope.vehiculo = {}; |
13 | 14 | $scope.remitos = []; |
14 | - $scope.now = new Date(); | |
15 | + $scope.now = fechaReparto; | |
15 | 16 | focaLogisticaPedidoRutaService.obtenerVehiculoById(idVehiculo).then(function(res) { |
16 | 17 | $scope.vehiculo = res.data; |
17 | 18 | }); |
src/js/controllerDetalleVehiculo.js
... | ... | @@ -1,219 +0,0 @@ |
1 | -angular.module('focaLogisticaPedidoRuta') | |
2 | - .controller('focaDetalleVehiculo', | |
3 | - ['$scope', | |
4 | - '$uibModalInstance', | |
5 | - 'idVehiculo', | |
6 | - 'idRemito', | |
7 | - 'focaModalService', | |
8 | - '$filter', | |
9 | - 'focaLogisticaPedidoRutaService', | |
10 | - function($scope, $uibModalInstance, idVehiculo, idRemito, focaModalService, $filter, | |
11 | - focaLogisticaPedidoRutaService | |
12 | - ) { | |
13 | - //seteo variables | |
14 | - $scope.cargandoDatos = true; | |
15 | - $scope.idRemito = idRemito; | |
16 | - $scope.articulos = []; | |
17 | - $scope.vehiculo = {}; | |
18 | - $scope.cisternas = []; | |
19 | - $scope.cisternasCarga = []; | |
20 | - $scope.remito = {}; | |
21 | - $scope.aCargar = []; | |
22 | - var cisternaMovimientos = []; | |
23 | - var promesaRemito; | |
24 | - var promesaVehiculo = focaLogisticaPedidoRutaService.obtenerVehiculoById(idVehiculo); | |
25 | - var promesaCisternas = focaLogisticaPedidoRutaService | |
26 | - .obtenerCisternasPorFecha(idVehiculo); | |
27 | - if(idRemito !== -1) { | |
28 | - promesaRemito = focaLogisticaPedidoRutaService.obtenerRemitoById(idRemito); | |
29 | - } | |
30 | - Promise.all([promesaVehiculo, promesaCisternas, promesaRemito]).then(function(res) { | |
31 | - $scope.cargandoDatos = false; | |
32 | - $scope.vehiculo = res[0].data; | |
33 | - $scope.cisternas = res[1].data; | |
34 | - if(!res[2]) return; | |
35 | - $scope.remito = res[2].data; | |
36 | - if($scope.remito.idUsuarioProceso) { | |
37 | - focaModalService.alert('Remito ya asignado'); | |
38 | - $uibModalInstance.close(); | |
39 | - } | |
40 | - $scope.articulos = $scope.remito.articulosRemito; | |
41 | - $scope.seleccionarArticulo($scope.articulos[0]); | |
42 | - var tieneUsuario = $scope.cisternas.filter(function(cisterna) { | |
43 | - if(cisterna.cisternaCarga) { | |
44 | - return cisterna.cisternaCarga.idUsuarioProceso !== | |
45 | - focaLogisticaPedidoRutaService.idUsuario; | |
46 | - } | |
47 | - }); | |
48 | - if(tieneUsuario.length) { | |
49 | - focaModalService.alert('Otro usario esta usando este vehículo'); | |
50 | - $uibModalInstance.close(); | |
51 | - return; | |
52 | - } | |
53 | - }); | |
54 | - $scope.aceptar = function() { | |
55 | - $scope.cargando = true; | |
56 | - for(var i = 0; i < $scope.cisternasCarga.length; i++) { | |
57 | - $scope.cisternasCarga[i].idUsuarioProceso = | |
58 | - focaLogisticaPedidoRutaService.idUsuario; | |
59 | - delete $scope.cisternasCarga[i].articulo; | |
60 | - } | |
61 | - var cisterna = { | |
62 | - cisternaMovimientos: cisternaMovimientos, | |
63 | - cisternaCargas: $scope.cisternasCarga, | |
64 | - idVehiculo: $scope.vehiculo.id, | |
65 | - fechaReparto: focaLogisticaPedidoRutaService.fecha | |
66 | - }; | |
67 | - focaLogisticaPedidoRutaService.guardarCisternas(cisterna, $scope.remito.id) | |
68 | - .then(function() { | |
69 | - focaModalService.alert('Cisternas cargadas con éxito').then(function() { | |
70 | - $scope.cargando = false; | |
71 | - $uibModalInstance.close(); | |
72 | - }); | |
73 | - }).catch(function(error) { | |
74 | - $scope.cargando = false; | |
75 | - $uibModalInstance.close(); | |
76 | - if (error.status === 403) { | |
77 | - focaModalService.alert('ERROR: ' + error.data); | |
78 | - return; | |
79 | - } | |
80 | - focaModalService.alert('Hubo un error al cargar las cisternas'); | |
81 | - }); | |
82 | - }; | |
83 | - $scope.cancelar = function() { | |
84 | - $uibModalInstance.close(); | |
85 | - }; | |
86 | - $scope.cargarACisternas = function() { | |
87 | - for(var i = 0; i < $scope.cisternas.length; i++) { | |
88 | - var cisterna = $scope.cisternas[i]; | |
89 | - var aCargar = parseFloat($scope.aCargar[i]); | |
90 | - var fechaReparto = focaLogisticaPedidoRutaService.fecha; | |
91 | - //validaciones | |
92 | - if(!aCargar) { | |
93 | - continue; | |
94 | - } | |
95 | - //cargar | |
96 | - if(cisterna.cisternaCarga.cantidad) { | |
97 | - cisterna.cisternaCarga.cantidad += aCargar; | |
98 | - }else { | |
99 | - cisterna.cisternaCarga.cantidad = aCargar; | |
100 | - cisterna.cisternaCarga.idProducto = $scope.articuloSeleccionado.idArticulo; | |
101 | - } | |
102 | - cisterna.disponible = cisterna.capacidad - cisterna.cisternaCarga.cantidad; | |
103 | - | |
104 | - cisterna.cisternaCarga.articulo = { | |
105 | - DetArt: $scope.articuloSeleccionado.descripcion | |
106 | - }; | |
107 | - $filter('filter')($scope.articulos, {id: $scope.articuloSeleccionado.id})[0] | |
108 | - .cargado = true; | |
109 | - | |
110 | - $scope.calcularPorcentaje(cisterna); | |
111 | - //Guardar | |
112 | - var now = new Date(); | |
113 | - var cisternaMovimiento = { | |
114 | - fecha: now.toISOString().slice(0, 19).replace('T', ' '), | |
115 | - cantidad: aCargar, | |
116 | - metodo: 'carga', | |
117 | - idCisternaCarga: cisterna.cisternaCarga.id, | |
118 | - idRemito: $scope.remito.id | |
119 | - }; | |
120 | - cisterna.cisternaCarga.fechaReparto = fechaReparto; | |
121 | - cisterna.cisternaCarga.idCisterna = cisterna.id; | |
122 | - $scope.cisternasCarga.push(cisterna.cisternaCarga); | |
123 | - cisternaMovimientos.push(cisternaMovimiento); | |
124 | - } | |
125 | - var articuloSiguiente = $scope.articulos.filter( | |
126 | - function(filter) { | |
127 | - return filter.cargado !== true; | |
128 | - } | |
129 | - ); | |
130 | - if(articuloSiguiente.length > 0) { | |
131 | - $scope.seleccionarArticulo(articuloSiguiente[0]); | |
132 | - } | |
133 | - }; | |
134 | - $scope.calcularPorcentaje = function(cisterna) { | |
135 | - if(!cisterna.cisternaCarga) { | |
136 | - cisterna.cisternaCarga = { | |
137 | - cantidad: 0 | |
138 | - }; | |
139 | - } | |
140 | - var porcentaje = (cisterna.cisternaCarga.cantidad * 100 / | |
141 | - cisterna.capacidad) + '%'; | |
142 | - var elementHtml = document.getElementById(cisterna.id); | |
143 | - if(elementHtml) { | |
144 | - elementHtml.style.width = porcentaje; | |
145 | - } | |
146 | - }; | |
147 | - $scope.seleccionarArticulo = function(articulo) { | |
148 | - $scope.articuloSeleccionado = articulo; | |
149 | - $scope.cisternaDisponible(); | |
150 | - $scope.autoCompletar(); | |
151 | - $scope.actualizarArticulo(); | |
152 | - }; | |
153 | - $scope.actualizarArticulo = function () { | |
154 | - $scope.articuloSeleccionado.cantidadCargada = 0; | |
155 | - for (var i = 0; i < $scope.aCargar.length; i++) { | |
156 | - $scope.articuloSeleccionado.cantidadCargada += | |
157 | - parseFloat($scope.aCargar[i]) || 0; | |
158 | - } | |
159 | - }; | |
160 | - $scope.autoCompletar = function() { | |
161 | - $scope.aCargar = []; | |
162 | - var disponible = $filter('filter')($scope.cisternas, {disabled: false}); | |
163 | - var index = $scope.cisternas.indexOf(disponible[0]); | |
164 | - $scope.aCargar[index] = $scope.articuloSeleccionado.cantidad; | |
165 | - }; | |
166 | - $scope.cisternaDisponible = function() { | |
167 | - for(var i = 0; i < $scope.cisternas.length; i++) { | |
168 | - if($scope.articuloSeleccionado.cantidad > $scope.cisternas[i].disponible) { | |
169 | - $scope.cisternas[i].disabled = true; | |
170 | - continue; | |
171 | - } | |
172 | - if($scope.cisternas[i].cisternaCarga && | |
173 | - $scope.cisternas[i].cisternaCarga.idProducto && | |
174 | - $scope.articuloSeleccionado.idArticulo !== | |
175 | - $scope.cisternas[i].cisternaCarga.idProducto) | |
176 | - { | |
177 | - $scope.cisternas[i].disabled = true; | |
178 | - continue; | |
179 | - } | |
180 | - $scope.cisternas[i].disabled = false; | |
181 | - } | |
182 | - }; | |
183 | - $scope.rellenarInput = function(input) { | |
184 | - if(!$scope.articuloSeleccionado) return; | |
185 | - if($scope.articuloSeleccionado.cantidad - | |
186 | - $scope.articuloSeleccionado.cantidadCargada === 0) { | |
187 | - return input; | |
188 | - } | |
189 | - if(!input) input = 0; | |
190 | - input = parseFloat(input); | |
191 | - input += parseFloat($scope.articuloSeleccionado.cantidad - | |
192 | - $scope.articuloSeleccionado.cantidadCargada); | |
193 | - return input; | |
194 | - }; | |
195 | - $scope.distribucionDisponible = function() { | |
196 | - if(!$scope.articuloSeleccionado || $scope.articuloSeleccionado.cantidad - | |
197 | - $scope.articuloSeleccionado.cantidadCargada !== 0 || | |
198 | - !$scope.tieneArticulosPendientes()) { | |
199 | - return false; | |
200 | - } | |
201 | - return true; | |
202 | - }; | |
203 | - $scope.tieneArticulosPendientes = function() { | |
204 | - var algunValorNegativo = $scope.aCargar.filter(function(p) { | |
205 | - return p < 0; | |
206 | - }); | |
207 | - if(algunValorNegativo.length) { | |
208 | - return false; | |
209 | - } | |
210 | - var articulosDescargados = $scope.articulos.filter(function(filter) { | |
211 | - return filter.cargado === true; | |
212 | - }); | |
213 | - if(articulosDescargados.length === $scope.articulos.length) { | |
214 | - $scope.aCargar = []; | |
215 | - return false; | |
216 | - } | |
217 | - return true; | |
218 | - }; | |
219 | - }]); |
src/js/osm-directive.js
... | ... | @@ -70,7 +70,9 @@ angular.module('focaLogisticaPedidoRuta').directive('focaLogistica', function() |
70 | 70 | }); |
71 | 71 | } |
72 | 72 | $scope.markers.push( |
73 | - L.marker([marcador.latitud, marcador.longitud], {icon: icon}) | |
73 | + L.marker( | |
74 | + [marcador.latitud, marcador.longitud], | |
75 | + {icon: icon, draggable: true}) | |
74 | 76 | .addTo($scope.map) |
75 | 77 | .bindPopup(observacion) |
76 | 78 | ); |
src/js/service.js
... | ... | @@ -8,25 +8,15 @@ angular.module('focaLogisticaPedidoRuta') |
8 | 8 | function($http, $cookies, API_ENDPOINT, $filter) { |
9 | 9 | var url = API_ENDPOINT.URL; |
10 | 10 | return { |
11 | - idUsuario: $cookies.get('idUsuario'), | |
11 | + idUsuario: $cookies.get('vendedorCobrador'), | |
12 | 12 | obtenerActividad: function(parametros) { |
13 | 13 | return $http.post(url + '/seguimiento/filtros', parametros); |
14 | 14 | }, |
15 | - obtenerVehiculoById: function(idVehiculo) { | |
16 | - return $http.get(url + '/vehiculo/' + idVehiculo); | |
17 | - }, | |
18 | - obtenerRemitoById: function(idRemito) { | |
19 | - return $http.get(url + '/remito/obtener/' + idRemito); | |
20 | - }, | |
21 | - guardarCisternas: function(cisterna, idRemito) { | |
22 | - return $http.post(url + '/cisterna/guardar/cargar/' + | |
23 | - this.idUsuario + '/' + idRemito,cisterna); | |
24 | - }, | |
25 | 15 | numeroHojaRuta: function() { |
26 | 16 | return $http.get(url + '/hoja-ruta/numero-siguiente'); |
27 | 17 | }, |
28 | 18 | getRemitos: function(idVehiculo) { |
29 | - return $http.get(url + '/remito/sin-hoja-ruta/' +idVehiculo); | |
19 | + return $http.get(url + '/remito/sin-hoja-ruta/' + idVehiculo); | |
30 | 20 | }, |
31 | 21 | cerrarDistribuicion: function(remitos) { |
32 | 22 | return $http.post(url + '/vehiculo/cierre-distribuicion', remitos); |
... | ... | @@ -54,8 +44,7 @@ angular.module('focaLogisticaPedidoRuta') |
54 | 44 | .length; k++) |
55 | 45 | { |
56 | 46 | if(cisterna.cisternasCarga[j].fechaReparto.substring(0, 10) === |
57 | - fecha.substring(0, 10) && !cisterna.cisternasCarga[j] | |
58 | - .confirmado) | |
47 | + fecha.substring(0, 10)) | |
59 | 48 | { |
60 | 49 | procesoMovimiento(cisterna.cisternasCarga[j] |
61 | 50 | .cisternaMovimientos[k]); |
... | ... | @@ -78,10 +67,6 @@ angular.module('focaLogisticaPedidoRuta') |
78 | 67 | getVehiculosByIdUsuario: function() { |
79 | 68 | return $http.get(url + '/vehiculo/usuario/' + this.idUsuario); |
80 | 69 | }, |
81 | - obtenerCisternasPorFecha: function(idVehiculo) { | |
82 | - return $http.post(url + '/cisterna/listar/fecha', | |
83 | - {idVehiculo: idVehiculo, fechaReparto: this.fecha}); | |
84 | - }, | |
85 | 70 | getUnidadesByFecha: function() { |
86 | 71 | return $http.post(url + '/vehiculo/listar/fecha', |
87 | 72 | {fecha: this.fecha}); |
... | ... | @@ -89,5 +74,8 @@ angular.module('focaLogisticaPedidoRuta') |
89 | 74 | setFechaReparto: function(fechaReparto) { |
90 | 75 | this.fecha = fechaReparto; |
91 | 76 | }, |
77 | + obtenerVehiculoById: function(idVehiculo) { | |
78 | + return $http.get(url + '/vehiculo/' + idVehiculo); | |
79 | + } | |
92 | 80 | }; |
93 | 81 | }]); |
src/views/foca-detalle-vehiculo.html
... | ... | @@ -1,129 +0,0 @@ |
1 | -<div class="modal-header"> | |
2 | - <h4>Detalle de carga</h4> | |
3 | - Transportista | |
4 | - <strong ng-bind="vehiculo.transportista.COD"></strong> | |
5 | - <strong ng-bind="vehiculo.transportista.NOM"></strong> | |
6 | - Unidad <strong ng-bind="vehiculo.codigo"></strong> | |
7 | - Tractor <strong ng-bind="vehiculo.tractor"></strong> | |
8 | - <br> | |
9 | - <div ng-show="idRemito !== -1"> | |
10 | - <span>Remito Nº</span> | |
11 | - <strong ng-bind="[remito.sucursal, remito.numeroRemito] | comprobante"></strong> | |
12 | - <span>, Fecha</span> | |
13 | - <strong ng-bind="remito.fechaRemito | date: 'dd/MM/yyyy HH:mm'"></strong> | |
14 | - <span>, Cliente</span> | |
15 | - <strong ng-bind="remito.nombreCliente"></strong> | |
16 | - <span>, Domicilio entrega</span> | |
17 | - <strong ng-bind="remito.domicilioStamp"></strong> | |
18 | - </div> | |
19 | -</div> | |
20 | -<div class="modal-body"> | |
21 | - <div> | |
22 | - <table class="table table-sm" ng-show="idRemito !== -1"> | |
23 | - <thead> | |
24 | - <tr> | |
25 | - <th></th> | |
26 | - <th>Articulo</th> | |
27 | - <th>Cantidad</th> | |
28 | - <th>Cargado</th> | |
29 | - <th>Resta asignar</th> | |
30 | - </tr> | |
31 | - </thead> | |
32 | - <tbody> | |
33 | - <tr ng-repeat="(key, articulo) in articulos"> | |
34 | - <td><input | |
35 | - type="radio" | |
36 | - name="articuloRadio" | |
37 | - id="{{'articulo' + articulo.id}}" | |
38 | - ng-checked="articuloSeleccionado.id === articulo.id" | |
39 | - ng-disabled="articulo.cargado" | |
40 | - ng-click="seleccionarArticulo(articulo)" | |
41 | - ></td> | |
42 | - <td ng-bind="articulo.descripcion"></td> | |
43 | - <td ng-bind="articulo.cantidad"></td> | |
44 | - <td ng-bind="articulo.cantidadCargada || 0"></td> | |
45 | - <td ng-bind="articulo.cantidad - articulo.cantidadCargada"></td> | |
46 | - </tr> | |
47 | - </tbody> | |
48 | - </table> | |
49 | - <table class="table table-sm" ladda="cargandoDatos" data-spinner-color="#FF0000"> | |
50 | - <thead> | |
51 | - <tr> | |
52 | - <th width="10%">Cisterna</th> | |
53 | - <th>Capacidad</th> | |
54 | - <th>Articulo cargado</th> | |
55 | - <th width="20%">Asignado</th> | |
56 | - <th>Cargado / Capacidad Disponible</th> | |
57 | - </tr> | |
58 | - </thead> | |
59 | - <tbody> | |
60 | - <tr ng-repeat="(key, cisterna) in cisternas"> | |
61 | - <td class="py-3" ng-bind="cisterna.codigo"></td> | |
62 | - <td class="py-3" ng-bind="cisterna.capacidad"></td> | |
63 | - <td class="py-3" ng-bind="cisterna.cisternaCarga.articulo.DetArt || 'Sin asignar'"></td> | |
64 | - <td ng-if="idRemito != -1"> | |
65 | - <input | |
66 | - class="form-control" | |
67 | - foca-tipo-input | |
68 | - foca-teclado | |
69 | - placeholder="A cargar..." | |
70 | - ng-model="aCargar[key]" | |
71 | - ng-disabled="cisterna.disabled || !tieneArticulosPendientes()" | |
72 | - ng-focus="aCargar[key] = rellenarInput(aCargar[key]); actualizarArticulo()" | |
73 | - ng-change="actualizarArticulo()" | |
74 | - > | |
75 | - </td> | |
76 | - <td ng-if="idRemito == -1"> | |
77 | - <input | |
78 | - class="form-control" | |
79 | - placeholder="A cargar..." | |
80 | - readonly> | |
81 | - </td> | |
82 | - <td><div class="progress foca-alto-progress pl-0 pr-0 mt-1"> | |
83 | - <strong | |
84 | - class="mt-2 col-4 text-center position-absolute" | |
85 | - ng-bind="(cisterna.cisternaCarga.cantidad || 0) + '/' + | |
86 | - (cisterna.capacidad - cisterna.cisternaCarga.cantidad)"> | |
87 | - </strong> | |
88 | - <div | |
89 | - id="{{cisterna.id}}" | |
90 | - class="progress-bar" | |
91 | - role="progressbar" | |
92 | - aria-valuemin="0" | |
93 | - aria-valuemax="{{cisterna.capacidad}}" | |
94 | - ng-style="{'width':'{{calcularPorcentaje(cisterna)}}'}"> | |
95 | - </div> | |
96 | - </div> | |
97 | - </td> | |
98 | - </tr> | |
99 | - </tbody> | |
100 | - </table> | |
101 | - <div class="col-12"> | |
102 | - <button | |
103 | - class="form-control btn btn-success" | |
104 | - ladda="cargando" | |
105 | - data-spinner-color="#FF0000" | |
106 | - type="button" | |
107 | - ng-disabled="!distribucionDisponible()" | |
108 | - ng-class="{'btn-light': !distribucionDisponible()}" | |
109 | - ng-click="cargarACisternas(vehiculo)" | |
110 | - foca-focus="distribucionDisponible()"> | |
111 | - Aplicar distribución de cargas | |
112 | - </button> | |
113 | - </div> | |
114 | - </div> | |
115 | -</div> | |
116 | -<div class="modal-footer py-1"> | |
117 | - <button | |
118 | - class="btn btn-sm btn-secondary" | |
119 | - ladda="cargando" | |
120 | - type="button" | |
121 | - ng-click="cancelar()">Cancelar</button> | |
122 | - <button | |
123 | - class="btn btn-sm btn-primary" | |
124 | - ladda="cargando" | |
125 | - type="button" | |
126 | - ng-click="aceptar()" | |
127 | - ng-disabled="tieneArticulosPendientes() || idRemito === -1" | |
128 | - foca-focus="!tieneArticulosPendientes() && idRemito !== -1">Cargar</button> | |
129 | -</div> |
src/views/foca-modal-cerrar-vehiculo.html
1 | 1 | <div class="modal-header"> |
2 | - <h5>En desarrollo</h5> | |
3 | 2 | <h4>Cerrar distribución vehículo</h4> |
4 | 3 | <div class="row"> |
5 | 4 | <div class="col-6 row"> |
... | ... | @@ -12,7 +11,6 @@ |
12 | 11 | show-button-bar="false" |
13 | 12 | is-open="datepickerOpen" |
14 | 13 | on-open-focus="false" |
15 | - ng-focus="datepickerOpen = true" | |
16 | 14 | class="form-control col-8"/> |
17 | 15 | </div> |
18 | 16 | </div> |