feat(inventory): 實作過期與瑕疵庫存總計顯示,並強化庫存明細過期提示
This commit is contained in:
56
resources/js/Pages/Product/Edit.tsx
Normal file
56
resources/js/Pages/Product/Edit.tsx
Normal file
@@ -0,0 +1,56 @@
|
||||
import AuthenticatedLayout from "@/Layouts/AuthenticatedLayout";
|
||||
import { Head, Link } from "@inertiajs/react";
|
||||
import { Package, ArrowLeft } from "lucide-react";
|
||||
import { Button } from "@/Components/ui/button";
|
||||
import ProductForm from "@/Components/Product/ProductForm";
|
||||
import { getEditBreadcrumbs } from "@/utils/breadcrumb";
|
||||
import type { Category, Product } from "./Index";
|
||||
import type { Unit } from "@/Components/Unit/UnitManagerDialog";
|
||||
|
||||
interface Props {
|
||||
product: Product;
|
||||
categories: Category[];
|
||||
units: Unit[];
|
||||
}
|
||||
|
||||
export default function Edit({ product, categories, units }: Props) {
|
||||
return (
|
||||
<AuthenticatedLayout
|
||||
breadcrumbs={getEditBreadcrumbs("products")}
|
||||
>
|
||||
<Head title={`編輯商品 - ${product.name}`} />
|
||||
|
||||
<div className="container mx-auto p-6 max-w-7xl">
|
||||
{/* Header */}
|
||||
<div className="mb-6">
|
||||
<Link href={route("products.index")}>
|
||||
<Button
|
||||
variant="outline"
|
||||
className="gap-2 button-outlined-primary mb-4"
|
||||
>
|
||||
<ArrowLeft className="h-4 w-4" />
|
||||
返回商品列表
|
||||
</Button>
|
||||
</Link>
|
||||
|
||||
<div className="mb-4">
|
||||
<h1 className="text-2xl font-bold text-grey-0 flex items-center gap-2">
|
||||
<Package className="h-6 w-6 text-primary-main" />
|
||||
編輯商品:{product.name}
|
||||
</h1>
|
||||
<p className="text-gray-500 mt-1">
|
||||
修改商品的基本資訊、價格或庫存單位設定。
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 表單內容 */}
|
||||
<ProductForm
|
||||
initialData={product}
|
||||
categories={categories}
|
||||
units={units}
|
||||
/>
|
||||
</div>
|
||||
</AuthenticatedLayout >
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user