modal-precio-condicion.html 7.4 KB
<div class="modal-header py-1">
    <div class="row w-100">
        <div class="col-lg-6">
            <h5 ng-show="!ingreso" class="modal-title my-1">Busqueda de Precio-Condición</h5>
            <h5 ng-show="ingreso" class="modal-title my-1">Nuevos Plazos</h5>
        </div>
        <div class="input-group col-lg-6 pr-0 my-2" ng-show="!ingreso">
            <input
                type="text"
                class="form-control form-control-sm"
                id="search"
                placeholder="Busqueda"
                ng-model="filters"
                ng-change="search()"
                ng-keydown="busquedaDown($event.keyCode)"
                ng-keypress="busquedaPress($event.keyCode)"
                foca-focus="selectedPrecioCondicion == -1"
                ng-focus="selectedPrecioCondicion = -1"
                teclado-virtual
            >
            <div class="input-group-append">
                <button class="btn btn-outline-secondary" type="button" ng-click="busquedaPress(13)">
                    <i class="fa fa-search" aria-hidden="true"></i>
                </button>
            </div>
        </div>
    </div>
</div>
<div class="modal-body" id="modal-body">
    

    <table ng-show="!ingreso" class="table table-striped table-sm">
        <thead>
            <tr>
                <th>Código</th>
                <th>Nombre</th>
                <th>Lista Precio</th>
                <th>Plazos</th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            <tr ng-show="currentPagePrecioCondicion.length == 0">
                <td colspan="6">
                    No se encontraron resultados.
                </td>
            </tr>
            <tr>
                <td colspan="4" ng-show="!ingreso">
                    <input
                        class="form-control form-control-sm"
                        type="text"
                        placeholder="Selección manual"
                        readonly
                        ng-click="ingreso = !ingreso"
                        />
                </td>
                <td colspan="1" ng-show="!ingreso">
                    <button
                        type="button"
                        class="btn btn-sm p-1 float-right"
                        ng-class="{
                            'btn-secondary': selectedPrecioCondicion != 0,
                            'btn-primary': selectedPrecioCondicion == 0
                        }"
                        foca-focus="selectedPrecioCondicion == 0"
                        ng-keydown="itemProducto($event.keyCode)"
                        ng-click="ingreso = !ingreso"
                    >
                        <i class="fa fa-circle-thin" aria-hidden="true"></i>
                    </button>
                </td>
            </tr>
            <tr class="selectable"
                ng-repeat="(key, precioCondicion) in currentPagePrecioCondicion"
                ng-click="select(precioCondicion)">
                <td ng-bind="precioCondicion.id | rellenarDigitos: 4: 0"></td>
                <td ng-bind="precioCondicion.nombre"></td>
                <td ng-bind="precioCondicion.idListaPrecio"></td>
                <td ng-bind="precioCondicion.plazos"></td>
                <td>
                    <button
                        type="button"
                        class="btn btn-sm p-1 float-right"
                        ng-class="{
                            'btn-secondary': selectedPrecioCondicion != key + 1,
                            'btn-primary': selectedPrecioCondicion == key + 1
                        }"
                        foca-focus="selectedPrecioCondicion == {{key + 1}}"
                        ng-keydown="itemProducto($event.keyCode)"
                    >
                        <i class="fa fa-circle-thin" aria-hidden="true"></i>
                    </button>
                </td>
            </tr>
        </tbody>
    </table>
    
    <table class="table table-striped table-sm" ng-show="ingreso">
        <thead>
            <tr>
                <th>Item</th>
                <th>Días</th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>
                    <input
                        type="number"
                        class="form-control text-right"
                        ng-model="plazoACargar.item"
                        readonly
                    />
                </td>
                <td>
                    <input
                        type="number"
                        class="form-control text-right"
                        min="0"
                        ng-model="plazoACargar.dias"
                        ng-keypress="agregarPlazo($event.keyCode)"
                        foca-focus="ingreso"
                    />
                </td>
                <td class="text-center">
                    <button
                        class="btn btn-outline-secondary"
                        ng-click="agregarPlazo(13)"
                    >
                        <i class="fa fa-save"></i>
                    </button>
                </td>
            </tr>
            <tr ng-repeat="(key, plazo) in plazosNuevos">
                <td class="text-right" ng-bind="key + 1"></td>
                <td class="text-right" ng-bind="plazo.dias"></td>
                <td class="text-center">
                    <button
                        class="btn btn-outline-secondary"
                        ng-click="quitarPlazo(key)"
                    >
                        <i class="fa fa-trash"></i>
                    </button>
                </td>
            </tr>
        </tbody>
    </table>
</div>
<div class="modal-footer py-1">
    <nav ng-show="currentPagePrecioCondicion.length > 0 && !ingreso" class="mr-auto">
        <ul class="pagination pagination-sm mb-0">
            <li class="page-item" ng-class="{'disabled': currentPage == 1}">
                <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage - 1)">
                    <span aria-hidden="true">&laquo;</span>
                    <span class="sr-only">Anterior</span>
                </a>
            </li>
            <li
                class="page-item"
                ng-repeat="pagina in paginas"
                ng-class="{'active': pagina == currentPage}"
            >
                <a
                    class="page-link"
                    href="javascript:void();"
                    ng-click="selectPage(pagina)"
                    ng-bind="pagina"
                ></a>
            </li>
            <li class="page-item" ng-class="{'disabled': currentPage == lastPage}">
                <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage + 1)">
                    <span aria-hidden="true">&raquo;</span>
                    <span class="sr-only">Siguiente</span>
                </a>
            </li>
        </ul>
    </nav>
    <button
        ng-show="!ingreso"
        class="btn btn-sm btn-secondary"
        type="button"
        ng-click="cancel()"
    >Cancelar
    </button>
    <button
        ng-show="ingreso"
        ng-disabled="plazosNuevos.length === 0"
        class="btn btn-sm btn-primary"
        type="button"
        ng-click="select(plazosNuevos)"
    >Aceptar
    </button>
    <button
        ng-show="ingreso"
        class="btn btn-sm btn-secondary"
        type="button"
        ng-click="volver()"
    >Volver
    </button>
</div>