foca-abm-choferes-listado.html 8.3 KB
<div class="row">
    <foca-cabecera-facturador 
    titulo="'Choferes'"
    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">
        <div class="row px-5 py-2 botonera-secundaria">
            <div class="col-12">
                <foca-botonera-facturador botones="botonera" max="6" class="row"></foca-botonera-facturador>
            </div>
        </div>
        <table class="table table-default table-hover table-sm table-abm table-striped mb-0">
            <thead>
                <tr>
                    <th>Nombre</th>
                    <th>Tipo</th>
                    <th>Documento</th>
                    <th>Teléfono</th>
                    <th class="text-center">
                        <button
                            title="Agregar"
                            class="btn btn-outline-debo boton-accion"
                            ng-click="crearChofer()"
                            ng-disabled="!crear"
                        >
                            <i class="fa fa-plus"></i>
                        </button>
                    </th>
                </tr>
            </thead>
            <tbody>
                <tr ng-show="creando">
                    <td align="center">
                        <input
                            class="form-control"
                            type="text"
                            teclado-virtual
                            ng-model="chofer.nombre"
                            ng-required="true"
                            ng-keypress="next($event.keyCode)"
                            foca-focus="focused == 1"
                            ng-focus="focused = 1"
                        >
                    </td>
                    <td align="center">
                        <div class="col-sm-4">
                            <select 
                                class="form-control"
                                ng-options="tipoDocumento.id as tipoDocumento.descripcion for tipoDocumento in tiposDocumento track by tipoDocumento.id"
                                ng-model="chofer.idTipoDocumento">
                            </select>
                        </div>
                    </td>
                    <td align="center">
                        <input
                            class="form-control"
                            foca-tipo-input
                            teclado-virtual
                            solo-positivos
                            limite-numeros-max="15"
                            ng-model="chofer.dni"
                            ng-required="true"
                            ng-keypress="next($event.keyCode)"
                            foca-focus="focused == 2"
                            ng-focus="focused = 2"
                            ng-disabled="!nuevo"
                            string-toNumber
                        >
                    </td>
                    <td align="center">
                        <input
                            class="form-control"
                            foca-tipo-input
                            teclado-virtual
                            solo-positivos
                            limite-numeros-max="15"
                            ng-model="chofer.telefono"
                            ng-required="true"
                            foca-focus="focused == 3"
                            ng-focus="focused = 3"
                            string-toNumber
                        >
                    </td>
                    <td align="center">
                            <button
                                class="btn btn-outline-dark boton-accion"
                                ng-click="agregarChofer()"
                            >
                                <i class="fa fa-save"></i>
                            </button>
                        </td>
                </tr>
                
                <tr ng-repeat="(key, chofer) in choferes | filter:filters" ng-hide="chofer.desactivado">
                    <td ng-bind="chofer.nombre" ng-hide="chofer.editando"></td>
                    <td align="center" ng-show="chofer.editando">
                        <input
                            class="form-control"
                            type="text"
                            teclado-virtual
                            ng-model="chofer.nombre"
                            ng-required="true"
                            ng-keypress="next($event.keyCode)"
                            foca-focus="focused == 1"
                            ng-focus="focused = 1"
                            esc-key="volver(chofer, key)"
                        >
                    </td>
                    <td ng-bind="tipoDocumento(chofer.idTipoDocumento)" ng-hide="chofer.editando"></td>
                    <td align="center" ng-show="chofer.editando">
                            <div class="col-sm-15">
                                <select 
                                    class="form-control"
                                    ng-options="tipoDocumento.id as tipoDocumento.descripcion for tipoDocumento in tiposDocumento track by tipoDocumento.id"
                                    ng-model="chofer.idTipoDocumento">
                                </select>
                            </div>
                        </td>
                    <td ng-bind="chofer.dni" ng-hide="chofer.editando">
                        <td align="center" ng-show="chofer.editando">
                            <input
                                class="form-control"
                                type="text"
                                teclado-virtual
                                ng-model="chofer.dni"
                                ng-required="true"
                                ng-keypress="next($event.keyCode)"
                                foca-focus="focused == 2"
                                ng-focus="focused = 2"
                                esc-key="volver(chofer, key)"
                            >
                        </td>
                    </td>
                    <td ng-bind="chofer.telefono" ng-hide="chofer.editando"></td>
                    <td align="center" ng-show="chofer.editando">
                        <input
                            class="form-control"
                            foca-tipo-input
                            teclado-virtual
                            solo-positivos
                            limite-numeros-max="15"
                            ng-model="chofer.telefono"
                            ng-required="true"
                            foca-focus="focused == 3"
                            ng-focus="focused = 3"
                            string-toNumber
                            esc-key="volver(chofer, key)"
                        >
                    </td>
                    <td class="text-center" ng-hide="chofer.editando">
                        <button
                            class="btn btn-outline-dark boton-accion"
                            title="Editar"
                            ng-click="editar(chofer)"
                        >
                            <i class="fa fa-pencil"></i>
                        </button>
                        <button
                            class="btn btn-outline-dark boton-accion"
                            title="Eliminar"
                            ng-click="solicitarConfirmacion(chofer)"
                        >
                            <i class="fa fa-trash"></i>
                        </button>
                    </td>
                    <td align="center" ng-show="chofer.editando">
                        <button
                            class="btn btn-outline-dark boton-accion"
                            ng-click="agregarChofer(chofer)"
                        >
                            <i class="fa fa-save"></i>
                        </button>
                        <button
                            class="btn btn-outline-dark boton-accion"
                            ng-click="volver(chofer, key)"
                        >
                            <i class="fa fa-undo" aria-hidden="true"></i>
                        </button>
                    </td>
                </tr>
            </body>
        </table>
    </div>
</div>