foca-detalle-vehiculo.html 5.89 KB
<div class="modal-header">
    <h4>Detalle de carga</h4>
    Transportista
    <strong ng-bind="vehiculo.transportista.COD"></strong>
    <strong ng-bind="vehiculo.transportista.NOM"></strong>
    Unidad <strong ng-bind="vehiculo.codigo"></strong>
    Tractor <strong ng-bind="vehiculo.tractor"></strong>
    <br>
    <div ng-show="idRemito !== -1">
        <span>Remito Nº</span>
        <strong ng-bind="[remito.sucursal, remito.numeroRemito] | comprobante"></strong>
        <span>, Fecha</span>
        <strong ng-bind="remito.fechaRemito | date: 'dd/MM/yyyy HH:mm'"></strong>
        <span>, Cliente</span>
        <strong ng-bind="remito.nombreCliente"></strong>
        <span>, Domicilio entrega</span>
        <strong ng-bind="remito.domicilioStamp"></strong>
    </div>
</div>
<div class="modal-body">
    <div>
        <table class="table table-sm" ng-show="idRemito !== -1">
            <thead>
                <tr>
                    <th></th>
                    <th>Articulo</th>
                    <th>Cantidad</th>
                    <th>Cargado</th>
                    <th>Resta asignar</th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="(key, articulo) in articulos">
                    <td><input
                        type="radio"
                        name="articuloRadio"
                        id="{{'articulo' + articulo.id}}"
                        ng-checked="articuloSeleccionado.id === articulo.id"
                        ng-disabled="articulo.cargado"
                        ng-click="seleccionarArticulo(articulo)"
                    ></td>
                    <td ng-bind="articulo.descripcion"></td>
                    <td ng-bind="articulo.cantidad"></td>
                    <td ng-bind="articulo.cantidadCargada || 0"></td>
                    <td ng-bind="articulo.cantidad - articulo.cantidadCargada"></td>
                </tr>
            </tbody>
        </table>
        <table class="table table-sm" ladda="cargandoDatos" data-spinner-color="#FF0000">
            <thead>
                <tr>
                    <th width="10%">Cisterna</th>
                    <th>Capacidad</th>
                    <th>Articulo cargado</th>
                    <th width="20%">Por asignar</th>
                    <th>Cargado / Capacidad Disponible</th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="(key, cisterna) in cisternas">
                    <td class="py-3" ng-bind="cisterna.codigo"></td>
                    <td class="py-3" ng-bind="cisterna.capacidad"></td>
                    <td class="py-3" ng-bind="cisterna.cisternaCarga.articulo.DetArt || 'Sin asignar'"></td>
                    <td ng-if="idRemito != -1">
                        <input
                            class="form-control"
                            foca-tipo-input
                            foca-teclado
                            placeholder="A cargar..."
                            ng-model="aCargar[key]"
                            ng-disabled="cisterna.disabled || !tieneArticulosPendientes()"
                            ng-focus="aCargar[key] = rellenarInput(aCargar[key], cisterna); actualizarArticulo()"
                            ng-change="actualizarArticulo()"
                        >
                    </td>
                    <td ng-if="idRemito == -1">
                        <input
                            class="form-control"
                            placeholder="A cargar..."
                            readonly>
                    </td>
                    <td><div class="progress foca-alto-progress pl-0 pr-0 mt-1">
                            <strong
                                class="mt-2 col-4 text-center position-absolute"
                                ng-bind="(cisterna.cisternaCarga.cantidad || 0) + '/' +
                                    (cisterna.capacidad - cisterna.cisternaCarga.cantidad)">
                            </strong>
                            <div
                                id="{{cisterna.id}}"
                                class="progress-bar"
                                role="progressbar"
                                aria-valuemin="0"
                                aria-valuemax="{{cisterna.capacidad}}"
                                ng-style="{'width':'{{calcularPorcentaje(cisterna)}}'}">
                            </div>
                        </div>
                    </td>
                    <td>
                        <button 
                            class="btn btn-outline-secondary"
                            ng-disabled="!cisterna.cisternaCarga.remitos.length"
                            ng-click="verRemitos(cisterna.cisternaCarga.remitos)">
                            <i class="fa fa-info" aria-hidden="true"></i>
                        </button>
                    </td>
                </tr>
            </tbody>
        </table>
        <div class="col-12">
            <button
                class="form-control btn btn-success"
                ladda="cargando"
                data-spinner-color="#FF0000"
                type="button"
                ng-disabled="!distribucionDisponible()"
                ng-class="{'btn-light': !distribucionDisponible()}"
                ng-click="cargarACisternas(vehiculo)"
                foca-focus="distribucionDisponible()">
                Aplicar distribución de cargas
            </button>
        </div>
    </div>
</div>
<div class="modal-footer py-1">
    <button
        class="btn btn-sm btn-secondary"
        ladda="cargando"
        type="button"
        ng-click="cancelar()">Cancelar</button>
    <button
        class="btn btn-sm btn-primary"
        ladda="cargando"
        type="button"
        ng-click="aceptar()"
        ng-disabled="tieneArticulosPendientes() || idRemito === -1"
        foca-focus="!tieneArticulosPendientes() && idRemito !== -1">Cargar</button>
</div>