casos especiales proceso listo
This commit is contained in:
@@ -87,7 +87,7 @@
|
||||
actualizar
|
||||
)
|
||||
"
|
||||
:disabled="!mostrar()"
|
||||
:disabled="!mostrarBoton()"
|
||||
>
|
||||
Actualizar Datos
|
||||
</b-button>
|
||||
@@ -100,22 +100,22 @@ import moment from 'moment'
|
||||
import validator from 'validator'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isLoading: false,
|
||||
idCasoEspecial: null,
|
||||
minDate1: new Date('2020-01-01'),
|
||||
nuevo: {},
|
||||
viejo: {},
|
||||
}
|
||||
},
|
||||
props: {
|
||||
idCasoEspecial: { type: Number, required: true },
|
||||
admin: { type: Object, required: true },
|
||||
viejo: { type: Object, required: true },
|
||||
imprimirMensaje: { type: Function, required: true },
|
||||
imprimirWarning: { type: Function, required: true },
|
||||
imprimirError: { type: Function, required: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isLoading: false,
|
||||
minDate1: new Date('2020-01-01'),
|
||||
nuevo: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
fecha(date) {
|
||||
if (date) {
|
||||
@@ -127,7 +127,7 @@ export default {
|
||||
}
|
||||
return ''
|
||||
},
|
||||
mostrar() {
|
||||
mostrarBoton() {
|
||||
if (
|
||||
this.nuevo.correo ||
|
||||
this.nuevo.direccion ||
|
||||
@@ -139,11 +139,8 @@ export default {
|
||||
(this.nuevo.fechaInicio && this.nuevo.fechaFin)
|
||||
) {
|
||||
if (this.nuevo.correo) {
|
||||
if (validator.isEmail(this.nuevo.correo)) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
if (validator.isEmail(this.nuevo.correo)) return true
|
||||
else return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -176,23 +173,6 @@ export default {
|
||||
this.imprimirError(err.response.data)
|
||||
})
|
||||
},
|
||||
obtenerCasoEspecial() {
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.get(
|
||||
`${process.env.api}/caso_especial?idCasoEspecial=${this.idCasoEspecial}`,
|
||||
this.admin.token
|
||||
)
|
||||
.then((res) => {
|
||||
this.viejo = res.data
|
||||
// this.nuevo.motivo = this.viejo.motivo
|
||||
this.updateIsLoading(false)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.imprimirError(err.response.data)
|
||||
})
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
minDate2() {
|
||||
@@ -201,10 +181,6 @@ export default {
|
||||
return new Date(min.getFullYear(), min.getMonth() + 6, min.getDate())
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.idCasoEspecial = localStorage.getItem('idCasoEspecial')
|
||||
if (this.admin.idTipoUsuario === 1) this.obtenerCasoEspecial()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -38,10 +38,7 @@ export default {
|
||||
this.admin.token
|
||||
)
|
||||
.then((res) => {
|
||||
localStorage.removeItem('idCasoEspecial')
|
||||
this.imprimirMensaje(
|
||||
'Ha liberado este servicio social correctamente.'
|
||||
)
|
||||
this.imprimirMensaje(res.data.message)
|
||||
this.updateIsLoading(false)
|
||||
this.$router.push('/admin/casos_especiales')
|
||||
})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<section>
|
||||
<div>
|
||||
<h3 class="title">Casos Especiales</h3>
|
||||
|
||||
<div class="columns">
|
||||
@@ -34,14 +34,14 @@
|
||||
v-for="(s, i) in status"
|
||||
:key="i"
|
||||
:value="s.idStatus"
|
||||
v-show="i > 8 && i < 14"
|
||||
v-show="i > 9"
|
||||
>
|
||||
{{ s.status }}
|
||||
</option>
|
||||
</b-select>
|
||||
</b-field>
|
||||
|
||||
<div class="column is-align-self-center">
|
||||
<b-field class="column is-align-self-center">
|
||||
<b-button
|
||||
type="is-info"
|
||||
@click="obtenerCasosEspeciales()"
|
||||
@@ -50,7 +50,7 @@
|
||||
>
|
||||
Buscar
|
||||
</b-button>
|
||||
</div>
|
||||
</b-field>
|
||||
</div>
|
||||
|
||||
<TablaServiciosSociales
|
||||
@@ -64,7 +64,7 @@
|
||||
:data="data"
|
||||
:onPageChange="onPageChange"
|
||||
/>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -88,8 +88,6 @@ export default {
|
||||
},
|
||||
props: {
|
||||
admin: { type: Object, required: true },
|
||||
imprimirMensaje: { type: Function, required: true },
|
||||
imprimirWarning: { type: Function, required: true },
|
||||
imprimirError: { type: Function, required: true },
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -3,10 +3,12 @@
|
||||
<BotonRegresar path="/admin/casos_especiales/caso_especial" />
|
||||
|
||||
<EditarCasoEspecial
|
||||
:idCasoEspecial="idCasoEspecial"
|
||||
:admin="admin"
|
||||
:viejo="viejo"
|
||||
:imprimirError="imprimirError"
|
||||
:imprimirMensaje="imprimirMensaje"
|
||||
:imprimirWarning="imprimirWarning"
|
||||
:imprimirError="imprimirError"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
/>
|
||||
|
||||
@@ -15,6 +17,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import EditarCasoEspecial from '@/components/admin/EditarCasoEspecial'
|
||||
|
||||
export default {
|
||||
@@ -24,13 +27,36 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
isLoading: false,
|
||||
idCasoEspecial: null,
|
||||
admin: {},
|
||||
viejo: { Carrera: {}, Status: {}, Usuario: {} },
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
updateIsLoading(booleanValue) {
|
||||
this.isLoading = booleanValue
|
||||
},
|
||||
obtenerCasoEspecial() {
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.get(
|
||||
`${process.env.api}/caso_especial?idCasoEspecial=${this.idCasoEspecial}`,
|
||||
this.admin.token
|
||||
)
|
||||
.then((res) => {
|
||||
this.viejo = res.data
|
||||
if (
|
||||
this.viejo.Status.idStatus != 11 &&
|
||||
this.viejo.Status.idStatus != 12
|
||||
)
|
||||
this.$router.push('/admin/casos_especiales/caso_especial')
|
||||
this.updateIsLoading(false)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.imprimirError(err.response.data)
|
||||
})
|
||||
},
|
||||
imprimirError(err = {}, title = '¡Hubo un error!', onConfirm = () => {}) {
|
||||
this.$buefy.dialog.alert({
|
||||
ariaRole: 'alertdialog',
|
||||
@@ -94,6 +120,7 @@ export default {
|
||||
token: localStorage.getItem('token'),
|
||||
},
|
||||
}
|
||||
this.idCasoEspecial = Number(localStorage.getItem('idCasoEspecial'))
|
||||
},
|
||||
},
|
||||
created() {
|
||||
@@ -101,8 +128,10 @@ export default {
|
||||
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')
|
||||
if (!localStorage.getItem('idCasoEspecial'))
|
||||
this.$router.push('/admin/casos_especiales')
|
||||
else if (this.admin.idTipoUsuario === 1) {
|
||||
if (!this.idCasoEspecial) this.$router.push('/admin/casos_especiales')
|
||||
else this.obtenerCasoEspecial()
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
<template>
|
||||
<section class="container px-2 pb-6">
|
||||
<BotonRegresar
|
||||
path="/admin/casos_especiales"
|
||||
:deleteFromLocalStorage="['idCasoEspecial']"
|
||||
/>
|
||||
<BotonRegresar path="/admin/casos_especiales" />
|
||||
|
||||
<Informacion :alumno="alumno" />
|
||||
<InformacionCasoEspecial :alumno="alumno" />
|
||||
|
||||
<Liberar
|
||||
<LiberarCasoEspecial
|
||||
v-if="alumno.Status.idStatus === 11 || alumno.Status.idStatus === 12"
|
||||
:idCasoEspecial="idCasoEspecial"
|
||||
:admin="admin"
|
||||
@@ -17,10 +14,7 @@
|
||||
:updateIsLoading="updateIsLoading"
|
||||
/>
|
||||
|
||||
<BotonRegresar
|
||||
path="/admin/casos_especiales"
|
||||
:deleteFromLocalStorage="['idCasoEspecial']"
|
||||
/>
|
||||
<BotonRegresar path="/admin/casos_especiales" />
|
||||
|
||||
<b-loading :is-full-page="true" :can-cancel="false" v-model="isLoading" />
|
||||
</section>
|
||||
@@ -29,14 +23,14 @@
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import BotonRegresar from '@/components/botonRegresar'
|
||||
import Informacion from '@/components/admin/InformacionCasoEspecial'
|
||||
import Liberar from '@/components/admin/LiberarCasoEspecial'
|
||||
import InformacionCasoEspecial from '@/components/admin/InformacionCasoEspecial'
|
||||
import LiberarCasoEspecial from '@/components/admin/LiberarCasoEspecial'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
BotonRegresar,
|
||||
Informacion,
|
||||
Liberar,
|
||||
InformacionCasoEspecial,
|
||||
LiberarCasoEspecial,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -138,7 +132,7 @@ export default {
|
||||
if (this.admin.idTipoUsuario === 3) this.$router.push('/alumno')
|
||||
if (this.admin.idTipoUsuario === 4) this.$router.push('/casoEspecial')
|
||||
if (!this.idCasoEspecial) this.$router.push('/admin/casos_especiales')
|
||||
this.obtenerCasoEspecial()
|
||||
else this.obtenerCasoEspecial()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -2,12 +2,7 @@
|
||||
<section class="container px-2 pb-6">
|
||||
<BotonRegresar path="/admin" />
|
||||
|
||||
<TablaCasosEspecialesAdmin
|
||||
:admin="admin"
|
||||
:imprimirMensaje="imprimirMensaje"
|
||||
:imprimirWarning="imprimirWarning"
|
||||
:imprimirError="imprimirError"
|
||||
/>
|
||||
<TablaCasosEspecialesAdmin :admin="admin" :imprimirError="imprimirError" />
|
||||
</section>
|
||||
</template>
|
||||
|
||||
@@ -44,42 +39,6 @@ export default {
|
||||
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: () => 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: () => onConfirm(),
|
||||
onCancel: () => onCancel(),
|
||||
})
|
||||
},
|
||||
getLocalhostInfo() {
|
||||
this.admin.idUsuario = Number(localStorage.getItem('idUsuario'))
|
||||
this.admin.idTipoUsuario = Number(localStorage.getItem('idTipoUsuario'))
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
|
||||
<NuevoCasoEspecial
|
||||
:responsable="responsable"
|
||||
:imprimirError="imprimirError"
|
||||
:imprimirMensaje="imprimirMensaje"
|
||||
:imprimirWarning="imprimirWarning"
|
||||
:imprimirError="imprimirError"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user