fix(auditoria): afluencia (validacion, update sin perder datos ni retroceder etapa, dedup cruzado, notas), alta cliente (registro tras firma, documentos por cliente, aviso de fallos) y reporte de clientes aplanado
This commit is contained in:
@@ -17,6 +17,10 @@ interface Props {
|
||||
alta: AltaCliente
|
||||
onCambiarFirma: (firma: DatosFirma) => void
|
||||
onAnterior: () => void
|
||||
/** Registra el alta en el servidor (después de firmar y revisar el expediente) */
|
||||
onRegistrar: () => void
|
||||
/** true mientras el alta se está registrando */
|
||||
registrando?: boolean
|
||||
}
|
||||
|
||||
const GENERADORES: { tipo: string; descargar: (alta: AltaCliente) => void }[] = [
|
||||
@@ -28,7 +32,7 @@ const GENERADORES: { tipo: string; descargar: (alta: AltaCliente) => void }[] =
|
||||
]
|
||||
|
||||
/** Paso 8: firma del cliente, nombre del asesor, resumen y generación de PDFs */
|
||||
export default function FirmasForm({ alta, onCambiarFirma, onAnterior }: Props) {
|
||||
export default function FirmasForm({ alta, onCambiarFirma, onAnterior, onRegistrar, registrando = false }: Props) {
|
||||
const [error, setError] = useState('')
|
||||
const [avisoExpediente, setAvisoExpediente] = useState('')
|
||||
const { datosGenerales: g, viviendaCredito: v, economicos, firma } = alta
|
||||
@@ -158,14 +162,31 @@ export default function FirmasForm({ alta, onCambiarFirma, onAnterior }: Props)
|
||||
</div>
|
||||
</SectionCard>
|
||||
|
||||
<div className="sticky bottom-0 flex items-center rounded-b-xl border-t border-[#E5E7EB] bg-white px-6 py-4">
|
||||
<div className="sticky bottom-0 flex flex-wrap items-center gap-3 rounded-b-xl border-t border-[#E5E7EB] bg-white px-6 py-4">
|
||||
<button
|
||||
type="button"
|
||||
onClick={onAnterior}
|
||||
className="rounded-lg border border-[#D1D5DB] bg-white px-5 py-2.5 text-sm font-medium text-[#374151] shadow-sm transition-all duration-100 ease-out hover:bg-[#F9FAFB]"
|
||||
disabled={registrando}
|
||||
className="rounded-lg border border-[#D1D5DB] bg-white px-5 py-2.5 text-sm font-medium text-[#374151] shadow-sm transition-all duration-100 ease-out hover:bg-[#F9FAFB] disabled:opacity-50"
|
||||
>
|
||||
Anterior
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
// La firma es obligatoria para registrar el alta
|
||||
if (!validar()) return
|
||||
avisarExpediente()
|
||||
onRegistrar()
|
||||
}}
|
||||
disabled={registrando}
|
||||
className="rounded-lg bg-accent px-6 py-2.5 text-sm font-medium text-white shadow-sm transition-all duration-100 ease-out hover:bg-accent-hover disabled:opacity-50"
|
||||
>
|
||||
{registrando ? 'Registrando…' : 'Registrar alta'}
|
||||
</button>
|
||||
<p className="text-xs text-[#64748B]">
|
||||
El expediente se registra y los PDFs se generan después de firmar.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user