登记收款加银行账户,允许额度欠费。

This commit is contained in:
luojiaquan
2026-09-20 17:57:10 +08:00
parent 85b37bc07e
commit 3a5b810991
15 changed files with 237 additions and 40 deletions
+10
View File
@@ -0,0 +1,10 @@
import request from '@/utils/request'
// 公司收款银行账户(登记收款下拉选择)
export function listBankAccountOptions(currency) {
return request({
url: '/ar/bank-account/options',
method: 'get',
params: currency ? { currency } : {}
})
}
@@ -506,8 +506,8 @@
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="营业执照" prop="businessLicenseOssId">
<image-upload v-model="companyForm.businessLicenseOssId" :limit="1" :size="5" />
<el-form-item label="营业执照" prop="businessLicenseUrl">
<image-upload v-model="companyForm.businessLicenseUrl" :limit="1" :size="5" />
</el-form-item>
</el-col>
<el-col :span="24">
@@ -1029,7 +1029,7 @@ function resetCompanyForm() {
registeredCity: '',
registeredDistrict: '',
registeredAddressDetail: '',
businessLicenseOssId: null,
businessLicenseUrl: '',
attachmentIds: '',
remark: ''
}
@@ -73,7 +73,7 @@
<div class="balance-label">可用额度</div>
<div class="balance-value" :class="availableOverLimit ? 'danger' : 'success'">{{ availableCredit }}</div>
<div class="balance-sub" v-if="availableOverLimit" style="color: var(--el-color-danger);">
已超额,回款核销后恢复
已超额,可继续计费,请及时催收回款
</div>
</el-card>
</el-col>
@@ -152,6 +152,14 @@
<el-table-column label="收款方式" align="center" prop="payMethod" width="110">
<template #default="scope">{{ formatOption(payMethodOptions, scope.row.payMethod) }}</template>
</el-table-column>
<el-table-column label="收款银行账户" align="center" width="220" show-overflow-tooltip>
<template #default="scope">
<span v-if="scope.row.bankAccountId">
{{ scope.row.bankName || '-' }} {{ scope.row.bankAccountNo || '' }}
</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="银行/平台流水号" align="center" prop="bankTransactionNo" width="170" show-overflow-tooltip />
<el-table-column label="状态" align="center" prop="status" width="90">
<template #default="scope">
@@ -637,6 +645,26 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="收款银行账户" prop="bankAccountId">
<el-select
v-model="receiptDialog.form.bankAccountId"
placeholder="请选择收款银行账户"
style="width: 100%;"
filterable
clearable
:loading="bankAccountLoading"
@change="handleBankAccountChange"
>
<el-option
v-for="acc in bankAccountOptions"
:key="acc.bankAccountId"
:label="`${acc.bankName} ${acc.accountNo}(${acc.accountName})`"
:value="acc.bankAccountId"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="流水号" prop="bankTransactionNo">
<el-input v-model="receiptDialog.form.bankTransactionNo" placeholder="银行/支付平台流水号" />
@@ -715,6 +743,13 @@
</el-descriptions-item>
<el-descriptions-item label="待核销金额">CNY {{ formatMoney(viewDialog.data.unallocatedAmount) }}</el-descriptions-item>
<el-descriptions-item label="收款方式">{{ formatOption(payMethodOptions, viewDialog.data.payMethod) }}</el-descriptions-item>
<el-descriptions-item label="收款银行账户">
<span v-if="viewDialog.data.bankAccountId">
{{ viewDialog.data.bankName || '-' }} {{ viewDialog.data.bankAccountNo || '' }}
<span v-if="viewDialog.data.bankAccountName">({{ viewDialog.data.bankAccountName }})</span>
</span>
<span v-else>-</span>
</el-descriptions-item>
<el-descriptions-item label="银行流水号">{{ viewDialog.data.bankTransactionNo || '-' }}</el-descriptions-item>
<el-descriptions-item label="确认时间">{{ formatDateTime(viewDialog.data.confirmedAt) }}</el-descriptions-item>
<el-descriptions-item label="登记人">{{ viewDialog.data.createBy || '-' }}</el-descriptions-item>
@@ -822,7 +857,7 @@
<div class="rate-tip">
{{ creditDialog.form.creditType === 'TEMP'
? '失效日当天仍有效,次日访问账户时自动清零并记到期流水'
: '信用额度失效日期必填;失效日当天仍有效,次日自动清零,已用额度未回款时将形成欠费拦截' }}
: '信用额度失效日期必填;失效日当天仍有效,次日自动清零,已用额度未回款时将形成超额欠费(可继续计费,请及时催收)' }}
</div>
</el-form-item>
</el-col>
@@ -970,6 +1005,7 @@ import { getCustomer } from "@/api/customersuppliermanagement/customerinfo/custo
import { listAccount, listReceipt, getReceipt, addReceipt, confirmReceipt, cancelReceipt, listFlow, listCreditFlow, applyCreditAdjust, listCreditApply, approveCreditApply, rejectCreditApply, cancelCreditApply, listMyCreditPools } from "@/api/customersuppliermanagement/customermoney/customermoney.js"
import { listUnsettledBill, listBalanceWriteoff, balanceWriteoff, cancelBalanceWriteoff } from "@/api/customersuppliermanagement/customermoney/customerbill.js"
import { convertToBase } from "@/api/data/exchangeRate"
import { listBankAccountOptions } from "@/api/ar/bankAccount"
import { getToken } from "@/utils/auth"
import { AR_BALANCE_WRITEOFF_STATUS, AR_BALANCE_WRITEOFF_STATUS_OPTIONS, AR_BALANCE_WRITEOFF_STATUS_TYPES, AR_BILL_STATUS_OPTIONS, AR_BILL_STATUS_TYPES, arEnumLabel } from '@/constants/ar/enums'
@@ -1107,7 +1143,7 @@ const availableCreditValue = computed(() => {
})
/** 可用额度展示文本 */
const availableCredit = computed(() => formatMoney(availableCreditValue.value))
/** 是否处于超额状态(已用额度超过授信总额,新计费开单将被拦截,需先回款核销) */
/** 是否处于超额状态(已用额度超过授信总额,可用为负;不拦截计费,后续做超额提醒) */
const availableOverLimit = computed(() => availableCreditValue.value < 0)
/** 临时额度有效期文案 */
@@ -1360,6 +1396,30 @@ const receiptDialog = reactive({
visible: false,
form: {}
})
/** 收款银行账户下拉(按币种过滤,默认账户优先) */
const bankAccountOptions = ref([])
const bankAccountLoading = ref(false)
function loadBankAccountOptions(currency, { autoPick = true } = {}) {
bankAccountLoading.value = true
listBankAccountOptions(currency || 'CNY').then(res => {
bankAccountOptions.value = res.data || []
if (!autoPick) return
// 当前已选账户在新列表中仍存在则保留;否则默认选中默认账户(无默认取第一个)
const cur = receiptDialog.form.bankAccountId
const stillExists = cur && bankAccountOptions.value.some(a => a.bankAccountId === cur)
if (!stillExists) {
const def = bankAccountOptions.value.find(a => a.isDefault === '1') || bankAccountOptions.value[0]
receiptDialog.form.bankAccountId = def ? def.bankAccountId : null
}
}).finally(() => {
bankAccountLoading.value = false
})
}
function handleBankAccountChange() {
// 选项清空时无需额外处理;快照(户名/账号/开户行)由后端登记时回填
}
const receiptRules = {
receivedAt: [{ required: true, message: '收款日期不能为空', trigger: 'change' }],
amount: [{ required: true, message: '收款金额不能为空', trigger: 'blur' }],
@@ -1378,6 +1438,7 @@ function resetReceiptForm() {
currency: 'CNY',
exchangeRate: 1,
payMethod: 'BANK_TRANSFER',
bankAccountId: null,
bankTransactionNo: '',
remark: '',
attachmentList: []
@@ -1387,6 +1448,7 @@ function resetReceiptForm() {
function handleAddReceipt() {
resetReceiptForm()
loadBankAccountOptions(receiptDialog.form.currency)
receiptDialog.visible = true
}
@@ -1422,11 +1484,12 @@ function fetchDefaultRate() {
})
}
/** 切换币种:重置手工标记并重新取默认汇率 */
/** 切换币种:重置手工标记并重新取默认汇率、刷新收款银行账户下拉 */
function handleCurrencyChange() {
rateEdited.value = false
rateSourceInfo.value = { source: '', ratePath: '' }
fetchDefaultRate()
loadBankAccountOptions(receiptDialog.form.currency)
}
/** 手工修改汇率 */