multiple correccion de bugs
This commit is contained in:
@@ -57,14 +57,12 @@
|
||||
|
||||
<b-button
|
||||
type="is-success"
|
||||
v-if="
|
||||
!props.row.folio &&
|
||||
!props.row.monto &&
|
||||
!props.row.fechaTicket &&
|
||||
props.row.validacion != 1
|
||||
"
|
||||
v-if="!props.row.folio && !props.row.monto && !props.row.fechaTicket"
|
||||
@click="
|
||||
cuenta(props.row.Usuario.numeroCuenta),
|
||||
usuario(
|
||||
props.row.Usuario.numeroCuenta,
|
||||
props.row.Usuario.idUsuario
|
||||
),
|
||||
imprimirWarning(
|
||||
'¿Estas seguro de querer validar esta inscripción ?',
|
||||
validarSinTicket
|
||||
@@ -93,7 +91,7 @@ export default {
|
||||
currentPage: 1,
|
||||
perPage: 5,
|
||||
|
||||
noCuenta: '',
|
||||
data: {},
|
||||
validacion: '2',
|
||||
numeroCuenta: '',
|
||||
}
|
||||
@@ -109,7 +107,6 @@ export default {
|
||||
.then((res) => {
|
||||
this.updateIsLoading(false)
|
||||
this.inscripciones = res.data
|
||||
console.log(this.inscripciones)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
@@ -126,13 +123,13 @@ export default {
|
||||
})
|
||||
},
|
||||
validarSinTicket() {
|
||||
const data = {
|
||||
numeroCuenta: this.noCuenta,
|
||||
}
|
||||
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.put(`${process.env.api}/admin/validar_sin_ticket`, data, this.token)
|
||||
.put(
|
||||
`${process.env.api}/admin/validar_sin_ticket`,
|
||||
this.data,
|
||||
this.token
|
||||
)
|
||||
.then((res) => {
|
||||
this.imprimirMensaje(res.data.message)
|
||||
this.updateIsLoading(false)
|
||||
@@ -142,8 +139,9 @@ export default {
|
||||
this.updateIsLoading(false)
|
||||
})
|
||||
},
|
||||
cuenta(value) {
|
||||
this.noCuenta = value
|
||||
usuario(noCuenta, usuario) {
|
||||
this.data.numeroCuenta = noCuenta
|
||||
this.data.idUsuario = usuario
|
||||
},
|
||||
|
||||
imprimirError(err = {}, title = '¡Hubo un error!', onConfirm = () => {}) {
|
||||
|
||||
@@ -122,13 +122,12 @@ export default {
|
||||
imprimirError: { type: Function, required: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
inscripcionesUsuario: { type: Array, required: true },
|
||||
idUsuario: { type: Number, required: true },
|
||||
},
|
||||
|
||||
data() {
|
||||
const today = new Date()
|
||||
return {
|
||||
datosUsuario: {},
|
||||
|
||||
areaMac: false,
|
||||
area1: true,
|
||||
area2: true,
|
||||
@@ -140,13 +139,15 @@ export default {
|
||||
idArea: '4',
|
||||
folio: '',
|
||||
monto: '',
|
||||
fechaTicket: null,
|
||||
dropFiles: [],
|
||||
terminos: false,
|
||||
|
||||
fechaTicket: '',
|
||||
idCarrera: '',
|
||||
|
||||
token: '',
|
||||
minDate: this.diaMin(today),
|
||||
maxDate: new Date(),
|
||||
|
||||
dropFiles: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -174,7 +175,7 @@ export default {
|
||||
|
||||
let formData = new FormData()
|
||||
if (this.error === false) {
|
||||
formData.append('idUsuario', this.datosUsuario.idUsuario)
|
||||
formData.append('idUsuario', this.idUsuario)
|
||||
formData.append('folio', this.folio)
|
||||
if (this.monto === '') this.monto = 0
|
||||
formData.append('monto', this.monto)
|
||||
@@ -187,7 +188,7 @@ export default {
|
||||
.post(
|
||||
`${process.env.api}/usuario/inscripcionUsuario`,
|
||||
formData,
|
||||
this.datosUsuario.token
|
||||
this.token
|
||||
)
|
||||
.then((res) => {
|
||||
this.$emit('pedirInscripciones')
|
||||
@@ -199,9 +200,6 @@ export default {
|
||||
this.updateIsLoading(false)
|
||||
this.imprimirError(err.response.data)
|
||||
})
|
||||
.finally((res) => {
|
||||
this.areaPermitida()
|
||||
})
|
||||
} else {
|
||||
this.imprimirError({
|
||||
message: 'El monto mínimo para esta inscripción es de $20 pesos.',
|
||||
@@ -209,10 +207,7 @@ export default {
|
||||
}
|
||||
},
|
||||
areaPermitida() {
|
||||
if (
|
||||
this.datosUsuario.idCarrera === 11122 ||
|
||||
this.datosUsuario.idCarrera === 20226
|
||||
)
|
||||
if (this.idCarrera === 11122 || this.idCarrera === 20226)
|
||||
this.areaMac = true
|
||||
|
||||
for (let i = 0; i < this.inscripcionesUsuario.length; i++) {
|
||||
@@ -241,12 +236,8 @@ export default {
|
||||
this.dropFiles.splice(index, 1)
|
||||
},
|
||||
getLocalhostInfo() {
|
||||
this.datosUsuario.idUsuario = Number(localStorage.getItem('idUsuario'))
|
||||
this.datosUsuario.numeroCuenta = localStorage.getItem('numeroCuenta')
|
||||
this.datosUsuario.nombre = localStorage.getItem('idnombre')
|
||||
this.datosUsuario.carrera = localStorage.getItem('carrera')
|
||||
this.datosUsuario.idCarrera = localStorage.getItem('idCarrera')
|
||||
this.datosUsuario.token = {
|
||||
this.idCarrera = Number(localStorage.getItem('idCarrera'))
|
||||
this.token = {
|
||||
headers: {
|
||||
token: localStorage.getItem('token'),
|
||||
},
|
||||
@@ -263,7 +254,6 @@ export default {
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.areaPermitida()
|
||||
this.getLocalhostInfo()
|
||||
},
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
:imprimirError="imprimirError"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
:inscripcionesUsuario="inscripcionesUsuario"
|
||||
:idUsuario="idUsuario"
|
||||
@pedirInscripciones="pedirInscripciones"
|
||||
/>
|
||||
</div>
|
||||
@@ -38,7 +39,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
datosUsuario: {},
|
||||
idUsuario: '',
|
||||
inscripcionesUsuario: [],
|
||||
}
|
||||
},
|
||||
@@ -46,8 +47,8 @@ export default {
|
||||
async pedirInscripciones() {
|
||||
await axios
|
||||
.get(
|
||||
`${process.env.api}/usuario/inscripciones?idUsuario=${this.datosUsuario.idUsuario}`,
|
||||
this.datosUsuario.token
|
||||
`${process.env.api}/usuario/inscripciones?idUsuario=${this.idUsuario}`,
|
||||
this.token
|
||||
)
|
||||
.then((res) => {
|
||||
this.inscripcionesUsuario = res.data
|
||||
@@ -121,8 +122,8 @@ export default {
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.datosUsuario.idUsuario = Number(localStorage.getItem('idUsuario'))
|
||||
this.datosUsuario.token = {
|
||||
this.idUsuario = Number(localStorage.getItem('idUsuario'))
|
||||
this.token = {
|
||||
headers: { token: localStorage.getItem('token') },
|
||||
}
|
||||
this.pedirInscripciones()
|
||||
|
||||
Reference in New Issue
Block a user