1
0
forked from poc/pds

After Production Quantity and Overall Validation

This commit is contained in:
dhanabalan
2025-03-30 23:04:29 +05:30
parent e46f290fd1
commit 6e44b690f1
16 changed files with 1726 additions and 407 deletions

View File

@@ -21,6 +21,8 @@ class StickerMasterResource extends Resource
protected static ?string $navigationGroup = 'Master Entries';
protected static ?int $navigationSort = 8;
public static function form(Form $form): Form
{
return $form
@@ -28,17 +30,27 @@ class StickerMasterResource extends Resource
Forms\Components\Select::make('plant_id')
->relationship('plant', 'name')
->reactive()
->afterStateUpdated(fn (callable $set) => $set('item_id', null))
->nullable()
->afterStateUpdated(fn (callable $set) =>
$set('item_id', null) & $set('item_description', null)
)
->required(),
Forms\Components\Select::make('item_id')
->label('Item Code')
->options(fn (callable $get) =>
\App\Models\Item::where('plant_id', $get('plant_id'))
->pluck('code', 'id')
)
->options(function (callable $get) {
if (!$get('plant_id')) {
return [];
}
return \App\Models\Item::where('plant_id', $get('plant_id'))
->pluck('code', 'id')
->toArray();
})
->required()
->nullable()
->searchable()
->reactive()
->live(debounce: 500) // Enable live updates
->afterStateUpdated(function ($state, callable $set, callable $get) {
$plantId = $get('plant_id'); // Get selected plant_id
@@ -180,11 +192,9 @@ class StickerMasterResource extends Resource
->label('ID')
->numeric()
->sortable(),
Tables\Columns\TextColumn::make('item.id')
->numeric()
Tables\Columns\TextColumn::make('item.code')
->sortable(),
Tables\Columns\TextColumn::make('plant.name')
->numeric()
->sortable(),
Tables\Columns\CheckboxColumn::make('serial_number_motor')
->disabled(true)