Commit 4deaf827fbd31f418b6d95a278fdb2e5be99a970
1 parent
8f74dfc4bb
Exists in
master
and in
2 other branches
fix funciones
Showing
2 changed files
with
32 additions
and
34 deletions
Show diff stats
src/js/controllerDetalleVehiculo.js
| 1 | angular.module('focaLogisticaPedidoRuta') | 1 | angular.module('focaLogisticaPedidoRuta') |
| 2 | .controller('focaDetalleVehiculo', | 2 | .controller('focaDetalleVehiculo', |
| 3 | ['$scope', | 3 | ['$scope', |
| 4 | '$uibModalInstance', | 4 | '$uibModalInstance', |
| 5 | 'idVehiculo', | 5 | 'idVehiculo', |
| 6 | 'idRemito', | 6 | 'idRemito', |
| 7 | 'focaModalService', | 7 | 'focaModalService', |
| 8 | '$filter', | 8 | '$filter', |
| 9 | 'focaLogisticaPedidoRutaService', | 9 | 'focaLogisticaPedidoRutaService', |
| 10 | function($scope, $uibModalInstance, idVehiculo, idRemito, focaModalService, $filter, | 10 | function($scope, $uibModalInstance, idVehiculo, idRemito, focaModalService, $filter, |
| 11 | focaLogisticaPedidoRutaService | 11 | focaLogisticaPedidoRutaService |
| 12 | ) { | 12 | ) { |
| 13 | //seteo variables | 13 | //seteo variables |
| 14 | $scope.cargandoDatos = true; | 14 | $scope.cargandoDatos = true; |
| 15 | $scope.idRemito = idRemito; | 15 | $scope.idRemito = idRemito; |
| 16 | $scope.articulos = []; | 16 | $scope.articulos = []; |
| 17 | $scope.vehiculo = {}; | 17 | $scope.vehiculo = {}; |
| 18 | $scope.remito = {}; | 18 | $scope.remito = {}; |
| 19 | $scope.aCargar = []; | 19 | $scope.aCargar = []; |
| 20 | var cisternaMovimientos = []; | 20 | var cisternaMovimientos = []; |
| 21 | var promesaVehiculo = focaLogisticaPedidoRutaService.obtenerVehiculoById(idVehiculo); | 21 | var promesaVehiculo = focaLogisticaPedidoRutaService.obtenerVehiculoById(idVehiculo); |
| 22 | var promesaRemito; | 22 | var promesaRemito; |
| 23 | if(idRemito !== -1) { | 23 | if(idRemito !== -1) { |
| 24 | promesaRemito = focaLogisticaPedidoRutaService.obtenerRemitoById(idRemito); | 24 | promesaRemito = focaLogisticaPedidoRutaService.obtenerRemitoById(idRemito); |
| 25 | } | 25 | } |
| 26 | Promise.all([promesaVehiculo, promesaRemito]).then(function(res) { | 26 | Promise.all([promesaVehiculo, promesaRemito]).then(function(res) { |
| 27 | $scope.cargandoDatos = false; | 27 | $scope.cargandoDatos = false; |
| 28 | $scope.vehiculo = res[0].data; | 28 | $scope.vehiculo = res[0].data; |
| 29 | if(!res[1]) return; | 29 | if(!res[1]) return; |
| 30 | $scope.remito = res[1].data; | 30 | $scope.remito = res[1].data; |
| 31 | if($scope.remito.idUsuarioProceso) { | 31 | if($scope.remito.idUsuarioProceso) { |
| 32 | focaModalService.alert('Remito ya asignado'); | 32 | focaModalService.alert('Remito ya asignado'); |
| 33 | $uibModalInstance.close(); | 33 | $uibModalInstance.close(); |
| 34 | } | 34 | } |
| 35 | $scope.articulos = $scope.remito.articulosRemito; | 35 | $scope.articulos = $scope.remito.articulosRemito; |
| 36 | $scope.cambioArticulo($scope.articulos[0]); | 36 | $scope.seleccionarArticulo($scope.articulos[0]); |
| 37 | }); | 37 | }); |
| 38 | $scope.aceptar = function() { | 38 | $scope.aceptar = function() { |
| 39 | $scope.cargando = true; | 39 | $scope.cargando = true; |
| 40 | var cisternaCargas = []; | 40 | var cisternaCargas = []; |
| 41 | for (var i = 0; i < $scope.vehiculo.cisternas.length; i++) { | 41 | for (var i = 0; i < $scope.vehiculo.cisternas.length; i++) { |
| 42 | delete $scope.vehiculo.cisternas[i].cisternaCarga.articulo; | 42 | delete $scope.vehiculo.cisternas[i].cisternaCarga.articulo; |
| 43 | cisternaCargas.push($scope.vehiculo.cisternas[i].cisternaCarga); | 43 | cisternaCargas.push($scope.vehiculo.cisternas[i].cisternaCarga); |
| 44 | } | 44 | } |
| 45 | var cisterna = { | 45 | var cisterna = { |
| 46 | cisternaMovimientos: cisternaMovimientos, | 46 | cisternaMovimientos: cisternaMovimientos, |
| 47 | cisternaCargas: cisternaCargas, | 47 | cisternaCargas: cisternaCargas, |
| 48 | idVehiculo: $scope.vehiculo.id | 48 | idVehiculo: $scope.vehiculo.id |
| 49 | }; | 49 | }; |
| 50 | focaLogisticaPedidoRutaService.guardarCisternas(cisterna, $scope.remito.id) | 50 | focaLogisticaPedidoRutaService.guardarCisternas(cisterna, $scope.remito.id) |
| 51 | .then(function() { | 51 | .then(function() { |
| 52 | focaModalService.alert('Cisternas cargadas con éxito').then(function() { | 52 | focaModalService.alert('Cisternas cargadas con éxito').then(function() { |
| 53 | $scope.cargando = false; | 53 | $scope.cargando = false; |
| 54 | $uibModalInstance.close(); | 54 | $uibModalInstance.close(); |
| 55 | }); | 55 | }); |
| 56 | }).catch(function(error) { | 56 | }).catch(function(error) { |
| 57 | $scope.cargando = false; | 57 | $scope.cargando = false; |
| 58 | $uibModalInstance.close(); | 58 | $uibModalInstance.close(); |
| 59 | if (error.status === 403.1) { | 59 | if (error.status === 403.1) { |
| 60 | focaModalService.alert('ERROR: El vehículo esta en uso'); | 60 | focaModalService.alert('ERROR: El vehículo esta en uso'); |
| 61 | } | 61 | } |
| 62 | if(error.status === 403.2) { | 62 | if(error.status === 403.2) { |
| 63 | focaModalService.alert('ERROR: Otro usario ya cargó este remito'); | 63 | focaModalService.alert('ERROR: Otro usario ya cargó este remito'); |
| 64 | return; | 64 | return; |
| 65 | } | 65 | } |
| 66 | focaModalService.alert('Hubo un error al cargar las cisternas'); | 66 | focaModalService.alert('Hubo un error al cargar las cisternas'); |
| 67 | }); | 67 | }); |
| 68 | }; | 68 | }; |
| 69 | |||
| 70 | $scope.cancelar = function() { | 69 | $scope.cancelar = function() { |
| 71 | $uibModalInstance.close(); | 70 | $uibModalInstance.close(); |
| 72 | }; | 71 | }; |
| 73 | |||
| 74 | $scope.cargarACisternas = function(vehiculo) { | 72 | $scope.cargarACisternas = function(vehiculo) { |
| 75 | for(var i = 0; i < vehiculo.cisternas.length; i++) { | 73 | for(var i = 0; i < vehiculo.cisternas.length; i++) { |
| 76 | var cisterna = vehiculo.cisternas[i]; | 74 | var cisterna = vehiculo.cisternas[i]; |
| 77 | var aCargar = parseFloat($scope.aCargar[i]); | 75 | var aCargar = parseFloat($scope.aCargar[i]); |
| 78 | //validaciones | 76 | //validaciones |
| 79 | if(!aCargar) { | 77 | if(!aCargar) { |
| 80 | continue; | 78 | continue; |
| 81 | } | 79 | } |
| 82 | if(aCargar > cisterna.disponible) { | 80 | if(aCargar > cisterna.disponible) { |
| 83 | focaModalService.alert('La cantidad cargada supera la capacidad de la' + | 81 | focaModalService.alert('La cantidad cargada supera la capacidad de la' + |
| 84 | 'cisterna ' + cisterna.codigo); | 82 | 'cisterna ' + cisterna.codigo); |
| 85 | return; | 83 | return; |
| 86 | } | 84 | } |
| 87 | //cargar | 85 | //cargar |
| 88 | if(cisterna.cisternaCarga.cantidad) { | 86 | if(cisterna.cisternaCarga.cantidad) { |
| 89 | cisterna.cisternaCarga.cantidad += aCargar; | 87 | cisterna.cisternaCarga.cantidad += aCargar; |
| 90 | }else { | 88 | }else { |
| 91 | cisterna.cisternaCarga.cantidad = aCargar; | 89 | cisterna.cisternaCarga.cantidad = aCargar; |
| 92 | cisterna.cisternaCarga.idProducto = $scope.articuloSeleccionado.idArticulo; | 90 | cisterna.cisternaCarga.idProducto = $scope.articuloSeleccionado.idArticulo; |
| 93 | } | 91 | } |
| 94 | cisterna.disponible = cisterna.capacidad - cisterna.cisternaCarga.cantidad; | 92 | cisterna.disponible = cisterna.capacidad - cisterna.cisternaCarga.cantidad; |
| 95 | 93 | ||
| 96 | cisterna.cisternaCarga.articulo = { | 94 | cisterna.cisternaCarga.articulo = { |
| 97 | DetArt: $scope.articuloSeleccionado.descripcion | 95 | DetArt: $scope.articuloSeleccionado.descripcion |
| 98 | }; | 96 | }; |
| 99 | $filter('filter')($scope.articulos, {id: $scope.articuloSeleccionado.id})[0] | 97 | $filter('filter')($scope.articulos, {id: $scope.articuloSeleccionado.id})[0] |
| 100 | .cargado = true; | 98 | .cargado = true; |
| 101 | 99 | ||
| 102 | $scope.calcularPorcentaje(cisterna); | 100 | $scope.calcularPorcentaje(cisterna); |
| 103 | //Guardar | 101 | //Guardar |
| 104 | var now = new Date(); | 102 | var now = new Date(); |
| 105 | var cisternaMovimiento = { | 103 | var cisternaMovimiento = { |
| 106 | fecha: now.toISOString().slice(0, 19).replace('T', ' '), | 104 | fecha: now.toISOString().slice(0, 19).replace('T', ' '), |
| 107 | cantidad: aCargar, | 105 | cantidad: aCargar, |
| 108 | metodo: 'carga', | 106 | metodo: 'carga', |
| 109 | idCisternaCarga: cisterna.cisternaCarga.id, | 107 | idCisternaCarga: cisterna.cisternaCarga.id, |
| 110 | idRemito: $scope.remito.id | 108 | idRemito: $scope.remito.id |
| 111 | }; | 109 | }; |
| 112 | cisternaMovimientos.push(cisternaMovimiento); | 110 | cisternaMovimientos.push(cisternaMovimiento); |
| 113 | } | 111 | } |
| 114 | var articuloSiguiente = $scope.articulos.filter( | 112 | var articuloSiguiente = $scope.articulos.filter( |
| 115 | function(filter) { | 113 | function(filter) { |
| 116 | return filter.cargado !== true; | 114 | return filter.cargado !== true; |
| 117 | } | 115 | } |
| 118 | ); | 116 | ); |
| 119 | if(articuloSiguiente.length > 0) { | 117 | if(articuloSiguiente.length > 0) { |
| 120 | $scope.cambioArticulo(articuloSiguiente[0]); | 118 | $scope.seleccionarArticulo(articuloSiguiente[0]); |
| 121 | } | 119 | } |
| 122 | $scope.aCargar = []; | ||
| 123 | }; | 120 | }; |
| 124 | $scope.calcularPorcentaje = function(cisterna) { | 121 | $scope.calcularPorcentaje = function(cisterna) { |
| 125 | if(!cisterna.cisternaCarga.cantidad) { | 122 | if(!cisterna.cisternaCarga.cantidad) { |
| 126 | cisterna.cisternaCarga.cantidad = 0; | 123 | cisterna.cisternaCarga.cantidad = 0; |
| 127 | } | 124 | } |
| 128 | var porcentaje = (cisterna.cisternaCarga.cantidad * 100 / | 125 | var porcentaje = (cisterna.cisternaCarga.cantidad * 100 / |
| 129 | cisterna.capacidad) + '%'; | 126 | cisterna.capacidad) + '%'; |
| 130 | var elementHtml = document.getElementById(cisterna.id); | 127 | var elementHtml = document.getElementById(cisterna.id); |
| 131 | if(elementHtml) { | 128 | if(elementHtml) { |
| 132 | elementHtml.style.width = porcentaje; | 129 | elementHtml.style.width = porcentaje; |
| 133 | } | 130 | } |
| 134 | }; | 131 | }; |
| 135 | $scope.cambioArticulo = function(articulo) { | 132 | $scope.seleccionarArticulo = function(articulo) { |
| 136 | $scope.aCargar = []; | ||
| 137 | $filter('filter')($scope.articulos, {id: articulo.id})[0].checked = true; | ||
| 138 | $scope.articuloSeleccionado = articulo; | 133 | $scope.articuloSeleccionado = articulo; |
| 139 | for(var i = 0; i < $scope.vehiculo.cisternas.length; i++) { | 134 | $scope.cisternaDisabled(); |
| 140 | $scope.vehiculo.cisternas[i] = | 135 | $scope.autoCompletar(); |
| 141 | $scope.cisternaDisabled($scope.vehiculo.cisternas[i]); | ||
| 142 | } | ||
| 143 | var disponible = $filter('filter')($scope.vehiculo.cisternas, {disabled: false}); | ||
| 144 | var index = $scope.vehiculo.cisternas.indexOf(disponible[0]); | ||
| 145 | $scope.aCargar[index] = $scope.articuloSeleccionado.cantidad; | ||
| 146 | $scope.actualizarArticulo(); | 136 | $scope.actualizarArticulo(); |
| 147 | }; | 137 | }; |
| 148 | $scope.actualizarArticulo = function () { | 138 | $scope.actualizarArticulo = function () { |
| 149 | $scope.articuloSeleccionado.cantidadCargada = 0; | 139 | $scope.articuloSeleccionado.cantidadCargada = 0; |
| 150 | for (var i = 0; i < $scope.aCargar.length; i++) { | 140 | for (var i = 0; i < $scope.aCargar.length; i++) { |
| 151 | $scope.articuloSeleccionado.cantidadCargada += | 141 | $scope.articuloSeleccionado.cantidadCargada += |
| 152 | parseFloat($scope.aCargar[i]) || 0; | 142 | parseFloat($scope.aCargar[i]) || 0; |
| 153 | } | 143 | } |
| 154 | }; | 144 | }; |
| 155 | $scope.cisternaDisabled = function(cisterna) { | 145 | $scope.autoCompletar = function() { |
| 156 | if(!$scope.articuloSeleccionado || ($scope.articuloSeleccionado.idArticulo !== | 146 | $scope.aCargar = []; |
| 157 | cisterna.cisternaCarga.idProducto && cisterna.cisternaCarga.idProducto) || | 147 | var disponible = $filter('filter')($scope.vehiculo.cisternas, {disabled: false}); |
| 158 | !$scope.tieneArticulosPendientes()|| $scope.articuloSeleccionado.cantidad > | 148 | var index = $scope.vehiculo.cisternas.indexOf(disponible[0]); |
| 159 | cisterna.disponible) { | 149 | $scope.aCargar[index] = $scope.articuloSeleccionado.cantidad; |
| 160 | cisterna.disabled = true; | 150 | }; |
| 161 | }else { | 151 | $scope.cisternaDisabled = function() { |
| 162 | cisterna.disabled = false; | 152 | for (var i = 0; i < $scope.vehiculo.cisternas.length; i++) { |
| 163 | } | 153 | var cisterna = $scope.vehiculo.cisternas[i]; |
| 164 | return cisterna; | 154 | if(!$scope.articuloSeleccionado || ($scope.articuloSeleccionado.idArticulo !== |
| 155 | cisterna.cisternaCarga.idProducto && cisterna.cisternaCarga.idProducto) || | ||
| 156 | !$scope.tieneArticulosPendientes()|| $scope.articuloSeleccionado.cantidad > | ||
| 157 | cisterna.disponible) { | ||
| 158 | cisterna.disabled = true; | ||
| 159 | }else { | ||
| 160 | cisterna.disabled = false; | ||
| 161 | } | ||
| 162 | } | ||
| 165 | }; | 163 | }; |
| 166 | $scope.rellenarInput = function(input) { | 164 | $scope.rellenarInput = function(input) { |
| 167 | if(!$scope.articuloSeleccionado) return; | 165 | if(!$scope.articuloSeleccionado) return; |
| 166 | if($scope.articuloSeleccionado.cantidad - | ||
| 167 | $scope.articuloSeleccionado.cantidadCargada === 0) { | ||
| 168 | return input; | ||
| 169 | } | ||
| 168 | if(!input) input = 0; | 170 | if(!input) input = 0; |
| 169 | input = parseFloat(input); | 171 | input = parseFloat(input); |
| 170 | if(input === $scope.articuloSeleccionado.cantidad || | ||
| 171 | $scope.articuloSeleccionado.cantidad - | ||
| 172 | $scope.articuloSeleccionado.cantidadCargada === 0) { | ||
| 173 | return input; | ||
| 174 | } | ||
| 175 | input += parseFloat($scope.articuloSeleccionado.cantidad - | 172 | input += parseFloat($scope.articuloSeleccionado.cantidad - |
| 176 | $scope.articuloSeleccionado.cantidadCargada); | 173 | $scope.articuloSeleccionado.cantidadCargada); |
| 177 | return input; | 174 | return input; |
| 178 | }; | 175 | }; |
| 179 | $scope.distribucionDisponible = function() { | 176 | $scope.distribucionDisponible = function() { |
| 180 | if(!$scope.articuloSeleccionado || $scope.articuloSeleccionado.cantidad - | 177 | if(!$scope.articuloSeleccionado || $scope.articuloSeleccionado.cantidad - |
| 181 | $scope.articuloSeleccionado.cantidadCargada !== 0 || | 178 | $scope.articuloSeleccionado.cantidadCargada !== 0 || |
| 182 | !$scope.tieneArticulosPendientes()) { | 179 | !$scope.tieneArticulosPendientes()) { |
| 183 | return false; | 180 | return false; |
| 184 | } | 181 | } |
| 185 | return true; | 182 | return true; |
| 186 | }; | 183 | }; |
| 187 | $scope.tieneArticulosPendientes = function() { | 184 | $scope.tieneArticulosPendientes = function() { |
| 188 | var algunValorNegativo = $scope.aCargar.filter(function(p) { | 185 | var algunValorNegativo = $scope.aCargar.filter(function(p) { |
| 189 | return p < 0; | 186 | return p < 0; |
| 190 | }); | 187 | }); |
| 191 | if(algunValorNegativo.length) { | 188 | if(algunValorNegativo.length) { |
src/views/foca-detalle-vehiculo.html
| 1 | <div class="modal-header"> | 1 | <div class="modal-header"> |
| 2 | <h4>Detalle de carga</h4> | 2 | <h4>Detalle de carga</h4> |
| 3 | Transportista | 3 | Transportista |
| 4 | <strong ng-bind="vehiculo.transportista.COD"></strong> | 4 | <strong ng-bind="vehiculo.transportista.COD"></strong> |
| 5 | <strong ng-bind="vehiculo.transportista.NOM"></strong> | 5 | <strong ng-bind="vehiculo.transportista.NOM"></strong> |
| 6 | Unidad <strong ng-bind="vehiculo.codigo"></strong> | 6 | Unidad <strong ng-bind="vehiculo.codigo"></strong> |
| 7 | Tractor <strong ng-bind="vehiculo.tractor"></strong> | 7 | Tractor <strong ng-bind="vehiculo.tractor"></strong> |
| 8 | <br> | 8 | <br> |
| 9 | <div ng-show="idRemito !== -1"> | 9 | <div ng-show="idRemito !== -1"> |
| 10 | <span>Remito Nº</span> | 10 | <span>Remito Nº</span> |
| 11 | <strong ng-bind="[remito.sucursal, remito.numeroRemito] | comprobante"></strong> | 11 | <strong ng-bind="[remito.sucursal, remito.numeroRemito] | comprobante"></strong> |
| 12 | <span>, Fecha</span> | 12 | <span>, Fecha</span> |
| 13 | <strong ng-bind="remito.fechaRemito | date: 'dd/MM/yyyy HH:mm'"></strong> | 13 | <strong ng-bind="remito.fechaRemito | date: 'dd/MM/yyyy HH:mm'"></strong> |
| 14 | <span>, Cliente</span> | 14 | <span>, Cliente</span> |
| 15 | <strong ng-bind="remito.nombreCliente"></strong> | 15 | <strong ng-bind="remito.nombreCliente"></strong> |
| 16 | <span>, Domicilio entrega</span> | 16 | <span>, Domicilio entrega</span> |
| 17 | <strong ng-bind="remito.domicilioStamp"></strong> | 17 | <strong ng-bind="remito.domicilioStamp"></strong> |
| 18 | </div> | 18 | </div> |
| 19 | </div> | 19 | </div> |
| 20 | <div class="modal-body"> | 20 | <div class="modal-body"> |
| 21 | <div> | 21 | <div> |
| 22 | <table class="table table-sm" ng-show="idRemito !== -1"> | 22 | <table class="table table-sm" ng-show="idRemito !== -1"> |
| 23 | <thead> | 23 | <thead> |
| 24 | <tr> | 24 | <tr> |
| 25 | <th></th> | 25 | <th></th> |
| 26 | <th>Articulo</th> | 26 | <th>Articulo</th> |
| 27 | <th>Cantidad</th> | 27 | <th>Cantidad</th> |
| 28 | <th>Cargado</th> | 28 | <th>Cargado</th> |
| 29 | <th>Resta asignar</th> | 29 | <th>Resta asignar</th> |
| 30 | </tr> | 30 | </tr> |
| 31 | </thead> | 31 | </thead> |
| 32 | <tbody> | 32 | <tbody> |
| 33 | <tr ng-repeat="(key, articulo) in articulos"> | 33 | <tr ng-repeat="(key, articulo) in articulos"> |
| 34 | <td><input | 34 | <td><input |
| 35 | type="radio" | 35 | type="radio" |
| 36 | name="articuloRadio" | 36 | name="articuloRadio" |
| 37 | id="{{'articulo' + articulo.id}}" | 37 | id="{{'articulo' + articulo.id}}" |
| 38 | ng-checked="articulo.checked" | 38 | ng-checked="articuloSeleccionado.id === articulo.id" |
| 39 | ng-disabled="articulo.cargado" | 39 | ng-disabled="articulo.cargado" |
| 40 | ng-click="cambioArticulo(articulo)" | 40 | ng-click="seleccionarArticulo(articulo)" |
| 41 | ></td> | 41 | ></td> |
| 42 | <td ng-bind="articulo.descripcion"></td> | 42 | <td ng-bind="articulo.descripcion"></td> |
| 43 | <td ng-bind="articulo.cantidad"></td> | 43 | <td ng-bind="articulo.cantidad"></td> |
| 44 | <td ng-bind="articulo.cantidadCargada || 0"></td> | 44 | <td ng-bind="articulo.cantidadCargada || 0"></td> |
| 45 | <td ng-bind="articulo.cantidad - articulo.cantidadCargada"></td> | 45 | <td ng-bind="articulo.cantidad - articulo.cantidadCargada"></td> |
| 46 | </tr> | 46 | </tr> |
| 47 | </tbody> | 47 | </tbody> |
| 48 | </table> | 48 | </table> |
| 49 | <table class="table table-sm" ladda="cargandoDatos" data-spinner-color="#FF0000"> | 49 | <table class="table table-sm" ladda="cargandoDatos" data-spinner-color="#FF0000"> |
| 50 | <thead> | 50 | <thead> |
| 51 | <tr> | 51 | <tr> |
| 52 | <th width="10%">Cisterna</th> | 52 | <th width="10%">Cisterna</th> |
| 53 | <th>Capacidad</th> | 53 | <th>Capacidad</th> |
| 54 | <th>Articulo cargado</th> | 54 | <th>Articulo cargado</th> |
| 55 | <th width="20%">Asignado</th> | 55 | <th width="20%">Asignado</th> |
| 56 | <th>Cargado / Capacidad Disponible</th> | 56 | <th>Cargado / Capacidad Disponible</th> |
| 57 | </tr> | 57 | </tr> |
| 58 | </thead> | 58 | </thead> |
| 59 | <tbody> | 59 | <tbody> |
| 60 | <tr ng-repeat="(key, cisterna) in vehiculo.cisternas"> | 60 | <tr ng-repeat="(key, cisterna) in vehiculo.cisternas"> |
| 61 | <td class="py-3" ng-bind="cisterna.codigo"></td> | 61 | <td class="py-3" ng-bind="cisterna.codigo"></td> |
| 62 | <td class="py-3" ng-bind="cisterna.capacidad"></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> | 63 | <td class="py-3" ng-bind="cisterna.cisternaCarga.articulo.DetArt || 'Sin asignar'"></td> |
| 64 | <td ng-if="idRemito != -1"> | 64 | <td ng-if="idRemito != -1"> |
| 65 | <input | 65 | <input |
| 66 | class="form-control" | 66 | class="form-control" |
| 67 | foca-tipo-input | 67 | foca-tipo-input |
| 68 | foca-teclado | 68 | foca-teclado |
| 69 | placeholder="A cargar..." | 69 | placeholder="A cargar..." |
| 70 | ng-model="aCargar[key]" | 70 | ng-model="aCargar[key]" |
| 71 | ng-disabled="cisterna.disabled" | 71 | ng-disabled="cisterna.disabled" |
| 72 | ng-focus="aCargar[key] = rellenarInput(aCargar[key]); actualizarArticulo()" | 72 | ng-focus="aCargar[key] = rellenarInput(aCargar[key]); actualizarArticulo()" |
| 73 | ng-change="actualizarArticulo()" | 73 | ng-change="actualizarArticulo()" |
| 74 | > | 74 | > |
| 75 | </td> | 75 | </td> |
| 76 | <td ng-if="idRemito == -1"> | 76 | <td ng-if="idRemito == -1"> |
| 77 | <input | 77 | <input |
| 78 | class="form-control" | 78 | class="form-control" |
| 79 | placeholder="A cargar..." | 79 | placeholder="A cargar..." |
| 80 | readonly> | 80 | readonly> |
| 81 | </td> | 81 | </td> |
| 82 | <td><div class="progress foca-alto-progress pl-0 pr-0 mt-1"> | 82 | <td><div class="progress foca-alto-progress pl-0 pr-0 mt-1"> |
| 83 | <strong | 83 | <strong |
| 84 | class="mt-2 col-4 text-center position-absolute" | 84 | class="mt-2 col-4 text-center position-absolute" |
| 85 | ng-bind="(cisterna.cisternaCarga.cantidad || 0) + '/' + | 85 | ng-bind="(cisterna.cisternaCarga.cantidad || 0) + '/' + |
| 86 | (cisterna.capacidad - cisterna.cisternaCarga.cantidad)"> | 86 | (cisterna.capacidad - cisterna.cisternaCarga.cantidad)"> |
| 87 | </strong> | 87 | </strong> |
| 88 | <div | 88 | <div |
| 89 | id="{{cisterna.id}}" | 89 | id="{{cisterna.id}}" |
| 90 | class="progress-bar" | 90 | class="progress-bar" |
| 91 | role="progressbar" | 91 | role="progressbar" |
| 92 | aria-valuemin="0" | 92 | aria-valuemin="0" |
| 93 | aria-valuemax="{{cisterna.capacidad}}" | 93 | aria-valuemax="{{cisterna.capacidad}}" |
| 94 | ng-style="{'width':'{{calcularPorcentaje(cisterna)}}'}"> | 94 | ng-style="{'width':'{{calcularPorcentaje(cisterna)}}'}"> |
| 95 | </div> | 95 | </div> |
| 96 | </div> | 96 | </div> |
| 97 | </td> | 97 | </td> |
| 98 | </tr> | 98 | </tr> |
| 99 | </tbody> | 99 | </tbody> |
| 100 | </table> | 100 | </table> |
| 101 | <div class="col-12 aling-end"> | 101 | <div class="col-12"> |
| 102 | <button | 102 | <button |
| 103 | class="form-control btn btn-success" | 103 | class="form-control btn btn-success" |
| 104 | ladda="cargando" | 104 | ladda="cargando" |
| 105 | data-spinner-color="#FF0000" | 105 | data-spinner-color="#FF0000" |
| 106 | type="button" | 106 | type="button" |
| 107 | ng-disabled="!distribucionDisponible()" | 107 | ng-disabled="!distribucionDisponible()" |
| 108 | ng-class="{'btn-light': !distribucionDisponible()}" | 108 | ng-class="{'btn-light': !distribucionDisponible()}" |
| 109 | ng-click="cargarACisternas(vehiculo)" | 109 | ng-click="cargarACisternas(vehiculo)" |
| 110 | foca-focus="distribucionDisponible()"> | 110 | foca-focus="distribucionDisponible()"> |
| 111 | Aplicar distribución de cargas | 111 | Aplicar distribución de cargas |
| 112 | </button> | 112 | </button> |
| 113 | </div> | 113 | </div> |
| 114 | </div> | 114 | </div> |
| 115 | </div> | 115 | </div> |
| 116 | <div class="modal-footer py-1"> | 116 | <div class="modal-footer py-1"> |
| 117 | <button | 117 | <button |
| 118 | class="btn btn-sm btn-secondary" | 118 | class="btn btn-sm btn-secondary" |
| 119 | ladda="cargando" | 119 | ladda="cargando" |
| 120 | type="button" | 120 | type="button" |
| 121 | ng-click="cancelar()">Cancelar</button> | 121 | ng-click="cancelar()">Cancelar</button> |
| 122 | <button | 122 | <button |
| 123 | class="btn btn-sm btn-primary" | 123 | class="btn btn-sm btn-primary" |
| 124 | ladda="cargando" | 124 | ladda="cargando" |
| 125 | type="button" | 125 | type="button" |
| 126 | ng-click="aceptar()" | 126 | ng-click="aceptar()" |
| 127 | ng-disabled="tieneArticulosPendientes() || idRemito === -1">Cargar</button> | 127 | ng-disabled="tieneArticulosPendientes() || idRemito === -1" |
| 128 | foca-focus="!tieneArticulosPendientes() && idRemito !== -1">Cargar</button> | ||
| 128 | </div> | 129 | </div> |
| 129 | 130 |