This commit is contained in:
2026-09-15 14:18:23 +08:00
parent fb41713930
commit a311ec41c3
13 changed files with 88 additions and 31 deletions
@@ -78,6 +78,16 @@ export async function getPallet(warehouseId: string, palletId: string) {
return unwrapApiResponse(response)
}
export async function getPalletLabelPdf(warehouseId: string, palletId: string) {
const blob = await overseasHttp.get<Blob, Blob>(
`/platform/v1/warehouse-admin/${encodeURIComponent(warehouseId)}/pallets/${encodeURIComponent(palletId)}/label`,
{ responseType: 'blob', timeout: 60_000 },
)
if (blob.type.includes('application/json')) unwrapApiResponse(JSON.parse(await blob.text()) as ApiEnvelope<unknown>)
if (!blob.size || !blob.type.includes('application/pdf')) throw new Error('打印服务未返回有效 PDF,请重试')
return blob
}
export async function createPallet(warehouseId: string, payload: SavePalletPayload) {
const response = await overseasHttp.post<ApiEnvelope<string>, ApiEnvelope<string>>(
`/platform/v1/warehouse-admin/${encodeURIComponent(warehouseId)}/pallets`, payload,