From e414396b0ccaf02735361d79c3ba885cae273328 Mon Sep 17 00:00:00 2001 From: sky121113 Date: Fri, 5 Jun 2026 13:01:52 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[FEAT]=20=E6=96=BC=E6=A9=9F=E5=8F=B0?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E8=88=87=E6=A9=9F=E5=8F=B0=E8=A8=AD=E5=AE=9A?= =?UTF-8?q?=E9=A0=81=E9=9D=A2=E6=96=B0=E5=A2=9E=E5=85=AC=E5=8F=B8=E7=AF=A9?= =?UTF-8?q?=E9=81=B8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 於機台管理 (MachineController 與 index.blade.php) 為系統管理員新增公司篩選下拉選單,並支援分頁參數與 AJAX 查詢。 2. 於機台設定頁面中的機台列表 (tab-machines.blade.php) 與系統設定列表 (tab-system-settings.blade.php) 新增公司篩選器。 3. 在 MachineSettingController 傳遞公司列表資料至視圖,以便支援公司篩選。 4. 修正重置按鈕,使其能正確清除 Preline HSSelect 的選取狀態並重新載入資料。 --- .../MachineSettingController.php | 51 ++++++++------ .../Controllers/Admin/MachineController.php | 13 +++- .../basic-settings/machines/index.blade.php | 10 ++- .../machines/partials/tab-machines.blade.php | 21 +++++- .../partials/tab-system-settings.blade.php | 26 +++++--- .../views/admin/machines/index.blade.php | 66 ++++++++++++++++++- 6 files changed, 151 insertions(+), 36 deletions(-) diff --git a/app/Http/Controllers/Admin/BasicSettings/MachineSettingController.php b/app/Http/Controllers/Admin/BasicSettings/MachineSettingController.php index 1ac0b32..34748c9 100644 --- a/app/Http/Controllers/Admin/BasicSettings/MachineSettingController.php +++ b/app/Http/Controllers/Admin/BasicSettings/MachineSettingController.php @@ -5,6 +5,7 @@ namespace App\Http\Controllers\Admin\BasicSettings; use App\Http\Controllers\Admin\AdminController; use App\Models\Machine\Machine; use App\Models\Machine\MachineModel; +use App\Models\System\Company; use App\Models\System\PaymentConfig; use App\Traits\ImageHandler; use Illuminate\Http\Request; @@ -28,6 +29,23 @@ class MachineSettingController extends AdminController $per_page = $request->input('per_page', 10); $search = $request->input('search'); $isAjax = $request->boolean('_ajax'); + $currentUser = auth()->user(); + $companyId = trim((string) $request->input('company_id', '')); + + $applyMachineFilters = function ($query) use ($search, $currentUser, $companyId) { + if ($search) { + $query->where(function ($q) use ($search) { + $q->where('name', 'like', "%{$search}%") + ->orWhere('serial_no', 'like', "%{$search}%"); + }); + } + + if ($currentUser->isSystemAdmin() && $companyId !== '') { + $query->where('company_id', $companyId); + } + + return $query; + }; // AJAX 模式:只查當前 Tab 的搜尋/分頁結果 if ($isAjax) { @@ -38,23 +56,13 @@ class MachineSettingController extends AdminController switch ($tab) { case 'machines': $machineQuery = Machine::query()->with(['machineModel', 'paymentConfig', 'company']); - if ($search) { - $machineQuery->where(function ($q) use ($search) { - $q->where('name', 'like', "%{$search}%") - ->orWhere('serial_no', 'like', "%{$search}%"); - }); - } + $applyMachineFilters($machineQuery); $machines = $machineQuery->latest()->paginate($per_page)->withQueryString(); break; case 'system_settings': $machineQuery = Machine::query()->with(['company']); - if ($search) { - $machineQuery->where(function ($q) use ($search) { - $q->where('name', 'like', "%{$search}%") - ->orWhere('serial_no', 'like', "%{$search}%"); - }); - } + $applyMachineFilters($machineQuery); $machines = $machineQuery->latest()->paginate($per_page)->withQueryString(); break; @@ -76,15 +84,15 @@ class MachineSettingController extends AdminController ->orWhere('username', 'like', "%{$search}%"); }); } - if ($request->filled('company_id')) { - $userQuery->where('company_id', $request->company_id); + if ($currentUser->isSystemAdmin() && $companyId !== '') { + $userQuery->where('company_id', $companyId); } $users_list = $userQuery->latest()->paginate($per_page)->withQueryString(); break; } - $companies = \App\Models\System\Company::select('id', 'name', 'code')->get(); + $companies = Company::select('id', 'name', 'code')->orderBy('name')->get(); $tabView = match($tab) { 'models' => 'admin.basic-settings.machines.partials.tab-models', @@ -98,9 +106,14 @@ class MachineSettingController extends AdminController } // SSR 模式:一次查好全部三個 Tab 的首頁資料(供 x-show 即時切換) - $machines = Machine::query() - ->with(['machineModel', 'paymentConfig', 'company']) - ->latest()->paginate($per_page)->withQueryString(); + $machineQuery = Machine::query() + ->with(['machineModel', 'paymentConfig', 'company']); + + if (in_array($tab, ['machines', 'system_settings'], true)) { + $applyMachineFilters($machineQuery); + } + + $machines = $machineQuery->latest()->paginate($per_page)->withQueryString(); $models_list = MachineModel::query() ->withCount('machines') @@ -114,7 +127,7 @@ class MachineSettingController extends AdminController // 基礎下拉資料 (用於新增/編輯機台的彈窗) $models = MachineModel::select('id', 'name')->get(); $paymentConfigs = PaymentConfig::select('id', 'name')->get(); - $companies = \App\Models\System\Company::select('id', 'name', 'code')->get(); + $companies = Company::select('id', 'name', 'code')->orderBy('name')->get(); return view('admin.basic-settings.machines.index', compact( 'machines', diff --git a/app/Http/Controllers/Admin/MachineController.php b/app/Http/Controllers/Admin/MachineController.php index 235151f..8d7b6a5 100644 --- a/app/Http/Controllers/Admin/MachineController.php +++ b/app/Http/Controllers/Admin/MachineController.php @@ -3,6 +3,7 @@ namespace App\Http\Controllers\Admin; use App\Models\Machine\Machine; +use App\Models\System\Company; use App\Services\Machine\MachineService; use Illuminate\Http\Request; use Illuminate\View\View; @@ -16,8 +17,10 @@ class MachineController extends AdminController public function index(Request $request): View { $per_page = $request->input('per_page', 10); + $companyId = trim((string) $request->input('company_id', '')); $query = Machine::query(); + $currentUser = auth()->user(); // 搜尋:名稱或序號 if ($search = $request->input('search')) { @@ -27,13 +30,21 @@ class MachineController extends AdminController }); } + if ($currentUser->isSystemAdmin() && $companyId !== '') { + $query->where('company_id', $companyId); + } + // 預加載統計資料 $machines = $query->orderBy("last_heartbeat_at", "desc") ->orderBy("id", "desc") ->paginate($per_page) ->withQueryString(); - return view('admin.machines.index', compact('machines')); + $companies = $currentUser->isSystemAdmin() + ? Company::select('id', 'name', 'code')->orderBy('name')->get() + : collect(); + + return view('admin.machines.index', compact('machines', 'companies')); } /** diff --git a/resources/views/admin/basic-settings/machines/index.blade.php b/resources/views/admin/basic-settings/machines/index.blade.php index d075bed..f24be32 100644 --- a/resources/views/admin/basic-settings/machines/index.blade.php +++ b/resources/views/admin/basic-settings/machines/index.blade.php @@ -5,9 +5,10 @@ tab: '{{ $tab }}', tabLoading: false, machineSearch: '', + machineCompanyId: @js(request('company_id')), modelSearch: '', permissionSearch: '', - permissionCompanyId: '{{ request('company_id') }}', + permissionCompanyId: @js(request('company_id')), isUpdatingSetting: false, async toggleSystemSetting(machineId, field, value) { if (this.isUpdatingSetting) return; @@ -287,7 +288,10 @@ const search = searchMap[tabName] || ''; let qs = `tab=${tabName}&_ajax=1`; if (search) qs += `&search=${encodeURIComponent(search)}`; - if (tabName === 'permissions' && this.permissionCompanyId) qs += `&company_id=${this.permissionCompanyId}`; + const machineCompanyId = (this.machineCompanyId || '').trim(); + const permissionCompanyId = (this.permissionCompanyId || '').trim(); + if ((tabName === 'machines' || tabName === 'system_settings') && machineCompanyId) qs += `&company_id=${machineCompanyId}`; + if (tabName === 'permissions' && permissionCompanyId) qs += `&company_id=${permissionCompanyId}`; if (extraQuery) qs += extraQuery; // 同步 URL(不含 _ajax) @@ -1669,4 +1673,4 @@ -@endsection \ No newline at end of file +@endsection diff --git a/resources/views/admin/basic-settings/machines/partials/tab-machines.blade.php b/resources/views/admin/basic-settings/machines/partials/tab-machines.blade.php index 2615de7..cea18f6 100644 --- a/resources/views/admin/basic-settings/machines/partials/tab-machines.blade.php +++ b/resources/views/admin/basic-settings/machines/partials/tab-machines.blade.php @@ -19,6 +19,14 @@ class="luxury-input py-2.5 pl-11 pr-4 block w-full sm:w-72 text-sm font-bold"> + @if(auth()->user()->isSystemAdmin()) +
+ +
+ @endif +
{{-- 搜尋按鈕 --}}
- {{ $machines->appends(['tab' => 'machines'])->links('vendor.pagination.luxury') }} + {{ $machines->appends(['tab' => 'machines', 'search' => request('search'), 'company_id' => request('company_id')])->links('vendor.pagination.luxury') }}
diff --git a/resources/views/admin/basic-settings/machines/partials/tab-system-settings.blade.php b/resources/views/admin/basic-settings/machines/partials/tab-system-settings.blade.php index acf2bf8..315f1e2 100644 --- a/resources/views/admin/basic-settings/machines/partials/tab-system-settings.blade.php +++ b/resources/views/admin/basic-settings/machines/partials/tab-system-settings.blade.php @@ -15,17 +15,18 @@ class="luxury-input py-2.5 pl-11 pr-4 block w-full sm:w-72 text-sm font-bold"> + @if(auth()->user()->isSystemAdmin())
- @foreach ($companies as $company) - - @endforeach - + id="machine-company-filter-system-settings" + name="company_filter" + :options="$companies" + :selected="request('company_id')" + x-on:change="machineCompanyId = $event.target.value; searchInTab('system_settings')" + :placeholder="__('All Companies')" />
+ @endif
{{-- 搜尋按鈕 --}} @@ -39,7 +40,16 @@ {{-- 重置按鈕 --}} + + +
+
- @foreach ($machines as $machine) + @forelse ($machines as $machine)
@@ -823,11 +831,27 @@
- @endforeach + @empty +
+ + + + + +
+ @endforelse
- {{ $machines->appends(request()->query())->links('vendor.pagination.luxury') }} + @if($machines->total() > 0) + {{ $machines->appends(request()->query())->links('vendor.pagination.luxury') }} + @else +
+ {{ __('No records found') }} + 0 / 0 +
+ @endif
diff --git a/resources/views/admin/machines/permissions.blade.php b/resources/views/admin/machines/permissions.blade.php index 33d69b5..4b62f1b 100644 --- a/resources/views/admin/machines/permissions.blade.php +++ b/resources/views/admin/machines/permissions.blade.php @@ -103,15 +103,7 @@ window.dispatchEvent(new CustomEvent('toast', { detail: { message: e.message, type: 'error' } })); }); } -}" @ajax:navigate.window.prevent="fetchPage($event.detail.url)" - @submit.prevent="if($event.target.method.toLowerCase() === 'get') { - const url = new URL($event.target.action, window.location.origin); - new FormData($event.target).forEach((value, key) => { - if(value.trim()) url.searchParams.set(key, value); - else url.searchParams.delete(key); - }); - fetchPage(url.pathname + url.search); - }"> +}" @ajax:navigate.window.prevent="fetchPage($event.detail.url)">
@@ -151,7 +143,15 @@
+ class="flex flex-wrap items-center gap-4 w-full md:w-auto" + @submit.prevent=" + const url = new URL($el.action, window.location.origin); + new FormData($el).forEach((value, key) => { + if (value.trim()) url.searchParams.set(key, value); + else url.searchParams.delete(key); + }); + fetchPage(url.pathname + url.search); + ">
@@ -170,7 +170,8 @@ @if(auth()->user()->isSystemAdmin())
+ :placeholder="__('All Companies')" + x-on:change="$el.closest('form').dispatchEvent(new Event('submit', { cancelable: true }))" />
@endif @@ -186,7 +187,7 @@ $el.closest('form').querySelectorAll('input[type=text]').forEach(i => i.value = ''); $el.closest('form').querySelectorAll('select').forEach(s => { s.value = ' '; - const instance = window.HSSelect.getInstance(s); + const instance = window.HSSelect?.getInstance(s); if (instance) instance.setValue(' '); }); $el.closest('form').dispatchEvent(new Event('submit', { cancelable: true })); @@ -279,12 +280,15 @@ @empty -
- +
+ + d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" /> + + -

