Se agregaron nuevas funcionalidades
This commit is contained in:
@@ -22,6 +22,11 @@ interface Usuario {
|
||||
idUsuario?: number;
|
||||
usuario?: string;
|
||||
nombre?: string;
|
||||
/*
|
||||
"cartaAceptacion": "1NzEg5DRbIOdBi_P9IbjJoFUOAW7kRnKp",
|
||||
"cartaTermino": "1xRycJEyO19tvNpwd4jbw9OMbZInxcJeY",
|
||||
"informeGlobal": "1XvEUa6Zqi0giX9zo9myFEWVoZgdVhlOQ",
|
||||
*/
|
||||
}
|
||||
|
||||
interface Carrera {
|
||||
@@ -82,6 +87,21 @@ interface Datos {
|
||||
fechaRegistro?: string;
|
||||
fechaInicio?: string;
|
||||
fechaTermino?: string;
|
||||
/*
|
||||
|
||||
|
||||
cartaAceptacion?: boolean;
|
||||
cartaTermino?: boolean;
|
||||
informreGlobal?: boolean;
|
||||
*/
|
||||
cartaAceptacion?: string;
|
||||
cartaTermino?: string;
|
||||
informeGlobal?: string;
|
||||
|
||||
idCuestionarioPrograma?: number;
|
||||
idCuestionarioPrograma2?: number;
|
||||
idCuestionarioAlumno?: number;
|
||||
idCuestionarioAlumno2?: number;
|
||||
}
|
||||
|
||||
export default function Servicio() {
|
||||
@@ -111,9 +131,18 @@ export default function Servicio() {
|
||||
}, []);
|
||||
|
||||
// Función para imprimir errores
|
||||
const imprimirError = (msg: string) => {
|
||||
console.error(msg);
|
||||
alert(`Error: ${msg}`);
|
||||
const imprimirError = (error: unknown) => {
|
||||
alert(`❌ Error: ${JSON.stringify(error)}`);
|
||||
}
|
||||
|
||||
const imprimirMensaje = (message: string) => {
|
||||
alert(`✅ ${message}`);
|
||||
};
|
||||
|
||||
const imprimirWarning = (message: string, onConfirm: () => void) => {
|
||||
if (confirm(`⚠️ ${message}\n¿Deseas continuar?`)) {
|
||||
onConfirm();
|
||||
}
|
||||
};
|
||||
|
||||
// Función para actualizar el estado de carga
|
||||
@@ -209,11 +238,8 @@ export default function Servicio() {
|
||||
<section className="container px-2 pb-6">
|
||||
<BotonRegresar />
|
||||
|
||||
{/*
|
||||
<h3 className="title">{alumno.Status?.status}</h3>
|
||||
*/}
|
||||
|
||||
|
||||
<h3 className="title">{datos.Status?.status}</h3>
|
||||
|
||||
<InformacionServicio
|
||||
datos={datos}
|
||||
admin={admin}
|
||||
@@ -223,48 +249,91 @@ export default function Servicio() {
|
||||
|
||||
<TituloStatus status={datos.Status}/>
|
||||
|
||||
{/*
|
||||
{/* Para mostrar si tiene la carta y poder ver los diferentes archivos */}
|
||||
{datos.cartaAceptacion && (
|
||||
<Archivo
|
||||
title={datos.cartaAceptacion ? "carta de aceptación" : ""}
|
||||
datos={datos}
|
||||
admin={admin}
|
||||
imprimirMensaje={imprimirMensaje}
|
||||
imprimirWarning={imprimirWarning}
|
||||
updateIsLoading={updateIsLoading}
|
||||
imprimirError={imprimirError}
|
||||
/>
|
||||
)}
|
||||
|
||||
{datos.cartaTermino && (
|
||||
<Archivo
|
||||
title={datos.cartaTermino ? "carta de término" : ""}
|
||||
datos={datos}
|
||||
admin={admin}
|
||||
imprimirMensaje={imprimirMensaje}
|
||||
imprimirWarning={imprimirWarning}
|
||||
updateIsLoading={updateIsLoading}
|
||||
imprimirError={imprimirError}
|
||||
/>
|
||||
)}
|
||||
|
||||
{datos.informeGlobal && (
|
||||
<Archivo
|
||||
title={datos.informeGlobal ? "informe global" : ""}
|
||||
datos={datos}
|
||||
admin={admin}
|
||||
imprimirMensaje={imprimirMensaje}
|
||||
imprimirWarning={imprimirWarning}
|
||||
updateIsLoading={updateIsLoading}
|
||||
imprimirError={imprimirError}
|
||||
/>
|
||||
)}
|
||||
|
||||
<div>
|
||||
{datos.idCuestionarioPrograma || datos.idCuestionarioPrograma2 ? (
|
||||
<p className="my-4">
|
||||
<strong>Cuenta con cuestionario de programa resuelto.</strong>
|
||||
</p>
|
||||
) : null}
|
||||
|
||||
{datos.idCuestionarioAlumno || datos.idCuestionarioAlumno2 ? (
|
||||
<p className="my-4">
|
||||
<strong>Cuenta con cuestionario de alumno resuelto.</strong>
|
||||
</p>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
<ConfirmarServicio
|
||||
idServicio={idServicio ?? 0}
|
||||
admin={admin}
|
||||
datos={datos}
|
||||
imprimirMensaje={imprimirMensaje}
|
||||
imprimirWarning={imprimirWarning}
|
||||
imprimirError={imprimirError}
|
||||
updateIsLoading={updateIsLoading}
|
||||
/>
|
||||
|
||||
<CancelarServicio
|
||||
idServicio={idServicio ?? 0}
|
||||
admin={admin}
|
||||
datos={datos}
|
||||
imprimirMensaje={imprimirMensaje}
|
||||
imprimirWarning={imprimirWarning}
|
||||
imprimirError={imprimirError}
|
||||
updateIsLoading={updateIsLoading}
|
||||
/>
|
||||
|
||||
|
||||
|
||||
{alumno.cartaAceptacion && (
|
||||
<Archivo
|
||||
|
||||
imprimirMensaje={imprimirMensaje}
|
||||
imprimirWarning={imprimirWarning}
|
||||
|
||||
updateIsLoading={updateIsLoading}
|
||||
alumno={alumno}
|
||||
title="carta de aceptación"
|
||||
/>
|
||||
)}
|
||||
|
||||
{alumno.cartaTermino && (
|
||||
<Archivo
|
||||
admin={admin}
|
||||
imprimirMensaje={imprimirMensaje}
|
||||
imprimirWarning={imprimirWarning}
|
||||
imprimirError={imprimirError}
|
||||
updateIsLoading={updateIsLoading}
|
||||
alumno={alumno}
|
||||
title="carta de término"
|
||||
/>
|
||||
)}
|
||||
|
||||
{alumno.informeGlobal && (
|
||||
<Archivo
|
||||
admin={admin}
|
||||
imprimirMensaje={imprimirMensaje}
|
||||
imprimirWarning={imprimirWarning}
|
||||
imprimirError={imprimirError}
|
||||
updateIsLoading={updateIsLoading}
|
||||
alumno={alumno}
|
||||
title="informe global"
|
||||
/>
|
||||
)}
|
||||
*/}
|
||||
|
||||
{/*
|
||||
|
||||
codigo de vue
|
||||
<div>
|
||||
<p v-if="alumno.idCuestionarioPrograma || alumno.idCuestionarioPrograma2" class="my-4">
|
||||
<strong> Cuenta con cuestionario de programa resuelto. </strong>
|
||||
</p>
|
||||
|
||||
<p v-if="alumno.idCuestionarioAlumno || alumno.idCuestionarioAlumno2" class="my-4">
|
||||
<strong> Cuenta con cuestionario de alumno resuelto. </strong>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{alumno.idCuestionarioPrograma || alumno.idCuestionarioPrograma2 ? (
|
||||
<p className="my-4">
|
||||
|
||||
@@ -13,19 +13,43 @@ interface Status {
|
||||
interface Alumno {
|
||||
idServicio: number;
|
||||
Status: Status;
|
||||
/*
|
||||
cartaAceptacion?: string;
|
||||
cartaTermino?: string;
|
||||
informeGlobal?: string;
|
||||
*/
|
||||
}
|
||||
|
||||
interface Datos {
|
||||
idServicio?: number;
|
||||
//Programa?: Programa
|
||||
//Carrera?: Carrera;
|
||||
//Usuario?: Usuario;
|
||||
Status?: Status;
|
||||
creditos?: string;
|
||||
correo?: string;
|
||||
fechaRegistro?: string;
|
||||
fechaInicio?: string;
|
||||
fechaTermino?: string;
|
||||
/*
|
||||
cartaAceptacion?: string;
|
||||
cartaTermino?: string;
|
||||
informeGlobal?: string;
|
||||
*/
|
||||
cartaAceptacion?: string;
|
||||
cartaTermino?: string;
|
||||
informeGlobal?: string;
|
||||
}
|
||||
|
||||
interface Admin {
|
||||
token: { headers: Record<string, string> };
|
||||
//token: { headers: Record<string, string> };
|
||||
token?: string;
|
||||
}
|
||||
|
||||
interface Props {
|
||||
title: string;
|
||||
admin: Admin;
|
||||
alumno: Alumno;
|
||||
datos: Datos;
|
||||
imprimirError: (err: unknown) => void;
|
||||
imprimirMensaje: (msg: string) => void;
|
||||
imprimirWarning: (msg: string, onConfirm: () => void) => void;
|
||||
@@ -44,7 +68,7 @@ interface RechazarData {
|
||||
export default function Archivo({
|
||||
title,
|
||||
admin,
|
||||
alumno,
|
||||
datos,
|
||||
imprimirError,
|
||||
imprimirMensaje,
|
||||
imprimirWarning,
|
||||
@@ -62,11 +86,11 @@ export default function Archivo({
|
||||
const archivo = (): string | undefined => {
|
||||
switch (title) {
|
||||
case "carta de aceptación":
|
||||
return alumno.cartaAceptacion;
|
||||
return datos.cartaAceptacion;
|
||||
case "carta de termino":
|
||||
return alumno.cartaTermino;
|
||||
return datos.cartaTermino;
|
||||
case "informe global":
|
||||
return alumno.informeGlobal;
|
||||
return datos.informeGlobal;
|
||||
default:
|
||||
return undefined;
|
||||
}
|
||||
@@ -90,7 +114,7 @@ export default function Archivo({
|
||||
funcRechazar: (data: RechazarData) => Promise<AxiosResponse<ApiResponse>>
|
||||
) => {
|
||||
const data: RechazarData = {
|
||||
idServicio: alumno.idServicio,
|
||||
idServicio: datos.idServicio!,
|
||||
mensaje: mensajeRechazo,
|
||||
};
|
||||
|
||||
@@ -112,66 +136,66 @@ export default function Archivo({
|
||||
};
|
||||
|
||||
const rechazarCartaAceptacion = (data: RechazarData) =>
|
||||
axiosInstance.put(`/servicio/rechazar_aceptacion`, data, admin.token);
|
||||
axiosInstance.put(`/servicio/rechazar_aceptacion`, data);
|
||||
|
||||
const rechazarCartaTermino = (data: RechazarData) =>
|
||||
axiosInstance.put(`/servicio/rechazar_termino`, data, admin.token);
|
||||
axiosInstance.put(`/servicio/rechazar_termino`, data);
|
||||
|
||||
const rechazarInformeGlobal = (data: RechazarData) =>
|
||||
axiosInstance.put(`/servicio/rechazar_informe`, data, admin.token);
|
||||
axiosInstance.put(`/servicio/rechazar_informe`, data);
|
||||
|
||||
return (
|
||||
<div className="mb-4">
|
||||
<div className="flex items-center">
|
||||
<h6 className="pr-4 text-lg">Ver {title}</h6>
|
||||
<div className="flex items-center">
|
||||
<h6 className="pr-4 text-lg">Ver {title}</h6>
|
||||
|
||||
<div className="pr-4">
|
||||
<a
|
||||
className="btn btn-link btn-light"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
href={`https://drive.google.com/file/d/${archivo()}/view?usp=sharing`}
|
||||
>
|
||||
Ver
|
||||
</a>
|
||||
<div className="pr-4">
|
||||
<a
|
||||
className="btn btn-link btn-light"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
href={`https://drive.google.com/file/d/${archivo()}/view?usp=sharing`}
|
||||
>
|
||||
Ver
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{((datos.Status?.idStatus === 1 && title === "carta de aceptación") ||
|
||||
(datos.Status?.idStatus === 5 &&
|
||||
(title === "carta de termino" || title === "informe global"))) && (
|
||||
<button
|
||||
className="btn btn-danger"
|
||||
onClick={updateRechazar}
|
||||
>
|
||||
Rechazar
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{((alumno.Status.idStatus === 1 && title === "carta de aceptación") ||
|
||||
(alumno.Status.idStatus === 5 &&
|
||||
(title === "carta de termino" || title === "informe global"))) && (
|
||||
<button
|
||||
className="btn btn-danger"
|
||||
onClick={updateRechazar}
|
||||
>
|
||||
Rechazar
|
||||
</button>
|
||||
{rechazar && (
|
||||
<div className="mt-2">
|
||||
<label>Razón del rechazo:</label>
|
||||
<textarea
|
||||
maxLength={500}
|
||||
value={mensajeRechazo}
|
||||
onChange={(e) => setMensajeRechazo(e.target.value)}
|
||||
className="form-control"
|
||||
/>
|
||||
|
||||
<button
|
||||
className="btn btn-link"
|
||||
disabled={!mensajeRechazo}
|
||||
onClick={() =>
|
||||
imprimirWarning(
|
||||
"¿Seguro(a) que quiere rechazar este documento?",
|
||||
rechazarArchivo
|
||||
)
|
||||
}
|
||||
>
|
||||
Rechazar {title}
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{rechazar && (
|
||||
<div className="mt-2">
|
||||
<label>Razón del rechazo:</label>
|
||||
<textarea
|
||||
maxLength={500}
|
||||
value={mensajeRechazo}
|
||||
onChange={(e) => setMensajeRechazo(e.target.value)}
|
||||
className="form-control"
|
||||
/>
|
||||
|
||||
<button
|
||||
className="btn btn-link"
|
||||
disabled={!mensajeRechazo}
|
||||
onClick={() =>
|
||||
imprimirWarning(
|
||||
"¿Seguro(a) que quiere rechazar este documento?",
|
||||
rechazarArchivo
|
||||
)
|
||||
}
|
||||
>
|
||||
Rechazar {title}
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,13 +14,41 @@ interface Alumno {
|
||||
}
|
||||
|
||||
interface Admin {
|
||||
token: { headers: Record<string, string> };
|
||||
//token: { headers: Record<string, string> };
|
||||
token?: string;
|
||||
}
|
||||
|
||||
interface Datos {
|
||||
//Programa?: Programa;
|
||||
//Carrera?: Carrera;
|
||||
//Usuario?: Usuario;
|
||||
Status?: Status;
|
||||
creditos?: string;
|
||||
correo?: string;
|
||||
fechaRegistro?: string;
|
||||
fechaInicio?: string;
|
||||
fechaTermino?: string;
|
||||
/*
|
||||
|
||||
|
||||
cartaAceptacion?: boolean;
|
||||
cartaTermino?: boolean;
|
||||
informreGlobal?: boolean;
|
||||
*/
|
||||
cartaAceptacion?: string;
|
||||
cartaTermino?: string;
|
||||
informeGlobal?: string;
|
||||
|
||||
idCuestionarioPrograma?: number;
|
||||
idCuestionarioPrograma2?: number;
|
||||
idCuestionarioAlumno?: number;
|
||||
idCuestionarioAlumno2?: number;
|
||||
}
|
||||
|
||||
interface Props {
|
||||
idServicio: number;
|
||||
admin: Admin;
|
||||
alumno: Alumno;
|
||||
datos: Datos;
|
||||
imprimirError: (err: unknown) => void;
|
||||
imprimirMensaje: (msg: string) => void;
|
||||
imprimirWarning: (msg: string, onConfirm: () => void) => void;
|
||||
@@ -30,7 +58,7 @@ interface Props {
|
||||
export default function CancelarServicio({
|
||||
idServicio,
|
||||
admin,
|
||||
alumno,
|
||||
datos,
|
||||
imprimirError,
|
||||
imprimirMensaje,
|
||||
imprimirWarning,
|
||||
@@ -49,17 +77,17 @@ export default function CancelarServicio({
|
||||
const data = { idServicio, mensaje: mensajeCancelar };
|
||||
|
||||
try {
|
||||
updateIsLoading(true);
|
||||
const res = await axiosInstance.put(`/servicio/cancelar`, data, admin.token);
|
||||
localStorage.removeItem("idServicio");
|
||||
imprimirMensaje(res.data.message);
|
||||
router.push("/admin");
|
||||
} catch (err: unknown) {
|
||||
if (isAxiosError(err)) imprimirError(err.response?.data || err.message);
|
||||
else if (err instanceof Error) imprimirError(err.message);
|
||||
else imprimirError(err);
|
||||
} finally {
|
||||
updateIsLoading(false);
|
||||
updateIsLoading(true);
|
||||
const res = await axiosInstance.put(`/servicio/cancelar`, data);
|
||||
localStorage.removeItem("idServicio");
|
||||
imprimirMensaje(res.data.message);
|
||||
router.push("/admin");
|
||||
} catch (err: unknown) {
|
||||
if (isAxiosError(err)) imprimirError(err.response?.data || err.message);
|
||||
else if (err instanceof Error) imprimirError(err.message);
|
||||
else imprimirError(err);
|
||||
} finally {
|
||||
updateIsLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -67,10 +95,10 @@ export default function CancelarServicio({
|
||||
<div className="mt-5 space-y-4">
|
||||
{/* Botón de Cancelar */}
|
||||
<button
|
||||
disabled={alumno.Status.idStatus === 6 || alumno.Status.idStatus === 10}
|
||||
disabled={datos.Status?.idStatus === 6 || datos.Status?.idStatus === 10}
|
||||
onClick={updateCancelar}
|
||||
className={`px-4 py-2 rounded text-white ${
|
||||
alumno.Status.idStatus === 6 || alumno.Status.idStatus === 10
|
||||
datos.Status?.idStatus === 6 || datos.Status?.idStatus === 10
|
||||
? "bg-gray-400 cursor-not-allowed"
|
||||
: "bg-red-600 hover:bg-red-700"
|
||||
}`}
|
||||
|
||||
@@ -41,12 +41,14 @@ export default function CargaMasiva({datos}: {datos: CargaMasivaProps}) {
|
||||
Authorization: `Bearer ${datos.admin.tokenArchivo}`,
|
||||
},
|
||||
})
|
||||
console.log('Respuesta de carga masiva:', res.data)
|
||||
//updateIsLoading(false)
|
||||
//ImprimirMensaje(res.data.message)
|
||||
router.push("/admin")
|
||||
router.push("/administrador/responsables")
|
||||
} catch (error) {
|
||||
//updateIsLoading(false)
|
||||
//imprimirError(error.response.data || error)
|
||||
console.log('Error en carga masiva:', error)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import { isAxiosError } from 'axios';
|
||||
import { axiosInstance } from '@/api/config';
|
||||
import type { AxiosResponse } from 'axios';
|
||||
import { useRouter } from "next/navigation";
|
||||
import { Carrera, Usuario } from "@/types/responses";
|
||||
|
||||
interface Status {
|
||||
idStatus: number;
|
||||
@@ -18,13 +19,41 @@ interface Alumno {
|
||||
}
|
||||
|
||||
interface Admin {
|
||||
token: { headers: Record<string, string> };
|
||||
//token: { headers: Record<string, string> };
|
||||
token?: string;
|
||||
}
|
||||
|
||||
interface Datos {
|
||||
Programa?: Programa;
|
||||
//Carrera?: Carrera;
|
||||
//Usuario?: Usuario;
|
||||
Status?: Status;
|
||||
creditos?: string;
|
||||
correo?: string;
|
||||
fechaRegistro?: string;
|
||||
fechaInicio?: string;
|
||||
fechaTermino?: string;
|
||||
/*
|
||||
|
||||
|
||||
cartaAceptacion?: boolean;
|
||||
cartaTermino?: boolean;
|
||||
informreGlobal?: boolean;
|
||||
*/
|
||||
cartaAceptacion?: string;
|
||||
cartaTermino?: string;
|
||||
informeGlobal?: string;
|
||||
|
||||
idCuestionarioPrograma?: number;
|
||||
idCuestionarioPrograma2?: number;
|
||||
idCuestionarioAlumno?: number;
|
||||
idCuestionarioAlumno2?: number;
|
||||
}
|
||||
|
||||
interface Props {
|
||||
idServicio: number;
|
||||
admin: Admin;
|
||||
alumno: Alumno;
|
||||
datos: Datos;
|
||||
imprimirError: (err: unknown) => void;
|
||||
imprimirMensaje: (msg: string) => void;
|
||||
imprimirWarning: (msg: string, onConfirm: () => void) => void;
|
||||
@@ -45,7 +74,7 @@ interface ApiResponse {
|
||||
export default function ConfirmarServicio({
|
||||
idServicio,
|
||||
admin,
|
||||
alumno,
|
||||
datos,
|
||||
imprimirError,
|
||||
imprimirMensaje,
|
||||
imprimirWarning,
|
||||
@@ -55,8 +84,8 @@ export default function ConfirmarServicio({
|
||||
const router = useRouter();
|
||||
|
||||
const confirmarServicio = () => {
|
||||
if (alumno.Status.idStatus === 1) confirmar(confirmarPreRegistro);
|
||||
else if (alumno.Status.idStatus === 5) confirmar(confirmarLiberacion);
|
||||
if (datos.Status?.idStatus === 1) confirmar(confirmarPreRegistro);
|
||||
else if (datos.Status?.idStatus === 5) confirmar(confirmarLiberacion);
|
||||
};
|
||||
|
||||
const confirmar = async (
|
||||
@@ -82,16 +111,16 @@ export default function ConfirmarServicio({
|
||||
};
|
||||
|
||||
const confirmarPreRegistro = (data: ConfirmarData) =>
|
||||
axiosInstance.put<ApiResponse>(`/servicio/registro`, data, admin.token);
|
||||
axiosInstance.put<ApiResponse>(`/servicio/registro`, data);
|
||||
|
||||
const confirmarLiberacion = (data: ConfirmarData) => {
|
||||
if (vistoBuenoAcatlan) data.vistoBuenoAcatlan = vistoBuenoAcatlan;
|
||||
return axiosInstance.put<ApiResponse>(`/servicio/liberacion`, data, admin.token);
|
||||
return axiosInstance.put<ApiResponse>(`/servicio/liberacion`, data);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
{alumno.Status.idStatus === 5 && alumno.Programa.acatlan && (
|
||||
{datos.Status?.idStatus === 5 && datos.Programa?.acatlan && (
|
||||
<div className="flex items-center space-x-2">
|
||||
<input
|
||||
type="checkbox"
|
||||
@@ -106,11 +135,11 @@ export default function ConfirmarServicio({
|
||||
</div>
|
||||
)}
|
||||
|
||||
{(alumno.Status.idStatus === 1 || alumno.Status.idStatus === 5) && (
|
||||
{(datos.Status?.idStatus === 1 || datos.Status?.idStatus === 5) && (
|
||||
<button
|
||||
disabled={
|
||||
alumno.Status.idStatus === 5 &&
|
||||
alumno.Programa.acatlan &&
|
||||
datos.Status?.idStatus === 5 &&
|
||||
datos.Programa?.acatlan &&
|
||||
!vistoBuenoAcatlan
|
||||
}
|
||||
onClick={() =>
|
||||
@@ -120,8 +149,8 @@ export default function ConfirmarServicio({
|
||||
)
|
||||
}
|
||||
className={`px-4 py-2 rounded text-white ${
|
||||
alumno.Status.idStatus === 5 &&
|
||||
alumno.Programa.acatlan &&
|
||||
datos.Status?.idStatus === 5 &&
|
||||
datos.Programa?.acatlan &&
|
||||
!vistoBuenoAcatlan
|
||||
? "bg-gray-400 cursor-not-allowed"
|
||||
: "bg-green-600 hover:bg-green-700"
|
||||
|
||||
@@ -47,10 +47,15 @@ interface Datos {
|
||||
fechaLiberacion?: string;
|
||||
telefono?: string;
|
||||
direccion?: string;
|
||||
cartaaceptacion?: boolean;
|
||||
cartatermino?: boolean;
|
||||
/*
|
||||
cartaAceptacion?: boolean;
|
||||
cartaTermino?: boolean;
|
||||
informeGlobal?: boolean;
|
||||
programainterno?: boolean;
|
||||
*/
|
||||
cartaAceptacion?: string;
|
||||
cartaTermino?: string;
|
||||
informeGlobal?: string;
|
||||
programaInterno?: boolean;
|
||||
profesor?: string;
|
||||
vistoBuenoAcatlan?: boolean;
|
||||
idCuestionarioPrograma?: number;
|
||||
@@ -206,7 +211,7 @@ export default function InformacionServicio({ admin, imprimirError, updateIsLoad
|
||||
|
||||
<div className="mb-3">
|
||||
<label className="form-label fw-semibold">Programa Interno:</label>
|
||||
<p className="form-control">{datos.programainterno}</p>
|
||||
<p className="form-control">{datos.programaInterno}</p>
|
||||
</div>
|
||||
|
||||
<div className="mb-3">
|
||||
|
||||
@@ -25,6 +25,7 @@ type Alumno = {
|
||||
creditos?: number | string;
|
||||
nombre?: string;
|
||||
idCarrera?: number;
|
||||
carrera?: string;
|
||||
};
|
||||
|
||||
interface Props {
|
||||
@@ -201,7 +202,7 @@ export default function NuevoServicio({
|
||||
|
||||
<div className="mb-3">
|
||||
<label className="form-label">Carrera</label>
|
||||
<p className="input">{alumno.idCarrera ? String(alumno.idCarrera) : ''}</p>
|
||||
<p className="input">{alumno.carrera ? String(alumno.carrera) : ''}</p>
|
||||
</div>
|
||||
|
||||
<div className="mb-3">
|
||||
|
||||
@@ -63,9 +63,11 @@ export default function TablaServiciosResponsable({ responsable, imprimirError }
|
||||
|
||||
const obtenerCatalogoStatus = async () => {
|
||||
try {
|
||||
const headers = responsable?.token ? { Authorization: `Bearer ${responsable.token}` } : undefined;
|
||||
const res = await axiosInstance.get<StatusItem[]>(`/status`, { headers });
|
||||
//const headers = responsable?.token ? { Authorization: `Bearer ${responsable.token}` } : undefined;
|
||||
const res = await axiosInstance.get<StatusItem[]>('/status');
|
||||
setStatus(res.data);
|
||||
console.log(res.data);
|
||||
console.log('Status obtenidos', status);
|
||||
obtenerServicios();
|
||||
} catch (err: unknown) {
|
||||
const axiosErr = err as AxiosError;
|
||||
|
||||
Reference in New Issue
Block a user