客户付款银行账号记录

This commit is contained in:
luojiaquan
2026-09-21 11:18:38 +08:00
parent 212c64e0ed
commit ebe1c1dfdd
3 changed files with 21 additions and 56 deletions
@@ -84,13 +84,13 @@ public class CustomerReceipt extends BaseEntity
/** 收款方式:BANK_TRANSFER/ALIPAY/WECHAT/CASH/OTHER */
private String payMethod;
/** 收款银行账户ID(ar_bank_account) */
/** 客户银行账户ID(ar_bank_account) */
private Long bankAccountId;
/** 收款账户户名(登记时快照) */
/** 客户银行账户户名(登记时快照) */
private String bankAccountName;
/** 收款银行账号(登记时快照) */
/** 客户银行账号(登记时快照) */
private String bankAccountNo;
/** 开户行名称(登记时快照) */
@@ -142,8 +142,9 @@ public class CustomerMoneyServiceImpl implements ICustomerMoneyService
{
receipt.setCurrency(receipt.getCurrency().trim().toUpperCase());
}
// 收款银行账户:以库中启用账户为准回填快照(不信任前端传入的户名/账号/开户行文本),
// 收款银行账户:以库中启用账户为准回填快照(不信任前端传入的户名/开户行文本),
// 账户后续停用或修改不影响历史单据展示。
// 未选账户时,允许只手工录入客户银行账号文本(bankAccountNo),户名/开户行清空。
if (receipt.getBankAccountId() != null)
{
ArBankAccount bankAccount = arBankAccountMapper.selectEnabledById(receipt.getBankAccountId());
@@ -158,8 +159,9 @@ public class CustomerMoneyServiceImpl implements ICustomerMoneyService
else
{
receipt.setBankAccountName(null);
receipt.setBankAccountNo(null);
receipt.setBankName(null);
receipt.setBankAccountNo(StringUtils.hasText(receipt.getBankAccountNo())
? receipt.getBankAccountNo().trim() : null);
}
// 汇率与本位币金额:CNY 固定 1:1;外币以收款日即期汇率表为基准,允许页面手工修改。
// 汇率来源由后端权威判定(不信任前端标记):与汇率表一致=RATE_TABLE,不一致/表未配置=MANUAL。
@@ -152,10 +152,10 @@
<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>
<el-table-column label="客户银行账号" align="center" width="200" show-overflow-tooltip>
<template #default="scope">
<span v-if="scope.row.bankAccountId">
{{ scope.row.bankName || '-' }} {{ scope.row.bankAccountNo || '' }}
<span v-if="scope.row.bankAccountNo">
{{ scope.row.bankName ? scope.row.bankName + ' ' : '' }}{{ scope.row.bankAccountNo }}
</span>
<span v-else>-</span>
</template>
@@ -646,23 +646,13 @@
</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
<el-form-item label="客户银行账号" prop="bankAccountNo">
<el-input
v-model="receiptDialog.form.bankAccountNo"
placeholder="客户付款银行账号(选填)"
maxlength="64"
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">
@@ -743,9 +733,9 @@
</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 || '' }}
<el-descriptions-item label="客户银行账号">
<span v-if="viewDialog.data.bankAccountNo">
{{ viewDialog.data.bankName ? viewDialog.data.bankName + ' ' : '' }}{{ viewDialog.data.bankAccountNo }}
<span v-if="viewDialog.data.bankAccountName">({{ viewDialog.data.bankAccountName }})</span>
</span>
<span v-else>-</span>
@@ -1005,7 +995,6 @@ 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'
@@ -1396,30 +1385,6 @@ 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' }],
@@ -1438,7 +1403,7 @@ function resetReceiptForm() {
currency: 'CNY',
exchangeRate: 1,
payMethod: 'BANK_TRANSFER',
bankAccountId: null,
bankAccountNo: '',
bankTransactionNo: '',
remark: '',
attachmentList: []
@@ -1448,7 +1413,6 @@ function resetReceiptForm() {
function handleAddReceipt() {
resetReceiptForm()
loadBankAccountOptions(receiptDialog.form.currency)
receiptDialog.visible = true
}
@@ -1484,12 +1448,11 @@ function fetchDefaultRate() {
})
}
/** 切换币种:重置手工标记并重新取默认汇率、刷新收款银行账户下拉 */
/** 切换币种:重置手工标记并重新取默认汇率 */
function handleCurrencyChange() {
rateEdited.value = false
rateSourceInfo.value = { source: '', ratePath: '' }
fetchDefaultRate()
loadBankAccountOptions(receiptDialog.form.currency)
}
/** 手工修改汇率 */