优化
This commit is contained in:
+3
-1
@@ -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))) {
|
||||
|
||||
+1
-1
@@ -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" } },
|
||||
|
||||
@@ -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'/)
|
||||
|
||||
Reference in New Issue
Block a user