|
|
@@ -1,7 +1,15 @@
|
|
|
<script setup lang="ts">
|
|
|
import type { DataTableColumns, FormInst, FormRules } from "naive-ui";
|
|
|
import { EllipsisVertical } from "@vicons/ionicons5";
|
|
|
-import { NButton, NDropdown, NFormItemGi, NIcon, NInput, NTag, useMessage } from "naive-ui";
|
|
|
+import {
|
|
|
+ NButton,
|
|
|
+ NDropdown,
|
|
|
+ NFormItemGi,
|
|
|
+ NIcon,
|
|
|
+ NInput,
|
|
|
+ NTag,
|
|
|
+ useMessage,
|
|
|
+} from "naive-ui";
|
|
|
import AdminSearchPanel from "@/components/AdminSearchPanel.vue";
|
|
|
import AdminTablePageBar from "@/components/AdminTablePageBar.vue";
|
|
|
import type {
|
|
|
@@ -28,7 +36,6 @@ interface SearchModel {
|
|
|
|
|
|
type ActionType =
|
|
|
| "approve"
|
|
|
- | "mt"
|
|
|
| "receipt"
|
|
|
| "submit"
|
|
|
| "backstage"
|
|
|
@@ -140,13 +147,11 @@ const actionForm = ref({
|
|
|
id: 0,
|
|
|
type: "approve" as ActionType,
|
|
|
status: null as string | null,
|
|
|
- withdrawStatus: null as string | null,
|
|
|
callbackStatus: null as string | null,
|
|
|
submitStatus: null as string | null,
|
|
|
backstageStatus: null as string | null,
|
|
|
infoStatus: null as string | null,
|
|
|
approveDesc: "",
|
|
|
- withdrawTicket: "",
|
|
|
});
|
|
|
|
|
|
const batchModalVisible = ref(false);
|
|
|
@@ -192,9 +197,6 @@ const withdrawalRecordPageSize = ref(10);
|
|
|
|
|
|
const actionRules: FormRules = {
|
|
|
status: [{ required: true, message: "请选择处理状态", trigger: "change" }],
|
|
|
- withdrawStatus: [
|
|
|
- { required: true, message: "请选择处理状态", trigger: "change" },
|
|
|
- ],
|
|
|
callbackStatus: [
|
|
|
{ required: true, message: "请选择处理状态", trigger: "change" },
|
|
|
],
|
|
|
@@ -208,9 +210,6 @@ const actionRules: FormRules = {
|
|
|
{ required: true, message: "请选择处理状态", trigger: "change" },
|
|
|
],
|
|
|
approveDesc: [{ required: true, message: "请输入拒绝原因", trigger: "blur" }],
|
|
|
- withdrawTicket: [
|
|
|
- { required: true, message: "请输入 MT 订单号", trigger: "blur" },
|
|
|
- ],
|
|
|
};
|
|
|
const batchRules: FormRules = {
|
|
|
submitStatus: [
|
|
|
@@ -226,7 +225,6 @@ const batchRules: FormRules = {
|
|
|
};
|
|
|
const actionTitleMap: Record<ActionType, string> = {
|
|
|
approve: "取款审核",
|
|
|
- mt: "MT 扣款",
|
|
|
receipt: "回执处理",
|
|
|
submit: "汇款提交",
|
|
|
backstage: "后台审核",
|
|
|
@@ -268,7 +266,10 @@ function resolveStatus(row: WithdrawItem) {
|
|
|
"3": "已拒绝",
|
|
|
"4": "已取消",
|
|
|
};
|
|
|
- const statusTypeMap: Record<string, "warning" | "info" | "success" | "error"> = {
|
|
|
+ const statusTypeMap: Record<
|
|
|
+ string,
|
|
|
+ "warning" | "info" | "success" | "error"
|
|
|
+ > = {
|
|
|
"0": "warning",
|
|
|
"1": "info",
|
|
|
"2": "success",
|
|
|
@@ -278,8 +279,18 @@ function resolveStatus(row: WithdrawItem) {
|
|
|
const toDisplayStatusValue = () => {
|
|
|
// 与查询条件状态保持一致:0-待处理 1-处理中 2-已通过 3-已拒绝 4-已取消
|
|
|
if (row.status === 5 || row.backstageStatus === 5) return "4";
|
|
|
- if (row.status === 3 || row.withdrawStatus === 3 || row.callbackStatus === 2) return "3";
|
|
|
- if (row.status === 2 && row.withdrawStatus === 2 && row.callbackStatus === 1) return "2";
|
|
|
+ if (
|
|
|
+ row.status === 3 ||
|
|
|
+ row.withdrawStatus === 3 ||
|
|
|
+ row.callbackStatus === 2
|
|
|
+ )
|
|
|
+ return "3";
|
|
|
+ if (
|
|
|
+ row.status === 2 &&
|
|
|
+ row.withdrawStatus === 2 &&
|
|
|
+ row.callbackStatus === 1
|
|
|
+ )
|
|
|
+ return "2";
|
|
|
if (row.status === 1) return "0";
|
|
|
return "1";
|
|
|
};
|
|
|
@@ -290,18 +301,18 @@ function resolveStatus(row: WithdrawItem) {
|
|
|
};
|
|
|
}
|
|
|
|
|
|
-function feeReductionText(v?: number) {
|
|
|
- if (v === 1) return "是";
|
|
|
- if (v === 0) return "否";
|
|
|
- return "--";
|
|
|
-}
|
|
|
+// function feeReductionText(v?: number) {
|
|
|
+// if (v === 1) return "是";
|
|
|
+// if (v === 0) return "否";
|
|
|
+// return "--";
|
|
|
+// }
|
|
|
|
|
|
-function salesLevelText(v?: number) {
|
|
|
- if (v === 1) return "Level 1";
|
|
|
- if (v === 2) return "Level 2";
|
|
|
- if (v === 3) return "Level 3";
|
|
|
- return "--";
|
|
|
-}
|
|
|
+// function salesLevelText(v?: number) {
|
|
|
+// if (v === 1) return "Level 1";
|
|
|
+// if (v === 2) return "Level 2";
|
|
|
+// if (v === 3) return "Level 3";
|
|
|
+// return "--";
|
|
|
+// }
|
|
|
|
|
|
function buildSearchPayload(): WithdrawSearchParams {
|
|
|
const toOptionalNumber = (v: string) => {
|
|
|
@@ -353,13 +364,11 @@ function openActionModal(type: ActionType, row: WithdrawItem) {
|
|
|
id: row.id,
|
|
|
type,
|
|
|
status: null,
|
|
|
- withdrawStatus: null,
|
|
|
callbackStatus: null,
|
|
|
submitStatus: type === "submit" ? "2" : null,
|
|
|
backstageStatus: null,
|
|
|
infoStatus: null,
|
|
|
approveDesc: "",
|
|
|
- withdrawTicket: "",
|
|
|
};
|
|
|
actionModalVisible.value = true;
|
|
|
nextTick(() => actionFormRef.value?.restoreValidation());
|
|
|
@@ -409,7 +418,10 @@ async function fetchDepositRecords() {
|
|
|
try {
|
|
|
const { list, total } = await withdrawApi.searchDepositPage({
|
|
|
cId: row.cId,
|
|
|
- page: { current: depositRecordPage.value, row: depositRecordPageSize.value },
|
|
|
+ page: {
|
|
|
+ current: depositRecordPage.value,
|
|
|
+ row: depositRecordPageSize.value,
|
|
|
+ },
|
|
|
});
|
|
|
depositRecords.value = list;
|
|
|
depositRecordTotal.value = total;
|
|
|
@@ -425,7 +437,10 @@ async function fetchWithdrawalRecords() {
|
|
|
try {
|
|
|
const { list, total } = await withdrawApi.searchWithdrawPage({
|
|
|
cId: row.cId,
|
|
|
- page: { current: withdrawalRecordPage.value, row: withdrawalRecordPageSize.value },
|
|
|
+ page: {
|
|
|
+ current: withdrawalRecordPage.value,
|
|
|
+ row: withdrawalRecordPageSize.value,
|
|
|
+ },
|
|
|
});
|
|
|
withdrawalRecords.value = list;
|
|
|
withdrawalRecordTotal.value = total;
|
|
|
@@ -462,10 +477,12 @@ const groupedRemitChannels = computed(() => {
|
|
|
|
|
|
function parseSelectOptions(selectObj: unknown) {
|
|
|
if (!selectObj || typeof selectObj !== "object") return [];
|
|
|
- return Object.entries(selectObj as Record<string, unknown>).map(([label, value]) => ({
|
|
|
- label,
|
|
|
- value: String(value ?? ""),
|
|
|
- }));
|
|
|
+ return Object.entries(selectObj as Record<string, unknown>).map(
|
|
|
+ ([label, value]) => ({
|
|
|
+ label,
|
|
|
+ value: String(value ?? ""),
|
|
|
+ }),
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
async function openRemitModal(row: WithdrawItem) {
|
|
|
@@ -493,11 +510,16 @@ async function chooseRemitChannel(channel: RemitChannelItem) {
|
|
|
});
|
|
|
remitTitle.value = channel.name || channel.enName || channel.code;
|
|
|
remitBase.value = data as Record<string, unknown>;
|
|
|
- const labels =
|
|
|
- ((data?.params as Record<string, unknown>) ??
|
|
|
- (data?.paramsEn as Record<string, unknown>) ??
|
|
|
- {}) as Record<string, unknown>;
|
|
|
- const blacklist = new Set(["params", "paramsEn", "id", "serial", "withdrawUrl"]);
|
|
|
+ const labels = ((data?.params as Record<string, unknown>) ??
|
|
|
+ (data?.paramsEn as Record<string, unknown>) ??
|
|
|
+ {}) as Record<string, unknown>;
|
|
|
+ const blacklist = new Set([
|
|
|
+ "params",
|
|
|
+ "paramsEn",
|
|
|
+ "id",
|
|
|
+ "serial",
|
|
|
+ "withdrawUrl",
|
|
|
+ ]);
|
|
|
const fields: Array<{
|
|
|
name: string;
|
|
|
label: string;
|
|
|
@@ -512,7 +534,9 @@ async function chooseRemitChannel(channel: RemitChannelItem) {
|
|
|
name,
|
|
|
label,
|
|
|
value: String((data as Record<string, unknown>)[name] ?? ""),
|
|
|
- options: parseSelectOptions((data as Record<string, unknown>)[`${name}Select`]),
|
|
|
+ options: parseSelectOptions(
|
|
|
+ (data as Record<string, unknown>)[`${name}Select`],
|
|
|
+ ),
|
|
|
});
|
|
|
});
|
|
|
remitFields.value = fields;
|
|
|
@@ -544,8 +568,11 @@ async function submitRemit() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-function getActionOptions(row: WithdrawItem): Array<{ label: string; key: ActionType }> {
|
|
|
- const callbackPending = row.callbackStatus === 0 || row.callbackStatus == null;
|
|
|
+function getActionOptions(
|
|
|
+ row: WithdrawItem,
|
|
|
+): Array<{ label: string; key: ActionType }> {
|
|
|
+ const callbackPending =
|
|
|
+ row.callbackStatus === 0 || row.callbackStatus == null;
|
|
|
const options: Array<{ label: string; key: ActionType }> = [];
|
|
|
|
|
|
// 旧页逻辑:待处理时显示「审核」
|
|
|
@@ -553,11 +580,6 @@ function getActionOptions(row: WithdrawItem): Array<{ label: string; key: Action
|
|
|
options.push({ label: "审核", key: "approve" });
|
|
|
}
|
|
|
|
|
|
- // 旧页逻辑:待 MT 扣款时显示「MT」
|
|
|
- if (row.withdrawStatus === 1) {
|
|
|
- options.push({ label: "MT", key: "mt" });
|
|
|
- }
|
|
|
-
|
|
|
// 旧页逻辑:通道回执
|
|
|
if (
|
|
|
row.withdrawStatus === 2 &&
|
|
|
@@ -658,7 +680,10 @@ function mapFields(
|
|
|
) {
|
|
|
return defs
|
|
|
.filter((def) => hasDisplayValue(source[def.key]))
|
|
|
- .map((def) => ({ label: def.label, value: toDetailValue(source[def.key]) }));
|
|
|
+ .map((def) => ({
|
|
|
+ label: def.label,
|
|
|
+ value: toDetailValue(source[def.key]),
|
|
|
+ }));
|
|
|
}
|
|
|
|
|
|
const basicDetailFields = computed<DetailFieldItem[]>(() => {
|
|
|
@@ -713,7 +738,10 @@ const bankDetailFields = computed<DetailFieldItem[]>(() => {
|
|
|
|
|
|
if (remitType === "BANK" || remitType === "BANK_TELEGRAPHIC") {
|
|
|
fields.push(...mapFields(rec, bankTransferFields));
|
|
|
- } else if (remitType === "CHANNEL_TYPE_CARD" || remitType === "UCARD_WALLET") {
|
|
|
+ } else if (
|
|
|
+ remitType === "CHANNEL_TYPE_CARD" ||
|
|
|
+ remitType === "UCARD_WALLET"
|
|
|
+ ) {
|
|
|
fields.push(...mapFields(rec, cardFields));
|
|
|
} else if (
|
|
|
remitType === "CHANNEL_TYPE_WALLET" ||
|
|
|
@@ -744,10 +772,6 @@ const withdrawDetailFields = computed<DetailFieldItem[]>(() => {
|
|
|
value: `${amountText(row.transformAmount)} (${displayText(row.transformCurrency)})`,
|
|
|
},
|
|
|
{ label: "取款方式", value: toDetailValue(row.remitChannelName) },
|
|
|
- { label: "手续费减免", value: feeReductionText(row.feeReduction) },
|
|
|
- { label: "手续费", value: amountText(row.feeAmount) },
|
|
|
- { label: "手续费减免金额", value: amountText(row.feeReductionAmount) },
|
|
|
- { label: "风险等级", value: salesLevelText(row.salesSettingLevel) },
|
|
|
{ label: "汇款提交时间", value: toDetailValue(row.submitTime) },
|
|
|
{ label: "状态", value: resolveStatus(row).label },
|
|
|
{ label: "拒绝/备注", value: toDetailValue(row.approveDesc) },
|
|
|
@@ -765,13 +789,6 @@ async function submitAction() {
|
|
|
status: (Number(f.status) as 2 | 3) ?? 2,
|
|
|
approveDesc: f.status === "3" ? f.approveDesc.trim() : "",
|
|
|
});
|
|
|
- } else if (f.type === "mt") {
|
|
|
- await withdrawApi.approveWithdrawMT({
|
|
|
- id: f.id,
|
|
|
- withdrawStatus: (Number(f.withdrawStatus) as 2 | 3) ?? 2,
|
|
|
- approveDesc: f.withdrawStatus === "3" ? f.approveDesc.trim() : "",
|
|
|
- withdrawTicket: f.withdrawStatus === "2" ? f.withdrawTicket.trim() : "",
|
|
|
- });
|
|
|
} else if (f.type === "receipt") {
|
|
|
await withdrawApi.approveWithdrawReceipt({
|
|
|
id: f.id,
|
|
|
@@ -890,7 +907,6 @@ const allColumns = ref<DataTableColumns<WithdrawItem>>([
|
|
|
{
|
|
|
title: "流水号",
|
|
|
key: "serial",
|
|
|
- width: 200,
|
|
|
render(row) {
|
|
|
return h(
|
|
|
NButton,
|
|
|
@@ -907,23 +923,14 @@ const allColumns = ref<DataTableColumns<WithdrawItem>>([
|
|
|
{
|
|
|
title: "申请金额",
|
|
|
key: "amount",
|
|
|
-
|
|
|
render(row) {
|
|
|
return `${amountText(row.amount)} ${row.currency || ""}`.trim();
|
|
|
},
|
|
|
},
|
|
|
- {
|
|
|
- title: "平台出金",
|
|
|
- key: "withdrawAmount",
|
|
|
-
|
|
|
- render(row) {
|
|
|
- return `${amountText(row.withdrawAmount)} ${row.withdrawCurrency || ""}`.trim();
|
|
|
- },
|
|
|
- },
|
|
|
{
|
|
|
title: "汇款金额",
|
|
|
key: "transformAmount",
|
|
|
-
|
|
|
+
|
|
|
render(row) {
|
|
|
return `${amountText(row.transformAmount)} ${row.transformCurrency || ""}`.trim();
|
|
|
},
|
|
|
@@ -931,43 +938,14 @@ const allColumns = ref<DataTableColumns<WithdrawItem>>([
|
|
|
{
|
|
|
title: "取款方式",
|
|
|
key: "remitChannelName",
|
|
|
-
|
|
|
ellipsis: { tooltip: true },
|
|
|
},
|
|
|
- { title: "申请时间", key: "addTime", },
|
|
|
- { title: "放款时间", key: "submitTime", },
|
|
|
- {
|
|
|
- title: "手续费减免",
|
|
|
- key: "feeReduction",
|
|
|
- render(row) {
|
|
|
- return feeReductionText(row.feeReduction);
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- title: "手续费",
|
|
|
- key: "feeAmount",
|
|
|
- render(row) {
|
|
|
- return amountText(row.feeAmount);
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- title: "手续费减免金额",
|
|
|
- key: "feeReductionAmount",
|
|
|
- render(row) {
|
|
|
- return amountText(row.feeReductionAmount);
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- title: "风险等级",
|
|
|
- key: "salesSettingLevel",
|
|
|
- render(row) {
|
|
|
- return salesLevelText(row.salesSettingLevel);
|
|
|
- },
|
|
|
- },
|
|
|
+ { title: "申请时间", key: "addTime" },
|
|
|
+ { title: "放款时间", key: "submitTime" },
|
|
|
{
|
|
|
title: "状态",
|
|
|
key: "statusTag",
|
|
|
-
|
|
|
+
|
|
|
render(row) {
|
|
|
const s = resolveStatus(row);
|
|
|
return h(
|
|
|
@@ -997,7 +975,14 @@ const allColumns = ref<DataTableColumns<WithdrawItem>>([
|
|
|
h(
|
|
|
NButton,
|
|
|
{ text: true, circle: true, class: "action-cell__more-btn" },
|
|
|
- { icon: () => h(NIcon, { size: 16 }, { default: () => h(EllipsisVertical) }) },
|
|
|
+ {
|
|
|
+ icon: () =>
|
|
|
+ h(
|
|
|
+ NIcon,
|
|
|
+ { size: 16 },
|
|
|
+ { default: () => h(EllipsisVertical) },
|
|
|
+ ),
|
|
|
+ },
|
|
|
),
|
|
|
},
|
|
|
),
|
|
|
@@ -1231,7 +1216,9 @@ watch([withdrawalRecordPage, withdrawalRecordPageSize], () => {
|
|
|
<!-- <NButton size="small" @click="openDepositRecords">存款记录</NButton> -->
|
|
|
<!-- <NButton size="small" @click="openWithdrawalRecords">取款记录</NButton> -->
|
|
|
<NButton
|
|
|
- v-for="item in getActionOptions(detailRow).filter((x) => x.key !== 'detail')"
|
|
|
+ v-for="item in getActionOptions(detailRow).filter(
|
|
|
+ (x) => x.key !== 'detail',
|
|
|
+ )"
|
|
|
:key="item.key"
|
|
|
size="small"
|
|
|
@click="openActionFromDetail(item.key)"
|
|
|
@@ -1306,7 +1293,9 @@ watch([withdrawalRecordPage, withdrawalRecordPageSize], () => {
|
|
|
>
|
|
|
<div v-if="!remitFields.length && !remitFormLoading">
|
|
|
<div v-if="remitChannelsLoading" class="remit-tip">正在加载通道...</div>
|
|
|
- <div v-else-if="!groupedRemitChannels.length" class="remit-tip">暂无可用出金通道</div>
|
|
|
+ <div v-else-if="!groupedRemitChannels.length" class="remit-tip">
|
|
|
+ 暂无可用出金通道
|
|
|
+ </div>
|
|
|
<div v-else class="remit-groups">
|
|
|
<section
|
|
|
v-for="group in groupedRemitChannels"
|
|
|
@@ -1450,26 +1439,6 @@ watch([withdrawalRecordPage, withdrawalRecordPageSize], () => {
|
|
|
:options="processOptions"
|
|
|
/>
|
|
|
</NFormItem>
|
|
|
- <NFormItem
|
|
|
- v-if="actionForm.type === 'mt'"
|
|
|
- label="处理状态"
|
|
|
- path="withdrawStatus"
|
|
|
- >
|
|
|
- <NSelect
|
|
|
- v-model:value="actionForm.withdrawStatus"
|
|
|
- :options="processOptions"
|
|
|
- />
|
|
|
- </NFormItem>
|
|
|
- <NFormItem
|
|
|
- v-if="actionForm.type === 'mt' && actionForm.withdrawStatus === '2'"
|
|
|
- label="MT 订单号"
|
|
|
- path="withdrawTicket"
|
|
|
- >
|
|
|
- <NInput
|
|
|
- v-model:value="actionForm.withdrawTicket"
|
|
|
- placeholder="请输入 MT 订单号"
|
|
|
- />
|
|
|
- </NFormItem>
|
|
|
<NFormItem
|
|
|
v-if="actionForm.type === 'receipt'"
|
|
|
label="回执状态"
|
|
|
@@ -1513,7 +1482,6 @@ watch([withdrawalRecordPage, withdrawalRecordPageSize], () => {
|
|
|
<NFormItem
|
|
|
v-if="
|
|
|
(actionForm.type === 'approve' && actionForm.status === '3') ||
|
|
|
- (actionForm.type === 'mt' && actionForm.withdrawStatus === '3') ||
|
|
|
(actionForm.type === 'receipt' &&
|
|
|
actionForm.callbackStatus === '2') ||
|
|
|
(actionForm.type === 'submit' && actionForm.submitStatus === '3') ||
|