{{ __('No accounts found') }}

+

{{ __('No accounts found') }}

@@ -354,17 +358,26 @@
@empty
-
- - +
+ + + + -

{{ __('No accounts found') }}

+

{{ __('No accounts found') }}

@endforelse
- {{ $users_list->links('vendor.pagination.luxury') }} + @if($users_list->total() > 0) + {{ $users_list->appends(request()->query())->links('vendor.pagination.luxury') }} + @else +
+ {{ __('No records found') }} + 0 / 0 +
+ @endif
@@ -529,4 +542,4 @@
-@endsection \ No newline at end of file +@endsection diff --git a/resources/views/admin/maintenance/index.blade.php b/resources/views/admin/maintenance/index.blade.php index bf2450d..ef16841 100644 --- a/resources/views/admin/maintenance/index.blade.php +++ b/resources/views/admin/maintenance/index.blade.php @@ -24,6 +24,14 @@ if (newContent) { document.querySelector('#ajax-content-container').innerHTML = newContent.innerHTML; window.history.pushState({}, '', url); + + const container = document.querySelector('#ajax-content-container'); + if (container && window.Alpine) { + Alpine.initTree(container); + } + if (window.HSStaticMethods && typeof window.HSStaticMethods.autoInit === 'function') { + setTimeout(() => window.HSStaticMethods.autoInit(), 100); + } } } catch (e) { console.error('AJAX Load Failed:', e); @@ -80,14 +88,21 @@
+ @click="if ($event.target.closest('a') && $event.target.closest('a').href && ($event.target.closest('a').href.includes('page=') || $event.target.closest('a').href.includes('search=') || $event.target.closest('a').href.includes('category=') || $event.target.closest('a').href.includes('company_id='))) { $event.preventDefault(); fetchPage($event.target.closest('a').href); }">
+ @submit.prevent=" + const url = new URL($el.action, window.location.origin); + new FormData($el).forEach((value, key) => { + if (value.trim()) url.searchParams.set(key, value); + else url.searchParams.delete(key); + }); + fetchPage(url.pathname + url.search); + ">
@@ -106,7 +121,7 @@
+ x-on:change="$el.closest('form').dispatchEvent(new Event('submit', { cancelable: true }))" :hasSearch="false" class="luxury-select-sm"> @foreach(['Repair', 'Installation', 'Removal', 'Maintenance'] as $cat)
+ @if(auth()->user()->isSystemAdmin()) +
+ +
+ @endif +
@empty
-
- - +
+ + -

{{ __('No maintenance records found') }}

+

{{ __('No maintenance records found') }}

@endforelse
- {{ $records->links('vendor.pagination.luxury') }} + @if($records->total() > 0) + {{ $records->appends(request()->query())->links('vendor.pagination.luxury') }} + @else +
+ {{ __('No records found') }} + 0 / 0 +
+ @endif
diff --git a/resources/views/admin/remote/stock.blade.php b/resources/views/admin/remote/stock.blade.php index 47fe11d..ca35ca0 100644 --- a/resources/views/admin/remote/stock.blade.php +++ b/resources/views/admin/remote/stock.blade.php @@ -9,6 +9,7 @@ selectedMachine: null, slots: [], viewMode: initialMachineId ? 'detail' : 'history', + displayMode: 'table', history: @js($history), loading: false, updating: false, @@ -251,17 +252,42 @@ }, getSlotColorClass(slot) { - if (!slot.expiry_date) return 'bg-slate-50/50 dark:bg-slate-800/50 text-slate-400 border-slate-200/60 dark:border-slate-700/50'; - const todayStr = new Date().toISOString().split('T')[0]; - const expiryStr = slot.expiry_date; - if (expiryStr < todayStr) { - return 'bg-rose-50/60 dark:bg-rose-500/10 text-rose-600 dark:text-rose-400 border-rose-200 dark:border-rose-500/30 shadow-sm shadow-rose-500/5'; + const today = new Date().toISOString().split('T')[0]; + if (slot.expiry_date && slot.expiry_date < today) { + return 'bg-rose-50/60 dark:bg-rose-500/10 text-rose-600 dark:text-rose-400 border-rose-200 dark:border-rose-500/30'; } - const diffDays = Math.round((new Date(expiryStr) - new Date(todayStr)) / 86400000); - if (diffDays <= 7) { - return 'bg-amber-50/60 dark:bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-200 dark:border-amber-500/30 shadow-sm shadow-amber-500/5'; + if (!slot.product || parseInt(slot.stock) === 0) { + return 'bg-slate-50/50 dark:bg-slate-800/50 text-slate-400 border-slate-200/60 dark:border-slate-700/50'; } - return 'bg-emerald-50/60 dark:bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-200 dark:border-emerald-500/30 shadow-sm shadow-emerald-500/5'; + if (slot.max_stock > 0 && parseInt(slot.stock) <= (parseInt(slot.max_stock) * 0.2)) { + return 'bg-amber-50/60 dark:bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-200 dark:border-amber-500/30'; + } + const maxStock = parseInt(slot.max_stock) || 10; + if (parseInt(slot.stock) > maxStock / 2) { + return 'bg-cyan-50/60 dark:bg-cyan-500/10 text-cyan-600 dark:text-cyan-400 border-cyan-200 dark:border-cyan-500/30'; + } + return 'bg-emerald-50/60 dark:bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-200 dark:border-emerald-500/30'; + }, + + getSlotCardClass(slot) { + const base = 'luxury-card p-6 rounded-[2rem] backdrop-blur-xl group hover:shadow-2xl transition-all duration-500 relative '; + const today = new Date().toISOString().split('T')[0]; + if (slot.expiry_date && slot.expiry_date < today) return base + 'bg-rose-500/[0.06] border-rose-500/20 dark:bg-rose-500/10 dark:border-rose-500/30 hover:shadow-rose-500/10'; + if (!slot.product || parseInt(slot.stock) === 0) return base + 'bg-slate-500/[0.06] border-slate-500/20 dark:bg-slate-500/10 dark:border-slate-500/30 hover:shadow-slate-500/10'; + if (slot.max_stock > 0 && parseInt(slot.stock) <= (parseInt(slot.max_stock) * 0.2)) return base + 'bg-amber-500/[0.06] border-amber-500/20 dark:bg-amber-500/10 dark:border-amber-500/30 hover:shadow-amber-500/10'; + const maxStock = parseInt(slot.max_stock) || 10; + if (parseInt(slot.stock) > maxStock / 2) return base + 'bg-cyan-500/[0.06] border-cyan-500/20 dark:bg-cyan-500/10 dark:border-cyan-500/30 hover:shadow-cyan-500/10'; + return base + 'bg-emerald-500/[0.04] border-emerald-500/10 dark:bg-emerald-500/[0.08] dark:border-emerald-500/25 hover:shadow-emerald-500/10'; + }, + + getSlotProgressClass(slot) { + const today = new Date().toISOString().split('T')[0]; + if (slot.expiry_date && slot.expiry_date < today) return 'bg-rose-500 shadow-[0_0_8px_rgba(244,63,94,0.4)]'; + if (!slot.product || parseInt(slot.stock) === 0) return 'bg-slate-400'; + if (slot.max_stock > 0 && parseInt(slot.stock) <= (parseInt(slot.max_stock) * 0.2)) return 'bg-amber-500 shadow-[0_0_8px_rgba(245,158,11,0.4)]'; + const maxStock = parseInt(slot.max_stock) || 10; + if (parseInt(slot.stock) > maxStock / 2) return 'bg-cyan-500 shadow-[0_0_8px_rgba(6,182,212,0.4)]'; + return 'bg-emerald-500 shadow-[0_0_8px_rgba(16,185,129,0.4)]'; }, getCommandBadgeClass(status) { @@ -546,8 +572,29 @@
- -
+ +
+
+ + +
+
@@ -558,22 +605,131 @@ {{ - __('Warning') }} -
-
- - {{ - __('Normal') }} + __('Low Stock') }}
-
+ +
+
+ +
+
+
+
+ {{ + __('Loading Cabinet...') }} +
+
+ + +
+
+ + +
+ +
+
+
+ + +
+ class="absolute inset-0 bg-white/60 dark:bg-slate-900/60 backdrop-blur-md z-20 flex items-center justify-center transition-all duration-500 rounded-[2.5rem]">
@@ -584,102 +740,124 @@
- -
+ + - -
+ +
+
diff --git a/resources/views/admin/warehouses/index.blade.php b/resources/views/admin/warehouses/index.blade.php index 871147d..d1cdac6 100644 --- a/resources/views/admin/warehouses/index.blade.php +++ b/resources/views/admin/warehouses/index.blade.php @@ -95,6 +95,15 @@ const currentContent = document.querySelector('#ajax-content-container'); if (newContent && currentContent) { currentContent.innerHTML = newContent.innerHTML; + if (window.Alpine) { + Alpine.initTree(currentContent); + } + } + + const newStats = doc.querySelector('#warehouse-stats-container'); + const currentStats = document.querySelector('#warehouse-stats-container'); + if (newStats && currentStats) { + currentStats.innerHTML = newStats.innerHTML; } window.history.pushState({}, '', url); @@ -148,7 +157,7 @@
{{-- Stats Cards --}} -
+

{{ __('Total Warehouses') }}

{{ $stats['total'] }}

@@ -174,7 +183,14 @@ {{-- Filters --}}
+ @submit.prevent=" + const url = new URL($el.action, window.location.origin); + new FormData($el).forEach((value, key) => { + if (value.trim()) url.searchParams.set(key, value); + else url.searchParams.delete(key); + }); + fetchPage(url.pathname + url.search); + "> + @if(auth()->user()->isSystemAdmin()) +
+ +
+ @endif +
@empty -
- +
+
+ + + +

{{ __('No machines found') }}

+
@endforelse
- {{ $machines->links('vendor.pagination.luxury') }} + @if($machines->total() > 0) + {{ $machines->links('vendor.pagination.luxury') }} + @else +
+ {{ __('No records found') }} + 0 / 0 +
+ @endif
diff --git a/resources/views/admin/warehouses/partials/tab-movements.blade.php b/resources/views/admin/warehouses/partials/tab-movements.blade.php index 1195a52..67f8586 100644 --- a/resources/views/admin/warehouses/partials/tab-movements.blade.php +++ b/resources/views/admin/warehouses/partials/tab-movements.blade.php @@ -3,6 +3,26 @@ @submit.prevent="handleFilterSubmit('movements')"> + @if(auth()->user()->isSystemAdmin()) +
+ +
+ @endif + {{-- 倉庫篩選 --}}
{ s.value = ' '; - const instance = window.HSSelect.getInstance(s); + const instance = window.HSSelect?.getInstance(s); if (instance) instance.setValue(' '); }); $el.closest('form').dispatchEvent(new CustomEvent('multi-select-reset', { bubbles: true })); @@ -167,12 +187,10 @@
-
- - - -
-

