Merge pull request 'ranjith-dev' (#1003) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #1003
This commit was merged in pull request #1003.
This commit is contained in:
53
app/Livewire/CoilPackDataTable.php
Normal file
53
app/Livewire/CoilPackDataTable.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire;
|
||||
|
||||
use App\Models\CoilPacking;
|
||||
use Livewire\Component;
|
||||
|
||||
class CoilPackDataTable extends Component
|
||||
{
|
||||
|
||||
public $plantId;
|
||||
|
||||
public $coilPackNo;
|
||||
|
||||
public $snoCount = 0;
|
||||
|
||||
public $records = [];
|
||||
|
||||
protected $listeners = [
|
||||
'loadData' => 'loadCoilData',
|
||||
];
|
||||
|
||||
public function loadCoilData($coilPackNo, $plantId)
|
||||
{
|
||||
$this->plantId = $plantId;
|
||||
$this->coilPackNo = $coilPackNo;
|
||||
$this->records = [];
|
||||
|
||||
$this->records = CoilPacking::query()
|
||||
->where('plant_id', $this->plantId)
|
||||
->where('coil_packing_number', $this->coilPackNo)
|
||||
->orderBy('scanned_at')
|
||||
->get()
|
||||
->map(function ($record) {
|
||||
return [
|
||||
'created_at' => $record->created_at,
|
||||
'created_by' => $record->created_by ?? '',
|
||||
'coil_packing_number' => $record->coil_packing_number,
|
||||
'item_code' => $record->item?->code ?? '',
|
||||
'item_description' => $record->item?->description ?? '',
|
||||
'process_order' => $record->process_order,
|
||||
'scanned_at' => $record->scanned_at,
|
||||
'scanned_by' => $record->scanned_by ?? '',
|
||||
];
|
||||
})
|
||||
->toArray();
|
||||
|
||||
}
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.coil-pack-data-table');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
|
||||
<x-filament::page>
|
||||
|
||||
<div class="filament-form space-y-6">
|
||||
{{ $this->form }}
|
||||
</div>
|
||||
|
||||
<div class="bg-white shadow rounded-xl p-4">
|
||||
<livewire:coil-pack-data-table />
|
||||
</div>
|
||||
|
||||
<div class="filament-actions mt-6">
|
||||
<x-filament::actions>
|
||||
@foreach ($this->getFormActions() as $action)
|
||||
{{ $action }}
|
||||
@endforeach
|
||||
</x-filament::actions>
|
||||
</div>
|
||||
|
||||
@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>
|
||||
46
resources/views/livewire/coil-pack-data-table.blade.php
Normal file
46
resources/views/livewire/coil-pack-data-table.blade.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<div class="p-4">
|
||||
<h2 class="text-lg font-bold mb-4 text-gray-700 uppercase tracking-wider">
|
||||
CP 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 whitespace-nowrap">Created By</th>
|
||||
<th class="border px-4 py-2 whitespace-nowrap">CPacking No</th>
|
||||
<th class="border px-4 py-2 whitespace-nowrap">Item Code</th>
|
||||
<th class="border px-4 py-2">Description</th>
|
||||
<th class="border px-4 py-2">Coil No</th>
|
||||
<th class="border px-4 py-2">Scanned Datetime</th>
|
||||
<th class="border px-4 py-2 whitespace-nowrap">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 whitespace-nowrap">{{ $record['created_by'] ?? '-' }}</td>
|
||||
<td class="border px-4 py-2 whitespace-nowrap">{{ $record['coil_packing_number'] ?? '-' }}</td>
|
||||
<td class="border px-4 py-2">{{ $record['item_code'] ?? '-' }}</td>
|
||||
<td class="border px-4 py-2 whitespace-nowrap">{{ $record['item_description'] ?? '-' }}</td>
|
||||
<td class="border px-4 py-2 whitespace-nowrap">{{ $record['process_order'] ?? '-' }}</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="10" class="px-4 py-4 text-center text-gray-500">
|
||||
No coil packing records found.
|
||||
</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@ Route::get('laser/characteristics/check', [CharacteristicsController::class, 'ch
|
||||
|
||||
Route::post('laser/characteristics/data', [CharacteristicsController::class, 'storeClassChar']);
|
||||
|
||||
// ..Marked serial (auto or manual)
|
||||
// ..Marked / Stopped serial (auto or manual)
|
||||
|
||||
Route::post('laser/characteristics/status', [CharacteristicsController::class, 'storeLaserStatus']);
|
||||
|
||||
@@ -224,10 +224,12 @@ Route::post('laser/characteristics/status', [CharacteristicsController::class, '
|
||||
|
||||
Route::post('laser/winded-serial/status', [CharacteristicsController::class, 'storeLaserWindStatus']);
|
||||
|
||||
// ..Request Characteristics
|
||||
// ..Request Characteristics / Quality - Store
|
||||
|
||||
Route::post('laser/characteristics/change', [CharacteristicsController::class, 'storeLaserRequestChar']);
|
||||
|
||||
// ..Request and Stop / Characteristics / Quality - Status
|
||||
|
||||
Route::get('laser/characteristics/request', [CharacteristicsController::class, 'getLaserRequestChar']);
|
||||
|
||||
Route::post('laser-doc-pdf', [PdfController::class, 'storeLaserPdf']);
|
||||
@@ -277,3 +279,7 @@ Route::post('vehicle/entry', [VehicleController::class, 'storeVehicleEntry']);
|
||||
Route::get('item-code', [PlantController::class, 'getItemCode']);
|
||||
|
||||
// Route::post('laser-stop-report', [SapFileController::class, 'laserStopReport']);
|
||||
|
||||
//..Coil Packing
|
||||
|
||||
Route::get('/download-coil-qr-pdf/{palletNo}', [PalletController::class, 'downloadCoilQrPdf'])->name('download-coil-qr-pdf');
|
||||
|
||||
Reference in New Issue
Block a user