Files
inscripciones_front/components/admin/tableTickets.vue
T
2022-02-09 23:07:51 -06:00

85 lines
1.9 KiB
Vue

<template>
<div>
<b-table
class="box"
:data="inscripciones"
:paginated="isPaginated"
:per-page="perPage"
:current-page.sync="currentPage"
>
<b-table-column
field="numeroCuenta"
label="Número de cuenta"
centered
v-slot="props"
>
{{ props.row.Usuario.numeroCuenta }}
</b-table-column>
<b-table-column field="folio" label="Folio" centered v-slot="props"
>{{ props.row.folio }}
</b-table-column>
<b-table-column field="cantidad" label="Cantidad" centered v-slot="props">
{{ props.row.monto }}
</b-table-column>
<b-table-column field="fecha" label="Fecha" centered v-slot="props">
{{ props.row.fechaInscripcion }}
</b-table-column>
<b-table-column field="ticket" label="Ticket" centered v-slot="props">
<b-button type="is-info" @click="verTicket(props.row)"
>Ver ticket</b-button
>
</b-table-column>
</b-table>
</div>
</template>
<script>
import axios from 'axios'
export default {
data() {
return {
inscripciones: [],
isPaginated: true,
currentPage: 1,
perPage: 5,
}
},
methods: {
todasInscripciones(perPage) {
console.log(this.currentPage)
axios
.get(`${process.env.api}/admin/todas_inscripciones`)
.then((res) => {
this.inscripciones = res.data
console.log(res.data)
})
.catch((err) => {
console.log(err)
// this.imprimirError(err.response.data)
})
},
verTicket(value) {
console.log(value)
this.$router.push({
path: '/admin/ticket/',
query: {
folio: value.folio,
monto: value.monto,
fecha: value.fechaTicket,
},
})
},
},
created() {
this.todasInscripciones(this.currentPage)
},
}
</script>
<style scoped></style>