You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
124 lines
7.1 KiB
124 lines
7.1 KiB
7 months ago
|
<?xml version='1.0' encoding='UTF-8' ?>
|
||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
<html xmlns="http://www.w3.org/1999/xhtml"
|
||
|
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
|
||
|
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
||
|
xmlns:p="http://primefaces.org/ui"
|
||
|
xmlns:f="http://xmlns.jcp.org/jsf/core">
|
||
|
<ui:composition template="./template/templatePlantilla.xhtml">
|
||
|
|
||
|
<ui:define name="top">
|
||
|
INVENTARIO
|
||
|
</ui:define>
|
||
|
|
||
|
<ui:define name="content">
|
||
|
<div class="card crud-demo">
|
||
|
<h:form id="form">
|
||
|
<p:growl id="messages" showDetail="true" />
|
||
|
|
||
|
<p:toolbar>
|
||
|
<p:toolbarGroup>
|
||
|
<p:commandButton value="Nueva Ubicacion 📍" icon="pi pi-plus" actionListener="#{ubiBean.prepararNuevaUbicacion()}"
|
||
|
update=":dialogs:manage-product-content" oncomplete="PF('manageProductDialog').show()"
|
||
|
styleClass="ui-button-raised ui-button-flat" style="margin-right: 0.5rem">
|
||
|
<p:resetInput target=":dialogs:manage-product-content" />
|
||
|
</p:commandButton>
|
||
|
</p:toolbarGroup>
|
||
|
</p:toolbar>
|
||
|
|
||
|
|
||
|
<p:dataTable id="dt-ubi" widgetVar="dtUbi" var="ubicacion" value="#{ubiBean.ubicaciones}"
|
||
|
reflow="true" styleClass="products-table"
|
||
|
rowKey="#{ubiBean.ubicacion.idUbicacion}" paginator="true" rows="10" rowSelectMode="add" paginatorPosition="bottom">
|
||
|
|
||
|
<f:facet name="header">
|
||
|
<div class="products-table-header">
|
||
|
<span style="font-weight: bold">Ubicaciones</span>
|
||
|
<span class="filter-container ui-input-icon-left"> <i class="pi pi-search"></i>
|
||
|
<p:inputText id="globalFilter" onkeyup="PF('dtUbi').filter()" placeholder="Search" />
|
||
|
</span>
|
||
|
</div>
|
||
|
</f:facet>
|
||
|
|
||
|
<p:column headerText="No.°" sortBy="#{ubicacion.idUbicacion}" filterBy="#{ubicacion.idUbicacion}">
|
||
|
<h:outputText value="#{ubicacion.idUbicacion}" />
|
||
|
</p:column>
|
||
|
|
||
|
<p:column headerText="Pasillo" sortBy="#{ubicacion.pasillo}" filterBy="#{ubicacion.pasillo}">
|
||
|
<h:outputText value="#{ubicacion.pasillo}" />
|
||
|
</p:column>
|
||
|
|
||
|
<p:column headerText="Anaquel" sortBy="#{ubicacion.anaquel}" filterBy="#{ubicacion.anaquel}">
|
||
|
<h:outputText value="#{ubicacion.anaquel}" />
|
||
|
</p:column>
|
||
|
|
||
|
<p:column headerText="Nivel" sortBy="#{ubicacion.nivel}" filterBy="#{ubicacion.nivel}">
|
||
|
<h:outputText value="#{ubicacion.nivel}" />
|
||
|
</p:column>
|
||
|
|
||
|
<p:column headerText="Acciones">
|
||
|
<p:commandButton icon="pi pi-pencil" update=":dialogs:manage-product-content"
|
||
|
oncomplete="PF('manageProductDialog').show()"
|
||
|
styleClass="rounded-button ui-button-info" process="@this"
|
||
|
actionListener="#{ubiBean.preparaEliminarUbicacion(ubicacion)}">
|
||
|
<p:resetInput target=":dialogs:manage-product-content" />
|
||
|
</p:commandButton>
|
||
|
|
||
|
<p:commandButton styleClass="rounded-button ui-button-danger" icon="pi pi-trash"
|
||
|
process="@this"
|
||
|
actionListener="#{ubiBean.preparaEliminarUbicacion(ubicacion)}"
|
||
|
oncomplete="PF('deleteProductDialog').show()">
|
||
|
</p:commandButton>
|
||
|
</p:column>
|
||
|
|
||
|
</p:dataTable>
|
||
|
</h:form>
|
||
|
|
||
|
<h:form id="dialogs">
|
||
|
<p:dialog header="Detalles de ubicación" showEffect="fade" modal="true" widgetVar="manageProductDialog"
|
||
|
responsive="true">
|
||
|
<p:outputPanel id="manage-product-content" styleClass="ui-fluid">
|
||
|
<p:outputPanel>
|
||
|
<h:panelGrid columns="2">
|
||
|
<h:outputLabel value="Pasillo" for="Pasillo" />
|
||
|
<p:inputText id="Pasillo" value="#{ubiBean.ubicacion.pasillo}" title="Pasillo"
|
||
|
required="true" requiredMessage="El pasillo es requerido. ⚠️" />
|
||
|
<h:outputLabel value="Anaquel" for="Anaquel" />
|
||
|
<p:inputText id="Anaquel" value="#{ubiBean.ubicacion.anaquel}" title="Anaquel"
|
||
|
required="true" requiredMessage="El anaquel es requerido. ⚠️" />
|
||
|
<h:outputLabel value="Nivel" for="Nivel" />
|
||
|
<p:inputText id="Nivel" value="#{ubiBean.ubicacion.nivel}" title="Nivel"
|
||
|
required="true" requiredMessage="El nivel es requerido. ⚠️" />
|
||
|
</h:panelGrid>
|
||
|
</p:outputPanel>
|
||
|
</p:outputPanel>
|
||
|
|
||
|
<f:facet name="footer">
|
||
|
<div style="text-align: center;">
|
||
|
<p:commandButton value="Guardar" icon="pi pi-save"
|
||
|
styleClass="ui-button-raised ui-button-flat" actionListener="#{ubiBean.agregarU()}"
|
||
|
update="manage-product-content" process="manage-product-content @this" />
|
||
|
</div>
|
||
|
</f:facet>
|
||
|
</p:dialog>
|
||
|
|
||
|
<p:confirmDialog widgetVar="deleteProductDialog" showEffect="fade" width="300"
|
||
|
message="¿Deseas eliminar este elemento?" header="Eliminar" severity="warn">
|
||
|
<div style="display: flex; justify-content: space-between;">
|
||
|
<p:commandButton value="Eliminar" icon="pi pi-trash"
|
||
|
styleClass="ui-button-raised ui-button-danger ui-button-flat"
|
||
|
actionListener="#{ubiBean.eliminarUbicacion()}" process="@this"
|
||
|
oncomplete="PF('deleteProductDialog').hide()" />
|
||
|
<p:commandButton value="Cancelar" type="button"
|
||
|
styleClass="ui-button-raised ui-button-danger-success ui-button-flat" icon="pi pi-times"
|
||
|
onclick="PF('deleteProductDialog').hide()" />
|
||
|
</div>
|
||
|
</p:confirmDialog>
|
||
|
</h:form>
|
||
|
</div>
|
||
|
</ui:define>
|
||
|
|
||
|
</ui:composition>
|
||
|
|
||
|
</html>
|