应付计算evri和CTT模板调整计费

This commit is contained in:
liuminghui
2026-11-19 16:49:30 +08:00
parent 43a8bd61e8
commit 908975a7d6
13 changed files with 824 additions and 120 deletions
@@ -36,6 +36,19 @@
<el-table-column prop="zoneName" label="分区" min-width="140" show-overflow-tooltip>
<template #default="{ row }"><cell-text v-model="row.zoneName" :edit="isRowEditing(row)" /></template>
</el-table-column>
<el-table-column prop="calcRule" label="计费条件" width="110" align="center">
<template #default="{ row }">
<el-select v-if="isRowEditing(row)" v-model="row.calcRule" clearable size="small" placeholder="不限">
<el-option label="邮编" value="POSTCODE" />
<el-option label="尺寸" value="SIZE" />
<el-option label="重量" value="WEIGHT" />
</el-select>
<span v-else>{{ bandRuleLabel(row.calcRule) }}</span>
</template>
</el-table-column>
<el-table-column prop="calcParam" label="条件参数" min-width="150" show-overflow-tooltip>
<template #default="{ row }"><cell-text v-model="row.calcParam" :edit="isRowEditing(row)" /></template>
</el-table-column>
<el-table-column prop="weightLabel" label="重量段" min-width="120" show-overflow-tooltip>
<template #default="{ row }"><cell-text v-model="row.weightLabel" :edit="isRowEditing(row)" /></template>
</el-table-column>
@@ -539,7 +552,7 @@ watch(source, (list) => {
}, { immediate: true })
function filteredBands(pane) {
return filterRows(pane.item.weightBands || [], pane.bandKeyword, ['sectionName', 'countryName', 'countryCode', 'zoneName', 'weightLabel', 'chargeName', 'priceUnit'])
return filterRows(pane.item.weightBands || [], pane.bandKeyword, ['sectionName', 'countryName', 'countryCode', 'zoneName', 'calcRule', 'calcParam', 'weightLabel', 'chargeName', 'priceUnit'])
}
function filteredFees(pane) {
@@ -718,6 +731,14 @@ function filterRows(rows, keyword, fields) {
return rows.filter(row => fields.some(field => String(row?.[field] ?? '').toLowerCase().includes(text)))
}
function bandRuleLabel(rule) {
const value = String(rule || '').toUpperCase()
if (value === 'POSTCODE') return '邮编'
if (value === 'SIZE') return '尺寸'
if (value === 'WEIGHT') return '重量'
return ''
}
function pageOf(rows, pageNo) {
const start = (pageNo - 1) * pageSize
return rows.slice(start, start + pageSize)