This commit is contained in:
Lizandro Guarnizo
2026-06-16 19:54:04 -05:00
parent 8128616b63
commit c58998599b
5 changed files with 247 additions and 0 deletions
+36
View File
@@ -930,6 +930,9 @@ function renderHistorialTimeline(turnos, total) {
en_recepcion: 'background:#dbeafe;color:#1e40af',
espera: 'background:#fef9c3;color:#78350f',
};
const CONS_ICON = {
pendiente: '📋', enviado: '📤', visto: '👁', firmado: '✅', rechazado: '❌'
};
const totalLabel = total > turnos.length ? `<div class="text-end px-3 pb-1" style="font-size:.67rem;color:#94a3b8">Mostrando ${turnos.length} de ${total} visitas</div>` : '';
const items = turnos.map(t => {
const color = t.prioridad_color || '#6366f1';
@@ -939,6 +942,38 @@ function renderHistorialTimeline(turnos, total) {
const eStyle = ESTADO_STYLE[est] || 'background:#f1f5f9;color:#334155';
const eLbl = ESTADO_LBL[est] || est;
const mins = t.servicio_min != null ? `<span style="font-size:.65rem;color:#94a3b8;margin-left:4px">${t.servicio_min} min</span>` : '';
// Exámenes
let examStr = '';
if (t.examenes && t.examenes.length) {
examStr = `<div style="margin-top:6px;font-size:.75rem">
<strong style="color:#64748b">Exámenes:</strong>
<div style="color:#475569">${t.examenes.map(e => escHtml(e.nombre)).join(', ')}</div>
</div>`;
}
// Consentimientos
let consStr = '';
if (t.consentimientos && t.consentimientos.length) {
consStr = `<div style="margin-top:6px;font-size:.75rem">
<strong style="color:#64748b">Consentimientos:</strong>
<div>${t.consentimientos.map(c =>
`<span style="display:inline-block;margin-right:6px">${CONS_ICON[c.estado]||'?'} ${escHtml(c.nombre||'Consentimiento')}</span>`
).join('')}</div>
</div>`;
}
// Comentarios
let comStr = '';
if (t.comentarios && t.comentarios.length) {
comStr = `<div style="margin-top:6px;font-size:.72rem;border-top:1px solid #e2e8f0;padding-top:6px">
<strong style="color:#64748b">📝 Últimos comentarios:</strong>
<div style="color:#475569;margin-top:4px">${t.comentarios.map(c =>
`<div style="margin-bottom:3px"><strong>${escHtml(c.usuario_nombre)}</strong>: ${escHtml(c.comentario)}</div>`
).join('')}</div>
</div>`;
}
return `<div class="timeline-item">
<div class="timeline-dot" style="color:${color};background:${color}"></div>
<div class="timeline-content">
@@ -946,6 +981,7 @@ function renderHistorialTimeline(turnos, total) {
<div class="timeline-codigo" style="color:${color}">${escHtml(t.codigo)}</div>
<div class="timeline-lugar">${lugar}</div>
<span class="timeline-eb" style="${eStyle}">${escHtml(eLbl)}</span>${mins}
${examStr}${consStr}${comStr}
</div>
</div>`;
}).join('');