|
|
@ -7,6 +7,7 @@ import com.vaadin.flow.component.datepicker.DatePicker; |
|
|
|
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.H3; |
|
|
|
import com.vaadin.flow.component.html.Span; |
|
|
|
import com.vaadin.flow.component.icon.Icon; |
|
|
|
import com.vaadin.flow.component.icon.VaadinIcon; |
|
|
@ -36,11 +37,13 @@ public class MantenimientoView extends VerticalLayout { |
|
|
|
private final VerticalLayout controlsLayout; |
|
|
|
private final DatabaseService databaseService; |
|
|
|
private final VerticalLayout actualizacionesLayout; |
|
|
|
private final VerticalLayout etiquetaLayout; |
|
|
|
|
|
|
|
public MantenimientoView() { |
|
|
|
this.databaseService = new DatabaseService(); |
|
|
|
this.controlsLayout = new VerticalLayout(); |
|
|
|
this.actualizacionesLayout = new VerticalLayout(); |
|
|
|
this.etiquetaLayout = new VerticalLayout(); |
|
|
|
|
|
|
|
HorizontalLayout fechaLayout = new HorizontalLayout(); |
|
|
|
//Componentes de texto |
|
|
@ -54,6 +57,7 @@ public class MantenimientoView extends VerticalLayout { |
|
|
|
|
|
|
|
//Selector de fecha |
|
|
|
DatePicker fecha = new DatePicker("Fecha"); |
|
|
|
// fecha.setPlaceholder("Fecha"); |
|
|
|
|
|
|
|
|
|
|
|
//ComboBox Tipo de Mantenimiento |
|
|
@ -71,8 +75,10 @@ public class MantenimientoView extends VerticalLayout { |
|
|
|
//Si el tipo es preventivo se establecera la fecha automaticamente a la fecha del sistema |
|
|
|
if ("PREVENTIVO".equals(tipoSeleccionado)) { |
|
|
|
fecha.setValue(LocalDate.now()); |
|
|
|
etiquetaLayout.setVisible(false); |
|
|
|
} else { |
|
|
|
fecha.clear(); |
|
|
|
etiquetaLayout.setVisible(true); |
|
|
|
} |
|
|
|
} else { |
|
|
|
nomenclatura.clear(); |
|
|
@ -100,9 +106,10 @@ public class MantenimientoView extends VerticalLayout { |
|
|
|
|
|
|
|
createHardwareSection(databaseService); |
|
|
|
addActualizacionesSection(); |
|
|
|
correctivo(); |
|
|
|
|
|
|
|
|
|
|
|
add(fechaLayout, departamentoLayout, controlsLayout, actualizacionesLayout); |
|
|
|
add(fechaLayout, departamentoLayout, controlsLayout, actualizacionesLayout, etiquetaLayout); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -242,4 +249,49 @@ public class MantenimientoView extends VerticalLayout { |
|
|
|
actualizacionesLayout.add(Titulo, actualizaciones, formasLayout); |
|
|
|
actualizacionesLayout.setSpacing(false); |
|
|
|
} |
|
|
|
|
|
|
|
private void correctivo(){ |
|
|
|
Span Titulo = new Span("Reparación Realizada al Equipo: "); |
|
|
|
|
|
|
|
|
|
|
|
TextField txtModelo = new TextField(); |
|
|
|
txtModelo.setPlaceholder("Modelo"); |
|
|
|
txtModelo.setWidth("240px"); |
|
|
|
|
|
|
|
TextField txtSerie = new TextField(); |
|
|
|
txtSerie.setPlaceholder("Serie"); |
|
|
|
txtSerie.setWidth("240px"); |
|
|
|
|
|
|
|
TextField txtSoft = new TextField(); |
|
|
|
txtSoft.setPlaceholder("Instalación de Software"); |
|
|
|
txtSoft.setWidth("500px"); |
|
|
|
|
|
|
|
TextField txtRepHard = new TextField(); |
|
|
|
txtRepHard.setPlaceholder("Reparación de Hardware"); |
|
|
|
txtRepHard.setWidth("500px"); |
|
|
|
|
|
|
|
TextField txtCamDisp = new TextField(); |
|
|
|
txtCamDisp.setPlaceholder("Cambio de Dispositivo"); |
|
|
|
txtCamDisp.setWidth("500px"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HorizontalLayout model = new HorizontalLayout(); |
|
|
|
model.add(txtModelo, txtSerie, txtSoft); |
|
|
|
model.setSizeFull(); |
|
|
|
|
|
|
|
HorizontalLayout hard = new HorizontalLayout(); |
|
|
|
hard.add(txtRepHard, txtCamDisp); |
|
|
|
hard.setSizeFull(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
etiquetaLayout.setVisible(false); |
|
|
|
|
|
|
|
|
|
|
|
etiquetaLayout.add(Titulo, model, hard); |
|
|
|
|
|
|
|
} |
|
|
|
} |