This commit is contained in:
wuweihua
2026-09-17 17:58:05 +08:00
7 changed files with 531 additions and 19 deletions
@@ -297,6 +297,12 @@
</el-tag>
</template>
</el-table-column>
<el-table-column label="变动维度" align="center" width="130">
<template #default="scope">
<el-tag v-if="isCreditUsageFlow(scope.row.changeType)" type="warning">授信占用(已用额度)</el-tag>
<el-tag v-else type="primary">授信额度</el-tag>
</template>
</el-table-column>
<el-table-column label="调整方式" align="center" prop="adjustMode" width="90">
<template #default="scope">{{ formatOption(adjustModeOptions, scope.row.adjustMode) }}</template>
</el-table-column>
@@ -307,21 +313,24 @@
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="变动前额度" align="center" prop="beforeAmount" width="110">
<el-table-column label="变动前" align="center" prop="beforeAmount" width="100">
<template #default="scope">{{ formatMoney(scope.row.beforeAmount) }}</template>
</el-table-column>
<el-table-column label="变动额度" align="center" width="110">
<el-table-column label="变动额" align="center" width="100">
<template #default="scope">
<span :class="scope.row.direction === 1 ? 'money-in' : 'money-out'">
{{ scope.row.direction === 1 ? '+' : '-' }}{{ formatMoney(scope.row.changeAmount) }}
</span>
</template>
</el-table-column>
<el-table-column label="变动后额度" align="center" prop="afterAmount" width="110">
<el-table-column label="变动后" align="center" prop="afterAmount" width="100">
<template #default="scope">{{ formatMoney(scope.row.afterAmount) }}</template>
</el-table-column>
<el-table-column label="已用额度" align="center" prop="usedCredit" width="100">
<template #default="scope">{{ formatMoney(scope.row.usedCredit) }}</template>
<el-table-column label="已用额度快照" align="center" prop="usedCredit" width="110">
<template #default="scope">
<span v-if="isCreditUsageFlow(scope.row.changeType)">-</span>
<span v-else>{{ formatMoney(scope.row.usedCredit) }}</span>
</template>
</el-table-column>
<el-table-column label="生效日期" align="center" prop="effectiveDate" width="110">
<template #default="scope">{{ scope.row.effectiveDate || '-' }}</template>
@@ -989,6 +998,14 @@ const adjustModeOptions = [
function creditChangeTag(v) {
return { INIT: '', ADJUST: 'primary', EXPIRE: 'danger', OCCUPY: 'warning', RELEASE: 'success' }[v] || 'info'
}
/**
* 是否为授信占用/释放流水。
* 占用/释放流水的 变动前/变动额/变动后 记的是【已用额度】维度;
* INIT/ADJUST/EXPIRE 流水这三列记的是【授信额度】(信用/临时额度)维度。
*/
function isCreditUsageFlow(changeType) {
return changeType === 'OCCUPY' || changeType === 'RELEASE'
}
function formatMoney(val) {
const num = Number(val)
return isNaN(num) ? '0.00' : num.toFixed(2)