344 lines
10 KiB
Vue
344 lines
10 KiB
Vue
<template>
|
|
<div class="container">
|
|
<div class="columns">
|
|
|
|
<div class="column is-3 mb-0 ">
|
|
<b-field >
|
|
<b-input
|
|
placeholder="No.Cuenta"
|
|
icon="school"
|
|
rounded
|
|
v-model="numeroCuenta"
|
|
maxlength="9"
|
|
|
|
></b-input>
|
|
</b-field>
|
|
</div>
|
|
|
|
<div class="column is-3 mb-4 pb-4">
|
|
<b-field>
|
|
<b-input
|
|
type="name"
|
|
placeholder="Nombre"
|
|
icon="account"
|
|
rounded
|
|
v-model="nombre"
|
|
></b-input>
|
|
</b-field>
|
|
</div>
|
|
|
|
<div class="column is-3" >
|
|
<b-field>
|
|
<b-select placeholder="Status" icon="information" value="1" expanded rounded v-model="status">
|
|
<optgroup label="Status">
|
|
<option value="1">Pre-registro</option>
|
|
<option value="2">Pre-validado</option>
|
|
<option value="3">Registro</option>
|
|
<option value="4">Pre-término</option>
|
|
<option value="5">Término</option>
|
|
<option value="6">Liberado</option>
|
|
<option value="7">Rechazado</option>
|
|
</optgroup>
|
|
</b-select>
|
|
</b-field>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
<BotonesCarga v-if="id == 1"/>
|
|
</div>
|
|
|
|
<p v-text="id"></p>
|
|
|
|
<div class="columns">
|
|
<section class="column is-12">
|
|
<b-table
|
|
:data="data"
|
|
ref="table"
|
|
paginated
|
|
per-page="5"
|
|
hoverable
|
|
striped
|
|
>
|
|
|
|
<b-table-column field="nombre" label="Nombre" v-slot="props" centered>
|
|
<span @click="verifica()">{{ props.row.nombre }}</span>
|
|
</b-table-column>
|
|
|
|
<b-table-column field="carrera" label="Carrera" v-slot="props" centered>
|
|
<span @click="cualquiera(props.row.carrera)">{{ props.row.carrera }}</span>
|
|
</b-table-column>
|
|
|
|
<b-table-column field="numeroCuenta" label="Número de Cuenta" v-slot="props" centered>
|
|
<span @click="cualquiera(props.row.numeroCuenta)">{{ props.row.numeroCuenta }}</span>
|
|
</b-table-column>
|
|
|
|
<b-table-column field="fechaInicio" label="Inicio" centered v-slot="props">
|
|
<span @click="cualquiera(props.row.fechaInicio)">{{ props.row.fechaInicio }}</span>
|
|
</b-table-column>
|
|
|
|
<b-table-column field="fechaFin" label="Final" centered v-slot="props">
|
|
<span @click="cualquiera(props.row.fechaFin)">{{ props.row.fechaFin }}</span>
|
|
</b-table-column>
|
|
|
|
<b-table-column field="status" label="Status" v-slot="props" centered>
|
|
<span @click="cualquiera(props.row.status)" class="tag" :class="types(props.row.status)">{{ props.row.status }}</span>
|
|
</b-table-column>
|
|
|
|
<b-table-column field="cartaTermino" label="Carta Término" v-slot="props" centered v-if="id == 2">
|
|
<div v-if="props.row.status === 'pre-termino'">
|
|
<span
|
|
v-if="props.row.cartaTermino === true"
|
|
>
|
|
<b-icon :icon="iconoCarta(props.row.cartaTermino)"
|
|
class="tag is-success"></b-icon>
|
|
</span>
|
|
|
|
<b-button
|
|
v-if="props.row.cartaTermino === false"
|
|
size="is-small"
|
|
:class="botonCarta(props.row.cartaTermino)"
|
|
:icon="iconoCarta(props.row.cartaTermino)">
|
|
Carta Término
|
|
</b-button>
|
|
</div>
|
|
</b-table-column>
|
|
|
|
<b-table-column field="cuestionario" label="Cuestionario" v-slot="props" centered v-if="id == 2">
|
|
<div
|
|
v-if="props.row.status === 'pre-termino'">
|
|
<span
|
|
v-if="props.row.cuestionario === true"
|
|
>
|
|
<b-icon :icon="iconoCuestionario(props.row.cuestionario)"
|
|
class="tag is-success"></b-icon>
|
|
</span>
|
|
|
|
<b-button
|
|
v-if="props.row.cuestionario === false"
|
|
size="is-small"
|
|
:class="botonCuestionario(props.row.cuestionario)"
|
|
:icon="iconoCuestionario(props.row.cuestionario)">
|
|
Cuestionario
|
|
</b-button>
|
|
</div>
|
|
</b-table-column>
|
|
</b-table>
|
|
</section>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
// import validator from 'validator'
|
|
import BotonesCarga from './botonesCarga.vue'
|
|
|
|
export default {
|
|
components: {
|
|
BotonesCarga
|
|
},
|
|
data () {
|
|
return {
|
|
numeroCuenta: '',
|
|
nombre: '',
|
|
status: 1,
|
|
tipoUsuario: 1,
|
|
data: [
|
|
{
|
|
idRegistro: 1, // span
|
|
nombre: 'Lemuel',
|
|
carrera: 'Matemáticas Aplicadas y Computación',
|
|
numeroCuenta: '41908550',
|
|
fechaInicio: '1/01/2020',
|
|
fechaFin: '1/06/2020',
|
|
status: 'pre-validado',
|
|
cartaTermino: true,
|
|
cuestionario: false,
|
|
idStatus: 1
|
|
},
|
|
{
|
|
idRegistro: 1, // span
|
|
nombre: 'Andrés Hernan Saavedra Trejo',
|
|
carrera: 'Matemáticas Aplicadas y Computación',
|
|
numeroCuenta: '42008550',
|
|
fechaInicio: '1/01/2020',
|
|
fechaFin: '1/06/2020',
|
|
status: 'pre-termino',
|
|
cartaTermino: true,
|
|
cuestionario: false,
|
|
idStatus: 1
|
|
},
|
|
{
|
|
idRegistro: 1, // span
|
|
nombre: 'Marco',
|
|
carrera: 'Matemáticas Aplicadas y Computación',
|
|
numeroCuenta: '41908550',
|
|
fechaInicio: '1/01/2020',
|
|
fechaFin: '1/06/2020',
|
|
status: 'pre-validado',
|
|
cartaTermino: true,
|
|
cuestionario: true,
|
|
idStatus: 1
|
|
},
|
|
{
|
|
idRegistro: 1, // span
|
|
nombre: 'Eithan',
|
|
carrera: 'Matemáticas Aplicadas y Computación',
|
|
numeroCuenta: '41908550',
|
|
fechaInicio: '1/01/2020',
|
|
fechaFin: '1/06/2020',
|
|
status: 'pre-termino',
|
|
cartaTermino: false,
|
|
cuestionario: true,
|
|
idStatus: 1
|
|
},
|
|
{
|
|
idRegistro: 1, // span
|
|
nombre: 'Brenda',
|
|
carrera: 'Matemáticas Aplicadas y Computación',
|
|
numeroCuenta: '41908550',
|
|
fechaInicio: '1/01/2020',
|
|
fechaFin: '1/06/2020',
|
|
status: 'registro',
|
|
cartaTermino: true,
|
|
cuestionario: false,
|
|
idStatus: 1
|
|
},
|
|
{
|
|
idRegistro: 1, // span
|
|
nombre: 'Lemuel',
|
|
carrera: 'Matemáticas Aplicadas y Computación',
|
|
numeroCuenta: '41908550',
|
|
fechaInicio: '1/01/2020',
|
|
fechaFin: '1/06/2020',
|
|
status: 'pre-termino',
|
|
cartaTermino: false,
|
|
cuestionario: false,
|
|
idStatus: 1
|
|
},
|
|
{
|
|
idRegistro: 1, // span
|
|
nombre: 'Lemuel',
|
|
carrera: 'Matemáticas Aplicadas y Computación',
|
|
numeroCuenta: '41908550',
|
|
fechaInicio: '1/01/2020',
|
|
fechaFin: '1/06/2020',
|
|
status: 'termino',
|
|
cartaTermino: true,
|
|
cuestionario: false,
|
|
idStatus: 1
|
|
},
|
|
{
|
|
idRegistro: 1, // span
|
|
nombre: 'Lemuel',
|
|
carrera: 'Matemáticas Aplicadas y Computación',
|
|
numeroCuenta: '41908550',
|
|
fechaInicio: '1/01/2020',
|
|
fechaFin: '1/06/2020',
|
|
status: 'liberado',
|
|
cartaTermino: false,
|
|
cuestionario: false,
|
|
idStatus: 1
|
|
},
|
|
{
|
|
idRegistro: 1, // span
|
|
nombre: 'Lemuel',
|
|
carrera: 'Matemáticas Aplicadas y Computación',
|
|
numeroCuenta: '41908550',
|
|
fechaInicio: '1/01/2020',
|
|
fechaFin: '1/06/2020',
|
|
status: 'rechazado',
|
|
cartaTermino: true,
|
|
cuestionario: false,
|
|
idStatus: 1
|
|
}
|
|
],
|
|
newSearch: {}
|
|
}
|
|
},
|
|
props: {
|
|
id: {
|
|
type: Number,
|
|
required: false
|
|
}
|
|
},
|
|
methods: {
|
|
onPageChange (page) {
|
|
this.page = page
|
|
this.loadAsyncData()
|
|
},
|
|
types (status) {
|
|
/* const Status = parseFloat(status) Investigar para que sirve :) */
|
|
if (status === 'pre-registro') {
|
|
return 'is-dark'
|
|
} else if (status === 'pre-validado') {
|
|
return 'is-warning'
|
|
} else if (status === 'registro') {
|
|
return 'is-info'
|
|
} else if (status === 'pre-termino') {
|
|
return 'is-link'
|
|
} else if (status === 'termino') {
|
|
return 'is-success'
|
|
} else if (status === 'liberado') {
|
|
return 'is-success'
|
|
} else if (status === 'rechazado') {
|
|
return 'is-danger'
|
|
}
|
|
},
|
|
botonCarta (cartaTermino) {
|
|
if (cartaTermino === true) {
|
|
return 'is-success'
|
|
} else {
|
|
return 'is-danger'
|
|
}
|
|
},
|
|
botonCuestionario (cuestionario) {
|
|
if (cuestionario === true) {
|
|
return 'is-success'
|
|
} else {
|
|
return 'is-danger'
|
|
}
|
|
},
|
|
iconoCarta (cartaTermino) {
|
|
if (cartaTermino === true) {
|
|
return 'check'
|
|
} else {
|
|
return 'close'
|
|
}
|
|
},
|
|
iconoCuestionario (cuestionario) {
|
|
if (cuestionario === true) {
|
|
return 'check'
|
|
} else {
|
|
return 'close'
|
|
}
|
|
},
|
|
cualquiera (variable) {
|
|
console.log(variable)
|
|
console.log(this.numeroCuenta)
|
|
console.log(this.nombre)
|
|
console.log(this.status)
|
|
console.log(this.id)
|
|
},
|
|
addSearch (e) {
|
|
e.preventDefault()
|
|
console.log('Agregando busqueda')
|
|
}/*
|
|
esNumero (numero) {
|
|
const ultimaLetra = numero.length - 1
|
|
|
|
if (numero && !validator.isNumeric(numero[ultimaLetra])) { return numero.substr(0, ultimaLetra) }
|
|
return numero
|
|
}/*
|
|
maxLength (str, max) {
|
|
if (str.lenght > max) { return str.substr(0, max) }
|
|
return str
|
|
} */
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
</style>
|