vista carta de aceptación mejorado

This commit is contained in:
Lemuel Marquez
2021-05-16 22:14:27 -05:00
parent 1a55bcf7aa
commit 9cd91c8752
37 changed files with 216 additions and 59 deletions
+1 -1
View File
@@ -122,7 +122,7 @@ export default {
},
token: {
headers: {
token: window.localStorage.getItem('token'),
token: localStorage.getItem('token'),
},
},
}
@@ -148,7 +148,7 @@ export default {
this.admin.tipoUsuario = localStorage.getItem('tipoUsuario')
this.token = {
headers: {
token: window.localStorage.getItem('token'),
token: localStorage.getItem('token'),
},
}
},
@@ -213,7 +213,7 @@ export default {
},
watch: {
servicioSeleccionado() {
window.localStorage.setItem(
localStorage.setItem(
'idCasoEspecial',
this.servicioSeleccionado.idCasoEspecial
)
+2 -6
View File
@@ -162,14 +162,13 @@ export default {
this.page = page
this.obtenerServicios()
},
getLocalhostInfo() {
this.admin.idUsuario = localStorage.getItem('idUsuario')
this.admin.idTipoUsuario = Number(localStorage.getItem('idTipoUsuario'))
this.admin.tipoUsuario = localStorage.getItem('tipoUsuario')
this.token = {
headers: {
token: window.localStorage.getItem('token'),
token: localStorage.getItem('token'),
},
}
},
@@ -234,10 +233,7 @@ export default {
},
watch: {
servicioSeleccionado() {
window.localStorage.setItem(
'idServicio',
this.servicioSeleccionado.idServicio
)
localStorage.setItem('idServicio', this.servicioSeleccionado.idServicio)
this.$router.push(`/admin/servicio`)
},
},
@@ -43,7 +43,7 @@ export default {
csv: {},
token: {
headers: {
token: window.localStorage.getItem('token'),
token: localStorage.getItem('token'),
},
},
isLoading: false,
@@ -96,7 +96,7 @@ export default {
this.admin.tipoUsuario = localStorage.getItem('tipoUsuario')
this.token = {
headers: {
token: window.localStorage.getItem('token'),
token: localStorage.getItem('token'),
},
}
},
@@ -148,7 +148,7 @@ export default {
},
watch: {
responsableSeleccionado() {
window.localStorage.setItem(
localStorage.setItem(
'idResponsable',
this.responsableSeleccionado.idUsuario
)
+1 -1
View File
@@ -50,7 +50,7 @@ export default {
isLoading: false,
token: {
headers: {
token: window.localStorage.getItem('token'),
token: localStorage.getItem('token'),
},
},
}
+1 -1
View File
@@ -187,7 +187,7 @@ export default {
fechaFin: [],
token: {
headers: {
token: window.localStorage.getItem('token'),
token: localStorage.getItem('token'),
},
},
minDate1: new Date('2020-01-01'),
+1 -1
View File
@@ -56,7 +56,7 @@ export default {
return {
token: {
headers: {
token: window.localStorage.getItem('token'),
token: localStorage.getItem('token'),
},
},
nacimiento: [],
+1 -1
View File
@@ -72,7 +72,7 @@ export default {
return {
token: {
headers: {
token: window.localStorage.getItem('token'),
token: localStorage.getItem('token'),
},
},
isLoading: false,
@@ -210,7 +210,7 @@ export default {
minDate1: new Date('2020-01-01'),
token: {
headers: {
token: window.localStorage.getItem('token'),
token: localStorage.getItem('token'),
},
},
}
+1 -1
View File
@@ -146,7 +146,7 @@ export default {
this.admin.tipoUsuario = localStorage.getItem('tipoUsuario')
this.token = {
headers: {
token: window.localStorage.getItem('token'),
token: localStorage.getItem('token'),
},
}
},
+7 -17
View File
@@ -1,17 +1,5 @@
<template>
<div
v-if="idServicio != null && cartaAceptacion != null"
class="container footter"
>
<b-button
class="border-info mt-5"
type="is-info is-light"
icon-left="arrow-left-box"
tag="router-link"
to="/responsable"
>Regresar</b-button
>
<div class="container">
<h3 class="title is-4 mt-4">
Carta de aceptación (en formato .PDF. No se aceptan fotos).
</h3>
@@ -29,6 +17,7 @@
<p>
<b-icon icon="upload" size="is-large"></b-icon>
</p>
<p>
{{
file.name || 'Arrastra aquí tu archivo o da click para buscar'
@@ -67,7 +56,7 @@ export default {
isLoading: false,
token: {
headers: {
token: window.localStorage.getItem('token'),
token: localStorage.getItem('token'),
},
},
}
@@ -127,9 +116,9 @@ export default {
this.idServicio = localStorage.getItem('idServicio')
this.cartaAceptacion = localStorage.getItem('cartaAceptacion')
if (this.idServicio === null || this.cartaAceptacion === null) {
this.$router.push('/responsable')
}
// if (this.idServicio === null || this.cartaAceptacion === null) {
// this.$router.push('/responsable')
// }
},
error(msj) {
let salir = false
@@ -183,6 +172,7 @@ export default {
.centro {
text-align: center;
}
.footter {
margin-bottom: 10rem;
}
+1 -1
View File
@@ -67,7 +67,7 @@ export default {
isLoading: false,
token: {
headers: {
token: window.localStorage.getItem('token'),
token: localStorage.getItem('token'),
},
},
}
+1 -1
View File
@@ -184,7 +184,7 @@ export default {
p7: '',
token: {
headers: {
token: window.localStorage.getItem('token'),
token: localStorage.getItem('token'),
},
},
}
@@ -182,7 +182,7 @@ export default {
return {
token: {
headers: {
token: window.localStorage.getItem('token'),
token: localStorage.getItem('token'),
},
},
isLoading: false,
+3 -5
View File
@@ -103,7 +103,7 @@
@click="responsableUpdate(props.row.idServicio, 'carta_aceptacion')"
v-if="props.row.Status.idStatus === 7"
>
Carta Término
Carta Aceptación Rechazada
</b-button>
<span :class="types(props.row.Status.idStatus)" v-else>{{
@@ -209,8 +209,7 @@ export default {
this.obtenerServicios()
},
responsableUpdate(idServicio, path) {
window.localStorage.setItem('idServicio', idServicio)
console.log(path)
localStorage.setItem('idServicio', idServicio)
this.$router.push(`/responsable/${path}`)
},
getLocalhostInfo() {
@@ -221,7 +220,7 @@ export default {
this.responsable.tipoUsuario = localStorage.getItem('tipoUsuario')
this.token = {
headers: {
token: window.localStorage.getItem('token'),
token: localStorage.getItem('token'),
},
}
},
@@ -248,7 +247,6 @@ export default {
this.token
)
.then((res) => {
console.log(res.data)
this.data = res.data.serviciosResponsable
this.total = res.data.count
this.isLoading = false
+2 -2
View File
@@ -28,8 +28,8 @@ export default {
// 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
View File
@@ -271,6 +271,7 @@ export default {
if (idTipoUsuario === 2) this.$router.push('/responsable')
if (idTipoUsuario === 3) this.$router.push('/alumno')
if (idTipoUsuario === 4) this.$router.push('/casoEspecial')
},
}
</script>
@@ -17,6 +17,7 @@ export default {
if (idTipoUsuario === 2) this.$router.push('/responsable')
if (idTipoUsuario === 3) this.$router.push('/alumno')
if (idTipoUsuario === 4) this.$router.push('/casoEspecial')
},
}
</script>
@@ -18,6 +18,7 @@ export default {
if (idTipoUsuario === 2) this.$router.push('/responsable')
if (idTipoUsuario === 3) this.$router.push('/alumno')
if (idTipoUsuario === 4) this.$router.push('/casoEspecial')
},
}
</script>
+2 -1
View File
@@ -1,7 +1,7 @@
<template>
<section class="container">
<BotonRegresar path="/admin" />
<TablaCasosEspeciales />
</section>
</template>
@@ -19,6 +19,7 @@ export default {
if (idTipoUsuario === 2) this.$router.push('/responsable')
if (idTipoUsuario === 3) this.$router.push('/alumno')
if (idTipoUsuario === 4) this.$router.push('/casoEspecial')
},
}
</script>
+1
View File
@@ -30,6 +30,7 @@ export default {
if (idTipoUsuario === 2) this.$router.push('/responsable')
if (idTipoUsuario === 3) this.$router.push('/alumno')
if (idTipoUsuario === 4) this.$router.push('/casoEspecial')
},
}
</script>
+1
View File
@@ -32,6 +32,7 @@ export default {
if (idTipoUsuario === 2) this.$router.push('/responsable')
if (idTipoUsuario === 3) this.$router.push('/alumno')
if (idTipoUsuario === 4) this.$router.push('/casoEspecial')
},
}
</script>
@@ -67,7 +67,7 @@ export default {
selected: {},
token: {
headers: {
token: window.localStorage.getItem('token'),
token: localStorage.getItem('token'),
},
},
}
@@ -131,6 +131,8 @@ export default {
if (idTipoUsuario === 2) this.$router.push('/responsable')
if (idTipoUsuario === 3) this.$router.push('/alumno')
if (idTipoUsuario === 4) this.$router.push('/casoEspecial')
if (!localStorage.getItem('idResponsable')) {
this.$router.push('/admin/responsables')
}
@@ -50,7 +50,7 @@ export default {
idServicio: localStorage.getItem('idServicio'),
token: {
headers: {
token: window.localStorage.getItem('token'),
token: localStorage.getItem('token'),
},
},
isLoading: false,
@@ -169,6 +169,10 @@ export default {
},
},
beforeCreate() {
if (idTipoUsuario === 2) this.$router.push('/responsable')
if (idTipoUsuario === 3) this.$router.push('/alumno')
if (idTipoUsuario === 4) this.$router.push('/casoEspecial')
if (!localStorage.getItem('idResponsable')) {
this.$router.push('/admin/responsables')
}
+2 -1
View File
@@ -16,8 +16,9 @@ export default {
if (idTipoUsuario === 2) this.$router.push('/responsable')
if (idTipoUsuario === 3) this.$router.push('/alumno')
if (idTipoUsuario === 4) this.$router.push('/casoEspecial')
if (!window.localStorage.getItem('idServicio')) {
if (!localStorage.getItem('idServicio')) {
this.$router.push('/admin')
}
},
+3 -1
View File
@@ -16,7 +16,9 @@ export default {
if (idTipoUsuario === 2) this.$router.push('/responsable')
if (idTipoUsuario === 3) this.$router.push('/alumno')
if (!window.localStorage.getItem('idServicio')) {
if (idTipoUsuario === 4) this.$router.push('/casoEspecial')
if (!localStorage.getItem('idServicio')) {
this.$router.push('/admin')
}
},
+1 -1
View File
@@ -54,7 +54,7 @@ export default {
return {
token: {
headers: {
token: window.localStorage.getItem('token'),
token: localStorage.getItem('token'),
},
},
isLoading: false,
+3 -3
View File
@@ -34,7 +34,7 @@ export default {
return {
token: {
headers: {
token: window.localStorage.getItem('token'),
token: localStorage.getItem('token'),
},
},
activeStep: '',
@@ -148,11 +148,11 @@ export default {
this.alumno.nombre = localStorage.getItem('nombre')
this.alumno.cuenta = localStorage.getItem('usuario')
window.localStorage.setItem(
localStorage.setItem(
'idCuestionarioAlumno',
resp.data.idCuestionarioAlumno
)
window.localStorage.setItem('idServicio', resp.data.idServicio)
localStorage.setItem('idServicio', resp.data.idServicio)
})
.catch((error) => {
this.error(error.response.data.message)
+7
View File
@@ -14,5 +14,12 @@ export default {
components: {
TablaServicios,
},
beforeCreate() {
const idTipoUsuario = Number(localStorage.getItem('idTipoUsuario'))
if (idTipoUsuario === 1) this.$router.push('/admin')
if (idTipoUsuario === 2) this.$router.push('/alumno')
if (idTipoUsuario === 3) this.$router.push('/alumno')
},
}
</script>
+7
View File
@@ -14,6 +14,13 @@ export default {
BotonRegresar,
FormularioEspecial,
},
beforeCreate() {
const idTipoUsuario = Number(localStorage.getItem('idTipoUsuario'))
if (idTipoUsuario === 1) this.$router.push('/admin')
if (idTipoUsuario === 2) this.$router.push('/alumno')
if (idTipoUsuario === 3) this.$router.push('/alumno')
},
}
</script>
+1
View File
@@ -16,6 +16,7 @@ export default {
if (idTipoUsuario === 1) this.$router.push('/admin')
if (idTipoUsuario === 3) this.$router.push('/alumno')
if (idTipoUsuario === 4) this.$router.push('/casoEspecial')
},
}
</script>
+144 -5
View File
@@ -1,21 +1,160 @@
<template>
<section>
<CartaAceptacion />
<section class="container section">
<BotonRegresar
path="/responsable"
:deleteFromLocalStorage="['idServicio']"
/>
<h3 class="title is-4 mt-4">
Carta de aceptación (en formato .PDF. No se aceptan fotos).
</h3>
<b-field>
<b-upload
v-model="file"
type="is-black"
accept="application/pdf"
drag-drop
expanded
>
<div class="section content has-text-centered">
<p>
<b-icon icon="upload" size="is-large"></b-icon>
</p>
<p>
{{ file.name || 'Arrastra aquí tu archivo o da click para buscar' }}
</p>
<p>Tamaño máximo para el archivo: 20MB</p>
</div>
</b-upload>
</b-field>
<b-field class="has-text-centered">
<b-button
:disabled="!file.size"
class="border-success my-5"
type="is-success"
@click="subir()"
>Enviar</b-button
>
</b-field>
<b-loading
:is-full-page="true"
v-model="isLoading"
:can-cancel="false"
></b-loading>
</section>
</template>
<script>
import CartaAceptacion from '../../../components/responsable/cartaAceptacion'
import axios from 'axios'
import BotonRegresar from '../../../components/botonRegresar'
export default {
components: {
CartaAceptacion,
data() {
return {
responsable: {},
file: {},
idServicio: '',
isLoading: false,
token: {},
}
},
components: { BotonRegresar },
methods: {
getLocalhostInfo() {
this.responsable.idUsuario = localStorage.getItem('idUsuario')
this.responsable.idTipoUsuario = Number(
localStorage.getItem('idTipoUsuario')
)
this.responsable.tipoUsuario = localStorage.getItem('tipoUsuario')
this.token = {
headers: {
'Content-Type': 'multipart/form-data',
token: localStorage.getItem('token'),
},
}
this.idServicio = localStorage.getItem('idServicio')
},
subir() {
const formData = new FormData()
const data = { idServicio: this.idServicio }
this.isLoading = true
formData.append('data', JSON.stringify(data))
formData.append('cartaAceptacion', this.file)
axios
.put(
`${process.env.api}/servicio/carta_aceptacion`,
formData,
this.token
)
.then((res) => {
this.isLoading = false
this.$buefy.dialog.alert({
title: 'Success',
message: 'Se subio el archivo correctamente.',
type: 'is-success',
hasIcon: true,
icon: 'checkbox-marked-circle',
iconPack: 'mdi',
ariaRole: 'alertdialog',
ariaModal: true,
})
localStorage.removeItem('idServicio')
this.$router.push('/responsable')
})
.catch((err) => {
this.isLoading = false
this.imprimirerr(err.response.data)
})
},
imprimirError(err) {
this.$buefy.dialog.alert({
title: 'Error',
message: err.message,
type: 'is-danger',
hasIcon: true,
icon: 'alert-circle',
iconPack: 'mdi',
ariaRole: 'alertdialog',
ariaModal: true,
})
if (err.err === 'token error') {
localStorage.clear()
this.$router.push('/')
}
},
},
watch: {
file() {
const TamMax = 20000000
console.log(this.file)
if (this.file.size > TamMax) {
this.$buefy.toast.open({
message: 'El archivo excede el tamaño permitido',
type: 'is-danger',
})
this.file = {}
}
},
},
created() {
if (localStorage.getItem('idServicio')) this.getLocalhostInfo()
else this.$router.push('/responsable')
},
beforeCreate() {
const idTipoUsuario = Number(localStorage.getItem('idTipoUsuario'))
if (idTipoUsuario === 1) this.$router.push('/admin')
if (idTipoUsuario === 3) this.$router.push('/alumno')
if (idTipoUsuario === 4) this.$router.push('/casoEspecial')
},
}
</script>
<style></style>
@@ -16,6 +16,7 @@ export default {
if (idTipoUsuario === 1) this.$router.push('/admin')
if (idTipoUsuario === 3) this.$router.push('/alumno')
if (idTipoUsuario === 4) this.$router.push('/casoEspecial')
},
}
</script>
+1
View File
@@ -16,6 +16,7 @@ export default {
if (idTipoUsuario === 1) this.$router.push('/admin')
if (idTipoUsuario === 3) this.$router.push('/alumno')
if (idTipoUsuario === 4) this.$router.push('/casoEspecial')
},
}
</script>
+1
View File
@@ -33,6 +33,7 @@ export default {
if (idTipoUsuario === 1) this.$router.push('/admin')
if (idTipoUsuario === 3) this.$router.push('/alumno')
if (idTipoUsuario === 4) this.$router.push('/casoEspecial')
},
}
</script>
+1
View File
@@ -22,6 +22,7 @@ export default {
if (idTipoUsuario === 1) this.$router.push('/admin')
if (idTipoUsuario === 3) this.$router.push('/alumno')
if (idTipoUsuario === 4) this.$router.push('/casoEspecial')
},
}
</script>