Files
red_de_investigacion_front/src/components/modificar.vue
T

1694 lines
56 KiB
Vue

<template>
<div class="container ">
<div class="container todo " v-if="espera==true">
<div class="spinner-grow cada text-primary" role="status">
<span class="sr-only">Loading...</span>
</div>
<div class="spinner-grow cada text-secondary" role="status">
<span class="sr-only">Loading...</span>
</div>
<div class="spinner-grow cada text-success" role="status">
<span class="sr-only">Loading...</span>
</div>
<div class="spinner-grow cada text-danger" role="status">
<span class="sr-only">Loading...</span>
</div>
<div class="spinner-grow cada text-warning" role="status">
<span class="sr-only">Loading...</span>
</div>
<div class="spinner-grow cada text-info" role="status">
<span class="sr-only">Loading...</span>
</div>
<div class="spinner-grow cada text-light" role="status">
<span class="sr-only">Loading...</span>
</div>
<div class="spinner-grow cada text-dark" role="status">
<span class="sr-only">Loading...</span>
</div>
</div>
<div v-else class="container ">
<div class="row">
<div class="col">
<h1>Modificar datos del proyecto</h1>
<!-- {{id_proyecto}} -->
</div>
</div>
<h3>Nombre del responsable</h3>
<div class="row tabla cuadro_abajo_boton" >
<div class="col-md-6 col-xs-12">
<div class="admin-campos" v-if="elegido()">
<i class="fas fa-user"></i>
<input type="nombre" placeholder="Nombre" v-model="nombre" >
</div>
<div v-else class="alert alert-success alert-dismissible caja_nombre">
<button type="button" class="close" v-on:click="nombre_elegido=false, profesor=''">&times;</button>
<strong >{{profesor}}</strong> .
</div>
</div>
<div class="col-md-6 col-xs-12">
<div v-if="lista[0].RFC==1" class="spinner-border alt" role="status">
<span class="sr-only">Loading...</span>
</div>
<p v-else-if="buscar_profesor.length==0"><font size="6">No se encontro</font></p>
<div v-else class="table-wrapper-scroll-y my-custom-scrollbar">
<table class="table table-bordered table-striped mb-0 ">
<tr>
<th>
Nombre del Profesors
</th>
</tr>
<tr v-for="item in buscar_profesor" v-bind:key=" item.RFC" >
<td class="renglon select_verde " v-text="item.Nombre +' '+item.ApPaterno+ ' '+item.ApMaterno" @click="verificar(item.Nombre +' '+item.ApPaterno+ ' '+item.ApMaterno,item.RFC)" v-if="profesor==item.Nombre +' '+item.ApPaterno+ ' '+item.ApMaterno"></td>
<td class="renglon" v-text="item.Nombre +' '+item.ApPaterno+ ' '+item.ApMaterno" @click="verificar(item.Nombre +' '+item.ApPaterno+ ' '+item.ApMaterno,item.RFC)" v-else></td>
</tr>
</table>
</div>
</div>
</div>
<h3 class="separar_titulo">Datos del proyecto</h3>
<div class="row">
<div class="col-6 separar_caja">
<form>
<div class="form-group ">
<label for="formGroupExampleInput" class="letra_titulo">Nombre del Proyecto</label>
<input type="text" class="form-control letra_caja" id="formGroupExampleInput" v-model="nombre_proyecto" :maxlength="295">
</div>
</form>
</div>
<div class="col-6">
<form>
<div class="form-group ">
<label for="formGroupExampleInput2" class="letra_titulo">Disciplina</label>
<input type="text" class="form-control letra_caja" id="formGroupExampleInput2" v-model="disciplina" :maxlength="245">
</div>
</form>
</div>
</div>
<div class="row separacion" >
<div class="col-md-6">
<table class="table" >
<tr>
<th>
Campos de Conocimiento
</th>
</tr>
<tr v-for="item in campos_de_conocimiento" v-bind:key="item.id" >
<td class="renglon select_verde " v-text="item.nombre" @click="seleccionar_campo(item.id_campo)" v-if="verificar_selec(item.id_campo)"></td>
<td class="renglon" v-text="item.nombre" @click="seleccionar_campo(item.id_campo)" v-else></td>
</tr>
</table>
</div>
<div class="col">
<div class="table-wrapper-scroll-y my-custom-scrollbar">
<table class="table table-bordered table-striped mb-0 ">
<thead class="thead-dark">
<tr>
<th>
Lineas de Investigación
</th>
</tr>
</thead>
<tr v-for="item in linea" v-bind:key="item.id" >
<td class="renglon select_verde" v-if="linea_seleccionada==item.nom" v-text="item.nom" @click="select_linea(item.nom)" ></td>
<td class="renglon" v-else v-text="item.nom" @click="select_linea(item.nom)" ></td>
</tr>
</table>
</div>
<input v-if="aparece==true" v-model="linea_base" type="text" class="form-control marco " placeholder="Nombre de la otra disciplina" :maxlength="140">
</div>
</div>
<div class="row separacion">
<div class="col">
<div class="form-group ">
<label for="objetivo_general" class="letra_titulo">Objetivo General</label>
<textarea id="objetivo_general" class="form-control" rows="5" name="text" placeholder="Objetivo General" v-model="objetivo_general" :maxlength="795" ></textarea>
</div>
</div>
</div>
<div class="row">
<div class="col ">
<!-- {{inputs}} -->
<div class="form-group ">
<label for="objetivo_particular" class="letra_titulo">Objetivos Particulares</label>
<div id="objetivo_particular" class="form-group" v-for="(inp,k) in inputs" :key="k">
<input type="text" class="form-control" placeholder="Objetivo Particular" v-model="inp.objetivo_texto" :maxlength="895">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<button class="button_agregar rojo" @click="remove()" v-show=" inputs.length > 3">-</button>
</div>
<div class="col-6">
<button class="button_agregar verde" @click="add()" >+</button>
</div>
</div>
<div class="row separacion">
<div class="col">
<div class="form-group ">
<label for="hipotesis" class="letra_titulo">Hipotesis del proyecto</label>
<textarea class="form-control" rows="5" id="hipotesis" name="text" placeholder="Hipotesis (en su caso)" v-model="hipotesis" :maxlength="795"></textarea>
</div>
</div>
</div>
<div class="row separacion">
<div class="col">
<div class="form-group ">
<label for="resumen" class="letra_titulo">Resumen del proyecto</label>
<textarea class="form-control" rows="5" id="resuemn" name="text" placeholder="Resumen del proyecto de investigación" v-model="resumen" :maxlength="1450"></textarea>
</div>
</div>
</div>
<div class="row separacion">
<div class="col">
<div id="calendar"></div>
</div>
</div>
<div class="row separacion">
<div class="col">
<div class="form-group ">
<label for="fecha_inicio" class="letra_titulo">Fecha de inicio</label>
<datepicker id="fecha_inicio" class="center" :language="es" v-model="fecha_inicio" name="fecha_inicio" ></datepicker>
</div>
</div>
<div class="col">
<div class="form-group ">
<label for="fecha_fin" class="letra_titulo">Fecha termino</label>
<datepicker id="fecha_fin" class="center" :language="es" v-model="fecha_final" name="fecha_final" ></datepicker>
</div>
<p class="error">{{validar_fecha()}}</p>
</div>
</div>
<div class="row separacion">
<div class="col-md-6 separacion">
<table class="table" >
<tr>
<th>
Estado de Avance
</th>
</tr>
<tr v-for="item in estado_avance" v-bind:key="item.avance" >
<!-- <td class="renglon select_verde" v-text="item.avance" ></td>
-->
<td class="renglon select_verde " v-text="item.avance" @click="verificar_estado_avance(item.avance)" v-if="check_estado(item.avance)"></td>
<td class="renglon" v-text="item.avance" @click="verificar_estado_avance(item.avance)" v-else></td>
</tr>
</table>
</div>
<div class="col">
<table class="table" >
<tr>
<th>
Duración
</th>
</tr>
<tr v-for="item in duracion" v-bind:key="item.tiempo" >
<td class="renglon select_verde" v-text="item.tiempo" @click="verificar_duracion(item.tiempo)" v-if="check_duracion(item.tiempo)" ></td>
<td class="renglon" v-text="item.tiempo" @click="verificar_duracion(item.tiempo)" v-else ></td>
</tr>
</table>
</div>
</div>
<div class="row separacion">
<div class="col">
<div class="form-group ">
<label for="avance" class="letra_titulo">Avance del proyecto en %</label>
<input id="avance" class="cuadro top porciento" placeholder="Avance %" v-model="avance"
oninput="javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);"
type = "number"
maxlength = "3"/>
<p class="error">{{validar_avance()}}</p>
</div>
</div>
</div>
<div class="row separacion">
<div class="col">
<div class="table-wrapper-scroll-y my-custom-scrollbar">
<table class="table table-bordered table-striped mb-0 ">
<tr>
<th>
Financiamiento del proyecto
</th>
</tr>
<tr v-for="item in financiaminetos" v-bind:key="item.nombre" >
<td class="renglon select_verde " v-text="item.nombre" @click="seleccionar_financiamiento(item.nombre)" v-if="verificar_financiamiento(item.nombre)"></td>
<td class="renglon" v-text="item.nombre" @click="seleccionar_financiamiento(item.nombre)" v-else></td>
</tr>
</table>
</div>
</div>
<div class="col separacion">
<div class="form-group ">
<label v-if=" check_numero_registro()" for="numero" class="letra_titulo">Numero de registro</label>
<input v-if=" check_numero_registro()" id="numero" type="text" class="cuadro_registro" placeholder="Numero de registro" v-model="numero_registro" >
<label for="presupuesto" class="letra_titulo">Presupuesto Asignado ($00.00MXN)</label>
<input type="number" class="ultimo" placeholder="Presupuesto Asignado ($00.00MXN)" v-model="presupuesto" >
</div>
<p class="error" v-if="chack_presupuesto()">El presupuesto solo puede tener numeros y a lo más un caracter punto '.'</p>
</div>
</div>
<h3 class="separacion">Entidades Participandes (además de la FES Acatlán)</h3>
<div clas="row">
<div class="col">
<div class="form-group" v-for="entidad in entidades_seleccionadas" :key="entidad.id_entidad">
<div class="input-group">
<div class="input-group-prepend">
<button class="Azul-puma btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" >{{entidad.nombre}}</button>
<div class="dropdown-menu">
<div v-for="ent in entidades" :key="ent.id_entidades">
<a class="dropdown-item renglon " @click="entidad.nombre=ent.tipo, entidad.id_entidad=ent.id_entidad">{{ent.tipo}}</a>
</div>
</div>
</div>
<input type="text" v-model="entidad.nombre_de_entidad" class="form-control" placeholder="Nombre de la entidad" aria-label="Text input with dropdown button" :maxlength="95">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<button class="button_agregar rojo" @click="remove_entidades()" v-show=" entidades_seleccionadas.length > 1">-</button>
</div>
<div class="col-6">
<button class="button_agregar verde" @click="add_entidades()" >+</button>
</div>
</div>
<div class="row separacion">
<div class="col separacion">
<div class="table-wrapper-scroll-y my-custom-scrollbar">
<table class="table table-bordered table-striped mb-0 ">
<tr>
<th>
Producto(s)
</th>
</tr>
<tr v-for="item in productos" v-bind:key="item.nombre" >
<td class="renglon select_verde " v-text="item.nombre" @click="seleccionar_producto(item.id_producto)" v-if="verificar_producto(item.id_producto)"></td>
<td class="renglon" v-text="item.nombre" @click="seleccionar_producto(item.id_producto)" v-else></td>
</tr>
</table>
</div>
</div>
</div>
<h3 class="separacion">Profesores participantes internos</h3>
<!-- <p>{{profesores_externos}}</p>
<p>{{alumnos_internos}}</p>
<p>{{alumnos_externos}}</p> -->
<!-- {{profesores_internos}}
{{concurrent}}
{{nombre_buscar}}
{{profesores_internos.length}} -->
<div class="row">
<div class="col-md-6 col-xs-12">
<div class="form-group" v-for="item in profesores_internos" v-bind:key="item.nombre" >
<div class="input-group">
<div class="input-group-prepend">
<button class="Azul-puma btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" >{{item.participacion}}</button>
<div class="dropdown-menu">
<a class="dropdown-item renglon" @click="item.participacion= 'Corresponsable'" >Corresponsable</a>
<a class="dropdown-item renglon" @click="item.participacion= 'Colaborador'" >Colaborador</a>
<a class="dropdown-item renglon" @click="item.participacion= 'Otro'" >Otro</a>
</div>
</div>
<input v-if="item.use==false" type="text" class="form-control" placeholder='Nombre del profesor interno ' v-model="nombre_buscar[item.n]" aria-label="Text input with dropdown button" @click="borrar(),concurrent= item.n">
<div v-else class=" form-control alert alert-success alert-dismissible caja_nombre">
<button type="button" class="close" v-on:click="item.use=false, item.nombre=''">&times;</button>
<strong >{{item.nombre}}</strong> .
</div>
</div>
</div>
</div>
<div v-if="lista[0].RFC==1" class="spinner-border alt alado" role="status">
<span class="sr-only">Loading...</span>
</div>
<div v-else class="col-md-6 col-xs-12">
<div class="table-wrapper-scroll-y my-custom-scrollbar">
<table class="table table-bordered table-striped mb-0 ">
<tr>
<th>
Nombre del Profesor
</th>
</tr>
<p v-if="filtro.length==0"><font size="6">No se encontro</font></p>
<tr v-else v-for="item in filtro" v-bind:key="item.RFC" >
<td class="renglon" v-text="item.Nombre +' '+item.ApPaterno+ ' '+item.ApMaterno" @click="poner_nombre(item.Nombre +' '+item.ApPaterno+ ' '+item.ApMaterno)" ></td>
</tr>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-6">
<button class="button_agregar rojo" @click="remove_profesor_interno()" v-show=" profesores_internos.length > 1">-</button>
</div>
<div class="col-6">
<button class="button_agregar verde" @click="add_profesor_interno()" >+</button>
</div>
</div>
<h3 class="separacion">Profesores participantes externos</h3>
<div class="row">
<div class="col">
<div class="form-group" v-for="item in profesores_externos" v-bind:key="item.nombre" >
<div class="input-group">
<div class="input-group-prepend">
<button class="Azul-puma btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" >{{item.participacion}}</button>
<div class="dropdown-menu">
<a class="dropdown-item renglon" @click="item.participacion= 'Corresponsable'" >Corresponsable</a>
<a class="dropdown-item renglon" @click="item.participacion= 'Colaborador'" >Colaborador</a>
<a class="dropdown-item renglon" @click="item.participacion= 'Otro'" >Otro</a>
</div>
</div>
<!-- profesores_externos:[{nombre: '', participacion: 'Tipo de participación', entidad:'Seleccione Entidad',id_entidad:null}] -->
<input type="text" class="form-control" placeholder="Nombre del profesor externo" aria-label="Text input with dropdown button" v-model.lazy="item.nombre" :maxlength="95">
<div class="input-group-prepend">
<button class="Azul-puma btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" >{{item.entidad}}</button>
<div class="dropdown-menu">
<div v-for="ent in entidades_persona" :key="ent.id_entidad">
<a class="dropdown-item renglon " @click="item.entidad=ent.nombre_entidad, item.id_entidad=ent.id_pro_entidad">{{ent.nombre_entidad}}</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<button class="button_agregar rojo" @click="remove_profesor_externo()" v-show=" profesores_externos.length > 1">-</button>
</div>
<div class="col-6">
<button class="button_agregar verde" @click="add_profesor_externo()" >+</button>
</div>
</div>
<h3 class="separacion" >Alumnos participantes internos</h3>
<div class="row">
<div class="col">
<div class="form-group" v-for="item in alumnos_internos" v-bind:key="item.nombre" >
<div class="input-group">
<div class="input-group-prepend">
<button class="Azul-puma btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" >{{item.participacion}}</button>
<div class="dropdown-menu">
<a class="dropdown-item renglon" @click="item.participacion= 'Servicio Social'" >Servicio Social</a>
<a class="dropdown-item renglon" @click="item.participacion= 'Becario'" >Becario</a>
<a class="dropdown-item renglon" @click="item.participacion= 'Práctica profesional'" >Práctica profesional</a>
<a class="dropdown-item renglon" @click="item.participacion= 'Otro'" >Otro</a>
</div>
</div>
<input type="text" class="form-control" placeholder="Nombre del alumno interno" aria-label="Text input with dropdown button" v-model.lazy="item.nombre" :maxlength="95">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<button class="button_agregar rojo" @click="remove_alumnos_internos()" v-show=" alumnos_internos.length > 1">-</button>
</div>
<div class="col-6">
<button class="button_agregar verde" @click="add_alumnos_internos()" >+</button>
</div>
</div>
<!-- {{entidades_persona}} -->
<h3 class="separacion">Alumnos participantes externos</h3>
<div class="row">
<div class="col">
<div class="form-group" v-for="item in alumnos_externos" v-bind:key="item.nombre" >
<div class="input-group">
<div class="input-group-prepend">
<button class="Azul-puma btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" >{{item.participacion}}</button>
<div class="dropdown-menu">
<a class="dropdown-item renglon" @click="item.participacion= 'Servicio Social'" >Servicio Social</a>
<a class="dropdown-item renglon" @click="item.participacion= 'Becario'" >Becario</a>
<a class="dropdown-item renglon" @click="item.participacion= 'Práctica profesional'" >Práctica profesional</a>
<a class="dropdown-item renglon" @click="item.participacion= 'Otro'" >Otro</a>
</div>
</div>
<input type="text" class="form-control" placeholder="Nombre del alumno externo" aria-label="Text input with dropdown button" v-model.lazy="item.nombre" :maxlength="95">
<div class="input-group-prepend">
<button class="Azul-puma btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" >{{item.entidad}}</button>
<div class="dropdown-menu">
<div v-for="ent in entidades_persona" :key="ent.id_entidad">
<a class="dropdown-item renglon " @click="item.entidad=ent.nombre_entidad, item.id_entidad=ent.id_pro_entidad">{{ent.nombre_entidad}}</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<button class="button_agregar rojo" @click="remove_alumnos_externos()" v-show=" alumnos_externos.length > 1">-</button>
</div>
<div class="col-6">
<button class="button_agregar verde" @click="add_alumnos_externos()" >+</button>
</div>
</div>
<div class="row espacio">
<div class="col">
<button class="button" @click="registrar()" > Guardar </button>
</div>
</div>
<div class="row espacio">
<div class="col">
<!-- <p>{{this.id_proyecto}}</p> -->
<button class="button_salir " @click="salir()" >Salir</button>
<!-- {{entidades}} -->
</div>
</div>
</div>
</div>
</template>
<script>
import axios from 'axios';
import {en, es} from 'vuejs-datepicker/dist/locale';
import config from '../config/config.js'
import Datepicker from 'vuejs-datepicker';
import swal from 'sweetalert';
export default {
data(){
return {
id_proyecto : window.localStorage.getItem('id_proyecto_select'),
datos:null,
nombre:'',
pop: '',
nombre_elegido: true,
profesor: '',
RFC: null,
lista: [{ "Nombre": "-", "RFC": 1 }],
campos_de_conocimiento:[],
campos_de_conocimiento_seleccionado:[],
linea:[{nom:"Autocultura e intercultura de las literaturas mexicanas y española"},{nom: "Didáctica dla literatura"},{nom: "Didáctica de la liteatura"},{nom: "Didáctica de la literaa"},{nom: "Didáctica de la literatu"},{nom: "Didáctica de la literatur"},{nom: "Otra"}],
objetivos_particulares:[],
p: '',
name : '',
inputs:([{name: ''},{name: ''},{name: ''}]),
counter:3,
nombre_proyecto:'',
disciplina: '',
objetivo_general:'',
resp: null,
error: false,
hipotesis:'',
resumen:'',
fecha_inicio:null,
fecha_final:null,
en: en,
es: es,
estado_avance:[{avance:"Nuevo"},{avance:"En Desarrollo"},{avance: "Concluido"},{avance: "Suspendido"}],
duracion:[{tiempo:"1 año"},{tiempo: "2 años"},{tiempo: "3 años"},{tiempo: "Más de 3 años"}],
estado_elegido:'',
duracion_elegido:'',
avance: null,
av: false,
fe:false,
financiaminetos:[{nombre: "PAPIME"},{nombre: "PAPIIT"},{nombre: "PAIDI"},{nombre: "CONACYT"},{nombre: "Otras Universidades o Instituciones Nacionales"},{nombre: "Otras Universidades o Instituciones Internacionales"}, {nombre: "ONG'S o Fundaciones Nacionales"},{nombre: "Sector Privado"},{nombre: "Investigación dentro de su plaza"} ],
entidades:[],
productos:[],
financiamiento_seleccionado:'',
numero_registro:'',
presupuesto:null,
entidades_seleccionadas:[{id_entidad: null, nombre: 'Seleccione la Entidad', nombre_de_entidad:''}],
productos_seleccionados:[],
con:1,
type: null,
entidades_persona:[],
profesores_internos:[{nombre: '', participacion: 'Tipo de participación', n:1, use: false }],
profesores_externos:[{nombre: '', participacion: 'Tipo de participación', entidad:'Seleccione Entidad',id_entidad:null}],
alumnos_internos:[{nombre: '', participacion:'Tipo de participación'}],
alumnos_externos:[{nombre: '', participacion: 'Tipo de participación', entidad:'Seleccione Entidad',id_entidad:null}],
link: '',
concurrent: 0,
nombre_buscar:[],
espera: false,
linea_seleccionada: null,
linea_base: null,
aparece: false
}
},
methods:
{
check_numero_registro()
{
if(this.financiamiento_seleccionado=='PAPIME' || this.financiamiento_seleccionado=='PAPIIT' || this.financiamiento_seleccionado=='PAIDI' || this.financiamiento_seleccionado=='CONACYT' )
return true;
else
{
this.numero_registro='';
return false;
}
},
select_linea(nom){
if(this.linea_seleccionada==nom)
this.linea_seleccionada=null;
else
{
this.linea_seleccionada=nom;
if(nom=="Otra")
this.aparece=true;
else
{
this.linea_base=null
this.aparece=false;
}
}
},
registrar(){
if(this.linea_base!=null)
{
this.linea_seleccionada=this.linea_base;
}
else
if(this.linea_seleccionada=='Otra')
{
swal("No deje la linea de investigacion vacia",'','warning')
return;
}
this.espera=true;
const data={
datos_proyecto:{
id_proyecto: this.id_proyecto,
nombre_proyecto: this.nombre_proyecto,
RFC: this.RFC,
nombre_responsable: this.profesor,
disciplina: this.disciplina,
objetivo_general: this.objetivo_general,
hipotesis: this.hipotesis,
resumen: this.resumen,
fecha_inicio: this.fecha_inicio,
fecha_fin: this.fecha_final,
estado_avance: this.estado_elegido,
avance: this.avance,
duracion: this.duracion_elegido,
financiamiento: this.financiamiento_seleccionado,
numero_registro: this.numero_registro,
linea_investigacion: this.linea_seleccionada,
presupuesto: this.presupuesto
},
lineas:{
campo_conocimiento: this.campos_de_conocimiento_seleccionado,
objetivo_particular: this.inputs,
producto: this.productos_seleccionados,
entidades: this.entidades_seleccionadas,
profesores_internos:this.profesores_internos,
profesores_externos: this.profesores_externos,
alumnos_internos: this.alumnos_internos,
alumnos_externos : this.alumnos_externos
}
}
// eslint-disable-next-line no-console
console.log(data)
axios.post(`${config.api}/actualizar`,data).then(async ()=>{
this.espera=false;
await swal("listo",' ', "success");
this.$router.push('/buscar');
})
},
salir(){
this.$router.push('/buscar');
},
verificar(profesor,RFC){
if(this.profesor==profesor)
{
this.profesor='';
this.nombre_elegido=false;
}
else
{
this.profesor=profesor;
this.RFC=RFC;
this.nombre_elegido=true;
}
},
elegido(){
if(this.nombre_elegido==true)
return false;
else
return true;
},
async datos_proyecto()
{
await axios.get(`${config.api}/datos_modificar?id_proyecto=${this.id_proyecto}`).then(response=>{
this.datos=response.data.data;
//alert(response.data);
})
}
,verificar_selec(id_campo){
let ban=0;
this.campos_de_conocimiento_seleccionado.forEach(element=>{
if(element==id_campo)
ban=1;
});
if(ban==1)
return true;
else
return false;
}
,
seleccionar_campo(id_campo)
{
let ban=0;
let con=0;
this.campos_de_conocimiento_seleccionado.forEach(element=>{
if(element==id_campo)
ban=1;
if(ban==0)
con++;
});
if(ban==0)
{
this.campos_de_conocimiento_seleccionado.push(id_campo);
}
else{
this.campos_de_conocimiento_seleccionado.splice(con,1);
}
},
verificar_selec_linea (id_linea){
let ban=0;
this.lineas_de_investigacion_seleccionado.forEach(element=>{
if(element==id_linea)
ban=1;
});
if(ban==1)
return true;
else
return false;
}
,
seleccionar_linea(id_linea)
{
let ban=0;
let con=0;
this.lineas_de_investigacion_seleccionado.forEach(element=>{
if(element==id_linea)
ban=1;
if(ban==0)
con++;
});
if(ban==0)
{
this.lineas_de_investigacion_seleccionado.push(id_linea);
}
else{
this.lineas_de_investigacion_seleccionado.splice(con,1);
}
}
,
traer_campos_de_conocimiento()
{
axios.post(`${config.api}/traer_campos`).then(response=>{
this.p=response;
this.campos_de_conocimiento=response.data.campos;
})
},
add() {
this.inputs.push({ objetivo_texto: '' });
},
remove() {
this.inputs.splice( this.inputs.length-1,1);
},
validar_fecha(){
if(this.fecha_inicio>=this.fecha_final && this.fecha_inicio!=null && this.fecha_final!=null)
{
this.fe=false;
return "La fecha de final tiene que ser mayor que la final"
}
else{
this.fe=true;
return
}
}, verificar_estado_avance(estado){
if(this.estado_elegido==estado)
this.estado_elegido='';
else
this.estado_elegido=estado;
}, check_estado(estado){
if(this.estado_elegido==estado)
return true;
else
return false;
}, check_duracion(tiempo){
if(this.duracion_elegido==tiempo)
return true;
else
return false;
},
verificar_duracion(tiempo){
if(this.duracion_elegido==tiempo)
this.duracion_elegido='';
else
this.duracion_elegido=tiempo;
},
validar_avance(){
if(this.avance>100)
{
this.av=false;
return "El porcentage de avance tiene que estar en el intervalo [1-100]";
}
else
{
if(this.avance!=null)
this.av=true;
return '';
}
}
,
seleccionar_financiamiento(financiamiento){
if(financiamiento==this.financiamiento_seleccionado)
this.financiamiento_seleccionado='';
else
this.financiamiento_seleccionado=financiamiento;
},
chack_presupuesto(){
if(this.presupuesto=='')
return true;
},
add_entidades() {
this.entidades_seleccionadas.push({id_entidad: null, nombre: 'Seleccione la Entidad', nombre_de_entidad:''});
},
remove_entidades() {
this.entidades_seleccionadas.splice( this.entidades_seleccionadas.length-1,1);
},
seleccionar_producto(id){
let ban=0;
let con=0;
this.productos_seleccionados.forEach(elemet=>{
if(elemet==id)
ban=1;
if(ban==0)
con++;
});
if(ban==1)
this.productos_seleccionados.splice(con,1);
else
this.productos_seleccionados.push(id);
},
verificar_producto(id)
{
let ban=false;
this.productos_seleccionados.forEach(elemet=>{
if(elemet==id)
ban=true;
})
return ban;
},
verificar_financiamiento(financiamiento){
if(this.financiamiento_seleccionado==financiamiento)
return true;
else
return false;
},
traer_entidades()
{
axios.post(`${config.api}/traer_entidades`).then(response=>{
this.entidades=response.data.entidades;
})
},
traer_entidades_persona()
{
const data={
id_proyecto: this.id_proyecto
}
axios.post(`${config.api}/traer_entidades_proyecto`,data).then(async respose=>{
this.entidades_persona=[]
await respose.data.entidad_proyecto.forEach(element=>{
if(element.nombre_entidad!="FES-Acatlan")
this.entidades_persona.push(element);
});
}).catch();
return this.entidades_persona;
},
async buscar(){
let use;
await axios.get(`${config.api}/busca_profesor`).then(respose=>{
use=respose.data.data;
}).catch(()=>{this.lista="asddas"});
return use;
},
traer_productos()
{
axios.post(`${config.api}/traer_productos`).then(response=>{
this.productos=response.data.productos;
})
},
async poner_nombre(nom){
if(this.concurrent!=0)
{
this.profesores_internos[this.concurrent-1].nombre=nom;
this.profesores_internos[this.concurrent-1].use=true;
}
},
borrar(){
for(let i=0; i<this.nombre_buscar.length; i++)
{
this.nombre_buscar[i]='';
}
// this.profesores_internos.forEach(element=>{
// element.use=false;
// })
},
add_alumnos_externos() {
this.alumnos_externos.push({nombre: '', participacion: 'Tipo de participación',entidad:'Seleccione Entidad',id_entidad:null});
},
remove_alumnos_externos(){
this.alumnos_externos.splice( this.alumnos_externos.length-1,1);
},
add_alumnos_internos() {
this.alumnos_internos.push({nombre: '', participacion: 'Tipo de participación'});
},
remove_alumnos_internos(){
this.alumnos_internos.splice( this.alumnos_internos.length-1,1);
},
add_profesor_externo() {
this.profesores_externos.push({nombre: '', participacion: 'Tipo de participación', entidad:'Seleccione Entidad',id_entidad:null});
},
remove_profesor_externo() {
this.profesores_externos.splice( this.profesores_externos.length-1,1);
},
add_profesor_interno() {
this.nombre_buscar.push('');
this.profesores_internos.push({nombre: '', participacion: 'Tipo de participación', n : this.profesores_internos.length+1,use: false });
},
remove_profesor_interno() {
//alert(this.profesores_internos.length)
//swal(this.profesores_internos)
if(this.profesores_internos[this.profesores_internos.length-1].use==false)
{
if(this.concurrent==this.profesores_internos.length)
this.concurrent--;
this.nombre_buscar.splice(this.nombre_buscar.length-1,1);
this.profesores_internos.splice( this.profesores_internos.length-1,1);
}
else
swal({
title: "Tienes que borrar al profesor ya seleccionado",
icon: "warning",
})
},
},
async created()
{
axios.get(`${config.api}/busca_profesor`)
.then(respose=>{
// use=respose.data.data;
this.lista=respose.data.data;
// eslint-disable-next-line no-console
console.log(this.lista)
// swal(respose.data.data, "seccess");
})
.catch( async (error)=>{
// eslint-disable-next-line no-console
console.log(this.error)
// eslint-disable-next-line no-console
console.log(this.error.response)
// eslint-disable-next-line no-console
console.log(this.error.response.data)
await swal.fire({
title: "Error",
text: error.response.data.msj || error,
icon: "error"
});
});
//this.lista=await this.buscar();
//alert(this.lista);
this.id_proyecto = await window.localStorage.getItem('id_proyecto_select');
//alert(this.id_proyecto);
await this.datos_proyecto();
this.traer_entidades();
this.traer_productos();
this.traer_campos_de_conocimiento();
this.traer_entidades_persona()
// eslint-disable-next-line no-console
console.log(this.datos.proyecto[0]);
this.profesor=this.datos.proyecto[0].nombre_responsable;
this.RFC=this.datos.proyecto[0].RFC_responsable;
this.nombre_proyecto=this.datos.proyecto[0].nombre_proyecto;
this.disciplina=this.datos.proyecto[0].disciplina;
this.objetivo_general=this.datos.proyecto[0].objetivo_general;
this.campos_de_conocimiento_seleccionado=this.datos.campo_proyecto;
this.inputs=this.datos.objetivo;
this.hipotesis=this.datos.proyecto[0].hipotesis;
this.resumen=this.datos.proyecto[0].resumen;
this.fecha_inicio=this.datos.proyecto[0].fecha_inicio;
this.fecha_final=this.datos.proyecto[0].fecha_final;
this.estado_elegido=this.datos.proyecto[0].estado_avance;
this.duracion_elegido=this.datos.proyecto[0].duracion;
this.avance=this.datos.proyecto[0].avance;
this.financiamiento_seleccionado=this.datos.proyecto[0].financiamiento;
this.numero_registro=this.datos.proyecto[0].numero_registro;
this.presupuesto=this.datos.proyecto[0].presupuesto;
this.entidades_seleccionadas=this.datos.entidad;
this.productos_seleccionados=this.datos.producto;
this.profesores_internos=this.datos.profesores_internos;
this.profesores_externos=this.datos.profesores_externos;
this.alumnos_internos=this.datos.alumnos_internos;
this.alumnos_externos=this.datos.alumnos_externos;
let ban=0;
for( let i=0; i<this.linea.length; i++)
{
if(this.datos.proyecto[0].linea_investigacion==this.linea[i].nom)
ban=1;
}
if(ban)
this.linea_seleccionada=this.datos.proyecto[0].linea_investigacion;
else{
this.linea_seleccionada='Otra';
this.aparece=true;
this.linea_base=this.datos.proyecto[0].linea_investigacion;
}
for(let i=0; i<=this.profesores_internos.length; i++)
{
this.nombre_buscar.push('')
}
},
computed:{
buscar_profesor: function()
{
return this.lista.filter((item)=> (item.Nombre+' '+item.ApPaterno+' '+item.ApMaterno).toLowerCase().includes(this.nombre.toLowerCase()) );
},
filtro: function()
{
return this.lista.filter((item)=> (item.Nombre +' '+item.ApPaterno+ ' '+item.ApMaterno).toLowerCase().includes( this.nombre_buscar[this.concurrent].toLowerCase()) );
}
},
components: {
Datepicker
},
}
</script>
<style scoped>
.marco{
border-color: black;
}
.cada{
margin-top: 1rem;
margin-bottom: 10rem;
justify-content: center;
width: 7rem;
height: 7rem;
}
.todo{
padding-top: 10rem;
height: 37rem;
}
.center {
display: flex;
justify-content: center;
margin-top: 1rem;
}
.porciento{
text-align: right;
padding-right: 2rem;
}
.letra_titulo{
color: black;
font-size: 1.4rem;
}
.letra_caja{
font-size: 1.2rem;
text-align: center;
}
.separar_titulo{
margin-bottom: 3rem;
}
.separar_caja{
margin-bottom: 2rem;
}
.cuadro_registro{
height: 3rem;
width: 20rem;
border-top: white;
border-right:white;
border-left: white;
border-bottom-color:black;
margin-left: 2rem;
margin-bottom: 3rem;
font-size: 1rem;
padding-left: 2rem;
}
.error{
color: red;
}
.ultimo{
height: 3rem;
width: 20rem;
border-top: white;
border-right:white;
border-left: white;
border-bottom-color:black;
margin-left: 2rem;
font-size: 1rem;
padding-left: 2rem;
}
.my-custom-scrollbar {
position: relative;
height: 19rem;
overflow: auto;
}
.table-wrapper-scroll-y {
display: block;
}
.boton_aceptar{
background-color: rgb(31, 182, 31);
color: white;
border-radius: .5rem;
}
.separacion{
margin-bottom: 3rem;
}
.select_verde{
background-color: rgb(31, 182, 31);
color: white;
}
.button_agregar {
background-color: #1B3D70; /* Green */
border: none;
color: white;
height: 3rem;
width: 4rem;
text-align: center;
text-decoration: none;
cursor: pointer;
font-size: 1.5rem;
border-radius: .5rem;
-webkit-transition-duration: 0.4s; /* Safari */
transition-duration: 0.4s;
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
margin-bottom: 3rem;
margin-top:1rem;
}
.verde:hover{
background-color: rgb(35, 143, 35);
color: white;
}
.rojo{
background-color: rgba(173, 17, 17, 0.89);
color: white;
border-radius: .5rem;
border-bottom: none;
}
.button_salir {
background-color: #1B3D70; /* Green */
border: none;
color: white;
height: 4.5rem;
width: 15rem;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 1.5rem;
border-radius: 1rem;
-webkit-transition-duration: 0.4s; /* Safari */
transition-duration: 0.4s;
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
margin-left: 2rem;
margin-right: 2rem;
margin-bottom: 3rem;
}
.button_salir:hover {
background-color: rgb(170, 4, 4);
color: white;
}
.button {
background-color: #1B3D70; /* Green */
border: none;
color: white;
height: 4.5rem;
width: 15rem;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 1.5rem;
border-radius: 1rem;
-webkit-transition-duration: 0.4s; /* Safari */
transition-duration: 0.4s;
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
margin-left: 2rem;
margin-right: 2rem;
margin-bottom: 2rem;
}
.botton_falso{
background-color: #CCC; /* Green */
border: none;
color: white;
height: 4.5rem;
width: 15rem;
padding: 1rem 4rem;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 1.5rem;
border-radius: 1rem;
-webkit-transition-duration: 0.4s; /* Safari */
transition-duration: 0.4s;
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
margin-left: 2rem;
margin-right: 2rem;
margin-bottom: 2rem;
}
.button:hover {
background-color: #bb8800;
color: white;
}
.cuadro{
height: 4rem;
width: 15rem;
border-top: white;
border-right:white;
border-left: white;
border-bottom-color:black;
font-size: 1rem;
margin-bottom: 2rem;
}
.formulario{
margin-top: 5rem;
margin-bottom: 5rem;
}
.renglon:hover{
background-color: rgb(31, 182, 31);
color: white;
}
.inputs_nombre{
margin-top: 4rem;
margin-bottom: 2rem;
}
@media screen and (min-width: 768px) {
.registro form div input[type="text"]{
height: 300rem;
}
.cuadro{
height: 3rem;
width: 25rem;
border-top: white;
border-right:white;
border-left: white;
border-bottom-color:black;
margin-left: 2rem;
margin-bottom: 3rem;
font-size: 1.5rem;
padding-left: 2rem;
}
.inputs_nombre{
margin-top: 4rem;
margin-bottom: 2rem;
}
}
.alado{
margin-left: 15rem;
}
.alt{
height: 5rem;
width: 5rem;
}
.select_verde{
color: white;
background-color: rgb(31, 182, 31);
}
.verde:hover{
color: white;
background-color: rgba(35, 143, 35,.6);
}
.renglon:hover{
color: white;
background-color: rgba(31, 182, 31,.6);
}
.cuadro_abajo_boton{
height: 15rem;
}
.ajustar{
height: 45rem;
}
.my-custom-scrollbar {
position: relative;
height: 15rem;
overflow: auto;
}
.table-wrapper-scroll-y {
display: block;
}
.button_salir {
background-color: #1B3D70; /* Green */
border: none;
color: white;
height: 4.5rem;
width: 15rem;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 1.5rem;
border-radius: 1rem;
-webkit-transition-duration: 0.4s; /* Safari */
transition-duration: 0.4s;
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
margin-left: 2rem;
margin-right: 2rem;
margin-bottom: 3rem;
}
.button_salir:hover {
background-color: rgb(170, 4, 4);
color: white;
}
.button {
background-color: #1B3D70; /* Green */
border: none;
color: white;
height: 4.5rem;
width: 15rem;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 1.5rem;
border-radius: 1rem;
-webkit-transition-duration: 0.4s; /* Safari */
transition-duration: 0.4s;
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
margin-left: 2rem;
margin-right: 2rem;
margin-bottom: 2rem;
}
.botton_falso{
background-color: #CCC; /* Green */
border: none;
color: white;
height: 4.5rem;
width: 15rem;
padding: 1rem 4rem;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 1.5rem;
border-radius: 1rem;
-webkit-transition-duration: 0.4s; /* Safari */
transition-duration: 0.4s;
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
margin-left: 2rem;
margin-right: 2rem;
margin-bottom: 2rem;
}
.button:hover {
background-color: #bb8800;
color: white;
}
.tabla{
margin-top: 3rem;
margin-bottom: 4rem;
}
h1{
margin-top: 4rem;
margin-bottom: 8rem;
color: black;
}
.caja_nombre{
height: 3.5rem;
}
.admin-campos {
position: relative;
}
.admin-campos input[type="nombre"] {
border-bottom: black .2rem solid;
border-left: white;
border-right:white;
border-top: white;
display: block;
font-size: 1rem;
margin: 0 auto 3rem auto;
padding: 1rem 0 0rem 3rem;
width: 80%;
}
.admin-campos input::placeholder, .admin-campos input::placeholder {
color: rgb(75, 71, 71);
}
.admin-campos i {
color: black;
font-size: 1.5rem;
left: 2.3rem;
position: absolute;
top:.5rem;
}
@media screen and (max-width: 450px)
{
h1{
margin-top: 4rem;
margin-bottom: 1rem;
color: black;
}
.cuadro_abajo_boton{
height: 20rem;
}
.ajustar{
height: 50rem;
}
}
@media screen and (min-width: 1024px) {
.admin-login img {
height: 10rem;
}
.admin-campos {
width: 30rem;
}
.admin-campos input[type="nombre"]{
font-size: 1.5rem;
padding: 1rem 0 1rem 4rem;
}
.admin-campos i {
font-size: 2rem;
left: 3.5rem;
}
}
</style>