@ -78,6 +78,9 @@ public class DetallesMantView extends VerticalLayout implements BeforeEnterObser
private SignaturePad smtSignPad ;
private SignaturePad smtSignPad ;
private SignaturePad gciaSignPad ;
private SignaturePad gciaSignPad ;
private final HorizontalLayout firmasLAyout = new HorizontalLayout ( ) ;
private final HorizontalLayout firmasLAyout = new HorizontalLayout ( ) ;
private Image firmaUsuarioImg ;
private Image firmaSmtImg ;
private Image firmaGciaImg ;
/ / Agrega estos atributos :
/ / Agrega estos atributos :
private VerticalLayout userSignLayout ;
private VerticalLayout userSignLayout ;
@ -220,6 +223,15 @@ public class DetallesMantView extends VerticalLayout implements BeforeEnterObser
btnCancelar . setVisible ( true ) ;
btnCancelar . setVisible ( true ) ;
gridHardware . setEditOnClick ( true ) ;
gridHardware . setEditOnClick ( true ) ;
gridActualizaciones . setEditOnClick ( true ) ;
gridActualizaciones . setEditOnClick ( true ) ;
if ( firmaUsuarioImg ! = null & & firmaUsuarioImg . getParent ( ) . isPresent ( ) ) {
userSignLayout . replace ( firmaUsuarioImg , userSignPad ) ;
userSignPad . clear ( ) ;
}
if ( firmaSmtImg ! = null & & firmaSmtImg . getParent ( ) . isPresent ( ) ) {
smtSignLayout . replace ( firmaSmtImg , smtSignPad ) ;
smtSignPad . clear ( ) ;
}
} ) ;
} ) ;
btnCancelar . addClickListener ( e - > {
btnCancelar . addClickListener ( e - > {
@ -237,6 +249,13 @@ public class DetallesMantView extends VerticalLayout implements BeforeEnterObser
gridHardware . getEditor ( ) . cancel ( ) ;
gridHardware . getEditor ( ) . cancel ( ) ;
gridActualizaciones . setEditOnClick ( false ) ;
gridActualizaciones . setEditOnClick ( false ) ;
gridActualizaciones . getEditor ( ) . cancel ( ) ;
gridActualizaciones . getEditor ( ) . cancel ( ) ;
if ( firmaUsuarioImg ! = null & & userSignPad . getParent ( ) . isPresent ( ) ) {
userSignLayout . replace ( userSignPad , firmaUsuarioImg ) ;
}
if ( firmaSmtImg ! = null & & smtSignPad . getParent ( ) . isPresent ( ) ) {
smtSignLayout . replace ( smtSignPad , firmaSmtImg ) ;
}
} ) ;
} ) ;
@ -369,6 +388,7 @@ public class DetallesMantView extends VerticalLayout implements BeforeEnterObser
userSignLayout . setAlignItems ( Alignment . CENTER ) ;
userSignLayout . setAlignItems ( Alignment . CENTER ) ;
userSignPad = new SignaturePad ( ) ;
userSignPad = new SignaturePad ( ) ;
userSignPad . setHeight ( "200px" ) ;
userSignPad . setHeight ( "200px" ) ;
userSignPad . setWidthFull ( ) ;
userSignLayout . add ( userSignPad , new Span ( "Usuario Interno" ) ) ;
userSignLayout . add ( userSignPad , new Span ( "Usuario Interno" ) ) ;
smtSignLayout = new VerticalLayout ( ) ;
smtSignLayout = new VerticalLayout ( ) ;
@ -376,6 +396,7 @@ public class DetallesMantView extends VerticalLayout implements BeforeEnterObser
smtSignLayout . setAlignItems ( Alignment . CENTER ) ;
smtSignLayout . setAlignItems ( Alignment . CENTER ) ;
smtSignPad = new SignaturePad ( ) ;
smtSignPad = new SignaturePad ( ) ;
smtSignPad . setHeight ( "200px" ) ;
smtSignPad . setHeight ( "200px" ) ;
smtSignPad . setWidthFull ( ) ;
smtSignLayout . add ( smtSignPad , new Span ( "Responsable de Soporte" ) ) ;
smtSignLayout . add ( smtSignPad , new Span ( "Responsable de Soporte" ) ) ;
gciaSignLayout = new VerticalLayout ( ) ;
gciaSignLayout = new VerticalLayout ( ) ;
@ -383,6 +404,7 @@ public class DetallesMantView extends VerticalLayout implements BeforeEnterObser
gciaSignLayout . setAlignItems ( Alignment . CENTER ) ;
gciaSignLayout . setAlignItems ( Alignment . CENTER ) ;
gciaSignPad = new SignaturePad ( ) ;
gciaSignPad = new SignaturePad ( ) ;
gciaSignPad . setHeight ( "200px" ) ;
gciaSignPad . setHeight ( "200px" ) ;
gciaSignPad . setWidthFull ( ) ;
gciaSignLayout . add ( gciaSignPad , new Span ( "Gcia. de T.I" ) ) ;
gciaSignLayout . add ( gciaSignPad , new Span ( "Gcia. de T.I" ) ) ;
firmasLAyout . removeAll ( ) ;
firmasLAyout . removeAll ( ) ;
@ -449,7 +471,7 @@ public class DetallesMantView extends VerticalLayout implements BeforeEnterObser
if ( ! firmaUser . startsWith ( "data:image" ) ) {
if ( ! firmaUser . startsWith ( "data:image" ) ) {
firmaUser = "data:image/png;base64," + firmaUser ;
firmaUser = "data:image/png;base64," + firmaUser ;
}
}
Image firmaUsuarioImg = new Image ( firmaUser , "Firma del usuario" ) ;
firmaUsuarioImg = new Image ( firmaUser , "Firma del usuario" ) ;
firmaUsuarioImg . setHeight ( "200px" ) ;
firmaUsuarioImg . setHeight ( "200px" ) ;
firmaUsuarioImg . setWidthFull ( ) ;
firmaUsuarioImg . setWidthFull ( ) ;
userSignLayout . replace ( userSignPad , firmaUsuarioImg ) ;
userSignLayout . replace ( userSignPad , firmaUsuarioImg ) ;
@ -460,7 +482,7 @@ public class DetallesMantView extends VerticalLayout implements BeforeEnterObser
if ( ! firmaSmt . startsWith ( "data:image" ) ) {
if ( ! firmaSmt . startsWith ( "data:image" ) ) {
firmaSmt = "data:image/png;base64," + firmaSmt ;
firmaSmt = "data:image/png;base64," + firmaSmt ;
}
}
Image firmaSmtImg = new Image ( firmaSmt , "Firma del usuario de soporte" ) ;
firmaSmtImg = new Image ( firmaSmt , "Firma del usuario de soporte" ) ;
firmaSmtImg . setHeight ( "200px" ) ;
firmaSmtImg . setHeight ( "200px" ) ;
firmaSmtImg . setWidthFull ( ) ;
firmaSmtImg . setWidthFull ( ) ;
smtSignLayout . replace ( smtSignPad , firmaSmtImg ) ;
smtSignLayout . replace ( smtSignPad , firmaSmtImg ) ;
@ -471,7 +493,7 @@ public class DetallesMantView extends VerticalLayout implements BeforeEnterObser
if ( ! firmaGcia . startsWith ( "data:image" ) ) {
if ( ! firmaGcia . startsWith ( "data:image" ) ) {
firmaGcia = "data:image/png;base64," + firmaGcia ;
firmaGcia = "data:image/png;base64," + firmaGcia ;
}
}
Image firmaGciaImg = new Image ( firmaGcia , "Firma del gerente" ) ;
firmaGciaImg = new Image ( firmaGcia , "Firma del gerente" ) ;
firmaGciaImg . setHeight ( "200px" ) ;
firmaGciaImg . setHeight ( "200px" ) ;
firmaGciaImg . setWidthFull ( ) ;
firmaGciaImg . setWidthFull ( ) ;
gciaSignLayout . replace ( gciaSignPad , firmaGciaImg ) ;
gciaSignLayout . replace ( gciaSignPad , firmaGciaImg ) ;