This commit is contained in:
2026-09-11 17:27:33 +08:00
parent 88a1601814
commit 22fcaba78d
3 changed files with 44 additions and 11 deletions
+10
View File
@@ -59,3 +59,13 @@ export function downloadDropshipPalletLabel(taskId, warehouseId, palletId) {
return response.tempFilePath
})
}
export function downloadAllDropshipPalletLabels(taskId, warehouseId) {
const baseUrl = String(session.apiBase || '/api/platform/v1').replace(/\/$/, '')
const url = `${baseUrl}${ROOT}/tasks/${encodeURIComponent(taskId)}/pallets/print?warehouseId=${encodeURIComponent(stableId(warehouseId))}`
return apiDownload({ url }).then((response) => {
const contentType = response.header?.['Content-Type'] || response.header?.['content-type'] || ''
if (response.statusCode < 200 || response.statusCode >= 300 || !response.tempFilePath || (contentType && !/^application\/pdf/i.test(contentType))) throw new Error('全部托盘码打印文件生成失败')
return response.tempFilePath
})
}