应付计算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)
@@ -66,6 +66,18 @@
<el-table-column label="分区" min-width="120">
<template #default="{ row }"><el-input v-model="row.zoneName" size="small" placeholder="不分区可空" /></template>
</el-table-column>
<el-table-column label="计费条件" width="110">
<template #default="{ row }">
<el-select 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>
</template>
</el-table-column>
<el-table-column label="条件参数" min-width="160">
<template #default="{ row }"><el-input v-model="row.calcParam" size="small" placeholder="07 / side:80 / 30" /></template>
</el-table-column>
<el-table-column v-if="form.chargeType !== 'EXTRA'" label="重量下限KG" width="120">
<template #default="{ row }"><el-input v-model="row.weightMin" size="small" /></template>
</el-table-column>
@@ -186,7 +198,7 @@ function onMode() {
}
function blankRow() {
return { countryName: '', countryCode: '', zoneName: '', weightMin: '0', weightMax: '', price: '', extraPrice: '' }
return { countryName: '', countryCode: '', zoneName: '', calcRule: '', calcParam: '', weightMin: '0', weightMax: '', price: '', extraPrice: '' }
}
function addRow() {
@@ -235,6 +247,8 @@ async function submit() {
countryName: row.countryName,
countryCode: row.countryCode,
zoneName: row.zoneName,
calcRule: row.calcRule,
calcParam: row.calcParam,
weightMin: 0,
weightMax: firstKg,
price
@@ -253,6 +267,8 @@ async function submit() {
countryName: row.countryName,
countryCode: row.countryCode,
zoneName: row.zoneName,
calcRule: row.calcRule,
calcParam: row.calcParam,
weightMin: min,
weightMax: max,
price