|
|
|
@@ -11,9 +11,10 @@ import dayjs from "dayjs"; |
|
|
|
|
|
|
|
interface Props { |
|
|
|
onPickOrderAssigned?: () => void; |
|
|
|
onSwitchToDetailTab?: () => void; |
|
|
|
} |
|
|
|
|
|
|
|
const FinishedGoodFloorLanePanel: React.FC<Props> = ({ onPickOrderAssigned }) => { |
|
|
|
const FinishedGoodFloorLanePanel: React.FC<Props> = ({ 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<Props> = ({ 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<Props> = ({ 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'); |
|
|
|
|