|
@ -1,17 +1,23 @@ |
|
|
package mx.gob.jumapacelaya.ui; |
|
|
package mx.gob.jumapacelaya.ui; |
|
|
|
|
|
|
|
|
|
|
|
import com.vaadin.flow.component.Component; |
|
|
|
|
|
import com.vaadin.flow.component.UI; |
|
|
import com.vaadin.flow.component.button.ButtonVariant; |
|
|
import com.vaadin.flow.component.button.ButtonVariant; |
|
|
import com.vaadin.flow.component.checkbox.CheckboxGroup; |
|
|
import com.vaadin.flow.component.checkbox.CheckboxGroup; |
|
|
import com.vaadin.flow.component.combobox.ComboBox; |
|
|
import com.vaadin.flow.component.combobox.ComboBox; |
|
|
import com.vaadin.flow.component.datepicker.DatePicker; |
|
|
import com.vaadin.flow.component.datepicker.DatePicker; |
|
|
import com.vaadin.flow.component.dependency.CssImport; |
|
|
import com.vaadin.flow.component.dependency.CssImport; |
|
|
|
|
|
import com.vaadin.flow.component.html.H1; |
|
|
|
|
|
import com.vaadin.flow.component.html.H2; |
|
|
import com.vaadin.flow.component.html.Span; |
|
|
import com.vaadin.flow.component.html.Span; |
|
|
import com.vaadin.flow.component.icon.Icon; |
|
|
import com.vaadin.flow.component.icon.Icon; |
|
|
import com.vaadin.flow.component.icon.VaadinIcon; |
|
|
import com.vaadin.flow.component.icon.VaadinIcon; |
|
|
import com.vaadin.flow.component.notification.Notification; |
|
|
import com.vaadin.flow.component.notification.Notification; |
|
|
|
|
|
import com.vaadin.flow.component.orderedlayout.FlexComponent; |
|
|
import com.vaadin.flow.component.orderedlayout.HorizontalLayout; |
|
|
import com.vaadin.flow.component.orderedlayout.HorizontalLayout; |
|
|
import com.vaadin.flow.component.orderedlayout.VerticalLayout; |
|
|
import com.vaadin.flow.component.orderedlayout.VerticalLayout; |
|
|
import com.vaadin.flow.component.radiobutton.RadioButtonGroup; |
|
|
import com.vaadin.flow.component.radiobutton.RadioButtonGroup; |
|
|
|
|
|
import com.vaadin.flow.component.textfield.NumberField; |
|
|
import com.vaadin.flow.component.textfield.TextArea; |
|
|
import com.vaadin.flow.component.textfield.TextArea; |
|
|
import com.vaadin.flow.component.textfield.TextField; |
|
|
import com.vaadin.flow.component.textfield.TextField; |
|
|
import com.vaadin.flow.component.button.Button; |
|
|
import com.vaadin.flow.component.button.Button; |
|
@ -19,6 +25,7 @@ import com.vaadin.flow.router.BeforeEnterEvent; |
|
|
import com.vaadin.flow.router.BeforeEnterObserver; |
|
|
import com.vaadin.flow.router.BeforeEnterObserver; |
|
|
import com.vaadin.flow.router.PageTitle; |
|
|
import com.vaadin.flow.router.PageTitle; |
|
|
import com.vaadin.flow.router.Route; |
|
|
import com.vaadin.flow.router.Route; |
|
|
|
|
|
import de.f0rce.signaturepad.SignaturePad; |
|
|
import jakarta.annotation.security.PermitAll; |
|
|
import jakarta.annotation.security.PermitAll; |
|
|
import mx.gob.jumapacelaya.services.DatabaseService; |
|
|
import mx.gob.jumapacelaya.services.DatabaseService; |
|
|
|
|
|
|
|
@ -36,14 +43,16 @@ public class MantenimientoView extends VerticalLayout implements BeforeEnterObse |
|
|
private final DatabaseService databaseService; |
|
|
private final DatabaseService databaseService; |
|
|
private final VerticalLayout actualizacionesLayout; |
|
|
private final VerticalLayout actualizacionesLayout; |
|
|
private final VerticalLayout etiquetaLayout; |
|
|
private final VerticalLayout etiquetaLayout; |
|
|
private DatePicker fecha; |
|
|
|
|
|
private ComboBox<String> tipoMantt; |
|
|
|
|
|
|
|
|
private final HorizontalLayout firmasLayout; |
|
|
|
|
|
private final DatePicker fecha; |
|
|
|
|
|
private final ComboBox<String> tipoMantt; |
|
|
|
|
|
|
|
|
public MantenimientoView() { |
|
|
public MantenimientoView() { |
|
|
this.databaseService = new DatabaseService(); |
|
|
this.databaseService = new DatabaseService(); |
|
|
this.controlsLayout = new VerticalLayout(); |
|
|
this.controlsLayout = new VerticalLayout(); |
|
|
this.actualizacionesLayout = new VerticalLayout(); |
|
|
this.actualizacionesLayout = new VerticalLayout(); |
|
|
this.etiquetaLayout = new VerticalLayout(); |
|
|
this.etiquetaLayout = new VerticalLayout(); |
|
|
|
|
|
this.firmasLayout = new HorizontalLayout(); |
|
|
|
|
|
|
|
|
HorizontalLayout fechaLayout = new HorizontalLayout(); |
|
|
HorizontalLayout fechaLayout = new HorizontalLayout(); |
|
|
//Componentes de texto |
|
|
//Componentes de texto |
|
@ -107,10 +116,11 @@ public class MantenimientoView extends VerticalLayout implements BeforeEnterObse |
|
|
|
|
|
|
|
|
createHardwareSection(databaseService); |
|
|
createHardwareSection(databaseService); |
|
|
addActualizacionesSection(); |
|
|
addActualizacionesSection(); |
|
|
correctivo(); |
|
|
|
|
|
|
|
|
correctivoLayout(); |
|
|
|
|
|
signLayout(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
add(fechaLayout, departamentoLayout, controlsLayout, actualizacionesLayout, etiquetaLayout); |
|
|
|
|
|
|
|
|
add(fechaLayout, departamentoLayout, controlsLayout, actualizacionesLayout, etiquetaLayout, firmasLayout); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -135,6 +145,7 @@ public class MantenimientoView extends VerticalLayout implements BeforeEnterObse |
|
|
addNuevoTipo(); |
|
|
addNuevoTipo(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Metodo para agregar un nuevo ComboBox de tipo de hardware y campos de texto |
|
|
//Metodo para agregar un nuevo ComboBox de tipo de hardware y campos de texto |
|
|
private void addNuevoTipo() { |
|
|
private void addNuevoTipo() { |
|
|
ComboBox<String> tipoHardware = new ComboBox<>(); |
|
|
ComboBox<String> tipoHardware = new ComboBox<>(); |
|
@ -143,7 +154,7 @@ public class MantenimientoView extends VerticalLayout implements BeforeEnterObse |
|
|
tipoHardware.setPlaceholder("Tipo de hardware"); |
|
|
tipoHardware.setPlaceholder("Tipo de hardware"); |
|
|
tipoHardware.setSizeFull(); |
|
|
tipoHardware.setSizeFull(); |
|
|
|
|
|
|
|
|
TextField noSerie = new TextField(); |
|
|
|
|
|
|
|
|
NumberField noSerie = new NumberField(); |
|
|
noSerie.setEnabled(false); |
|
|
noSerie.setEnabled(false); |
|
|
noSerie.setRequired(true); |
|
|
noSerie.setRequired(true); |
|
|
noSerie.setPlaceholder("No. Serie"); |
|
|
noSerie.setPlaceholder("No. Serie"); |
|
@ -155,7 +166,7 @@ public class MantenimientoView extends VerticalLayout implements BeforeEnterObse |
|
|
modelo.setPlaceholder("Modelo"); |
|
|
modelo.setPlaceholder("Modelo"); |
|
|
modelo.setSizeFull(); |
|
|
modelo.setSizeFull(); |
|
|
|
|
|
|
|
|
TextField placa = new TextField(); |
|
|
|
|
|
|
|
|
NumberField placa = new NumberField(); |
|
|
placa.setEnabled(false); |
|
|
placa.setEnabled(false); |
|
|
placa.setRequired(true); |
|
|
placa.setRequired(true); |
|
|
placa.setPlaceholder("Placa"); |
|
|
placa.setPlaceholder("Placa"); |
|
@ -234,6 +245,7 @@ public class MantenimientoView extends VerticalLayout implements BeforeEnterObse |
|
|
} else { |
|
|
} else { |
|
|
txtCuales.setEnabled(false); |
|
|
txtCuales.setEnabled(false); |
|
|
txtCuales.setRequired(false); |
|
|
txtCuales.setRequired(false); |
|
|
|
|
|
txtCuales.clear(); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
@ -251,7 +263,8 @@ public class MantenimientoView extends VerticalLayout implements BeforeEnterObse |
|
|
actualizacionesLayout.setSpacing(false); |
|
|
actualizacionesLayout.setSpacing(false); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void correctivo(){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void correctivoLayout(){ |
|
|
Span Titulo = new Span("Reparación Realizada al Equipo: "); |
|
|
Span Titulo = new Span("Reparación Realizada al Equipo: "); |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -259,8 +272,8 @@ public class MantenimientoView extends VerticalLayout implements BeforeEnterObse |
|
|
txtModelo.setPlaceholder("Modelo"); |
|
|
txtModelo.setPlaceholder("Modelo"); |
|
|
txtModelo.setWidth("240px"); |
|
|
txtModelo.setWidth("240px"); |
|
|
|
|
|
|
|
|
TextField txtSerie = new TextField(); |
|
|
|
|
|
txtSerie.setPlaceholder("Serie"); |
|
|
|
|
|
|
|
|
NumberField txtSerie = new NumberField(); |
|
|
|
|
|
txtSerie.setPlaceholder("No. Serie"); |
|
|
txtSerie.setWidth("240px"); |
|
|
txtSerie.setWidth("240px"); |
|
|
|
|
|
|
|
|
TextField txtSoft = new TextField(); |
|
|
TextField txtSoft = new TextField(); |
|
@ -287,15 +300,58 @@ public class MantenimientoView extends VerticalLayout implements BeforeEnterObse |
|
|
hard.setSizeFull(); |
|
|
hard.setSizeFull(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
etiquetaLayout.setVisible(false); |
|
|
etiquetaLayout.setVisible(false); |
|
|
|
|
|
etiquetaLayout.add(Titulo, model, hard); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
etiquetaLayout.add(Titulo, model, hard); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void signLayout() { |
|
|
|
|
|
VerticalLayout userSignLayout = new VerticalLayout(); |
|
|
|
|
|
SignaturePad userSignPad = new SignaturePad(); |
|
|
|
|
|
userSignPad.setBackgroundColor(0, 0, 0, 0); |
|
|
|
|
|
userSignPad.setHeight("200px"); |
|
|
|
|
|
userSignPad.setPenColor("#000000"); |
|
|
|
|
|
userSignPad.getElement().getStyle().set("border", "1px solid black"); |
|
|
|
|
|
Span userSignSpan = new Span("Nombre Usuario"); |
|
|
|
|
|
userSignLayout.setSizeFull(); |
|
|
|
|
|
userSignLayout.setSpacing(true); |
|
|
|
|
|
userSignLayout.setAlignItems(Alignment.CENTER); |
|
|
|
|
|
userSignLayout.add(userSignPad, userSignSpan); |
|
|
|
|
|
|
|
|
|
|
|
VerticalLayout smtSignLayout = new VerticalLayout(); |
|
|
|
|
|
SignaturePad smtSignPad = new SignaturePad(); |
|
|
|
|
|
smtSignPad.setHeight("200px"); |
|
|
|
|
|
smtSignPad.setBackgroundColor(0, 0, 0, 0); |
|
|
|
|
|
smtSignPad.setPenColor("#000000"); |
|
|
|
|
|
smtSignPad.getElement().getStyle().set("border", "1px solid black"); |
|
|
|
|
|
Span smtSignSpan = new Span("S.M.T. Nombre"); |
|
|
|
|
|
smtSignLayout.setSizeFull(); |
|
|
|
|
|
smtSignLayout.setSpacing(true); |
|
|
|
|
|
smtSignLayout.setAlignItems(Alignment.CENTER); |
|
|
|
|
|
smtSignLayout.add(smtSignPad, smtSignSpan); |
|
|
|
|
|
|
|
|
|
|
|
VerticalLayout gcialSignLayout = new VerticalLayout(); |
|
|
|
|
|
SignaturePad gciatiSignPad = new SignaturePad(); |
|
|
|
|
|
gciatiSignPad.setBackgroundColor(0, 0, 0, 0); |
|
|
|
|
|
gciatiSignPad.setHeight("200px"); |
|
|
|
|
|
gciatiSignPad.setPenColor("#000000"); |
|
|
|
|
|
gciatiSignPad.getElement().getStyle().set("border", "1px solid black"); |
|
|
|
|
|
Span gciatiSignSpan = new Span("L.I. Sandra E. Rodriguez Ramirez"); |
|
|
|
|
|
Span tituloGerente = new Span("Gerencia de Tecnologias de la Información"); |
|
|
|
|
|
gcialSignLayout.setSizeFull(); |
|
|
|
|
|
gcialSignLayout.setSpacing(false); |
|
|
|
|
|
gcialSignLayout.setAlignItems(Alignment.CENTER); |
|
|
|
|
|
gcialSignLayout.add(gciatiSignPad, gciatiSignSpan, tituloGerente); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
firmasLayout.add(userSignLayout, smtSignLayout, gcialSignLayout); |
|
|
|
|
|
firmasLayout.setSizeFull(); |
|
|
|
|
|
firmasLayout.setSpacing(false); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void beforeEnter(BeforeEnterEvent beforeEnterEvent) { |
|
|
public void beforeEnter(BeforeEnterEvent beforeEnterEvent) { |
|
|
String fechaParam = beforeEnterEvent.getLocation().getQueryParameters().getParameters().get("fecha") != null |
|
|
String fechaParam = beforeEnterEvent.getLocation().getQueryParameters().getParameters().get("fecha") != null |
|
|