produccion
This commit is contained in:
@@ -0,0 +1,148 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<p class="pb-2"><b>Número de cuenta: </b> {{ numeroCuenta }}</p>
|
||||
|
||||
<b-field label="Ticket" horizontal grouped>
|
||||
<b-input v-model="folioA" :disabled="switchFolio" maxlength="6"></b-input>
|
||||
<p class="control">
|
||||
<b-button
|
||||
type="is-primary"
|
||||
icon-left="pencil"
|
||||
@click="habilitar('folio')"
|
||||
>
|
||||
</b-button>
|
||||
</p>
|
||||
</b-field>
|
||||
|
||||
<b-field label="Cantidad" horizontal>
|
||||
<b-input v-model="montoA" :disabled="switchMonto" maxlength="5"></b-input>
|
||||
<p class="control">
|
||||
<b-button
|
||||
type="is-primary"
|
||||
icon-left="pencil"
|
||||
@click="habilitar('monto')"
|
||||
>
|
||||
</b-button>
|
||||
</p>
|
||||
</b-field>
|
||||
|
||||
<b-field label="Fecha del ticket" horizontal>
|
||||
<b-datepicker
|
||||
v-model="fechaTicketA"
|
||||
:disabled="switchFecha"
|
||||
:max-date="maxDate"
|
||||
icon="calendar-today"
|
||||
>
|
||||
</b-datepicker>
|
||||
<p class="control">
|
||||
<b-button
|
||||
type="is-primary"
|
||||
icon-left="pencil"
|
||||
@click="habilitar('fecha')"
|
||||
>
|
||||
</b-button>
|
||||
</p>
|
||||
</b-field>
|
||||
|
||||
<div class="has-text-centered pb-2">
|
||||
<b-button
|
||||
type="is-success"
|
||||
@click="
|
||||
imprimirWarning(
|
||||
'¿Estas seguro de querer actualizar esta información?',
|
||||
actualizarTicket
|
||||
)
|
||||
"
|
||||
>Actualizar datos</b-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
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 },
|
||||
folio: { type: String, require: true },
|
||||
monto: { type: String, require: true },
|
||||
token: { type: Object, require: true },
|
||||
fechaTicket: { type: Date, require: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
numeroCuenta: localStorage.getItem('noCuenta'),
|
||||
|
||||
switchFolio: true,
|
||||
switchMonto: true,
|
||||
switchFecha: true,
|
||||
|
||||
folioA: '',
|
||||
montoA: '',
|
||||
fechaTicketA: null,
|
||||
maxDate: new Date(),
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
habilitar(tipo) {
|
||||
tipo == 'folio' && this.switchFolio == true
|
||||
? (this.switchFolio = false)
|
||||
: (this.switchFolio = true)
|
||||
|
||||
tipo == 'monto' && this.switchMonto == true
|
||||
? (this.switchMonto = false)
|
||||
: (this.switchMonto = true)
|
||||
|
||||
tipo == 'fecha' && this.switchFecha == true
|
||||
? (this.switchFecha = false)
|
||||
: (this.switchFecha = true)
|
||||
},
|
||||
actualizarTicket() {
|
||||
const data = {
|
||||
idInscripcion: Number(localStorage.getItem('inscripcion')),
|
||||
folio: this.folioA,
|
||||
monto: this.montoA,
|
||||
fechaTicket: this.fechaTicketA,
|
||||
}
|
||||
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.put(`${process.env.api}/admin/actualizar_ticket`, data, this.token)
|
||||
.then((res) => {
|
||||
this.updateIsLoading(false)
|
||||
this.imprimirMensaje(res.data.message)
|
||||
this.bloquearBotones()
|
||||
localStorage.setItem('monto', this.montoA)
|
||||
localStorage.setItem('folio', this.folioA)
|
||||
localStorage.setItem('fechaTicket', this.fechaTicketA)
|
||||
this.$emit('actualizarFolio')
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.imprimirError(err.response.data)
|
||||
})
|
||||
},
|
||||
bloquearBotones() {
|
||||
this.switchFolio = true
|
||||
this.switchMonto = true
|
||||
this.switchFecha = true
|
||||
},
|
||||
diaMin(today) {
|
||||
return new Date(
|
||||
today.getFullYear(),
|
||||
today.getMonth(),
|
||||
today.getDate() - today.getDate() + 1
|
||||
)
|
||||
},
|
||||
},
|
||||
created() {
|
||||
;(this.folioA = this.folio),
|
||||
(this.montoA = this.monto),
|
||||
(this.fechaTicketA = this.fechaTicket)
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<div class="block pt-5" v-if="motivo">
|
||||
<div class="has-text-centered pb-4">
|
||||
<b-tag type="is-danger" size="is-medium">Ticket declinado</b-tag>
|
||||
</div>
|
||||
<p class="box"><b>Motivo: </b>{{ motivo }}</p>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
folio: { type: String, require: true },
|
||||
token: { type: Object, require: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
motivo: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
traerMotivo() {
|
||||
axios
|
||||
.get(`${process.env.api}/admin/motivo?folio=${this.folio}`, this.token)
|
||||
.then((res) => {
|
||||
this.motivo = res.data.motivo
|
||||
})
|
||||
.catch((err) => {})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.traerMotivo()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,73 @@
|
||||
<template>
|
||||
<form class="modal-card">
|
||||
<header class="modal-card-head">
|
||||
<h5 class="modal-card-title">
|
||||
¿Estás seguro de querer declinar este ticket?
|
||||
</h5>
|
||||
</header>
|
||||
|
||||
<section class="modal-card-body">
|
||||
<b-field label="Motivo por el cual vas a declinar el ticket">
|
||||
<b-input type="textarea" maxlength="100" v-model="motivo" expanded />
|
||||
</b-field>
|
||||
</section>
|
||||
|
||||
<footer
|
||||
class="modal-card-foot"
|
||||
style="display: flex; justify-content: space-between"
|
||||
>
|
||||
<b-button type="is-danger" @click="$emit('close')"> Cancelar </b-button>
|
||||
|
||||
<b-button
|
||||
type="is-success"
|
||||
@click="multaPrestamo(), $emit('close')"
|
||||
:disabled="!motivo"
|
||||
>
|
||||
Enviar
|
||||
</b-button>
|
||||
</footer>
|
||||
</form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
token: { type: Object, require: true },
|
||||
folio: { type: String, require: true },
|
||||
imprimirError: { type: Function, required: true },
|
||||
imprimirMensaje: { type: Function, required: true },
|
||||
updateIsLoading: { type: Function, require: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
motivo: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
multaPrestamo() {
|
||||
const data = {
|
||||
folio: this.folio,
|
||||
validacion: 0,
|
||||
motivo: this.motivo,
|
||||
}
|
||||
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.put(`${process.env.api}/admin/validar`, data, this.token)
|
||||
.then((res) => {
|
||||
this.updateIsLoading(false)
|
||||
this.imprimirMensaje(res.data.message)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.imprimirError(err.response.data)
|
||||
})
|
||||
.finally(() => {
|
||||
this.$router.go(-1)
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -37,7 +37,6 @@ import fileDownload from 'js-file-download'
|
||||
export default {
|
||||
props: {
|
||||
updateIsLoading: { type: Function, require: true },
|
||||
tipo: { type: String, require: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -57,11 +56,11 @@ export default {
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.get(
|
||||
`${process.env.api}/admin/reporte?inicio=${this.inicio}&fin=${this.fin}&tipo=${this.tipo}`,
|
||||
`${process.env.api}/admin/reporte?inicio=${this.inicio}&fin=${this.fin}`,
|
||||
this.token
|
||||
)
|
||||
.then((res) => {
|
||||
fileDownload(res.data, `reporte.csv`)
|
||||
fileDownload(res.data, `inscripcionesCEDETEC.csv`)
|
||||
this.updateIsLoading(false)
|
||||
})
|
||||
.catch((err) => {
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
{{ props.row.Usuario.numeroCuenta }}
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column field="folio" label="Folio" centered v-slot="props"
|
||||
<b-table-column field="ticket" label="Ticket" centered v-slot="props"
|
||||
>{{ props.row.folio }}
|
||||
</b-table-column>
|
||||
|
||||
@@ -47,14 +47,12 @@
|
||||
{{ props.row.monto }}
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column field="ticket" label="Ticket" centered v-slot="props">
|
||||
<b-button
|
||||
type="is-info"
|
||||
v-if="props.row.folio"
|
||||
@click="verTicket(props.row)"
|
||||
>Ver ticket</b-button
|
||||
>
|
||||
|
||||
<b-table-column
|
||||
field="inscripcion"
|
||||
label="Inscripción"
|
||||
centered
|
||||
v-slot="props"
|
||||
>
|
||||
<b-button
|
||||
type="is-success"
|
||||
v-if="!props.row.folio && !props.row.monto && !props.row.fechaTicket"
|
||||
@@ -71,6 +69,29 @@
|
||||
>Validar</b-button
|
||||
>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column centered v-slot="props">
|
||||
<b-button
|
||||
type="is-danger"
|
||||
@click="
|
||||
inscripcion(props.row.idInscripcion),
|
||||
imprimirWarning(
|
||||
'¿Estas seguro de querer cancelar esta inscripción ?',
|
||||
cancelarInscripcion
|
||||
)
|
||||
"
|
||||
>Cancelar</b-button
|
||||
>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column centered v-slot="props">
|
||||
<b-button
|
||||
type="is-info"
|
||||
v-if="props.row.folio"
|
||||
@click="verTicket(props.row)"
|
||||
>Ver ticket</b-button
|
||||
>
|
||||
</b-table-column>
|
||||
</b-table>
|
||||
</div>
|
||||
</template>
|
||||
@@ -92,6 +113,7 @@ export default {
|
||||
perPage: 5,
|
||||
|
||||
data: {},
|
||||
dataIns: {},
|
||||
validacion: '2',
|
||||
numeroCuenta: '',
|
||||
}
|
||||
@@ -113,15 +135,16 @@ export default {
|
||||
})
|
||||
},
|
||||
verTicket(value) {
|
||||
this.$router.push({
|
||||
path: '/admin/ticket/',
|
||||
query: {
|
||||
folio: value.folio,
|
||||
monto: value.monto,
|
||||
fecha: value.fechaTicket,
|
||||
},
|
||||
})
|
||||
this.$router.push('/admin/ticket')
|
||||
localStorage.setItem('monto', value.monto)
|
||||
localStorage.setItem('folio', value.folio)
|
||||
localStorage.setItem('fechaTicket', value.fechaTicket)
|
||||
localStorage.setItem('noCuenta', value.Usuario.numeroCuenta)
|
||||
localStorage.setItem('inscripcion', value.idInscripcion)
|
||||
},
|
||||
usuario(noCuenta, usuario) {
|
||||
this.data.numeroCuenta = noCuenta
|
||||
this.data.idUsuario = usuario
|
||||
},
|
||||
validarSinTicket() {
|
||||
this.updateIsLoading(true)
|
||||
@@ -140,11 +163,27 @@ export default {
|
||||
this.updateIsLoading(false)
|
||||
})
|
||||
},
|
||||
usuario(noCuenta, usuario) {
|
||||
this.data.numeroCuenta = noCuenta
|
||||
this.data.idUsuario = usuario
|
||||
inscripcion(inscripcion) {
|
||||
this.dataIns.idInscripcion = inscripcion
|
||||
},
|
||||
cancelarInscripcion() {
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.put(
|
||||
`${process.env.api}/admin/cancelar_inscripcion`,
|
||||
this.dataIns,
|
||||
this.token
|
||||
)
|
||||
.then((res) => {
|
||||
this.imprimirMensaje(res.data.message)
|
||||
this.updateIsLoading(false)
|
||||
this.todasInscripciones()
|
||||
})
|
||||
.catch((err) => {
|
||||
this.imprimirError(err.response.data)
|
||||
this.updateIsLoading(false)
|
||||
})
|
||||
},
|
||||
|
||||
imprimirError(err = {}, title = '¡Hubo un error!', onConfirm = () => {}) {
|
||||
this.$buefy.dialog.alert({
|
||||
ariaRole: 'alertdialog',
|
||||
|
||||
+61
-43
@@ -3,8 +3,6 @@
|
||||
<div class="column is-one-third py-5">
|
||||
<figure class="containerImg">
|
||||
<b-image class="zoom" :src="urlTicket" alt="Imagen del ticket">
|
||||
<b-loading :is-full-page="isFullPage" v-model="isLoading">
|
||||
</b-loading>
|
||||
</b-image>
|
||||
</figure>
|
||||
</div>
|
||||
@@ -14,42 +12,36 @@
|
||||
<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>
|
||||
<p>
|
||||
Recuerda que al validar el ticket también se confirma la inscripción del
|
||||
alumno.
|
||||
caso de ser así valida el ticket y la inscripción.
|
||||
</p>
|
||||
|
||||
<div class="box">
|
||||
<p><b>Número de cuenta</b> {{ numeroCuenta }}</p>
|
||||
<p><b>Folio:</b> {{ $route.query.folio }}</p>
|
||||
<p><b>Cantidad: </b> {{ $route.query.monto }}</p>
|
||||
<p><b>Fecha del ticket:</b> {{ fecha($route.query.fecha) }}</p>
|
||||
</div>
|
||||
<IsCancelacion :folio="folio" :token="token" />
|
||||
|
||||
<DatosTicket
|
||||
:imprimirMensaje="imprimirMensaje"
|
||||
:imprimirError="imprimirError"
|
||||
:imprimirWarning="imprimirWarning"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
:folio="folio"
|
||||
:monto="monto"
|
||||
:fechaTicket="fechaTicket"
|
||||
:token="token"
|
||||
@actualizarFolio="actualizarFolio"
|
||||
/>
|
||||
|
||||
<div class="has-text-centered pb-5">
|
||||
<b-button
|
||||
type="is-success"
|
||||
@click="
|
||||
validacion(1),
|
||||
imprimirWarning(
|
||||
'¿ Estas seguro que los datos son correctos y quieres validar este ticket ?',
|
||||
validar
|
||||
)
|
||||
imprimirWarning(
|
||||
'¿ Estas seguro que los datos son correctos y quieres validar este ticket ?',
|
||||
validar
|
||||
)
|
||||
"
|
||||
>Validar</b-button
|
||||
>
|
||||
<b-button
|
||||
type="is-danger"
|
||||
@click="
|
||||
validacion(0),
|
||||
imprimirWarning(
|
||||
'¿ Estas seguro que los datos son incorrectos y quieres declinar el ticket ?',
|
||||
validar
|
||||
)
|
||||
"
|
||||
>Denegar</b-button
|
||||
>
|
||||
<b-button label="Declinar" type="is-danger" @click="declinarTicket()" />
|
||||
|
||||
<b-button type="is-info" @click="regresar()">Regresar</b-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -58,9 +50,16 @@
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import moment from 'moment'
|
||||
import DatosTicket from './datosTicket.vue'
|
||||
import ModalCancelar from './modalCancelar.vue'
|
||||
import IsCancelacion from './isCancelacion.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
DatosTicket,
|
||||
ModalCancelar,
|
||||
IsCancelacion,
|
||||
},
|
||||
props: {
|
||||
imprimirMensaje: { type: Function, require: true },
|
||||
imprimirError: { type: Function, require: true },
|
||||
@@ -71,10 +70,13 @@ export default {
|
||||
return {
|
||||
token: '',
|
||||
|
||||
isImageModalActive: false,
|
||||
isLoading: true,
|
||||
fechaTicket: new Date(localStorage.getItem('fechaTicket')),
|
||||
folio: localStorage.getItem('folio'),
|
||||
monto: localStorage.getItem('monto'),
|
||||
|
||||
isFullPage: true,
|
||||
urlTicket: '',
|
||||
|
||||
validado: null,
|
||||
|
||||
numeroCuenta: localStorage.getItem('noCuenta'),
|
||||
@@ -82,24 +84,22 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
traerTicket() {
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.get(`${process.env.api}/admin/ticket?folio=${this.$route.query.folio}`)
|
||||
.get(`${process.env.api}/admin/ticket?folio=${this.folio}`)
|
||||
.then((res) => {
|
||||
this.isLoading = false
|
||||
this.updateIsLoading(false)
|
||||
this.urlTicket = res.config.url
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoading = false
|
||||
this.updateIsLoading(false)
|
||||
this.imprimirError(err.response.data)
|
||||
})
|
||||
},
|
||||
validacion(value) {
|
||||
this.validado = value
|
||||
},
|
||||
validar() {
|
||||
const data = {
|
||||
folio: this.$route.query.folio,
|
||||
validacion: this.validado,
|
||||
folio: this.folio,
|
||||
validacion: 1,
|
||||
}
|
||||
|
||||
this.updateIsLoading(true)
|
||||
@@ -117,11 +117,29 @@ export default {
|
||||
this.$router.go(-1)
|
||||
})
|
||||
},
|
||||
fecha(fecha) {
|
||||
return moment(fecha).format('L')
|
||||
declinarTicket() {
|
||||
const modalProps = {
|
||||
token: this.token,
|
||||
folio: this.folio,
|
||||
imprimirError: this.imprimirError,
|
||||
imprimirMensaje: this.imprimirMensaje,
|
||||
updateIsLoading: this.updateIsLoading,
|
||||
}
|
||||
|
||||
this.$buefy.modal.open({
|
||||
props: modalProps,
|
||||
parent: this,
|
||||
component: ModalCancelar,
|
||||
hasModalCard: true,
|
||||
customClass: 'custom-class custom-class-2',
|
||||
trapFocus: true,
|
||||
})
|
||||
},
|
||||
actualizarFolio() {
|
||||
this.folio = localStorage.getItem('folio')
|
||||
},
|
||||
regresar() {
|
||||
this.$router.go(-1)
|
||||
this.$router.push('/admin')
|
||||
},
|
||||
},
|
||||
created() {
|
||||
|
||||
Reference in New Issue
Block a user