feat: infrastructure assets management with warranty tracking and EAN lookup integration

This commit is contained in:
jeremy bayse
2026-04-09 21:51:43 +02:00
parent 3544c77bd1
commit b28c56c94c
46 changed files with 2961 additions and 414 deletions

View File

@@ -96,6 +96,10 @@ const transitionColors = {
<p class="text-xs text-gray-500">Service demandeur</p>
<p class="mt-0.5 font-medium text-gray-900">{{ commande.service?.nom ?? '—' }}</p>
</div>
<div>
<p class="text-xs text-gray-500">Ville / Commune</p>
<p class="mt-0.5 font-medium text-gray-900">{{ commande.commune?.nom ?? '—' }}</p>
</div>
<div>
<p class="text-xs text-gray-500">Fournisseur</p>
<p class="mt-0.5 font-medium text-gray-900">{{ commande.fournisseur?.nom ?? '—' }}</p>
@@ -160,6 +164,35 @@ const transitionColors = {
:show-received="['commandee','partiellement_recue','recue_complete','cloturee'].includes(commande.statut)" />
</div>
<!-- Matériels associés (Assets) -->
<div v-if="commande.assets?.length" class="rounded-xl bg-white p-5 shadow-sm border border-gray-100">
<div class="flex items-center justify-between mb-4">
<h2 class="text-sm font-semibold uppercase tracking-wide text-gray-500">Matériels livrés (Assets)</h2>
<span class="px-2 py-0.5 rounded-full bg-blue-100 text-blue-700 text-[10px] font-bold uppercase">{{ commande.assets.length }} équipements</span>
</div>
<div class="divide-y divide-gray-100">
<div v-for="asset in commande.assets" :key="asset.id" class="flex items-center justify-between py-3 first:pt-0 last:pb-0">
<div class="flex items-start gap-3">
<div class="mt-1 rounded bg-gray-100 p-2 text-gray-400">
<svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z" />
</svg>
</div>
<div>
<Link :href="route('assets.show', asset.id)" class="font-medium text-gray-900 hover:text-blue-600 transition-colors">
{{ asset.nom }}
</Link>
<div class="text-xs text-gray-500 font-mono">{{ asset.numero_serie ?? 'Sans S/N' }} {{ asset.marque }} {{ asset.modele }}</div>
</div>
</div>
<div class="text-right">
<span class="block text-xs font-medium text-gray-900">{{ asset.type }}</span>
<span v-if="asset.date_fin_garantie" class="text-[10px] text-gray-500">Garantie jusqu'au {{ formatDate(asset.date_fin_garantie) }}</span>
</div>
</div>
</div>
</div>
<!-- Notes -->
<div v-if="commande.description || commande.justification || commande.notes || commande.notes_fournisseur"
class="rounded-xl bg-white p-5 shadow-sm border border-gray-100">