diff --git a/components/responsable/cartaTermino.vue b/components/responsable/cartaTermino.vue index 334c718..453f6f3 100644 --- a/components/responsable/cartaTermino.vue +++ b/components/responsable/cartaTermino.vue @@ -67,6 +67,9 @@ export default { }); }, Enviar() { + // const loadingComponent = this.$buefy.loading.open({ + // container: this.isFullPage ? null : this.$refs.element.$el, + // }); const data = { idServicio: this.idServicio }; const formData = new FormData(); formData.append("data", JSON.stringify(data)); @@ -80,10 +83,38 @@ export default { }) .then((res) => { console.log(res.data); + + // loadingComponent.close(); + this.$buefy.dialog.alert({ + title: "Success", + message: "Se enviaron los datos correctamente", + type: "is-success", + hasIcon: true, + icon: "checkbox-marked-circle", + iconPack: "mdi", + ariaRole: "alertdialog", + ariaModal: true, + }); + }) + .catch((error) => { + // loadingComponent.close(); + this.$buefy.dialog.alert({ + title: "Error", + message: error.response.data.message, + type: "is-danger", + hasIcon: true, + icon: "alert-circle", + iconPack: "mdi", + ariaRole: "alertdialog", + ariaModal: true, + }); + }) + .finally(() => { + this.$router.push("/responsable"); }); }, getIdLocal() { - this.idServicio = localStorage.getItem("idUsuario"); + this.idServicio = localStorage.getItem("idServicio"); }, }, watch: { @@ -91,6 +122,9 @@ export default { this.validarTamaño(); }, }, + created() { + this.getIdLocal(); + }, }; diff --git a/dist/200.html b/dist/200.html index a84bcc3..5c10561 100644 --- a/dist/200.html +++ b/dist/200.html @@ -1,9 +1,9 @@
-