From 536d10234df81dc68108c7b94b56054dd5b7bc6a Mon Sep 17 00:00:00 2001 From: sky121113 Date: Mon, 18 May 2026 09:15:11 +0800 Subject: [PATCH] =?UTF-8?q?[FIX]=20=E4=BF=AE=E5=BE=A9=E8=A7=92=E8=89=B2?= =?UTF-8?q?=E9=81=B8=E5=96=AE=E5=81=B4=E9=82=8A=E6=AC=84=E9=A1=AF=E7=A4=BA?= =?UTF-8?q?=E7=95=B0=E5=B8=B8=E8=88=87=E9=87=8D=E6=A7=8B=E6=A9=9F=E5=8F=B0?= =?UTF-8?q?=E8=A3=9C=E8=B2=A8=E6=8C=89=E9=88=95=E6=AC=8A=E9=99=90=E9=98=B2?= =?UTF-8?q?=E7=A6=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 修復 resources/views/layouts/partials/sidebar-menu.blade.php 中倉庫、銷售、遠端管理子選單未被 Spatie 權限包裹的 UI 異常,完美隱藏未授權子項目。 2. 重構 resources/views/admin/warehouses/machine-inventory.blade.php 的補貨按鈕文字,將「一鍵補貨」變更為「產生補貨單」。 3. 於 machine-inventory.blade.php 的 Alpine.js 控制器中動態宣告 hasReplenishPermission 權限判斷,若當前使用者不具備 menu.warehouses.replenishments 權限,點擊按鈕時將攔截跳轉並透過 dispatch 發送全域紅色 Error Toast 警告。 4. 擴充 zh_TW.json、en.json、ja.json 多語系翻譯檔,補齊「產生補貨單」與「無權限存取補貨單」之三語系翻譯。 --- lang/en.json | 2 ++ lang/ja.json | 2 ++ lang/zh_TW.json | 2 ++ .../warehouses/machine-inventory.blade.php | 14 ++++++++++--- .../layouts/partials/sidebar-menu.blade.php | 20 +++++++++++++++++++ 5 files changed, 37 insertions(+), 3 deletions(-) diff --git a/lang/en.json b/lang/en.json index 0b6003e..971776c 100644 --- a/lang/en.json +++ b/lang/en.json @@ -661,6 +661,7 @@ "Generate": "Generate", "Generate New Code": "Generate New Code", "Generate Pickup Code": "Generate Pickup Code", + "Generate Replenishment Order": "Generate Replenishment Order", "Generate and manage one-time pickup codes for customers": "Generate and manage one-time pickup codes for customers", "Gift Definitions": "Gift Definitions", "Global roles accessible by all administrators.": "Global roles accessible by all administrators.", @@ -1808,6 +1809,7 @@ "You can assign or change the personnel handling this order": "You can assign or change the personnel handling this order", "You cannot assign permissions you do not possess.": "You cannot assign permissions you do not possess.", "You cannot delete your own account.": "You cannot delete your own account.", + "You do not have permission to access replenishment orders": "You do not have permission to access replenishment orders", "Your recent account activity": "Your recent account activity", "[PickupCode] Verification failed: :code": "[PickupCode] Verification failed: :code", "[StaffCard] Verification failed: :uid": "[StaffCard] Verification failed: :uid", diff --git a/lang/ja.json b/lang/ja.json index af811ed..c12e69f 100644 --- a/lang/ja.json +++ b/lang/ja.json @@ -661,6 +661,7 @@ "Generate": "生成", "Generate New Code": "新コード生成", "Generate Pickup Code": "受取コード生成", + "Generate Replenishment Order": "補充伝票生成", "Generate and manage one-time pickup codes for customers": "顧客用のワンタイム受取コードを生成・管理", "Gift Definitions": "ギフト設定", "Global roles accessible by all administrators.": "全管理者がアクセス可能なグローバルロール。", @@ -1808,6 +1809,7 @@ "You can assign or change the personnel handling this order": "この注文を処理する担当者を割り当て、または変更できます", "You cannot assign permissions you do not possess.": "自身が持っていない権限を割り当てることはできません。", "You cannot delete your own account.": "自分自身のアカウントは削除できません。", + "You do not have permission to access replenishment orders": "補充伝票のアクセス権限がありません", "Your recent account activity": "最近のアカウントアクティビティ", "[PickupCode] Verification failed: :code": "[受取コード] 検証失敗: :code", "[StaffCard] Verification failed: :uid": "[スタッフカード] 検証失敗: :uid", diff --git a/lang/zh_TW.json b/lang/zh_TW.json index 370fcc9..2e1a020 100644 --- a/lang/zh_TW.json +++ b/lang/zh_TW.json @@ -668,6 +668,7 @@ "Generate": "產生", "Generate New Code": "產生新代碼", "Generate Pickup Code": "產生取貨碼", + "Generate Replenishment Order": "產生補貨單", "Generate and manage one-time pickup codes for customers": "產生並管理客戶的一次性取貨碼", "Gift Definitions": "禮品設定", "Global roles accessible by all administrators.": "適用於所有管理者的全域角色。", @@ -1830,6 +1831,7 @@ "You can assign or change the personnel handling this order": "您可以指派或變更處理此訂單的人員", "You cannot assign permissions you do not possess.": "您無法指派您自身不具備的權限。", "You cannot delete your own account.": "您無法刪除自己的帳號。", + "You do not have permission to access replenishment orders": "您沒有機台補貨單的權限", "Your recent account activity": "最近的帳號活動", "[PickupCode] Verification failed: :code": "[取貨碼] 驗證失敗: :code", "[StaffCard] Verification failed: :uid": "[員工卡] 驗證失敗: :uid", diff --git a/resources/views/admin/warehouses/machine-inventory.blade.php b/resources/views/admin/warehouses/machine-inventory.blade.php index a3ee369..6fb0690 100644 --- a/resources/views/admin/warehouses/machine-inventory.blade.php +++ b/resources/views/admin/warehouses/machine-inventory.blade.php @@ -108,14 +108,21 @@
{{ __('Total Stock Volume') }} - + - {{ __('Auto Replenishment') }} + {{ __('Generate Replenishment Order') }}
@@ -754,6 +761,7 @@ document.addEventListener('alpine:init', () => { selectedMachine: null, slots: [], loading: false, + hasReplenishPermission: {{ auth()->user()->can('menu.warehouses.replenishments') ? 'true' : 'false' }}, async init() { const urlParams = new URLSearchParams(window.location.search); diff --git a/resources/views/layouts/partials/sidebar-menu.blade.php b/resources/views/layouts/partials/sidebar-menu.blade.php index 482d001..c07c981 100644 --- a/resources/views/layouts/partials/sidebar-menu.blade.php +++ b/resources/views/layouts/partials/sidebar-menu.blade.php @@ -134,26 +134,36 @@
@@ -172,14 +182,18 @@