From 6780228f86bd28b6813aea156dbb82767ac25f2e Mon Sep 17 00:00:00 2001 From: liuyihe <2513762445@qq.com> Date: Thu, 3 Sep 2026 10:46:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/first-leg/api/inboundBilling.ts | 35 ++++++++++++ .../components/InboundBillingPanel.test.mjs | 6 +- .../components/InboundBillingPanel.vue | 56 +++++++++++++++++-- src/modules/first-leg/types/inboundBilling.ts | 38 +++++++++++++ .../views/FirstLegOrdersView.test.mjs | 4 +- .../first-leg/views/FirstLegOrdersView.vue | 19 +++++-- 6 files changed, 145 insertions(+), 13 deletions(-) diff --git a/src/modules/first-leg/api/inboundBilling.ts b/src/modules/first-leg/api/inboundBilling.ts index fef4283..befba7b 100644 --- a/src/modules/first-leg/api/inboundBilling.ts +++ b/src/modules/first-leg/api/inboundBilling.ts @@ -9,6 +9,9 @@ import type { interface MerchantInboundBillingWireResponse { inbound: MerchantInboundResult + measurementSummary: MerchantInboundBilling['measurementSummary'] + measurementItems: MerchantInboundBilling['measurementItems'] + billingBasis: MerchantInboundBilling['billingBasis'] latestFee: MerchantInboundFeeSnapshot } @@ -101,6 +104,35 @@ function sanitizeFee(fee: MerchantInboundFeeSnapshot): MerchantInboundFeeSnapsho } } +function sanitizeMeasurementSummary(item: MerchantInboundBilling['measurementSummary']): MerchantInboundBilling['measurementSummary'] { + return { + measurementId: item.measurementId == null ? null : String(item.measurementId), + sourceType: item.sourceType, + measurementStatus: item.measurementStatus, + actualPackageCount: item.actualPackageCount, + actualGrossWeightKg: item.actualGrossWeightKg, + actualNetWeightKg: item.actualNetWeightKg, + actualVolumeCbm: item.actualVolumeCbm, + volumeWeightKg: item.volumeWeightKg, + actualGoodsName: item.actualGoodsName, + } +} + +function sanitizeMeasurementItem(item: MerchantInboundBilling['measurementItems'][number]): MerchantInboundBilling['measurementItems'][number] { + return { + id: String(item.id), + itemNo: item.itemNo, + boxSpecification: item.boxSpecification, + packageCount: item.packageCount, + lengthCm: item.lengthCm, + widthCm: item.widthCm, + heightCm: item.heightCm, + unitVolumeCbm: item.unitVolumeCbm, + totalVolumeCbm: item.totalVolumeCbm, + volumeWeightKg: item.volumeWeightKg, + } +} + function sanitizeInboundBilling(response: MerchantInboundBillingWireResponse): MerchantInboundBilling { return { inbound: { @@ -108,6 +140,9 @@ function sanitizeInboundBilling(response: MerchantInboundBillingWireResponse): M publicRemark: response.inbound.publicRemark, palletLocations: response.inbound.palletLocations.map(sanitizePalletLocation), }, + measurementSummary: sanitizeMeasurementSummary(response.measurementSummary), + measurementItems: (response.measurementItems || []).map(sanitizeMeasurementItem), + billingBasis: response.billingBasis, latestFee: sanitizeFee(response.latestFee), } } diff --git a/src/modules/first-leg/components/InboundBillingPanel.test.mjs b/src/modules/first-leg/components/InboundBillingPanel.test.mjs index 083ba22..4669d84 100644 --- a/src/modules/first-leg/components/InboundBillingPanel.test.mjs +++ b/src/modules/first-leg/components/InboundBillingPanel.test.mjs @@ -14,13 +14,15 @@ test('renders loading, pending, isolated error, and published states', () => { assert.match(source, /\$emit\('retry'\)/) }) -test('shows the confirmed merchant inbound and fee fields without write actions', () => { +test('shows the confirmed merchant inbound, measurement details and customer confirmation entry', () => { for (const label of ['入仓码', '平台收货仓', '实际毛重', '实测体积', '托盘与库位', '换算与精度', '最终计费量', '基础费用', '附加费用', '费用合计', '平台备注']) { assert.match(source, new RegExp(label)) } assert.match(source, /formatInboundMoney\(props\.data\.latestFee\.totalAmount/) assert.match(source, /formatConversionPrecision\(/) - assert.doesNotMatch(source, /确认费用|调整费用|发送费用|下载照片/) + assert.match(source, /确认费用/) + assert.match(source, /measurementItems/) + assert.doesNotMatch(source, /调整费用|发送费用|下载照片/) assert.doesNotMatch(source, /internalNotes|statusHistory|files/) assert.match(source, /latestFee\.ruleCode/) assert.match(source, /latestFee\.rateCode/) diff --git a/src/modules/first-leg/components/InboundBillingPanel.vue b/src/modules/first-leg/components/InboundBillingPanel.vue index 29f3fa3..a857566 100644 --- a/src/modules/first-leg/components/InboundBillingPanel.vue +++ b/src/modules/first-leg/components/InboundBillingPanel.vue @@ -1,4 +1,5 @@ + + +
+
测量总箱数
{{ formatInboundNumber(props.data.measurementSummary.actualPackageCount, 0) }}
+
测量总毛重
{{ formatInboundMeasure(props.data.measurementSummary.actualGrossWeightKg, 'kg') }}
+
测量总体积
{{ formatInboundMeasure(props.data.measurementSummary.actualVolumeCbm, 'm³') }}
+
测量总材积重
{{ formatInboundMeasure(props.data.measurementSummary.volumeWeightKg, 'kg') }}
+
计费体积
{{ formatInboundMeasure(props.data.billingBasis.chargeableVolumeCbm, 'm³') }}
+
计费重量
{{ formatInboundMeasure(props.data.billingBasis.chargeableWeightKg, 'kg') }}
+
+ + + + + + + + + + + + +