1
0
forked from poc/pds

Added pallet data tables

This commit is contained in:
dhanabalan
2025-07-01 13:16:32 +05:30
parent c2b193c5b8
commit e083c0e4a5
4 changed files with 249 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
<x-filament::page>
<form wire:submit.prevent="create" class="space-y-6 mt-4"> <!-- Added mt-4 (16px) -->
<div class="filament-page-header space-y-2 mb-6">
{{-- Breadcrumbs --}}
<div class="filament-breadcrumbs flex items-center gap-2 text-sm">
<a href="{{ route('filament.admin.resources.pallet-validations.index') }}"
class="text-primary-500 hover:underline">
Pallet Validations
</a>
<span class="text-gray-500"> > </span>
<span class="text-gray-600">Create</span>
</div>
<h1 class="text-3xl font-bold tracking-tight">Scan Pallet</h1>
</div>
<div class="filament-form space-y-6">
{{ $this->form }}
</div>
<div class="bg-white shadow rounded-xl p-4">
<livewire:pallet-data-table />
</div>
<div class="filament-actions mt-6">
<x-filament::actions>
@foreach ($this->getFormActions() as $action)
{{ $action }}
@endforeach
</x-filament::actions>
</div>
</form>
@push('scripts')
<script>
window.addEventListener('open-pdf', event => {
const url = event.detail.url;
const win = window.open(url, '_blank');
if (!win || win.closed || typeof win.closed == 'undefined') {
alert('Popup blocked. Please allow popups for this site.');
}
});
</script>
@endpush
</x-filament::page>

View File

@@ -0,0 +1,43 @@
<div class="flex flex-col items-start space-y-2">
<div class="flex items-center">
<input
type="checkbox"
id="is_completed"
wire:model.defer="data.is_completed"
class="focus:outline-none focus:ring-0 focus:border-transparent border-gray-300"
>
<label for="is_completed" style="margin-left:2mm;" class="whitespace-nowrap mb-0">
Is Completed!
</label>
</div>
<button
type="button"
wire:click="markAsComplete"
class="px-2 py-1 border border-primary-500 text-primary-600 rounded hover:bg-primary-50 hover:border-primary-700 transition text-sm"
>
Save Pallet
</button>
<!-- <div class="flex flex-col items-start space-y-2">
<div class="flex items-center space-x-8">
<input
type="checkbox"
id="is_completed"
wire:model.defer="data.is_completed"
class="focus:outline-none focus:ring-0 focus:border-transparent border-gray-300"
>
<label for="is_completed" class="whitespace-nowrap mb-0">
Is Completed!
</label>
<button
type="button"
wire:click="markAsComplete"
class="py-1 px-6 border border-primary-500 text-primary-600 rounded hover:bg-primary-50 hover:border-primary-700 transition text-sm whitespace-nowrap"
>
Save Pallet
</button>
</div>
</div> -->

View File

@@ -0,0 +1,40 @@
<div class="p-4">
<h2 class="text-lg font-bold mb-4 text-gray-700 uppercase tracking-wider">
PALLET DATA TABLE:
</h2>
<div class="overflow-x-auto rounded-lg shadow">
<table class="w-full divide-y divide-gray-200 text-sm text-center">
<thead class="bg-gray-100 text-s font-semibold uppercase text-gray-700">
<tr>
<th class="border px-4 py-2">No</th>
<th class="border px-4 py-2">Created Datetime</th>
<th class="border px-4 py-2">Created By</th>
<th class="border px-4 py-2">Pallet Number</th>
<th class="border px-4 py-2">Serial Number</th>
<th class="border px-4 py-2">Scanned Datetime</th>
<th class="border px-4 py-2">Scanned By</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-100">
@forelse ($records as $index => $record)
<tr class="hover:bg-gray-50">
<td class="border px-4 py-2">{{ $index + 1 }}</td>
<td class="border px-4 py-2 whitespace-nowrap">{{ $record['created_at'] ?? '-' }}</td>
<td class="border px-4 py-2">{{ $record['created_by'] ?? '-' }}</td>
<td class="border px-4 py-2 whitespace-nowrap">{{ $record['pallet_number'] ?? '-' }}</td>
<td class="border px-4 py-2">{{ $record['serial_number'] ?? '-' }}</td>
<td class="border px-4 py-2 whitespace-nowrap">{{ $record['scanned_at'] ?? '-' }}</td>
<td class="border px-4 py-2">{{ $record['scanned_by'] ?? '-' }}</td>
</tr>
@empty
<tr>
<td colspan="7" class="px-4 py-4 text-center text-gray-500">
No pallet records found.
</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</div>