{{ __('No movement records found') }}

+ + + +

{{ __('No movement records found') }}

@@ -229,12 +247,24 @@
@empty -
- +
+
+ + + +

{{ __('No movement records found') }}

+
@endforelse
- {{ $movements->links('vendor.pagination.luxury') }} + @if($movements->total() > 0) + {{ $movements->links('vendor.pagination.luxury') }} + @else +
+ {{ __('No records found') }} + 0 / 0 +
+ @endif
diff --git a/resources/views/admin/warehouses/partials/tab-stock-in.blade.php b/resources/views/admin/warehouses/partials/tab-stock-in.blade.php index 13d34b3..6a1603d 100644 --- a/resources/views/admin/warehouses/partials/tab-stock-in.blade.php +++ b/resources/views/admin/warehouses/partials/tab-stock-in.blade.php @@ -80,6 +80,18 @@
@endif + @if(auth()->user()->isSystemAdmin()) +
+ +
+ @endif + {{-- 搜尋 + 重置按鈕 --}}
@empty -
- +
+
+ + + +

{{ __('No stock-in orders found') }}

+
@endforelse
- {{ $orders->links('vendor.pagination.luxury', ['ajax_navigate_event' => 'ajax:navigate:stock-in']) }} + @if($orders->total() > 0) + {{ $orders->links('vendor.pagination.luxury', ['ajax_navigate_event' => 'ajax:navigate:stock-in']) }} + @else +
+ {{ __('No records found') }} + 0 / 0 +
+ @endif
diff --git a/resources/views/admin/warehouses/partials/tab-stock.blade.php b/resources/views/admin/warehouses/partials/tab-stock.blade.php index cfba802..8f532ee 100644 --- a/resources/views/admin/warehouses/partials/tab-stock.blade.php +++ b/resources/views/admin/warehouses/partials/tab-stock.blade.php @@ -22,6 +22,22 @@ :placeholder="__('Filter by Warehouse Presence')" />
+ @if(auth()->user()->isSystemAdmin()) +
+ +
+ @endif +
@empty -
- +
+
+ + + +

