修改附加费

This commit is contained in:
wuweihua
2026-09-22 10:40:13 +08:00
parent 465b3e6b6b
commit c860d1666d
8 changed files with 192 additions and 46 deletions
@@ -73,7 +73,7 @@
</el-table-column>
<el-table-column :label="colSurcharge" width="110" align="center">
<template #default="{ row }">
<surcharge-count-cell :list="row.surcharges || []" @click="pickSurcharge(row)" />
<surcharge-count-cell :list="row.surcharges || []" @remove="s => removeSurcharge(row, s)" />
</template>
</el-table-column>
<el-table-column :label="colAction" width="90" align="center">
@@ -97,7 +97,7 @@ const props = defineProps({
productName: { type: String, default: '' },
rows: { type: Array, default: () => [] }
})
const emit = defineEmits(['update:modelValue', 'pick-surcharge', 'row-change'])
const emit = defineEmits(['update:modelValue', 'pick-surcharge', 'row-change', 'surcharge-change'])
const { proxy } = getCurrentInstance()
@@ -187,6 +187,14 @@ function pickSurcharge(row) {
emit('pick-surcharge', row || null)
}
function removeSurcharge(row, sc) {
if (!row || !sc || sc.scId == null) return
const scId = String(sc.scId)
const next = (row.surcharges || []).filter(s => s && String(s.scId) !== scId)
row.surcharges = next
emit('surcharge-change', row)
}
function countryKey(row) {
return String(row.countryCode || row.countryName || '').toUpperCase()
}