Merge remote-tracking branch 'origin/release/test' into dev

# Conflicts:
#	src/modules/overseas-warehouse/api/dispatches.ts
#	src/modules/overseas-warehouse/pages/DispatchesView.vue
This commit is contained in:
2026-09-09 16:50:22 +08:00
8 changed files with 66 additions and 40 deletions
@@ -81,7 +81,7 @@ describe('dispatch overseas API', () => {
it('transfers to delivery only by dispatchNo without customerId', async () => {
vi.mocked(overseasHttp.post).mockResolvedValue({ code: '200', message: 'success', data: { dispatchNo: 'PC/1', outboundNo: 'OUT-1', deliveryNo: 'DEL-1' } })
const payload = { idempotencyKey: 'transfer-1', plannedDeliveryAt: '2026-09-01T10:00:00', deliveryMethod: 'TRUCK_PALLET', pickupMethod: 'WAREHOUSE_PICKUP', loadingType: 'PALLET', fees: [{ feeType: 'DELIVERY_FEE', currency: 'USD', amount: 10 }] }
const payload = { idempotencyKey: 'transfer-1', plannedDeliveryAt: '2026-09-01T10:00:00', deliveryMethod: 'TRUCK_PALLET', pickupMethod: 'WAREHOUSE_PICKUP', loadingType: 'PALLET', fees: [{ feeType: 'DELIVERY_FEE', feeName: '派送费用', direction: 'RECEIVABLE' as const, currency: 'USD' as const, amount: 10 }] }
await transferDispatchToDelivery('PC/1', payload)
expect(overseasHttp.post).toHaveBeenCalledWith('/platform/v1/last-leg/dispatches/PC%2F1/transfer-delivery', payload)
})
@@ -214,7 +214,11 @@ export interface TransferDeliveryPayload {
appointmentAccount?: string
sellerName?: string
remark?: string
fees: Array<{ feeType: string; currency: string; amount: number; remark?: string }>
fees: Array<{ feeType: string; feeName: string; direction: 'RECEIVABLE' | 'PAYABLE'; currency: 'CNY' | 'USD'; amount: number
supplierId?: string; supplierName?: string; supplierCategory?: string; settlementMode?: 'ON_ACCOUNT' | 'DIRECT_PAID'
paidAt?: string; paymentMethod?: 'ONLINE' | 'BANK_TRANSFER' | 'CASH' | 'OTHER'; paymentReferenceNo?: string
paymentVoucherFileIds?: string[]; chargeableQuantity?: number; quantityUnit?: string; unitPrice?: number
periodStart?: string; periodEnd?: string; remark?: string }>
palletCartonMarks?: Record<string, string[]>
}
export async function transferDispatchToDelivery(dispatchNo: string, payload: TransferDeliveryPayload) {
@@ -125,17 +125,14 @@ export interface LastMileStatusHistoryDto {
}
export interface LastMileFeeDto {
id: string
customerId: string
orderId: string
feeItem: string
currency: string
amount: number
status: string
supplierDescription?: string | null
createdBy: string
createdAt: string
updatedAt: string
id: string; sourceFeeId: string; sourceVersion: number; customerId: string; orderId?: string | null
feeItemCode: string; feeItemName: string; direction: 'RECEIVABLE' | 'PAYABLE'
currency: 'CNY'; amount: number; originalCurrency: 'CNY' | 'USD'; originalAmount: number
exchangeRate: number; exchangeRateMonth: string; reviewStatus: 'DRAFT' | 'PENDING' | 'APPROVED' | 'REJECTED'
publicationStatus: string; sourceStatus: string; supplierId?: string | null; supplierName?: string | null
settlementMode?: 'ON_ACCOUNT' | 'DIRECT_PAID' | null; businessDate: string
chargeableQuantity?: number | null; quantityUnit?: string | null; unitPrice?: number | null
periodStart?: string | null; periodEnd?: string | null; createdAt: string; updatedAt: string
}
export interface LastMileOperationDto {
@@ -147,11 +144,11 @@ export interface LastMileOperationDto {
}
export interface CreateLastMileFeePayload {
feeItem: string
currency: string
amount: number
status: string
supplierDescription?: string
feeItemCode: string; feeItemName: string; direction: 'RECEIVABLE' | 'PAYABLE'; currency: 'CNY' | 'USD'
amount: number; businessDate: string; supplierId?: string; supplierName?: string; supplierCategory?: string
settlementMode?: 'ON_ACCOUNT' | 'DIRECT_PAID'; paidAt?: string; paymentMethod?: 'ONLINE' | 'BANK_TRANSFER' | 'CASH' | 'OTHER'
paymentReferenceNo?: string; paymentVoucherFileIds?: string[]; chargeableQuantity?: number
quantityUnit?: string; unitPrice?: number; periodStart?: string; periodEnd?: string
}
export interface TransferDestinationPayload {
@@ -378,6 +375,7 @@ export async function downloadLastMileOrders(query: Partial<LastMileOrderQuery>)
export async function createLastMileOrderFee(orderId: string, payload: CreateLastMileFeePayload) {
const response = await overseasHttp.post<ApiEnvelope<LastMileFeeDto>, ApiEnvelope<LastMileFeeDto>>(
`/platform/v1/last-leg/orders/${encodeURIComponent(orderId)}/fees`, payload,
{ headers: { 'Idempotency-Key': `last-mile-fee-${orderId}-${Date.now()}-${Math.random().toString(36).slice(2)}` } },
)
return unwrapApiResponse(response)
}