Componente documento
This commit is contained in:
@@ -0,0 +1,152 @@
|
||||
<template>
|
||||
<div>
|
||||
<span class="spanDoc"
|
||||
><strong>{{ title }}</strong></span
|
||||
>
|
||||
<a :href="link" target="_blank">
|
||||
<b-button class="is-info">
|
||||
Ver
|
||||
</b-button>
|
||||
</a>
|
||||
<b-button
|
||||
class="is-danger"
|
||||
v-if="esRechazable()"
|
||||
@click="mensajeBool = !mensajeBool"
|
||||
>
|
||||
Rechazar
|
||||
</b-button>
|
||||
<b-field label="Razón del rechazo: " v-if="mensajeBool">
|
||||
<b-input maxlength="500" type="textarea" v-model="mensajeRech"></b-input>
|
||||
</b-field>
|
||||
<b-button
|
||||
v-if="mensajeRech && mensajeBool"
|
||||
class="is-danger"
|
||||
@click="rechazarDialog()"
|
||||
>
|
||||
Rechazar documento
|
||||
</b-button>
|
||||
<b-button v-else-if="mensajeBool" disabled>
|
||||
Rechazar documento
|
||||
</b-button>
|
||||
<b-loading
|
||||
:is-full-page="true"
|
||||
v-model="isLoading"
|
||||
:can-cancel="false"
|
||||
></b-loading>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from "axios";
|
||||
export default {
|
||||
props: {
|
||||
title: String,
|
||||
link: String,
|
||||
idDoc: Number,
|
||||
doc: Object,
|
||||
status: Number,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
mensajeRech: "",
|
||||
mensajeBool: false,
|
||||
idServicio: localStorage.getItem("idServicio"),
|
||||
isLoading: false,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
esRechazable() {
|
||||
switch (this.idDoc) {
|
||||
case 1:
|
||||
if (this.status == 1) return true;
|
||||
else return false;
|
||||
case 2:
|
||||
if (this.status == 5) return true;
|
||||
else return false;
|
||||
case 3:
|
||||
if (this.status == 5) return true;
|
||||
else return false;
|
||||
}
|
||||
},
|
||||
rechazarDialog() {
|
||||
this.$buefy.dialog.confirm({
|
||||
title: "Confimar servicio",
|
||||
message: "¿Seguro(a) que quiere rechazar este documento?",
|
||||
confirmText: "Confirmar",
|
||||
cancelText: "Cancelar",
|
||||
type: "is-danger",
|
||||
hasIcon: true,
|
||||
onConfirm: () => {
|
||||
switch (this.idDoc) {
|
||||
case 1:
|
||||
this.rechazarCartaAceptacion();
|
||||
break;
|
||||
case 2:
|
||||
this.rechazarCartaTermino();
|
||||
break;
|
||||
case 3:
|
||||
this.rechazarInformeGlobal();
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
rechazarCartaAceptacion() {
|
||||
this.isLoading = true;
|
||||
const data = {
|
||||
mensaje: this.mensajeRech,
|
||||
idServicio: this.idServicio,
|
||||
};
|
||||
axios
|
||||
.put(`${process.env.api}/servicio/rechazar_aceptacion`, data)
|
||||
.then((res) => {
|
||||
this.isLoading = false;
|
||||
this.$buefy.dialog.alert("Se ha rechazado el documento");
|
||||
this.$router.push("/admin");
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoading = false;
|
||||
this.error();
|
||||
console.log(err);
|
||||
});
|
||||
},
|
||||
rechazarCartaTermino() {
|
||||
this.isLoading = true;
|
||||
const data = {
|
||||
mensaje: this.mensajeRech,
|
||||
idServicio: this.idServicio,
|
||||
};
|
||||
axios
|
||||
.put(`${process.env.api}/servicio/rechazar_termino`, data)
|
||||
.then((res) => {
|
||||
this.isLoading = false;
|
||||
this.$buefy.dialog.alert("Se ha rechazado el documento");
|
||||
this.$router.push("/admin");
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoading = false;
|
||||
this.error();
|
||||
console.log(err);
|
||||
});
|
||||
},
|
||||
rechazarInformeGlobal() {
|
||||
this.isLoading = true;
|
||||
const data = {
|
||||
mensaje: this.mensajeRech,
|
||||
idServicio: this.idServicio,
|
||||
};
|
||||
axios
|
||||
.put(`${process.env.api}/servicio/rechazar_informe`, data)
|
||||
.then((res) => {
|
||||
this.isLoading = false;
|
||||
this.$buefy.dialog.alert("Se ha rechazado el documento");
|
||||
this.$router.push("/admin");
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoading = false;
|
||||
this.error();
|
||||
console.log(err);
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -5,17 +5,9 @@
|
||||
Regresar
|
||||
</b-button>
|
||||
</div>
|
||||
<!--Componente titulo-->
|
||||
<TituloServicio :status="alumno.Status.idStatus" />
|
||||
<!--Componente programa-->
|
||||
<DatosPrograma :programa="alumno.Programa" />
|
||||
<!--Componente datosPersonales, alumno-->
|
||||
<DatosPersonales :alumno="alumno" />
|
||||
<!--Componente Enlaces
|
||||
alumno.Status.idStatus
|
||||
alumno.cartaAceptacion
|
||||
linkCartaAceptacion
|
||||
-->
|
||||
<div id="enlaces">
|
||||
<b-button
|
||||
class="boton is-info"
|
||||
@@ -25,104 +17,33 @@
|
||||
</b-button>
|
||||
<br /><br />
|
||||
<TituloStatus :status="alumno.Status.idStatus" />
|
||||
<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 v-if="alumno.cartaAceptacion">
|
||||
<Documento
|
||||
:title="'Ver carta de aceptación'"
|
||||
:link="linkCartaAceptacion"
|
||||
:doc="alumno.cartaAceptacion"
|
||||
:idDoc="1"
|
||||
:status="alumno.Status.idStatus"
|
||||
/>
|
||||
</div>
|
||||
<b-field label="Razón del rechazo: " v-if="mensajeRechBoolean1">
|
||||
<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)"
|
||||
>
|
||||
Rechazar documento
|
||||
</b-button>
|
||||
<b-button v-else-if="mensajeRechBoolean1" disabled>
|
||||
Rechazar documento
|
||||
</b-button>
|
||||
<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 v-if="alumno.cartaTermino" style="margin-top: 10px">
|
||||
<Documento
|
||||
:title="'Ver carta de término'"
|
||||
:link="linkCartaTermino"
|
||||
:doc="alumno.cartaTermino"
|
||||
:idDoc="2"
|
||||
:status="alumno.Status.idStatus"
|
||||
/>
|
||||
</div>
|
||||
<b-field label="Razón del rechazo: " v-if="mensajeRechBoolean2">
|
||||
<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)"
|
||||
>
|
||||
Rechazar documento
|
||||
</b-button>
|
||||
<b-button v-else-if="mensajeRechBoolean2" disabled>
|
||||
Rechazar documento
|
||||
</b-button>
|
||||
<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>
|
||||
<Documento
|
||||
:title="'Ver informe global de actividades'"
|
||||
:link="linkInformeGlobal"
|
||||
:doc="alumno.InformeGlobal"
|
||||
:idDoc="3"
|
||||
:status="alumno.Status.idStatus"
|
||||
/>
|
||||
</div>
|
||||
<b-field label="Razón del rechazo: " v-if="mensajeRechBoolean3">
|
||||
<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)"
|
||||
>
|
||||
Rechazar documento
|
||||
</b-button>
|
||||
<b-button v-else-if="mensajeRechBoolean3" disabled>
|
||||
Rechazar documento
|
||||
</b-button>
|
||||
<b-checkbox
|
||||
v-if="alumno.Programa.acatlan && alumno.Status.idStatus == 5"
|
||||
v-model="alumno.vistoBuenoAcatlan"
|
||||
@@ -186,7 +107,7 @@
|
||||
<b-loading
|
||||
:is-full-page="true"
|
||||
v-model="isLoading"
|
||||
:can-cancel="true"
|
||||
:can-cancel="false"
|
||||
></b-loading>
|
||||
</div>
|
||||
</div>
|
||||
@@ -198,6 +119,7 @@ import tituloServicio from "./tituloServicio";
|
||||
import tituloStatus from "./tituloStatus";
|
||||
import datosPrograma from "./datosPrograma";
|
||||
import datosPersonales from "./datosPersonales";
|
||||
import documento from './documento'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -205,6 +127,7 @@ export default {
|
||||
datosPrograma,
|
||||
datosPersonales,
|
||||
tituloStatus,
|
||||
documento
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -228,12 +151,6 @@ export default {
|
||||
mensaje: "",
|
||||
mensajeCancel: "",
|
||||
isLoading: false,
|
||||
mensajeRech1: "",
|
||||
mensajeRech2: "",
|
||||
mensajeRech3: "",
|
||||
mensajeRechBoolean1: false,
|
||||
mensajeRechBoolean2: false,
|
||||
mensajeRechBoolean3: false,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@@ -305,86 +222,6 @@ export default {
|
||||
},
|
||||
});
|
||||
},
|
||||
rechazarDialog(num) {
|
||||
const doc = num;
|
||||
this.$buefy.dialog.confirm({
|
||||
title: "Confimar servicio",
|
||||
message: "¿Seguro(a) que quiere rechazar este documento?",
|
||||
confirmText: "Confirmar",
|
||||
cancelText: "Cancelar",
|
||||
type: "is-dnager",
|
||||
hasIcon: true,
|
||||
onConfirm: () => {
|
||||
switch (doc) {
|
||||
case 1:
|
||||
this.rechazarCartaAceptacion();
|
||||
break;
|
||||
case 2:
|
||||
this.rechazarCartaTermino();
|
||||
break;
|
||||
case 3:
|
||||
this.rechazarInformeGlobal();
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
rechazarCartaAceptacion() {
|
||||
this.isLoading = true;
|
||||
const data = {
|
||||
mensaje: this.mensajeRech1,
|
||||
idServicio: this.idServicio,
|
||||
};
|
||||
axios
|
||||
.put(`${process.env.api}/servicio/rechazar_aceptacion`, data)
|
||||
.then((res) => {
|
||||
this.isLoading = false;
|
||||
this.$buefy.dialog.alert("Se ha rechazado el documento");
|
||||
this.$router.push("./");
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoading = false;
|
||||
this.error();
|
||||
console.log(err);
|
||||
});
|
||||
},
|
||||
rechazarCartaTermino() {
|
||||
this.isLoading = true;
|
||||
const data = {
|
||||
mensaje: this.mensajeRech2,
|
||||
idServicio: this.idServicio,
|
||||
};
|
||||
axios
|
||||
.put(`${process.env.api}/servicio/rechazar_termino`, data)
|
||||
.then((res) => {
|
||||
this.isLoading = false;
|
||||
this.$buefy.dialog.alert("Se ha rechazado el documento");
|
||||
this.$router.push("./");
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoading = false;
|
||||
this.error();
|
||||
console.log(err);
|
||||
});
|
||||
},
|
||||
rechazarInformeGlobal() {
|
||||
this.isLoading = true;
|
||||
const data = {
|
||||
mensaje: this.mensajeRech3,
|
||||
idServicio: this.idServicio,
|
||||
};
|
||||
axios
|
||||
.put(`${process.env.api}/servicio/rechazar_informe`, data)
|
||||
.then((res) => {
|
||||
this.isLoading = false;
|
||||
this.$buefy.dialog.alert("Se ha rechazado el documento");
|
||||
this.$router.push("./");
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoading = false;
|
||||
this.error();
|
||||
console.log(err);
|
||||
});
|
||||
},
|
||||
cancelar() {
|
||||
this.isLoading = true;
|
||||
const data = {
|
||||
@@ -466,8 +303,7 @@ export default {
|
||||
async created() {
|
||||
await this.obtenerRegistro();
|
||||
},
|
||||
beforeCreate() {
|
||||
}
|
||||
beforeCreate() {},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user