diff --git a/api/pda-dropship.js b/api/pda-dropship.js index d73f8da..050e51e 100644 --- a/api/pda-dropship.js +++ b/api/pda-dropship.js @@ -1,4 +1,5 @@ import { apiDownload, apiRequest } from '@/api/http.js' +import { session } from '@/stores/session.js' const ROOT = '/first-leg/pda-dropship' @@ -48,7 +49,8 @@ export function sealDropshipPallet(taskId, warehouseId, pallet) { } export function downloadDropshipPalletLabel(taskId, warehouseId, palletId) { - const url = `${ROOT}/tasks/${encodeURIComponent(taskId)}/pallets/${encodeURIComponent(palletId)}/print?warehouseId=${encodeURIComponent(stableId(warehouseId))}` + const baseUrl = String(session.apiBase || '/api/platform/v1').replace(/\/$/, '') + const url = `${baseUrl}${ROOT}/tasks/${encodeURIComponent(taskId)}/pallets/${encodeURIComponent(palletId)}/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))) { diff --git a/pages.json b/pages.json index 56997eb..110ef4a 100644 --- a/pages.json +++ b/pages.json @@ -6,7 +6,7 @@ { "path": "pages/operation/operation", "style": { "navigationStyle": "custom", "navigationBarTitleText": "现场作业", "backgroundColor": "#F5F7FA" } }, { "path": "pages/tasks/tasks", "style": { "navigationStyle": "custom", "navigationBarTitleText": "拣货任务", "backgroundColor": "#F5F7FA" } }, { "path": "pages/dropship-tasks/dropship-tasks", "style": { "navigationStyle": "custom", "navigationBarTitleText": "一件代发", "backgroundColor": "#F5F7FA" } }, - { "path": "pages/dropship-palletization/dropship-palletization", "style": { "navigationStyle": "custom", "navigationBarTitleText": "合托作业", "backgroundColor": "#F5F7FA" } }, + { "path": "pages/dropship-palletization/dropship-palletization", "style": { "navigationStyle": "custom", "navigationBarTitleText": "一件代发入库", "backgroundColor": "#F5F7FA" } }, { "path": "pages/history/history", "style": { "navigationStyle": "custom", "navigationBarTitleText": "作业记录", "backgroundColor": "#F5F7FA" } }, { "path": "pages/profile/profile", "style": { "navigationStyle": "custom", "navigationBarTitleText": "个人中心", "backgroundColor": "#F5F7FA" } }, { "path": "pages/scanner-test/scanner-test", "style": { "navigationStyle": "custom", "navigationBarTitleText": "广播扫码测试", "backgroundColor": "#F5F7FA" } }, diff --git a/tests/dropship-palletization.test.mjs b/tests/dropship-palletization.test.mjs index 4b49cc9..cc790a7 100644 --- a/tests/dropship-palletization.test.mjs +++ b/tests/dropship-palletization.test.mjs @@ -23,6 +23,7 @@ test('dropship palletization adapter uses only the dedicated production PDA cont ]) assert.match(api, new RegExp(route.replaceAll('/', '\\/'))) assert.match(api, /apiDownload/) assert.match(api, /application\\\/pdf/) + assert.match(api, /session\.apiBase \|\| '\/api\/platform\/v1'/) assert.match(api, /tasks\/pending\?\$\{params\.join\('&'\)\}/) assert.match(api, /warehouseId=\$\{encodeURIComponent\(warehouseId\)\}/) assert.match(api, /operationId\('count'/)