Updated readonly rule

This commit is contained in:
dhanabalan
2025-07-02 16:05:25 +05:30
parent fd3ef4656c
commit c4b4993e1d

View File

@@ -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)',