feat(EtatLieux): Implémente la gestion des points de contrôle et améliore le PDF/l'intégration DocuSeal.

This commit is contained in:
Serreau Jovann
2026-02-06 16:34:44 +01:00
parent a88a143fa5
commit d5fcb788b4
6 changed files with 333 additions and 70 deletions

View File

@@ -76,6 +76,57 @@
</form>
</div>
{# POINTS DE CONTROLE #}
<div class="bg-white rounded-[2rem] p-6 border border-slate-100 shadow-sm">
<h3 class="text-xs font-black text-slate-400 uppercase tracking-widest mb-4">Points de Contrôle</h3>
<form action="{{ path('etl_edl_save_points', {id: mission.id}) }}" method="post" id="form-points">
{% for reserve in mission.productReserves %}
{% set product = reserve.product %}
{% if product.productPointControlls|length > 0 %}
<div class="mb-6 last:mb-0">
<h4 class="font-bold text-slate-900 mb-3 flex items-center gap-2">
<span class="w-1 h-4 bg-blue-500 rounded-full"></span>
{{ product.name }}
</h4>
<div class="space-y-3 pl-3 border-l border-slate-100 ml-0.5">
{% for point in product.productPointControlls %}
{# Try to find existing status/comment in etatLieux.pointControls #}
{% set existingPoint = null %}
{% for ep in etatLieux.pointControls %}
{% if ep.name == point.name %}
{% set existingPoint = ep %}
{% endif %}
{% endfor %}
<div class="bg-slate-50 p-3 rounded-xl">
<div class="flex items-start gap-3">
<div class="pt-1">
<input type="checkbox" name="points[{{ product.id }}][{{ point.id }}][status]" value="1"
class="w-5 h-5 rounded-md border-slate-300 text-blue-600 focus:ring-blue-500"
{{ existingPoint and existingPoint.status ? 'checked' : '' }}>
</div>
<div class="flex-1">
<p class="text-sm font-bold text-slate-700 mb-1">{{ point.name }}</p>
<input type="text" name="points[{{ product.id }}][{{ point.id }}][details]"
value="{{ existingPoint ? existingPoint.details : '' }}"
placeholder="Commentaire (optionnel)..."
class="w-full bg-white border border-slate-200 rounded-lg px-3 py-2 text-xs focus:outline-none focus:border-blue-500 transition-colors">
</div>
</div>
</div>
{% endfor %}
</div>
</div>
{% endif %}
{% endfor %}
<button type="submit" class="w-full py-3 bg-slate-900 text-white rounded-xl text-xs font-bold uppercase tracking-wide hover:bg-slate-800 transition-colors shadow-lg mt-4">
Enregistrer les contrôles
</button>
</form>
</div>
{# COMMENTAIRES #}
<div class="bg-white rounded-[2rem] p-6 border border-slate-100 shadow-sm">
<h3 class="text-xs font-black text-slate-400 uppercase tracking-widest mb-4">Commentaires</h3>

View File

@@ -19,7 +19,12 @@
<div class="bg-blue-600 rounded-[2rem] p-8 text-white shadow-xl shadow-blue-600/20 text-center relative overflow-hidden">
<div class="absolute top-0 right-0 -mr-8 -mt-8 w-32 h-32 bg-white/10 rounded-full blur-2xl"></div>
<h2 class="text-2xl font-black mb-2">État des Lieux Terminé</h2>
<p class="text-sm font-medium opacity-90">Veuillez procéder à la signature du document.</p>
<p class="text-sm font-medium opacity-90 mb-6">Veuillez procéder à la signature du document.</p>
<a href="{{ path('etl_edl_regenerate_view', {id: mission.id}) }}" target="_blank" class="inline-flex items-center px-6 py-3 bg-white/20 hover:bg-white/30 text-white rounded-xl text-xs font-bold uppercase tracking-widest backdrop-blur-sm transition-all border border-white/30">
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" /><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" /></svg>
Voir le PDF (Actualiser)
</a>
</div>
{# ACTIONS SIGNATURE #}