Commit 9938f813 by chenwq

fix(financeManage): 修复市场转账相关API及银行账户处理问题

修正市场转账收款账户查询的API接口地址,补全代码中的if语句花括号提升可读性与逻辑性,更新特殊银行账号模块的注释描述,优化转账弹窗的账户选择逻辑避免重复ID冲突并补充参数传递,修复费用调整的正则校验表达式
1 parent d5cf66c9
......@@ -208,7 +208,8 @@ export function queryMarketTransferFee(data) {
// 市场费转账-收款账户
export function getMarketTransferBankAccounts(data) {
data.method = "dj.api.smartcarlife.merchantBankEnterpriseAccount.listWithPage";
// data.method = "dj.api.smartcarlife.merchantBankEnterpriseAccount.listWithPage";
data.method = "dj.api.smartcarlife.merchantBankEnterpriseAccount.listBankAccount";
return request(data, "post");
}
......
......@@ -3,7 +3,7 @@ import request from "./request";
const path = "dj.api.smartcarlife.";
const djPath = "dj.api.";
// 分页查询银企账号记录
// 分页查询特殊银行账号记录
export function getListApi(data) {
data.method = `${path}specialBankAccount.listWithPage`;
return request(data, "post");
......@@ -15,19 +15,19 @@ export function getMerchantLevelApi(data) {
return request(data, "post");
}
// 银企账号 - 添加或修改记录
// 特殊银行账号 - 添加或修改记录
export function updateBankAccount(data) {
data.method = `${path}specialBankAccount.insertOrUpdate`;
return request(data, "post");
}
// 银企账号 - 根据商户号查询银企账号详细信息
// 特殊银行账号 - 根据商户号查询特殊银行账号详细信息
export function getBankById(data) {
data.method = `${path}specialBankAccount.getById`;
return request(data, "post");
}
// 银企账号 - 删除
// 特殊银行账号 - 删除
export function deleteBankAccount(data) {
data.method = `${path}specialBankAccount.delete`;
return request(data, "post");
......
......@@ -111,10 +111,12 @@ export function normalizeApprovedMarketTransferFees(list = []) {
const expenseCategoryIds = [];
(list || []).forEach((item) => {
const id = item && item.expenseCategoryId;
if (id === undefined || id === null)
if (id === undefined || id === null) {
return;
if (!expenseCategoryIds.includes(id))
}
if (!expenseCategoryIds.includes(id)) {
expenseCategoryIds.push(id);
}
amountMap[id] = item.expenseCategoryResult;
});
......
......@@ -297,10 +297,15 @@ export default {
currentPage: 1,
pageSize: 10000,
}).then((res) => {
this.bankAccountList = (res.list || []).map(item => ({
// value: item.merchantId || item.id || item.bankAccountNo,
// label: this.formatBankAccountLabel(item),
value: item.merchantId,
this.bankAccountList = res.map(item => ({
/**
* 数据来源:银企账号、特殊银行账号
* id+item.bankAccountType才是唯一值,避免不同类型的账号id相同导致的选中问题
*/
value: item.id + "" + item.bankAccountType,
bankAccountId: item.id,
bankAccountType: item.bankAccountType,
merchantId: item.merchantId,
label: item.bankAccountName + " / " + item.bankAccountNo,
}));
});
......@@ -410,7 +415,7 @@ export default {
},
validateAdjustmentFee(rule, value, callback) {
const adjustmentFee = `${value || ""}`.trim();
const error = adjustmentFee && !/^-?\d+(\.\d{1,2})?$/.test(adjustmentFee)
const error = adjustmentFee && !/^-?\d+(?:\.\d{1,2})?$/.test(adjustmentFee)
? new Error("费用调整仅支持数字、负数和两位小数")
: undefined;
callback(error);
......@@ -508,6 +513,10 @@ export default {
this.$message.error("请等待转账凭证上传完成");
return;
}
const accountObj = this.bankAccountList.find(item => item.value === params.rcvMerchantId) || {};
params.bankAccountId = accountObj.bankAccountId;
params.bankAccountType = accountObj.bankAccountType;
params.rcvMerchantId = accountObj.merchantId;
submitMarketTransferFee(params).then(() => {
this.$message.success("操作成功");
this.$emit("handleConfirm");
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!