应付配置增加附加费配置,应付账单新增核销、对账、凭证、审核功能
This commit is contained in:
@@ -191,23 +191,11 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="calcRule" label="计费条件" width="140">
|
||||
<template #default="{ row }">
|
||||
<el-select v-if="isRowEditing(row)" v-model="row.calcRule" size="small" placeholder="暂不计费">
|
||||
<el-option v-for="item in calcRules" :key="item.value" :label="item.label" :value="item.value" />
|
||||
<el-select v-if="isRowEditing(row)" :model-value="feeBillFlag(row)" size="small" @change="value => setFeeBill(row, value)">
|
||||
<el-option label="需要计费" value="BILL" />
|
||||
<el-option label="暂不计费" value="MANUAL" />
|
||||
</el-select>
|
||||
<span v-else>{{ calcRuleLabel(row.calcRule) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="calcParam" label="条件参数" min-width="220" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<span v-if="!isRowEditing(row)">{{ feeCondition(row) }}</span>
|
||||
<template v-else>
|
||||
<div v-if="conditionHint(row)" class="pay-cond-hint">{{ conditionHint(row) }}</div>
|
||||
<cell-text
|
||||
v-if="showCalcParamEditor(row)"
|
||||
v-model="row.calcParam"
|
||||
:edit="true"
|
||||
/>
|
||||
</template>
|
||||
<span v-else>{{ feeBillFlag(row) === 'BILL' ? '需要计费' : '暂不计费' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="editable" label="操作" width="120" align="center" fixed="right">
|
||||
@@ -471,50 +459,16 @@ 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: '退件' },
|
||||
{ value: 'MANUAL', label: '暂不计费' }
|
||||
]
|
||||
|
||||
function calcRuleLabel(value) {
|
||||
return calcRules.find(item => item.value === value)?.label || '暂不计费'
|
||||
function feeBillFlag(row) {
|
||||
return row?.calcRule && row.calcRule !== 'MANUAL' ? 'BILL' : 'MANUAL'
|
||||
}
|
||||
|
||||
function conditionHint(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`)
|
||||
function setFeeBill(row, value) {
|
||||
if (value === 'MANUAL') {
|
||||
row.calcRule = 'MANUAL'
|
||||
return
|
||||
}
|
||||
if (row.postcodeParam) {
|
||||
parts.push(`邮编 ${row.postcodeParam}`)
|
||||
}
|
||||
return parts.join(';')
|
||||
}
|
||||
|
||||
function hasCalcParam(row) {
|
||||
const text = String(row?.calcParam ?? '').trim()
|
||||
if (!text) return false
|
||||
return text !== String(row?.postcodeParam ?? '').trim()
|
||||
}
|
||||
|
||||
function showCalcParamEditor(row) {
|
||||
return hasCalcParam(row) || !conditionHint(row)
|
||||
}
|
||||
|
||||
function feeCondition(row) {
|
||||
const parts = []
|
||||
const hint = conditionHint(row)
|
||||
if (hint) parts.push(hint)
|
||||
if (hasCalcParam(row)) parts.push(String(row.calcParam).trim())
|
||||
return parts.join(';') || '-'
|
||||
if (!row.calcRule || row.calcRule === 'MANUAL') row.calcRule = 'ALWAYS'
|
||||
}
|
||||
|
||||
const pageSize = 20
|
||||
|
||||
Reference in New Issue
Block a user