forked from TDTP/admin_transporte_frontend
Agrega Validaciones a Carga GTFS y define rutas de informes
parent
8e7168fbe4
commit
181806faf2
|
@ -22,6 +22,8 @@
|
|||
let location = useLocation()
|
||||
let loading = false;
|
||||
let showUpload = null;
|
||||
let baseUrlInforme = window.location.origin;
|
||||
|
||||
getPermisosPath($location.pathname)
|
||||
.then(data => escritura = data.escritura)
|
||||
.catch(error => console.log({ error }))
|
||||
|
@ -70,6 +72,11 @@
|
|||
.finally(() => loading = false)
|
||||
}
|
||||
|
||||
function reporteErroresCargaGTFS (id_red, id_gtfs){
|
||||
const url = new URL(`reporte/gtfs/reporte_${id_red}_${id_gtfs}.pdf`, baseUrlInforme);
|
||||
window.open(url.href, '_blank');
|
||||
}
|
||||
|
||||
function adjustDateTimeByOffset(isoString) {
|
||||
// Extraer la fecha, la hora y el desplazamiento de zona horaria
|
||||
const [datePart, timePart] = isoString.split('T');
|
||||
|
@ -180,7 +187,20 @@
|
|||
{/if}
|
||||
</td>
|
||||
<td>{adjustDateTimeByOffset(app.created)}</td>
|
||||
<td>{app.status}</td>
|
||||
|
||||
<td >
|
||||
{#if app.status.toUpperCase().includes('CON REPAROS')}
|
||||
<!-- Elemento interactivo para usuarios con 'CON REPAROS' en el estado -->
|
||||
|
||||
<a href={"#"} on:click|preventDefault={() => reporteErroresCargaGTFS(id_red, app.id_gtfs)}>
|
||||
{app.status}</a>
|
||||
|
||||
{:else}
|
||||
<!-- Solo texto para estados sin 'CON REPAROS' -->
|
||||
{app.status}
|
||||
{/if}
|
||||
</td>
|
||||
|
||||
<td>{app.valid_from}</td>
|
||||
<td>{app.vigente ? '✅':'🚫'}</td>
|
||||
</tr>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
export let loading = false;
|
||||
|
||||
let operadores = [];
|
||||
|
||||
let baseUrl = window.location.origin;
|
||||
getOperadores({ vigente: 1 })
|
||||
.then(data => data.sort((a, b) => a.nombre_operador < b.nombre_operador ? -1 : 1))
|
||||
.then(data => operadores = data)
|
||||
|
@ -20,16 +20,17 @@
|
|||
}
|
||||
|
||||
function abrirReporteItinerario() {
|
||||
if (!validarOperadorSeleccionado()) return;
|
||||
const url = `${window.location.href}/reporte_itinerarios_${id_operador}.pdf`;
|
||||
window.open(url, '_blank');
|
||||
if (!validarOperadorSeleccionado()) return;
|
||||
const url = new URL(`reporte/itinerarios/${id_operador}.pdf`, baseUrl);
|
||||
window.open(url.href, '_blank');
|
||||
}
|
||||
|
||||
function abrirReporteExpediciones() {
|
||||
if (!validarOperadorSeleccionado()) return;
|
||||
const fecha = new Date().toISOString().slice(0, 10).replace(/-/g, '');
|
||||
const url = `${window.location.href}/reporte_expediciones_${id_operador}_${fecha}.pdf`;
|
||||
window.open(url, '_blank');
|
||||
//const url = `${window.location.href}reporte/expediciones/${id_operador}_${fecha}.pdf`;
|
||||
const url = new URL(`reporte/expediciones/${id_operador}_${fecha}.pdf`, baseUrl);
|
||||
window.open(url.href, '_blank');
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in New Issue