diff --git a/src/components/StockTakeManagement/PickerCardList.tsx b/src/components/StockTakeManagement/PickerCardList.tsx index ca5fc4df..59b7feaa 100644 --- a/src/components/StockTakeManagement/PickerCardList.tsx +++ b/src/components/StockTakeManagement/PickerCardList.tsx @@ -71,6 +71,7 @@ import { dayjsToDateTimeString, } from "@/app/utils/formatUtil"; import { AUTH } from "@/authorities"; +import { statusChipColor } from "./StockTakeRoundCardList"; const FLOOR_GROUP_UNSET = "__UNSET__"; /** 與 controllQRcodescanWarehouse 選倉相同:樓層 → 倉庫 → 倉位 */ @@ -1264,21 +1265,6 @@ const PickerCardList: React.FC = ({ return Array.from(sectionSet).sort((a, b) => a.localeCompare(b)); }); }, [roundRecords]); - const getStatusColor = (status: string) => { - const statusLower = status.toLowerCase().replace(/_/g, ""); - if (statusLower === "completed") return "success"; - if ( - statusLower === "stocktaking" || - statusLower === "inprogress" || - statusLower === "processing" - ) { - return "primary"; // 盤點中 — 藍 - } - if (statusLower === "approving") return "info"; - if (statusLower === "pending") return "warning"; // 待處理 — 橘 - if (statusLower === "nocycle") return "default"; - return "default"; - }; const TimeDisplay: React.FC<{ startTime: string | null; endTime: string | null }> = ({ startTime, endTime }) => { const [currentTime, setCurrentTime] = useState(dayjs()); @@ -1339,10 +1325,6 @@ const PickerCardList: React.FC = ({ return "-"; } }; - const getCompletionRate = (session: AllPickedStockTakeListReponse): number => { - if (session.totalInventoryLotNumber === 0) return 0; - return Math.round((session.currentStockTakeItemNumber / session.totalInventoryLotNumber) * 100); - }; const planStartDate = globalRoundPlanStartDate; const closeCreateDialog = () => { setOpenConfirmDialog(false); @@ -1732,16 +1714,14 @@ const PickerCardList: React.FC = ({ ) : ( {stockTakeSessions.map((session: AllPickedStockTakeListReponse) => { - const statusColor = getStatusColor(session.status || ""); const lastStockTakeDate = session.lastStockTakeDate ? dayjs(session.lastStockTakeDate).format(OUTPUT_DATE_FORMAT) : "-"; - const completionRate = getCompletionRate(session); const sectionMeta = [ session.stockTakeSectionDescription, session.warehouseArea, session.storeId, - ].filter((v): v is string => Boolean(v && v.trim())).join(" / "); + ].filter((v): v is string => Boolean(v && v.trim())).join(" · "); return ( @@ -1751,7 +1731,7 @@ const PickerCardList: React.FC = ({ display: "flex", flexDirection: "column", border: "1px solid", - borderColor: statusColor === "success" ? "success.main" : "primary.main", + borderColor: "divider", }} > @@ -1792,7 +1772,8 @@ const PickerCardList: React.FC = ({ {t("View Details")} + {isAdmin && card.open ? ( + - {isAdmin && card.open ? ( - - ) : null} - - + ) : null} @@ -420,4 +429,16 @@ const StockTakeRoundCardList: React.FC = ({ ); }; +type StatusChipColor = "default" | "primary" | "secondary" | "error" | "info" | "success" | "warning"; + +export function statusChipColor(status: string): StatusChipColor { + const s = (status || "").toLowerCase().replace(/_/g, ""); + if (s === "completed") return "success"; + if (s === "pending") return "warning"; + if (s === "approving") return "info"; + if (s === "stocktaking" || s === "processing" || s === "inprogress") return "primary"; + if (s === "notmatch") return "warning"; + return "default"; +} + export default StockTakeRoundCardList; diff --git a/src/i18n/en/stockTake.json b/src/i18n/en/stockTake.json index f267674f..d31d6ac8 100644 --- a/src/i18n/en/stockTake.json +++ b/src/i18n/en/stockTake.json @@ -32,6 +32,11 @@ "Month suffix": "", "Next month": "Next month", "Open rounds this month": "Open rounds", + "progressCounted": "Counted", + "progressApproved": "Approved", + "Count of total": "{{done}} of {{total}}", + "Round unit sections": "Sections", + "Round unit lots": "Lots", "Previous month": "Previous month", "Round closed": "Round closed", "Main floor": "Main floor", @@ -59,7 +64,7 @@ "Confirm create stock take": "Confirm create stock take", "Section create item overlap title": "These items are already in an open item stock-take round; this round will skip them", "Section create item overlap line": "Item {{item}} is in round #{{round}}{{roundName}}; this round will not include it (section {{section}})", - "Control Time": "Control Time", + "Control Time": "Time spent", "Create by item": "By item", "Create by section": "By section", "Cannot create while both section and item rounds are open": "Cannot create a new round while both section and item rounds are open", @@ -77,7 +82,7 @@ "Total selected lots label": "Selected lots", "items unit": "item(s)", "lots unit": "lot(s)", - "Create Stock Take (Select Sections)": "Create stock take (select sections)", + "Create Stock Take (Select Sections)": "Create stock take", "Created": "Created", "Creation date": "Creation date", "Damage": "Damage", @@ -179,11 +184,11 @@ "Stock take round name": "Stock take round name", "Stock take round name placeholder": "Optional, e.g. May full-site stock take", "Stock take sections in current list": "{{count}} stock take section(s) in current list", - "Store ID": "Store ID", + "Store ID": "Floor", "Submit All Inputted": "Submit All Inputted", "Total": "Total", "Total Adjustments": "Total Adjustments", - "Total Item Kind Number": "Total Item Kind Number", + "Total Item Kind Number": "Items", "Total Items": "Total Items", "Total Lots": "Total Lots", "Total Sections": "Total Sections", @@ -196,7 +201,7 @@ "Variance filter inclusive only": "Within range", "Variance filter inclusive range hint": "Show rows with |variance %| ≤ {{value}}%", "View Details": "View Details", - "View ReStockTake": "View ReStockTake", + "View ReStockTake": "Re-count", "Warehouse": "Warehouse", "Warehouse code": "Warehouse code", "Warehouse Location": "Warehouse Location", @@ -211,7 +216,7 @@ "book qty": "book qty", "completed": "Completed", "do": "Delivery order", - "end time": "end time", + "end time": "Finished", "jo": "Job order", "lot_issue": "Lot issue", "material": "Material", @@ -224,7 +229,7 @@ "resolved": "Resolved", "sections unit": "area(s)", "selected stock take qty": "selected stock take qty", - "start time": "start time", + "start time": "Started", "Select floor first": "Select floor first", "Select warehouse first": "Select warehouse first", "Select area first": "Select area first", diff --git a/src/i18n/zh/stockTake.json b/src/i18n/zh/stockTake.json index b58f6d75..d13a4097 100644 --- a/src/i18n/zh/stockTake.json +++ b/src/i18n/zh/stockTake.json @@ -15,6 +15,11 @@ "Month suffix": "月", "Next month": "下一個月", "Open rounds this month": "進行中的輪次", + "progressCounted": "已點算", + "progressApproved": "已審核", + "Count of total": "{{done}}/{{total}}", + "Round unit sections": "區域", + "Round unit lots": "批號", "Previous month": "上一個月", "Round closed": "已關閉此輪", "Main floor": "主要樓層", @@ -74,9 +79,9 @@ "Last Stock Take Date": "上次盤點日期", "Stock Taker": "盤點員", "Approver": "審核員", - "start time": "開始時間", - "end time": "結束時間", - "Control Time": "操作時間", + "start time": "開始", + "end time": "結束", + "Control Time": "耗時", "Approver stock take record saved successfully": "審核員盤點記錄保存成功", "Stock take record status updated to not match": "盤點狀態更新為要求重點", "Batch approver save completed: {{success}} success, {{errors}} errors": "批次審核儲存完成:成功 {{success}} 筆,錯誤 {{errors}} 筆", @@ -158,9 +163,9 @@ "Total selected lots label": "已選批號", "items unit": "項", "lots unit": "筆", - "Create Stock Take (Select Sections)": "建立盤點(選擇區域)", - "Total Item Kind Number": "貨品種類數量", - "View ReStockTake": "查看重新盤點", + "Create Stock Take (Select Sections)": "建立盤點", + "Total Item Kind Number": "貨品種類", + "View ReStockTake": "重新盤點", "Warehouse missing stock take section tooltip has": "有 {{count}} 個倉庫未設定盤點區域,點擊查看", "Warehouse missing stock take section tooltip none": "所有倉庫均已設定盤點區域", "Warehouse missing stock take section warn title": "未設定盤點區域的倉庫",