From 2186f1f3a68536bc486f194f3327d8daf083e24d Mon Sep 17 00:00:00 2001 From: liuyihe <2513762445@qq.com> Date: Mon, 12 Oct 2026 21:19:07 +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 --- .../overseas-warehouse/api/returnInventory.ts | 2 +- .../pages/LastMileOrdersView.vue | 2 +- .../pages/ReturnInventoryManagementView.test.ts | 17 ++++++++++++----- .../pages/ReturnInventoryManagementView.vue | 6 +----- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/modules/overseas-warehouse/api/returnInventory.ts b/src/modules/overseas-warehouse/api/returnInventory.ts index d51eb293..e780a454 100644 --- a/src/modules/overseas-warehouse/api/returnInventory.ts +++ b/src/modules/overseas-warehouse/api/returnInventory.ts @@ -2,7 +2,7 @@ import { http, unwrapApiResponse, type ApiEnvelope } from '@/shared/api/http' import { normalizeOverseasPage, type OverseasPagePayload } from './lastMileOrders' -export interface ReturnStockRow { customerId: string; overseasWarehouseId: string; skuCode: string; productNameZh?: string; totalQuantity: number; availableQuantity: number; looseAvailableQuantity?: number; cartonQuantity: number; updatedAt: string } +export interface ReturnStockRow { customerId: string; overseasWarehouseId: string; skuCode: string; productNameZh?: string; totalQuantity: number; availableQuantity: number; relabelLockedQuantity: number; looseAvailableQuantity?: number; cartonQuantity: number; updatedAt: string } export interface ReturnCartonRow { customerId: string; overseasWarehouseId: string; cartonMark: string; sourceReturnNo?: string; sourceUnitType?: 'PALLET' | 'BOX' | 'PARCEL' | string; sourceBatchNo?: string; status: string; fbaCartonMark?: string; destinationWarehouseCode?: string; destinationWarehouseName?: string; relabelNo?: string; relabelStatus?: string; relabelledQuantity?: number; relabelReservedQuantity?: number; skuTypes: number; totalQuantity: number; length?: number; width?: number; height?: number; weight?: number; createdAt: string } export interface ReturnCartonMergeHistory { planNo?: string; sourceCartonMark: string; targetCartonMark: string; returnNo: string; skuCode: string; quantity: number; createdAt: string } export interface ReturnCartonDetail extends ReturnCartonRow { customerId: string; items: Array<{ skuCode: string; productNameZh?: string; quantity: number; availableQuantity?: number }>; mergeHistory?: ReturnCartonMergeHistory[] } diff --git a/src/modules/overseas-warehouse/pages/LastMileOrdersView.vue b/src/modules/overseas-warehouse/pages/LastMileOrdersView.vue index f33eab86..e11f1441 100644 --- a/src/modules/overseas-warehouse/pages/LastMileOrdersView.vue +++ b/src/modules/overseas-warehouse/pages/LastMileOrdersView.vue @@ -1137,7 +1137,7 @@ onMounted(() => { void load() }) - + diff --git a/src/modules/overseas-warehouse/pages/ReturnInventoryManagementView.test.ts b/src/modules/overseas-warehouse/pages/ReturnInventoryManagementView.test.ts index a0274faa..fe114428 100644 --- a/src/modules/overseas-warehouse/pages/ReturnInventoryManagementView.test.ts +++ b/src/modules/overseas-warehouse/pages/ReturnInventoryManagementView.test.ts @@ -25,7 +25,7 @@ vi.mock('../api/relabelOrders', () => ({ reviewReturnPackingPlan: vi.fn(), cancelReturnPackingPlan: vi.fn(), })) const wrappers: VueWrapper[] = [] -const stock = { customerId: 'customer-1', overseasWarehouseId: 'warehouse-1', skuCode: 'SKU-TEST', totalQuantity: 8, availableQuantity: 6, cartonQuantity: 1, updatedAt: '2026-09-30' } +const stock = { customerId: 'customer-1', overseasWarehouseId: 'warehouse-1', skuCode: 'SKU-TEST', totalQuantity: 8, availableQuantity: 6, relabelLockedQuantity: 2, cartonQuantity: 1, updatedAt: '2026-09-30' } const carton = { customerId: 'customer-1', overseasWarehouseId: 'warehouse-1', cartonMark: 'RETURN-BOX-1', status: 'AVAILABLE', skuTypes: 1, totalQuantity: 8, createdAt: '2026-09-30' } async function mountView(mode: 'inventory' | 'cartons') { const wrapper = mount(ReturnInventoryManagementView, { @@ -56,6 +56,12 @@ afterEach(() => { }) describe('ReturnInventoryManagementView shared list', () => { + it('退货库存展示服务端换标占用列', async () => { + const wrapper = await mountView('inventory') + const columns = wrapper.findComponent(DataTable).props('columns') + expect(columns).toEqual(expect.arrayContaining([expect.objectContaining({ prop: 'relabelLockedQuantity', label: '换标占用(件)' })])) + expect(wrapper.findComponent(DataTable).props('data')[0]).toEqual(expect.objectContaining({ relabelLockedQuantity: 2 })) + }) it('keeps partial quantities bound to each physical parcel and box when they share a SKU', async () => { vi.mocked(listReturnPackingSources).mockResolvedValue({ records: [ { ...carton, cartonMark: 'PARCEL-A', sourceUnitType: 'PARCEL', sourceReturnNo: 'RETURN-1', items: [{ skuCode: 'SKU-A', quantity: 5, availableQuantity: 5 }] }, @@ -272,10 +278,11 @@ describe('ReturnInventoryManagementView shared list', () => { }) }) -it('箱列表分别显示后端实际完成量与未完成申请占用量', async () => { +it('箱列表不展示换标单号和换标进度', async () => { vi.mocked(listReturnCartons).mockResolvedValue({ records: [{ ...carton, relabelStatus: 'PARTIALLY_COMPLETED', relabelledQuantity: 3, relabelReservedQuantity: 2 }], page: 1, size: 20, total: 1, pages: 1 }) const wrapper = await mountView('cartons') - expect(wrapper.text()).toContain('部分完成') - expect(wrapper.text()).toContain('实际完成 3 件') - expect(wrapper.text()).toContain('处理中占用 2 件') + expect(wrapper.text()).not.toContain('换标单号') + expect(wrapper.text()).not.toContain('换标进度') + expect(wrapper.text()).not.toContain('实际完成 3 件') + expect(wrapper.text()).not.toContain('处理中占用 2 件') }) diff --git a/src/modules/overseas-warehouse/pages/ReturnInventoryManagementView.vue b/src/modules/overseas-warehouse/pages/ReturnInventoryManagementView.vue index 9fbfa53d..cf15f872 100644 --- a/src/modules/overseas-warehouse/pages/ReturnInventoryManagementView.vue +++ b/src/modules/overseas-warehouse/pages/ReturnInventoryManagementView.vue @@ -427,6 +427,7 @@ const stockColumns: DataTableColumn[] = [ prop: "availableQuantity", align: "right", }, + { key: "relabelLockedQuantity", label: "换标占用(件)", prop: "relabelLockedQuantity", minWidth: 140, align: "right" }, { key: "updatedAt", label: "更新时间", prop: "updatedAt", minWidth: 180 }, ]; const movementColumns: DataTableColumn[] = [ @@ -489,8 +490,6 @@ const cartonColumns: DataTableColumn[] = [ minWidth: 180, }, { key: "carton-6", label: "目的仓", minWidth: 180, slotName: "carton-6" }, - { key: "relabelNo", label: "换标单号", prop: "relabelNo", minWidth: 200 }, - { key: "carton-8", label: "换标进度", minWidth: 290, slotName: "carton-8" }, { key: "carton-9", label: "状态", width: 100, slotName: "carton-9" }, { key: "skuTypes", label: "SKU种类", prop: "skuTypes", align: "right" }, { @@ -734,9 +733,6 @@ const tableColumns = computed(() => -