up
This commit is contained in:
@@ -16,7 +16,8 @@ use Filament\Forms\Components\{
|
||||
TextInput,
|
||||
Select,
|
||||
DatePicker,
|
||||
Section
|
||||
Section,
|
||||
View
|
||||
};
|
||||
use Filament\Tables\Columns\{
|
||||
TextColumn,
|
||||
@@ -64,6 +65,13 @@ class OrdenProduccionResource extends Resource
|
||||
->required(),
|
||||
])
|
||||
->columns(2),
|
||||
|
||||
Section::make('Proceso')
|
||||
->schema([
|
||||
View::make('filament.orden_produccion.timeline')
|
||||
->columnSpanFull(),
|
||||
])
|
||||
->columnSpanFull(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -130,7 +138,7 @@ class OrdenProduccionResource extends Resource
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
RelationManagers\TrasladosRelationManager::class,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\OrdenProduccionResource\RelationManagers;
|
||||
|
||||
use App\Models\TrasladoPrenda;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Tables;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Forms;
|
||||
|
||||
class TrasladosRelationManager extends RelationManager
|
||||
{
|
||||
protected static string $relationship = 'traslados';
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'id';
|
||||
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return $form->schema([
|
||||
Forms\Components\TextInput::make('cantidad_enviada')->numeric(),
|
||||
Forms\Components\TextInput::make('cantidad_recibida')->numeric(),
|
||||
Forms\Components\TextInput::make('residual')->numeric()->disabled(),
|
||||
Forms\Components\Select::make('origen')->options([
|
||||
'confeccion' => 'Confección',
|
||||
'tintoreria' => 'Tintorería',
|
||||
'acabados' => 'Acabados',
|
||||
'bodega' => 'Bodega',
|
||||
]),
|
||||
Forms\Components\Select::make('destino')->options([
|
||||
'confeccion' => 'Confección',
|
||||
'tintoreria' => 'Tintorería',
|
||||
'acabados' => 'Acabados',
|
||||
'bodega' => 'Bodega',
|
||||
]),
|
||||
Forms\Components\Textarea::make('notas')->columnSpanFull(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function table(Tables\Table $table): Tables\Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('id')->label('ID'),
|
||||
TextColumn::make('origen'),
|
||||
TextColumn::make('destino'),
|
||||
TextColumn::make('cantidad_enviada'),
|
||||
TextColumn::make('cantidad_recibida'),
|
||||
TextColumn::make('prendas_defectuosas'),
|
||||
TextColumn::make('reparaciones'),
|
||||
TextColumn::make('saldos'),
|
||||
TextColumn::make('residual'),
|
||||
TextColumn::make('estado'),
|
||||
TextColumn::make('fecha_envio')->dateTime(),
|
||||
TextColumn::make('fecha_recepcion')->dateTime(),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->headerActions([
|
||||
Tables\Actions\CreateAction::make(),
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources;
|
||||
|
||||
use App\Filament\Resources\TrasladoPrendaResource\Pages;
|
||||
use App\Filament\Resources\TrasladoPrendaResource\RelationManagers;
|
||||
use App\Models\TrasladoPrenda;
|
||||
use Filament\Forms;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Tables;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\DateTimePicker;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
|
||||
class TrasladoPrendaResource extends Resource
|
||||
{
|
||||
protected static ?string $model = TrasladoPrenda::class;
|
||||
|
||||
protected static ?string $navigationGroup = 'Gestión';
|
||||
protected static ?string $navigationIcon = 'heroicon-o-switch-horizontal';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
Select::make('origen')->options([
|
||||
'confeccion' => 'Confección',
|
||||
'tintoreria' => 'Tintorería',
|
||||
'acabados' => 'Acabados',
|
||||
'bodega' => 'Bodega',
|
||||
])->required(),
|
||||
|
||||
Select::make('destino')->options([
|
||||
'confeccion' => 'Confección',
|
||||
'tintoreria' => 'Tintorería',
|
||||
'acabados' => 'Acabados',
|
||||
'bodega' => 'Bodega',
|
||||
])->required(),
|
||||
|
||||
TextInput::make('cantidad_enviada')->numeric()->required(),
|
||||
TextInput::make('cantidad_recibida')->numeric()->nullable(),
|
||||
TextInput::make('prendas_defectuosas')->numeric()->nullable(),
|
||||
TextInput::make('reparaciones')->numeric()->nullable(),
|
||||
TextInput::make('saldos')->numeric()->nullable(),
|
||||
TextInput::make('residual')->numeric()->disabled()->dehydrated(false),
|
||||
DateTimePicker::make('fecha_envio')->nullable(),
|
||||
DateTimePicker::make('fecha_recepcion')->nullable(),
|
||||
Select::make('estado')->options([
|
||||
'pendiente' => 'Pendiente',
|
||||
'realizado' => 'Realizado',
|
||||
'recibido' => 'Recibido',
|
||||
])->default('pendiente'),
|
||||
Textarea::make('notas')->columnSpanFull(),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('id')->sortable(),
|
||||
TextColumn::make('origen'),
|
||||
TextColumn::make('destino'),
|
||||
TextColumn::make('cantidad_enviada'),
|
||||
TextColumn::make('cantidad_recibida'),
|
||||
TextColumn::make('prendas_defectuosas'),
|
||||
TextColumn::make('reparaciones'),
|
||||
TextColumn::make('saldos'),
|
||||
TextColumn::make('residual'),
|
||||
TextColumn::make('estado'),
|
||||
TextColumn::make('fecha_envio')->dateTime(),
|
||||
TextColumn::make('fecha_recepcion')->dateTime(),
|
||||
TextColumn::make('referencia_type')->label('Referencia'),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => Pages\ListTrasladoPrendas::route('/'),
|
||||
'create' => Pages\CreateTrasladoPrenda::route('/create'),
|
||||
'edit' => Pages\EditTrasladoPrenda::route('/{record}/edit'),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\TrasladoPrendaResource\Pages;
|
||||
|
||||
use App\Filament\Resources\TrasladoPrendaResource;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateTrasladoPrenda extends CreateRecord
|
||||
{
|
||||
protected static string $resource = TrasladoPrendaResource::class;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\TrasladoPrendaResource\Pages;
|
||||
|
||||
use App\Filament\Resources\TrasladoPrendaResource;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditTrasladoPrenda extends EditRecord
|
||||
{
|
||||
protected static string $resource = TrasladoPrendaResource::class;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\TrasladoPrendaResource\Pages;
|
||||
|
||||
use App\Filament\Resources\TrasladoPrendaResource;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListTrasladoPrendas extends ListRecords
|
||||
{
|
||||
protected static string $resource = TrasladoPrendaResource::class;
|
||||
}
|
||||
Reference in New Issue
Block a user