turnero: renombrar estado 'rechazada' → 'Pendiente' en UI

Muestra que el paciente trae después no se muestra como rechazo.
Colores rojo → naranja, botón/etiqueta/íconos actualizados en lugar.php y bandeja.php.
DB/API internos sin cambio (enum 'rechazada' se mantiene).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-07-27 22:08:41 -05:00
co-authored by Claude Sonnet 4.6
parent 045fd64113
commit 80b61f88be
2 changed files with 11 additions and 11 deletions
+2 -2
View File
@@ -220,7 +220,7 @@ Layout::open('Bandeja del día', 'fas fa-layer-group');
.bnd-m-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.bnd-m-dot.pendiente { background: #f59e0b; }
.bnd-m-dot.recibida { background: #22c55e; }
.bnd-m-dot.rechazada { background: #ef4444; }
.bnd-m-dot.rechazada { background: #f97316; }
.bnd-m-label { font-weight: 600; color: #1e293b; }
.bnd-m-estado { color: #64748b; font-size: 0.74rem; }
.bnd-m-rechazado { color: #ef4444; font-size: 0.72rem; }
@@ -592,7 +592,7 @@ function _renderDetalle(d) {
secM += `<div class="bnd-muestra">
<div class="bnd-m-dot ${m.estado}"></div>
<span class="bnd-m-label">${m.tipo_muestra}</span>
<span class="bnd-m-estado">${m.estado}${m.recibida_at?' · '+_hora(m.recibida_at):''}</span>
<span class="bnd-m-estado">${m.estado==='rechazada'?'Pendiente':m.estado}${m.recibida_at?' · '+_hora(m.recibida_at):''}</span>
${rechazo}
</div>`;
});
+9 -9
View File
@@ -502,7 +502,7 @@ try {
}
.muestra-row.pendiente { background: #fffbeb; border-color: #fde68a; }
.muestra-row.recibida { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.muestra-row.rechazada { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
.muestra-row.rechazada { background: #fff7ed; border-color: #fed7aa; color: #c2410c; }
.muestra-info { flex: 1; min-width: 0; }
.muestra-label { font-weight: 600; font-size: .82rem; font-family: monospace; }
.muestra-motivo { font-size: .7rem; margin-top: 2px; opacity: .85; }
@@ -515,7 +515,7 @@ try {
}
.btn-muestra-accion:active { opacity: .75; }
.btn-muestra-accion.recibir { background: #16a34a; color: #fff; }
.btn-muestra-accion.rechazar { background: #fff; color: #991b1b; border: 1.5px solid #fca5a5; }
.btn-muestra-accion.rechazar { background: #fff; color: #c2410c; border: 1.5px solid #fed7aa; }
.muestras-summary {
font-size: .72rem; color: #64748b; margin-bottom: .5rem;
display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
@@ -524,7 +524,7 @@ try {
font-size: .68rem; }
.muestras-summary .mc.pend { background: #fef9c3; color: #854d0e; }
.muestras-summary .mc.rec { background: #dcfce7; color: #166534; }
.muestras-summary .mc.rech { background: #fee2e2; color: #991b1b; }
.muestras-summary .mc.rech { background: #fff7ed; color: #c2410c; }
</style>
</head>
<body>
@@ -1800,7 +1800,7 @@ async function iniciarAtencion() {
async function finalizarAtencion() {
if (!turnoActivo) return;
if (hayPendientes) { mostrarError('Debe firmar todos los consentimientos antes de finalizar.'); return; }
if (hayMuestrasPendientes) { mostrarError('Debe marcar cada muestra como recibida o rechazada antes de finalizar.'); return; }
if (hayMuestrasPendientes) { mostrarError('Debe marcar cada muestra como recibida o pendiente antes de finalizar.'); return; }
if (!confirm(`¿Finalizar atención del turno ${turnoActivo.codigo}?`)) return;
await cambiarEstadoTurno('finalizado');
}
@@ -2203,7 +2203,7 @@ function renderMuestras(lista) {
let chips = '';
if (nPend) chips += `<span class="mc pend">${nPend} pendiente${nPend > 1 ? 's' : ''}</span>`;
if (nRec) chips += `<span class="mc rec">${nRec} recibida${nRec > 1 ? 's' : ''}</span>`;
if (nRech) chips += `<span class="mc rech">${nRech} rechazada${nRech > 1 ? 's' : ''}</span>`;
if (nRech) chips += `<span class="mc rech">${nRech} pendiente${nRech > 1 ? 's' : ''}</span>`;
summary.innerHTML = chips;
cont.innerHTML = lista.map(m => {
@@ -2230,7 +2230,7 @@ function renderMuestras(lista) {
</button>
<button class="btn-muestra-accion rechazar"
onclick="pedirRechazo(${m.id},'${label.replace(/'/g,'\\\'')}')" >
<i class="fas fa-times"></i> Rechazar
<i class="fas fa-clock"></i> Pendiente
</button>
</div>`
: `${tsHtml}
@@ -2243,7 +2243,7 @@ function renderMuestras(lista) {
const ico = m.estado === 'recibida'
? '<i class="fas fa-check-circle" style="color:#16a34a;flex-shrink:0"></i>'
: m.estado === 'rechazada'
? '<i class="fas fa-times-circle" style="color:#dc2626;flex-shrink:0"></i>'
? '<i class="fas fa-hourglass-half" style="color:#c2410c;flex-shrink:0"></i>'
: '<i class="fas fa-clock" style="color:#d97706;flex-shrink:0"></i>';
return `<div class="muestra-row ${m.estado}" data-muestra-id="${m.id}">
@@ -2278,7 +2278,7 @@ async function marcarMuestra(muestraId, estado, motivo = null) {
renderMuestras(_muestrasActivas);
const msg = estado === 'recibida'
? 'Muestra recibida ✓'
: estado === 'rechazada' ? 'Muestra rechazada' : 'Revertida a pendiente';
: estado === 'rechazada' ? 'Pendiente' : 'Revertida a pendiente';
mostrarToast(msg, estado === 'recibida' ? 'success' : estado === 'rechazada' ? 'warn' : 'info', 2000);
} catch (err) {
mostrarError(err.message);
@@ -2286,7 +2286,7 @@ async function marcarMuestra(muestraId, estado, motivo = null) {
}
function pedirRechazo(muestraId, tipoMuestra) {
const motivo = prompt(`Motivo de rechazo para "${tipoMuestra}":\n(hemólisis, coagulado, volumen insuficiente…)`);
const motivo = prompt(`Nota para "${tipoMuestra}" (opcional):\n(ej: paciente la trae mañana, volumen insuficiente…)`);
if (motivo === null) return;
marcarMuestra(muestraId, 'rechazada', motivo.trim() || null);
}