Initial commit with contrats and domaines modules
This commit is contained in:
55
resources/js/Pages/Fournisseurs/Create.vue
Normal file
55
resources/js/Pages/Fournisseurs/Create.vue
Normal file
@@ -0,0 +1,55 @@
|
||||
<script setup>
|
||||
import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout.vue'
|
||||
import { Head, Link, useForm } from '@inertiajs/vue3'
|
||||
|
||||
const form = useForm({
|
||||
nom: '', raison_sociale: '', siret: '', adresse: '', code_postal: '', ville: '',
|
||||
telephone: '', email: '', contact_commercial: '', email_commercial: '',
|
||||
telephone_commercial: '', site_web: '', notes: '', active: true,
|
||||
})
|
||||
|
||||
function submit() { form.post(route('fournisseurs.store')) }
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Head title="Nouveau fournisseur" />
|
||||
<AuthenticatedLayout>
|
||||
<template #header>
|
||||
<div class="flex items-center gap-3">
|
||||
<Link :href="route('fournisseurs.index')" class="text-gray-400 hover:text-gray-600">
|
||||
<svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" /></svg>
|
||||
</Link>
|
||||
<h1 class="text-xl font-semibold text-gray-900">Nouveau fournisseur</h1>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<form @submit.prevent="submit" class="max-w-3xl space-y-6">
|
||||
<div class="rounded-xl bg-white p-6 shadow-sm border border-gray-100">
|
||||
<h2 class="mb-4 text-sm font-semibold uppercase tracking-wide text-gray-500">Informations</h2>
|
||||
<div class="grid gap-4 sm:grid-cols-2">
|
||||
<div class="sm:col-span-2">
|
||||
<label class="block text-sm font-medium text-gray-700">Nom <span class="text-red-500">*</span></label>
|
||||
<input v-model="form.nom" type="text" required class="mt-1 block w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none" />
|
||||
<p v-if="form.errors.nom" class="mt-1 text-xs text-red-600">{{ form.errors.nom }}</p>
|
||||
</div>
|
||||
<div><label class="block text-sm font-medium text-gray-700">Raison sociale</label><input v-model="form.raison_sociale" type="text" class="mt-1 block w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none" /></div>
|
||||
<div><label class="block text-sm font-medium text-gray-700">SIRET</label><input v-model="form.siret" type="text" maxlength="14" class="mt-1 block w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none" /></div>
|
||||
<div class="sm:col-span-2"><label class="block text-sm font-medium text-gray-700">Adresse</label><textarea v-model="form.adresse" rows="2" class="mt-1 block w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none" /></div>
|
||||
<div><label class="block text-sm font-medium text-gray-700">Code postal</label><input v-model="form.code_postal" type="text" class="mt-1 block w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none" /></div>
|
||||
<div><label class="block text-sm font-medium text-gray-700">Ville</label><input v-model="form.ville" type="text" class="mt-1 block w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none" /></div>
|
||||
<div><label class="block text-sm font-medium text-gray-700">Téléphone</label><input v-model="form.telephone" type="text" class="mt-1 block w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none" /></div>
|
||||
<div><label class="block text-sm font-medium text-gray-700">Email</label><input v-model="form.email" type="email" class="mt-1 block w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none" /></div>
|
||||
<div><label class="block text-sm font-medium text-gray-700">Site web</label><input v-model="form.site_web" type="url" class="mt-1 block w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none" /></div>
|
||||
<div><label class="block text-sm font-medium text-gray-700">Contact commercial</label><input v-model="form.contact_commercial" type="text" class="mt-1 block w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none" /></div>
|
||||
<div><label class="block text-sm font-medium text-gray-700">Email commercial</label><input v-model="form.email_commercial" type="email" class="mt-1 block w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none" /></div>
|
||||
<div><label class="block text-sm font-medium text-gray-700">Tél. commercial</label><input v-model="form.telephone_commercial" type="text" class="mt-1 block w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none" /></div>
|
||||
<div class="sm:col-span-2"><label class="block text-sm font-medium text-gray-700">Notes</label><textarea v-model="form.notes" rows="3" class="mt-1 block w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none" /></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end gap-3">
|
||||
<Link :href="route('fournisseurs.index')" class="rounded-lg border border-gray-300 px-5 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 transition-colors">Annuler</Link>
|
||||
<button type="submit" :disabled="form.processing" class="rounded-lg bg-blue-600 px-5 py-2 text-sm font-medium text-white hover:bg-blue-700 disabled:opacity-50 transition-colors">{{ form.processing ? 'Création...' : 'Créer' }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</AuthenticatedLayout>
|
||||
</template>
|
||||
66
resources/js/Pages/Fournisseurs/Edit.vue
Normal file
66
resources/js/Pages/Fournisseurs/Edit.vue
Normal file
@@ -0,0 +1,66 @@
|
||||
<script setup>
|
||||
import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout.vue'
|
||||
import { Head, Link, useForm } from '@inertiajs/vue3'
|
||||
|
||||
const props = defineProps({ fournisseur: Object })
|
||||
|
||||
const form = useForm({
|
||||
nom: props.fournisseur.nom, raison_sociale: props.fournisseur.raison_sociale ?? '',
|
||||
siret: props.fournisseur.siret ?? '', adresse: props.fournisseur.adresse ?? '',
|
||||
code_postal: props.fournisseur.code_postal ?? '', ville: props.fournisseur.ville ?? '',
|
||||
telephone: props.fournisseur.telephone ?? '', email: props.fournisseur.email ?? '',
|
||||
contact_commercial: props.fournisseur.contact_commercial ?? '',
|
||||
email_commercial: props.fournisseur.email_commercial ?? '',
|
||||
telephone_commercial: props.fournisseur.telephone_commercial ?? '',
|
||||
site_web: props.fournisseur.site_web ?? '', notes: props.fournisseur.notes ?? '',
|
||||
active: props.fournisseur.active,
|
||||
})
|
||||
|
||||
function submit() { form.put(route('fournisseurs.update', props.fournisseur.id)) }
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Head :title="`Modifier — ${fournisseur.nom}`" />
|
||||
<AuthenticatedLayout>
|
||||
<template #header>
|
||||
<div class="flex items-center gap-3">
|
||||
<Link :href="route('fournisseurs.show', fournisseur.id)" class="text-gray-400 hover:text-gray-600">
|
||||
<svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" /></svg>
|
||||
</Link>
|
||||
<h1 class="text-xl font-semibold text-gray-900">Modifier {{ fournisseur.nom }}</h1>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<form @submit.prevent="submit" class="max-w-3xl space-y-6">
|
||||
<div class="rounded-xl bg-white p-6 shadow-sm border border-gray-100">
|
||||
<h2 class="mb-4 text-sm font-semibold uppercase tracking-wide text-gray-500">Informations</h2>
|
||||
<div class="grid gap-4 sm:grid-cols-2">
|
||||
<div class="sm:col-span-2">
|
||||
<label class="block text-sm font-medium text-gray-700">Nom <span class="text-red-500">*</span></label>
|
||||
<input v-model="form.nom" type="text" required class="mt-1 block w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none" />
|
||||
</div>
|
||||
<div><label class="block text-sm font-medium text-gray-700">Raison sociale</label><input v-model="form.raison_sociale" type="text" class="mt-1 block w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none" /></div>
|
||||
<div><label class="block text-sm font-medium text-gray-700">SIRET</label><input v-model="form.siret" type="text" maxlength="14" class="mt-1 block w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none" /></div>
|
||||
<div class="sm:col-span-2"><label class="block text-sm font-medium text-gray-700">Adresse</label><textarea v-model="form.adresse" rows="2" class="mt-1 block w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none" /></div>
|
||||
<div><label class="block text-sm font-medium text-gray-700">Code postal</label><input v-model="form.code_postal" type="text" class="mt-1 block w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none" /></div>
|
||||
<div><label class="block text-sm font-medium text-gray-700">Ville</label><input v-model="form.ville" type="text" class="mt-1 block w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none" /></div>
|
||||
<div><label class="block text-sm font-medium text-gray-700">Téléphone</label><input v-model="form.telephone" type="text" class="mt-1 block w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none" /></div>
|
||||
<div><label class="block text-sm font-medium text-gray-700">Email</label><input v-model="form.email" type="email" class="mt-1 block w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none" /></div>
|
||||
<div><label class="block text-sm font-medium text-gray-700">Site web</label><input v-model="form.site_web" type="url" class="mt-1 block w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none" /></div>
|
||||
<div><label class="block text-sm font-medium text-gray-700">Contact commercial</label><input v-model="form.contact_commercial" type="text" class="mt-1 block w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none" /></div>
|
||||
<div><label class="block text-sm font-medium text-gray-700">Email commercial</label><input v-model="form.email_commercial" type="email" class="mt-1 block w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none" /></div>
|
||||
<div><label class="block text-sm font-medium text-gray-700">Tél. commercial</label><input v-model="form.telephone_commercial" type="text" class="mt-1 block w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none" /></div>
|
||||
<div class="sm:col-span-2"><label class="block text-sm font-medium text-gray-700">Notes</label><textarea v-model="form.notes" rows="3" class="mt-1 block w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none" /></div>
|
||||
<div class="flex items-center gap-2">
|
||||
<input v-model="form.active" type="checkbox" id="active" class="rounded border-gray-300 text-blue-600 focus:ring-blue-500" />
|
||||
<label for="active" class="text-sm font-medium text-gray-700">Fournisseur actif</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end gap-3">
|
||||
<Link :href="route('fournisseurs.show', fournisseur.id)" class="rounded-lg border border-gray-300 px-5 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 transition-colors">Annuler</Link>
|
||||
<button type="submit" :disabled="form.processing" class="rounded-lg bg-blue-600 px-5 py-2 text-sm font-medium text-white hover:bg-blue-700 disabled:opacity-50 transition-colors">{{ form.processing ? 'Enregistrement...' : 'Enregistrer' }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</AuthenticatedLayout>
|
||||
</template>
|
||||
122
resources/js/Pages/Fournisseurs/Index.vue
Normal file
122
resources/js/Pages/Fournisseurs/Index.vue
Normal file
@@ -0,0 +1,122 @@
|
||||
<script setup>
|
||||
import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout.vue'
|
||||
import Pagination from '@/Components/Pagination.vue'
|
||||
import ConfirmModal from '@/Components/ConfirmModal.vue'
|
||||
import { Head, Link, router, useForm } from '@inertiajs/vue3'
|
||||
import { ref, reactive } from 'vue'
|
||||
|
||||
const props = defineProps({
|
||||
fournisseurs: Object,
|
||||
filters: Object,
|
||||
})
|
||||
|
||||
const filters = reactive({ ...props.filters })
|
||||
const deleteTarget = ref(null)
|
||||
const deleteForm = useForm({})
|
||||
|
||||
function applyFilters() {
|
||||
router.get(route('fournisseurs.index'), filters, { preserveState: true, replace: true })
|
||||
}
|
||||
|
||||
function doDelete() {
|
||||
deleteForm.delete(route('fournisseurs.destroy', deleteTarget.value.id), {
|
||||
onSuccess: () => deleteTarget.value = null,
|
||||
})
|
||||
}
|
||||
|
||||
function toggleActive(f) {
|
||||
router.patch(route('fournisseurs.toggle-active', f.id))
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Head title="Fournisseurs" />
|
||||
<AuthenticatedLayout>
|
||||
<template #header>
|
||||
<div class="flex items-center justify-between">
|
||||
<h1 class="text-xl font-semibold text-gray-900">Fournisseurs</h1>
|
||||
<Link :href="route('fournisseurs.create')"
|
||||
class="rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 transition-colors">
|
||||
+ Ajouter
|
||||
</Link>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="space-y-4">
|
||||
<!-- Filtres -->
|
||||
<div class="rounded-xl bg-white p-4 shadow-sm border border-gray-100 flex gap-3">
|
||||
<input v-model="filters.search" @input="applyFilters" type="text" placeholder="Recherche nom, ville, email..."
|
||||
class="flex-1 rounded-lg border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none" />
|
||||
<select v-model="filters.active" @change="applyFilters"
|
||||
class="rounded-lg border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none">
|
||||
<option value="">Tous</option>
|
||||
<option value="1">Actifs</option>
|
||||
<option value="0">Inactifs</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- Table -->
|
||||
<div class="rounded-xl bg-white shadow-sm border border-gray-100 overflow-hidden">
|
||||
<table class="min-w-full divide-y divide-gray-100 text-sm">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th class="px-5 py-3 text-left text-xs font-medium text-gray-500 uppercase">Nom</th>
|
||||
<th class="px-5 py-3 text-left text-xs font-medium text-gray-500 uppercase">Contact</th>
|
||||
<th class="px-5 py-3 text-left text-xs font-medium text-gray-500 uppercase">Ville</th>
|
||||
<th class="px-5 py-3 text-right text-xs font-medium text-gray-500 uppercase">Commandes</th>
|
||||
<th class="px-5 py-3 text-center text-xs font-medium text-gray-500 uppercase">Statut</th>
|
||||
<th class="px-5 py-3 text-center text-xs font-medium text-gray-500 uppercase">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-50">
|
||||
<tr v-for="f in fournisseurs.data" :key="f.id" :class="['hover:bg-gray-50 transition-colors', !f.active ? 'opacity-60' : '']">
|
||||
<td class="px-5 py-3">
|
||||
<Link :href="route('fournisseurs.show', f.id)" class="font-medium text-blue-600 hover:underline">{{ f.nom }}</Link>
|
||||
<p v-if="f.raison_sociale" class="text-xs text-gray-400">{{ f.raison_sociale }}</p>
|
||||
</td>
|
||||
<td class="px-5 py-3 text-gray-600">
|
||||
<p v-if="f.email">{{ f.email }}</p>
|
||||
<p v-if="f.telephone" class="text-xs text-gray-400">{{ f.telephone }}</p>
|
||||
</td>
|
||||
<td class="px-5 py-3 text-gray-600">{{ f.ville ?? '—' }}</td>
|
||||
<td class="px-5 py-3 text-right font-medium text-gray-900">{{ f.commandes_count }}</td>
|
||||
<td class="px-5 py-3 text-center">
|
||||
<button @click="toggleActive(f)"
|
||||
:class="['rounded-full px-2.5 py-1 text-xs font-medium transition-colors', f.active ? 'bg-green-100 text-green-700 hover:bg-green-200' : 'bg-gray-100 text-gray-600 hover:bg-gray-200']">
|
||||
{{ f.active ? 'Actif' : 'Inactif' }}
|
||||
</button>
|
||||
</td>
|
||||
<td class="px-5 py-3 text-center">
|
||||
<div class="flex items-center justify-center gap-2">
|
||||
<Link :href="route('fournisseurs.show', f.id)" class="text-gray-400 hover:text-blue-600 transition-colors">
|
||||
<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="M15 12a3 3 0 11-6 0 3 3 0 016 0z 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>
|
||||
</Link>
|
||||
<Link :href="route('fournisseurs.edit', f.id)" class="text-gray-400 hover:text-indigo-600 transition-colors">
|
||||
<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="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" />
|
||||
</svg>
|
||||
</Link>
|
||||
<button @click="deleteTarget = f" class="text-gray-400 hover:text-red-600 transition-colors">
|
||||
<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="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div v-if="!fournisseurs.data.length" class="py-12 text-center text-gray-400">Aucun fournisseur trouvé.</div>
|
||||
<div class="border-t border-gray-100 px-5 py-3">
|
||||
<Pagination :links="fournisseurs.links" :meta="fournisseurs.meta" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ConfirmModal :show="!!deleteTarget" title="Supprimer le fournisseur"
|
||||
:message="`Supprimer définitivement ${deleteTarget?.nom} ?`"
|
||||
:processing="deleteForm.processing" @confirm="doDelete" @cancel="deleteTarget = null" />
|
||||
</AuthenticatedLayout>
|
||||
</template>
|
||||
84
resources/js/Pages/Fournisseurs/Show.vue
Normal file
84
resources/js/Pages/Fournisseurs/Show.vue
Normal file
@@ -0,0 +1,84 @@
|
||||
<script setup>
|
||||
import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout.vue'
|
||||
import StatutBadge from '@/Components/Commandes/StatutBadge.vue'
|
||||
import { Head, Link } from '@inertiajs/vue3'
|
||||
|
||||
defineProps({ fournisseur: Object })
|
||||
|
||||
function formatDate(d) {
|
||||
if (!d) return '—'
|
||||
return new Intl.DateTimeFormat('fr-FR').format(new Date(d))
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Head :title="fournisseur.nom" />
|
||||
<AuthenticatedLayout>
|
||||
<template #header>
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center gap-3">
|
||||
<Link :href="route('fournisseurs.index')" class="text-gray-400 hover:text-gray-600">
|
||||
<svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
|
||||
</svg>
|
||||
</Link>
|
||||
<h1 class="text-xl font-semibold text-gray-900">{{ fournisseur.nom }}</h1>
|
||||
<span :class="['rounded-full px-2.5 py-1 text-xs font-medium', fournisseur.active ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-600']">
|
||||
{{ fournisseur.active ? 'Actif' : 'Inactif' }}
|
||||
</span>
|
||||
</div>
|
||||
<Link :href="route('fournisseurs.edit', fournisseur.id)"
|
||||
class="rounded-lg border border-gray-300 px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 transition-colors">
|
||||
Modifier
|
||||
</Link>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="grid gap-6 lg:grid-cols-2">
|
||||
<div class="rounded-xl bg-white p-6 shadow-sm border border-gray-100">
|
||||
<h2 class="mb-4 text-sm font-semibold uppercase tracking-wide text-gray-500">Coordonnées</h2>
|
||||
<dl class="space-y-3 text-sm">
|
||||
<div v-if="fournisseur.raison_sociale"><dt class="text-gray-500">Raison sociale</dt><dd class="font-medium text-gray-900">{{ fournisseur.raison_sociale }}</dd></div>
|
||||
<div v-if="fournisseur.siret"><dt class="text-gray-500">SIRET</dt><dd class="font-medium text-gray-900">{{ fournisseur.siret }}</dd></div>
|
||||
<div v-if="fournisseur.adresse"><dt class="text-gray-500">Adresse</dt><dd class="font-medium text-gray-900">{{ fournisseur.adresse }}<br v-if="fournisseur.code_postal || fournisseur.ville" />{{ [fournisseur.code_postal, fournisseur.ville].filter(Boolean).join(' ') }}</dd></div>
|
||||
<div v-if="fournisseur.telephone"><dt class="text-gray-500">Téléphone</dt><dd class="font-medium text-gray-900">{{ fournisseur.telephone }}</dd></div>
|
||||
<div v-if="fournisseur.email"><dt class="text-gray-500">Email</dt><dd class="font-medium text-gray-900">{{ fournisseur.email }}</dd></div>
|
||||
<div v-if="fournisseur.site_web"><dt class="text-gray-500">Site web</dt><dd class="font-medium text-gray-900"><a :href="fournisseur.site_web" target="_blank" class="text-blue-600 hover:underline">{{ fournisseur.site_web }}</a></dd></div>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div class="rounded-xl bg-white p-6 shadow-sm border border-gray-100">
|
||||
<h2 class="mb-4 text-sm font-semibold uppercase tracking-wide text-gray-500">Contact commercial</h2>
|
||||
<dl class="space-y-3 text-sm">
|
||||
<div v-if="fournisseur.contact_commercial"><dt class="text-gray-500">Contact</dt><dd class="font-medium text-gray-900">{{ fournisseur.contact_commercial }}</dd></div>
|
||||
<div v-if="fournisseur.email_commercial"><dt class="text-gray-500">Email</dt><dd class="font-medium text-gray-900">{{ fournisseur.email_commercial }}</dd></div>
|
||||
<div v-if="fournisseur.telephone_commercial"><dt class="text-gray-500">Téléphone</dt><dd class="font-medium text-gray-900">{{ fournisseur.telephone_commercial }}</dd></div>
|
||||
<div v-if="fournisseur.notes"><dt class="text-gray-500">Notes</dt><dd class="font-medium text-gray-700 whitespace-pre-wrap">{{ fournisseur.notes }}</dd></div>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div class="rounded-xl bg-white p-6 shadow-sm border border-gray-100 lg:col-span-2">
|
||||
<h2 class="mb-4 text-sm font-semibold uppercase tracking-wide text-gray-500">Commandes récentes</h2>
|
||||
<table v-if="fournisseur.commandes?.length" class="min-w-full divide-y divide-gray-100 text-sm">
|
||||
<thead class="bg-gray-50"><tr>
|
||||
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase">N°</th>
|
||||
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase">Objet</th>
|
||||
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase">Service</th>
|
||||
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase">Statut</th>
|
||||
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase">Date</th>
|
||||
</tr></thead>
|
||||
<tbody class="divide-y divide-gray-50">
|
||||
<tr v-for="cmd in fournisseur.commandes" :key="cmd.id" class="hover:bg-gray-50">
|
||||
<td class="px-4 py-2"><Link :href="route('commandes.show', cmd.id)" class="text-blue-600 hover:underline">{{ cmd.numero_commande }}</Link></td>
|
||||
<td class="px-4 py-2 text-gray-700">{{ cmd.objet }}</td>
|
||||
<td class="px-4 py-2 text-gray-500">{{ cmd.service?.nom }}</td>
|
||||
<td class="px-4 py-2"><StatutBadge :statut="cmd.statut" size="sm" /></td>
|
||||
<td class="px-4 py-2 text-gray-500">{{ formatDate(cmd.date_demande) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p v-else class="text-sm text-gray-400">Aucune commande.</p>
|
||||
</div>
|
||||
</div>
|
||||
</AuthenticatedLayout>
|
||||
</template>
|
||||
Reference in New Issue
Block a user