listo admin caso especial

This commit is contained in:
Lemuel Marquez
2021-08-05 14:12:22 -05:00
parent 9431a783b8
commit e291493089
6 changed files with 56 additions and 47 deletions
+24 -1
View File
@@ -193,4 +193,27 @@ export default {
}
</script>
<style></style>
<style>
.input:focus {
border: #1b3d70;
box-shadow: 0 0 8px 0 #1b3d70;
}
.select select:focus {
border-color: #1b3d70;
box-shadow: 0 0 8px 0 #1b3d70;
}
.select:not(.is-multiple):not(.is-loading)::after {
border-color: #1b3d70;
}
.pagination-link.is-current {
background-color: #1b3d70;
border-color: #1b3d70;
}
.pointer {
cursor: pointer;
}
</style>
@@ -77,8 +77,6 @@
Liberar
</b-button>
</b-field>
<b-loading :is-full-page="true" :can-cancel="false" v-model="isLoading" />
</div>
</template>
@@ -91,7 +89,6 @@ export default {
return {
alumno: { Usuario: {}, Carrera: {}, Status: {} },
idCasoEspecial: null,
isLoading: false,
}
},
props: {
@@ -99,6 +96,7 @@ export default {
imprimirMensaje: { type: Function, required: true },
imprimirWarning: { type: Function, required: true },
imprimirError: { type: Function, required: true },
updateIsLoading: { type: Function, required: true },
},
methods: {
fecha(date) {
@@ -111,25 +109,10 @@ export default {
}
return ''
},
obtenerCasoEspecial() {
return axios
.get(
`${process.env.api}/caso_especial?idCasoEspecial=${this.idCasoEspecial}`,
this.admin.token
)
.then((res) => {
this.alumno = res.data
this.isLoading = false
})
.catch((err) => {
this.isLoading = false
this.imprimirError(err.response.data)
})
},
confirmarLiberacion() {
const data = { idCasoEspecial: this.idCasoEspecial }
this.isLoading = true
this.updateIsLoading(true)
axios
.put(
`${process.env.api}/caso_especial/liberacion`,
@@ -139,18 +122,35 @@ export default {
.then((res) => {
localStorage.removeItem('idCasoEspecial')
this.$buefy.dialog.alert('El servicio ha sido liberado.')
this.isLoading = false
this.updateIsLoading(false)
this.$router.push('/admin/casos_especiales')
})
.catch((err) => {
this.isLoading = false
this.updateIsLoading(false)
this.error(err.response.data)
})
},
obtenerCasoEspecial() {
this.updateIsLoading(true)
return axios
.get(
`${process.env.api}/caso_especial?idCasoEspecial=${this.idCasoEspecial}`,
this.admin.token
)
.then((res) => {
this.alumno = res.data
this.updateIsLoading(false)
})
.catch((err) => {
this.updateIsLoading(false)
this.imprimirError(err.response.data)
})
},
},
created() {
this.idCasoEspecial = localStorage.getItem('idCasoEspecial')
if (this.admin.idTipoUsuario === 1) this.obtenerCasoEspecial()
if (this.admin.idTipoUsuario === 1 && this.idCasoEspecial)
this.obtenerCasoEspecial()
},
}
</script>
+1 -24
View File
@@ -150,27 +150,4 @@ export default {
}
</script>
<style>
.input:focus {
border: #1b3d70;
box-shadow: 0 0 8px 0 #1b3d70;
}
.select select:focus {
border-color: #1b3d70;
box-shadow: 0 0 8px 0 #1b3d70;
}
.select:not(.is-multiple):not(.is-loading)::after {
border-color: #1b3d70;
}
.pagination-link.is-current {
background-color: #1b3d70;
border-color: #1b3d70;
}
.pointer {
cursor: pointer;
}
</style>
<style></style>
@@ -10,7 +10,10 @@
:imprimirMensaje="imprimirMensaje"
:imprimirWarning="imprimirWarning"
:imprimirError="imprimirError"
:updateIsLoading="updateIsLoading"
/>
<b-loading :is-full-page="true" :can-cancel="false" v-model="isLoading" />
</section>
</template>
@@ -26,9 +29,13 @@ export default {
data() {
return {
admin: {},
isLoading: false,
}
},
methods: {
updateIsLoading(booleanValue) {
this.isLoading = booleanValue
},
imprimirError(err = {}, title = '¡Hubo un error!', onConfirm = () => {}) {
this.$buefy.dialog.alert({
ariaRole: 'alertdialog',
+2
View File
@@ -101,3 +101,5 @@ export default {
},
}
</script>
<style></style>