diff --git a/pages/admin/casos_especiales/caso_especial/editar/index.vue b/pages/admin/casos_especiales/caso_especial/editar/index.vue index ff5054c..5e69727 100644 --- a/pages/admin/casos_especiales/caso_especial/editar/index.vue +++ b/pages/admin/casos_especiales/caso_especial/editar/index.vue @@ -22,5 +22,82 @@ export default { if (!localStorage.getItem('idCasoEspecial')) this.$router.push('/admin/casos_especiales') }, + data() { + return { + admin: {}, + } + }, + methods: { + imprimirError(err = {}, title = '¡Hubo un error!', onConfirm = () => {}) { + this.$buefy.dialog.alert({ + ariaRole: 'alertdialog', + ariaModal: true, + type: 'is-danger', + title, + message: err.message, + confirmText: 'Entendido', + hasIcon: true, + iconPack: 'mdi', + icon: 'alert-octagon', + onConfirm, + }) + if (err.err && err.err === 'token error') { + localStorage.clear() + this.$router.push('/') + } + }, + imprimirMensaje(message, title = '¡Felicidades!', onConfirm = () => {}) { + this.$buefy.dialog.alert({ + ariaRole: 'alertdialog', + ariaModal: true, + type: 'is-success', + title, + message, + confirmText: 'Ok', + hasIcon: true, + iconPack: 'mdi', + icon: 'check-circle', + onConfirm, + }) + }, + imprimirWarning( + message, + title = '¡Espera un minuto!', + onConfirm = () => {}, + onCancel = () => {} + ) { + this.$buefy.dialog.alert({ + ariaRole: 'alertdialog', + ariaModal: true, + type: 'is-warning', + title, + message, + confirmText: 'Confirmar', + canCancel: true, + cancelText: 'Cancelar', + hasIcon: true, + iconPack: 'mdi', + icon: 'help-circle', + onConfirm, + onCancel, + }) + }, + getLocalhostInfo() { + this.admin.idUsuario = Number(localStorage.getItem('idUsuario')) + this.admin.idTipoUsuario = Number(localStorage.getItem('idTipoUsuario')) + this.admin.tipoUsuario = localStorage.getItem('tipoUsuario') + this.admin.token = { + headers: { + token: localStorage.getItem('token'), + }, + } + }, + }, + created() { + this.getLocalhostInfo() + if (this.admin.idTipoUsuario === 2) this.$router.push('/responsable') + if (this.admin.idTipoUsuario === 3) this.$router.push('/alumno') + if (this.admin.idTipoUsuario === 4) this.$router.push('/casoEspecial') + }, } diff --git a/pages/admin/casos_especiales/caso_especial/index.vue b/pages/admin/casos_especiales/caso_especial/index.vue index d679859..32515bf 100644 --- a/pages/admin/casos_especiales/caso_especial/index.vue +++ b/pages/admin/casos_especiales/caso_especial/index.vue @@ -27,6 +27,83 @@ export default { if (!localStorage.getItem('idCasoEspecial')) this.$router.push('/admin/casos_especiales') }, + data() { + return { + admin: {}, + } + }, + methods: { + imprimirError(err = {}, title = '¡Hubo un error!', onConfirm = () => {}) { + this.$buefy.dialog.alert({ + ariaRole: 'alertdialog', + ariaModal: true, + type: 'is-danger', + title, + message: err.message, + confirmText: 'Entendido', + hasIcon: true, + iconPack: 'mdi', + icon: 'alert-octagon', + onConfirm, + }) + if (err.err && err.err === 'token error') { + localStorage.clear() + this.$router.push('/') + } + }, + imprimirMensaje(message, title = '¡Felicidades!', onConfirm = () => {}) { + this.$buefy.dialog.alert({ + ariaRole: 'alertdialog', + ariaModal: true, + type: 'is-success', + title, + message, + confirmText: 'Ok', + hasIcon: true, + iconPack: 'mdi', + icon: 'check-circle', + onConfirm, + }) + }, + imprimirWarning( + message, + title = '¡Espera un minuto!', + onConfirm = () => {}, + onCancel = () => {} + ) { + this.$buefy.dialog.alert({ + ariaRole: 'alertdialog', + ariaModal: true, + type: 'is-warning', + title, + message, + confirmText: 'Confirmar', + canCancel: true, + cancelText: 'Cancelar', + hasIcon: true, + iconPack: 'mdi', + icon: 'help-circle', + onConfirm, + onCancel, + }) + }, + getLocalhostInfo() { + this.admin.idUsuario = Number(localStorage.getItem('idUsuario')) + this.admin.idTipoUsuario = Number(localStorage.getItem('idTipoUsuario')) + this.admin.tipoUsuario = localStorage.getItem('tipoUsuario') + this.admin.token = { + headers: { + token: localStorage.getItem('token'), + }, + } + }, + }, + created() { + this.getLocalhostInfo() + if (this.admin.idTipoUsuario === 2) this.$router.push('/responsable') + if (this.admin.idTipoUsuario === 3) this.$router.push('/alumno') + if (this.admin.idTipoUsuario === 4) this.$router.push('/casoEspecial') + }, } diff --git a/pages/admin/casos_especiales/index.vue b/pages/admin/casos_especiales/index.vue index 91195c4..5534142 100644 --- a/pages/admin/casos_especiales/index.vue +++ b/pages/admin/casos_especiales/index.vue @@ -22,5 +22,82 @@ export default { if (idTipoUsuario === 3) this.$router.push('/alumno') if (idTipoUsuario === 4) this.$router.push('/casoEspecial') }, + data() { + return { + admin: {}, + } + }, + methods: { + imprimirError(err = {}, title = '¡Hubo un error!', onConfirm = () => {}) { + this.$buefy.dialog.alert({ + ariaRole: 'alertdialog', + ariaModal: true, + type: 'is-danger', + title, + message: err.message, + confirmText: 'Entendido', + hasIcon: true, + iconPack: 'mdi', + icon: 'alert-octagon', + onConfirm, + }) + if (err.err && err.err === 'token error') { + localStorage.clear() + this.$router.push('/') + } + }, + imprimirMensaje(message, title = '¡Felicidades!', onConfirm = () => {}) { + this.$buefy.dialog.alert({ + ariaRole: 'alertdialog', + ariaModal: true, + type: 'is-success', + title, + message, + confirmText: 'Ok', + hasIcon: true, + iconPack: 'mdi', + icon: 'check-circle', + onConfirm, + }) + }, + imprimirWarning( + message, + title = '¡Espera un minuto!', + onConfirm = () => {}, + onCancel = () => {} + ) { + this.$buefy.dialog.alert({ + ariaRole: 'alertdialog', + ariaModal: true, + type: 'is-warning', + title, + message, + confirmText: 'Confirmar', + canCancel: true, + cancelText: 'Cancelar', + hasIcon: true, + iconPack: 'mdi', + icon: 'help-circle', + onConfirm, + onCancel, + }) + }, + getLocalhostInfo() { + this.admin.idUsuario = Number(localStorage.getItem('idUsuario')) + this.admin.idTipoUsuario = Number(localStorage.getItem('idTipoUsuario')) + this.admin.tipoUsuario = localStorage.getItem('tipoUsuario') + this.admin.token = { + headers: { + token: localStorage.getItem('token'), + }, + } + }, + }, + created() { + this.getLocalhostInfo() + if (this.admin.idTipoUsuario === 2) this.$router.push('/responsable') + if (this.admin.idTipoUsuario === 3) this.$router.push('/alumno') + if (this.admin.idTipoUsuario === 4) this.$router.push('/casoEspecial') + }, } diff --git a/pages/admin/index.vue b/pages/admin/index.vue index 75c244b..e18ddfb 100644 --- a/pages/admin/index.vue +++ b/pages/admin/index.vue @@ -14,7 +14,12 @@ - + diff --git a/pages/admin/registros/index.vue b/pages/admin/registros/index.vue index 29916ec..2db5b2f 100644 --- a/pages/admin/registros/index.vue +++ b/pages/admin/registros/index.vue @@ -32,6 +32,83 @@ export default { if (idTipoUsuario === 3) this.$router.push('/alumno') if (idTipoUsuario === 4) this.$router.push('/casoEspecial') }, + data() { + return { + admin: {}, + } + }, + methods: { + imprimirError(err = {}, title = '¡Hubo un error!', onConfirm = () => {}) { + this.$buefy.dialog.alert({ + ariaRole: 'alertdialog', + ariaModal: true, + type: 'is-danger', + title, + message: err.message, + confirmText: 'Entendido', + hasIcon: true, + iconPack: 'mdi', + icon: 'alert-octagon', + onConfirm, + }) + if (err.err && err.err === 'token error') { + localStorage.clear() + this.$router.push('/') + } + }, + imprimirMensaje(message, title = '¡Felicidades!', onConfirm = () => {}) { + this.$buefy.dialog.alert({ + ariaRole: 'alertdialog', + ariaModal: true, + type: 'is-success', + title, + message, + confirmText: 'Ok', + hasIcon: true, + iconPack: 'mdi', + icon: 'check-circle', + onConfirm, + }) + }, + imprimirWarning( + message, + title = '¡Espera un minuto!', + onConfirm = () => {}, + onCancel = () => {} + ) { + this.$buefy.dialog.alert({ + ariaRole: 'alertdialog', + ariaModal: true, + type: 'is-warning', + title, + message, + confirmText: 'Confirmar', + canCancel: true, + cancelText: 'Cancelar', + hasIcon: true, + iconPack: 'mdi', + icon: 'help-circle', + onConfirm, + onCancel, + }) + }, + getLocalhostInfo() { + this.admin.idUsuario = Number(localStorage.getItem('idUsuario')) + this.admin.idTipoUsuario = Number(localStorage.getItem('idTipoUsuario')) + this.admin.tipoUsuario = localStorage.getItem('tipoUsuario') + this.admin.token = { + headers: { + token: localStorage.getItem('token'), + }, + } + }, + }, + created() { + this.getLocalhostInfo() + if (this.admin.idTipoUsuario === 2) this.$router.push('/responsable') + if (this.admin.idTipoUsuario === 3) this.$router.push('/alumno') + if (this.admin.idTipoUsuario === 4) this.$router.push('/casoEspecial') + }, } diff --git a/pages/admin/responsables/index.vue b/pages/admin/responsables/index.vue index fed66d6..54d670e 100644 --- a/pages/admin/responsables/index.vue +++ b/pages/admin/responsables/index.vue @@ -26,5 +26,82 @@ export default { if (idTipoUsuario === 3) this.$router.push('/alumno') if (idTipoUsuario === 4) this.$router.push('/casoEspecial') }, + data() { + return { + admin: {}, + } + }, + methods: { + imprimirError(err = {}, title = '¡Hubo un error!', onConfirm = () => {}) { + this.$buefy.dialog.alert({ + ariaRole: 'alertdialog', + ariaModal: true, + type: 'is-danger', + title, + message: err.message, + confirmText: 'Entendido', + hasIcon: true, + iconPack: 'mdi', + icon: 'alert-octagon', + onConfirm, + }) + if (err.err && err.err === 'token error') { + localStorage.clear() + this.$router.push('/') + } + }, + imprimirMensaje(message, title = '¡Felicidades!', onConfirm = () => {}) { + this.$buefy.dialog.alert({ + ariaRole: 'alertdialog', + ariaModal: true, + type: 'is-success', + title, + message, + confirmText: 'Ok', + hasIcon: true, + iconPack: 'mdi', + icon: 'check-circle', + onConfirm, + }) + }, + imprimirWarning( + message, + title = '¡Espera un minuto!', + onConfirm = () => {}, + onCancel = () => {} + ) { + this.$buefy.dialog.alert({ + ariaRole: 'alertdialog', + ariaModal: true, + type: 'is-warning', + title, + message, + confirmText: 'Confirmar', + canCancel: true, + cancelText: 'Cancelar', + hasIcon: true, + iconPack: 'mdi', + icon: 'help-circle', + onConfirm, + onCancel, + }) + }, + getLocalhostInfo() { + this.admin.idUsuario = Number(localStorage.getItem('idUsuario')) + this.admin.idTipoUsuario = Number(localStorage.getItem('idTipoUsuario')) + this.admin.tipoUsuario = localStorage.getItem('tipoUsuario') + this.admin.token = { + headers: { + token: localStorage.getItem('token'), + }, + } + }, + }, + created() { + this.getLocalhostInfo() + if (this.admin.idTipoUsuario === 2) this.$router.push('/responsable') + if (this.admin.idTipoUsuario === 3) this.$router.push('/alumno') + if (this.admin.idTipoUsuario === 4) this.$router.push('/casoEspecial') + }, } diff --git a/pages/admin/responsables/infoResponsable/index.vue b/pages/admin/responsables/infoResponsable/index.vue index 83f7bfe..39f353e 100644 --- a/pages/admin/responsables/infoResponsable/index.vue +++ b/pages/admin/responsables/infoResponsable/index.vue @@ -33,6 +33,83 @@ export default { if (!localStorage.getItem('idResponsable')) this.$router.push('/admin/responsables') }, + data() { + return { + admin: {}, + } + }, + methods: { + imprimirError(err = {}, title = '¡Hubo un error!', onConfirm = () => {}) { + this.$buefy.dialog.alert({ + ariaRole: 'alertdialog', + ariaModal: true, + type: 'is-danger', + title, + message: err.message, + confirmText: 'Entendido', + hasIcon: true, + iconPack: 'mdi', + icon: 'alert-octagon', + onConfirm, + }) + if (err.err && err.err === 'token error') { + localStorage.clear() + this.$router.push('/') + } + }, + imprimirMensaje(message, title = '¡Felicidades!', onConfirm = () => {}) { + this.$buefy.dialog.alert({ + ariaRole: 'alertdialog', + ariaModal: true, + type: 'is-success', + title, + message, + confirmText: 'Ok', + hasIcon: true, + iconPack: 'mdi', + icon: 'check-circle', + onConfirm, + }) + }, + imprimirWarning( + message, + title = '¡Espera un minuto!', + onConfirm = () => {}, + onCancel = () => {} + ) { + this.$buefy.dialog.alert({ + ariaRole: 'alertdialog', + ariaModal: true, + type: 'is-warning', + title, + message, + confirmText: 'Confirmar', + canCancel: true, + cancelText: 'Cancelar', + hasIcon: true, + iconPack: 'mdi', + icon: 'help-circle', + onConfirm, + onCancel, + }) + }, + getLocalhostInfo() { + this.admin.idUsuario = Number(localStorage.getItem('idUsuario')) + this.admin.idTipoUsuario = Number(localStorage.getItem('idTipoUsuario')) + this.admin.tipoUsuario = localStorage.getItem('tipoUsuario') + this.admin.token = { + headers: { + token: localStorage.getItem('token'), + }, + } + }, + }, + created() { + this.getLocalhostInfo() + if (this.admin.idTipoUsuario === 2) this.$router.push('/responsable') + if (this.admin.idTipoUsuario === 3) this.$router.push('/alumno') + if (this.admin.idTipoUsuario === 4) this.$router.push('/casoEspecial') + }, } diff --git a/pages/admin/responsables/infoResponsable/modificar/index.vue b/pages/admin/responsables/infoResponsable/modificar/index.vue index 80d3071..ccae778 100644 --- a/pages/admin/responsables/infoResponsable/modificar/index.vue +++ b/pages/admin/responsables/infoResponsable/modificar/index.vue @@ -25,5 +25,82 @@ export default { if (!localStorage.getItem('idResponsable')) this.$router.push('/admin/responsables') }, + data() { + return { + admin: {}, + } + }, + methods: { + imprimirError(err = {}, title = '¡Hubo un error!', onConfirm = () => {}) { + this.$buefy.dialog.alert({ + ariaRole: 'alertdialog', + ariaModal: true, + type: 'is-danger', + title, + message: err.message, + confirmText: 'Entendido', + hasIcon: true, + iconPack: 'mdi', + icon: 'alert-octagon', + onConfirm, + }) + if (err.err && err.err === 'token error') { + localStorage.clear() + this.$router.push('/') + } + }, + imprimirMensaje(message, title = '¡Felicidades!', onConfirm = () => {}) { + this.$buefy.dialog.alert({ + ariaRole: 'alertdialog', + ariaModal: true, + type: 'is-success', + title, + message, + confirmText: 'Ok', + hasIcon: true, + iconPack: 'mdi', + icon: 'check-circle', + onConfirm, + }) + }, + imprimirWarning( + message, + title = '¡Espera un minuto!', + onConfirm = () => {}, + onCancel = () => {} + ) { + this.$buefy.dialog.alert({ + ariaRole: 'alertdialog', + ariaModal: true, + type: 'is-warning', + title, + message, + confirmText: 'Confirmar', + canCancel: true, + cancelText: 'Cancelar', + hasIcon: true, + iconPack: 'mdi', + icon: 'help-circle', + onConfirm, + onCancel, + }) + }, + getLocalhostInfo() { + this.admin.idUsuario = Number(localStorage.getItem('idUsuario')) + this.admin.idTipoUsuario = Number(localStorage.getItem('idTipoUsuario')) + this.admin.tipoUsuario = localStorage.getItem('tipoUsuario') + this.admin.token = { + headers: { + token: localStorage.getItem('token'), + }, + } + }, + }, + created() { + this.getLocalhostInfo() + if (this.admin.idTipoUsuario === 2) this.$router.push('/responsable') + if (this.admin.idTipoUsuario === 3) this.$router.push('/alumno') + if (this.admin.idTipoUsuario === 4) this.$router.push('/casoEspecial') + }, } diff --git a/pages/admin/servicio/index.vue b/pages/admin/servicio/index.vue index beb270e..3d73edd 100644 --- a/pages/admin/servicio/index.vue +++ b/pages/admin/servicio/index.vue @@ -22,5 +22,82 @@ export default { this.$router.push('/admin') } }, + data() { + return { + admin: {}, + } + }, + methods: { + imprimirError(err = {}, title = '¡Hubo un error!', onConfirm = () => {}) { + this.$buefy.dialog.alert({ + ariaRole: 'alertdialog', + ariaModal: true, + type: 'is-danger', + title, + message: err.message, + confirmText: 'Entendido', + hasIcon: true, + iconPack: 'mdi', + icon: 'alert-octagon', + onConfirm, + }) + if (err.err && err.err === 'token error') { + localStorage.clear() + this.$router.push('/') + } + }, + imprimirMensaje(message, title = '¡Felicidades!', onConfirm = () => {}) { + this.$buefy.dialog.alert({ + ariaRole: 'alertdialog', + ariaModal: true, + type: 'is-success', + title, + message, + confirmText: 'Ok', + hasIcon: true, + iconPack: 'mdi', + icon: 'check-circle', + onConfirm, + }) + }, + imprimirWarning( + message, + title = '¡Espera un minuto!', + onConfirm = () => {}, + onCancel = () => {} + ) { + this.$buefy.dialog.alert({ + ariaRole: 'alertdialog', + ariaModal: true, + type: 'is-warning', + title, + message, + confirmText: 'Confirmar', + canCancel: true, + cancelText: 'Cancelar', + hasIcon: true, + iconPack: 'mdi', + icon: 'help-circle', + onConfirm, + onCancel, + }) + }, + getLocalhostInfo() { + this.admin.idUsuario = Number(localStorage.getItem('idUsuario')) + this.admin.idTipoUsuario = Number(localStorage.getItem('idTipoUsuario')) + this.admin.tipoUsuario = localStorage.getItem('tipoUsuario') + this.admin.token = { + headers: { + token: localStorage.getItem('token'), + }, + } + }, + }, + created() { + this.getLocalhostInfo() + if (this.admin.idTipoUsuario === 2) this.$router.push('/responsable') + if (this.admin.idTipoUsuario === 3) this.$router.push('/alumno') + if (this.admin.idTipoUsuario === 4) this.$router.push('/casoEspecial') + }, } diff --git a/pages/admin/servicio/modificar/index.vue b/pages/admin/servicio/modificar/index.vue index 63ebae9..4724509 100644 --- a/pages/admin/servicio/modificar/index.vue +++ b/pages/admin/servicio/modificar/index.vue @@ -22,5 +22,82 @@ export default { this.$router.push('/admin') } }, + data() { + return { + admin: {}, + } + }, + methods: { + imprimirError(err = {}, title = '¡Hubo un error!', onConfirm = () => {}) { + this.$buefy.dialog.alert({ + ariaRole: 'alertdialog', + ariaModal: true, + type: 'is-danger', + title, + message: err.message, + confirmText: 'Entendido', + hasIcon: true, + iconPack: 'mdi', + icon: 'alert-octagon', + onConfirm, + }) + if (err.err && err.err === 'token error') { + localStorage.clear() + this.$router.push('/') + } + }, + imprimirMensaje(message, title = '¡Felicidades!', onConfirm = () => {}) { + this.$buefy.dialog.alert({ + ariaRole: 'alertdialog', + ariaModal: true, + type: 'is-success', + title, + message, + confirmText: 'Ok', + hasIcon: true, + iconPack: 'mdi', + icon: 'check-circle', + onConfirm, + }) + }, + imprimirWarning( + message, + title = '¡Espera un minuto!', + onConfirm = () => {}, + onCancel = () => {} + ) { + this.$buefy.dialog.alert({ + ariaRole: 'alertdialog', + ariaModal: true, + type: 'is-warning', + title, + message, + confirmText: 'Confirmar', + canCancel: true, + cancelText: 'Cancelar', + hasIcon: true, + iconPack: 'mdi', + icon: 'help-circle', + onConfirm, + onCancel, + }) + }, + getLocalhostInfo() { + this.admin.idUsuario = Number(localStorage.getItem('idUsuario')) + this.admin.idTipoUsuario = Number(localStorage.getItem('idTipoUsuario')) + this.admin.tipoUsuario = localStorage.getItem('tipoUsuario') + this.admin.token = { + headers: { + token: localStorage.getItem('token'), + }, + } + }, + }, + created() { + this.getLocalhostInfo() + if (this.admin.idTipoUsuario === 2) this.$router.push('/responsable') + if (this.admin.idTipoUsuario === 3) this.$router.push('/alumno') + if (this.admin.idTipoUsuario === 4) this.$router.push('/casoEspecial') + }, } diff --git a/pages/alumno/cuestionario/index.vue b/pages/alumno/cuestionario/index.vue index 6c7ff51..14215f7 100644 --- a/pages/alumno/cuestionario/index.vue +++ b/pages/alumno/cuestionario/index.vue @@ -256,6 +256,83 @@ export default { mounted() { this.idCuestionario = localStorage.getItem('idCuestionarioAlumno') }, + // data() { + // return { + // admin: {}, + // } + // }, + // methods: { + // imprimirError(err = {}, title = '¡Hubo un error!', onConfirm = () => {}) { + // this.$buefy.dialog.alert({ + // ariaRole: 'alertdialog', + // ariaModal: true, + // type: 'is-danger', + // title, + // message: err.message, + // confirmText: 'Entendido', + // hasIcon: true, + // iconPack: 'mdi', + // icon: 'alert-octagon', + // onConfirm, + // }) + // if (err.err && err.err === 'token error') { + // localStorage.clear() + // this.$router.push('/') + // } + // }, + // imprimirMensaje(message, title = '¡Felicidades!', onConfirm = () => {}) { + // this.$buefy.dialog.alert({ + // ariaRole: 'alertdialog', + // ariaModal: true, + // type: 'is-success', + // title, + // message, + // confirmText: 'Ok', + // hasIcon: true, + // iconPack: 'mdi', + // icon: 'check-circle', + // onConfirm, + // }) + // }, + // imprimirWarning( + // message, + // title = '¡Espera un minuto!', + // onConfirm = () => {}, + // onCancel = () => {} + // ) { + // this.$buefy.dialog.alert({ + // ariaRole: 'alertdialog', + // ariaModal: true, + // type: 'is-warning', + // title, + // message, + // confirmText: 'Confirmar', + // canCancel: true, + // cancelText: 'Cancelar', + // hasIcon: true, + // iconPack: 'mdi', + // icon: 'help-circle', + // onConfirm, + // onCancel, + // }) + // }, + // getLocalhostInfo() { + // this.admin.idUsuario = Number(localStorage.getItem('idUsuario')) + // this.admin.idTipoUsuario = Number(localStorage.getItem('idTipoUsuario')) + // this.admin.tipoUsuario = localStorage.getItem('tipoUsuario') + // this.admin.token = { + // headers: { + // token: localStorage.getItem('token'), + // }, + // } + // }, + // }, + // created() { + // this.getLocalhostInfo() + // if (this.admin.idTipoUsuario === 2) this.$router.push('/responsable') + // if (this.admin.idTipoUsuario === 3) this.$router.push('/alumno') + // if (this.admin.idTipoUsuario === 4) this.$router.push('/casoEspecial') + // }, }