From 9d7fdc9c7fe1b21e951894d7b9c23f738aab0944 Mon Sep 17 00:00:00 2001 From: sky121113 Date: Mon, 27 Apr 2026 14:24:37 +0800 Subject: [PATCH] =?UTF-8?q?[STYLE]=20=E5=84=AA=E5=8C=96=E7=B6=AD=E4=BF=AE?= =?UTF-8?q?=E7=B4=80=E9=8C=84=E8=88=87=E5=80=89=E5=84=B2=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=A8=A1=E7=B5=84=20RWD=20=E9=9F=BF=E6=87=89=E5=BC=8F=E4=BD=88?= =?UTF-8?q?=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 維修紀錄 (Maintenance Records):優化標題區域與按鈕在行動裝置上的顯示,新增「系統 (System)」維修類型支援。 2. 倉儲管理 (Warehouse Management):全面優化總覽、庫存、調撥與補貨介面,確保在手機版自動切換為優化的卡片或折疊佈局。 3. 機台庫存 (Machine Inventory):修正表格寬度與字體大小,提升小螢幕下的閱讀性。 4. 補貨流程 (Replenishment Workflow):優化一鍵補貨 Modal 與詳情面板的 RWD 表現。 5. 全站佈局:調整 admin.blade.php 與主容器間距,修復部分區域在窄螢幕下的破圖問題。 --- .../Controllers/Admin/WarehouseController.php | 125 ++++--- lang/ja.json | 12 +- lang/zh_TW.json | 17 +- resources/css/app.css | 2 +- resources/views/admin/dashboard.blade.php | 283 +++++++++------- .../views/admin/machines/index.blade.php | 254 ++++++++++---- .../admin/machines/permissions.blade.php | 134 ++++++-- .../admin/machines/utilization.blade.php | 2 +- .../views/admin/maintenance/index.blade.php | 199 ++++++++--- .../views/admin/warehouses/index.blade.php | 265 +++++++++++---- .../warehouses/machine-inventory.blade.php | 319 ++++++++++++------ .../modal-replenishment-auto.blade.php | 18 +- .../modal-replenishment-create.blade.php | 15 +- .../slideover-replenishment-details.blade.php | 57 ++-- .../partials/table-replenishments.blade.php | 62 ++-- .../admin/warehouses/replenishments.blade.php | 296 +++++++++++----- .../admin/warehouses/transfers.blade.php | 2 +- resources/views/layouts/admin.blade.php | 49 ++- 18 files changed, 1481 insertions(+), 630 deletions(-) diff --git a/app/Http/Controllers/Admin/WarehouseController.php b/app/Http/Controllers/Admin/WarehouseController.php index 72aaa2f..0d78158 100644 --- a/app/Http/Controllers/Admin/WarehouseController.php +++ b/app/Http/Controllers/Admin/WarehouseController.php @@ -594,7 +594,7 @@ class WarehouseController extends Controller public function machineSlots(Machine $machine) { $slots = $machine->slots() - ->with(['product:id,name,image_url,barcode']) + ->with(['product:id,name,image_url,barcode,price']) ->orderByRaw('CAST(slot_no AS UNSIGNED) ASC') ->get(); @@ -703,16 +703,9 @@ class WarehouseController extends Controller ReplenishmentOrderItem::insert($itemsData); }); - if ($request->ajax()) { - session()->flash('success', __('Replenishment order created successfully')); - return response()->json([ - 'success' => true, - 'message' => __('Replenishment order created successfully') - ]); - } + session()->flash('success', __('Replenishment order created successfully')); - return redirect()->route('admin.warehouses.replenishments') - ->with('success', __('Replenishment order created successfully')); + return redirect()->route('admin.warehouses.replenishments'); } /** @@ -865,14 +858,18 @@ class WarehouseController extends Controller // pending → prepared:扣減倉庫庫存 if ($newStatus === ReplenishmentOrder::STATUS_PREPARED) { foreach ($replenishmentOrder->items as $item) { - $stock = WarehouseStock::where('warehouse_id', $replenishmentOrder->warehouse_id) - ->where('product_id', $item->product_id) - ->lockForUpdate() - ->first(); + $stock = WarehouseStock::firstOrCreate( + [ + 'warehouse_id' => $replenishmentOrder->warehouse_id, + 'product_id' => $item->product_id, + ], + [ + 'company_id' => $replenishmentOrder->company_id, + 'quantity' => 0, + ] + ); - if (!$stock || $stock->quantity < $item->quantity) { - throw new \Exception(__('Warehouse stock insufficient') . " ({$item->product?->name})"); - } + $stock->lockForUpdate(); $before = $stock->quantity; $stock->decrement('quantity', $item->quantity); @@ -914,6 +911,14 @@ class WarehouseController extends Controller 'completed' => __('Confirm Complete'), ]; + $statusMessages = [ + 'prepared' => __('Order prepared successfully, stock deducted'), + 'delivering' => __('Order is now in delivery'), + 'completed' => __('Order completed and stock updated'), + ]; + + session()->flash('success', $statusMessages[$newStatus] ?? __('Status updated successfully')); + return response()->json([ 'success' => true, 'message' => __('Status updated successfully') @@ -938,29 +943,35 @@ class WarehouseController extends Controller $replenishmentOrder->loadMissing('items'); foreach ($replenishmentOrder->items as $item) { - $stock = WarehouseStock::where('warehouse_id', $replenishmentOrder->warehouse_id) - ->where('product_id', $item->product_id) - ->lockForUpdate() - ->first(); - - if ($stock) { - $before = $stock->quantity; - $stock->increment('quantity', $item->quantity); - - StockMovement::create([ - 'company_id' => $replenishmentOrder->company_id, + $stock = WarehouseStock::firstOrCreate( + [ 'warehouse_id' => $replenishmentOrder->warehouse_id, 'product_id' => $item->product_id, - 'type' => 'in', - 'quantity' => $item->quantity, - 'before_qty' => $before, - 'after_qty' => $before + $item->quantity, - 'reference_type' => ReplenishmentOrder::class, - 'reference_id' => $replenishmentOrder->id, - 'note' => __('Replenishment cancelled, stock returned') . ' #' . $replenishmentOrder->order_no, - 'created_by' => Auth::id(), - ]); - } + ], + [ + 'company_id' => $replenishmentOrder->company_id, + 'quantity' => 0, + ] + ); + + $stock->lockForUpdate(); + + $before = $stock->quantity; + $stock->increment('quantity', $item->quantity); + + StockMovement::create([ + 'company_id' => $replenishmentOrder->company_id, + 'warehouse_id' => $replenishmentOrder->warehouse_id, + 'product_id' => $item->product_id, + 'type' => 'in', + 'quantity' => $item->quantity, + 'before_qty' => $before, + 'after_qty' => $before + $item->quantity, + 'reference_type' => ReplenishmentOrder::class, + 'reference_id' => $replenishmentOrder->id, + 'note' => __('Replenishment cancelled, stock returned') . ' #' . $replenishmentOrder->order_no, + 'created_by' => Auth::id(), + ]); } } @@ -969,10 +980,16 @@ class WarehouseController extends Controller ]); }); + $msg = __('Order has been cancelled'); + if (in_array($replenishmentOrder->getOriginal('status'), [ReplenishmentOrder::STATUS_PREPARED, ReplenishmentOrder::STATUS_DELIVERING])) { + $msg .= ' — ' . __('Stock returned to warehouse'); + } + + session()->flash('success', $msg); + return response()->json([ 'success' => true, - 'message' => __('Order has been cancelled'), - 'stock_returned' => in_array($replenishmentOrder->getOriginal('status'), [ReplenishmentOrder::STATUS_PREPARED, ReplenishmentOrder::STATUS_DELIVERING]), + 'message' => $msg ]); } @@ -999,10 +1016,11 @@ class WarehouseController extends Controller $replenishmentOrder->update(['assigned_to' => $user->id]); + session()->flash('success', __('Personnel assigned successfully')); + return response()->json([ 'success' => true, - 'message' => __('Personnel assigned successfully'), - 'assignee_name' => $user->name, + 'message' => __('Personnel assigned successfully') ]); } @@ -1101,16 +1119,23 @@ class WarehouseController extends Controller if ($warehouseId) { // Warehouse uses TenantScoped, findOrFail will respect it $warehouse = Warehouse::findOrFail($warehouseId); - $stocks = WarehouseStock::with(['product' => fn($q) => $q->select('id', 'name', 'image_url', 'name_dictionary_key')->with('translations')]) - ->where('warehouse_id', $warehouse->id) - ->where('quantity', '>', 0) + + // 獲取公司所有啟動中的商品 + $products = Product::where('company_id', $warehouse->company_id) + ->active() + ->select('id', 'name', 'image_url', 'name_dictionary_key') + ->with('translations') ->get(); + + // 獲取目前的庫存量(用於顯示,不限制選擇) + $stocks = WarehouseStock::where('warehouse_id', $warehouse->id) + ->pluck('quantity', 'product_id'); - $data = $stocks->map(fn($s) => [ - 'id' => $s->product_id, - 'name' => $s->product?->localized_name ?? 'Unknown', - 'quantity' => $s->quantity, - 'image' => $s->product?->image_url + $data = $products->map(fn($p) => [ + 'id' => $p->id, + 'name' => $p->localized_name ?? 'Unknown', + 'quantity' => $stocks[$p->id] ?? 0, + 'image' => $p->image_url ]); } elseif ($machineId) { // Machine uses TenantScoped and machine_access scope diff --git a/lang/ja.json b/lang/ja.json index 3680597..2074430 100644 --- a/lang/ja.json +++ b/lang/ja.json @@ -46,6 +46,7 @@ "Confirm Transfer Order": "転送伝票を確認", "Create and manage replenishment orders from warehouse to machines": "倉庫から機台への補充伝票の作成と管理", "Create Replenishment Order": "補充伝票を作成", + "Create stock replenishment for specific machines": "指定マシンの在庫補充伝票を作成", "CREATE STOCK TRANSFERS BETWEEN WAREHOUSES AND MACHINE RETURNS": "倉庫間の転送および機台からの返品伝票を作成", "Create stock transfers between warehouses and machine returns": "倉庫間の転送および機台からの返品伝票を作成", "Create Transfer Order": "転送伝票を作成", @@ -88,9 +89,11 @@ "Loading...": "読み込み中...", "Low Stock": "在庫不足", "Low Stock Alerts": "低在庫アラート", + "Machine": "マシン", "Machine Distribution": "機器分布", "Machine Distribution Map": "機器分布マップ", "Machine Inventory Overview": "機台在庫概要", + "Machine Stock": "マシン在庫", "Machine Replenishment": "機台補充", "Machine Return": "機台返品", "Machine to Warehouse": "機台から倉庫", @@ -131,6 +134,7 @@ "Please enter configuration name": "設定名を入力してください", "Please select a company": "会社を選択してください", "Please select warehouse and machine": "倉庫とマシンを選択してください", + "Please Select Slot first": "先にスロットを選択してください", "Points": "ポイント", "Prepared": "準備済み", "Preparing": "準備中", @@ -147,6 +151,7 @@ "Quick Replenish": "クイック補充", "Real-time slot-level inventory across all machines": "すべての機台におけるリアルタイムの貨道別在庫", "Replenishment cancelled, stock returned": "補充キャンセル、在庫返却", + "Replenishment Details": "機台補充伝票詳細", "Replenishment Items": "補充項目", "Replenishment order confirmed and inventory updated": "補充伝票が確定され、在庫が更新されました", "Replenishment order created successfully": "補充伝票が正常に作成されました", @@ -242,5 +247,10 @@ "Welcome Gift Feature": "来店特典機能", "Stock / Capacity": "在庫 / 上限", "Warehouse Stock": "倉庫在庫", - "Recalculate": "再計算" + "Recalculate": "再計算", + "Work Content": "作業内容", + "No content provided": "内容は提供されていません", + "Maintenance Photos": "メンテナンス写真", + "Execution Time": "実行時間", + "Product Name": "商品名" } \ No newline at end of file diff --git a/lang/zh_TW.json b/lang/zh_TW.json index 4fdadf3..5464362 100644 --- a/lang/zh_TW.json +++ b/lang/zh_TW.json @@ -1,4 +1,6 @@ { + "Start Time": "開始時間", + "End Time": "結束時間", "15 Seconds": "15 秒", "30 Seconds": "30 秒", "60 Seconds": "60 秒", @@ -258,6 +260,9 @@ "Confirm this transfer?": "確定要確認此調撥作業嗎?", "Confirm Transfer": "確認調撥", "Confirm Transfer Order": "確認調撥單", + "Are you sure you want to confirm preparation? This will deduct stock from the warehouse.": "確定要確認備貨嗎?此操作將會扣除倉庫庫存。", + "Are you sure you want to start delivery?": "確定要開始配送嗎?", + "Are you sure you want to confirm completion? This will update the machine stock.": "確定要確認完成嗎?此操作將會更新機台貨道庫存。", "Connected": "通訊中", "Connecting...": "連線中", "Connection lost (LWT)": "連線中斷", @@ -292,6 +297,7 @@ "Create Product": "建立商品", "Create Replenishment Order": "建立補貨單", "Create replenishment orders and manage restocking from warehouse to machines": "建立補貨單,管理從倉庫到機台的補貨流程", + "Create stock replenishment for specific machines": "為指定機台建立庫存補貨單", "Create Role": "建立角色", "CREATE STOCK TRANSFERS BETWEEN WAREHOUSES AND MACHINE RETURNS": "建立倉庫間調撥或機台退庫單", "Create stock transfers between warehouses and machine returns": "建立倉庫間調撥或機台退庫單", @@ -624,6 +630,7 @@ "Low stock and out-of-stock alerts": "低庫存與缺貨警示", "Loyalty & Features": "行銷與點數", "Machine Advertisement Settings": "機台廣告設置", + "Machine": "機台", "Machine Count": "機台數量", "Machine created successfully.": "機台已成功建立。", "Machine Details": "機台詳情", @@ -634,6 +641,7 @@ "Machine Info": "機台資訊", "Machine Information": "機台資訊", "Machine Inventory": "機台庫存", + "Machine Stock": "機台庫存", "Machine Inventory Overview": "機台庫存概覽", "Machine is heartbeat normal": "機台通訊正常", "Machine List": "機台列表", @@ -887,10 +895,13 @@ "Optional remarks...": "選填備註...", "Order already completed": "訂單已完成", "Order already processed": "訂單已處理", + "Order completed and stock updated": "訂單已完成,機台庫存已更新", "Order Details": "進貨單詳情", "Order has been cancelled": "訂單已取消", "Order Info": "單據資訊", + "Order is now in delivery": "訂單配送中", "Order Management": "訂單管理", + "Order prepared successfully, stock deducted": "訂單已成功備貨,庫存已扣除", "Order No.": "單號", "Orders": "購買單", "Original": "原始", @@ -977,6 +988,7 @@ "Please select a material": "請選擇素材", "Please select a slot": "請選擇貨道", "Please select warehouse and machine": "請選擇倉庫和機台", + "Please Select Slot first": "請先選擇貨道", "PNG, JPG up to 2MB": "支援 PNG, JPG (最大 2MB)", "PNG, JPG, WEBP up to 10MB": "支援 PNG, JPG, WEBP 格式,且不超過 10MB", "Point Rules": "點數規則", @@ -1071,6 +1083,7 @@ "Repair": "維修", "Replenishment": "補貨", "Replenishment Audit": "補貨單", + "Replenishment Details": "補貨單詳情", "Replenishment cancelled, stock returned": "補貨取消,庫存退回", "Replenishment completed": "補貨完成", "Replenishment history": "補貨歷史紀錄", @@ -1508,5 +1521,7 @@ "待填寫": "待填寫", "Stock / Capacity": "庫存/上限", "Warehouse Stock": "倉庫數量", - "Recalculate": "重新計算" + "Recalculate": "重新計算", + "Work Content": "作業內容", + "Product Name": "商品名稱" } \ No newline at end of file diff --git a/resources/css/app.css b/resources/css/app.css index 88379b5..e2f4876 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -172,7 +172,7 @@ @layer components { .luxury-nav-item { - @apply flex items-center gap-x-3.5 py-2.5 px-4 text-sm font-semibold rounded-xl transition-all duration-200; + @apply flex items-center gap-x-3.5 py-2.5 px-4 text-sm font-semibold rounded-xl transition-all duration-200 overflow-hidden; @apply text-slate-600 hover:text-slate-900 hover:bg-slate-100; @apply dark:text-slate-300 dark:hover:text-white dark:hover:bg-white/5; } diff --git a/resources/views/admin/dashboard.blade.php b/resources/views/admin/dashboard.blade.php index 4059996..a347062 100644 --- a/resources/views/admin/dashboard.blade.php +++ b/resources/views/admin/dashboard.blade.php @@ -8,7 +8,8 @@
-

{{ __('Connectivity Status') }}

+

{{ + __('Connectivity Status') }}

{{ __('Real-time status monitoring') }}

-
+
-
-
+
+
- {{ __('Online Machines') }} + {{ __('Online Machines') + }}
{{ $activeMachines }}
-
+
- {{ __('Offline Machines') }} + {{ __('Offline Machines') + }}
{{ $offlineMachines }}
-
+
- {{ __('Alerts Pending') }} + {{ __('Alerts Pending') + }}
{{ $alertsPending }}
- -
+ + -
+

+ class="text-6xl sm:text-7xl font-black text-cyan-500 drop-shadow-[0_0_20px_rgba(6,182,212,0.3)] leading-none"> {{ $activeMachines }}

{{ __('Total Connected') }}

@@ -66,7 +71,8 @@
-

{{ __('Monthly Transactions') }}

+

{{ + __('Monthly Transactions') }}

{{ __('Monthly cumulative revenue overview') }}

-

{{ __("Today's Transactions") }}

+

{{ __("Today Cumulative Sales") }}

${{ number_format($totalRevenue / 30, 0) }}

@@ -101,7 +107,8 @@
+12.5% -

{{ __('vs Yesterday') }}

+

{{ + __('vs Yesterday') }}

@@ -148,11 +155,12 @@
-
+
-

{{ __('Machine Status List') }}

+

{{ + __('Machine Status List') }}

{{ __('Total items', ['count' => $machines->total()]) }} @@ -161,8 +169,9 @@

{{ __('Real-time monitoring across all machines') }}

-
-
+ +
-
+ + -
- {{ $machines->appends(request()->query())->links('vendor.pagination.luxury') }} + +
+ @forelse($machines as $machine) +
+ +
+
+
+ @if(isset($machine->image_urls[0])) + + @else + + + + @endif +
+
+

+ {{ $machine->name }} +

+

+ SN: {{ $machine->serial_no ?: '--' }} +

+
+
+ + @php $cStatus = $machine->calculated_status; @endphp +
+ @if($cStatus === 'online') +
+ + +
+ @elseif($cStatus === 'error') +
+ @else +
+ @endif +
+
+ + +
+
+

{{ __('Today Cumulative Sales') }}

+

$ {{ number_format($machine->today_sales_sum ?? 0, 0) }}

+
+
+

{{ __('Status') }}

+

+ @if($cStatus === 'online') + {{ __('Online') }} + @elseif($cStatus === 'error') + {{ __('Error') }} + @else + {{ __('Offline') }} + @endif +

+
+
+

{{ __('Last Signal') }}

+

+ {{ $machine->last_heartbeat_at ? $machine->last_heartbeat_at->format('Y-m-d H:i:s') : '---' }} +

+
+
+ + +
+ @php + $stockSum = (float)($machine->slots_sum_stock ?? 0); + $maxStockSum = (float)($machine->slots_sum_max_stock ?? 0); + $stockPercentage = $maxStockSum > 0 ? round(($stockSum / $maxStockSum) * 100, 1) : 0; + $barColor = $stockPercentage < 20 ? 'bg-rose-500' : ($stockPercentage < 50 ? 'bg-amber-500' : 'bg-emerald-500'); + @endphp +
+

{{ __('Current Stock') }}

+ {{ $stockPercentage }}% +
+
+
+
+
+ + + + + + + + {{ __('Inventory Overview') }} + +
+ @empty +
+ {{ __('No data available') }} +
+ @endforelse
-
+ +
+ {{ $machines->appends(request()->query())->links('vendor.pagination.luxury') }} +
+
@endsection \ No newline at end of file diff --git a/resources/views/admin/machines/index.blade.php b/resources/views/admin/machines/index.blade.php index 3592823..6bd2f5c 100644 --- a/resources/views/admin/machines/index.blade.php +++ b/resources/views/admin/machines/index.blade.php @@ -156,7 +156,7 @@ }; -
-
+

+ class="text-2xl sm:text-3xl font-black text-slate-800 dark:text-white tracking-tight font-display transition-all duration-300"> {{ __('Machine List') }}

@@ -210,8 +210,8 @@ :class="{ 'opacity-30 pointer-events-none transition-opacity duration-300': isLoadingTable }"> -

-
+ -
- - - - - - - +
+
+ + + + + + + +
+ +
+ + + +
- - - -
-
+ + + +
+ @foreach ($machines as $machine) +
+ +
+
+
+ @if(isset($machine->image_urls[0])) + + @else + + + + @endif +
+
+

+ {{ $machine->name }} +

+

+ {{ $machine->serial_no ?: '--' }} +

+
+
+ + @php + $cStatus = $machine->calculated_status; + @endphp + @if($cStatus === 'online') +
+ + +
+ @elseif($cStatus === 'error') +
+ @else +
+ @endif +
+ + +
+
+

{{ __('Temperature') }}

+

{{ $machine->temperature ?? '--' }}°C

+
+
+

{{ __('APP Version') }}

+

{{ $machine->firmware_version ?: '-' }}

+
+
+

{{ __('Last Page') }}

+

{{ $machine->current_page_label ?: '-' }}

+
+
+

{{ __('Status') }}

+

+ @if($cStatus === 'online') + {{ __('Online') }} + @elseif($cStatus === 'error') + {{ __('Error') }} + @else + {{ __('Offline') }} + @endif +

+
+
+

{{ __('Last Heartbeat') }}

+

+ {{ $machine->last_heartbeat_at ? $machine->last_heartbeat_at->format('Y-m-d H:i:s') : '-' }} +

+
+
+ + +
+ + +
+
+ @endforeach +
+
{{ $machines->appends(request()->query())->links('vendor.pagination.luxury') }}
@@ -476,47 +580,54 @@
-
+
-
- - +
+ +
+ + + + + + +
-
- - +
+ +
+ + + + + + +
@@ -606,8 +717,11 @@ -
+
+ +
diff --git a/resources/views/admin/machines/permissions.blade.php b/resources/views/admin/machines/permissions.blade.php index 4a00ee8..33d69b5 100644 --- a/resources/views/admin/machines/permissions.blade.php +++ b/resources/views/admin/machines/permissions.blade.php @@ -1,7 +1,7 @@ @extends('layouts.admin') @section('content') -
-
+
-

{{ __('Machine Permissions') }}

+

{{ __('Machine Permissions') }}

{{ __('Manage machine access permissions') }}

@@ -153,7 +153,7 @@
-
+
@if(auth()->user()->isSystemAdmin()) -
+
@endif - - - +
+ + + +
-
+ + + +
+ @forelse($users_list as $user) +
+ + +
+
+
+ + + +
+
+

+ {{ $user->name }} +

+

+ {{ $user->username }} +

+
+
+
+ + {{ $user->company->name ?? __('System') }} + +
+
+ + +
+
+ {{ __('Authorized Machines') }} + {{ $user->machines->count() }} +
+
+ @forelse($user->machines as $m) +
+ {{ $m->name }} +
+ @empty +
+ -- {{ __('None') }} -- +
+ @endforelse +
+
+ + +
+ +
+
+ @empty +
+
+ + + +

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

+
+
+ @endforelse +
{{ $users_list->links('vendor.pagination.luxury') }}
diff --git a/resources/views/admin/machines/utilization.blade.php b/resources/views/admin/machines/utilization.blade.php index 594adc3..2f7269e 100644 --- a/resources/views/admin/machines/utilization.blade.php +++ b/resources/views/admin/machines/utilization.blade.php @@ -176,7 +176,7 @@ window.utilizationDashboard = function(initialMachines, initialStats) { } -
+
diff --git a/resources/views/admin/maintenance/index.blade.php b/resources/views/admin/maintenance/index.blade.php index b9b7b96..bf2450d 100644 --- a/resources/views/admin/maintenance/index.blade.php +++ b/resources/views/admin/maintenance/index.blade.php @@ -1,7 +1,7 @@ @extends('layouts.admin') @section('content') -
-
+
-

{{ __('Maintenance Records') }}

+

{{ __('Maintenance Records') }}

{{ __('Track device health and maintenance history') }}

@@ -47,7 +48,7 @@ - {{ __('New Record') }} + {{ __('New Record') }}
@@ -85,47 +86,73 @@
-
-
- - - - - - - -
+
+ + + + + + + +
- -
- + +
+ - @foreach(['Repair', 'Installation', 'Removal', 'Maintenance'] as $cat) - - @endforeach - -
+ @foreach(['Repair', 'Installation', 'Removal', 'Maintenance'] as $cat) + + @endforeach +
+
+ +
+ + + +
- -
+ + + +
+ @forelse($records as $record) +
+ + +
+
+
+ + + +
+
+

+ {{ $record->machine->name ?? 'N/A' }} +

+

+ {{ $record->machine->serial_no ?? 'N/A' }} +

+
+
+ @php + $color = match($record->category) { + 'Repair' => 'rose', + 'Installation' => 'emerald', + 'Removal' => 'amber', + 'Maintenance' => 'cyan', + default => 'slate' + }; + @endphp +
+
+ + + {{ __($record->category) }} + +
+
+
+ + +
+
+

{{ __('Execution Time') }}

+

{{ $record->maintenance_at->format('Y-m-d H:i') }}

+
+
+

{{ __('Engineer') }}

+
+
+ {{ mb_substr($record->user->name, 0, 1) }} +
+ {{ $record->user->name }} +
+
+ @if(auth()->user()->isSystemAdmin()) +
+

{{ __('Company') }}

+

+ {{ $record->company->name ?? __('System') }} ({{ $record->company->company_code ?? '' }}) +

+
+ @endif +
+ + +
+ +
+
+ @empty +
+
+ + + +

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

+
+
+ @endforelse +
+
{{ $records->links('vendor.pagination.luxury') }}
-
+ @@ -242,10 +361,12 @@
-
- {{ __('Company') }} -
-
+
{{ __('Execution Time') }}
@@ -289,7 +410,7 @@
- +

{{ __('Machine Inventory Overview') }}

-

{{ __('Real-time slot-level inventory across all machines') }}

+

{{ __('Real-time slot-level inventory across all machines') }}

{{-- List Mode --}}
-
+
-
+
- + - +
- -
@@ -127,80 +135,113 @@ - - - - - - + + + + + + @forelse($machines as $machine) @php - $maxStock = $machine->slots->sum('max_stock') ?: 1; - $currentStock = (int)($machine->total_stock ?? 0); - $fillRate = round(($currentStock / $maxStock) * 100); - $fillColor = $fillRate >= 50 ? 'emerald' : ($fillRate >= 20 ? 'amber' : 'rose'); + $maxStock = $machine->slots->sum('max_stock') ?: 1; + $currentStock = (int)($machine->total_stock ?? 0); + $fillRate = round(($currentStock / $maxStock) * 100); + $fillColor = $fillRate >= 50 ? 'emerald' : ($fillRate >= 20 ? 'amber' : 'rose'); @endphp @empty - + + + @endforelse
{{ __('Machine') }}{{ __('Serial No.') }}{{ __('Slots') }}{{ __('Total Stock') }}{{ __('Stock Rate') }}{{ __('Actions') }} + {{ __('Machine') }} + {{ __('Serial No.') }} + {{ __('Slots') }} + {{ __('Total Stock') }} + {{ __('Stock Rate') }} + {{ __('Actions') }}
-
+
@if($machine->image_urls && isset($machine->image_urls[0])) - + @else - + + + @endif
- {{ $machine->name }} + {{ + $machine->name }}
- {{ $machine->serial_no }} + {{ + $machine->serial_no }} - {{ $machine->total_slots ?? 0 }} + {{ $machine->total_slots ?? 0 + }} {{ $currentStock }}
-
-
-
- {{ $fillRate }}% -
+
+
+
+ {{ $fillRate + }}% +
{{ __('No machines found') }}
{{ __('No + machines found') }}
-
{{ $machines->links('vendor.pagination.luxury') }}
+
{{ + $machines->links('vendor.pagination.luxury') }}
@@ -209,22 +250,32 @@
-
-
+
+
+
- - + +
- - + +
- {{ __('總庫存量') }} + {{ __('總庫存量') + }}
@@ -232,66 +283,98 @@
-
+
-
+
-

- +

+

+
-
+
-
- +
+ + +
- +
- {{ __('Active Slots') }} + {{ __('Active Slots') + }}
-
+
-
- +
+ + +
- +
- {{ __('Empty Slots') }} + {{ __('Empty Slots') + }}
-
+
-
- +
+ + +
- {{ __('Stock Level > 50%') }} + {{ __('Stock Level + > 50%') }}
- +
@@ -303,47 +386,60 @@
- +
-
+
{{ __('Expired') }}
- {{ __('Low Stock') }} + {{ __('Low Stock') + }}
-
-
-
+
+
+
+
-
+
@@ -367,48 +465,65 @@
-
+
- - - - - + + + + + @@ -418,4 +533,4 @@ -@endsection +@endsection \ No newline at end of file diff --git a/resources/views/admin/warehouses/partials/modal-replenishment-auto.blade.php b/resources/views/admin/warehouses/partials/modal-replenishment-auto.blade.php index ea1e5b0..bc1b9f0 100644 --- a/resources/views/admin/warehouses/partials/modal-replenishment-auto.blade.php +++ b/resources/views/admin/warehouses/partials/modal-replenishment-auto.blade.php @@ -88,10 +88,12 @@ -
{{ __('Slot') }}{{ __('Product') }}{{ __('Barcode') }}{{ __('Stock Level') }} / {{ __('Max Stock') }}{{ __('Sale Price') }}{{ + __('Slot') }}{{ + __('Product') }}{{ + __('Barcode') }} + {{ __('Stock Level') }} / {{ __('Max Stock') }} + {{ __('Sale Price') }}
- - / - + +
+ + / + +
@@ -146,10 +148,10 @@ {{-- 庫存 / 上限 --}}
{{ __('Stock / Capacity') }}
-
- - / - +
+ + / +
diff --git a/resources/views/admin/warehouses/partials/modal-replenishment-create.blade.php b/resources/views/admin/warehouses/partials/modal-replenishment-create.blade.php index 9a9b64e..55576c6 100644 --- a/resources/views/admin/warehouses/partials/modal-replenishment-create.blade.php +++ b/resources/views/admin/warehouses/partials/modal-replenishment-create.blade.php @@ -23,7 +23,7 @@
- +
@@ -39,18 +39,17 @@
-