diff --git a/resources/js/Components/Product/ProductDialog.tsx b/resources/js/Components/Product/ProductDialog.tsx index 73fdcdb..2dc998f 100644 --- a/resources/js/Components/Product/ProductDialog.tsx +++ b/resources/js/Components/Product/ProductDialog.tsx @@ -176,6 +176,13 @@ export default function ProductDialog({ id="barcode" value={data.barcode} onChange={(e) => setData("barcode", e.target.value)} + onKeyDown={(e) => { + if (e.key === 'Enter') { + e.preventDefault(); + // 掃描後自動跳轉到下一個欄位(品牌) + document.getElementById('brand')?.focus(); + } + }} placeholder="輸入條碼或自動生成" className={`flex-1 ${errors.barcode ? "border-red-500" : ""}`} /> diff --git a/resources/js/Pages/Production/Index.tsx b/resources/js/Pages/Production/Index.tsx index 3ef377e..d23793b 100644 --- a/resources/js/Pages/Production/Index.tsx +++ b/resources/js/Pages/Production/Index.tsx @@ -3,7 +3,7 @@ */ import { useState, useEffect } from "react"; -import { Plus, Factory, Search, RotateCcw, Eye, Pencil, Trash2 } from 'lucide-react'; +import { Plus, Factory, Search, Eye, Pencil, Trash2 } from 'lucide-react'; import { Button } from "@/Components/ui/button"; import AuthenticatedLayout from "@/Layouts/AuthenticatedLayout"; import { Head, router, Link } from "@inertiajs/react"; @@ -12,7 +12,7 @@ import { getBreadcrumbs } from "@/utils/breadcrumb"; import { Can } from "@/Components/Permission/Can"; import { SearchableSelect } from "@/Components/ui/searchable-select"; import { Input } from "@/Components/ui/input"; -import { Label } from "@/Components/ui/label"; + import { Select, SelectContent, @@ -80,11 +80,7 @@ export default function ProductionIndex({ productionOrders, filters }: Props) { ); }; - const handleReset = () => { - setSearch(""); - setStatus("all"); - router.get(route('production-orders.index')); - }; + const handlePerPageChange = (value: string) => { setPerPage(value); @@ -113,70 +109,79 @@ export default function ProductionIndex({ productionOrders, filters }: Props) { 記錄生產過程,追蹤原物料使用與成品入庫

-
- - - -
+ - {/* 篩選區塊 */} -
-
-
-
- -
- - setSearch(e.target.value)} - className="pl-10 h-9 block" - onKeyDown={(e) => e.key === 'Enter' && handleFilter()} - /> -
-
- -
- - -
+ {/* Toolbar */} +
+
+ {/* Search */} +
+ + setSearch(e.target.value)} + className="pl-10 pr-10 h-9" + onKeyDown={(e) => e.key === 'Enter' && handleFilter()} + /> + {search && ( + + )}
-
-
- - + + + + + 全部狀態 + 草稿 + 已完成 + 已取消 + + + + {/* Action Buttons */} +
+ + + + + +
diff --git a/resources/js/Pages/Production/Recipe/Index.tsx b/resources/js/Pages/Production/Recipe/Index.tsx index a8d3d30..52e7025 100644 --- a/resources/js/Pages/Production/Recipe/Index.tsx +++ b/resources/js/Pages/Production/Recipe/Index.tsx @@ -3,7 +3,7 @@ */ import { useState, useEffect } from "react"; -import { Plus, Search, RotateCcw, Pencil, Trash2, BookOpen, Eye } from 'lucide-react'; +import { Plus, Search, Pencil, Trash2, BookOpen, Eye } from 'lucide-react'; import { Button } from "@/Components/ui/button"; import AuthenticatedLayout from "@/Layouts/AuthenticatedLayout"; import { Head, router, Link } from "@inertiajs/react"; @@ -11,7 +11,7 @@ import Pagination from "@/Components/shared/Pagination"; import { getBreadcrumbs } from "@/utils/breadcrumb"; import { SearchableSelect } from "@/Components/ui/searchable-select"; import { Input } from "@/Components/ui/input"; -import { Label } from "@/Components/ui/label"; + import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/Components/ui/table"; import { Badge } from "@/Components/ui/badge"; import { Can } from "@/Components/Permission/Can"; @@ -82,10 +82,7 @@ export default function RecipeIndex({ recipes, filters }: Props) { ); }; - const handleReset = () => { - setSearch(""); - router.get(route('recipes.index')); - }; + const handlePerPageChange = (value: string) => { setPerPage(value); @@ -130,54 +127,55 @@ export default function RecipeIndex({ recipes, filters }: Props) { 管理產品的標準生產配方與用量

-
- - - - - -
+
- {/* 篩選區塊 */} -
-
-
-
- -
- - setSearch(e.target.value)} - className="pl-10 h-9 block" - onKeyDown={(e) => e.key === 'Enter' && handleFilter()} - /> -
-
+ {/* Toolbar */} +
+
+ {/* Search */} +
+ + setSearch(e.target.value)} + className="pl-10 pr-10 h-9" + onKeyDown={(e) => e.key === 'Enter' && handleFilter()} + /> + {search && ( + + )}
-
-
- - + {/* Action Buttons */} +
+ + + + + + + +