diff --git a/src/components/FinishedGoodSearch/FinishedGoodFloorLanePanel.tsx b/src/components/FinishedGoodSearch/FinishedGoodFloorLanePanel.tsx index 4669828..941aa96 100644 --- a/src/components/FinishedGoodSearch/FinishedGoodFloorLanePanel.tsx +++ b/src/components/FinishedGoodSearch/FinishedGoodFloorLanePanel.tsx @@ -11,9 +11,10 @@ import dayjs from "dayjs"; interface Props { onPickOrderAssigned?: () => void; + onSwitchToDetailTab?: () => void; } -const FinishedGoodFloorLanePanel: React.FC = ({ onPickOrderAssigned }) => { +const FinishedGoodFloorLanePanel: React.FC = ({ onPickOrderAssigned, onSwitchToDetailTab }) => { const { t } = useTranslation("pickOrder"); const { data: session } = useSession() as { data: SessionWithTokens | null }; const currentUserId = session?.id ? parseInt(session.id) : undefined; @@ -84,6 +85,7 @@ const FinishedGoodFloorLanePanel: React.FC = ({ onPickOrderAssigned }) => window.dispatchEvent(new CustomEvent('pickOrderAssigned')); loadSummaries(); // 刷新按钮状态 onPickOrderAssigned?.(); + onSwitchToDetailTab?.(); } else if (res.code === "USER_BUSY") { Swal.fire({ icon: "warning", @@ -116,7 +118,7 @@ const FinishedGoodFloorLanePanel: React.FC = ({ onPickOrderAssigned }) => } finally { setIsAssigning(false); } - }, [currentUserId, t, selectedDate, onPickOrderAssigned]); + }, [currentUserId, t, selectedDate, onPickOrderAssigned, onSwitchToDetailTab, loadSummaries]); const getDateLabel = (offset: number) => { return dayjs().add(offset, 'day').format('YYYY-MM-DD'); diff --git a/src/components/FinishedGoodSearch/FinishedGoodSearch.tsx b/src/components/FinishedGoodSearch/FinishedGoodSearch.tsx index ff54a88..376db21 100644 --- a/src/components/FinishedGoodSearch/FinishedGoodSearch.tsx +++ b/src/components/FinishedGoodSearch/FinishedGoodSearch.tsx @@ -330,6 +330,10 @@ const handleAssignByLane = useCallback(async ( }, [], ); + + const handleSwitchToDetailTab = useCallback(() => { + setTabIndex(1); + }, []); const openCreateModal = useCallback(async () => { console.log("testing") @@ -621,10 +625,15 @@ const handleAssignByLane = useCallback(async ( {/* Content section - NO overflow: 'auto' here */} - - {tabIndex === 0 && } + + + {tabIndex === 0 && ( + + )} {tabIndex === 1 && } {tabIndex === 2 && } {tabIndex === 3 && } diff --git a/src/components/FinishedGoodSearch/GoodPickExecution.tsx b/src/components/FinishedGoodSearch/GoodPickExecution.tsx index ca39390..6c58f2e 100644 --- a/src/components/FinishedGoodSearch/GoodPickExecution.tsx +++ b/src/components/FinishedGoodSearch/GoodPickExecution.tsx @@ -57,6 +57,7 @@ import GoodPickExecutiondetail from "./GoodPickExecutiondetail"; interface Props { filterArgs: Record; onFgPickOrdersChange?: (fgPickOrders: FGPickOrderResponse[]) => void; + onSwitchToDetailTab?: () => void; } // QR Code Modal Component (from LotTable) @@ -313,7 +314,7 @@ const QrCodeModal: React.FC<{ ); }; -const PickExecution: React.FC = ({ filterArgs, onFgPickOrdersChange }) => { +const PickExecution: React.FC = ({ filterArgs, onFgPickOrdersChange, onSwitchToDetailTab }) => { const { t } = useTranslation("pickOrder"); const router = useRouter(); const { data: session } = useSession() as { data: SessionWithTokens | null }; @@ -985,6 +986,7 @@ return ( fetchFgPickOrdersData(); } }} + onSwitchToDetailTab={onSwitchToDetailTab} /> ) : ( // 有活动订单,显示 FG 订单信息