This commit is contained in:
Lemuel Marquez
2020-12-09 18:29:19 -06:00
4 changed files with 200 additions and 212 deletions
@@ -44,7 +44,7 @@
@page-change="onPageChange"
>
<b-table-column field="nombre" label="Nombre" v-slot="props" centered>
<span @click="verRegistro(props.row.usuario)">{{
<span @click="verRegistro(props.row)">{{
props.row.nombre
}}</span>
</b-table-column>
@@ -54,7 +54,7 @@
v-slot="props"
centered
>
<span @click="verRegistro(props.row.usuario)">{{
<span @click="verRegistro(props.row)">{{
props.row.usuario
}}</span>
</b-table-column>
@@ -91,7 +91,7 @@ export default {
this.data = [];
axios
.get(
`${process.env.api}/usuario/responsable?idUsuario=${this.idUsuario}&pagina=${this.page}&nombre=${this.nombre}&correo=${this.correo}`
`${process.env.api}/usuario/responsable?pagina=${this.page}&nombre=${this.nombre}&correo=${this.correo}`
)
.then((res) => {
const servicios = res.data.servicios;
@@ -121,8 +121,10 @@ export default {
insertIdLocal() {
this.idUsuario = localStorage.getItem("idUsuario");
},
verRegistro(correoResponsable) {
localStorage.setItem("correo", correoResponsable);
verRegistro(responsable) {
localStorage.setItem("correo", responsable.usuario);
localStorage.setItem("idResponsable", responsable.idUsuario);
localStorage.setItem("nombre", responsable.nombre);
this.$router.push("./infoResponsable");
},
},
+166 -162
View File
@@ -198,11 +198,15 @@
>
Visto bueno Acatlán
</b-checkbox>
<p v-if="alumno.cuestionarioP">
Cuenta con cuestionario de programa resuelto.
<p v-if="alumno.idCuestionarioPrograma" class="my-4">
<strong>
Cuenta con cuestionario de programa resuelto.
</strong>
</p>
<p v-if="alumno.cuestionarioA">
Cuenta con cuestionario de alumno resuelto.
<p v-if="alumno.idCuestionarioAlumno" class="my-4">
<strong>
Cuenta con cuestionario de alumno resuelto.
</strong>
</p>
</div>
<div id="acciones" class="my-5">
@@ -258,276 +262,276 @@
</template>
<script>
import axios from 'axios'
import moment from 'moment'
import axios from "axios";
import moment from "moment";
export default {
data () {
data() {
return {
alumno: {
Programa: {},
Usuario: {},
Carrera: {},
Status: {}
Status: {},
},
idServicio: localStorage.getItem('idServicio'),
idServicio: localStorage.getItem("idServicio"),
token: {
headers: {
token: localStorage.getItem('token')
}
token: localStorage.getItem("token"),
},
},
linkCartaAceptacion: '',
linkCartaTermino: '',
linkInformeGlobal: '',
linkCartaAceptacion: "",
linkCartaTermino: "",
linkInformeGlobal: "",
enviarMensaje: false,
enviarCancel: false,
mensaje: '',
mensajeCancel: '',
mensaje: "",
mensajeCancel: "",
isLoading: false,
mensajeRech1: '',
mensajeRech2: '',
mensajeRech3: '',
mensajeRech1: "",
mensajeRech2: "",
mensajeRech3: "",
mensajeRechBoolean1: false,
mensajeRechBoolean2: false,
mensajeRechBoolean3: false
}
mensajeRechBoolean3: false,
};
},
methods: {
mostrarConfirmar1 () {
if (this.alumno.Status.idStatus === 1) return true
return false
mostrarConfirmar1() {
if (this.alumno.Status.idStatus === 1) return true;
return false;
},
mostrarConfirmar2 () {
mostrarConfirmar2() {
if (this.alumno.Status.idStatus === 5) {
if (!this.alumno.acatlanContigo) return true
else if (this.alumno.vistoBueno) return true
if (!this.alumno.acatlanContigo) return true;
else if (this.alumno.vistoBueno) return true;
}
return false
return false;
},
obtenerRegistro () {
this.isLoading = true
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
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`
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`
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`
this.linkInformeGlobal = `https://drive.google.com/file/d/${this.alumno.informeGlobal}/view?usp=sharing`;
}
})
.catch((err) => {
this.isLoading = false
console.log(err.response)
})
this.isLoading = false;
console.log(err.response);
});
},
cancelarDialog () {
cancelarDialog() {
this.$buefy.dialog.confirm({
title: 'Cancelar sevicio',
message: '¿Seguro(a) que quiere cancelar este servicio?',
confirmText: 'Cancelar servicio',
cancelText: 'No',
type: 'is-danger',
title: "Cancelar sevicio",
message: "¿Seguro(a) que quiere cancelar este servicio?",
confirmText: "Cancelar servicio",
cancelText: "No",
type: "is-danger",
hasIcon: true,
onConfirm: () => this.cancelar()
})
onConfirm: () => this.cancelar(),
});
},
confirmarDialog (a) {
confirmarDialog(a) {
this.$buefy.dialog.confirm({
title: 'Confimar servicio',
message: '¿Seguro(a) que quiere confirmar este servicio?',
confirmText: 'Confirmar',
cancelText: 'Cancelar',
type: 'is-success',
title: "Confimar servicio",
message: "¿Seguro(a) que quiere confirmar este servicio?",
confirmText: "Confirmar",
cancelText: "Cancelar",
type: "is-success",
hasIcon: true,
onConfirm: () => {
switch (a) {
case 1:
this.confirmarRegistro()
break
this.confirmarRegistro();
break;
case 2:
this.confirmarTermino()
break
this.confirmarTermino();
break;
}
}
})
},
});
},
rechazarDialog (num) {
const doc = num
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',
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
this.rechazarCartaAceptacion();
break;
case 2:
this.rechazarCartaTermino()
break
this.rechazarCartaTermino();
break;
case 3:
this.rechazarInformeGlobal()
this.rechazarInformeGlobal();
}
}
})
},
});
},
rechazarCartaAceptacion () {
this.isLoading = true
rechazarCartaAceptacion() {
this.isLoading = true;
const data = {
mensaje: this.mensajeRech1,
idServicio: this.idServicio
}
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('./')
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)
})
this.isLoading = false;
this.error();
console.log(err);
});
},
rechazarCartaTermino () {
this.isLoading = true
rechazarCartaTermino() {
this.isLoading = true;
const data = {
mensaje: this.mensajeRech2,
idServicio: this.idServicio
}
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('./')
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)
})
this.isLoading = false;
this.error();
console.log(err);
});
},
rechazarInformeGlobal () {
this.isLoading = true
rechazarInformeGlobal() {
this.isLoading = true;
const data = {
mensaje: this.mensajeRech3,
idServicio: this.idServicio
}
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('./')
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)
})
this.isLoading = false;
this.error();
console.log(err);
});
},
cancelar () {
this.isLoading = true
cancelar() {
this.isLoading = true;
const data = {
idServicio: this.idServicio,
mensaje: this.mensajeCancel
}
mensaje: this.mensajeCancel,
};
axios
.put(`${process.env.api}/servicio/cancelar`, data)
.then((res) => {
this.isLoading = false
this.$buefy.dialog.alert('El servicio ha sido cancelado con éxito')
localStorage.removeItem('idServicio')
this.$router.push('./')
this.isLoading = false;
this.$buefy.dialog.alert("El servicio ha sido cancelado con éxito");
localStorage.removeItem("idServicio");
this.$router.push("./");
})
.catch((err) => {
this.isLoading = false
this.error()
console.log(err)
})
this.isLoading = false;
this.error();
console.log(err);
});
},
fecha (date) {
const fecha = moment(date.substr(0, 10))
return `${fecha.date()}/${fecha.month() + 1}/${fecha.year()}`
fecha(date) {
const fecha = moment(date.substr(0, 10));
return `${fecha.date()}/${fecha.month() + 1}/${fecha.year()}`;
},
confirmarRegistro () {
this.isLoading = true
confirmarRegistro() {
this.isLoading = true;
const data = {
idServicio: this.idServicio
}
idServicio: this.idServicio,
};
axios
.put(`${process.env.api}/servicio/registro`, data)
.then((res) => {
this.isLoading = false
this.$buefy.dialog.alert('El servicio ha sido aprovado')
localStorage.removeItem('idServicio')
this.$router.push('/admin')
this.isLoading = false;
this.$buefy.dialog.alert("El servicio ha sido aprovado");
localStorage.removeItem("idServicio");
this.$router.push("/admin");
})
.catch((e) => {
this.isLoading = false
console.log(e)
this.error()
})
this.isLoading = false;
console.log(e);
this.error();
});
},
confirmarLiberacion () {
this.isLoading = true
confirmarLiberacion() {
this.isLoading = true;
const data = {
idServicio: this.idServicio
}
idServicio: this.idServicio,
};
if (this.alumno.vistoBueno) {
data.vistoBueno = this.alumno.vistoBueno
data.vistoBueno = this.alumno.vistoBueno;
}
axios
.put(`${process.env.api}/servicio/liberacion`, data)
.then((res) => {
this.isLoading = false
this.$buefy.dialog.alert('El servicio ha sido liberado')
localStorage.removeItem('idServicio')
this.$router.push('/admin')
this.isLoading = false;
this.$buefy.dialog.alert("El servicio ha sido liberado");
localStorage.removeItem("idServicio");
this.$router.push("/admin");
})
.catch((e) => {
this.isLoading = false
console.log(e)
this.error()
})
this.isLoading = false;
console.log(e);
this.error();
});
},
error () {
error() {
this.$buefy.dialog.alert({
title: 'Error',
message: 'Ha ocurrido un <b>error</b>, inténtalo de nuevo más tarde',
type: 'is-danger',
title: "Error",
message: "Ha ocurrido un <b>error</b>, inténtalo de nuevo más tarde",
type: "is-danger",
hasIcon: true,
icon: 'times-circle',
iconPack: 'fa',
ariaRole: 'alertdialog',
ariaModal: true
})
icon: "times-circle",
iconPack: "fa",
ariaRole: "alertdialog",
ariaModal: true,
});
},
regresar() {
this.$router.push("./");
localStorage.removeItem("idServicio");
},
regresar () {
this.$router.push('./')
localStorage.removeItem('idServicio')
}
},
async created () {
await this.obtenerRegistro()
async created() {
await this.obtenerRegistro();
} /* ,
beforeCreate () {
if (!localStorage.getItem('idServicio')) { this.$router.push('./admin') }
} */
}
} */,
};
</script>
<style scoped>
+1 -1
View File
@@ -48,7 +48,7 @@ export default {
env: {
// api: 'http://localhost:3000'
api: "https://venus.acatlan.unam.mx/ss-pruebas",
// api: "https://03a9bde77357.ngrok.io",
//api: "https://03a9bde77357.ngrok.io",
// api: 'https//venus.acatlan.unam.mx/pruebas_pcpuma'
}
}
+26 -44
View File
@@ -4,8 +4,8 @@
Regresar
</b-button>
<p class="is-size-2 mb-4">Información del responsable</p>
<p class="is-size-4 mb-4">Nombre: {{ responsable.nombre }}</p>
<p class="is-size-4 mb-4">Correo: {{ responsable.correo }}</p>
<p class="is-size-4 mb-4">Nombre: {{ nombre }}</p>
<p class="is-size-4 mb-4">Correo: {{ correo }}</p>
<p class="is-size-4">Programa:</p>
<b-select v-model="selected" placeholder="Elija un programa">
<option
@@ -18,16 +18,18 @@
</b-select>
<p class="is-size-4 mb-4">Institución: {{ selected.institucion }}</p>
<p class="is-size-4 mb-4">Dependencia: {{ selected.dependencia }}</p>
<p class="is-size-4 mb-4">Clave: {{ selected.clave }}</p>
<b-button class="boton is-info my-5" @click="$router.push('./')">
<p class="is-size-4 mb-4">Clave: {{ selected.clavePrograma }}</p>
<div class="">
<b-button
class="boton is-info my-5"
@click="$router.push('./infoResponsable/edit')"
>
Editar información
</b-button>
</div>
<b-button class="boton is-info my-5" @click="regresar()">
Regresar
</b-button>
<b-button
class="boton is-info my-5"
@click="$router.push('./infoResponsable/editar')"
>
Editar información
</b-button>
</div>
</template>
@@ -37,54 +39,27 @@ export default {
data() {
return {
idResponsable: localStorage.getItem("idResponsable"),
responsable: {
nombre: "Marco",
correo: "marco@gmail.com",
},
programas: [
{
id: 1,
programa: "programa 1",
institucion: "institucion falsa 1",
dependencia: "dependencia falsa 1",
clave: 101,
},
{
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,
},
],
correo: localStorage.getItem('correo'),
nombre: localStorage.getItem('nombre'),
programas: [],
selected: {},
};
},
methods: {
obtenerDatos() {
obtenerProgramas () {
return axios
.get(
// aun no hay back
`${process.env.api}/servicio/admin?idResponsable=${this.idResponsable}` //,
// this.token
`${process.env.api}/programa?idUsuario=${this.idResponsable}` //,this.token
)
.then((res) => {
this.responsable = res.data;
this.programas = res.data.programas;
this.programas = res.data
})
.catch((err) => {
this.error();
console.log(err.response);
});
},
error () {
error() {
this.$buefy.dialog.alert({
title: "Error",
message: "Ha ocurrido un <b>error</b>, inténtalo de nuevo más tarde",
@@ -96,6 +71,13 @@ export default {
ariaModal: true,
});
},
regresar() {
this.$router.push("./");
localStorage.removeItem("correo");
},
},
created () {
this.obtenerProgramas()
}
};
</script>