|
|
@@ -825,7 +825,7 @@ function downloadTemplate() {
|
|
|
amount: 100.00,
|
|
|
order_title: "测试转账",
|
|
|
payee_name: "张三",
|
|
|
- payee_type: "alipay",
|
|
|
+ payee_type: "支付宝",
|
|
|
payee_account: "zhangsan@example.com",
|
|
|
remark: "测试"
|
|
|
});
|
|
|
@@ -833,7 +833,7 @@ function downloadTemplate() {
|
|
|
amount: 200.00,
|
|
|
order_title: "测试转账",
|
|
|
payee_name: "李四",
|
|
|
- payee_type: "bank",
|
|
|
+ payee_type: "银行卡",
|
|
|
payee_account: "6222021234567890123",
|
|
|
bank_type: "1",
|
|
|
bank_name: "中国工商银行",
|
|
|
@@ -877,7 +877,7 @@ async function parseExcelFile(file: File) {
|
|
|
order_title: row.getCell(2).value,
|
|
|
payee_name: row.getCell(3).value,
|
|
|
payee_type: row.getCell(4).value,
|
|
|
- payee_account: row.getCell(5).value,
|
|
|
+ payee_account: (row.getCell(5).value || {}).text || row.getCell(5).value,
|
|
|
bank_type: row.getCell(6).value,
|
|
|
bank_name: row.getCell(7).value,
|
|
|
bank_province: row.getCell(8).value,
|
|
|
@@ -928,12 +928,13 @@ function validateTransferData(data: any) {
|
|
|
}
|
|
|
|
|
|
// 验证收款方类型
|
|
|
- if (!data.payee_type || !["alipay", "bank"].includes(data.payee_type)) {
|
|
|
+ if (!data.payee_type || !["支付宝", "银行卡"].includes(data.payee_type)) {
|
|
|
result.status = "invalid";
|
|
|
- result.error_msg = "收款方类型必须是alipay或bank";
|
|
|
+ result.error_msg = "收款方类型必须是支付宝或银行卡";
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ console.log(data.payee_account);
|
|
|
// 验证收款方账号
|
|
|
if (!data.payee_account || data.payee_account.toString().trim() === "") {
|
|
|
result.status = "invalid";
|
|
|
@@ -942,8 +943,9 @@ function validateTransferData(data: any) {
|
|
|
}
|
|
|
|
|
|
// 验证银行卡信息
|
|
|
- if (data.payee_type === "bank") {
|
|
|
- if (!data.bank_type || ![1, 2].includes(data.bank_type)) {
|
|
|
+ if (data.payee_type === "银行卡") {
|
|
|
+ if (!data.bank_type || !["1", "2"].includes(data.bank_type.toString())) {
|
|
|
+ console.log(typeof data.bank_type);
|
|
|
result.status = "invalid";
|
|
|
result.error_msg = "银行账户类型必须是1或2";
|
|
|
return result;
|
|
|
@@ -998,11 +1000,11 @@ async function handleBatchTransfer() {
|
|
|
order_title: item.order_title.toString(),
|
|
|
remark: item.remark?.toString() || "",
|
|
|
payee_info: {
|
|
|
- identity_type: item.payee_type,
|
|
|
+ identity_type: item.payee_type === "支付宝" ? "alipay" : "bank",
|
|
|
name: item.payee_name.toString(),
|
|
|
identity: item.payee_account.toString(),
|
|
|
bankcard_ext_info:
|
|
|
- item.payee_type === "bank"
|
|
|
+ item.payee_type === "银行卡"
|
|
|
? {
|
|
|
account_type: item.bank_type?.toString(),
|
|
|
inst_name: item.bank_name?.toString(),
|