merge errors solved
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
</b-field>
|
||||
<b-field label="Fecha de inicio">
|
||||
<b-datepicker
|
||||
:placeholder="viejo.fechaInicio"
|
||||
:placeholder="fecha(viejo.fechaInicio)"
|
||||
icon="calendar-today"
|
||||
v-model="fechaInicio[0]"
|
||||
:min-date="minDate1">
|
||||
@@ -23,7 +23,7 @@
|
||||
<transition name="fade">
|
||||
<b-field label="Fecha de fin" v-if="fechaInicio[0]">
|
||||
<b-datepicker
|
||||
:placeholder="viejo.fechaInicio"
|
||||
:placeholder="fecha(viejo.fechaInicio)"
|
||||
v-model="fechaFin[0]"
|
||||
:min-date="minDate2"
|
||||
icon="calendar-today">
|
||||
@@ -31,21 +31,24 @@
|
||||
</b-field>
|
||||
</transition>
|
||||
<b-field label="Dirección">
|
||||
<b-input type="text" v-model="nuevo.direccion" :placeholder="viejo.direccion"></b-input>
|
||||
<b-input type="text"
|
||||
v-model="nuevo.direccion"
|
||||
:placeholder="viejo.direccion">
|
||||
</b-input>
|
||||
</b-field>
|
||||
<b-field label="Teléfono">
|
||||
<b-input type="number" :placeholder="viejo.telefono" maxlength="10"></b-input>
|
||||
<b-input
|
||||
type="number"
|
||||
:placeholder="viejo.telefono"
|
||||
maxlength="10"></b-input>
|
||||
</b-field>
|
||||
<b-field label="Fecha de nacimiento">
|
||||
<b-datepicker
|
||||
:placeholder="viejo.fechaNacimiento"
|
||||
:placeholder="fecha(viejo.fechaNacimiento)"
|
||||
v-model="fechaNacimiento[0]"
|
||||
icon="calendar-today">
|
||||
</b-datepicker>
|
||||
</b-field>
|
||||
<b-field label="ID status">
|
||||
<b-input type="" :placeholder="viejo.idStatus"></b-input>
|
||||
</b-field>
|
||||
<p class="is-size-5">Carta de aceptación</p>
|
||||
<br>
|
||||
<b-field>
|
||||
@@ -98,21 +101,15 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import moment from 'moment'
|
||||
import validator from 'validator'
|
||||
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
viejo: {
|
||||
correo: 'juanito@gmail.com',
|
||||
fechaInicio: '20-05-15',
|
||||
fechaFin: '2020-11-12',
|
||||
direccion: 'La que sea',
|
||||
telefono: 5548689152,
|
||||
fechaNacimiento: '2000-02-06',
|
||||
idStatus: 1
|
||||
},
|
||||
idServicio: localStorage.getItem('idServicio'),
|
||||
viejo: {},
|
||||
nuevo: {
|
||||
correo: '',
|
||||
fechaInicioFinal: '',
|
||||
@@ -120,7 +117,6 @@ export default {
|
||||
direccion: null,
|
||||
telefono: null,
|
||||
fechaNacimientoFinal: null,
|
||||
idStatus: null,
|
||||
cartaAceptacion: {},
|
||||
cartaTermino: {},
|
||||
informeGlobal: {}
|
||||
@@ -133,24 +129,46 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
obtenerRegistro () {
|
||||
this.isLoading = true
|
||||
return axios
|
||||
.get(
|
||||
`${process.env.api}/servicio/admin?idServicio=${this.idServicio}`//,
|
||||
// this.token
|
||||
)
|
||||
.then(res => {
|
||||
this.isLoading = false
|
||||
this.viejo = res.data
|
||||
console.log(this.viejo)
|
||||
})
|
||||
.catch(err => {
|
||||
this.isLoading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
dangerToast () {
|
||||
this.$buefy.toast.open({
|
||||
message: 'Asegurate de ingresar un PDF',
|
||||
type: 'is-danger'
|
||||
})
|
||||
},
|
||||
toast () {
|
||||
this.$buefy.toast.open({
|
||||
message: 'Se han actualizado los datos',
|
||||
type: 'is-success'
|
||||
})
|
||||
},
|
||||
mostrar () {
|
||||
if (
|
||||
validator.isEmail(this.nuevo.correo) ||
|
||||
this.nuevo.direccion ||
|
||||
this.nuevo.telefono ||
|
||||
this.nuevo.fechaNacimientoFinal ||
|
||||
this.nuevo.fechaInicioFinal ||
|
||||
this.nuevo.fechaFinFinal ||
|
||||
(this.nuevo.fechaInicioFinal &&
|
||||
this.nuevo.fechaFinFinal) ||
|
||||
this.nuevo.cartaTermino.name ||
|
||||
this.nuevo.cartaAceptacion.name ||
|
||||
this.nuevo.informeGlobal.name ||
|
||||
this.nuevo.idStatus
|
||||
this.nuevo.informeGlobal.name
|
||||
) {
|
||||
if (this.nuevo.correo) {
|
||||
if (validator.isEmail(this.nuevo.correo)) {
|
||||
@@ -183,14 +201,33 @@ export default {
|
||||
}
|
||||
},
|
||||
regresar () {
|
||||
localStorage.removeItem('idRegistro')
|
||||
this.$router.push('/admin/servicio')
|
||||
},
|
||||
actualizar () {
|
||||
this.isLoading = true
|
||||
// const data = {
|
||||
// a: 1
|
||||
// }
|
||||
const data = {}
|
||||
if (this.nuevo.direccion) { data.direccionUpdate = this.nuevo.direccion }
|
||||
if (this.nuevo.correo) { data.correoUpdate = this.nuevo.correo }
|
||||
if (this.nuevo.telefono) { data.telefonoUpdate = this.nuevo.telefono }
|
||||
if (this.nuevo.fechaInicioFinal) { data.fechaInicioUpdate = this.nuevo.fechaInicioFinal }
|
||||
if (this.nuevo.fechaFinFinal) { data.fechaFinUpdate = this.nuevo.fechaFinFinal }
|
||||
if (this.nuevo.fechaNacimientoFinal) { data.fechaNacimientoUpdate = this.nuevo.fechaNacimientoFinal }
|
||||
const formData = new FormData()
|
||||
if (this.cartaAceptacion) { formData.append('cartaAceptacion', this.cartaAceptacion) }
|
||||
if (this.cartaTermino) { formData.append('cartaTermino', this.cartaTermino) }
|
||||
if (this.informeGlobal) { formData.append('informeGlobal', this.informeGlobal) }
|
||||
if (data) { formData.append('data', JSON.stringify(data)) }
|
||||
axios
|
||||
.put(`${process.env.api}/servicio/update`, formData)
|
||||
.then(res => {
|
||||
this.isLoading = false
|
||||
this.$router.push('./')
|
||||
this.toast()
|
||||
})
|
||||
.catch(err => {
|
||||
this.isLoading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
actualizarDialog () {
|
||||
this.$buefy.dialog.confirm({
|
||||
@@ -202,6 +239,12 @@ export default {
|
||||
hasIcon: true,
|
||||
onConfirm: () => this.actualizar()
|
||||
})
|
||||
},
|
||||
fecha (date) {
|
||||
if (date) {
|
||||
const fecha = moment(date.substr(0, 10))
|
||||
return `${fecha.date()}/${fecha.month() + 1}/${fecha.year()}`
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -221,6 +264,9 @@ export default {
|
||||
fechaNacimiento: function () {
|
||||
this.nuevo.fechaNacimientoFinal = moment(this.fechaNacimiento[0])
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.obtenerRegistro()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div class="mb-5">
|
||||
<b-button class="boton is-info" @click="$router.push('./')">
|
||||
<b-button class="boton is-info" @click="regresar()">
|
||||
Regresar
|
||||
</b-button>
|
||||
<b-button class="boton is-info" @click="$router.push('./servicio/modificar')">
|
||||
Editar información
|
||||
</b-button>
|
||||
</div>
|
||||
<div id="Status">
|
||||
<p class="is-size-3" v-if="alumno.Status.idStatus == 1">
|
||||
@@ -51,10 +48,21 @@
|
||||
<p class="is-size-5 mt-5" v-if="alumno.fechaNacimiento"><b>Fecha de nacimiento: </b>{{fecha(alumno.fechaNacimiento)}}</p>
|
||||
</div>
|
||||
<div id="enlaces">
|
||||
<br>
|
||||
<div v-if="alumno.cartaAceptacion" class="level">
|
||||
<a :href="linkCartaAceptacion" class="has-text-link link" target="_blank">Ver carta de aceptación</a>
|
||||
<b-button class="is-danger" v-if="alumno.Status.idStatus == 1" @click="mensajeRechBoolean1 = !mensajeRechBoolean1">
|
||||
<b-button class="boton is-info" @click="$router.push('./servicio/modificar')">
|
||||
Editar información
|
||||
</b-button>
|
||||
<br><br>
|
||||
<h3 class="is-size-4 mb-5" v-if="alumno.Status.idStatus == 1">Confirmar el pre-registro del alumno</h3>
|
||||
<h3 class="is-size-4 mb-5" v-if="alumno.Status.idStatus == 4">Término</h3>
|
||||
<h3 class="is-size-4 mb-5" v-if="alumno.Status.idStatus == 5">Validar el término del alumno</h3>
|
||||
<div v-if="alumno.cartaAceptacion" class="">
|
||||
<span class="spanDoc"><strong>Ver carta de aceptación</strong></span>
|
||||
<a :href="linkCartaAceptacion" target="_blank" >
|
||||
<b-button class="is-info">
|
||||
Ver
|
||||
</b-button>
|
||||
</a>
|
||||
<b-button class="is-danger" v-if="alumno.Status.idStatus == 1 && alumno.cartaAceptacion" @click="mensajeRechBoolean1 = !mensajeRechBoolean1">
|
||||
Rechazar
|
||||
</b-button>
|
||||
</div>
|
||||
@@ -62,17 +70,19 @@
|
||||
<b-input maxlength="500" type="textarea" v-model="mensajeRech1"></b-input>
|
||||
</b-field>
|
||||
<b-button v-if="mensajeRech1 && mensajeRechBoolean1" class="is-danger" @click="rechazarDialog(1)">
|
||||
Cancelar servicio
|
||||
Rechazar documento
|
||||
</b-button>
|
||||
<b-button v-else-if="mensajeRechBoolean1" disabled>
|
||||
Cancelar servicio
|
||||
Rechazar documento
|
||||
</b-button>
|
||||
<h3 class="is-size-4 mb-5" v-if="alumno.Status.idStatus == 1">Confirmar el pre-registro del alumno</h3>
|
||||
<h3 class="is-size-4 mb-5" v-if="alumno.Status.idStatus == 4">Termino</h3>
|
||||
<h3 class="is-size-4 mb-5" v-if="alumno.Status.idStatus == 5">Validar el término del alumno</h3>
|
||||
<div class="level">
|
||||
<a v-if="alumno.cartaTermino" :href="linkCartaTermino" class="has-text-link link">Ver carta de término</a>
|
||||
<b-button class="is-danger" v-if="alumno.Status.idStatus == 5" @click="mensajeRechBoolean2 = !mensajeRechBoolean2">
|
||||
<div v-if="alumno.cartaTermino" style="margin-top: 10px">
|
||||
<span class="spanDoc"><strong>Ver carta de término</strong></span>
|
||||
<a :href="linkCartaTermino" target="_blank" >
|
||||
<b-button class="is-info">
|
||||
Ver
|
||||
</b-button>
|
||||
</a>
|
||||
<b-button class="is-danger" v-if="alumno.Status.idStatus == 5 && alumno.cartaTermino" @click="mensajeRechBoolean2 = !mensajeRechBoolean2">
|
||||
Rechazar
|
||||
</b-button>
|
||||
</div>
|
||||
@@ -80,14 +90,19 @@
|
||||
<b-input maxlength="500" type="textarea" v-model="mensajeRech2"></b-input>
|
||||
</b-field>
|
||||
<b-button v-if="mensajeRech2 && mensajeRechBoolean2" class="is-danger" @click="rechazarDialog(2)">
|
||||
Cancelar servicio
|
||||
Rechazar documento
|
||||
</b-button>
|
||||
<b-button v-else-if="mensajeRechBoolean2" disabled>
|
||||
Cancelar servicio
|
||||
Rechazar documento
|
||||
</b-button>
|
||||
<div v-if="alumno.informeGlobal" class="level">
|
||||
<a :href="linkInformeGlobal" class="has-text-link link">Ver informe global de actividades</a>
|
||||
<b-button class="is-danger" v-if="alumno.Status.idStatus == 5" @click="mensajeRechBoolean3 = !mensajeRechBoolean3">
|
||||
<div v-if="alumno.informeGlobal" style="margin-top: 10px">
|
||||
<span class="spanDoc"><strong>Ver informe global de actividades</strong></span>
|
||||
<a :href="linkInformeGlobal" target="_blank" >
|
||||
<b-button class="is-info">
|
||||
Ver
|
||||
</b-button>
|
||||
</a>
|
||||
<b-button class="is-danger" v-if="alumno.Status.idStatus == 5 && alumno.informeGlobal" @click="mensajeRechBoolean3 = !mensajeRechBoolean3">
|
||||
Rechazar
|
||||
</b-button>
|
||||
</div>
|
||||
@@ -95,10 +110,10 @@
|
||||
<b-input maxlength="500" type="textarea" v-model="mensajeRech3"></b-input>
|
||||
</b-field>
|
||||
<b-button v-if="mensajeRech3 && mensajeRechBoolean3" class="is-danger" @click="rechazarDialog(3)">
|
||||
Cancelar servicio
|
||||
Rechazar documento
|
||||
</b-button>
|
||||
<b-button v-else-if="mensajeRechBoolean3" disabled>
|
||||
Cancelar servicio
|
||||
Rechazar documento
|
||||
</b-button>
|
||||
<b-checkbox
|
||||
v-if="alumno.Programa.acatlan && alumno.Status.idStatus == 5"
|
||||
@@ -112,15 +127,15 @@
|
||||
<p v-if="alumno.cuestionarioA">Cuenta con cuestionario de alumno resuelto.</p>
|
||||
</div>
|
||||
<div id="acciones" class="my-5">
|
||||
<b-button class="is-info" @click="$router.push('./')">
|
||||
<b-button class="is-info" @click="regresar()">
|
||||
Regresar
|
||||
</b-button>
|
||||
<b-button class="is-success" @click="confirmarDialog()" v-if="mostrarConfirmar()">
|
||||
Confirmar
|
||||
</b-button>
|
||||
<b-button class="is-danger" @click="enviarCancel = !enviarCancel">
|
||||
Cancelar
|
||||
</b-button>
|
||||
<b-button class="is-success" @click="confirmarDialog()" v-if="mostrarConfirmar()">
|
||||
Confirmar
|
||||
</b-button>
|
||||
<br><br>
|
||||
<b-field label="Razón para cancelar: " v-if="enviarCancel">
|
||||
<b-input maxlength="500" type="textarea" v-model="mensajeCancel"></b-input>
|
||||
@@ -148,7 +163,7 @@ export default {
|
||||
Carrera: {},
|
||||
Status: {}
|
||||
},
|
||||
idServicio: 1,
|
||||
idServicio: localStorage.getItem('idServicio'),
|
||||
token: {
|
||||
headers: {
|
||||
token: localStorage.getItem('token')
|
||||
@@ -172,27 +187,29 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
mostrarConfirmar () {
|
||||
if (this.alumno.idStatus === 1) return true
|
||||
else if (this.alumno.idStatus === 5) {
|
||||
if (this.alumno.Status.idStatus === 1) return true
|
||||
else if (this.alumno.Status.idStatus === 5) {
|
||||
if (!this.alumno.acatlanContigo) return true
|
||||
else if (this.vistoBueno) return true
|
||||
}
|
||||
return false
|
||||
},
|
||||
obtenerRegistro () {
|
||||
this.isLoading = true
|
||||
return axios
|
||||
.get(
|
||||
`${process.env.api}/servicio/admin?idServicio=${this.idServicio}`//,
|
||||
// this.token
|
||||
)
|
||||
.then(res => {
|
||||
this.isLoading = false
|
||||
this.alumno = res.data
|
||||
|
||||
if (this.alumno.cartaAceptacion) { this.linkCartaAceptacion = `https://drive.google.com/file/d/${this.alumno.cartaAceptacion}/view?usp=sharing` }
|
||||
if (this.alumno.cartaTermino) { this.linkCartaTermino = `https://drive.google.com/file/d/${this.alumno.cartaTermino}/view?usp=sharing` }
|
||||
if (this.alumno.informeGlobal) { this.linkInformeGlobal = `https://drive.google.com/file/d/${this.alumno.informeGlobal}/view?usp=sharing` }
|
||||
})
|
||||
.catch(err => {
|
||||
this.isLoading = false
|
||||
console.log(err.response)
|
||||
})
|
||||
},
|
||||
@@ -329,8 +346,8 @@ export default {
|
||||
.then(res => {
|
||||
this.isLoading = false
|
||||
this.$buefy.dialog.alert('El servicio ha sido aprovado')
|
||||
// localStorage.removeItem('idRegistro')
|
||||
// this.$router.push('/admin')
|
||||
localStorage.removeItem('idRegistro')
|
||||
this.$router.push('/admin')
|
||||
})
|
||||
.catch(e => {
|
||||
this.isLoading = false
|
||||
@@ -349,10 +366,13 @@ export default {
|
||||
ariaRole: 'alertdialog',
|
||||
ariaModal: true
|
||||
})
|
||||
},
|
||||
regresar () {
|
||||
this.$router.push('./')
|
||||
localStorage.removeItem('idServicio')
|
||||
}
|
||||
},
|
||||
async created () {
|
||||
// this.idRegistro = localStorage.getItem('idRegistro')
|
||||
await this.obtenerRegistro()
|
||||
}/* ,
|
||||
beforeCreate () {
|
||||
@@ -377,5 +397,8 @@ export default {
|
||||
font-size: 20px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.spanDoc {
|
||||
margin-right: 5%;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
+3
-3
@@ -51,9 +51,9 @@ export default {
|
||||
build: {
|
||||
},
|
||||
env: {
|
||||
//api: 'http://localhost:3000'
|
||||
api: 'https://dc97624524b5.ngrok.io'
|
||||
//api: 'https//venus.acatlan.unam.mx/pruebas_pcpuma'
|
||||
// api: 'http://localhost:3000'
|
||||
api: 'https://6fcf0b54e39d.ngrok.io'
|
||||
// api: 'https//venus.acatlan.unam.mx/pruebas_pcpuma'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<p class="is-size-2">Editar información del responsable</p>
|
||||
<b-field label="Nombre">
|
||||
<b-input
|
||||
type="email"
|
||||
v-model="nuevo.nombre"
|
||||
:placeholder="viejo.nombre">
|
||||
</b-input>
|
||||
</b-field>
|
||||
<b-field label="Correo eletrónico">
|
||||
<b-input
|
||||
type="email"
|
||||
v-model="nuevo.correo"
|
||||
:placeholder="viejo.correo">
|
||||
</b-input>
|
||||
</b-field>
|
||||
<b-loading :is-full-page="true" v-model="isLoading" :can-cancel="true"></b-loading>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
viejo: {
|
||||
nombre: 'Marco',
|
||||
correo: 'correo1@gmail.com'
|
||||
},
|
||||
nuevo: {},
|
||||
idServicio: localStorage.getItem('idServicio'),
|
||||
isLoading: false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -44,7 +44,7 @@ export default {
|
||||
{ id: 2, programa: 'programa 2', institucion: 'institucion falsa 2', dependencia: 'dependencia falsa 2', clave: 102 },
|
||||
{ id: 3, programa: 'programa 3', institucion: 'institucion falsa 3', dependencia: 'dependencia falsa 3', clave: 103 }
|
||||
],
|
||||
selected: {} | null
|
||||
selected: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
Reference in New Issue
Block a user