From 97bc66f28cba4db01145ccc460f29704ee9c18ab Mon Sep 17 00:00:00 2001 From: liuyihe <2513762445@qq.com> Date: Fri, 6 Nov 2026 13:33:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/cross-border/api/orderBudgets.ts | 4 +-- .../cross-border/businessOrders.test.mjs | 25 ++++++++++--- .../components/BusinessOrdersView.vue | 35 ++++++++++--------- .../components/OrderFundingStatus.vue | 2 +- .../cross-border/orderFundingStatus.test.mjs | 13 +++++++ src/modules/cross-border/procurement.test.mjs | 2 +- .../cross-border/transportDemandForm.test.mjs | 2 ++ .../cross-border/transportDemandForm.ts | 3 +- 8 files changed, 60 insertions(+), 26 deletions(-) diff --git a/src/modules/cross-border/api/orderBudgets.ts b/src/modules/cross-border/api/orderBudgets.ts index 16d8eab..37dbaf2 100644 --- a/src/modules/cross-border/api/orderBudgets.ts +++ b/src/modules/cross-border/api/orderBudgets.ts @@ -2,9 +2,9 @@ import { apiRequest } from '@/api/http' export interface BudgetResult { status: string; usable: boolean; amountCny: number | string; message: string; orderNo: string | null } const base = '/merchant/v1/last-leg/order-budgets' // 创建订单时后端在同一事务记录冻结请求,客户端只在详情核对状态和重试明确失败。 -export function readOrderFunding(kind: 'procurement' | 'trucking', orderNo: string) { +export function readOrderFunding(kind: 'procurement' | 'trucking' | 'looseboard', orderNo: string) { return apiRequest({ method: 'GET', url: base + '/' + kind + '/orders/' + encodeURIComponent(orderNo) }) } -export function retryOrderFunding(kind: 'procurement' | 'trucking', orderNo: string) { +export function retryOrderFunding(kind: 'procurement' | 'trucking' | 'looseboard', orderNo: string) { return apiRequest({ method: 'POST', url: base + '/' + kind + '/orders/' + encodeURIComponent(orderNo) + '/retry' }) } diff --git a/src/modules/cross-border/businessOrders.test.mjs b/src/modules/cross-border/businessOrders.test.mjs index c32f40f..5b5fc12 100644 --- a/src/modules/cross-border/businessOrders.test.mjs +++ b/src/modules/cross-border/businessOrders.test.mjs @@ -18,7 +18,7 @@ test('all current truck statuses display Chinese labels in lists and details', ( const { poolOrderStatusLabels } = runInNewContext(`${labelsCode}\n({ poolOrderStatusLabels })`) const helpers = view.slice(view.indexOf('function read('), view.indexOf('function idempotencyKey(')) const compiled = ts.transpileModule(helpers, { compilerOptions: { target: ts.ScriptTarget.ES2022 } }).outputText - const { statusLabel, displayCell } = runInNewContext(`${compiled}\n({ statusLabel, displayCell })`, { poolOrderStatusLabels }) + const { statusLabel, displayCell } = runInNewContext(`${compiled}\n({ statusLabel, displayCell })`, { poolOrderStatusLabels, props: { kind: 'trucking' } }) for (const status of ['PENDING_REVIEW', 'FUNDING_PENDING', 'FUNDING_FAILED', 'WAITING_INBOUND', 'RECEIVING', 'WAITING_CONSOLIDATION', 'PALLET_OVERAGE_REVIEW', 'PARTIALLY_ALLOCATED', 'ALLOCATED', 'PENDING_DISPATCH', 'DISPATCHED', 'IN_TRANSIT', 'COMPLETED', 'REJECTED', 'CANCELLED']) { assert.match(statusLabel(status), /[\u4e00-\u9fff]/, status) assert.equal(displayCell({ status }, 'status'), statusLabel(status)) @@ -29,7 +29,7 @@ test('all current truck statuses display Chinese labels in lists and details', ( }) test('truck search excludes warehouse and dispatch preparation stages', () => { - const truckingOptions = view.split("options: props.kind === 'trucking' ? [")[1].split('] : [')[0] + const truckingOptions = view.split("options: props.kind === 'trucking' ? [")[1].split('] : Object.entries')[0] for (const status of ['WAITING_INBOUND', 'RECEIVING', 'WAITING_CONSOLIDATION', 'PALLET_OVERAGE_REVIEW', 'PARTIALLY_ALLOCATED', 'ALLOCATED', 'PENDING_DISPATCH']) { assert.ok(!truckingOptions.includes(status), status) } @@ -149,7 +149,7 @@ function transportHarness(kind = 'trucking', failFirst = false, budgetCheck = as const script = view.match(/