Added export button in non planned production page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Laravel Pint / pint (pull_request) Successful in 4m48s
Laravel Larastan / larastan (pull_request) Failing after 5m57s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Laravel Pint / pint (pull_request) Successful in 4m48s
Laravel Larastan / larastan (pull_request) Failing after 5m57s
This commit is contained in:
@@ -174,6 +174,53 @@ class ProductionNonPlannedReport extends Page implements HasForms
|
||||
}
|
||||
}
|
||||
|
||||
public function exportNonPlan(){
|
||||
$plantId = $this->filters['plant_id'] ?? null;
|
||||
$lineId = $this->filters['line_id'] ?? null;
|
||||
$date = $this->filters['date'] ?? null;
|
||||
|
||||
$selectedDate = Carbon::parse($date);
|
||||
|
||||
$date = $selectedDate->toDateString();
|
||||
$month = $selectedDate->month;
|
||||
$year = $selectedDate->year;
|
||||
|
||||
if (! $plantId) {
|
||||
Notification::make()
|
||||
->title('Plant')
|
||||
->body("please select plant to export data..!")
|
||||
->danger()
|
||||
->send();
|
||||
return;
|
||||
}
|
||||
else if (! $lineId) {
|
||||
Notification::make()
|
||||
->title('Line')
|
||||
->body("please select line to export data..!")
|
||||
->danger()
|
||||
->send();
|
||||
return;
|
||||
}
|
||||
else if (! $year) {
|
||||
Notification::make()
|
||||
->title('Year')
|
||||
->body("please select year to export data..!")
|
||||
->danger()
|
||||
->send();
|
||||
return;
|
||||
}
|
||||
else if (! $month) {
|
||||
Notification::make()
|
||||
->title('Month')
|
||||
->body("please select month to export data..!")
|
||||
->danger()
|
||||
->send();
|
||||
return;
|
||||
}
|
||||
|
||||
$this->dispatch('loadDataExport' ,$plantId, $lineId, $year, $month);
|
||||
}
|
||||
|
||||
public static function canAccess(): bool
|
||||
{
|
||||
return Auth::check() && Auth::user()->can('view production non planned page');
|
||||
|
||||
@@ -5,6 +5,13 @@
|
||||
<div class="space-y-4">
|
||||
{{ $this->form }}
|
||||
</div>
|
||||
<x-filament::button
|
||||
wire:click="exportNonPlan"
|
||||
color="primary"
|
||||
class="mt-4"
|
||||
>
|
||||
Export
|
||||
</x-filament::button>
|
||||
<x-filament::button
|
||||
wire:click="generateNonPlan"
|
||||
color="primary"
|
||||
|
||||
Reference in New Issue
Block a user