Merge branch 'dev' of https://repositorio.acatlan.unam.mx/CIDWA/servicio_social_front into marco
This commit is contained in:
@@ -0,0 +1,252 @@
|
||||
<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 mb-4 pb-4 " >
|
||||
<b-field>
|
||||
<b-select placeholder="Status" icon="information" expanded rounded v-model="idStatus">
|
||||
<optgroup label="Status">
|
||||
<option value=1>Pre-registro</option>
|
||||
<option value=2>Registro</option>
|
||||
<option value=3>Registro Validado</option>
|
||||
<option value=4>Pre-Término</option>
|
||||
<option value=5>Término</option>
|
||||
<option value=6>Liberación</option>
|
||||
<option value=7>Carta Aceptacion Rechazada</option>
|
||||
<option value=8>Carta Termino Rechazada</option>
|
||||
<option value=9>Informe Global Rechazado</option>
|
||||
<option value=10>Cancelado</option>
|
||||
</optgroup>
|
||||
</b-select>
|
||||
</b-field>
|
||||
</div>
|
||||
|
||||
<div class="buttons section pt-3 pl-5">
|
||||
<b-button type="is-info" @click="obtenerDatos()">
|
||||
Buscar
|
||||
</b-button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="buttons section pt-0 pl-0">
|
||||
<b-button type="is-info">
|
||||
Ver programas
|
||||
</b-button>
|
||||
</div>
|
||||
|
||||
<div class="columns">
|
||||
<section class="column is-12">
|
||||
<b-table
|
||||
:data="data"
|
||||
:loading="loading"
|
||||
|
||||
hoverable
|
||||
striped
|
||||
paginated
|
||||
backend-pagination
|
||||
:total="total"
|
||||
:per-page="perPage"
|
||||
@page-change="onPageChange"
|
||||
>
|
||||
<b-table-column field="nombre" label="Nombre" v-slot="props" centered>
|
||||
<span @click="servicios(props.row.idServicio)">{{ props.row.nombre}}</span>
|
||||
</b-table-column>
|
||||
<b-table-column field="numeroCuenta" label="Número de Cuenta" v-slot="props" centered width="100">
|
||||
<span @click="servicios(props.row.idServicio)">{{ props.row.numeroCuenta}}</span>
|
||||
</b-table-column>
|
||||
<b-table-column field="carrera" label="Carrera" v-slot="props" centered>
|
||||
<span @click="servicios(props.row.idServicio)">{{ props.row.carrera}}</span>
|
||||
</b-table-column>
|
||||
<b-table-column field="fechaInicio" truncate=10 label="Fecha Inicio" v-slot="props" centered>
|
||||
<span @click="servicios(props.row.idServicio)">{{ fecha(props.row.fechaInicio) }}</span>
|
||||
</b-table-column>
|
||||
<b-table-column field="fechaFin" label="Fecha Fin" v-slot="props" centered>
|
||||
<span @click="servicios(props.row.idServicio)">{{ fecha(props.row.fechaFin) }}</span>
|
||||
</b-table-column>
|
||||
<b-table-column field="status" label="Status" v-slot="props" centered>
|
||||
<span @click="servicios(props.row.idServicio)" class="tag" :class="types(props.row.idStatus)">{{ props.row.status}}</span>
|
||||
</b-table-column>
|
||||
</b-table>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import moment from 'moment'
|
||||
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
idUsuario: '',
|
||||
data: [],
|
||||
total: '',
|
||||
loading: true,
|
||||
page: 1,
|
||||
perPage: 25,
|
||||
numeroCuenta: '',
|
||||
nombre: '',
|
||||
idStatus: 1
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
onPageChange (page) {
|
||||
this.page = page
|
||||
this.obtenerDatos()
|
||||
console.log(this.page)
|
||||
},
|
||||
types (idStatus) {
|
||||
if (idStatus === 1) {
|
||||
return 'is-dark'
|
||||
} else if (idStatus === 2) {
|
||||
return 'is-info'
|
||||
} else if (idStatus === 3) {
|
||||
return 'is-link'
|
||||
} else if (idStatus === 4) {
|
||||
return 'is-warning'
|
||||
} else if (idStatus === 5) {
|
||||
return 'is-success'
|
||||
} else if (idStatus === 6) {
|
||||
return 'is-link'
|
||||
} else if (idStatus === 7) {
|
||||
return 'is-danger'
|
||||
} else if (idStatus === 8) {
|
||||
return 'is-danger'
|
||||
} else if (idStatus === 9) {
|
||||
return 'is-danger'
|
||||
} else if (idStatus === 10) { // admin
|
||||
return 'is-danger'
|
||||
}
|
||||
},
|
||||
botonCarta (cartaTermino) {
|
||||
if (cartaTermino === 1) {
|
||||
return 'is-success'
|
||||
} else {
|
||||
return 'is-danger'
|
||||
}
|
||||
},
|
||||
botonCuestionario (cuestionario) {
|
||||
if (cuestionario === 1) {
|
||||
return 'is-success'
|
||||
} else {
|
||||
return 'is-danger'
|
||||
}
|
||||
},
|
||||
iconoCarta (cartaTermino) {
|
||||
if (cartaTermino === 1) {
|
||||
return 'check'
|
||||
} else {
|
||||
return 'close'
|
||||
}
|
||||
},
|
||||
iconoCuestionario (cuestionario) {
|
||||
if (cuestionario === 1) {
|
||||
return 'check'
|
||||
} else {
|
||||
return 'close'
|
||||
}
|
||||
},
|
||||
fecha (date) {
|
||||
const fecha = moment(date.substr(0, 10))
|
||||
return `${fecha.date()}/${fecha.month() + 1}/${fecha.year()}`
|
||||
},
|
||||
obtenerDatos () {
|
||||
this.loading = true
|
||||
this.data = []
|
||||
|
||||
axios.get(`${process.env.api}/servicio/servicios_admin?pagina=${this.page}&idStatus=${this.idStatus}&nombre=${this.nombre}&numeroCuenta=${this.numeroCuenta}`)
|
||||
.then(res => {
|
||||
const servicios = res.data.servicios
|
||||
|
||||
if (servicios.length !== 0) {
|
||||
for (let i = 0; i < servicios.length; i++) {
|
||||
this.data.push({
|
||||
nombre: servicios[i].Usuario.nombre,
|
||||
numeroCuenta: servicios[i].Usuario.usuario,
|
||||
carrera: servicios[i].Carrera.carrera,
|
||||
fechaInicio: servicios[i].fechaInicio,
|
||||
fechaFin: servicios[i].fechaFin,
|
||||
status: servicios[i].Status.status,
|
||||
idStatus: servicios[i].Status.idStatus,
|
||||
idServicio: servicios[i].idServicio
|
||||
})
|
||||
}
|
||||
}
|
||||
let currentTotal = servicios.length
|
||||
let contador
|
||||
|
||||
for (let i = 0; i < (res.data.registros / 25) + 1; i++) {
|
||||
contador = i
|
||||
}
|
||||
currentTotal = this.perPage * contador
|
||||
this.total = currentTotal
|
||||
this.loading = false
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err.response.data.message)
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
servicios (idServicio) {
|
||||
window.localStorage.setItem('idServicio', idServicio)
|
||||
this.$router.push('/admin/servicio')
|
||||
},
|
||||
admRes () {
|
||||
this.idUsuario = localStorage.getItem('idUsuario')
|
||||
console.log(this.idUsuario)
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.admRes()
|
||||
this.obtenerDatos()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.input:focus{
|
||||
border:#1b3d70;
|
||||
box-shadow: 0 0 8px 0 #1b3d70;
|
||||
}
|
||||
.select select:focus{
|
||||
border-color: #1b3d70;
|
||||
box-shadow: 0 0 8px 0 #1b3d70;
|
||||
}
|
||||
.select:not(.is-multiple):not(.is-loading)::after{
|
||||
border-color: #1b3d70;
|
||||
}
|
||||
.pagination-link.is-current {
|
||||
background-color: #1b3d70;
|
||||
border-color: #1b3d70;
|
||||
}
|
||||
.b-table{
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
@@ -39,7 +39,6 @@
|
||||
<option value=7>Carta Aceptacion Rechazada</option>
|
||||
<option value=8>Carta Termino Rechazada</option>
|
||||
<option value=9>Informe Global Rechazado</option>
|
||||
<option value=10>Cancelado</option>
|
||||
</optgroup>
|
||||
</b-select>
|
||||
</b-field>
|
||||
@@ -53,10 +52,6 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<BotonesCarga v-if="id == 1"/>
|
||||
</div>
|
||||
|
||||
<div class="columns">
|
||||
<section class="column is-12">
|
||||
<b-table
|
||||
@@ -72,26 +67,26 @@
|
||||
@page-change="onPageChange"
|
||||
>
|
||||
<b-table-column field="nombre" label="Nombre" v-slot="props" centered>
|
||||
{{ props.row.nombre}}
|
||||
<span>{{ props.row.nombre}}</span>
|
||||
</b-table-column>
|
||||
<b-table-column field="numeroCuenta" label="Número de Cuenta" v-slot="props" centered>
|
||||
{{ props.row.numeroCuenta}}
|
||||
<b-table-column field="numeroCuenta" label="Número de Cuenta" v-slot="props" centered width="100">
|
||||
<span >{{ props.row.numeroCuenta}}</span>
|
||||
</b-table-column>
|
||||
<b-table-column field="carrera" label="Carrera" v-slot="props" centered>
|
||||
{{ props.row.carrera}}
|
||||
<span >{{ props.row.carrera}}</span>
|
||||
</b-table-column>
|
||||
<b-table-column field="fechaInicio" truncate=10 label="Fecha Inicio" v-slot="props" centered>
|
||||
{{ props.row.fechaInicio}}
|
||||
<span >{{ fecha(props.row.fechaInicio) }}</span>
|
||||
</b-table-column>
|
||||
<b-table-column field="fechaFin" label="Fecha Fin" v-slot="props" centered>
|
||||
{{ props.row.fechaFin}}
|
||||
<span >{{ fecha(props.row.fechaFin) }}</span>
|
||||
</b-table-column>
|
||||
<b-table-column field="status" label="Status" v-slot="props" centered>
|
||||
<span class="tag" :class="types(props.row.status)">{{ props.row.status}}</span>
|
||||
<span class="tag" :class="types(props.row.idStatus)">{{ 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'">
|
||||
<b-table-column field="cartaTermino" label="Carta Término" v-slot="props" centered v-if="idUsuario == 2">
|
||||
<div v-if="props.row.idStatus >= 4">
|
||||
<span
|
||||
v-if="props.row.cartaTermino === 1"
|
||||
>
|
||||
@@ -109,7 +104,7 @@
|
||||
</div>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column field="cuestionario" label="Cuestionario" v-slot="props" centered v-if="id == 2">
|
||||
<b-table-column field="cuestionario" label="Cuestionario" v-slot="props" centered v-if="idUsuario == 2">
|
||||
<div v-if="props.row.status === 'Pre-Termino'">
|
||||
<span
|
||||
v-if="props.row.cuestionario === 1"
|
||||
@@ -135,15 +130,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BotonesCarga from './botonesCarga.vue'
|
||||
import axios from 'axios'
|
||||
import moment from 'moment'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
BotonesCarga
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
idUsuario: '',
|
||||
data: [],
|
||||
total: '',
|
||||
loading: true,
|
||||
@@ -154,40 +147,32 @@ export default {
|
||||
idStatus: 1
|
||||
}
|
||||
},
|
||||
props: {
|
||||
id: {
|
||||
type: Number,
|
||||
required: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onPageChange (page) {
|
||||
this.page = page
|
||||
this.obtenerDatos()
|
||||
console.log(this.page)
|
||||
},
|
||||
types (status) {
|
||||
if (status === 'Pre-Registro') {
|
||||
types (idStatus) {
|
||||
if (idStatus === 1) {
|
||||
return 'is-dark'
|
||||
} else if (status === 'Pre-Registro') {
|
||||
return 'is-warning'
|
||||
} else if (status === 'Registro') {
|
||||
} else if (idStatus === 2) {
|
||||
return 'is-info'
|
||||
} else if (status === 'Registro Validado') {
|
||||
return 'is-succes'
|
||||
} else if (status === 'Pre-Termino') {
|
||||
return 'is-light'
|
||||
} else if (status === 'Termino') {
|
||||
return 'is-success'
|
||||
} else if (status === 'Liberación') {
|
||||
} else if (idStatus === 3) {
|
||||
return 'is-link'
|
||||
} else if (status === 'Carta Aceptacion Rechazada') {
|
||||
} else if (idStatus === 4) {
|
||||
return 'is-warning'
|
||||
} else if (idStatus === 5) {
|
||||
return 'is-success'
|
||||
} else if (idStatus === 6) {
|
||||
return 'is-link'
|
||||
} else if (idStatus === 7) {
|
||||
return 'is-danger'
|
||||
} else if (status === 'Carta Termino Rechazada') {
|
||||
} else if (idStatus === 8) {
|
||||
return 'is-danger'
|
||||
} else if (status === 'Informe Global Rechazdo') {
|
||||
} else if (idStatus === 9) {
|
||||
return 'is-danger'
|
||||
} else if (status === 'Cancelado') {
|
||||
} else if (idStatus === 10) { // admin
|
||||
return 'is-danger'
|
||||
}
|
||||
},
|
||||
@@ -219,11 +204,15 @@ export default {
|
||||
return 'close'
|
||||
}
|
||||
},
|
||||
fecha (date) {
|
||||
const fecha = moment(date.substr(0, 10))
|
||||
return `${fecha.date()}/${fecha.month() + 1}/${fecha.year()}`
|
||||
},
|
||||
obtenerDatos () {
|
||||
this.loading = true
|
||||
this.data = []
|
||||
|
||||
axios.get(`${process.env.api}/servicio/servicios_responsable?idUsuario=2&pagina=${this.page}&idStatus=${this.idStatus}&nombre=${this.nombre}&numeroCuenta=${this.numeroCuenta}`)
|
||||
axios.get(`${process.env.api}/servicio/servicios_responsable?idUsuario=${this.idUsuario}&pagina=${this.page}&idStatus=${this.idStatus}&nombre=${this.nombre}&numeroCuenta=${this.numeroCuenta}`)
|
||||
.then(res => {
|
||||
const servicios = res.data.servicios
|
||||
|
||||
@@ -236,6 +225,7 @@ export default {
|
||||
fechaInicio: servicios[i].fechaInicio,
|
||||
fechaFin: servicios[i].fechaFin,
|
||||
status: servicios[i].Status.status,
|
||||
idStatus: servicios[i].Status.idStatus,
|
||||
cuestionario: servicios[i].idCuestionarioPrograma,
|
||||
cartaTermino: servicios[i].cartaTermino
|
||||
})
|
||||
@@ -253,10 +243,16 @@ export default {
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err.response.data.message)
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
admRes () {
|
||||
this.idUsuario = localStorage.getItem('idUsuario')
|
||||
console.log(this.idUsuario)
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.admRes()
|
||||
this.obtenerDatos()
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -51,9 +51,9 @@ export default {
|
||||
build: {
|
||||
},
|
||||
env: {
|
||||
//api: 'http://localhost:3000'
|
||||
api: 'https://676239f84128.ngrok.io'
|
||||
//api: 'https//venus.acatlan.unam.mx/pruebas_pcpuma'
|
||||
// api: 'http://localhost:3000'
|
||||
api: 'https://3a654113271d.ngrok.io'
|
||||
// api: 'https//venus.acatlan.unam.mx/pruebas_pcpuma'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,23 +5,18 @@
|
||||
<p class="title is-three-fifths is-offset-one-fifth">Servicios Sociales</p>
|
||||
</div>
|
||||
<section class="section">
|
||||
<InputTable :id="id"/>
|
||||
<InputTableA/>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import InputTable from '../../components/responsable/inputTable'
|
||||
import InputTableA from '../../components/admin//servicio/inputTableA'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
InputTable
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
id: 1
|
||||
}
|
||||
InputTableA
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
+1
-1
@@ -86,7 +86,7 @@ export default {
|
||||
window.localStorage.setItem('nombre', resp.data.Usuario.nombre)
|
||||
window.localStorage.setItem('idTipoUsuario', resp.data.Usuario.TipoUsuario.idTipoUsuario)
|
||||
window.localStorage.setItem('tipoUsuario', resp.data.Usuario.TipoUsuario.tipoUsuario)
|
||||
window.localStorage.setItem('usuario', resp.data.Usuario.TipoUsuario.usuario)
|
||||
window.localStorage.setItem('usuario', resp.data.Usuario.usuario)
|
||||
|
||||
this.$router.push(`/${resp.data.Usuario.TipoUsuario.tipoUsuario}`)
|
||||
})
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
</div>
|
||||
|
||||
<section class="section">
|
||||
<InputTable :id="id"/>
|
||||
<InputTable />
|
||||
</section>
|
||||
|
||||
</div>
|
||||
@@ -31,11 +31,6 @@ export default {
|
||||
components: {
|
||||
InputTable
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
id: 2
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
agregarAlumno () {
|
||||
this.$router.push('/responsable/nuevo')
|
||||
|
||||
Reference in New Issue
Block a user