1
0
forked from poc/pds

removed live () in production quantity page

This commit is contained in:
dhanabalan
2025-07-15 13:48:30 +05:30
parent d1894e0d35
commit 2541300910

View File

@@ -130,7 +130,6 @@ class ProductionQuantityPage extends Page implements HasForms
->options(Plant::pluck('name', 'id'))
->label('Plant')
->reactive()
->live()
->required()
->columnSpan(1)
->default(function () {
@@ -163,7 +162,7 @@ class ProductionQuantityPage extends Page implements HasForms
->label('Block')
->required()
// ->nullable()
->live()
->reactive()
->columnSpan(1)
->options(function (callable $get) {
if (!$get('plant_id')) {
@@ -174,7 +173,6 @@ class ProductionQuantityPage extends Page implements HasForms
->pluck('name', 'id')
->toArray();
})
->reactive()
->default(function () {
$latestShiftId = optional(ProductionQuantity::latest()->first())->shift_id;
return optional(Shift::where('id', $latestShiftId)->first())->block_id;
@@ -276,7 +274,6 @@ class ProductionQuantityPage extends Page implements HasForms
->toArray();
})
->reactive()
->live()
->default(function () {
return optional(ProductionQuantity::latest()->first())->line_id;
})
@@ -323,7 +320,6 @@ class ProductionQuantityPage extends Page implements HasForms
TextInput::make('production_order')
->label('Production Order')
->reactive()
->live()
->required()
->columnSpan(1)
->afterStateUpdated(function ($state, callable $get, callable $set): void {
@@ -344,9 +340,9 @@ class ProductionQuantityPage extends Page implements HasForms
->columnSpan(1)
->autofocus(true)
->reactive()
->live()
->default(fn () => $this->clear_qr)
->extraAttributes([
'wire:ignore' => '',
'wire:keydown.enter' => 'processAllValues($event.target.value)',
]),
@@ -383,7 +379,6 @@ class ProductionQuantityPage extends Page implements HasForms
// })
->default(fn () => $this->recQr)
->readOnly(true),
TextInput::make('id')
@@ -417,36 +412,6 @@ class ProductionQuantityPage extends Page implements HasForms
$user = Filament::auth()->user(); //->name
$operatorName = $user->name;
$this->qrData = $formQRData;
// dd($formData, $formQRData);
// dd($this->form->getState()['serial_number']);
// try {
// // Access the nested form data
// $componentData = json_decode($formValues['components'][0]['snapshot'], true);
// $formData = $componentData['data']['data'][0]; // Access first item in data array
// // Extract specific values
// $this->qrData = $formQRData ?? $formData['item_code'];
// $this->pId = $formData['plant_id'] ?? null;
// $this->bId = $formData['block_name'] ?? null;
// $this->sId = $formData['shift_id'] ?? null;
// $this->lId = $formData['line_id'] ?? null;
// $this->iId = $formData['item_id'] ?? null;
// $this->succId = $formData['success_msg'] ?? null;
// // $this->sNoId = $formData['serial_number'] ?? null;
// $this->prodOrder = $formData['production_order'] ?? null;
// $this->recQr = $formData['recent_qr'] ?? null;
// $this->dispatch('plant-line-updated', $this->pId,$this->lId);
// } catch (\Exception $e) {
// //dd('Error parsing form data:', $e->getMessage(), $formValues);
// Notification::make()
// ->title("Error Parsing Form Data") // {$operatorName}
// ->body($e->getMessage())
// ->danger()
// // ->persistent()
// ->send();
// return;
// }
$latestProductionQuantity = ProductionQuantity::latest()->first();