Merge pull request 'Added genearte button in production target page' (#1171) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 21s
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 21s
Reviewed-on: #1171
This commit was merged in pull request #1171.
This commit is contained in:
@@ -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');
|
||||
|
||||
@@ -12,6 +12,13 @@
|
||||
>
|
||||
Export
|
||||
</x-filament::button>
|
||||
<x-filament::button
|
||||
wire:click="generate"
|
||||
color="primary"
|
||||
class="mt-4"
|
||||
>
|
||||
Generate
|
||||
</x-filament::button>
|
||||
<div class="bg-white shadow rounded-xl p-4 mt-6">
|
||||
<livewire:production-target-plan />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user