Commented enter logic and added export functionality
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Filament\Resources;
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Filament\Exports\ProductionQuantityExporter;
|
||||||
use App\Filament\Imports\ProductionQuantityImporter;
|
use App\Filament\Imports\ProductionQuantityImporter;
|
||||||
use App\Filament\Resources\ProductionQuantityResource\Pages;
|
use App\Filament\Resources\ProductionQuantityResource\Pages;
|
||||||
use App\Filament\Resources\ProductionQuantityResource\RelationManagers;
|
use App\Filament\Resources\ProductionQuantityResource\RelationManagers;
|
||||||
@@ -20,6 +21,7 @@ use Illuminate\Database\Eloquent\Builder;
|
|||||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
use Filament\Forms\Components\Section;
|
use Filament\Forms\Components\Section;
|
||||||
use Filament\Notifications\Notification;
|
use Filament\Notifications\Notification;
|
||||||
|
use Filament\Tables\Actions\ExportAction;
|
||||||
|
|
||||||
class ProductionQuantityResource extends Resource
|
class ProductionQuantityResource extends Resource
|
||||||
{
|
{
|
||||||
@@ -245,7 +247,7 @@ class ProductionQuantityResource extends Resource
|
|||||||
// ->required()
|
// ->required()
|
||||||
->reactive()
|
->reactive()
|
||||||
->autofocus(true)
|
->autofocus(true)
|
||||||
->debounce(300)
|
->debounce(1000)
|
||||||
// ->submitOnEnter()
|
// ->submitOnEnter()
|
||||||
->afterStateUpdated(function ($state, callable $get, callable $set) {
|
->afterStateUpdated(function ($state, callable $get, callable $set) {
|
||||||
// **Check if input is empty before processing**
|
// **Check if input is empty before processing**
|
||||||
@@ -709,6 +711,11 @@ class ProductionQuantityResource extends Resource
|
|||||||
])
|
])
|
||||||
->hint(fn ($get) => $get('validationError') ? $get('validationError') : null)
|
->hint(fn ($get) => $get('validationError') ? $get('validationError') : null)
|
||||||
->hintColor('danger'),
|
->hintColor('danger'),
|
||||||
|
// ->extraAttributes([
|
||||||
|
// 'x-data' => '{ value: "" }',
|
||||||
|
// 'x-model' => 'value',
|
||||||
|
// 'x-on:keydown.enter.prevent' => '$wire.processQr(value)',
|
||||||
|
// ]),
|
||||||
Forms\Components\Hidden::make('item_id')
|
Forms\Components\Hidden::make('item_id')
|
||||||
->required(),
|
->required(),
|
||||||
Forms\Components\TextInput::make('serial_number')
|
Forms\Components\TextInput::make('serial_number')
|
||||||
@@ -792,8 +799,10 @@ class ProductionQuantityResource extends Resource
|
|||||||
])
|
])
|
||||||
->headerActions([
|
->headerActions([
|
||||||
ImportAction::make()
|
ImportAction::make()
|
||||||
->importer(ProductionQuantityImporter::class)
|
->importer(ProductionQuantityImporter::class)
|
||||||
->maxRows(100000),
|
->maxRows(100000),
|
||||||
|
ExportAction::make()
|
||||||
|
->exporter(ProductionQuantityExporter::class),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user