优化
This commit is contained in:
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"base": "3133aac01953a2b7034517171cb098148407cd6e",
|
||||||
|
"commit": "a7388914cdd1ae654efa08867edb51fc4e0b6e5c",
|
||||||
|
"files": [
|
||||||
|
"src/pages/dispatch/dispatch.vue",
|
||||||
|
"src/utils/dispatch-error.js",
|
||||||
|
"tests/fulfillment-workflows.test.mjs"
|
||||||
|
],
|
||||||
|
"supersedes": "cf984ab4812d64b33e1ad2c98bc2804a272c6c77",
|
||||||
|
"deployed": false,
|
||||||
|
"checks": {
|
||||||
|
"tests": 215,
|
||||||
|
"h5Build": "PASS",
|
||||||
|
"browser": "local corrected H5 with gray API"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,7 +7,9 @@ export function toDispatchError(error, fallback = '排车作业失败') {
|
|||||||
const originalMessage = String(error?.message || '').trim()
|
const originalMessage = String(error?.message || '').trim()
|
||||||
let message = originalMessage || fallback
|
let message = originalMessage || fallback
|
||||||
|
|
||||||
if (FORBIDDEN_CODES.has(code)) {
|
if (error?.network) {
|
||||||
|
message = '网络连接失败,请检查网络后重试,当前作业已保留'
|
||||||
|
} else if (FORBIDDEN_CODES.has(code)) {
|
||||||
message = '当前账号没有海外仓 PDA 作业权限,请联系管理员授权'
|
message = '当前账号没有海外仓 PDA 作业权限,请联系管理员授权'
|
||||||
} else if (CONFLICT_CODES.has(code) && originalMessage === VEHICLE_PLATE_REQUIRED) {
|
} else if (CONFLICT_CODES.has(code) && originalMessage === VEHICLE_PLATE_REQUIRED) {
|
||||||
message = '请先在平台维护车牌信息后再拣货'
|
message = '请先在平台维护车牌信息后再拣货'
|
||||||
|
|||||||
@@ -11,6 +11,16 @@ import {
|
|||||||
import { session } from '../src/stores/session.js'
|
import { session } from '../src/stores/session.js'
|
||||||
import { toDispatchError } from '../src/utils/dispatch-error.js'
|
import { toDispatchError } from '../src/utils/dispatch-error.js'
|
||||||
|
|
||||||
|
test('dispatch network failures show recovery guidance and retain diagnostics', () => {
|
||||||
|
const error = toDispatchError({ message: 'request:fail', network: true, code: 'NETWORK_ERROR', requestId: 'network-request', traceId: 'network-trace' })
|
||||||
|
assert.equal(error.message, '网络连接失败,请检查网络后重试,当前作业已保留')
|
||||||
|
assert.equal(error.network, true)
|
||||||
|
assert.equal(error.code, 'NETWORK_ERROR')
|
||||||
|
assert.equal(error.requestId, 'network-request')
|
||||||
|
assert.equal(error.traceId, 'network-trace')
|
||||||
|
assert.equal(toDispatchError({ message: '业务校验失败' }).message, '业务校验失败')
|
||||||
|
})
|
||||||
|
|
||||||
const read = (path) => readFile(new URL(path, import.meta.url), 'utf8')
|
const read = (path) => readFile(new URL(path, import.meta.url), 'utf8')
|
||||||
|
|
||||||
test('dispatch merge retains return carton picking and review gates together', async () => {
|
test('dispatch merge retains return carton picking and review gates together', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user