feat(inventory): 開放倉庫編號編輯、優化調撥單條碼搜尋與庫存匯入範本雙分頁說明
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useState, useMemo } from "react";
|
||||
import { ArrowLeft, PackagePlus, AlertTriangle, Shield, Boxes } from "lucide-react";
|
||||
import { ArrowLeft, PackagePlus, AlertTriangle, Shield, Boxes, FileUp } from "lucide-react";
|
||||
import { Button } from "@/Components/ui/button";
|
||||
import AuthenticatedLayout from "@/Layouts/AuthenticatedLayout";
|
||||
import { Head, Link, router } from "@inertiajs/react";
|
||||
@@ -20,6 +20,7 @@ import {
|
||||
AlertDialogTitle,
|
||||
} from "@/Components/ui/alert-dialog";
|
||||
import { Can } from "@/Components/Permission/Can";
|
||||
import InventoryImportDialog from "@/Components/Warehouse/Inventory/InventoryImportDialog";
|
||||
|
||||
// 庫存頁面 Props
|
||||
interface Props {
|
||||
@@ -38,6 +39,7 @@ export default function WarehouseInventoryPage({
|
||||
const [searchTerm, setSearchTerm] = useState("");
|
||||
const [typeFilter, setTypeFilter] = useState<string>("all");
|
||||
const [deleteId, setDeleteId] = useState<string | null>(null);
|
||||
const [importDialogOpen, setImportDialogOpen] = useState(false);
|
||||
|
||||
// 篩選庫存列表
|
||||
const filteredInventories = useMemo(() => {
|
||||
@@ -157,6 +159,18 @@ export default function WarehouseInventoryPage({
|
||||
庫存警告:{lowStockItems} 項
|
||||
</Button>
|
||||
|
||||
{/* 匯入入庫按鈕 */}
|
||||
<Can permission="inventory.adjust">
|
||||
<Button
|
||||
variant="outline"
|
||||
className="button-outlined-primary"
|
||||
onClick={() => setImportDialogOpen(true)}
|
||||
>
|
||||
<FileUp className="mr-2 h-4 w-4" />
|
||||
匯入入庫
|
||||
</Button>
|
||||
</Can>
|
||||
|
||||
{/* 新增庫存按鈕 */}
|
||||
<Can permission="inventory.adjust">
|
||||
<Link href={route('warehouses.inventory.create', warehouse.id)}>
|
||||
@@ -210,6 +224,13 @@ export default function WarehouseInventoryPage({
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
|
||||
{/* 匯入對話框 */}
|
||||
<InventoryImportDialog
|
||||
open={importDialogOpen}
|
||||
onOpenChange={setImportDialogOpen}
|
||||
warehouseId={warehouse.id}
|
||||
/>
|
||||
</div>
|
||||
</AuthenticatedLayout>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user