Validacion del ticket
This commit is contained in:
@@ -57,7 +57,11 @@ export default {
|
||||
console.log(value)
|
||||
this.$router.push({
|
||||
path: '/admin/ticket/',
|
||||
query: { folio: value.folio },
|
||||
query: {
|
||||
folio: value.folio,
|
||||
monto: value.monto,
|
||||
fecha: value.fechaTicket,
|
||||
},
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,10 +1,49 @@
|
||||
<template>
|
||||
<div class="columns">
|
||||
<b-image
|
||||
class="img column is-half is-offset-one-quarter py-5"
|
||||
:src="this.urlTicket"
|
||||
alt="Imagen del ticekt"
|
||||
></b-image>
|
||||
<div class="column py-5">
|
||||
<b-image
|
||||
class="img"
|
||||
:src="this.urlTicket"
|
||||
alt="Imagen del ticekt"
|
||||
></b-image>
|
||||
</div>
|
||||
<div class="column mt-6">
|
||||
<p>
|
||||
Administrador por favor revisa que todos los datos sean correctos, en
|
||||
caso de ser así valida el ticket
|
||||
</p>
|
||||
|
||||
<div class="box">
|
||||
<p><b>Folio:</b> {{ $route.query.folio }}</p>
|
||||
<p><b>Cantidad: </b> {{ $route.query.monto }}</p>
|
||||
<p><b>Fecha del ticket:</b> {{ $route.query.fecha }}</p>
|
||||
</div>
|
||||
<div class="has-text-centered pb-5">
|
||||
<b-button
|
||||
type="is-success"
|
||||
@click="
|
||||
validacion(true),
|
||||
imprimirWarning(
|
||||
'¿ Estas seguro que los datos son correctos y quieres validar este ticekt ?',
|
||||
validar
|
||||
)
|
||||
"
|
||||
>Validar</b-button
|
||||
>
|
||||
<b-button
|
||||
type="is-danger"
|
||||
@click="
|
||||
validacion(false),
|
||||
imprimirWarning(
|
||||
'¿ Estas seguro que los datos son incorrectos y quieres declinar el ticket ?',
|
||||
validar
|
||||
)
|
||||
"
|
||||
>Denegar</b-button
|
||||
>
|
||||
<b-button type="is-info" @click="regresar()">Regresar</b-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -12,9 +51,16 @@
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
imprimirMensaje: { type: Function, require: true },
|
||||
imprimirError: { type: Function, require: true },
|
||||
imprimirWarning: { type: Function, required: true },
|
||||
updateIsLoading: { type: Function, require: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
urlTicket: '',
|
||||
validado: null,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -22,15 +68,39 @@ export default {
|
||||
axios
|
||||
.get(`${process.env.api}/admin/ticket?folio=${this.$route.query.folio}`)
|
||||
.then((res) => {
|
||||
console.log(res.config.url)
|
||||
this.urlTicket = res.config.url
|
||||
console.log(res)
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err)
|
||||
// this.imprimirError(err.response.data)
|
||||
})
|
||||
},
|
||||
validacion(value) {
|
||||
this.validado = value
|
||||
},
|
||||
validar() {
|
||||
const data = {
|
||||
folio: this.$route.query.folio,
|
||||
validacion: this.validado,
|
||||
}
|
||||
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.put(`${process.env.api}/admin/validar`, data)
|
||||
.then((res) => {
|
||||
this.updateIsLoading(false)
|
||||
this.imprimirMensaje(res.data.message)
|
||||
// this.$router.go(-1)
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err)
|
||||
this.updateIsLoading(false)
|
||||
this.imprimirError(err.response.data)
|
||||
})
|
||||
},
|
||||
regresar() {
|
||||
this.$router.go(-1)
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.traerTicket()
|
||||
@@ -39,7 +109,8 @@ export default {
|
||||
</script>
|
||||
<style scoped>
|
||||
.img {
|
||||
height: 400px;
|
||||
width: 400px;
|
||||
height: 350px;
|
||||
width: 350px;
|
||||
padding-bottom: 470px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user