麵包屑功能完善

This commit is contained in:
2026-01-07 13:06:49 +08:00
parent d852d7b2ec
commit 8ea1ce1515
14 changed files with 137 additions and 23 deletions

View File

@@ -28,6 +28,7 @@ import { Head, Link, router } from "@inertiajs/react";
import { Warehouse, InboundItem, InboundReason } from "@/types/warehouse";
import { getCurrentDateTime } from "@/utils/format";
import { toast } from "sonner";
import { getInventoryBreadcrumbs } from "@/utils/breadcrumb";
interface Product {
id: string;
@@ -151,7 +152,7 @@ export default function AddInventoryPage({ warehouse, products }: Props) {
};
return (
<AuthenticatedLayout>
<AuthenticatedLayout breadcrumbs={getInventoryBreadcrumbs(warehouse.id, warehouse.name, "手動入庫")}>
<Head title={`新增庫存 - ${warehouse.name}`} />
<div className="container mx-auto p-6 max-w-7xl">
{/* 頁面標題與導航 - 已於先前任務優化 */}

View File

@@ -19,6 +19,7 @@ import {
AlertDialogTitle,
} from "@/Components/ui/alert-dialog";
import TransactionTable, { Transaction } from "@/Components/Warehouse/Inventory/TransactionTable";
import { getShowBreadcrumbs } from "@/utils/breadcrumb";
interface Props {
@@ -72,7 +73,7 @@ export default function EditInventory({ warehouse, inventory, transactions = []
};
return (
<AuthenticatedLayout>
<AuthenticatedLayout breadcrumbs={getShowBreadcrumbs("warehouses", "修正庫存")}>
<Head title={`編輯庫存 - ${inventory.productName} `} />
<div className="container mx-auto p-6 max-w-4xl">
{/* 頁面標題與麵包屑 */}

View File

@@ -11,6 +11,7 @@ import WarehouseEmptyState from "@/Components/Warehouse/WarehouseEmptyState";
import { Warehouse } from "@/types/warehouse";
import Pagination from "@/Components/shared/Pagination";
import { toast } from "sonner";
import { getBreadcrumbs } from "@/utils/breadcrumb";
interface PageProps {
warehouses: {
@@ -100,7 +101,7 @@ export default function WarehouseIndex({ warehouses, filters }: PageProps) {
};
return (
<AuthenticatedLayout>
<AuthenticatedLayout breadcrumbs={getBreadcrumbs("warehouses")}>
<Head title="倉庫管理" />
<div className="container mx-auto p-6 max-w-7xl">
{/* 頁面標題 */}

View File

@@ -8,6 +8,7 @@ import InventoryToolbar from "@/Components/Warehouse/Inventory/InventoryToolbar"
import InventoryTable from "@/Components/Warehouse/Inventory/InventoryTable";
import { calculateLowStockCount } from "@/utils/inventory";
import { toast } from "sonner";
import { getInventoryBreadcrumbs } from "@/utils/breadcrumb";
import {
AlertDialog,
AlertDialogAction,
@@ -85,7 +86,7 @@ export default function WarehouseInventoryPage({
};
return (
<AuthenticatedLayout>
<AuthenticatedLayout breadcrumbs={getInventoryBreadcrumbs(warehouse.id, warehouse.name)}>
<Head title={`庫存管理 - ${warehouse.name}`} />
<div className="container mx-auto p-6 max-w-7xl">
{/* 頁面標題與導航 */}

View File

@@ -4,6 +4,7 @@ import { Button } from "@/Components/ui/button";
import { ArrowLeft } from "lucide-react";
import { Warehouse } from "@/types/warehouse";
import TransactionTable, { Transaction } from "@/Components/Warehouse/Inventory/TransactionTable";
import { getInventoryBreadcrumbs } from "@/utils/breadcrumb";
interface Props {
warehouse: Warehouse;
@@ -18,7 +19,7 @@ interface Props {
export default function InventoryHistory({ warehouse, inventory, transactions }: Props) {
return (
<AuthenticatedLayout>
<AuthenticatedLayout breadcrumbs={getInventoryBreadcrumbs(warehouse.id, warehouse.name, "庫存變動紀錄")}>
<Head title={`庫存異動紀錄 - ${inventory.productName}`} />
<div className="container mx-auto p-6 max-w-4xl">
{/* Header */}

View File

@@ -13,6 +13,7 @@ import SafetyStockList from "@/Components/Warehouse/SafetyStock/SafetyStockList"
import AddSafetyStockDialog from "@/Components/Warehouse/SafetyStock/AddSafetyStockDialog";
import EditSafetyStockDialog from "@/Components/Warehouse/SafetyStock/EditSafetyStockDialog";
import { toast } from "sonner";
import { getInventoryBreadcrumbs } from "@/utils/breadcrumb";
interface Props {
warehouse: Warehouse;
@@ -83,7 +84,7 @@ export default function SafetyStockPage({
}
return (
<AuthenticatedLayout>
<AuthenticatedLayout breadcrumbs={getInventoryBreadcrumbs(warehouse.id, warehouse.name, "安全庫存設定")}>
<Head title={`安全庫存設定 - ${warehouse.name}`} />
<div className="container mx-auto p-6 max-w-7xl">
{/* 頁面標題與導航 */}