From fbaa48337d25bb4429222953a6cc9d390f2bf433 Mon Sep 17 00:00:00 2001 From: liuyihe <2513762445@qq.com> Date: Fri, 16 Oct 2026 17:43:42 +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 --- .../api/warehouseServices.ts | 2 +- .../utils/transferCartonPrinting.test.mjs | 47 +++++++++++++++++++ .../utils/transferCartonPrinting.ts | 27 +++++++++++ .../views/WarehouseServiceView.vue | 37 +++++++-------- .../views/warehouseTransferForm.test.mjs | 6 +-- 5 files changed, 96 insertions(+), 23 deletions(-) create mode 100644 src/modules/overseas-warehouse/utils/transferCartonPrinting.test.mjs create mode 100644 src/modules/overseas-warehouse/utils/transferCartonPrinting.ts diff --git a/src/modules/overseas-warehouse/api/warehouseServices.ts b/src/modules/overseas-warehouse/api/warehouseServices.ts index da9dac1..1f2d938 100644 --- a/src/modules/overseas-warehouse/api/warehouseServices.ts +++ b/src/modules/overseas-warehouse/api/warehouseServices.ts @@ -48,7 +48,7 @@ export interface TransferCreate { deliveryAddress?: string; packageCount: number; volumeCbm: number; deliveryMethod?: string; estimatedArrivalAt?: string; estimatedShipAt?: string fbaShipmentNo?: string; trackingNo?: string; fbaBoxNos?: string; remark?: string; needRelabel: boolean; idempotencyKey: string labelDeadline?: string; pickupContactName?: string; pickupContactPhone?: string; relabelContactName?: string; relabelContactPhone?: string; relabelChargeAmount?: number; relabelDeliveryMethod?: RelabelDeliveryMethod - items: Array<{ skuCode?: string; productNameZh?: string; quantity: number; packageCount: number; shippingMark?: string }> + items: Array<{ skuCode?: string; productNameZh?: string; quantity: number; packageCount: number; shippingMark?: string; cartonMarks?: string[] }> relabelItems?: Array<{ operationType: 'CARTON_LABEL' | 'SKU_LABEL' | 'CARTON_AND_SKU'; customerCartonMarks: string[]; originalSku?: string; newSku?: string; quantity: number; fbaCartonMark?: string; destinationWarehouseCode?: string; remark?: string }> } export interface RelabelCreate { diff --git a/src/modules/overseas-warehouse/utils/transferCartonPrinting.test.mjs b/src/modules/overseas-warehouse/utils/transferCartonPrinting.test.mjs new file mode 100644 index 0000000..9508019 --- /dev/null +++ b/src/modules/overseas-warehouse/utils/transferCartonPrinting.test.mjs @@ -0,0 +1,47 @@ +import test from 'node:test' +import assert from 'node:assert/strict' +import { readFileSync } from 'node:fs' +import ts from 'typescript' +const source = readFileSync(new URL('./transferCartonPrinting.ts', import.meta.url), 'utf8') +const js = ts.transpileModule(source, { compilerOptions: { module: ts.ModuleKind.CommonJS } }).outputText +const exports = {} +new Function('exports', js)(exports) +const prepare = exports.prepareTransferCartonLabels + +test('prints forecast counts independently of quantities or order fields and escapes cargo', () => { + const rows = [{ sku: 'A