diff --git a/app/Filament/Pages/LocatorValidation.php b/app/Filament/Pages/LocatorValidation.php index 034769820..c75096cf4 100644 --- a/app/Filament/Pages/LocatorValidation.php +++ b/app/Filament/Pages/LocatorValidation.php @@ -72,14 +72,14 @@ class LocatorValidation extends Page implements HasForms ->label('Scan Pallet No') ->reactive() // ->readonly(fn () => $this->disablePalletNo) - ->readOnly(fn (callable $get) => !empty($get('scan_serial_no')) || !empty($get('scan_locator_no'))) + ->readOnly(fn (callable $get) => !$get('plant_id') || !empty($get('scan_serial_no')) || !empty($get('scan_locator_no'))) ->extraAttributes([ 'wire:keydown.enter' => 'processPalletNo($event.target.value)', ]), TextInput::make('scan_serial_no') ->label('Scan Serial No') // ->readOnly(fn () => $this->disableSerialNo) - ->readOnly(fn (callable $get) => !empty($get('scan_pallet_no')) || !empty($get('scan_locator_no'))) + ->readOnly(fn (callable $get) => !$get('plant_id') || !empty($get('scan_pallet_no')) || !empty($get('scan_locator_no'))) ->reactive() ->extraAttributes([ 'wire:keydown.enter' => 'processSerialNo($event.target.value)', @@ -87,7 +87,7 @@ class LocatorValidation extends Page implements HasForms TextInput::make('scan_locator_no') ->label('Scan Locator No') ->reactive() - // ->readOnly(fn ($get) => filled($get('scan_locator_no'))) + ->readOnly(fn (callable $get) => !$get('plant_id') || (!$get('scan_pallet_no') && !$get('scan_serial_no'))) ->extraAttributes([ 'id' => 'scan_locator_no', 'wire:keydown.enter' => 'processLocatorNo($event.target.value)',