{{ __('No products found') }}

+
@endforelse
-
{{ - $products->links('vendor.pagination.luxury') }}
- \ No newline at end of file +
+ @if($products->total() > 0) + {{ $products->links('vendor.pagination.luxury') }} + @else +
+ {{ __('No records found') }} + 0 / 0 +
+ @endif +
+ diff --git a/resources/views/admin/warehouses/partials/table-replenishments.blade.php b/resources/views/admin/warehouses/partials/table-replenishments.blade.php index e5b71c9..986a12f 100644 --- a/resources/views/admin/warehouses/partials/table-replenishments.blade.php +++ b/resources/views/admin/warehouses/partials/table-replenishments.blade.php @@ -115,7 +115,16 @@ @empty - {{ __('No replenishment orders found') }} + + +
+ + + +

{{ __('No replenishment orders found') }}

+
+ + @endforelse @@ -195,12 +204,24 @@ @empty
-

{{ __('No replenishment orders found') }}

+
+ + + +

{{ __('No replenishment orders found') }}

+
@endforelse
- {{ $orders->links('vendor.pagination.luxury', ['ajax_navigate_event' => 'ajax:navigate:replenishments']) }} + @if($orders->total() > 0) + {{ $orders->links('vendor.pagination.luxury', ['ajax_navigate_event' => 'ajax:navigate:replenishments']) }} + @else +
+ {{ __('No records found') }} + 0 / 0 +
+ @endif
diff --git a/resources/views/admin/warehouses/partials/table-transfers.blade.php b/resources/views/admin/warehouses/partials/table-transfers.blade.php index 67a0084..53bb506 100644 --- a/resources/views/admin/warehouses/partials/table-transfers.blade.php +++ b/resources/views/admin/warehouses/partials/table-transfers.blade.php @@ -88,7 +88,16 @@ @empty - {{ __('No transfer orders found') }} + + +
+ + + +

