客户余额,额度记录流水
This commit is contained in:
@@ -58,3 +58,21 @@ export function listFlow(query) {
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
/** 查询额度流水列表 */
|
||||
export function listCreditFlow(query) {
|
||||
return request({
|
||||
url: '/customersupplier/customermoney/credit/flow/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
/** 调整客户额度(信用额度/临时额度),调整过程留额度流水 */
|
||||
export function adjustCredit(data) {
|
||||
return request({
|
||||
url: '/customersupplier/customermoney/credit/adjust',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -108,7 +108,11 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="临时额度" prop="tempEd">
|
||||
<el-input v-model="form.tempEd" placeholder="请输入临时额度" />
|
||||
<el-input v-model="form.tempEd" :disabled="!isAdd" placeholder="请输入临时额度">
|
||||
<template #append v-if="!isAdd">
|
||||
<span style="color: #e6a23c">请在客户余额-额度管理中调整</span>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -130,7 +134,11 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="信用额度" prop="creditEd">
|
||||
<el-input v-model="form.creditEd" placeholder="请输入信用额度" />
|
||||
<el-input v-model="form.creditEd" :disabled="!isAdd" placeholder="请输入信用额度">
|
||||
<template #append v-if="!isAdd">
|
||||
<span style="color: #e6a23c">请在客户余额-额度管理中调整</span>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
@@ -630,7 +638,7 @@ function buildEmptyForm() {
|
||||
foreignCurrencyBalance: null,
|
||||
weightThreshold: null,
|
||||
throwRatio: null,
|
||||
creditEd: null,
|
||||
creditEd: 1000,
|
||||
productIds: null,
|
||||
attachmentList: [],
|
||||
companyList: [],
|
||||
|
||||
+453
-4
@@ -11,6 +11,12 @@
|
||||
<div class="head-code">客户编码:{{ customer.customerCode || route.query.customerCode || '-' }}</div>
|
||||
<div class="head-right">
|
||||
<el-tag type="success" size="small">本位币账户 CNY</el-tag>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="Money"
|
||||
@click="openAdjustDialog()"
|
||||
v-hasPermi="['customer:credit:adjust']"
|
||||
>额度调整</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
@@ -31,14 +37,23 @@
|
||||
</el-col>
|
||||
<el-col :xs="12" :sm="8" :md="4">
|
||||
<el-card shadow="hover" class="balance-card">
|
||||
<div class="balance-label">总额度</div>
|
||||
<div class="balance-label">
|
||||
总额度
|
||||
<el-button link type="primary" size="small" @click="openAdjustDialog('CREDIT')"
|
||||
v-hasPermi="['customer:credit:adjust']">调整</el-button>
|
||||
</div>
|
||||
<div class="balance-value">{{ formatMoney(currentAccount.totalCredit) }}</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :xs="12" :sm="8" :md="4">
|
||||
<el-card shadow="hover" class="balance-card">
|
||||
<div class="balance-label">额外额度</div>
|
||||
<div class="balance-label">
|
||||
额外额度
|
||||
<el-button link type="primary" size="small" @click="openAdjustDialog('TEMP')"
|
||||
v-hasPermi="['customer:credit:adjust']">调整</el-button>
|
||||
</div>
|
||||
<div class="balance-value">{{ formatMoney(currentAccount.extraCredit) }}</div>
|
||||
<div class="balance-sub">{{ tempCreditPeriodText }}</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :xs="12" :sm="8" :md="4">
|
||||
@@ -225,6 +240,100 @@
|
||||
@pagination="getFlowList"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
|
||||
<!-- ====== 额度流水 ====== -->
|
||||
<el-tab-pane label="额度流水" name="creditFlow">
|
||||
<el-form :model="creditFlowQuery" :inline="true" class="search-form">
|
||||
<el-form-item label="额度类型" prop="creditType">
|
||||
<el-select v-model="creditFlowQuery.creditType" placeholder="全部" clearable style="width: 130px;">
|
||||
<el-option v-for="opt in creditTypeOptions" :key="opt.value" :label="opt.label" :value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="变动类型" prop="changeType">
|
||||
<el-select v-model="creditFlowQuery.changeType" placeholder="全部" clearable style="width: 130px;">
|
||||
<el-option v-for="opt in creditChangeTypeOptions" :key="opt.value" :label="opt.label" :value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="日期">
|
||||
<el-date-picker
|
||||
v-model="creditFlowDateRange"
|
||||
value-format="YYYY-MM-DD"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="getCreditFlowList">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetCreditFlowQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table :data="creditFlowList" border v-loading="creditFlowLoading">
|
||||
<el-table-column label="流水号" align="center" prop="flowNo" width="190" />
|
||||
<el-table-column label="时间" align="center" prop="createTime" width="160">
|
||||
<template #default="scope">{{ formatDateTime(scope.row.createTime) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="额度类型" align="center" prop="creditType" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.creditType === 'TEMP' ? 'warning' : ''">
|
||||
{{ formatOption(creditTypeOptions, scope.row.creditType) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="变动类型" align="center" prop="changeType" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag :type="creditChangeTag(scope.row.changeType)">
|
||||
{{ formatOption(creditChangeTypeOptions, scope.row.changeType) }}
|
||||
</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>
|
||||
<el-table-column label="方向" align="center" width="80">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.direction === 1" type="success">增加</el-tag>
|
||||
<el-tag v-else-if="scope.row.direction === -1" type="danger">减少</el-tag>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="变动前额度" align="center" prop="beforeAmount" width="110">
|
||||
<template #default="scope">{{ formatMoney(scope.row.beforeAmount) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="变动额度" align="center" width="110">
|
||||
<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">
|
||||
<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>
|
||||
<el-table-column label="生效日期" align="center" prop="effectiveDate" width="110">
|
||||
<template #default="scope">{{ scope.row.effectiveDate || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="失效日期" align="center" prop="expireDate" width="110">
|
||||
<template #default="scope">{{ scope.row.expireDate || '长期' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="调整原因" align="center" prop="reason" show-overflow-tooltip min-width="160" />
|
||||
<el-table-column label="操作人" align="center" prop="createBy" width="100" />
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip min-width="160" />
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="creditFlowTotal > 0"
|
||||
:total="creditFlowTotal"
|
||||
v-model:page="creditFlowQuery.pageNum"
|
||||
v-model:limit="creditFlowQuery.pageSize"
|
||||
@pagination="getCreditFlowList"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
|
||||
@@ -402,6 +511,114 @@
|
||||
<el-button @click="viewDialog.visible = false">关 闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- ====== 额度调整弹窗 ====== -->
|
||||
<el-dialog
|
||||
:title="creditDialog.form.creditType === 'TEMP' ? '临时额度调整' : '信用额度调整'"
|
||||
v-model="creditDialog.visible"
|
||||
width="600px"
|
||||
append-to-body
|
||||
@closed="resetCreditForm"
|
||||
>
|
||||
<el-alert type="info" :closable="false" class="credit-tip">
|
||||
<div>当前{{ creditDialog.form.creditType === 'TEMP' ? '临时额度' : '信用额度' }}:
|
||||
<b>{{ formatMoney(creditBefore) }}</b>,已用额度:<b>{{ formatMoney(currentAccount.usedCredit) }}</b></div>
|
||||
</el-alert>
|
||||
<el-form ref="creditFormRef" :model="creditDialog.form" :rules="creditRules" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="额度类型" prop="creditType">
|
||||
<el-radio-group v-model="creditDialog.form.creditType" @change="onCreditTypeChange">
|
||||
<el-radio value="CREDIT">信用额度(长期)</el-radio>
|
||||
<el-radio value="TEMP">临时额度</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="调整方式" prop="adjustMode">
|
||||
<el-radio-group v-model="creditDialog.form.adjustMode">
|
||||
<el-radio value="SET">设置为</el-radio>
|
||||
<el-radio value="ADD">增加</el-radio>
|
||||
<el-radio value="SUB">减少</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="调整金额" prop="changeAmount">
|
||||
<el-input-number
|
||||
v-model="creditDialog.form.changeAmount"
|
||||
:precision="2"
|
||||
:step="1000"
|
||||
:min="0.01"
|
||||
controls-position="right"
|
||||
style="width: 100%;"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<template v-if="creditDialog.form.creditType === 'TEMP'">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="生效日期" prop="effectiveDate">
|
||||
<el-date-picker
|
||||
v-model="creditDialog.form.effectiveDate"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="默认今天"
|
||||
:disabled-date="afterToday"
|
||||
style="width: 100%;"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="失效日期" prop="expireDate">
|
||||
<el-date-picker
|
||||
v-model="creditDialog.form.expireDate"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="不填为长期有效"
|
||||
style="width: 100%;"
|
||||
/>
|
||||
<div class="rate-tip">失效日当天仍有效,次日访问账户时自动清零并记到期流水</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="调整原因" prop="reason">
|
||||
<el-input
|
||||
v-model="creditDialog.form.reason"
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
maxlength="255"
|
||||
show-word-limit
|
||||
placeholder="请必填,例如:客户旺季临时授信 / 年审调整长期额度"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<div class="credit-preview">
|
||||
<div>调整后{{ creditDialog.form.creditType === 'TEMP' ? '临时额度' : '信用额度' }}:
|
||||
<b :class="creditAfter < 0 ? 'money-out' : 'money-in'">{{ formatMoney(creditAfter) }}</b>
|
||||
</div>
|
||||
<div>调整后授信总额:<b>{{ formatMoney(totalCreditAfter) }}</b>
|
||||
(可用 = 授信总额 - 已用 {{ formatMoney(currentAccount.usedCredit) }})</div>
|
||||
<el-alert
|
||||
v-if="creditAfter < 0"
|
||||
type="error" :closable="false"
|
||||
title="调整后额度不能为负数" class="credit-alert"
|
||||
/>
|
||||
<el-alert
|
||||
v-else-if="totalCreditAfter < (Number(currentAccount.usedCredit) || 0)"
|
||||
type="error" :closable="false"
|
||||
title="授信总额不能小于已用额度" class="credit-alert"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<el-button type="primary" :loading="creditSubmitLoading" @click="submitAdjustCredit">确 定</el-button>
|
||||
<el-button @click="creditDialog.visible = false">取 消</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -409,11 +626,12 @@
|
||||
import axios from 'axios'
|
||||
import { saveAs } from 'file-saver'
|
||||
import { getCustomer } from "@/api/customersuppliermanagement/customerinfo/customer.js"
|
||||
import { listAccount, listReceipt, getReceipt, addReceipt, confirmReceipt, cancelReceipt, listFlow } from "@/api/customersuppliermanagement/customermoney/customermoney.js"
|
||||
import { listAccount, listReceipt, getReceipt, addReceipt, confirmReceipt, cancelReceipt, listFlow, listCreditFlow, adjustCredit } from "@/api/customersuppliermanagement/customermoney/customermoney.js"
|
||||
import { convertToBase } from "@/api/data/exchangeRate"
|
||||
import { getToken } from "@/utils/auth"
|
||||
|
||||
import { useRoute } from 'vue-router'
|
||||
import { nextTick } from 'vue'
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
@@ -472,9 +690,28 @@ function receiptTypeTag(v) {
|
||||
function receiptStatusTag(v) {
|
||||
return { PENDING: 'warning', CONFIRMED: 'success', CANCELLED: 'danger' }[v] || 'info'
|
||||
}
|
||||
function bizTypeTag(v) {
|
||||
const bizTypeTag = function(v) {
|
||||
return { RECEIPT: 'success', BILL_PAY: 'danger', REFUND: 'warning', ADJUST: 'info', FREEZE: 'info', UNFREEZE: '' }[v] || 'info'
|
||||
}
|
||||
|
||||
/* ================= 额度相关枚举 ================= */
|
||||
const creditTypeOptions = [
|
||||
{ value: 'CREDIT', label: '信用额度' },
|
||||
{ value: 'TEMP', label: '临时额度' }
|
||||
]
|
||||
const creditChangeTypeOptions = [
|
||||
{ value: 'INIT', label: '初始化' },
|
||||
{ value: 'ADJUST', label: '手工调整' },
|
||||
{ value: 'EXPIRE', label: '到期失效' }
|
||||
]
|
||||
const adjustModeOptions = [
|
||||
{ value: 'SET', label: '设置为' },
|
||||
{ value: 'ADD', label: '增加' },
|
||||
{ value: 'SUB', label: '减少' }
|
||||
]
|
||||
function creditChangeTag(v) {
|
||||
return { INIT: '', ADJUST: 'primary', EXPIRE: 'danger' }[v] || 'info'
|
||||
}
|
||||
function formatMoney(val) {
|
||||
const num = Number(val)
|
||||
return isNaN(num) ? '0.00' : num.toFixed(2)
|
||||
@@ -506,6 +743,152 @@ const availableCredit = computed(() => {
|
||||
return formatMoney(total + extra - used)
|
||||
})
|
||||
|
||||
/** 临时额度有效期文案 */
|
||||
const tempCreditPeriodText = computed(() => {
|
||||
const a = currentAccount.value
|
||||
const extra = Number(a.extraCredit) || 0
|
||||
if (extra <= 0) return ''
|
||||
if (!a.extraExpireDate) return '长期有效'
|
||||
const today = proxy.parseTime(new Date(), '{y}-{m}-{d}')
|
||||
if (a.extraExpireDate < today) return '已过期'
|
||||
return '有效期至 ' + a.extraExpireDate
|
||||
})
|
||||
|
||||
/* ============ 额度调整弹窗 ============ */
|
||||
const creditFormRef = ref(null)
|
||||
const creditSubmitLoading = ref(false)
|
||||
const creditDialog = reactive({
|
||||
visible: false,
|
||||
form: {}
|
||||
})
|
||||
const creditRules = {
|
||||
creditType: [{ required: true, message: '请选择额度类型', trigger: 'change' }],
|
||||
adjustMode: [{ required: true, message: '请选择调整方式', trigger: 'change' }],
|
||||
changeAmount: [{ required: true, message: '调整金额必须大于0', trigger: 'blur' }],
|
||||
reason: [{ required: true, message: '请填写调整原因', trigger: 'blur' }]
|
||||
}
|
||||
|
||||
/** 禁止选择晚于今天的日期(不允许预约未来生效) */
|
||||
function afterToday(date) {
|
||||
const today = new Date()
|
||||
today.setHours(23, 59, 59, 999)
|
||||
return date.getTime() > today.getTime()
|
||||
}
|
||||
|
||||
function defaultCreditForm(creditType) {
|
||||
return {
|
||||
customerId: route.query.customerId || null,
|
||||
creditType: creditType || 'CREDIT',
|
||||
adjustMode: 'ADD',
|
||||
changeAmount: null,
|
||||
reason: '',
|
||||
effectiveDate: proxy.parseTime(new Date(), '{y}-{m}-{d}'),
|
||||
expireDate: ''
|
||||
}
|
||||
}
|
||||
|
||||
function openAdjustDialog(creditType) {
|
||||
const customerId = Number(route.query.customerId)
|
||||
if (!customerId) {
|
||||
proxy.$modal.msgError('缺少客户ID,请从客户列表进入客户余额页')
|
||||
return
|
||||
}
|
||||
resetCreditForm()
|
||||
creditDialog.form = defaultCreditForm(creditType)
|
||||
creditDialog.visible = true
|
||||
}
|
||||
|
||||
function resetCreditForm() {
|
||||
creditDialog.form = defaultCreditForm()
|
||||
proxy.resetForm('creditFormRef')
|
||||
}
|
||||
|
||||
/** 切换额度类型:清掉校验红框,临时额度默认生效日为今天 */
|
||||
function onCreditTypeChange() {
|
||||
creditDialog.form.changeAmount = null
|
||||
if (creditDialog.form.creditType === 'TEMP' && !creditDialog.form.effectiveDate) {
|
||||
creditDialog.form.effectiveDate = proxy.parseTime(new Date(), '{y}-{m}-{d}')
|
||||
}
|
||||
nextTick(() => proxy.clearValidate('creditFormRef'))
|
||||
}
|
||||
|
||||
/** 当前被调整额度(调整前) */
|
||||
const creditBefore = computed(() => {
|
||||
const a = currentAccount.value
|
||||
return Number(creditDialog.form.creditType === 'TEMP' ? a.extraCredit : a.totalCredit) || 0
|
||||
})
|
||||
|
||||
/** 调整后被调额度 */
|
||||
const creditAfter = computed(() => {
|
||||
const input = Number(creditDialog.form.changeAmount) || 0
|
||||
const mode = creditDialog.form.adjustMode
|
||||
if (mode === 'SET') return input
|
||||
return mode === 'SUB' ? creditBefore.value - input : creditBefore.value + input
|
||||
})
|
||||
|
||||
/** 调整后授信总额(信用+临时) */
|
||||
const totalCreditAfter = computed(() => {
|
||||
const a = currentAccount.value
|
||||
const other = Number(creditDialog.form.creditType === 'TEMP' ? a.totalCredit : a.extraCredit) || 0
|
||||
return other + creditAfter.value
|
||||
})
|
||||
|
||||
function submitAdjustCredit() {
|
||||
creditFormRef.value.validate(valid => {
|
||||
if (!valid) return
|
||||
const f = creditDialog.form
|
||||
const amount = Number(f.changeAmount)
|
||||
if (!(amount > 0)) {
|
||||
proxy.$modal.msgError('调整金额必须大于0')
|
||||
return
|
||||
}
|
||||
if (f.creditType === 'TEMP') {
|
||||
if (f.expireDate && f.effectiveDate && f.expireDate <= f.effectiveDate) {
|
||||
proxy.$modal.msgError('失效日期必须晚于生效日期')
|
||||
return
|
||||
}
|
||||
}
|
||||
if (creditAfter.value < 0) {
|
||||
proxy.$modal.msgError('调整后额度不能为负数')
|
||||
return
|
||||
}
|
||||
const used = Number(currentAccount.value.usedCredit) || 0
|
||||
if (totalCreditAfter.value < used) {
|
||||
proxy.$modal.msgError('调整后授信总额不能小于已用额度 ' + formatMoney(used))
|
||||
return
|
||||
}
|
||||
if (creditAfter.value === creditBefore.value) {
|
||||
proxy.$modal.msgError('额度未发生变化,无需调整')
|
||||
return
|
||||
}
|
||||
const payload = {
|
||||
customerId: Number(f.customerId) || Number(route.query.customerId) || null,
|
||||
creditType: f.creditType,
|
||||
adjustMode: f.adjustMode,
|
||||
changeAmount: amount,
|
||||
reason: f.reason
|
||||
}
|
||||
if (!payload.customerId) {
|
||||
proxy.$modal.msgError('缺少客户ID,请从客户列表进入客户余额页')
|
||||
return
|
||||
}
|
||||
if (f.creditType === 'TEMP') {
|
||||
payload.effectiveDate = f.effectiveDate || null
|
||||
payload.expireDate = f.expireDate || null
|
||||
}
|
||||
creditSubmitLoading.value = true
|
||||
adjustCredit(payload).then(() => {
|
||||
proxy.$modal.msgSuccess('额度调整成功')
|
||||
creditDialog.visible = false
|
||||
loadCustomer()
|
||||
loadAccounts()
|
||||
getCreditFlowList()
|
||||
}).finally(() => {
|
||||
creditSubmitLoading.value = false
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function loadCustomer() {
|
||||
const customerId = route.query.customerId
|
||||
if (!customerId) return
|
||||
@@ -752,6 +1135,38 @@ function resetFlowQuery() {
|
||||
getFlowList()
|
||||
}
|
||||
|
||||
/* ================= 额度流水 ================= */
|
||||
const creditFlowList = ref([])
|
||||
const creditFlowTotal = ref(0)
|
||||
const creditFlowLoading = ref(false)
|
||||
const creditFlowDateRange = ref([])
|
||||
const creditFlowQuery = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
customerId: route.query.customerId,
|
||||
creditType: '',
|
||||
changeType: ''
|
||||
})
|
||||
|
||||
function getCreditFlowList() {
|
||||
creditFlowLoading.value = true
|
||||
const params = proxy.addDateRange({ ...creditFlowQuery }, creditFlowDateRange.value)
|
||||
listCreditFlow(params).then(res => {
|
||||
creditFlowList.value = res.rows || []
|
||||
creditFlowTotal.value = res.total || 0
|
||||
}).finally(() => {
|
||||
creditFlowLoading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
function resetCreditFlowQuery() {
|
||||
creditFlowQuery.creditType = ''
|
||||
creditFlowQuery.changeType = ''
|
||||
creditFlowDateRange.value = []
|
||||
creditFlowQuery.pageNum = 1
|
||||
getCreditFlowList()
|
||||
}
|
||||
|
||||
/* ================= 附件上传 ================= */
|
||||
const uploadFileUrl = ref(baseUrl + "/common/upload")
|
||||
const uploadHeaders = ref({ Authorization: "Bearer " + getToken() })
|
||||
@@ -848,6 +1263,8 @@ function initPage() {
|
||||
viewDialog.attachments = []
|
||||
receiptDateRange.value = []
|
||||
flowDateRange.value = []
|
||||
creditFlowDateRange.value = []
|
||||
creditDialog.visible = false
|
||||
receiptQuery.customerId = customerId
|
||||
receiptQuery.receiptType = ''
|
||||
receiptQuery.status = ''
|
||||
@@ -856,15 +1273,22 @@ function initPage() {
|
||||
flowQuery.bizType = ''
|
||||
flowQuery.direction = ''
|
||||
flowQuery.pageNum = 1
|
||||
creditFlowQuery.customerId = customerId
|
||||
creditFlowQuery.creditType = ''
|
||||
creditFlowQuery.changeType = ''
|
||||
creditFlowQuery.pageNum = 1
|
||||
receiptList.value = []
|
||||
receiptTotal.value = 0
|
||||
flowList.value = []
|
||||
flowTotal.value = 0
|
||||
creditFlowList.value = []
|
||||
creditFlowTotal.value = 0
|
||||
if (!customerId) return
|
||||
loadCustomer()
|
||||
loadAccounts()
|
||||
getReceiptList()
|
||||
getFlowList()
|
||||
getCreditFlowList()
|
||||
}
|
||||
|
||||
onMounted(initPage)
|
||||
@@ -916,6 +1340,31 @@ watch(() => route.query.customerId, (newId, oldId) => {
|
||||
color: var(--el-text-color-secondary);
|
||||
font-size: 13px;
|
||||
margin-bottom: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 4px;
|
||||
}
|
||||
.balance-sub {
|
||||
margin-top: 6px;
|
||||
font-size: 12px;
|
||||
color: var(--el-text-color-secondary);
|
||||
min-height: 16px;
|
||||
}
|
||||
.credit-tip {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
.credit-preview {
|
||||
margin-top: 4px;
|
||||
padding: 10px 14px;
|
||||
background: var(--el-fill-color-light);
|
||||
border-radius: 4px;
|
||||
font-size: 13px;
|
||||
line-height: 1.8;
|
||||
}
|
||||
.credit-alert {
|
||||
margin-top: 8px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.balance-value {
|
||||
font-size: 22px;
|
||||
|
||||
Reference in New Issue
Block a user