feat: improve visits filter UX and update currency label
This commit is contained in:
@@ -19,4 +19,40 @@ protected function getHeaderActions(): array
|
||||
->icon('heroicon-o-plus'),
|
||||
];
|
||||
}
|
||||
|
||||
protected function getHeaderWidgets(): array
|
||||
{
|
||||
return VisitResource::getWidgets();
|
||||
}
|
||||
|
||||
public function applyTableFilters(): void
|
||||
{
|
||||
parent::applyTableFilters();
|
||||
$this->dispatchStatsUpdate();
|
||||
}
|
||||
|
||||
public function updatedTableFilters(): void
|
||||
{
|
||||
parent::updatedTableFilters();
|
||||
$this->dispatchStatsUpdate();
|
||||
}
|
||||
|
||||
public function resetTableFiltersForm(): void
|
||||
{
|
||||
parent::resetTableFiltersForm();
|
||||
$this->dispatchStatsUpdate();
|
||||
}
|
||||
|
||||
protected function dispatchStatsUpdate(): void
|
||||
{
|
||||
$filters = $this->tableFilters ?? [];
|
||||
|
||||
$this->dispatch('visit-stats-updated',
|
||||
fromDate: ($filters['visit_date_range']['from_date'] ?? null) ?: null,
|
||||
toDate: ($filters['visit_date_range']['to_date'] ?? null) ?: null,
|
||||
doctor: isset($filters['doctor']['value']) && $filters['doctor']['value'] !== '' ? (int) $filters['doctor']['value'] : null,
|
||||
treatment: isset($filters['treatment']['value']) && $filters['treatment']['value'] !== '' ? (int) $filters['treatment']['value'] : null,
|
||||
paymentType: isset($filters['payment_type']['value']) && $filters['payment_type']['value'] !== '' ? (int) $filters['payment_type']['value'] : null,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user