{{ __('No transfer orders found') }}

+
+ + @endforelse @@ -173,12 +182,24 @@ @empty
-

{{ __('No transfer orders found') }}

+
+ + + +

{{ __('No transfer orders found') }}

+
@endforelse
- {{ $orders->links('vendor.pagination.luxury', ['ajax_navigate_event' => 'ajax:navigate:transfers']) }} + @if($orders->total() > 0) + {{ $orders->links('vendor.pagination.luxury', ['ajax_navigate_event' => 'ajax:navigate:transfers']) }} + @else +
+ {{ __('No records found') }} + 0 / 0 +
+ @endif
diff --git a/resources/views/admin/warehouses/replenishments.blade.php b/resources/views/admin/warehouses/replenishments.blade.php index cdfc5e4..7f3e16e 100644 --- a/resources/views/admin/warehouses/replenishments.blade.php +++ b/resources/views/admin/warehouses/replenishments.blade.php @@ -517,6 +517,8 @@ if (data.success && container) { container.outerHTML = data.html; this.$nextTick(() => { + const newContainer = document.getElementById('replenishments-table-container'); + if (newContainer && window.Alpine) Alpine.initTree(newContainer); if (window.HSStaticMethods) window.HSStaticMethods.autoInit(); }); window.history.pushState({}, '', targetUrl); @@ -533,6 +535,7 @@
{{-- Header --}} @@ -625,6 +628,18 @@
+ @if(auth()->user()->isSystemAdmin()) +
+ +
+ @endif + {{-- 開始時間 --}}
{ s.value = ' '; - const instance = window.HSSelect.getInstance(s); + const instance = window.HSSelect?.getInstance(s); if (instance) instance.setValue(' '); }); fetchTabData(); @@ -716,4 +731,4 @@ @include('admin.warehouses.partials.modal-replenishment-assign') @include('admin.warehouses.partials.modal-replenishment-status')
-@endsection \ No newline at end of file +@endsection diff --git a/resources/views/admin/warehouses/transfers.blade.php b/resources/views/admin/warehouses/transfers.blade.php index a09b8fe..e070b6e 100644 --- a/resources/views/admin/warehouses/transfers.blade.php +++ b/resources/views/admin/warehouses/transfers.blade.php @@ -109,6 +109,8 @@ container.outerHTML = data.html; // Re-init HSSelect or other Preline components if needed this.$nextTick(() => { + const newContainer = document.getElementById('transfers-table-container'); + if (newContainer && window.Alpine) Alpine.initTree(newContainer); if (window.HSStaticMethods) window.HSStaticMethods.autoInit(); }); @@ -392,6 +394,18 @@ + @if(auth()->user()->isSystemAdmin()) +
+ +
+ @endif + {{-- 開始時間 --}}
{ s.value = ' '; - const instance = window.HSSelect.getInstance(s); + const instance = window.HSSelect?.getInstance(s); if (instance) instance.setValue(' '); }); fetchTabData();