tabla y restar credito
This commit is contained in:
@@ -18,8 +18,8 @@
|
||||
|
||||
<div class="column mr-2 box ml-5">
|
||||
<p class="subtitle is-3">Cuenta: {{ this.numeroCuenta }}</p>
|
||||
<p class="subtitle is-3">Nombre: {{}}</p>
|
||||
<p class="subtitle is-3">Crédito: {{}}</p>
|
||||
<p class="subtitle is-3">Nombre: {{ datos.nombre }}</p>
|
||||
<p class="subtitle is-3">Credito: {{ datos.credito }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -68,7 +68,10 @@ export default {
|
||||
.get(`${process.env.api}/usuario/restar_credito`, data)
|
||||
.then((res) => {
|
||||
this.updateIsLoading(false)
|
||||
console.log(res)
|
||||
;(this.datos.nombre = res.data.nombre),
|
||||
(this.datos.credito = res.data.credito)
|
||||
this.imprimirMensaje(res.data.message)
|
||||
this.traerDatos()
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="block columns">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<b-table
|
||||
class="box"
|
||||
:data="inscripciones"
|
||||
:striped="true"
|
||||
:hoverable="true"
|
||||
: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="ticket" label="Ticket" 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 y hora"
|
||||
centered
|
||||
v-slot="props"
|
||||
>{{ hora(props.row.fechaInscripcion) }}</b-table-column
|
||||
>
|
||||
|
||||
<b-table-column field="validar" label="Validar" centered v-slot="props">
|
||||
<b-button
|
||||
type="is-success"
|
||||
@click="
|
||||
usuario(
|
||||
props.row.Usuario.numeroCuenta,
|
||||
props.row.Usuario.idUsuario
|
||||
),
|
||||
imprimirWarning(
|
||||
'¿Estas seguro de querer validar esta inscripción ?',
|
||||
validarSinTicket
|
||||
)
|
||||
"
|
||||
>Validar</b-button
|
||||
>
|
||||
</b-table-column>
|
||||
</b-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import moment from 'moment'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
updateIsLoading: { type: Function, require: true },
|
||||
imprimirError: { type: Function, require: true },
|
||||
imprimirMensaje: { type: Function, require: true },
|
||||
imprimirWarning: { type: Function, require: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
token: '',
|
||||
|
||||
ticketsImpresion: [],
|
||||
isPaginated: true,
|
||||
currentPage: 1,
|
||||
perPage: 10,
|
||||
|
||||
numeroCuenta: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
tickets() {
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.get(
|
||||
`${process.env.api}/admin/tickets_impresion?numeroCuenta=${this.numeroCuenta}`,
|
||||
this.token
|
||||
)
|
||||
.then((res) => {
|
||||
this.updateIsLoading(false)
|
||||
this.ticketsImpresion = res.data
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.imprimirError(err.response.data)
|
||||
})
|
||||
},
|
||||
usuario(noCuenta, usuario) {
|
||||
this.data.numeroCuenta = noCuenta
|
||||
this.data.idUsuario = usuario
|
||||
},
|
||||
hora(value) {
|
||||
return moment(value).format('LLL')
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.token = {
|
||||
headers: { token: localStorage.getItem('token') },
|
||||
}
|
||||
this.tickets()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -31,13 +31,14 @@
|
||||
import TableTickets from '~/components/admin/tableTickets.vue'
|
||||
import Reporte from '~/components/admin/reporte.vue'
|
||||
import RestarCredito from '~/components/admin/restarCredito.vue'
|
||||
import RestarCredito from '~/components/admin/restarCredito.vue'
|
||||
import TableImpresiones from '~/components/admin/tableImpresiones.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
TableTickets,
|
||||
Reporte,
|
||||
RestarCredito,
|
||||
TableImpresiones,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user