foca-abm-vehiculos-item.html 12 KB
<div class="row">
    <foca-cabecera-facturador 
    titulo="'Vehiculo / ' + tipo"
    fecha="now"
    class="mb-0 col-lg-12"
    ></foca-cabecera-facturador>
</div>
<div class="row">
    <div class="col-12 col-md-10 p-0 mt-4 border border-white rounded">
        <form name="formVehiculo" class="px-3">
            <input type="hidden" name="id" ng-model="sector.id" />
            <div class="row mt-3">
                <div class="form-group d-flex mb-2 col-md-6">
                    <label class="col-form-label col-md-4">Unidad</label>
                    <div class="input-group col-md-8 pl-0">
                        <input
                            class="form-control"
                            type="text"
                            teclado-virtual
                            ng-model="vehiculo.codigo"
                            foca-focus="focused == 1"
                            ng-focus="focused = 1"
                            ng-keypress="next($event.keyCode)"
                            ng-disabled="!nuevo"
                        />
                    </div>
                </div>
                <div class="form-group d-flex mb-2 col-md-6">
                    <label class="col-form-label col-md-4">Dominio tractor</label>
                    <div class="input-group col-md-8 pl-0">
                        <input
                            class="form-control"
                            type="text"
                            teclado-virtual
                            ng-model="vehiculo.tractor"
                            ng-required="true"
                            foca-focus="focused == 2"
                            ng-focus="focused = 2"
                            ng-keypress="next($event.keyCode)"
                        />
                    </div>
                </div>
                <div class="form-group d-flex mb-2 col-md-6">
                    <label class="col-form-label col-md-4">Dominio semi</label>
                    <div class="input-group col-md-8 pl-0">
                        <input
                            class="form-control"
                            type="text"
                            teclado-virtual
                            ng-model="vehiculo.semi"
                            ng-required="true"
                            foca-focus="focused == 3"
                            ng-focus="focused = 3"
                            ng-keypress="next($event.keyCode)"
                        />
                    </div>
                </div>
                <div class="form-group d-flex mb-2 col-md-6">
                    <label class="col-form-label col-md-4">Capacidad total</label>
                    <div class="input-group col-md-8 pl-0">
                        <input
                            class="form-control"
                            foca-tipo-input
                            solo-positivos
                            teclado-virtual
                            ng-model="vehiculo.capacidad"
                            ng-required="true"
                            foca-focus="focused == 4"
                            ng-focus="focused = 4"
                            ng-disabled="nuevo || !nuevo"
                        />
                    </div>
                </div>
            </div>
        </form>
        <div>
            <h5 class="pl-4 table-title">Cisternas</h5>
            <table class="table table-default table-hover table-sm table-abm table-striped mb-0" >
                <thead>
                    <tr>
                        <th class="text-center px-4">Código</th>
                        <th class="text-center">Capacidad</th>
                        <th class="text-center">Unidad de Medida</th>
                        <th class="text-center">
                            <button 
                                class="btn btn-outline-debo boton-accion"
                                title="Agregar Cisterna"
                                ng-click="crearCisterna(); focused = 1"
                                ng-disabled="crear"
                                foca-focus="focused == 5"
                                ng-focus="focused = 5"
                            >
                                <i class="fa fa-plus"></i>
                            </button>
                        </th>
                    </tr> 
                </thead>
                <tbody>
                    <tr ng-show="creando">
                        <td align="center">
                            <input
                                class="form-control text-uppercase foca-input ng-not-empty ng-valid ng-valid-required ng-touched"
                                ng-model="cisterna.codigo"
                                ng-keypress="next($event.keyCode)"
                                foca-focus="focused == 1"
                                ng-focus="focused = 1"
                                ng-disabled="!nuevoCisterna"
                                teclado-virtual
                            >
                        </td>
                        <td align="center">
                            <input
                                class="form-control text-uppercase foca-input ng-not-empty ng-valid ng-valid-required ng-touched" 
                                teclado-virtual
                                foca-tipo-input
                                solo-positivos
                                ng-model="cisterna.capacidad"
                                ng-required="true"
                                ng-keypress="next($event.keyCode)"
                                foca-focus="focused == 2"
                                ng-focus="focused = 2"
                            >
                        </td>
                        <td align="center">
                            <div class="input-group">
                                <input 
                                    ng-model="cisterna.unidadMedida.NOM"
                                    class="form-control"
                                    readonly
                                />
                                <div class="input-group-append">
                                    <button
                                        ladda="searchLoading"
                                        class="btn btn-outline-secondary form-control"
                                        type="button"
                                        ng-click="seleccionarUnidadMedida()"
                                        foca-focus="focused == 3"
                                    >
                                        <i class="fa fa-search" aria-hidden="true"></i>
                                    </button>
                                </div>
                            </div>
                        </td>
                        <td align="center">
                            <button
                                class="btn btn-outline-dark boton-accion"
                                ng-click="agregarCisterna()"
                            >
                                <i class="fa fa-save"></i>
                            </button>
                        </td>
                    </tr>

                    <tr ng-repeat="(key, cisterna) in cisternas | filter:filtros" ng-hide="cisterna.desactivado">
                        <td ng-bind="cisterna.codigo" class="text-center" ng-hide="cisterna.editando"></td>
                        <td align="center" ng-show="cisterna.editando">
                            <input
                                class="form-control text-uppercase foca-input ng-not-empty ng-valid ng-valid-required ng-touched"
                                ng-model="cisterna.codigo"
                                ng-keypress="next($event.keyCode)"
                                foca-focus="focused == 1"
                                ng-focus="focused = 1"
                                teclado-virtual
                                esc-key="volver(cisterna, key)"
                            >
                        </td>
                        <td ng-bind="cisterna.capacidad" class="text-center" ng-hide="cisterna.editando"></td>
                        <td align="center" ng-show="cisterna.editando" >
                            <input
                                class="form-control text-uppercase foca-input ng-not-empty ng-valid ng-valid-required ng-touched" 
                                teclado-virtual
                                foca-tipo-input
                                solo-positivos
                                ng-model="cisterna.capacidad"
                                ng-required="true"
                                ng-keypress="next($event.keyCode)"
                                foca-focus="focused == 2"
                                ng-focus="focused = 2"
                                esc-key="volver(cisterna, key)"
                            >
                        </td>
                        <td ng-bind="cisterna.unidadMedida.NOM" class="text-center" ng-hide="cisterna.editando"></td>
                        <td align="center" ng-show="cisterna.editando">
                            <div class="input-group">
                                <input 
                                    ng-model="cisterna.unidadMedida.NOM"
                                    class="form-control"
                                    ng-keypress="seleccionarUnidadMedida($event.keyCode,cisterna)"
                                    readonly
                                    esc-key="volver(cisterna, key)"
                                />
                                <div class="input-group-append">
                                    <button
                                        ladda="searchLoading"
                                        class="btn btn-outline-secondary form-control"
                                        type="button"
                                        ng-click="seleccionarUnidadMedida(13,cisterna)"
                                        foca-focus="focused == 3"
                                    >
                                        <i class="fa fa-search" aria-hidden="true"></i>
                                    </button>
                                </div>
                            </div>
                        </td>
                        <td class="text-center" ng-hide="cisterna.editando">
                            <button
                                class="btn btn-outline-dark boton-accion"
                                title="Editar"
                                ng-click="editar(cisterna)"
                            >
                                <i class="fa fa-pencil"></i>
                            </button>
                            <button
                                class="btn btn-outline-dark boton-accion"
                                title="Eliminar"
                                ng-click="solicitarConfirmacionTabla(cisterna, $index)"
                            >
                                <i class="fa fa-trash"></i>
                            </button>
                        </td>
                        <td align="center" ng-show="cisterna.editando" >
                            <button
                                class="btn btn-outline-dark boton-accion"
                                ng-click="agregarCisterna(cisterna)"
                            >
                                <i class="fa fa-save"></i>
                            </button>
                            <button
                                class="btn btn-outline-dark boton-accion"
                                ng-click="volver(cisterna, key)"
                            >
                                <i class="fa fa-undo" aria-hidden="true"></i>
                            </button>
                        </td>
                    </tr>
                    <tr ng-repeat="(key, cisterna) in cisternas" ng-show="false">
                    </tr>
                </body>
            </table>
        </div>
    </div>
</div>