funciones para imprimir mejoradas y finales

This commit is contained in:
Lemuel Marquez
2021-08-04 14:38:44 -05:00
parent 0bbf324f30
commit 8085f2dc01
3 changed files with 79 additions and 16 deletions
+2 -6
View File
@@ -23,13 +23,9 @@ export default {
modules: ['nuxt-buefy', '@nuxtjs/axios'],
axios: {},
build: {},
/* Server de pruebas */
// static: {
// prefix: false,
// },
env: {
// api: "http://localhost:3000",
api: 'https://venus.acatlan.unam.mx/ss-pruebas',
api: "http://localhost:3000",
// api: 'https://venus.acatlan.unam.mx/ss-pruebas',
// api: "https://890af9d598a4.ngrok.io"
// api: "https://venus.acatlan.unam.mx/serviciosocial",
},
+1 -4
View File
@@ -2159,7 +2159,6 @@
"merge-source-map": "^1.1.0",
"postcss": "^7.0.14",
"postcss-selector-parser": "^6.0.2",
"prettier": "^1.18.2",
"source-map": "~0.6.1",
"vue-template-es2015-compiler": "^1.9.0"
},
@@ -3360,7 +3359,6 @@
"dependencies": {
"anymatch": "~3.1.1",
"braces": "~3.0.2",
"fsevents": "~2.3.1",
"glob-parent": "~5.1.0",
"is-binary-path": "~2.1.0",
"is-glob": "~4.0.1",
@@ -11376,8 +11374,7 @@
"dependencies": {
"chokidar": "^3.4.1",
"graceful-fs": "^4.1.2",
"neo-async": "^2.5.0",
"watchpack-chokidar2": "^2.0.1"
"neo-async": "^2.5.0"
},
"optionalDependencies": {
"watchpack-chokidar2": "^2.0.1"
+76 -6
View File
@@ -25,12 +25,82 @@ export default {
components: {
InputTableA,
},
beforeCreate() {
const idTipoUsuario = Number(localStorage.getItem('idTipoUsuario'))
if (idTipoUsuario === 2) this.$router.push('/responsable')
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')
},
}
</script>