diff --git a/app/Filament/Pages/ProductionTarget.php b/app/Filament/Pages/ProductionTarget.php index 881730a9..aa2253db 100644 --- a/app/Filament/Pages/ProductionTarget.php +++ b/app/Filament/Pages/ProductionTarget.php @@ -159,7 +159,7 @@ class ProductionTarget extends Page $month = (int) $get('month'); $category = $get('category'); - $this->dispatch('loadData',$year, $month, $plantId, $lineId, $category); + }), ]) @@ -217,7 +217,21 @@ class ProductionTarget extends Page $lineId = $this->filters['line_id'] ?? null; $year = $this->filters['year'] ?? null; $month = (int) $this->filters['month'] ?? null; - $this->dispatch('loadData',$year, $month, $plantId, $lineId, ''); + $category = $this->filters['category'] ?? null; + if($category == '' || $category == null){ + // $this->dispatch('loadData',$year, $month, $plantId, $lineId, ''); + $this->dispatch( + 'loadData', + (int) $year, + (int) $month, + (int) $plantId, + (int) $lineId + ); + } + else{ + $this->dispatch('loadDataCategory',$year, $month, $plantId, $lineId, $category); + } + } public static function canAccess(): bool