feat: 服务渠道计重/黑名单配置与应付计费重展示
All checks were successful
Build and Deploy Front / deploy (push) Successful in 12m22s
All checks were successful
Build and Deploy Front / deploy (push) Successful in 12m22s
渠道表单支持计重规则/进位与黑名单;订单/揽收/排货/试算区分应收与应付计费重。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
d2ecbaa15e
commit
443032620b
@ -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 对齐)。集合为空则同上失败。
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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': '请选择',
|
||||
|
||||
@ -149,6 +149,12 @@
|
||||
<span>
|
||||
{{ t('channel.salesProducts.billingSimulate.chargeableWeight') }}:
|
||||
{{ formatNum(result.chargeableWeight ?? result.ChargeableWeight) }} kg
|
||||
<template
|
||||
v-if="(result.payableChargeableWeight ?? result.PayableChargeableWeight) != null"
|
||||
>
|
||||
;{{ t('channel.salesProducts.billingSimulate.payableChargeableWeight') }}:
|
||||
{{ formatNum(result.payableChargeableWeight ?? result.PayableChargeableWeight) }} kg
|
||||
</template>
|
||||
</span>
|
||||
<span v-if="zoneText">
|
||||
{{ t('channel.salesProducts.billingSimulate.zoneKeys') }}:{{ zoneText }}
|
||||
|
||||
@ -251,6 +251,57 @@
|
||||
</a-option>
|
||||
</a-select>
|
||||
</div>
|
||||
<div class="form-item">
|
||||
<label class="form-label">{{ t('channel.serviceChannels.form.blacklistArea') }}</label>
|
||||
<a-select
|
||||
v-model="formData.blacklistAreaId"
|
||||
:placeholder="t('channel.serviceChannels.form.placeholder.select')"
|
||||
allow-clear
|
||||
class="form-input"
|
||||
>
|
||||
<a-option
|
||||
v-for="option in blacklistAreaOptions"
|
||||
:key="option.value"
|
||||
:value="option.value"
|
||||
>
|
||||
{{ option.label }}
|
||||
</a-option>
|
||||
</a-select>
|
||||
</div>
|
||||
<div class="form-item">
|
||||
<label class="form-label">{{ t('channel.serviceChannels.form.weightRule') }}</label>
|
||||
<a-select
|
||||
v-model="formData.weightRuleId"
|
||||
:placeholder="t('channel.serviceChannels.form.placeholder.select')"
|
||||
allow-clear
|
||||
class="form-input"
|
||||
>
|
||||
<a-option
|
||||
v-for="option in weightRuleOptions"
|
||||
:key="option.value"
|
||||
:value="option.value"
|
||||
>
|
||||
{{ option.label }}
|
||||
</a-option>
|
||||
</a-select>
|
||||
</div>
|
||||
<div class="form-item">
|
||||
<label class="form-label">{{ t('channel.serviceChannels.form.weightRounding') }}</label>
|
||||
<a-select
|
||||
v-model="formData.weightRoundingId"
|
||||
:placeholder="t('channel.serviceChannels.form.placeholder.select')"
|
||||
allow-clear
|
||||
class="form-input"
|
||||
>
|
||||
<a-option
|
||||
v-for="option in weightRoundingOptions"
|
||||
:key="option.value"
|
||||
:value="option.value"
|
||||
>
|
||||
{{ option.label }}
|
||||
</a-option>
|
||||
</a-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
@ -1242,6 +1293,85 @@
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item>
|
||||
<template #label>
|
||||
<span class="label-with-tip">
|
||||
{{ t('channel.serviceChannels.form.blacklistArea') }}
|
||||
<a-tooltip :content="t('channel.serviceChannels.tip.blacklistArea')">
|
||||
<icon-question-circle class="tip-icon" />
|
||||
</a-tooltip>
|
||||
</span>
|
||||
</template>
|
||||
<a-select
|
||||
v-model="addChannelForm.blacklistAreaId"
|
||||
:placeholder="t('channel.serviceChannels.form.placeholder.select')"
|
||||
allow-clear
|
||||
>
|
||||
<a-option
|
||||
v-for="option in blacklistAreaOptions"
|
||||
:key="option.value"
|
||||
:value="option.value"
|
||||
>
|
||||
{{ option.label }}
|
||||
</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="16">
|
||||
<a-col :span="12">
|
||||
<a-form-item>
|
||||
<template #label>
|
||||
<span class="label-with-tip">
|
||||
{{ t('channel.serviceChannels.form.weightRule') }}
|
||||
<a-tooltip :content="t('channel.serviceChannels.tip.weightRule')">
|
||||
<icon-question-circle class="tip-icon" />
|
||||
</a-tooltip>
|
||||
</span>
|
||||
</template>
|
||||
<a-select
|
||||
v-model="addChannelForm.weightRuleId"
|
||||
:placeholder="t('channel.serviceChannels.form.placeholder.select')"
|
||||
allow-clear
|
||||
>
|
||||
<a-option
|
||||
v-for="option in weightRuleOptions"
|
||||
:key="option.value"
|
||||
:value="option.value"
|
||||
>
|
||||
{{ option.label }}
|
||||
</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="16">
|
||||
<a-col :span="12">
|
||||
<a-form-item>
|
||||
<template #label>
|
||||
<span class="label-with-tip">
|
||||
{{ t('channel.serviceChannels.form.weightRounding') }}
|
||||
<a-tooltip :content="t('channel.serviceChannels.tip.weightRounding')">
|
||||
<icon-question-circle class="tip-icon" />
|
||||
</a-tooltip>
|
||||
</span>
|
||||
</template>
|
||||
<a-select
|
||||
v-model="addChannelForm.weightRoundingId"
|
||||
:placeholder="t('channel.serviceChannels.form.placeholder.select')"
|
||||
allow-clear
|
||||
>
|
||||
<a-option
|
||||
v-for="option in weightRoundingOptions"
|
||||
:key="option.value"
|
||||
:value="option.value"
|
||||
>
|
||||
{{ option.label }}
|
||||
</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<div class="form-section-title">{{ t('channel.serviceChannels.section.desc') }}</div>
|
||||
@ -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<IdSelectOption[]>([])
|
||||
const warehouseFactorOptions = ref<IdSelectOption[]>([])
|
||||
const remoteAreaDivisionOptions = ref<IdSelectOption[]>([])
|
||||
const blacklistAreaOptions = ref<IdSelectOption[]>([])
|
||||
const weightRuleOptions = ref<IdSelectOption[]>([])
|
||||
const weightRoundingOptions = ref<IdSelectOption[]>([])
|
||||
|
||||
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<string, any>, channel?: any) {
|
||||
@ -3838,6 +4040,12 @@ function applyServiceChannelDetailToForm(d: Record<string, any>, 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
|
||||
|
||||
@ -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³`;
|
||||
|
||||
@ -603,6 +603,10 @@ defineExpose({ open, close })
|
||||
<span>{{ t('order.pickupOrder.table.chargeableWeight') }}</span>
|
||||
<b>{{ fmtNum(pick(detail, 'chargeableWeight', 'ChargeableWeight')) }}</b>
|
||||
</div>
|
||||
<div class="pk-detail-field">
|
||||
<span>{{ t('order.pickupOrder.table.payableChargeableWeight') }}</span>
|
||||
<b>{{ fmtNum(pick(detail, 'payableChargeableWeight', 'PayableChargeableWeight')) }}</b>
|
||||
</div>
|
||||
<div class="pk-detail-field">
|
||||
<span>{{ t('order.pickupOrder.table.volumetricWeight') }}</span>
|
||||
<b>{{ fmtNum(pick(detail, 'volumetricWeight', 'VolumetricWeight')) }}</b>
|
||||
|
||||
@ -146,7 +146,7 @@ function toggleExpand(id: number) {
|
||||
</div>
|
||||
<div class="alloc-trace__meta-item">
|
||||
<span class="label">{{ $t('order.myOrders.allocationTrace.weight') }}</span>
|
||||
<span class="value">{{ formatWeight(trace.chargeableWeight) }}</span>
|
||||
<span class="value">{{ formatWeight(trace.payableChargeableWeight ?? trace.chargeableWeight) }}</span>
|
||||
</div>
|
||||
<div class="alloc-trace__meta-item">
|
||||
<span class="label">{{ $t('order.myOrders.allocationTrace.stage') }}</span>
|
||||
|
||||
@ -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³`;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user