From bb78a432f5feaf303027fa338c7f16a70774a1f0 Mon Sep 17 00:00:00 2001 From: sky121113 Date: Mon, 2 Feb 2026 09:06:06 +0800 Subject: [PATCH] =?UTF-8?q?fix(product):=20=E4=BF=AE=E5=BE=A9=E6=A2=9D?= =?UTF-8?q?=E7=A2=BC=E6=8E=83=E6=8F=8F=E8=87=AA=E5=8B=95=E9=80=81=E5=87=BA?= =?UTF-8?q?=E5=95=8F=E9=A1=8C=E4=B8=A6=E5=84=AA=E5=8C=96=E6=89=8B=E5=8B=95?= =?UTF-8?q?=E8=BC=B8=E5=85=A5=E9=AB=94=E9=A9=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../js/Components/Product/ProductDialog.tsx | 7 + resources/js/Pages/Production/Index.tsx | 137 +++++++++--------- .../js/Pages/Production/Recipe/Index.tsx | 98 ++++++------- 3 files changed, 126 insertions(+), 116 deletions(-) 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 */} +
+ + + + + + + +