优化
This commit is contained in:
@@ -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
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user