diff --git a/app/Filament/Pages/ProductionTarget.php b/app/Filament/Pages/ProductionTarget.php
index 9e84523b..881730a9 100644
--- a/app/Filament/Pages/ProductionTarget.php
+++ b/app/Filament/Pages/ProductionTarget.php
@@ -137,16 +137,16 @@ class ProductionTarget extends Page
->pluck('name', 'id')
->toArray();
})
- ->reactive()
- ->afterStateUpdated(function ($state, callable $get, $set) {
- $plantId = $get('plant_id');
- $lineId = $state;
- // $month = $get('month');
- $year = $get('year');
+ ->reactive(),
+ // ->afterStateUpdated(function ($state, callable $get, $set) {
+ // $plantId = $get('plant_id');
+ // $lineId = $state;
+ // // $month = $get('month');
+ // $year = $get('year');
- $month = (int) $get('month');
- $this->dispatch('loadData',$year, $month, $plantId, $lineId, '');
- }),
+ // $month = (int) $get('month');
+ // $this->dispatch('loadData',$year, $month, $plantId, $lineId, '');
+ // }),
TextInput::make('category')
->label('Category')
@@ -212,6 +212,14 @@ class ProductionTarget extends Page
// $this->dispatch('loadDataMonthly' ,$plantId, $lineId, $year, $month);
}
+ public function generate(){
+ $plantId = $this->filters['plant_id'] ?? null;
+ $lineId = $this->filters['line_id'] ?? null;
+ $year = $this->filters['year'] ?? null;
+ $month = (int) $this->filters['month'] ?? null;
+ $this->dispatch('loadData',$year, $month, $plantId, $lineId, '');
+ }
+
public static function canAccess(): bool
{
return Auth::check() && Auth::user()->can('view production target page');
diff --git a/resources/views/filament/pages/production-target.blade.php b/resources/views/filament/pages/production-target.blade.php
index 242dbbbb..fed44e30 100644
--- a/resources/views/filament/pages/production-target.blade.php
+++ b/resources/views/filament/pages/production-target.blade.php
@@ -12,6 +12,13 @@
>
Export
+