Preinscripción en Línea
Completa tu preinscripción de manera virtual y segura
@@ -272,7 +272,14 @@ const store = useWebAdmisionStore()
const resultadosStore = useProcesoAdmisionResultadoStore()
const router = useRouter()
-const hayResultados = computed(() => resultadosStore.archivos.length > 0)
+const tieneResultados = (proceso) =>
+ (resultadosStore.archivosPorProceso[proceso.id]?.length ?? 0) > 0
+
+const mostrarPreinscripcion = (proceso) => {
+ if (!proceso.link_preinscripcion) return false
+ if (tieneResultados(proceso)) return false
+ return new Date() <= new Date(proceso.fecha_fin_inscripcion)
+}
const emit = defineEmits(["show-modal", "open-preinscripcion"])
@@ -280,8 +287,10 @@ const modalVisible = ref(false)
const detallesSeleccionados = ref([])
const tituloModal = ref("")
-onMounted(() => {
- store.cargarProcesos()
+onMounted(async () => {
+ await store.cargarProcesos()
+ const ids = store.procesos.map(p => p.id)
+ if (ids.length) resultadosStore.fetchArchivosMultiples(ids)
})
const formatFecha = (fecha) => {
diff --git a/front/src/components/WebPageSections/HeroSection.vue b/front/src/components/WebPageSections/HeroSection.vue
index 5546700..8d1533f 100644
--- a/front/src/components/WebPageSections/HeroSection.vue
+++ b/front/src/components/WebPageSections/HeroSection.vue
@@ -53,7 +53,7 @@
Resultados del:
webStore.procesoPrincipal)
-const hayResultados = computed(() => resultadosStore.archivos.length > 0)
-const hayExamen1 = computed(() => {
- return resultadosStore.archivos.some(a => a.orden === 1 || a.orden === 2)
-})
-
-const hayExamen2 = computed(() => {
- return resultadosStore.archivos.some(a => a.orden === 5 || a.orden === 6)
-})
+const todosLosArchivos = computed(() =>
+ Object.values(resultadosStore.archivosPorProceso).flat()
+)
+const hayResultados = computed(() => todosLosArchivos.value.length > 0)
+
+// Proceso cuyas fechas se muestran en la card
+const procesoFechas = computed(() =>
+ webStore.procesos.find(p => p.fecha_examen1) ?? procesoPrincipal.value
+)
+const hayExamen1 = computed(() =>
+ todosLosArchivos.value.some(a => a.orden === 1 || a.orden === 2)
+)
+const hayExamen2 = computed(() =>
+ todosLosArchivos.value.some(a => a.orden === 5 || a.orden === 6)
+)
const fechasExamen = computed(() => {
- const p = procesoPrincipal.value
+ const p = procesoFechas.value
if (!p) return []
const fmt = (iso) => {
@@ -149,10 +156,8 @@ onMounted(async () => {
if (!webStore.procesos.length) {
await webStore.cargarProcesos()
}
- const proceso = procesoPrincipal.value
- if (proceso?.id) {
- await resultadosStore.fetchArchivosPublico(proceso.id)
- }
+ const ids = webStore.procesos.map(p => p.id)
+ if (ids.length) await resultadosStore.fetchArchivosMultiples(ids)
})
defineEmits(["scroll-to-convocatoria", "virtual-tour"])
diff --git a/front/src/components/WebPageSections/navbarcontent/ProcesoResultado.vue b/front/src/components/WebPageSections/navbarcontent/ProcesoResultado.vue
index d0805dc..acf6141 100644
--- a/front/src/components/WebPageSections/navbarcontent/ProcesoResultado.vue
+++ b/front/src/components/WebPageSections/navbarcontent/ProcesoResultado.vue
@@ -10,26 +10,21 @@ const webStore = useWebAdmisionStore()
const resultadosStore = useProcesoAdmisionResultadoStore()
onMounted(async () => {
-
if (!webStore.procesos.length) {
await webStore.cargarProcesos()
}
-
- const proceso = webStore.procesoPrincipal
-
- if (proceso?.id) {
- await resultadosStore.fetchArchivosPublico(proceso.id)
- }
-
+ const ids = webStore.procesos.map(p => p.id)
+ if (ids.length) await resultadosStore.fetchArchivosMultiples(ids)
})
-
-const archivosExamen1 = computed(() =>
- resultadosStore.archivos.filter(a => [1,2,3,4].includes(a.orden))
-)
-
-const archivosExamen2 = computed(() =>
- resultadosStore.archivos.filter(a => [5,6].includes(a.orden))
+const procesosConResultados = computed(() =>
+ webStore.procesos
+ .map(p => ({
+ proceso: p,
+ examen1: (resultadosStore.archivosPorProceso[p.id] ?? []).filter(a => [1,2,3,4].includes(a.orden)),
+ examen2: (resultadosStore.archivosPorProceso[p.id] ?? []).filter(a => [5,6].includes(a.orden)),
+ }))
+ .filter(item => item.examen1.length || item.examen2.length)
)
@@ -44,7 +39,7 @@ const archivosExamen2 = computed(() =>
-
+
Resultados próximamente.
@@ -71,139 +66,91 @@ const archivosExamen2 = computed(() =>
- Resultados disponibles — {{ webStore.procesoPrincipal?.titulo }}
+ Resultados disponibles.
-
-
-
-