feat(formula): menambahkan kondisi untuk update dan delete data
- mengilangkan filter outlet di overview dan analysis jika hanya terdapat 1 outlet saja
This commit is contained in:
parent
62e2182dd2
commit
8077f626ac
@ -16,15 +16,16 @@
|
||||
|
||||
<flux:separator vertical class="hidden lg:block mx-2 my-2" />
|
||||
|
||||
<div class="flex flex-wrap gap-2 w-full sm:w-auto">
|
||||
<flux:checkbox.group wire:model.live="selectedOutletIds" variant="buttons">
|
||||
@foreach ($outlets as $key => $value)
|
||||
<flux:checkbox value="{{ $key }}" label="{{ $value }}" />
|
||||
@endforeach
|
||||
</flux:checkbox.group>
|
||||
</div>
|
||||
|
||||
<flux:separator vertical class="hidden lg:block mx-2 my-2" />
|
||||
@if (count($outlets) > 1)
|
||||
<div class="flex flex-wrap gap-2 w-full sm:w-auto">
|
||||
<flux:checkbox.group wire:model.live="selectedOutletIds" variant="buttons">
|
||||
@foreach ($outlets as $key => $value)
|
||||
<flux:checkbox value="{{ $key }}" label="{{ $value }}" />
|
||||
@endforeach
|
||||
</flux:checkbox.group>
|
||||
</div>
|
||||
<flux:separator vertical class="hidden lg:block mx-2 my-2" />
|
||||
@endif
|
||||
|
||||
<div class="w-full sm:w-auto">
|
||||
<flux:date-picker mode="range" wire:model.live="range">
|
||||
@ -39,7 +40,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<flux:separator class="mb-6"/>
|
||||
<flux:separator class="mb-6" />
|
||||
|
||||
<flux:heading>Counting Data</flux:heading>
|
||||
<div class="grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 gap-3 mb-6 mt-2">
|
||||
|
||||
@ -3,15 +3,16 @@
|
||||
<flux:text class="mb-6 mt-2 text-base">Selamat datang di Studio Yadi Parfum.</flux:text>
|
||||
|
||||
<div class="mt-6">
|
||||
<div class="mb-6 grid grid-cols-1 lg:grid-cols-2 gap-4">
|
||||
<flux:checkbox.group wire:model.live="selectedOutletIds" variant="buttons">
|
||||
@foreach ($outlets as $key => $value)
|
||||
<flux:checkbox value="{{ $key }}" label="{{ $value }}" />
|
||||
@endforeach
|
||||
</flux:checkbox.group>
|
||||
</div>
|
||||
|
||||
<flux:separator class="mb-6"/>
|
||||
@if (count($outlets) > 1)
|
||||
<div class="mb-6 grid grid-cols-1 lg:grid-cols-2 gap-4">
|
||||
<flux:checkbox.group wire:model.live="selectedOutletIds" variant="buttons">
|
||||
@foreach ($outlets as $key => $value)
|
||||
<flux:checkbox value="{{ $key }}" label="{{ $value }}" />
|
||||
@endforeach
|
||||
</flux:checkbox.group>
|
||||
</div>
|
||||
<flux:separator class="mb-6" />
|
||||
@endif
|
||||
|
||||
<flux:subheading>Data yang ditampilkan di bawah ini adalah data hari ini dan hari kemarin.</flux:subheading>
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 gap-4 mb-6 mt-2">
|
||||
|
||||
@ -31,23 +31,30 @@
|
||||
<flux:text class="text-xs text-gray-400">({{ $item['volume'] }} ml)</flux:text>
|
||||
</div>
|
||||
|
||||
<x-slot name="actions">
|
||||
<flux:modal.trigger name="form-modal">
|
||||
<flux:tooltip content="Ubah">
|
||||
<flux:button variant="primary" color="yellow" icon="pencil-square"
|
||||
size="sm"
|
||||
wire:click="$dispatch('modal:open', {method: 'update', 'modalTitle': 'Ubah Rumus', 'id': '{{ $item['hash'] }}'})">
|
||||
</flux:button>
|
||||
</flux:tooltip>
|
||||
</flux:modal.trigger>
|
||||
<flux:modal.trigger name="delete">
|
||||
<flux:tooltip content="Hapus">
|
||||
<flux:button variant="danger" icon="trash" size="sm"
|
||||
wire:click="$dispatch('fn:confirmAction', {id: '{{ $item['hash'] }}'})">
|
||||
</flux:button>
|
||||
</flux:tooltip>
|
||||
</flux:modal.trigger>
|
||||
</x-slot>
|
||||
@canany(['update formula', 'delete formula'])
|
||||
<x-slot name="actions">
|
||||
@can('update formula')
|
||||
<flux:modal.trigger name="form-modal">
|
||||
<flux:tooltip content="Ubah">
|
||||
<flux:button variant="primary" color="yellow" icon="pencil-square"
|
||||
size="sm"
|
||||
wire:click="$dispatch('modal:open', {method: 'update', 'modalTitle': 'Ubah Rumus', 'id': '{{ $item['hash'] }}'})">
|
||||
</flux:button>
|
||||
</flux:tooltip>
|
||||
</flux:modal.trigger>
|
||||
@endcan
|
||||
|
||||
@can('delete formula')
|
||||
<flux:modal.trigger name="delete">
|
||||
<flux:tooltip content="Hapus">
|
||||
<flux:button variant="danger" icon="trash" size="sm"
|
||||
wire:click="$dispatch('fn:confirmAction', {id: '{{ $item['hash'] }}'})">
|
||||
</flux:button>
|
||||
</flux:tooltip>
|
||||
</flux:modal.trigger>
|
||||
@endcan
|
||||
</x-slot>
|
||||
@endcanany
|
||||
</flux:callout>
|
||||
@endforeach
|
||||
</flux:card>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user