feat: 完善头程审核与计费信息

This commit is contained in:
2026-09-08 17:38:09 +08:00
parent cb7bb90eb6
commit dd9b8f7a63
16 changed files with 273 additions and 31 deletions
@@ -3,6 +3,7 @@ import { http } from '@/shared/api/http'
import {
approvePlatformUnifiedOrder,
batchApprovePlatformUnifiedOrders,
getPlatformUnifiedOrderBatchApprovalPreview,
addPlatformUnifiedOrderNote,
getPlatformUnifiedOrder,
downloadPlatformProductImage,
@@ -134,11 +135,39 @@ describe('unified orders API contract', () => {
} })
await expect(batchApprovePlatformUnifiedOrders('2089176869176389634', [
'2089223263733518337', '2089223263733518338',
{ orderId: '2089223263733518337', orderVersion: 3 },
{ orderId: '2089223263733518338', orderVersion: 8 },
])).resolves.toMatchObject({ successCount: 1, failureCount: 1 })
expect(http.post).toHaveBeenCalledWith(
'/platform/v1/orders/first-leg/batch-approve',
{ orderIds: ['2089223263733518337', '2089223263733518338'] },
{ items: [
{ orderId: '2089223263733518337', orderVersion: 3 },
{ orderId: '2089223263733518338', orderVersion: 8 },
] },
{ params: { tenantId: '2089176869176389634' } },
)
})
it('loads one batch-review preview with Chinese goods and normalizes long IDs', async () => {
vi.mocked(http.post).mockResolvedValue({ data: {
total: 1,
approvableCount: 1,
items: [{
orderId: '2089223263733518337', orderVersion: '3', inboundCode: 'NYEXX2609080001',
customerId: '2089176869176389634', customerName: '测试客户', chineseGoodsNames: [' 蓝牙音箱 ', ''],
channelCode: 'NY_EXX', channelName: '纽约海运', destinationWarehouseCode: 'ONT8',
destinationWarehouseName: 'ONT8 亚马逊仓', canApprove: true, blockReason: null,
}],
} })
const items = [{ orderId: '2089223263733518337', orderVersion: 3 }]
await expect(getPlatformUnifiedOrderBatchApprovalPreview('2089176869176389634', items)).resolves.toMatchObject({
total: 1, approvableCount: 1,
items: [{ orderId: '2089223263733518337', orderVersion: 3, chineseGoodsNames: ['蓝牙音箱'] }],
})
expect(http.post).toHaveBeenCalledWith(
'/platform/v1/orders/first-leg/batch-review-preview',
{ items },
{ params: { tenantId: '2089176869176389634' } },
)
})