# Conflicts: # src/components/Qc/QcStockInModal.tsx # src/components/StockTakeManagement/PickerStockTake.tsx # src/components/StockTakeManagement/StockTakeTab.tsxstockTakeUpdate
| @@ -103,10 +103,12 @@ const ApproverAllCardList: React.FC<ApproverAllCardListProps> = ({ | |||||
| const getStatusColor = (status: string | null) => { | const getStatusColor = (status: string | null) => { | ||||
| if (!status) return "default"; | if (!status) return "default"; | ||||
| const statusLower = status.toLowerCase(); | |||||
| const statusLower = status.toLowerCase().replace(/_/g, ""); | |||||
| if (statusLower === "completed") return "success"; | if (statusLower === "completed") return "success"; | ||||
| if (statusLower === "stocktaking" || statusLower === "processing") return "primary"; | |||||
| if (statusLower === "approving") return "info"; | if (statusLower === "approving") return "info"; | ||||
| return "warning"; | |||||
| if (statusLower === "pending") return "warning"; | |||||
| return "default"; | |||||
| }; | }; | ||||
| const paged = useMemo(() => { | const paged = useMemo(() => { | ||||
| @@ -121,12 +121,19 @@ const ApproverCardList: React.FC<ApproverCardListProps> = ({ onCardClick }) => { | |||||
| const getStatusColor = (status: string | null) => { | const getStatusColor = (status: string | null) => { | ||||
| if (!status) return "default"; | if (!status) return "default"; | ||||
| const statusLower = status.toLowerCase(); | |||||
| const statusLower = status.toLowerCase().replace(/_/g, ""); | |||||
| if (statusLower === "completed") return "success"; | if (statusLower === "completed") return "success"; | ||||
| if (statusLower === "in_progress" || statusLower === "processing") return "primary"; | |||||
| if (statusLower === "no_cycle") return "default"; | |||||
| if ( | |||||
| statusLower === "stocktaking" || | |||||
| statusLower === "inprogress" || | |||||
| statusLower === "processing" | |||||
| ) { | |||||
| return "primary"; | |||||
| } | |||||
| if (statusLower === "approving") return "info"; | if (statusLower === "approving") return "info"; | ||||
| return "warning"; | |||||
| if (statusLower === "pending") return "warning"; | |||||
| if (statusLower === "nocycle") return "default"; | |||||
| return "default"; | |||||
| }; | }; | ||||
| const getCompletionRate = (session: AllPickedStockTakeListReponse): number => { | const getCompletionRate = (session: AllPickedStockTakeListReponse): number => { | ||||
| @@ -1189,13 +1189,19 @@ const PickerCardList: React.FC<PickerCardListProps> = ({ | |||||
| }); | }); | ||||
| }, [roundRecords]); | }, [roundRecords]); | ||||
| const getStatusColor = (status: string) => { | const getStatusColor = (status: string) => { | ||||
| const statusLower = status.toLowerCase(); | |||||
| const statusLower = status.toLowerCase().replace(/_/g, ""); | |||||
| if (statusLower === "completed") return "success"; | if (statusLower === "completed") return "success"; | ||||
| if (statusLower === "in_progress" || statusLower === "processing") return "primary"; | |||||
| if ( | |||||
| statusLower === "stocktaking" || | |||||
| statusLower === "inprogress" || | |||||
| statusLower === "processing" | |||||
| ) { | |||||
| return "primary"; // 盤點中 — 藍 | |||||
| } | |||||
| if (statusLower === "approving") return "info"; | if (statusLower === "approving") return "info"; | ||||
| if (statusLower === "stockTaking") return "primary"; | |||||
| if (statusLower === "no_cycle") return "default"; | |||||
| return "warning"; | |||||
| 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 TimeDisplay: React.FC<{ startTime: string | null; endTime: string | null }> = ({ startTime, endTime }) => { | ||||
| const [currentTime, setCurrentTime] = useState(dayjs()); | const [currentTime, setCurrentTime] = useState(dayjs()); | ||||
| @@ -171,11 +171,12 @@ const StockTakeRoundCardList: React.FC<StockTakeRoundCardListProps> = ({ | |||||
| }; | }; | ||||
| const statusColor = (status: string) => { | const statusColor = (status: string) => { | ||||
| const s = (status || "").toLowerCase(); | |||||
| const s = (status || "").toLowerCase().replace(/_/g, ""); | |||||
| if (s === "completed") return "success"; | if (s === "completed") return "success"; | ||||
| if (s === "approving") return "info"; | if (s === "approving") return "info"; | ||||
| if (s === "stocktaking") return "primary"; | |||||
| return "warning"; | |||||
| if (s === "stocktaking" || s === "processing") return "primary"; // 盤點中 | |||||
| if (s === "pending") return "warning"; // 待處理 | |||||
| return "default"; | |||||
| }; | }; | ||||
| return ( | return ( | ||||