ranjith-dev #1441
@@ -75,6 +75,7 @@ class TestCertificate extends Page implements HasForms
|
|||||||
Select::make('machine_id')
|
Select::make('machine_id')
|
||||||
->label('Work Center')
|
->label('Work Center')
|
||||||
->reactive()
|
->reactive()
|
||||||
|
// ->searchable()
|
||||||
->options(function (callable $get) {
|
->options(function (callable $get) {
|
||||||
|
|
||||||
$plantId = $get('plant_id');
|
$plantId = $get('plant_id');
|
||||||
@@ -1760,10 +1761,20 @@ class TestCertificate extends Page implements HasForms
|
|||||||
$this->filters['production_order'] = $productionOrder;
|
$this->filters['production_order'] = $productionOrder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[On('work-center-updated')]
|
||||||
|
public function updateWorkCenter($workCenter): void
|
||||||
|
{
|
||||||
|
$this->filters['machine_id'] = $workCenter;
|
||||||
|
}
|
||||||
|
|
||||||
#[On('sticker-options')]
|
#[On('sticker-options')]
|
||||||
public function stickerStructure(array $stickerOptions): void
|
public function stickerStructure(array $stickerOptions): void
|
||||||
{
|
{
|
||||||
$this->filters['sticker_options'] = $stickerOptions;
|
$this->filters['sticker_options'] = $stickerOptions;
|
||||||
|
// Automatically select the first sticker
|
||||||
|
$firstStickerId = array_key_first($stickerOptions);
|
||||||
|
|
||||||
|
$this->filters['sticker_id'] = $firstStickerId;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[On('production-order-clear')]
|
#[On('production-order-clear')]
|
||||||
|
|||||||
@@ -176,6 +176,7 @@ class RandomSerialNumberList extends Component
|
|||||||
}
|
}
|
||||||
|
|
||||||
$stickerOptions = [];
|
$stickerOptions = [];
|
||||||
|
$workCenterId = null;
|
||||||
|
|
||||||
foreach ($stickerMappings as $stickerMapping) {
|
foreach ($stickerMappings as $stickerMapping) {
|
||||||
|
|
||||||
@@ -185,9 +186,9 @@ class RandomSerialNumberList extends Component
|
|||||||
|
|
||||||
$stickerMachineId = $stickerMapping->$machineColumn;
|
$stickerMachineId = $stickerMapping->$machineColumn;
|
||||||
|
|
||||||
if ((string) $stickerMachineId != (string) $machineId) {
|
// if ((string) $stickerMachineId != (string) $machineId) {
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
|
|
||||||
$structureColumn = "sticker_structure{$i}_id";
|
$structureColumn = "sticker_structure{$i}_id";
|
||||||
|
|
||||||
@@ -205,6 +206,8 @@ class RandomSerialNumberList extends Component
|
|||||||
$detail->sticker_id;
|
$detail->sticker_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$workCenterId = $stickerMachineId;
|
||||||
|
|
||||||
$this->dispatch('sticker-structure-updated', stickerStructureId: $stickerStructureId);
|
$this->dispatch('sticker-structure-updated', stickerStructureId: $stickerStructureId);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -213,6 +216,8 @@ class RandomSerialNumberList extends Component
|
|||||||
$this->dispatch('sticker-options', stickerOptions: $stickerOptions);
|
$this->dispatch('sticker-options', stickerOptions: $stickerOptions);
|
||||||
|
|
||||||
$this->dispatch('production-order-updated', productionOrder: $productionOrder);
|
$this->dispatch('production-order-updated', productionOrder: $productionOrder);
|
||||||
|
|
||||||
|
$this->dispatch('work-center-updated', workCenter: $workCenterId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function generate(): void
|
public function generate(): void
|
||||||
|
|||||||
Reference in New Issue
Block a user