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: {
|
||||
|
||||
Reference in New Issue
Block a user