Commit 6479a8ce by Billy Larru

eliminando vacaciones individuales

parent c7d18a0a
......@@ -139,6 +139,49 @@ const mostrarModalVerDetalleVacaciones = (data) => {
});
});
};
const mostrarModalEliminarVacaciones = (data) => {
let {id, estado} = data;
let titulo = "";
let textoConfirmacion = ""
let tituloOperacion = "";
if (estado == 1) {
titulo = 'Está seguro de eliminar?';
textoConfirmacion = 'Sí, eliminar!';
tituloOperacion = '¡Eliminado exitosamente!';
estado = 0;
} else {
titulo = 'Está seguro de activar?';
textoConfirmacion = 'Sí, activar!';
tituloOperacion = '¡Activado exitosamente!';
estado = 1;
}
swal({
title: titulo,
text: "",
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: textoConfirmacion
}).then((result) => {
if (result.value) {
ajaxWebService.patch(`${URI_ADMINISTRATIVOS_VACACIONES_INDIVIDUAL}/${id}`, {estado}).then((response) => {
if (response.status) {
swal({
type: 'success',
title: tituloOperacion,
showConfirmButton: false,
timer: 1500
});
listarVacacionesIndividuales();
}
});
}
});
};
function listarVacacionesIndividuales(objParams = {}){
ajaxWebService.get(URI_ADMINISTRATIVOS_VACACIONES_INDIVIDUAL, objParams).then((response) => {
let columns = getColumns();
......@@ -164,10 +207,10 @@ function listarVacacionesIndividuales(objParams = {}){
// let data = nodes.datatable.DataTable().row($(this).parents("tr")).data();
// mostrarModalEditarTolerancia(data);
// })
// .on("click", ".eliminar", function () {
// let data = nodes.datatable.DataTable().row($(this).parents("tr")).data();
// mostrarModalEliminarTolerancia(data);
// });
.on("click", ".eliminar", function () {
let data = nodes.datatable.DataTable().row($(this).parents("tr")).data();
mostrarModalEliminarVacaciones(data);
});
});
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment