Implement toggle for read/write mode across entity pages and enhance Documents and Divers functionality
- Added a toggle for switching between read and write modes on the Articles, Documents, Journaux, Tiers, and Divers pages, allowing users to access both data retrieval and data submission endpoints. - Updated the Documents page to cover all 9 documented endpoints, including 7 for reading and 2 for writing, with appropriate error handling. - Created a new Divers page to handle three endpoints: getserialnumber, codes_list, and custom_geninv_updatestock (the latter being non-functional). - Introduced new methods in LogisticsService for handling PDF generation and stock updates, with corresponding updates in the API documentation. - Improved form field components for better visual spacing in input fields.
This commit is contained in:
@@ -1,89 +1,110 @@
|
||||
<x-filament-panels::page>
|
||||
<x-logistics.error-banner :message="$errorMessage" />
|
||||
|
||||
{{-- Formulaire de recherche --}}
|
||||
<x-logistics.card>
|
||||
<x-logistics.section-header title="Rechercher des articles" />
|
||||
<div class="p-6">
|
||||
<div class="grid grid-cols-1 gap-4 sm:grid-cols-3">
|
||||
<x-logistics.form-field
|
||||
wire:model="search"
|
||||
label="Recherche"
|
||||
id="search"
|
||||
placeholder="Filtre de recherche..."
|
||||
/>
|
||||
<x-logistics.form-field
|
||||
wire:model="select"
|
||||
label="Colonnes (select)"
|
||||
id="select"
|
||||
placeholder="artid,artname"
|
||||
/>
|
||||
<x-logistics.form-field
|
||||
wire:model="results"
|
||||
label="Nombre de résultats"
|
||||
id="results"
|
||||
type="number"
|
||||
min="1"
|
||||
max="100"
|
||||
/>
|
||||
</div>
|
||||
{{-- Toggle Lecture / Ecriture --}}
|
||||
<div class="flex gap-2">
|
||||
<x-filament::button wire:click="$set('mode', 'read')" :color="$mode === 'read' ? 'primary' : 'gray'" icon="heroicon-o-arrow-down-tray">
|
||||
Lecture
|
||||
</x-filament::button>
|
||||
<x-filament::button wire:click="$set('mode', 'write')" :color="$mode === 'write' ? 'primary' : 'gray'" icon="heroicon-o-arrow-up-tray">
|
||||
Ecriture
|
||||
</x-filament::button>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 flex items-center gap-3">
|
||||
<x-filament::button wire:click="searchArticles" icon="heroicon-o-magnifying-glass">
|
||||
Rechercher
|
||||
</x-filament::button>
|
||||
<div wire:loading wire:target="searchArticles" class="flex items-center gap-2">
|
||||
<x-filament::loading-indicator class="h-4 w-4 text-primary-500" />
|
||||
<span class="text-sm text-gray-500">Recherche en cours...</span>
|
||||
@if ($mode === 'read')
|
||||
{{-- art_list --}}
|
||||
<x-logistics.card>
|
||||
<x-logistics.section-header title="art_list" description="Rechercher des articles" />
|
||||
<div class="p-6">
|
||||
<div class="grid grid-cols-1 gap-4 sm:grid-cols-3">
|
||||
<x-logistics.form-field
|
||||
wire:model="search"
|
||||
label="Recherche (search)"
|
||||
id="search"
|
||||
placeholder="Filtre de recherche..."
|
||||
/>
|
||||
<x-logistics.form-field
|
||||
wire:model="select"
|
||||
label="Colonnes (select)"
|
||||
id="select"
|
||||
placeholder="artid,artname"
|
||||
/>
|
||||
<x-logistics.form-field
|
||||
wire:model="results"
|
||||
label="Nombre de résultats (results)"
|
||||
id="results"
|
||||
type="number"
|
||||
min="1"
|
||||
max="100"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 flex items-center gap-3">
|
||||
<x-filament::button wire:click="searchArticles" icon="heroicon-o-magnifying-glass">
|
||||
Rechercher
|
||||
</x-filament::button>
|
||||
<div wire:loading wire:target="searchArticles" class="flex items-center gap-2">
|
||||
<x-filament::loading-indicator class="h-4 w-4 text-primary-500" />
|
||||
<span class="text-sm text-gray-500">Recherche en cours...</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</x-logistics.card>
|
||||
</x-logistics.card>
|
||||
|
||||
{{-- Resultats --}}
|
||||
@if (count($data) > 0)
|
||||
@if (count($data) > 0)
|
||||
<x-logistics.card>
|
||||
<x-logistics.section-header title="Résultats art_list">
|
||||
<x-slot:actions>
|
||||
@if ($metadata)
|
||||
<span class="rounded-full bg-gray-100 px-2.5 py-0.5 text-xs font-medium tabular-nums text-gray-600 dark:bg-white/10 dark:text-gray-300">
|
||||
{{ $metadata['rowcount'] ?? 0 }} résultat(s)
|
||||
</span>
|
||||
@endif
|
||||
</x-slot:actions>
|
||||
</x-logistics.section-header>
|
||||
<div class="p-6">
|
||||
<x-logistics.data-table :data="$data" />
|
||||
</div>
|
||||
</x-logistics.card>
|
||||
@endif
|
||||
|
||||
{{-- art_getstk --}}
|
||||
<x-logistics.card>
|
||||
<x-logistics.section-header title="Résultats">
|
||||
<x-slot:actions>
|
||||
@if ($metadata)
|
||||
<span class="rounded-full bg-gray-100 px-2.5 py-0.5 text-xs font-medium tabular-nums text-gray-600 dark:bg-white/10 dark:text-gray-300">
|
||||
{{ $metadata['rowcount'] ?? 0 }} résultat(s)
|
||||
</span>
|
||||
@endif
|
||||
</x-slot:actions>
|
||||
</x-logistics.section-header>
|
||||
<x-logistics.section-header title="art_getstk" description="Vérifier le stock d'un article" />
|
||||
<div class="p-6">
|
||||
<x-logistics.data-table :data="$data" />
|
||||
<div class="flex items-end gap-4">
|
||||
<div class="flex-1">
|
||||
<x-logistics.form-field
|
||||
wire:model="stockArticleId"
|
||||
label="Identifiant article (ARTID)"
|
||||
id="stockArticleId"
|
||||
placeholder="Ex: ART001"
|
||||
/>
|
||||
</div>
|
||||
<x-filament::button wire:click="getStock" icon="heroicon-o-cube">
|
||||
Vérifier le stock
|
||||
</x-filament::button>
|
||||
</div>
|
||||
|
||||
<div wire:loading wire:target="getStock" class="mt-4 flex items-center gap-2">
|
||||
<x-filament::loading-indicator class="h-4 w-4 text-primary-500" />
|
||||
<span class="text-sm text-gray-500">Chargement...</span>
|
||||
</div>
|
||||
|
||||
<div wire:loading.remove wire:target="getStock" class="mt-4">
|
||||
<x-logistics.json-block :data="$stockData" />
|
||||
</div>
|
||||
</div>
|
||||
</x-logistics.card>
|
||||
@else
|
||||
<x-logistics.card>
|
||||
<div class="p-6">
|
||||
<x-logistics.empty-state
|
||||
icon="heroicon-o-arrow-up-tray"
|
||||
title="Aucun endpoint d'écriture disponible"
|
||||
description="La section Articles ne dispose pas d'endpoints d'envoi de données."
|
||||
/>
|
||||
</div>
|
||||
</x-logistics.card>
|
||||
@endif
|
||||
|
||||
{{-- Stock d'un article --}}
|
||||
<x-logistics.card>
|
||||
<x-logistics.section-header title="Vérifier le stock d'un article" />
|
||||
<div class="p-6">
|
||||
<div class="flex items-end gap-4">
|
||||
<div class="flex-1">
|
||||
<x-logistics.form-field
|
||||
wire:model="stockArticleId"
|
||||
label="Identifiant article (ARTID)"
|
||||
id="stockArticleId"
|
||||
placeholder="Ex: ART001"
|
||||
/>
|
||||
</div>
|
||||
<x-filament::button wire:click="getStock" icon="heroicon-o-cube">
|
||||
Vérifier le stock
|
||||
</x-filament::button>
|
||||
</div>
|
||||
|
||||
<div wire:loading wire:target="getStock" class="mt-4 flex items-center gap-2">
|
||||
<x-filament::loading-indicator class="h-4 w-4 text-primary-500" />
|
||||
<span class="text-sm text-gray-500">Chargement...</span>
|
||||
</div>
|
||||
|
||||
<div wire:loading.remove wire:target="getStock" class="mt-4">
|
||||
<x-logistics.json-block :data="$stockData" />
|
||||
</div>
|
||||
</div>
|
||||
</x-logistics.card>
|
||||
</x-filament-panels::page>
|
||||
|
||||
Reference in New Issue
Block a user