102 lines
2.4 KiB
Vue
102 lines
2.4 KiB
Vue
<template>
|
|
<div>
|
|
<Title title="PC Puma" :operador="operador" />
|
|
|
|
<b-loading :is-full-page="true" v-model="isLoading" :can-cancel="false" />
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import Title from '@/components/layouts/Title'
|
|
|
|
export default {
|
|
components: {
|
|
Title,
|
|
},
|
|
data() {
|
|
return {
|
|
operador: {},
|
|
isLoading: false,
|
|
}
|
|
},
|
|
methods: {
|
|
updateIsLoading(valorBooleano) {
|
|
this.isLoading = valorBooleano
|
|
},
|
|
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, onConfirm = () => {}, title = '¡Felicidades!') {
|
|
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,
|
|
onConfirm = () => {},
|
|
title = '¡Espera un minuto!',
|
|
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.operador.idOperador = localStorage.getItem('idOperador')
|
|
this.operador.operador = localStorage.getItem('operador')
|
|
this.operador.idModulo = Number(localStorage.getItem('idModulo'))
|
|
this.operador.tipoUsuario = localStorage.getItem('tipoUsuario')
|
|
this.operador.idTipoUsuario = Number(
|
|
localStorage.getItem('idTipoUsuario')
|
|
)
|
|
this.operador.token = {
|
|
headers: {
|
|
token: localStorage.getItem('token'),
|
|
},
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
this.getLocalhostInfo()
|
|
},
|
|
}
|
|
</script>
|
|
|
|
<style></style>
|