套餐加分区功能

This commit is contained in:
wuweihua
2026-09-15 14:10:44 +08:00
parent 76208604bb
commit 7679a7d091
26 changed files with 1279 additions and 597 deletions
@@ -16,7 +16,7 @@
:closable="false"
show-icon
class="mb12"
title="FIXED 模式:可不填明细(计费取 bms_product_country 默认运费/挂号费);有明细时按产品×国家×重量段覆盖固定价。附加费来自产品关联,只读展示。"
title="FIXED 模式:可不填明细(计费取 bms_product_country 默认运费/挂号费);有明细时按产品×国家×分区×重量段覆盖固定价。附加费来自产品关联,只读展示。"
/>
<el-alert
v-else
@@ -64,6 +64,29 @@
</template>
</el-table-column>
<el-table-column v-if="isFixedType(setType)" label="分区" min-width="140">
<template #default="{ row }">
<el-select
v-if="refData.hasZonesOf(row)"
v-model="row.zoneCode"
filterable
clearable
placeholder="选择分区"
style="width: 100%"
:disabled="!row._countryKey"
@change="onZoneChange(row)"
>
<el-option
v-for="z in refData.zoneOptionsOf(row)"
:key="z.key"
:label="z.label"
:value="z.zoneCode"
/>
</el-select>
<span v-else class="muted">-</span>
</template>
</el-table-column>
<el-table-column v-if="isFixedType(setType)" label="重量段" min-width="150">
<template #default="{ row }">
<el-select
@@ -72,7 +95,7 @@
clearable
placeholder="选择重量段"
style="width: 100%"
:disabled="!row._countryKey"
:disabled="!row._countryKey || (refData.hasZonesOf(row) && !row.zoneCode)"
@change="onWeightChange(row)"
>
<el-option
@@ -158,7 +181,7 @@ const { bms_round_mode } = useDict('bms_round_mode')
/** 参考数据来自父页面,缓存与请求去重全页面共享 */
const { productOptions, surchargesOf, countryOptionsOf, weightOptionsOf } = props.refData
const { onProductChange, onCountryChange, onWeightChange } = useDetailCascade(props.refData)
const { onProductChange, onCountryChange, onZoneChange, onWeightChange } = useDetailCascade(props.refData)
function addRow() {
props.details.push(createEmptyDetailRow())
@@ -37,6 +37,21 @@
</el-select>
</el-form-item>
</el-col>
<el-col v-if="hasZones" :span="12">
<el-form-item label="分区" prop="zoneCode">
<el-select
v-model="form.zoneCode"
filterable
clearable
placeholder="选择分区"
style="width: 100%"
:disabled="!form._countryKey"
@change="onZoneChange(form)"
>
<el-option v-for="z in zoneOptions" :key="z.key" :label="z.label" :value="z.zoneCode" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="重量段" prop="weightLabel">
<el-select
@@ -45,7 +60,7 @@
clearable
placeholder="选择重量段"
style="width: 100%"
:disabled="!form._countryKey"
:disabled="!form._countryKey || (hasZones && !form.zoneCode)"
@change="onWeightChange(form)"
>
<el-option v-for="w in weightOptions" :key="w.value" :label="w.label" :value="w.value" />
@@ -173,8 +188,8 @@ const emit = defineEmits(['success'])
const { proxy } = getCurrentInstance()
const { bms_round_mode } = useDict('bms_round_mode')
const { productOptions, surchargesOf, countryOptionsOf, weightOptionsOf } = props.refData
const { onProductChange, onCountryChange, onWeightChange } = useDetailCascade(props.refData)
const { productOptions, surchargesOf, countryOptionsOf, zoneOptionsOf, hasZonesOf, weightOptionsOf } = props.refData
const { onProductChange, onCountryChange, onZoneChange, onWeightChange } = useDetailCascade(props.refData)
const visible = ref(false)
const title = ref('')
@@ -189,6 +204,8 @@ const rules = {
const surcharges = computed(() => surchargesOf(form.value))
const countryOptions = computed(() => countryOptionsOf(form.value))
const zoneOptions = computed(() => zoneOptionsOf(form.value))
const hasZones = computed(() => hasZonesOf(form.value))
const weightOptions = computed(() => weightOptionsOf(form.value))
/** 打开弹窗:row 为空表示新增 */
@@ -30,6 +30,9 @@
<el-table-column label="国家" min-width="130">
<template #default="{ row }">{{ row.countryName || row.countryCode || '-' }}</template>
</el-table-column>
<el-table-column label="分区" min-width="120">
<template #default="{ row }">{{ row.zoneName || row.zoneCode || '-' }}</template>
</el-table-column>
<el-table-column label="重量段" prop="weightLabel" min-width="130" />
<el-table-column label="运费单价" min-width="130" align="right">
<template #default="{ row }">
@@ -119,7 +122,7 @@ const details = computed(() => props.set.details || [])
const editable = computed(() => isChildEditable(props.set.status))
const subTitle = computed(() => isFixedType(props.set.setType)
? '按 产品 × 国家 × 重量段 覆盖固定价'
? '按 产品 × 国家 × 分区 × 重量段 覆盖固定价'
: '按产品限定折扣,留空走套餐默认折扣')
const hint = computed(() => isFixedType(props.set.setType)