偏远地区邮编判断调整

This commit is contained in:
liuminghui
2026-11-09 15:58:27 +08:00
parent 9220696519
commit b8b943ef51
26 changed files with 1431 additions and 60 deletions
@@ -117,8 +117,11 @@
<span v-else>{{ calcRuleLabel(row.calcRule) }}</span>
</template>
</el-table-column>
<el-table-column prop="calcParam" label="条件参数" min-width="180" show-overflow-tooltip>
<template #default="{ row }"><cell-text v-model="row.calcParam" :edit="editable" /></template>
<el-table-column prop="calcParam" label="条件参数" min-width="220" show-overflow-tooltip>
<template #default="{ row }">
<div>{{ feeCondition(row) }}</div>
<cell-text v-if="editable" v-model="row.calcParam" :edit="editable" />
</template>
</el-table-column>
<el-table-column v-if="editable" label="操作" width="70" align="center">
<template #default="{ row }">
@@ -195,6 +198,8 @@ const CellText = {
const calcRules = [
{ value: 'ALWAYS', label: '每票都收' },
{ value: 'POSTCODE', label: '命中邮编' },
{ value: 'ZONE', label: '命中分区' },
{ value: 'EXTRA_KG', label: '超重续收' },
{ value: 'WEIGHT', label: '超重' },
{ value: 'SIZE', label: '超尺寸' },
{ value: 'RETURN', label: '退件' },
@@ -205,6 +210,22 @@ function calcRuleLabel(value) {
return calcRules.find(item => item.value === value)?.label || '人工确认'
}
function feeCondition(row) {
const parts = []
const hasMin = row.weightMin != null && row.weightMin !== ''
const hasMax = row.weightMax != null && row.weightMax !== ''
if (hasMin || hasMax) {
parts.push(`${hasMin ? row.weightMin : ''}-${hasMax ? row.weightMax : ''}kg`)
}
if (row.postcodeParam) {
parts.push(`邮编 ${row.postcodeParam}`)
}
if (row.calcParam && row.calcParam !== row.postcodeParam) {
parts.push(String(row.calcParam))
}
return parts.join(';') || '-'
}
const pageSize = 20
const panes = ref([])
@@ -229,7 +250,7 @@ function filteredBands(pane) {
}
function filteredFees(pane) {
return filterRows(pane.item.surcharges || [], pane.feeKeyword, ['feeName', 'zoneName', 'chargeText', 'amount', 'currency', 'priceUnit', 'feeDesc', 'calcRule', 'calcParam'])
return filterRows(pane.item.surcharges || [], pane.feeKeyword, ['feeName', 'zoneName', 'chargeText', 'amount', 'currency', 'priceUnit', 'feeDesc', 'calcRule', 'calcParam', 'postcodeParam'])
}
function addBand(pane) {