diff --git a/src/app/api/do/actions.tsx b/src/app/api/do/actions.tsx index 818dca4..34627af 100644 --- a/src/app/api/do/actions.tsx +++ b/src/app/api/do/actions.tsx @@ -8,6 +8,8 @@ import { QcItemResult } from "../settings/qcItem"; import { RecordsRes } from "../utils"; import { DoResult } from "."; import { GridRowId, GridRowSelectionModel } from "@mui/x-data-grid"; +import { GET } from "../auth/[...nextauth]/route"; +import { stringify } from "querystring"; export interface CreateConsoDoInput { ids: GridRowSelectionModel; @@ -70,6 +72,21 @@ export interface AssignByStoreResponse { errorPosition: string; entity: any; } + +export interface PrintDeliveryNoteRequest{ + deliveryOrderId: number; + printerId: number; + printQty: number; + numOfCarton: number; + isDraft: boolean; + pickOrderId: number; +} + +export interface PrintDeliveryNoteResponse{ + success: boolean; + message?: string +} + export const assignPickOrderByStore = cache(async (data: AssignByStoreRequest) => { return await serverFetchJson(`${BASE_API_URL}/doPickOrder/assign-by-store`, { @@ -128,3 +145,15 @@ export const fetchDoSearch = cache(async (code: string, shopName: string, status }); +export async function printDN(request: PrintDeliveryNoteRequest){ + const response = await serverFetchJson(`${BASE_API_URL}/do/print-DN`,{ + method: "GET", + body: JSON.stringify(request), + headers: { + 'Content-type': 'application/json', + }, + }); + return response; +} + + diff --git a/src/components/FinishedGoodSearch/GoodPickExecution.tsx b/src/components/FinishedGoodSearch/GoodPickExecution.tsx index 206d251..1bd52b8 100644 --- a/src/components/FinishedGoodSearch/GoodPickExecution.tsx +++ b/src/components/FinishedGoodSearch/GoodPickExecution.tsx @@ -449,7 +449,7 @@ const PickExecution: React.FC = ({ filterArgs }) => { } finally { setCombinedDataLoading(false); } - }, [currentUserId]); + }, [currentUserId, combinedLotData]); // ✅ Only fetch existing data when session is ready, no auto-assignment useEffect(() => { diff --git a/src/i18n/zh/pickOrder.json b/src/i18n/zh/pickOrder.json index 2b281ee..72d1631 100644 --- a/src/i18n/zh/pickOrder.json +++ b/src/i18n/zh/pickOrder.json @@ -287,8 +287,12 @@ "View Details":"查看詳情", "COMPLETED":"已完成", "FG orders":"成品提料單", - "Back to List":"返回列表" + "Back to List":"返回列表", + "No completed DO pick orders found":"沒有已完成送貨單提料單", + "Print DN Label":"列印送貨單標貼", + "Enter the number of cartons: ": "請輸入總箱數", + "Number of cartons": "箱數"