From 66dfae4dd85297fe7b798ee423e5a9cf17e4690e Mon Sep 17 00:00:00 2001
From: casnet1
Date: Tue, 8 Dec 2020 20:10:52 -0600
Subject: [PATCH] =?UTF-8?q?tama=C3=B1o=20archico,=20mas=20data,=20reload?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/alumno/DataAlumno.vue | 41 ++++++++++++++++++++++++++++++-
pages/responsable/nuevo/index.vue | 19 ++++++++++++--
2 files changed, 57 insertions(+), 3 deletions(-)
diff --git a/components/alumno/DataAlumno.vue b/components/alumno/DataAlumno.vue
index 9f00049..3d44687 100644
--- a/components/alumno/DataAlumno.vue
+++ b/components/alumno/DataAlumno.vue
@@ -71,7 +71,11 @@
Nombre: {{ alumno.nombre }}
Número de cuenta: {{ alumno.cuenta }}
Carrera: {{ alumno.carrera }}
+ Créditos: {{ alumno.creditos[1]}}{{ alumno.creditos[2]}}%
Correo: {{ alumno.correo }}
+ Fecha de inicio: {{ fecha(alumno.registro) }}
+ Fecha de finalización: {{ fecha(alumno.inicio) }}
+ Fecha de registro: {{ fecha(alumno.fin) }}
@@ -217,6 +222,7 @@ export default {
alumno: {
carrera: '',
+ creditos: '',
nombre: '',
cuenta: '',
correo: '',
@@ -229,7 +235,8 @@ export default {
idCarrera: '',
idServicio: '',
inicio: [],
- fin: []
+ fin: [],
+ registro: []
},
programa: {
programa: '',
@@ -267,6 +274,12 @@ export default {
}
},
methods: {
+ reset () {
+ this.file = []
+ this.nacimiento = []
+ this.telefono = ''
+ this.direccion = ''
+ },
enviarRegistro () {
const loadingComponent = this.$buefy.loading.open({
container: this.isFullPage ? null : this.$refs.element.$el
@@ -295,6 +308,7 @@ export default {
})
this.reset()
+ location.reload()
})
.catch((error) => {
loadingComponent.close()
@@ -342,6 +356,7 @@ export default {
})
this.reset()
+ location.reload()
})
.catch((error) => {
loadingComponent.close()
@@ -356,6 +371,10 @@ export default {
ariaModal: true
})
})
+ },
+ fecha (date) {
+ const fecha = moment(date)
+ return `${fecha.date()}/${fecha.month() + 1}/${fecha.year()}`
}
},
computed: {
@@ -383,11 +402,13 @@ export default {
this.programa.acatlan = resp.data.Programa.acatlan
this.programa.programaInterno = resp.data.programaInterno
+ this.alumno.creditos = resp.data.creditos
this.alumno.carrera = resp.data.Carrera.carrera
this.alumno.idCarrera = resp.data.Carrera.idCarrera
this.alumno.correo = resp.data.correo
this.alumno.inicio = resp.data.fechaInicio
this.alumno.fin = resp.data.fechaFin
+ this.alumno.registro = resp.data.createdAt
this.alumno.direccion = resp.data.direccion
this.alumno.nacimiento = resp.data.fechaNacimiento
this.alumno.telefono = resp.data.telefono
@@ -400,6 +421,24 @@ export default {
.catch((error) => {
console.log(error.message)
})
+ },
+ watch: {
+ file () {
+ console.log(this.file.size)
+ if (this.file.size >= 20000000) {
+ this.$buefy.dialog.alert({
+ title: 'Error',
+ message: 'El tamaño del archivo exede los 20MB',
+ type: 'is-danger',
+ hasIcon: true,
+ icon: 'alert-circle',
+ iconPack: 'mdi',
+ ariaRole: 'alertdialog',
+ ariaModal: true
+ })
+ this.file = []
+ }
+ }
}
}
diff --git a/pages/responsable/nuevo/index.vue b/pages/responsable/nuevo/index.vue
index a7fcdb5..0100048 100644
--- a/pages/responsable/nuevo/index.vue
+++ b/pages/responsable/nuevo/index.vue
@@ -135,6 +135,7 @@
{{ file.name || "Arrastra aquí tu archivo o da click para buscar"}}
+ Tamaño máximo 20MB
@@ -155,7 +156,7 @@
-