eliminar hora excepcion
This commit is contained in:
parent
fdf9357a0a
commit
6896f35197
@ -27,6 +27,22 @@
|
||||
<b-table-column field="horaFin" label="Hora Fin" centered v-slot="props">
|
||||
{{ props.row.hora_fin }}
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column field="eliminar" label="Eliminar" centered v-slot="props">
|
||||
<b-button
|
||||
type="is-danger"
|
||||
@click="
|
||||
;(id_hora_excepcion = props.row.id_hora_excepcion),
|
||||
$alertsGenericos.imprimirWarning(
|
||||
$buefy,
|
||||
'¿Esta segur@ de querer eliminar esta hora excepció?',
|
||||
eliminarHoraExcepcion
|
||||
)
|
||||
"
|
||||
>
|
||||
Eliminar
|
||||
</b-button>
|
||||
</b-table-column>
|
||||
</b-table>
|
||||
</div>
|
||||
</template>
|
||||
@ -48,6 +64,8 @@ export default {
|
||||
hora_inicio: new Date(),
|
||||
hora_fin: new Date(),
|
||||
mostrar: false,
|
||||
|
||||
id_hora_excepcion: 0,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -69,6 +87,25 @@ export default {
|
||||
this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
|
||||
})
|
||||
},
|
||||
eliminarHoraExcepcion() {
|
||||
const data = {
|
||||
id_hora_excepcion: this.id_hora_excepcion,
|
||||
}
|
||||
console.log(data)
|
||||
axios
|
||||
.delete(`${process.env.api}/hora-excepcion`, { data })
|
||||
.then((res) => {
|
||||
this.$alertsGenericos.imprimirMensaje(
|
||||
this.$buefy,
|
||||
'Se ah eliminado correctamente la hora excepción'
|
||||
)
|
||||
this.updateActualizarTabla(true)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.error = 'is-danger'
|
||||
this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user