Added operator_id column, and searchable filter in view
This commit is contained in:
@@ -376,6 +376,9 @@ class ProductionLineStopResource extends Resource
|
|||||||
Tables\Columns\TextColumn::make('plant.name')
|
Tables\Columns\TextColumn::make('plant.name')
|
||||||
->label('Plant')
|
->label('Plant')
|
||||||
->sortable(),
|
->sortable(),
|
||||||
|
Tables\Columns\TextColumn::make('operator_id')
|
||||||
|
->label('Operator ID')
|
||||||
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('created_at')
|
Tables\Columns\TextColumn::make('created_at')
|
||||||
->label('Created At')
|
->label('Created At')
|
||||||
->dateTime()
|
->dateTime()
|
||||||
@@ -407,7 +410,6 @@ class ProductionLineStopResource extends Resource
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
//block
|
//block
|
||||||
|
|
||||||
Select::make('Block')
|
Select::make('Block')
|
||||||
->label('Select Block')
|
->label('Select Block')
|
||||||
->options(fn (callable $get) =>
|
->options(fn (callable $get) =>
|
||||||
@@ -418,7 +420,6 @@ class ProductionLineStopResource extends Resource
|
|||||||
->reactive(),
|
->reactive(),
|
||||||
|
|
||||||
//shift
|
//shift
|
||||||
|
|
||||||
Select::make('Shift')
|
Select::make('Shift')
|
||||||
->label('Select Shift')
|
->label('Select Shift')
|
||||||
->options(function (callable $get) {
|
->options(function (callable $get) {
|
||||||
@@ -436,7 +437,6 @@ class ProductionLineStopResource extends Resource
|
|||||||
->reactive(),
|
->reactive(),
|
||||||
|
|
||||||
//line
|
//line
|
||||||
|
|
||||||
Select::make('line')
|
Select::make('line')
|
||||||
->label('Select line')
|
->label('Select line')
|
||||||
->options(function (callable $get) {
|
->options(function (callable $get) {
|
||||||
|
|||||||
@@ -514,10 +514,16 @@ class ProductionPlanResource extends Resource
|
|||||||
->numeric()
|
->numeric()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('line.name')
|
Tables\Columns\TextColumn::make('line.name')
|
||||||
->sortable(),
|
->sortable()
|
||||||
|
->searchable(),
|
||||||
Tables\Columns\TextColumn::make('shift.name')
|
Tables\Columns\TextColumn::make('shift.name')
|
||||||
->sortable(),
|
->sortable()
|
||||||
|
->searchable(),
|
||||||
Tables\Columns\TextColumn::make('plant.name')
|
Tables\Columns\TextColumn::make('plant.name')
|
||||||
|
->sortable()
|
||||||
|
->searchable(),
|
||||||
|
Tables\Columns\TextColumn::make('operator_id')
|
||||||
|
->label('Operator ID')
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('created_at')
|
Tables\Columns\TextColumn::make('created_at')
|
||||||
->dateTime()
|
->dateTime()
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ use App\Filament\Resources\QualityValidationResource\RelationManagers;
|
|||||||
use App\Models\QualityValidation;
|
use App\Models\QualityValidation;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Closure;
|
use Closure;
|
||||||
|
use Filament\Facades\Filament;
|
||||||
use Filament\Forms;
|
use Filament\Forms;
|
||||||
use Filament\Forms\Components\DatePicker;
|
use Filament\Forms\Components\DatePicker;
|
||||||
use Filament\Forms\Components\DateTimePicker;
|
use Filament\Forms\Components\DateTimePicker;
|
||||||
@@ -21,6 +22,7 @@ use Illuminate\Database\Eloquent\Builder;
|
|||||||
use Illuminate\Database\Eloquent\Factories\Relationship;
|
use Illuminate\Database\Eloquent\Factories\Relationship;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
use Filament\Tables\Filters\Filter;
|
use Filament\Tables\Filters\Filter;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Validation\ValidationException;
|
use Illuminate\Validation\ValidationException;
|
||||||
|
|
||||||
|
|
||||||
@@ -37,7 +39,7 @@ class QualityValidationResource extends Resource
|
|||||||
public static function form(Form $form): Form
|
public static function form(Form $form): Form
|
||||||
{
|
{
|
||||||
return $form
|
return $form
|
||||||
->schema([
|
->schema(components: [
|
||||||
Forms\Components\Select::make('plant_id')
|
Forms\Components\Select::make('plant_id')
|
||||||
->relationship('plant', 'name')
|
->relationship('plant', 'name')
|
||||||
->reactive()
|
->reactive()
|
||||||
@@ -51,6 +53,8 @@ class QualityValidationResource extends Resource
|
|||||||
->required(),
|
->required(),
|
||||||
Forms\Components\TextInput::make('production_order')
|
Forms\Components\TextInput::make('production_order')
|
||||||
->required(),
|
->required(),
|
||||||
|
Forms\Components\Hidden::make('operator_id')
|
||||||
|
->default(Filament::auth()->user()->name),
|
||||||
|
|
||||||
Forms\Components\TextInput::make('item_id')
|
Forms\Components\TextInput::make('item_id')
|
||||||
->label('Item Code')
|
->label('Item Code')
|
||||||
@@ -1646,6 +1650,18 @@ class QualityValidationResource extends Resource
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// public static function mutateFormDataBeforeCreate(array $data): array
|
||||||
|
// {
|
||||||
|
// $user =Filament::auth()->user();
|
||||||
|
// dd($user);
|
||||||
|
// if($user){
|
||||||
|
// $data['operator_id'] = $user->name;
|
||||||
|
// }
|
||||||
|
// // $data['operator_id'] = Filament::auth()->user()->name;
|
||||||
|
// return $data;
|
||||||
|
// }
|
||||||
|
|
||||||
public static function getRelations(): array
|
public static function getRelations(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ class QualityValidation extends Model
|
|||||||
'part_validation3',
|
'part_validation3',
|
||||||
'part_validation4',
|
'part_validation4',
|
||||||
'part_validation5',
|
'part_validation5',
|
||||||
|
'operator_id',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function stickerMaster(): BelongsTo
|
public function stickerMaster(): BelongsTo
|
||||||
|
|||||||
Reference in New Issue
Block a user