应付配置的附加费配置完善
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
:search-per-row="4"
|
||||
search-action-align="right"
|
||||
row-key="productId"
|
||||
scrollbar-always-on
|
||||
>
|
||||
<template #toolbar="{ selection, ids }">
|
||||
<el-col :span="1.5">
|
||||
@@ -87,31 +88,34 @@
|
||||
<el-table-column label="生效结束" width="110" align="center">
|
||||
<template #default="{ row }">{{ dayText(row.effectiveEnd) || '不限' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-switch
|
||||
v-if="row.termId"
|
||||
:model-value="row.status === '1' ? '1' : '2'"
|
||||
active-value="1"
|
||||
inactive-value="2"
|
||||
inline-prompt
|
||||
active-text="生效"
|
||||
inactive-text="失效"
|
||||
@change="(val) => changeStatus(row, 'status', val)"
|
||||
v-hasPermi="['price:pay:edit']"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="210" align="center">
|
||||
<el-table-column label="操作" width="220" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button link type="primary" @click="downloadSource(row)" v-hasPermi="['price:pay:query']">下载</el-button>
|
||||
<el-button link type="primary" @click="openTermDialog(row)" v-hasPermi="['price:pay:edit']">修改有效期</el-button>
|
||||
<el-button link type="primary" @click="openRuleLog(row)" v-hasPermi="['price:pay:query']">附加费记录</el-button>
|
||||
<el-button link type="primary" @click="openDetail(row)" v-hasPermi="['price:pay:query']">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-drawer>
|
||||
|
||||
<el-dialog v-model="ruleLogVisible" :title="ruleLogTitle" width="860px" append-to-body>
|
||||
<el-table v-loading="ruleLogLoading" :data="ruleLogRows" border size="small" empty-text="这一版还没有附加费配置记录">
|
||||
<el-table-column label="操作" width="70" align="center">
|
||||
<template #default="{ row }">{{ ruleLogAction(row.operationType) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更改前" min-width="220" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ ruleLogSide(row, 'before') }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更改后" min-width="220" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ ruleLogSide(row, 'after') }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createBy" label="操作人" width="100" align="center" />
|
||||
<el-table-column label="操作时间" width="160" align="center">
|
||||
<template #default="{ row }">{{ row.createTime || '-' }}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-model="termVisible" title="修改有效期" width="460px" append-to-body>
|
||||
<el-form label-width="90px">
|
||||
<el-form-item label="生效开始" required>
|
||||
@@ -188,7 +192,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="PricePay">
|
||||
import { listPay, getPay, delPay, updatePay, listPayTerm, updatePayTerm, changePayTermStatus, comparePay } from '@/api/price/pay'
|
||||
import { listPay, getPay, delPay, updatePay, listPayTerm, updatePayTerm, changePayTermStatus, comparePay, listPaySurchargeRuleLog } from '@/api/price/pay'
|
||||
import PayImportDialog from './components/PayImportDialog.vue'
|
||||
import PayConfigDetail from './components/PayConfigDetail.vue'
|
||||
import PaySurchargeRuleDialog from './components/PaySurchargeRuleDialog.vue'
|
||||
@@ -207,6 +211,10 @@ const historyRows = ref([])
|
||||
const historyTitle = ref('价格版本')
|
||||
const historyProductId = ref(null)
|
||||
const historyPicked = ref([])
|
||||
const ruleLogVisible = ref(false)
|
||||
const ruleLogLoading = ref(false)
|
||||
const ruleLogRows = ref([])
|
||||
const ruleLogTitle = ref('附加费配置记录')
|
||||
const compareVisible = ref(false)
|
||||
const compareLoading = ref(false)
|
||||
const compareTitle = ref('版本比对')
|
||||
@@ -233,8 +241,7 @@ const statusOptions = [
|
||||
]
|
||||
|
||||
const columns = [
|
||||
{ label: '产品编号', prop: 'productId', align: 'center', width: 90 },
|
||||
{ label: '产品名称', prop: 'productName', align: 'center', minWidth: 150, showOverflowTooltip: true },
|
||||
{ label: '产品名称', prop: 'productName', align: 'center', minWidth: 180, showOverflowTooltip: true, fixed: 'left' },
|
||||
{ label: '价卡归属', prop: 'supplierName', align: 'center', width: 100 },
|
||||
{ label: '国家/口岸', prop: 'countryScope', align: 'center', minWidth: 120, showOverflowTooltip: true },
|
||||
{ label: '费用类型', prop: 'chargeType', align: 'center', width: 110 },
|
||||
@@ -384,9 +391,43 @@ function termText(row) {
|
||||
return `${start || '不限'} 至 ${end || '不限'}`
|
||||
}
|
||||
|
||||
function openRuleLog(row) {
|
||||
ruleLogTitle.value = `${row.productName || '产品'} 第 ${row.versionNo || '-'} 版的附加费配置记录`
|
||||
ruleLogRows.value = []
|
||||
ruleLogVisible.value = true
|
||||
ruleLogLoading.value = true
|
||||
listPaySurchargeRuleLog(row.productId, row.termId).then(res => {
|
||||
ruleLogRows.value = res.data || []
|
||||
}).finally(() => {
|
||||
ruleLogLoading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
function ruleLogAction(type) {
|
||||
if (type === '1') return '新增'
|
||||
if (type === '2') return '修改'
|
||||
if (type === '3') return '删除'
|
||||
return '-'
|
||||
}
|
||||
|
||||
function ruleLogSide(row, side) {
|
||||
let content = row.changeContent
|
||||
if (typeof content === 'string') {
|
||||
try {
|
||||
content = JSON.parse(content)
|
||||
} catch (error) {
|
||||
return side === 'after' ? content : '-'
|
||||
}
|
||||
}
|
||||
const values = content?.[side]
|
||||
if (!values || typeof values !== 'object') return '-'
|
||||
const text = Object.entries(values).map(([label, value]) => `${label}:${value}`).join(';')
|
||||
return text || '-'
|
||||
}
|
||||
|
||||
function openHistory(row) {
|
||||
historyProductId.value = row.productId
|
||||
historyTitle.value = `${row.productName || '产品'}(编号 ${row.productId})的价格版本`
|
||||
historyTitle.value = `${row.productName || '产品'}的价格版本`
|
||||
historyPicked.value = []
|
||||
historyVisible.value = true
|
||||
loadHistory()
|
||||
|
||||
Reference in New Issue
Block a user