|
|
|
@@ -579,7 +579,7 @@ export const batchScan = async (data: BatchScanRequest) => { |
|
|
|
}, |
|
|
|
); |
|
|
|
|
|
|
|
console.log("📥 batchScan - Response:", response); |
|
|
|
//console.log("📥 batchScan - Response:", response); |
|
|
|
return response; |
|
|
|
}; |
|
|
|
export const fetchDoPickOrderDetail = async ( |
|
|
|
@@ -765,6 +765,14 @@ export const fetchFGPickOrdersByUserId = async (userId: number) => { |
|
|
|
); |
|
|
|
return response; |
|
|
|
}; |
|
|
|
|
|
|
|
/** DO workbench: FG headers from `delivery_order_pick_order`, not `do_pick_order_line`. */ |
|
|
|
export const fetchFGPickOrdersByUserIdWorkbench = async (userId: number) => { |
|
|
|
return serverFetchJson<FGPickOrderResponse[]>( |
|
|
|
`${BASE_API_URL}/pickOrder/fg-pick-orders-workbench/${userId}`, |
|
|
|
{ method: "GET" }, |
|
|
|
); |
|
|
|
}; |
|
|
|
export const updateSuggestedLotLineId = async (suggestedPickLotId: number, newLotLineId: number) => { |
|
|
|
const response = await serverFetchJson<PostPickOrderResponse<UpdateSuggestedLotLineIdRequest>>( |
|
|
|
`${BASE_API_URL}/suggestedPickLot/update-suggested-lot/${suggestedPickLotId}`, |
|
|
|
@@ -824,6 +832,8 @@ export const recordPickExecutionIssue = async (data: PickExecutionIssueData) => |
|
|
|
revalidateTag("pickorder"); |
|
|
|
return result; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export const resuggestPickOrder = async (pickOrderId: number) => { |
|
|
|
console.log("Resuggesting pick order:", pickOrderId); |
|
|
|
const result = await serverFetchJson<PostPickOrderResponse>( |
|
|
|
@@ -1134,6 +1144,26 @@ export const fetchAllPickOrderLotsHierarchical = cache(async (userId: number): P |
|
|
|
}; |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
/** DO workbench: hierarchical lots where header is `delivery_order_pick_order`. */ |
|
|
|
export const fetchAllPickOrderLotsHierarchicalWorkbench = cache(async (userId: number): Promise<any> => { |
|
|
|
try { |
|
|
|
const data = await serverFetchJson<any>( |
|
|
|
`${BASE_API_URL}/pickOrder/all-lots-hierarchical-workbench/${userId}`, |
|
|
|
{ |
|
|
|
method: "GET", |
|
|
|
next: { tags: ["pickorder"] }, |
|
|
|
}, |
|
|
|
); |
|
|
|
return data; |
|
|
|
} catch (error) { |
|
|
|
console.error("❌ Error fetching workbench hierarchical lot details:", error); |
|
|
|
return { |
|
|
|
pickOrder: null, |
|
|
|
pickOrderLines: [], |
|
|
|
}; |
|
|
|
} |
|
|
|
}); |
|
|
|
export const fetchLotDetailsByDoPickOrderRecordId = async (doPickOrderRecordId: number): Promise<{ |
|
|
|
fgInfo: any; |
|
|
|
pickOrders: any[]; |
|
|
|
|