-
下载 APK
-
发布
-
停发
+
+ 下载 APK
+ 发布
+ 停发
{{ row.app === 'domestic' ? '国内' : '海外' }}
@@ -160,7 +154,8 @@ function download(row: PdaRelease) {
{{ (row.sizeBytes / 1024 / 1024).toFixed(1) }} MB
{{ row.createdAt?.replace('T', ' ').slice(0, 19) || '—' }}
{{ row.publishedAt?.replace('T', ' ').slice(0, 19) || '—' }}
-
+
+
@@ -170,11 +165,11 @@ function download(row: PdaRelease) {
-
-
+
+
-
+
@@ -182,11 +177,16 @@ function download(row: PdaRelease) {
diff --git a/src/modules/unified-orders/pages/UnifiedOrdersView.test.ts b/src/modules/unified-orders/pages/UnifiedOrdersView.test.ts
index 3c8db07c..09f8a540 100644
--- a/src/modules/unified-orders/pages/UnifiedOrdersView.test.ts
+++ b/src/modules/unified-orders/pages/UnifiedOrdersView.test.ts
@@ -34,6 +34,11 @@ describe('UnifiedOrdersView contract', () => {
expect(sendFeeSource).toContain('adjustPublishedInboundFee')
expect(source).toContain('价格表参考单价')
expect(source).toContain('本次对客单价')
+ expect(openDialogSource).toContain("feeConfirmPriceMissing.value = true")
+ expect(sendFeeSource).toContain('createManualInboundQuote')
+ expect(source).toContain("feeConfirmPriceMissing ? '未命中'")
+ expect(source).toContain("feeConfirmPriceMissing ? '人工定价原因'")
+ expect(source).not.toContain('
固定附加费')
expect(sendFeeSource).toContain("ElMessage.error(getApiErrorDetails(error, '确认费用发送失败').message)")
})
diff --git a/src/modules/unified-orders/pages/UnifiedOrdersView.vue b/src/modules/unified-orders/pages/UnifiedOrdersView.vue
index e6fffb40..69f9514f 100644
--- a/src/modules/unified-orders/pages/UnifiedOrdersView.vue
+++ b/src/modules/unified-orders/pages/UnifiedOrdersView.vue
@@ -66,6 +66,7 @@ import {
adjustPublishedInboundFee,
downloadWeightImage,
calculateInboundFee,
+ createManualInboundQuote,
confirmInboundFee,
createFeeAdjustmentIdempotencyKey,
createFeeActionIdempotencyKey,
@@ -258,24 +259,27 @@ const feeConfirmWeight = ref
(null)
const feeConfirmVolume = ref(null)
const feeConfirmReferenceLoading = ref(false)
const feeConfirmReference = ref(null)
+const feeConfirmPriceMissing = ref(false)
const feeConfirmUnitPrice = ref(null)
const feeConfirmPriceReason = ref('')
type FeeConfirmAttempt = {
fingerprint: string
calculateKey: string
+ manualKey: string
adjustKey: string
confirmKey: string
sendKey: string
}
let feeConfirmAttempt: FeeConfirmAttempt | null = null
const feeConfirmPriceChanged = computed(() => {
+ if (feeConfirmPriceMissing.value) return true
const reference = Number(feeConfirmReference.value?.unitPrice)
const current = Number(feeConfirmUnitPrice.value)
return reference >= 0 && current >= 0 && Math.abs(reference - current) > 0.000001
})
const feeConfirmPriceUnit = computed(() => {
const snapshot = feeConfirmReference.value
- return snapshot ? `${snapshot.currency} / ${snapshot.chargeUnit}` : '—'
+ return snapshot ? `${snapshot.currency} / ${snapshot.chargeUnit}` : 'CNY / 计费单位'
})
const feeConfirmEstimatedTotal = computed(() => {
const snapshot = feeConfirmReference.value
@@ -1669,6 +1673,7 @@ async function openFeeConfirmDialog() {
: measuredGrossWeight > 0 ? measuredGrossWeight : measuredNetWeight > 0 ? measuredNetWeight : null
feeConfirmVolume.value = Number(actualTotals.volume) > 0 ? Number(actualTotals.volume) : null
feeConfirmReference.value = null
+ feeConfirmPriceMissing.value = false
feeConfirmUnitPrice.value = null
feeConfirmPriceReason.value = ''
feeConfirmAttempt = null
@@ -1693,8 +1698,14 @@ async function openFeeConfirmDialog() {
feeConfirmReference.value = snapshot
feeConfirmUnitPrice.value = Number(snapshot.unitPrice)
} catch (error) {
- ElMessage.error(getApiErrorDetails(error, '价格表参考单价加载失败,暂不能推送费用').message)
- feeConfirmOpen.value = false
+ const details = getApiErrorDetails(error, '价格表参考单价加载失败')
+ if (details.code === 'A0404') {
+ feeConfirmPriceMissing.value = true
+ ElMessage.warning('当前FBA价格未命中,请填写本次对客单价和人工定价原因')
+ } else {
+ ElMessage.error(details.message)
+ feeConfirmOpen.value = false
+ }
} finally {
feeConfirmReferenceLoading.value = false
}
@@ -1715,6 +1726,7 @@ function currentFeeConfirmAttempt(
feeConfirmAttempt = {
fingerprint,
calculateKey: createFeeActionIdempotencyKey('calculate'),
+ manualKey: createFeeActionIdempotencyKey('manual'),
adjustKey: createFeeAdjustmentIdempotencyKey(),
confirmKey: createFeeActionIdempotencyKey('confirm'),
sendKey: createFeeActionIdempotencyKey('send'),
@@ -1747,14 +1759,25 @@ async function executeConfirmAndSendFee() {
try {
const tenantId = String(summary.tenantId)
const inboundId = String(summary.inboundId)
- let snapshot = await calculateInboundFee(tenantId, inboundId, {
- selectedWeightKg,
- selectedVolumeCbm,
- weightSource: 'ACTUAL',
- volumeSource: 'ACTUAL',
- }, attempt.calculateKey)
+ let snapshot: InboundFeeSnapshot
+ try {
+ snapshot = await calculateInboundFee(tenantId, inboundId, {
+ selectedWeightKg, selectedVolumeCbm, weightSource: 'ACTUAL', volumeSource: 'ACTUAL',
+ }, attempt.calculateKey)
+ } catch (error) {
+ if (getApiErrorDetails(error, '费用试算失败').code !== 'A0404') throw error
+ feeConfirmPriceMissing.value = true
+ if (feeConfirmPriceReason.value.trim().length < 2) {
+ ElMessage.warning('价格未命中,请填写至少 2 个字符的人工定价原因')
+ return
+ }
+ snapshot = await createManualInboundQuote(tenantId, inboundId, {
+ selectedWeightKg, selectedVolumeCbm, unitPrice: selectedUnitPrice,
+ reason: feeConfirmPriceReason.value.trim(),
+ }, attempt.manualKey)
+ }
const calculatedUnitPrice = Number(snapshot.unitPrice)
- if (Math.abs(selectedUnitPrice - calculatedUnitPrice) > 0.000001) {
+ if (snapshot.rateCode !== 'MANUAL_QUOTE' && Math.abs(selectedUnitPrice - calculatedUnitPrice) > 0.000001) {
snapshot = await adjustPublishedInboundFee(tenantId, inboundId, {
expectedFeeVersion: snapshot.feeVersion,
chargeableQuantity: Number(snapshot.chargeableQuantity),
@@ -2311,13 +2334,12 @@ onBeforeUnmount(() => {
kg
m³
- {{ feeConfirmPriceUnit }}
+ {{ feeConfirmPriceUnit }}
{{ feeConfirmPriceUnit }}
-
+
- 参考计费量
- {{ formatNumber(Number(feeConfirmReference.chargeableQuantity), feeConfirmReference.roundingScale) }} {{ feeConfirmReference.chargeUnit }}
- - 固定附加费
- {{ feeConfirmMoney(Number(feeConfirmReference.additionalAmount || 0), feeConfirmReference.currency) }}
- 按当前单价预计合计
- {{ feeConfirmEstimatedTotal == null ? '—' : feeConfirmMoney(feeConfirmEstimatedTotal, feeConfirmReference.currency) }}
参考数据