Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Zapiony/PUCE_UZDI_2026/llms.txt

Use this file to discover all available pages before exploring further.

The Reportes module is the analytical hub of UZDI, providing coordinators and administrators with live statistical and operational summaries drawn directly from the adolescentes and expedientes registered in the system. Every figure rendered in a report reflects the current state of the database — no stale snapshots. The module is accessible at /app/reportes and is restricted to users holding the Coordinador role or above (tppr_id >= 2).
Technicians are redirected automatically. Users with tppr_id = 1 (Técnico) cannot access the Reportes module. The router guard detects the insufficient role on navigation and redirects them to /app/dashboard.

Report Types

UZDI supports five distinct report types. Each type computes a tailored set of summary statistics and indicator rows from the live API data.

Estadístico general

Aggregate overview across all registered records: total adolescentes, expedientes en proceso, expedientes con alerta (atraso o incomparecencia), and global totals. The default report when no type is selected.

Adolescentes activos

Breakdown of the current adolescent population: total registered, reincidentes, and age-range distribution split between 14–15 and 16–17 years.

Medidas socioeducativas

Distribution of socio-educational measures by type and status. Shows how many expedientes are en proceso, en atraso, or in incomparecencia, with a ranked frequency table of measure types.

Expedientes

Case-file status summary: total count, in-process, upcoming expirations at 7-day and 30-day horizons, and already-expired records. Computed from fecha_fin_medida on each expediente.

Revisiones y seguimiento

Revision schedule view: cases expiring within 7 days (urgent), expiring within 30 days, already overdue (vencidos), and cases that have no expiration date registered yet.

Filters

Before generating a report, configure the parameters in the Configuración del reporte panel at the top of the page. All filter fields are optional except Tipo de reporte.
FieldDescriptionDefault
Tipo de reporte (required)Selects which of the five report templates to compute
PeríodoTime granularity selector: Mensual, Trimestral, Semestral, AnualMensual
Zona / UZDIFilters results to a specific UZDI office; populated dynamically from the catalogueAll zones
Fecha desdeStart of the date range (ISO date picker)Current month start
Fecha hastaEnd of the date range (ISO date picker)Today
Formato de salidaOutput format: PDF or ExcelPDF
Use the Limpiar button to reset all filter fields and the generated report back to the empty state. This is useful when switching between report types without stale parameters carrying over.
Once the desired parameters are set, click Generar reporte. The button is disabled while the API data is loading (Cargando datos…). After generation the report title bar shows the active zone, period, and date range at a glance.

Exporting Reports

Two export actions appear in the top-right corner of the generated report card.

PDF

Clicking the PDF button calls window.print(), which opens the native browser print dialog. The report layout is optimised for print; use Save as PDF in the print destination to produce a portable file.
// ReportesView.vue — descargarPDF
function descargarPDF() {
  window.print()
}
The print dialog will render the full report card as it appears on screen, including the summary stat cards and the indicator table. For best results, set the paper orientation to Landscape and disable browser headers/footers.

Excel

Clicking the Excel button triggers a mock export notice in the current implementation. Full spreadsheet generation requires a dedicated backend reporting endpoint.
// ReportesView.vue — exportarExcel
function exportarExcel() {
  alert('Exportación Excel requiere integración backend de reportes.')
}
Excel export is not yet implemented. The button serves as a placeholder. Integration with a server-side export service (e.g. ExcelJS or a NestJS streaming endpoint) is required to produce real .xlsx files.

Report Rendering

ReportesView.vue fetches adolescente and expediente data on mount and computes all statistics inline — no separate chart or table sub-components are imported into this view. The generated report renders two sections directly in the template:
  • Stat cards — four colour-coded cards (blue, green, amber, red/slate) whose values and labels are computed per report type by the reporteData computed property.
  • Indicator table — rows with an indicador label and a right-aligned valor count, also derived from reporteData.
The reporteData computed property switches on form.tipo to return the correct { stats, filas } shape for each of the five report types.

Empty State

If Generar reporte has not yet been clicked, the view renders an empty-state card with the message:
“Configure los parámetros para generar el reporte — Seleccione el tipo de reporte y haga clic en Generar reporte.”
If the report is generated but the system has no adolescentes or expedientes loaded yet, the indicator table renders:
“Sin datos para mostrar. Registre adolescentes y expedientes primero.”
This ensures the module gracefully handles a freshly seeded or empty database without throwing errors.

Build docs developers (and LLMs) love