diff --git a/src/modules/overseas-warehouse/api/dispatches.ts b/src/modules/overseas-warehouse/api/dispatches.ts index d7504c39..17236df9 100644 --- a/src/modules/overseas-warehouse/api/dispatches.ts +++ b/src/modules/overseas-warehouse/api/dispatches.ts @@ -37,6 +37,7 @@ export interface DispatchPalletCandidateDto { destinationWarehouseName?: string | null fbaWarehouseCode?: string | null packageCount?: number | null + grossWeightKg?: number | null volumeCbm?: number | null sourceStage?: 'PLAN' | 'RECEIVED' | 'RELABEL' | null cartonMarks?: string | null @@ -133,6 +134,8 @@ export interface DispatchItemDto { destinationWarehouseName?: string | null fbaWarehouseCode?: string | null packageCount?: number | null + grossWeightKg?: number | null + volumeWeightKg?: number | null volumeCbm?: number | null sourceStage?: string | null } diff --git a/src/modules/overseas-warehouse/api/inboundOrders.ts b/src/modules/overseas-warehouse/api/inboundOrders.ts index 677b4597..8ece659b 100644 --- a/src/modules/overseas-warehouse/api/inboundOrders.ts +++ b/src/modules/overseas-warehouse/api/inboundOrders.ts @@ -36,6 +36,8 @@ export interface InboundOrderSummaryDto { customerName?: string | null packageCount?: number | null pickedPackageCount?: number | null + grossWeightKg?: number | null + netWeightKg?: number | null volumeCbm?: number | null palletCount?: number | null assigned?: boolean | null diff --git a/src/modules/overseas-warehouse/api/inboundPlans.test.ts b/src/modules/overseas-warehouse/api/inboundPlans.test.ts index 37a0bf09..36256b1a 100644 --- a/src/modules/overseas-warehouse/api/inboundPlans.test.ts +++ b/src/modules/overseas-warehouse/api/inboundPlans.test.ts @@ -11,7 +11,7 @@ describe('inbound plan overseas API', () => { expect(overseasHttp.get).toHaveBeenCalledWith('/platform/v1/last-leg/inbound-plans', { params: { customerId: '190000000000000001', page: 1, size: 20, inboundCode: 'IN-1' } }) }) it('gets detail by encoded plan number', async () => { - vi.mocked(overseasHttp.get).mockResolvedValue({ code: '200', message: 'ok', data: { id: '1', planNo: 'IP/1', customerId: '2', sourceOrderId: '190000000000000099', lineCount: 0, palletCount: 0, totalVolumeCbm: 0, lines: [], pallets: [], allocations: [] } }) + vi.mocked(overseasHttp.get).mockResolvedValue({ code: '200', message: 'ok', data: { id: '1', planNo: 'IP/1', customerId: '2', sourceOrderId: '190000000000000099', lineCount: 0, palletCount: 0, totalGrossWeightKg: 0, totalNetWeightKg: 0, totalVolumeCbm: 0, lines: [], pallets: [], allocations: [] } }) await getInboundPlan('IP/1', '2') expect(overseasHttp.get).toHaveBeenCalledWith('/platform/v1/last-leg/inbound-plans/IP%2F1', { params: { customerId: '2' } }) }) diff --git a/src/modules/overseas-warehouse/api/inboundPlans.ts b/src/modules/overseas-warehouse/api/inboundPlans.ts index 4871b48f..4593bfce 100644 --- a/src/modules/overseas-warehouse/api/inboundPlans.ts +++ b/src/modules/overseas-warehouse/api/inboundPlans.ts @@ -34,6 +34,8 @@ export interface InboundPlanSummaryDto { destinationWarehouseName?: string | null fbaWarehouseCode?: string | null packageCount?: number | null + grossWeightKg?: number | null + netWeightKg?: number | null totalVolumeCbm?: number | null palletCount?: number | null status?: string | null @@ -56,13 +58,15 @@ export interface InboundPlanDetailDto { status?: string | null lineCount: number palletCount: number + totalGrossWeightKg: number + totalNetWeightKg: number totalVolumeCbm: number expectedPackageCount?: number pickedPackageCount?: number createdAt?: string | null updatedAt?: string | null remark?: string | null - lines: Array<{ id: string; orderId: string; inboundCode?: string | null; fbaWarehouseCode?: string | null; destinationWarehouseId?: string | null; destinationWarehouseCode?: string | null; destinationWarehouseName?: string | null; volumeCbm?: number | null; requiredPackageCount: number; plannedPalletCount: number }> + lines: Array<{ id: string; orderId: string; inboundCode?: string | null; fbaWarehouseCode?: string | null; destinationWarehouseId?: string | null; destinationWarehouseCode?: string | null; destinationWarehouseName?: string | null; grossWeightKg?: number | null; netWeightKg?: number | null; volumeCbm?: number | null; requiredPackageCount: number; plannedPalletCount: number }> pallets: Array<{ id: string; palletNo?: string | null; destinationWarehouseId?: string | null; destinationWarehouseCode?: string | null; destinationWarehouseName?: string | null; capacityCbm?: number | null; allocatedVolumeCbm?: number | null; sequenceNo: number; warehousePalletId?: string | null; warehouseLocationId?: string | null; warehouseResourceLockId?: string | null; assignmentStatus?: string | null; lockedAt?: string | null; actualVolumeCbm?: number | null; actualPackageCount: number }> allocations: Array<{ lineId: string; palletId: string; palletNo: string; palletOwnerPlanNo: string; palletOwnedByCurrentPlan: boolean; allocatedVolumeCbm?: number | null; plannedPackageCount: number; countedPackageCount: number; pickedPackageCount: number; actualVolumeCbm?: number | null; status?: string | null; version: number }> } diff --git a/src/modules/overseas-warehouse/api/lastMileOrders.ts b/src/modules/overseas-warehouse/api/lastMileOrders.ts index d854c4db..3b75310e 100644 --- a/src/modules/overseas-warehouse/api/lastMileOrders.ts +++ b/src/modules/overseas-warehouse/api/lastMileOrders.ts @@ -73,6 +73,8 @@ export interface LastMileOrderSummaryDto { packageCount?: number | null receivedPackageCount?: number | null packageDifference?: number | null + grossWeightKg?: number | null + netWeightKg?: number | null volumeCbm?: number | null productQuantity?: number | null volumeWeightKg?: number | null @@ -113,6 +115,7 @@ export interface LastMileCargoDto { productQuantity?: number | null palletCount?: number | null grossWeightKg?: number | null + netWeightKg?: number | null dimensionalWeightKg?: number | null volumeCbm?: number | null destinationWarehouseName?: string | null diff --git a/src/modules/overseas-warehouse/api/outbounds.ts b/src/modules/overseas-warehouse/api/outbounds.ts index 8855b7a2..b193b8d1 100644 --- a/src/modules/overseas-warehouse/api/outbounds.ts +++ b/src/modules/overseas-warehouse/api/outbounds.ts @@ -3,7 +3,7 @@ import { unwrapApiResponse, type ApiEnvelope } from '@/shared/api/http' import { normalizeOverseasPage, type OverseasPagePayload } from './lastMileOrders' import type { DeliveryOrderRow } from './deliveryOrders' -export interface OutboundRow { id: string; outboundNo: string; dispatchNo?: string | null; overseasWarehouseId?: string | null; lxCodes?: string | null; status?: string | null; palletCount?: number | null; packageCount?: number | null; createdAt?: string | null; outboundType?: string | null } +export interface OutboundRow { id: string; outboundNo: string; dispatchNo?: string | null; overseasWarehouseId?: string | null; lxCodes?: string | null; status?: string | null; palletCount?: number | null; packageCount?: number | null; grossWeightKg?: number | null; volumeWeightKg?: number | null; volumeCbm?: number | null; createdAt?: string | null; outboundType?: string | null } export interface OutboundPalletRow { id?: string | null palletNo?: string | null @@ -13,6 +13,9 @@ export interface OutboundPalletRow { destinationWarehouseName?: string | null skuCode?: string | null packageCount?: number | null + grossWeightKg?: number | null + volumeWeightKg?: number | null + volumeCbm?: number | null pickedPackageCount?: number | null status?: string | null } diff --git a/src/modules/overseas-warehouse/pages/DispatchDetailView.test.ts b/src/modules/overseas-warehouse/pages/DispatchDetailView.test.ts index cf1e8372..8db073a3 100644 --- a/src/modules/overseas-warehouse/pages/DispatchDetailView.test.ts +++ b/src/modules/overseas-warehouse/pages/DispatchDetailView.test.ts @@ -14,7 +14,7 @@ describe('DispatchDetailView', () => { routerPush.mockReset() vi.mocked(getDispatch).mockReset().mockResolvedValue({ id: '1', dispatchNo: 'PC/1', vehiclePlate: 'CA-100', driverName: '张师傅', status: 'PENDING_DEPARTURE', - route: 'LAX → ONT8', items: [{ id: '11', planPalletId: '20', orderNo: 'LM-1', warehousePalletId: '21', fbaWarehouseCode: 'ONT8', volumeCbm: 1.25 }], + route: 'LAX → ONT8', items: [{ id: '11', planPalletId: '20', orderNo: 'LM-1', warehousePalletId: '21', fbaWarehouseCode: 'ONT8', grossWeightKg: 88.5, volumeCbm: 1.25 }], }) }) @@ -26,7 +26,7 @@ describe('DispatchDetailView', () => { expect(wrapper.text()).toContain('CA-100') expect(wrapper.text()).toContain('待发车') const table = wrapper.findComponent(DataTableStub) - expect(table.props('data')).toEqual([{ orderNo: 'LM-1', weight: '—', palletCount: 1, fbaWarehouse: 'ONT8', volume: 1.25, containerNo: '—' }]) + expect(table.props('data')).toEqual([{ orderNo: 'LM-1', weight: 88.5, palletCount: 1, fbaWarehouse: 'ONT8', volume: 1.25, containerNo: '—' }]) wrapper.unmount() }) }) diff --git a/src/modules/overseas-warehouse/pages/DispatchDetailView.vue b/src/modules/overseas-warehouse/pages/DispatchDetailView.vue index 4d0c0db7..a6515cf1 100644 --- a/src/modules/overseas-warehouse/pages/DispatchDetailView.vue +++ b/src/modules/overseas-warehouse/pages/DispatchDetailView.vue @@ -13,7 +13,7 @@ import { formatOverseasDateTime } from '../lastMilePresentation' interface DetailField { label: string; value: string | number } interface RelatedOrderRow { orderNo: string - weight: string + weight: number palletCount: number fbaWarehouse: string volume: number @@ -84,20 +84,21 @@ const documentFields = computed(() => [ ]) const relatedOrders = computed(() => { - const grouped = new Map; destinations: Set; volume: number }>() + const grouped = new Map; destinations: Set; weight: number; volume: number }>() for (const item of detail.value?.items || []) { for (const orderNo of orderReferences(item)) { - const current = grouped.get(orderNo) || { pallets: new Set(), destinations: new Set(), volume: 0 } + const current = grouped.get(orderNo) || { pallets: new Set(), destinations: new Set(), weight: 0, volume: 0 } current.pallets.add(String(item.warehousePalletId || item.planPalletId || item.id)) const destination = text(item.fbaWarehouseCode || item.destinationWarehouseCode || item.destinationWarehouseName) if (destination !== '—') current.destinations.add(destination) + current.weight += Number(item.grossWeightKg || 0) current.volume += Number(item.volumeCbm || 0) grouped.set(orderNo, current) } } return [...grouped.entries()].map(([orderNo, value]) => ({ orderNo, - weight: '—', + weight: Number(value.weight.toFixed(3)), palletCount: value.pallets.size, fbaWarehouse: [...value.destinations].join('、') || '—', volume: Number(value.volume.toFixed(3)), @@ -107,7 +108,7 @@ const relatedOrders = computed(() => { const orderColumns: DataTableColumn[] = [ { key: 'orderNo', prop: 'orderNo', label: '订单号', minWidth: 210 }, - { key: 'weight', prop: 'weight', label: '重量(lb)', minWidth: 130, align: 'right' }, + { key: 'weight', prop: 'weight', label: '重量(kg)', minWidth: 130, align: 'right' }, { key: 'palletCount', prop: 'palletCount', label: '托数', minWidth: 100, align: 'right' }, { key: 'fbaWarehouse', prop: 'fbaWarehouse', label: '目的FBA仓', minWidth: 150 }, { key: 'volume', prop: 'volume', label: '体积(m³)', minWidth: 130, align: 'right' }, diff --git a/src/modules/overseas-warehouse/pages/DispatchesView.test.ts b/src/modules/overseas-warehouse/pages/DispatchesView.test.ts index a8d64658..6235a5b5 100644 --- a/src/modules/overseas-warehouse/pages/DispatchesView.test.ts +++ b/src/modules/overseas-warehouse/pages/DispatchesView.test.ts @@ -60,8 +60,9 @@ describe('DispatchesView', () => { [['edit'], ['查看', '打印BOL', '编辑'], false], [['cancel'], ['查看', '打印BOL', '取消'], false], [['transfer-delivery'], ['查看', '打印BOL', '转派送'], false], + [['edit', 'transfer-delivery'], ['查看', '打印BOL', '转派送', ''], true], [['edit', 'cancel'], ['查看', '打印BOL', '编辑', ''], true], - [['edit', 'cancel', 'transfer-delivery'], ['查看', '打印BOL', '编辑', ''], true], + [['edit', 'cancel', 'transfer-delivery'], ['查看', '打印BOL', '转派送', ''], true], ])('uses the row action threshold for permissions %j', async (allowed, labels, overflow) => { canPermission.mockImplementation(code => allowed.some(action => code === 'platform:overseas-warehouse:dispatch:' + action)) const wrapper = mount(DispatchesView, { global: { plugins: [ElementPlus] } }) @@ -129,6 +130,8 @@ describe('DispatchesView', () => { expect(source).toContain('permission.dispatchEdit') expect(source).toContain('permission.dispatchCancel') expect(source).toContain('permission.dispatchTransferDelivery') + expect(source).toContain("import RowActions, { type RowActionItem } from '@/shared/components/RowActions.vue'") + expect(source).toContain("{ key: 'transfer', label: '转派送', priority: 250") expect(source).toMatch(/function isPendingDeparture\(row: DispatchListItem\)\s*{\s*return row\.statusCode === 'PENDING_DEPARTURE'/) expect(source).toMatch(/access\.can\(permission\.dispatchEdit\)\s*&&\s*isPendingDeparture\(row\)/) expect(source).toMatch(/access\.can\(permission\.dispatchTransferDelivery\)\s*&&\s*\['PENDING_DEPARTURE', 'PICKING', 'READY_TO_DEPART'\]\.includes\(row\.statusCode\)/) diff --git a/src/modules/overseas-warehouse/pages/DispatchesView.vue b/src/modules/overseas-warehouse/pages/DispatchesView.vue index 656a8939..f0623738 100644 --- a/src/modules/overseas-warehouse/pages/DispatchesView.vue +++ b/src/modules/overseas-warehouse/pages/DispatchesView.vue @@ -1,7 +1,6 @@ + +