Files
inscripciones_front/components/admin/tableTickets.vue
T

130 lines
3.2 KiB
Vue
Raw Normal View History

2022-01-20 00:23:03 -06:00
<template>
<div>
2022-02-16 00:09:49 -06:00
<div class="block columns">
<b-field class="column" label="Status del ticket">
<b-radio v-model="validacion" native-value="1"
><b-tag type="is-success" size="is-medium">Validados</b-tag></b-radio
>
<b-radio v-model="validacion" native-value="0">
<b-tag type="is-danger" size="is-medium">Declinados</b-tag></b-radio
>
<b-radio v-model="validacion" native-value="2">
<b-tag size="is-medium">Sin validar</b-tag></b-radio
>
</b-field>
<b-field class="column" label="Número de cuenta">
<b-input v-model="numeroCuenta" expanded></b-input>
<p class="control">
<b-button @click="todasInscripciones" type="is-link">Buscar</b-button>
</p>
</b-field>
2022-02-10 00:45:16 -06:00
</div>
<b-table
class="box"
:data="inscripciones"
2022-02-10 00:45:16 -06:00
:striped="true"
:hoverable="true"
:paginated="isPaginated"
:per-page="perPage"
:current-page.sync="currentPage"
>
2022-02-01 23:43:44 -06:00
<b-table-column
field="numeroCuenta"
label="Número de cuenta"
centered
v-slot="props"
>
{{ props.row.Usuario.numeroCuenta }}
2022-01-20 00:23:03 -06:00
</b-table-column>
2022-02-01 23:43:44 -06:00
<b-table-column field="folio" label="Folio" centered v-slot="props"
>{{ props.row.folio }}
</b-table-column>
2022-01-20 17:42:55 -06:00
2022-02-01 23:43:44 -06:00
<b-table-column field="cantidad" label="Cantidad" centered v-slot="props">
{{ props.row.monto }}
2022-01-20 17:42:55 -06:00
</b-table-column>
2022-02-10 00:45:16 -06:00
<b-table-column
2022-02-16 10:57:01 -06:00
field="confirmacion"
label="Confirmación"
2022-02-10 00:45:16 -06:00
centered
v-slot="props"
>
2022-02-16 10:57:01 -06:00
<b-tag :type="types(props.row.confirmacion)">
{{ props.row.confirmacion }}
2022-02-10 00:45:16 -06:00
</b-tag>
</b-table-column>
<b-table-column field="cantidad" label="Cantidad" centered v-slot="props">
{{ props.row.monto }}
2022-02-01 23:43:44 -06:00
</b-table-column>
2022-01-20 17:42:55 -06:00
2022-02-03 23:10:35 -06:00
<b-table-column field="ticket" label="Ticket" centered v-slot="props">
<b-button type="is-info" @click="verTicket(props.row)"
>Ver ticket</b-button
>
2022-01-20 00:23:03 -06:00
</b-table-column>
</b-table>
</div>
</template>
2022-01-20 00:24:35 -06:00
2022-02-01 23:43:44 -06:00
<script>
import axios from 'axios'
export default {
data() {
return {
inscripciones: [],
isPaginated: true,
currentPage: 1,
perPage: 5,
2022-02-10 00:45:16 -06:00
2022-02-16 00:09:49 -06:00
validacion: '2',
numeroCuenta: '',
2022-02-01 23:43:44 -06:00
}
},
methods: {
2022-02-10 00:45:16 -06:00
types(value) {
2022-02-16 10:57:01 -06:00
return value === true ? 'is-success' : 'is-danger'
2022-02-10 00:45:16 -06:00
},
2022-02-16 00:09:49 -06:00
todasInscripciones() {
2022-02-01 23:43:44 -06:00
axios
2022-02-10 00:45:16 -06:00
.get(
2022-02-16 00:09:49 -06:00
`${process.env.api}/admin/todas_inscripciones?validacion=${this.validacion}&numeroCuenta=${this.numeroCuenta}`
2022-02-10 00:45:16 -06:00
)
2022-02-01 23:43:44 -06:00
.then((res) => {
this.inscripciones = res.data
})
.catch((err) => {
console.log(err)
// this.imprimirError(err.response.data)
})
},
2022-02-03 23:10:35 -06:00
verTicket(value) {
console.log(value)
this.$router.push({
path: '/admin/ticket/',
2022-02-04 01:07:58 -06:00
query: {
folio: value.folio,
monto: value.monto,
fecha: value.fechaTicket,
},
2022-02-03 23:10:35 -06:00
})
},
2022-02-01 23:43:44 -06:00
},
2022-02-10 00:45:16 -06:00
watch: {
2022-02-16 00:09:49 -06:00
validacion() {
this.todasInscripciones()
2022-02-10 00:45:16 -06:00
},
},
2022-02-01 23:43:44 -06:00
created() {
2022-02-16 00:09:49 -06:00
this.todasInscripciones()
2022-02-01 23:43:44 -06:00
},
}
</script>
2022-01-20 00:24:35 -06:00
<style scoped></style>