mensaje cuestionarios

This commit is contained in:
2020-12-09 18:14:13 -06:00
parent f72423d206
commit 95fee3520e
2 changed files with 168 additions and 164 deletions
+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>
+2 -2
View File
@@ -47,8 +47,8 @@ export default {
build: {},
env: {
// api: 'http://localhost:3000'
// api: "https://venus.acatlan.unam.mx/ss-pruebas",
api: "https://03a9bde77357.ngrok.io",
api: "https://venus.acatlan.unam.mx/ss-pruebas",
//api: "https://03a9bde77357.ngrok.io",
// api: 'https//venus.acatlan.unam.mx/pruebas_pcpuma'
}
}