From 443032620bb1171b1096cbb286d068f6a22ffb15 Mon Sep 17 00:00:00 2001 From: zzh <1368735060@qq.com> Date: Mon, 23 Nov 2026 16:47:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9C=8D=E5=8A=A1=E6=B8=A0=E9=81=93?= =?UTF-8?q?=E8=AE=A1=E9=87=8D/=E9=BB=91=E5=90=8D=E5=8D=95=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E4=B8=8E=E5=BA=94=E4=BB=98=E8=AE=A1=E8=B4=B9=E9=87=8D?= =?UTF-8?q?=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 渠道表单支持计重规则/进位与黑名单;订单/揽收/排货/试算区分应收与应付计费重。 Co-authored-by: Cursor --- docs/oms系统设计-050801.md | 4 +- src/locale/en-US.ts | 20 +- src/locale/zh-CN.ts | 17 +- .../components/BillingSimulateDrawer.vue | 6 + src/views/channel/serviceChannels/index.vue | 222 +++++++++++++++++- .../myOrders/components/OrderDetailDrawer.vue | 3 +- .../pickupOrder/PickupOrderDetailDrawer.vue | 4 + .../components/AllocationTraceModal.vue | 2 +- .../components/OrderDetailDrawer.vue | 8 +- 9 files changed, 271 insertions(+), 15 deletions(-) diff --git a/docs/oms系统设计-050801.md b/docs/oms系统设计-050801.md index 762071d..43ee235 100644 --- a/docs/oms系统设计-050801.md +++ b/docs/oms系统设计-050801.md @@ -836,7 +836,7 @@ JWT → mapId(user.userid INT) - **`overallBest`**:`Weight` 最大。 选中后回写 **`t_order.ChannelCode`**,并自选中 **`Providers`** 项固化下游对接字段:**`DownstreamSupplierCode`**、**`DownstreamAppKey`**、**`DownstreamAppId`**、**`ChannelForecastCode`**(实现:`ConfirmServiceChannelAndPayableAsync` → **`AllocationProviderSnapshotEnricher.ApplyDownstreamFieldsToOrder`**)。 2. **筛选**:`status=1` 的全部买价项(优先读渠道买价发布快照,无则 Live 组装)。 -3. **重量**:预报阶段取 **`downstream`** 行计费重;入库阶段取 **`receive`** 行计费重(收货复量后重新排货)。 +3. **重量**:按阶段取件重尺行的 **L/W/H/实重**,用**服务渠道** `WeightRuleId`/`WeightRoundingId`(规则快照固化)现算 **应付计费重**,写入 `t_order_weight.PayableChargeableWeight`(**不改**应收 `ChargeableWeight`)。排货时各候选渠道可各算各的应付重再比价。对账导入写 `downstream` 尺寸后同样按渠道计重重算应付。 4. **输出**:upsert `t_order_fee`,幂等键 `OrderId + CostItem + ChargingStage`;`PriceNo` 写渠道买价版本。 5. **调用方**:`/order/parcel/create`(预报)、`ApplyReceiveBillingByWaybillAsync`(入库)、`/order/fee/recalculate-payable`。 6. **下游运行时读取**:轨迹 **UpsertSmallBag** 的 **`ApiCode`** 优先 **`t_order.ChannelForecastCode`**,缺失时回退 live 查 **`t_service_channel.ForecastCode`**;itfx 下游预报(前端 **`createOrderOne`**)优先读订单 **`DownstreamSupplierCode` / `DownstreamAppKey` / `DownstreamAppId`**,**AppSecret** 仍按 **`DownstreamAppId`** 调 itfx App API。 @@ -2096,7 +2096,7 @@ JWT → mapId(user.userid INT) - 命中则更新 `t_order.IsRemote = 1`;未命中则更新 `t_order.IsRemote = 0` - 偏远校验不拦截订单,只影响后续费用匹配。 -7. 计费重计算(**有效规则 ID:仅销售产品**) +7. 计费重计算(**应收:有效规则 ID 仅销售产品**;应付见渠道计重 / `PayableChargeableWeight`) - **输入**:仅使用 `t_order_weight` 中 **`Type = forecast`** 的件重尺:`Length`、`Width`、`Height`、`ActualWeight`(单位与库表约定一致,一般为 cm / kg)。 - **解析 `effectiveWeightRuleId`**:取本单绑定 **`t_sales_product.WeightRuleId`**;须**非空**且对应 **`t_weight_rule.IsDeleted=0`**。否则更新 `PredeclareFailReason`(如「未配置计重规则」),保持 `draft`,失败返回。 - **加载明细集合 `rules`**:`t_weight_rule_info` 中 **`RuleId = effectiveWeightRuleId and IsDeleted=0`**,按 **`Id` 升序**排序;或从 **`rulesSnapshot.content.weightRule`** 读取与 **`effectiveWeightRuleId`** 一致的 **`clientRules`**(结构无 `client` 字段,与表 §5.2.16 对齐)。集合为空则同上失败。 diff --git a/src/locale/en-US.ts b/src/locale/en-US.ts index 2e0ac6e..c192203 100644 --- a/src/locale/en-US.ts +++ b/src/locale/en-US.ts @@ -984,7 +984,8 @@ export default { 'order.pickupOrder.table.payStatus': 'Payment', 'order.pickupOrder.table.receivable': 'Receivable', 'order.pickupOrder.table.actualWeightKg': 'Actual kg', - 'order.pickupOrder.table.chargeableWeight': 'Chargeable kg', + 'order.pickupOrder.table.chargeableWeight': 'Receivable chargeable kg', + 'order.pickupOrder.table.payableChargeableWeight': 'Payable chargeable kg', 'order.pickupOrder.table.volumetricWeight': 'Volumetric kg', 'order.pickupOrder.table.payable': 'Payable (buy)', 'order.pickupOrder.detail.sectionMeasure': 'Weight & size', @@ -2630,7 +2631,7 @@ export default { 'order.myOrders.allocationTrace.recalcLive': 'Recalculate live', 'order.myOrders.allocationTrace.scheme': 'Scheme', 'order.myOrders.allocationTrace.source': 'Scheme source', - 'order.myOrders.allocationTrace.weight': 'Chargeable weight', + 'order.myOrders.allocationTrace.weight': 'Payable chargeable weight', 'order.myOrders.allocationTrace.stage': 'Billing stage', 'order.myOrders.allocationTrace.conclusion': 'Selected {channel} among {count} candidates by “{scheme}”', 'order.myOrders.allocationTrace.col.channel': 'Service channel', @@ -2786,7 +2787,8 @@ export default { 'order.myOrders.drawer.weightHeight': 'Height(cm)', 'order.myOrders.drawer.actualWeight': 'Actual(kg)', 'order.myOrders.drawer.volumetricWeight': 'Volumetric(kg)', - 'order.myOrders.drawer.chargeableWeight': 'Chargeable(kg)', + 'order.myOrders.drawer.chargeableWeight': 'Receivable chargeable(kg)', + 'order.myOrders.drawer.payableChargeableWeight': 'Payable chargeable(kg)', 'order.myOrders.drawer.cubic': 'Cubic(m³)', 'order.myOrders.drawer.feeType': 'Type', 'order.myOrders.drawer.chargingStage': 'Charging Stage', @@ -6496,7 +6498,8 @@ export default { 'channel.salesProducts.billingSimulate.isRemote': 'Remote area', 'channel.salesProducts.billingSimulate.isRemoteAuto': 'By product zone', 'channel.salesProducts.billingSimulate.run': 'Simulate', - 'channel.salesProducts.billingSimulate.chargeableWeight': 'Chargeable weight', + 'channel.salesProducts.billingSimulate.chargeableWeight': 'Receivable chargeable weight', + 'channel.salesProducts.billingSimulate.payableChargeableWeight': 'Payable chargeable weight', 'channel.salesProducts.billingSimulate.zoneKeys': 'Zones', 'channel.salesProducts.billingSimulate.receivable': 'Receivable', 'channel.salesProducts.billingSimulate.payable': 'Payable', @@ -6610,6 +6613,9 @@ export default { 'channel.serviceChannels.form.forecastType.custom': 'Custom forecast', 'channel.serviceChannels.form.forecastCode': 'Forecast channel code', 'channel.serviceChannels.form.remoteArea': 'Remote area', + 'channel.serviceChannels.form.blacklistArea': 'Blacklist area', + 'channel.serviceChannels.form.weightRule': 'Weight rule', + 'channel.serviceChannels.form.weightRounding': 'Weight rounding', 'channel.serviceChannels.form.description': 'Channel description', 'channel.serviceChannels.form.preScript': 'Pre-forecast script', 'channel.serviceChannels.form.app': 'App', @@ -6640,6 +6646,12 @@ export default { 'channel.serviceChannels.tip.forecastType': 'Rules for forecast tracking numbers', 'channel.serviceChannels.tip.forecastCode': 'Upstream forecast channel code required by the provider', 'channel.serviceChannels.tip.remoteArea': 'Remote-area partition scheme', + 'channel.serviceChannels.tip.blacklistArea': + 'Skip this channel in allocation when the recipient address hits this partition (independent of sales-product blacklist)', + 'channel.serviceChannels.tip.weightRule': + 'Weight rule for payable chargeable weight (independent of sales-product receivable weight)', + 'channel.serviceChannels.tip.weightRounding': + 'Weight rounding for payable chargeable weight (independent of sales-product receivable rounding)', 'channel.serviceChannels.tip.preScript': 'Script to rewrite/validate fields before forecast; leave empty if unused', 'channel.serviceChannels.form.placeholder.input': 'Please enter', 'channel.serviceChannels.form.placeholder.select': 'Please select', diff --git a/src/locale/zh-CN.ts b/src/locale/zh-CN.ts index 2142f7c..c971556 100644 --- a/src/locale/zh-CN.ts +++ b/src/locale/zh-CN.ts @@ -962,7 +962,8 @@ export default { 'order.pickupOrder.table.payStatus': '支付', 'order.pickupOrder.table.receivable': '应收', 'order.pickupOrder.table.actualWeightKg': '实重(kg)', - 'order.pickupOrder.table.chargeableWeight': '计费重(kg)', + 'order.pickupOrder.table.chargeableWeight': '应收计费重(kg)', + 'order.pickupOrder.table.payableChargeableWeight': '应付计费重(kg)', 'order.pickupOrder.table.volumetricWeight': '体积重(kg)', 'order.pickupOrder.table.payable': '应付(买价)', 'order.pickupOrder.detail.sectionMeasure': '件重尺', @@ -2430,7 +2431,7 @@ export default { 'order.myOrders.allocationTrace.recalcLive': '现算刷新', 'order.myOrders.allocationTrace.scheme': '排货方案', 'order.myOrders.allocationTrace.source': '方案来源', - 'order.myOrders.allocationTrace.weight': '计费重', + 'order.myOrders.allocationTrace.weight': '应付计费重', 'order.myOrders.allocationTrace.stage': '计费阶段', 'order.myOrders.allocationTrace.conclusion': '因「{scheme}」在 {count} 个候选中选中 {channel}', 'order.myOrders.allocationTrace.col.channel': '服务渠道', @@ -2586,7 +2587,8 @@ export default { 'order.myOrders.drawer.weightHeight': '高(cm)', 'order.myOrders.drawer.actualWeight': '实重(kg)', 'order.myOrders.drawer.volumetricWeight': '体积重(kg)', - 'order.myOrders.drawer.chargeableWeight': '计费重(kg)', + 'order.myOrders.drawer.chargeableWeight': '应收计费重(kg)', + 'order.myOrders.drawer.payableChargeableWeight': '应付计费重(kg)', 'order.myOrders.drawer.cubic': '立方(m³)', 'order.myOrders.drawer.feeType': '类型', 'order.myOrders.drawer.chargingStage': '计费阶段', @@ -6501,7 +6503,8 @@ export default { 'channel.salesProducts.billingSimulate.isRemote': '是否偏远', 'channel.salesProducts.billingSimulate.isRemoteAuto': '按产品分区', 'channel.salesProducts.billingSimulate.run': '开始模拟', - 'channel.salesProducts.billingSimulate.chargeableWeight': '计费重', + 'channel.salesProducts.billingSimulate.chargeableWeight': '应收计费重', + 'channel.salesProducts.billingSimulate.payableChargeableWeight': '应付计费重', 'channel.salesProducts.billingSimulate.zoneKeys': '分区', 'channel.salesProducts.billingSimulate.receivable': '应收', 'channel.salesProducts.billingSimulate.payable': '应付', @@ -6616,6 +6619,9 @@ export default { 'channel.serviceChannels.form.forecastType.custom': '自定义预报', 'channel.serviceChannels.form.forecastCode': '预报渠道code', 'channel.serviceChannels.form.remoteArea': '偏远分区', + 'channel.serviceChannels.form.blacklistArea': '黑名单区', + 'channel.serviceChannels.form.weightRule': '计重规则', + 'channel.serviceChannels.form.weightRounding': '计重进位', 'channel.serviceChannels.form.description': '渠道说明', 'channel.serviceChannels.form.preScript': '预报前执行脚本', 'channel.serviceChannels.form.app': '应用', @@ -6646,6 +6652,9 @@ export default { 'channel.serviceChannels.tip.forecastType': '决定预报回传单号规则', 'channel.serviceChannels.tip.forecastCode': '上游预报渠道编码,按服务商要求填写', 'channel.serviceChannels.tip.remoteArea': '偏远地区判定分区方案', + 'channel.serviceChannels.tip.blacklistArea': '收件地址命中该分区时跳过本渠道排货(与销售产品黑名单独立)', + 'channel.serviceChannels.tip.weightRule': '应付计费重所用计重规则(与销售产品应收计重独立)', + 'channel.serviceChannels.tip.weightRounding': '应付计费重所用计重进位(与销售产品应收进位独立)', 'channel.serviceChannels.tip.preScript': '预报前改写/校验字段的脚本,无需求可留空', 'channel.serviceChannels.form.placeholder.input': '请输入', 'channel.serviceChannels.form.placeholder.select': '请选择', diff --git a/src/views/channel/salesProducts/components/BillingSimulateDrawer.vue b/src/views/channel/salesProducts/components/BillingSimulateDrawer.vue index 4e39e29..85602d9 100644 --- a/src/views/channel/salesProducts/components/BillingSimulateDrawer.vue +++ b/src/views/channel/salesProducts/components/BillingSimulateDrawer.vue @@ -149,6 +149,12 @@ {{ t('channel.salesProducts.billingSimulate.chargeableWeight') }}: {{ formatNum(result.chargeableWeight ?? result.ChargeableWeight) }} kg + {{ t('channel.salesProducts.billingSimulate.zoneKeys') }}:{{ zoneText }} diff --git a/src/views/channel/serviceChannels/index.vue b/src/views/channel/serviceChannels/index.vue index 0fe636a..e2bd899 100644 --- a/src/views/channel/serviceChannels/index.vue +++ b/src/views/channel/serviceChannels/index.vue @@ -251,6 +251,57 @@ +
+ + + + {{ option.label }} + + +
+
+ + + + {{ option.label }} + + +
+
+ + + + {{ option.label }} + + +
@@ -1242,6 +1293,85 @@ + + + + + + {{ option.label }} + + + + + + + + + + + + {{ option.label }} + + + + + + + + + + + + {{ option.label }} + + + +
{{ t('channel.serviceChannels.section.desc') }}
@@ -1466,6 +1596,8 @@ import { } from '@/api/channel/serviceChannel' import { getDictList, getDictListByTypes } from '@/api/system/dict' import { postForewarningServiceKpiAreaGetKpiAreas } from '@/api/channel/kpiArea' +import { postWeightRuleList } from '@/api/channel/weightRule' +import { postWeightRoundingList } from '@/api/channel/weightRounding' import { getWarehouseList } from '@/api/system/warehouse' import CustomLeftMenu from '@/components/CustomLeftMenu/index.vue' import type { CustomLeftMenuTreeNode } from '@/components/CustomLeftMenu/types' @@ -1786,6 +1918,9 @@ function filterKpiAreasByType(items: any[], areaType: string) { const priceAreaFactorOptions = ref([]) const warehouseFactorOptions = ref([]) const remoteAreaDivisionOptions = ref([]) +const blacklistAreaOptions = ref([]) +const weightRuleOptions = ref([]) +const weightRoundingOptions = ref([]) function mapKpiAreasToSelectOptions(items: any[]): IdSelectOption[] { return (items || []).map((it: any) => { @@ -1795,6 +1930,14 @@ function mapKpiAreasToSelectOptions(items: any[]): IdSelectOption[] { }) } +function mapRuleSelectOptions(items: any[]): IdSelectOption[] { + return (items || []).map((it: any) => { + const id = it?.id ?? it?.Id + const name = String(it?.name ?? it?.Name ?? id ?? '') + return { label: name, value: String(id ?? '') } + }) +} + function toOptionalPositiveId(v: unknown): number | undefined { if (v === '' || v == null) return undefined const n = Number(v) @@ -1819,6 +1962,38 @@ async function loadRemoteAreaSelectOptions() { } } +async function loadBlacklistAreaSelectOptions() { + try { + const blRes = await postForewarningServiceKpiAreaGetKpiAreas({ + pageIndex: 1, + pageSize: 500, + areaType: 'blacklist', + }) + const blItems = blRes?.items ?? (blRes as any)?.data?.items ?? [] + blacklistAreaOptions.value = mapKpiAreasToSelectOptions( + filterKpiAreasByType(blItems, 'blacklist') + ) + } catch (e: any) { + Message.error(e?.message || '加载黑名单区失败') + blacklistAreaOptions.value = [] + } +} + +async function loadWeightSelectOptions() { + try { + const [ruleRes, roundingRes] = await Promise.all([ + postWeightRuleList({ page: 1, pageSize: 500 }), + postWeightRoundingList({ page: 1, pageSize: 500 }), + ]) + weightRuleOptions.value = mapRuleSelectOptions(ruleRes?.items ?? []) + weightRoundingOptions.value = mapRuleSelectOptions(roundingRes?.items ?? []) + } catch (e: any) { + Message.error(e?.message || '加载计重规则/进位失败') + weightRuleOptions.value = [] + weightRoundingOptions.value = [] + } +} + async function loadBillingFactorSelectOptions() { try { const [areaRes, warehouseRes] = await Promise.all([ @@ -2105,6 +2280,9 @@ const formData = reactive({ forecastType: '', forecastCode: '', remoteAreaId: '', + blacklistAreaId: '', + weightRuleId: '', + weightRoundingId: '', description: '', preScript: '' }) @@ -2117,6 +2295,9 @@ type ConfigFormSnapshot = { forecastType: string forecastCode: string remoteAreaId: string + blacklistAreaId: string + weightRuleId: string + weightRoundingId: string description: string preScript: string } @@ -2133,6 +2314,9 @@ function snapshotConfigForm(): ConfigFormSnapshot { forecastType: formData.forecastType, forecastCode: formData.forecastCode, remoteAreaId: formData.remoteAreaId, + blacklistAreaId: formData.blacklistAreaId, + weightRuleId: formData.weightRuleId, + weightRoundingId: formData.weightRoundingId, description: formData.description, preScript: formData.preScript, } @@ -2153,6 +2337,9 @@ const configFormDirty = computed(() => { || formData.forecastType !== baseline.forecastType || formData.forecastCode !== baseline.forecastCode || formData.remoteAreaId !== baseline.remoteAreaId + || formData.blacklistAreaId !== baseline.blacklistAreaId + || formData.weightRuleId !== baseline.weightRuleId + || formData.weightRoundingId !== baseline.weightRoundingId || formData.description !== baseline.description || formData.preScript !== baseline.preScript ) @@ -2345,6 +2532,9 @@ const addChannelForm = reactive({ forecastType: '', forecastCode: '', remoteAreaId: '', + blacklistAreaId: '', + weightRuleId: '', + weightRoundingId: '', description: '', preScript: '' }) @@ -2569,6 +2759,8 @@ const ensureReferenceOptionsLoaded = async () => { loadAppList(), loadServiceProviderList(), loadRemoteAreaSelectOptions(), + loadBlacklistAreaSelectOptions(), + loadWeightSelectOptions(), ]) referenceOptionsLoaded.value = true } finally { @@ -2580,6 +2772,8 @@ const ensureReferenceOptionsLoaded = async () => { onMounted(() => { loadChannelGroups() void loadRemoteAreaSelectOptions() + void loadBlacklistAreaSelectOptions() + void loadWeightSelectOptions() }) // 计费因素数据 @@ -3819,11 +4013,19 @@ const handleAddChannelToGroup = async (group: any) => { addChannelForm.forecastType = '' addChannelForm.forecastCode = '' addChannelForm.remoteAreaId = '' + addChannelForm.blacklistAreaId = '' + addChannelForm.weightRuleId = '' + addChannelForm.weightRoundingId = '' addChannelForm.description = '' addChannelForm.preScript = '' addChannelShowAdvanced.value = false addChannelModalVisible.value = true - await Promise.all([mergeForecastTypeDictFromApi(), loadRemoteAreaSelectOptions()]) + await Promise.all([ + mergeForecastTypeDictFromApi(), + loadRemoteAreaSelectOptions(), + loadBlacklistAreaSelectOptions(), + loadWeightSelectOptions(), + ]) } function applyServiceChannelDetailToForm(d: Record, channel?: any) { @@ -3838,6 +4040,12 @@ function applyServiceChannelDetailToForm(d: Record, channel?: any) formData.forecastCode = String(d.forecastCode ?? d.ForecastCode ?? '') const remoteRaw = d.remoteAreaId ?? d.RemoteAreaId formData.remoteAreaId = remoteRaw != null && remoteRaw !== '' ? String(remoteRaw) : '' + const blRaw = d.blacklistAreaId ?? d.BlacklistAreaId + formData.blacklistAreaId = blRaw != null && blRaw !== '' ? String(blRaw) : '' + const wrRaw = d.weightRuleId ?? d.WeightRuleId + formData.weightRuleId = wrRaw != null && wrRaw !== '' ? String(wrRaw) : '' + const roundRaw = d.weightRoundingId ?? d.WeightRoundingId + formData.weightRoundingId = roundRaw != null && roundRaw !== '' ? String(roundRaw) : '' formData.description = String(d.description ?? d.Description ?? '') formData.preScript = String(d.preScript ?? d.PreScript ?? '') // 列表原先不带 createBy/updateBy,详情有;合并进当前渠道供上下文栏展示 @@ -3980,6 +4188,9 @@ async function executeChannelConfigSave(successMessage: string) { forecastType: formData.forecastType, forecastCode: formData.forecastCode, remoteAreaId: toOptionalPositiveId(formData.remoteAreaId) ?? null, + blacklistAreaId: toOptionalPositiveId(formData.blacklistAreaId) ?? null, + weightRuleId: toOptionalPositiveId(formData.weightRuleId) ?? null, + weightRoundingId: toOptionalPositiveId(formData.weightRoundingId) ?? null, description: formData.description, preScript: formData.preScript, isActive, @@ -4991,6 +5202,9 @@ const handleCancelAddChannel = () => { addChannelForm.forecastType = '' addChannelForm.forecastCode = '' addChannelForm.remoteAreaId = '' + addChannelForm.blacklistAreaId = '' + addChannelForm.weightRuleId = '' + addChannelForm.weightRoundingId = '' addChannelForm.description = '' addChannelForm.preScript = '' } @@ -5010,6 +5224,9 @@ const handleConfirmAddChannel = async () => { } try { const remoteAreaId = toOptionalPositiveId(addChannelForm.remoteAreaId) + const blacklistAreaId = toOptionalPositiveId(addChannelForm.blacklistAreaId) + const weightRuleId = toOptionalPositiveId(addChannelForm.weightRuleId) + const weightRoundingId = toOptionalPositiveId(addChannelForm.weightRoundingId) await createServiceChannel({ groupId: gid, channelCode: addChannelForm.channelCode, @@ -5022,6 +5239,9 @@ const handleConfirmAddChannel = async () => { preScript: addChannelForm.preScript, isActive: ENABLE_STATUS.enabled, ...(remoteAreaId != null ? { remoteAreaId } : {}), + ...(blacklistAreaId != null ? { blacklistAreaId } : {}), + ...(weightRuleId != null ? { weightRuleId } : {}), + ...(weightRoundingId != null ? { weightRoundingId } : {}), }) Message.success('新增渠道成功') addChannelModalVisible.value = false diff --git a/src/views/order/myOrders/components/OrderDetailDrawer.vue b/src/views/order/myOrders/components/OrderDetailDrawer.vue index 1c5b1f2..b212cbe 100644 --- a/src/views/order/myOrders/components/OrderDetailDrawer.vue +++ b/src/views/order/myOrders/components/OrderDetailDrawer.vue @@ -1376,6 +1376,7 @@ const weightMetricFields = [ { key: 'actualWeight', labelKey: 'order.myOrders.drawer.actualWeight', editable: true, highlight: false }, { key: 'volumetricWeight', labelKey: 'order.myOrders.drawer.volumetricWeight', editable: false, highlight: false }, { key: 'chargeableWeight', labelKey: 'order.myOrders.drawer.chargeableWeight', editable: false, highlight: true }, + { key: 'payableChargeableWeight', labelKey: 'order.myOrders.drawer.payableChargeableWeight', editable: false, highlight: true }, { key: 'cubic', labelKey: 'order.myOrders.drawer.cubic', editable: false, highlight: false }, ]; @@ -1494,7 +1495,7 @@ function formatWeightCellValue(row: any, key: string) { const val = row?.[key]; if (val == null || val === '') return '--'; if (['length', 'width', 'height'].includes(key)) return `${formatWeightNumber(val)} cm`; - if (['actualWeight', 'volumetricWeight', 'chargeableWeight'].includes(key)) { + if (['actualWeight', 'volumetricWeight', 'chargeableWeight', 'payableChargeableWeight'].includes(key)) { return `${formatWeightNumber(val)} kg`; } if (key === 'cubic') return `${formatWeightNumber(val)} m³`; diff --git a/src/views/order/pickupOrder/PickupOrderDetailDrawer.vue b/src/views/order/pickupOrder/PickupOrderDetailDrawer.vue index 27cd6a0..ecc6c67 100644 --- a/src/views/order/pickupOrder/PickupOrderDetailDrawer.vue +++ b/src/views/order/pickupOrder/PickupOrderDetailDrawer.vue @@ -603,6 +603,10 @@ defineExpose({ open, close }) {{ t('order.pickupOrder.table.chargeableWeight') }} {{ fmtNum(pick(detail, 'chargeableWeight', 'ChargeableWeight')) }}
+
+ {{ t('order.pickupOrder.table.payableChargeableWeight') }} + {{ fmtNum(pick(detail, 'payableChargeableWeight', 'PayableChargeableWeight')) }} +
{{ t('order.pickupOrder.table.volumetricWeight') }} {{ fmtNum(pick(detail, 'volumetricWeight', 'VolumetricWeight')) }} diff --git a/src/views/order/waybillManage/components/AllocationTraceModal.vue b/src/views/order/waybillManage/components/AllocationTraceModal.vue index 2a49005..1d11647 100644 --- a/src/views/order/waybillManage/components/AllocationTraceModal.vue +++ b/src/views/order/waybillManage/components/AllocationTraceModal.vue @@ -146,7 +146,7 @@ function toggleExpand(id: number) {
{{ $t('order.myOrders.allocationTrace.weight') }} - {{ formatWeight(trace.chargeableWeight) }} + {{ formatWeight(trace.payableChargeableWeight ?? trace.chargeableWeight) }}
{{ $t('order.myOrders.allocationTrace.stage') }} diff --git a/src/views/order/waybillManage/components/OrderDetailDrawer.vue b/src/views/order/waybillManage/components/OrderDetailDrawer.vue index 3413051..45e9b07 100644 --- a/src/views/order/waybillManage/components/OrderDetailDrawer.vue +++ b/src/views/order/waybillManage/components/OrderDetailDrawer.vue @@ -1802,6 +1802,7 @@ const weightMetricFields = [ { key: 'actualWeight', labelKey: 'order.myOrders.drawer.actualWeight', editable: true, highlight: false }, { key: 'volumetricWeight', labelKey: 'order.myOrders.drawer.volumetricWeight', editable: false, highlight: false }, { key: 'chargeableWeight', labelKey: 'order.myOrders.drawer.chargeableWeight', editable: false, highlight: true }, + { key: 'payableChargeableWeight', labelKey: 'order.myOrders.drawer.payableChargeableWeight', editable: false, highlight: true }, { key: 'cubic', labelKey: 'order.myOrders.drawer.cubic', editable: false, highlight: false }, ]; @@ -1890,7 +1891,10 @@ function formatWeightNumber(value: unknown) { return Number.isFinite(num) ? num.toFixed(3).replace(/\.?0+$/, '') : '--'; } -function formatWeightChargeable(row?: { chargeableWeight?: number | string | null }) { +function formatWeightChargeable(row?: { + chargeableWeight?: number | string | null; + payableChargeableWeight?: number | string | null; +}) { const val = row?.chargeableWeight; if (val == null || val === '') return '--'; return `${formatWeightNumber(val)} kg`; @@ -1900,7 +1904,7 @@ function formatWeightCellValue(row: any, key: string) { const val = row?.[key]; if (val == null || val === '') return '--'; if (['length', 'width', 'height'].includes(key)) return `${formatWeightNumber(val)} cm`; - if (['actualWeight', 'volumetricWeight', 'chargeableWeight'].includes(key)) { + if (['actualWeight', 'volumetricWeight', 'chargeableWeight', 'payableChargeableWeight'].includes(key)) { return `${formatWeightNumber(val)} kg`; } if (key === 'cubic') return `${formatWeightNumber(val)} m³`;