excel aufstellung finale
This commit is contained in:
1 parent
ebb51923a6
commit
ebff82bd0e
19 files changed
+4766
-82
No files matched your search
@@ -3,6 +3,7 @@
|
||||
namespace App\Filament\Resources\Projektes\RelationManagers;
|
||||
|
||||
use App\Actions\Create\CreateProjektMethoden;
|
||||
use App\Models\Aufstellung;
|
||||
use App\Models\Methode;
|
||||
use App\Models\ProjektMethode;
|
||||
use App\Models\ProjektObjekteImDetail;
|
||||
@@ -52,6 +53,17 @@ class ProjektMethodesRelationManager extends RelationManager
|
||||
})->validationMessages([
|
||||
'required' => 'Die Eingabe einer Methode ist erforderlich.',
|
||||
]),
|
||||
SelectColumn::make('aufstellung_id')
|
||||
->label('Aufstellung')
|
||||
->optionsRelationship('aufstellung', 'name')
|
||||
->preloadOptions()
|
||||
->rules(['required'])
|
||||
->afterStateUpdated(function (Component $livewire) {
|
||||
$livewire->dispatch('refreshMethods');
|
||||
})->validationMessages([
|
||||
'required' => 'Die Eingabe einer Aufstellung ist erforderlich.',
|
||||
]),
|
||||
|
||||
TextColumn::make('raumart')
|
||||
->searchable(),
|
||||
TextInputColumn::make('faktor')
|
||||
@@ -166,6 +178,28 @@ class ProjektMethodesRelationManager extends RelationManager
|
||||
})->after(function (Component $livewire) {
|
||||
$livewire->dispatch('refreshMethods');
|
||||
}),
|
||||
BulkAction::make('aufstellung')
|
||||
->color('primary')
|
||||
->label('Aufstellung zuweisen')
|
||||
->schema([
|
||||
Select::make('aufstellung_id')
|
||||
->label('Aufstellung')
|
||||
->prefixIcon('phosphor-finn-the-human')
|
||||
->options(Aufstellung::pluck('name', 'id'))
|
||||
->required(),
|
||||
])
|
||||
->icon('phosphor-finn-the-human')
|
||||
->action(function (Collection $records, array $data): void {
|
||||
foreach ($records as $record) {
|
||||
/** @var object $record */
|
||||
ProjektMethode::where('id', '=', $record->id)
|
||||
->update(
|
||||
['aufstellung_id' => $data['aufstellung_id']]
|
||||
);
|
||||
}
|
||||
})->after(function (Component $livewire) {
|
||||
$livewire->dispatch('refreshMethods');
|
||||
}),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user