Commit ed6ef304 by Billy Larru

cambio de estado en asignar monto de amanecidas

parent 982e61a6
...@@ -99,7 +99,7 @@ function registrar() { ...@@ -99,7 +99,7 @@ function registrar() {
if (response.status) { if (response.status) {
swal({ swal({
type: 'success', type: 'success',
title: '¡Se registró correctamente!', title: '¡Se registró exitosamente!',
showConfirmButton: false, showConfirmButton: false,
timer: 1500 timer: 1500
}); });
...@@ -120,7 +120,7 @@ function mostrarMensajeResultadoModal(result = {}){ ...@@ -120,7 +120,7 @@ function mostrarMensajeResultadoModal(result = {}){
if (result.value) { if (result.value) {
swal({ swal({
type: 'success', type: 'success',
title: '¡Se realizó la actualización correctamente!', title: '¡Se realizó la actualización exitosamente!',
showConfirmButton: false, showConfirmButton: false,
timer: 1500 timer: 1500
}); });
...@@ -151,26 +151,38 @@ function mostrarModalEdicion(data = {}) { ...@@ -151,26 +151,38 @@ function mostrarModalEdicion(data = {}) {
function mostrarModalEliminacion(data) { function mostrarModalEliminacion(data) {
let {id, estado} = data; let {id, estado} = data;
let mensaje = ""; let titulo = "";
let let textoConfirmacion = ""
let tituloOperacion = "";
estado = 0;
if (estado) {
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({ swal({
title: 'Está seguro de eliminar?', title: titulo,
text: "", text: "",
type: 'warning', type: 'warning',
showCancelButton: true, showCancelButton: true,
confirmButtonColor: '#3085d6', confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33', cancelButtonColor: '#d33',
confirmButtonText: 'Sí, eliminar!' confirmButtonText: textoConfirmacion
}).then((result) => { }).then((result) => {
if (result.value) { if (result.value) {
ajaxWebService.patch(`${URI_POLICIA_MONTOS_AMANECIDAS}/${id}`, {estado}).then((response) => { ajaxWebService.patch(`${URI_POLICIA_MONTOS_AMANECIDAS}/${id}`, {estado}).then((response) => {
if (response.status) { if (response.status) {
swal({ swal({
type: 'success', type: 'success',
title: '¡Eliminado correctamente!', title: tituloOperacion,
showConfirmButton: false, showConfirmButton: false,
timer: 1500 timer: 1500
}); });
......
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