Added coil packing data livewire table
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 28s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Failing after 9s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 1m6s
Laravel Pint / pint (pull_request) Successful in 3m37s
Laravel Larastan / larastan (pull_request) Failing after 6m27s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 28s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Failing after 9s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 1m6s
Laravel Pint / pint (pull_request) Successful in 3m37s
Laravel Larastan / larastan (pull_request) Failing after 6m27s
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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user