|
@@ -7,10 +7,20 @@
|
|
key="withdraw-search"
|
|
key="withdraw-search"
|
|
:searchFields="searchFields"
|
|
:searchFields="searchFields"
|
|
:defaultValues="defaultSearchValues"
|
|
:defaultValues="defaultSearchValues"
|
|
- @search="(val) => getData(1, val)"
|
|
|
|
- @reset="getData(1)"
|
|
|
|
|
|
+ @search="handleSearch"
|
|
|
|
+ @reset="handleReset"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
|
|
+ <!-- 状态Tab切换 -->
|
|
|
|
+ <el-tabs class="sa-tabs" v-model="currentStatus" @tab-change="handleTabChange">
|
|
|
|
+ <el-tab-pane label="全部" name="all"></el-tab-pane>
|
|
|
|
+ <el-tab-pane label="处理中" name="1"></el-tab-pane>
|
|
|
|
+ <el-tab-pane label="审核通过" name="2"></el-tab-pane>
|
|
|
|
+ <el-tab-pane label="审核拒绝" name="3"></el-tab-pane>
|
|
|
|
+ <el-tab-pane label="提现成功" name="4"></el-tab-pane>
|
|
|
|
+ <el-tab-pane label="提现失败" name="5"></el-tab-pane>
|
|
|
|
+ <el-tab-pane label="超时取消" name="6"></el-tab-pane>
|
|
|
|
+ </el-tabs>
|
|
<div class="sa-title sa-flex sa-row-between">
|
|
<div class="sa-title sa-flex sa-row-between">
|
|
<div class="label sa-flex">提款管理</div>
|
|
<div class="label sa-flex">提款管理</div>
|
|
<div>
|
|
<div>
|
|
@@ -26,47 +36,46 @@
|
|
class="sa-table"
|
|
class="sa-table"
|
|
:data="table.data"
|
|
:data="table.data"
|
|
@sort-change="fieldFilter"
|
|
@sort-change="fieldFilter"
|
|
- @row-dblclick="viewDetail"
|
|
|
|
row-key="id"
|
|
row-key="id"
|
|
stripe
|
|
stripe
|
|
>
|
|
>
|
|
<template #empty>
|
|
<template #empty>
|
|
<sa-empty />
|
|
<sa-empty />
|
|
</template>
|
|
</template>
|
|
- <el-table-column prop="order_no" label="提款订单号" min-width="180" sortable="custom">
|
|
|
|
|
|
+ <el-table-column prop="orderNo" label="提款订单号" min-width="180" sortable="custom">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
- <span class="sa-table-line-1">{{ scope.row.order_no || '-' }}</span>
|
|
|
|
|
|
+ <span class="sa-table-line-1">{{ scope.row.orderNo || '-' }}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="用户名" min-width="120">
|
|
<el-table-column label="用户名" min-width="120">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
<el-link type="primary" :underline="true" @click="viewUserDetail(scope.row)">
|
|
<el-link type="primary" :underline="true" @click="viewUserDetail(scope.row)">
|
|
- {{ scope.row.username || '-' }}
|
|
|
|
|
|
+ {{ scope.row.userName || '-' }}
|
|
</el-link>
|
|
</el-link>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column prop="phone" label="手机号" min-width="130" align="center">
|
|
|
|
|
|
+ <el-table-column prop="userPhone" label="手机号" min-width="130" align="center">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
- {{ scope.row.phone || '-' }}
|
|
|
|
|
|
+ {{ scope.row.userPhone || '-' }}
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="提款类型" min-width="100" align="center">
|
|
<el-table-column label="提款类型" min-width="100" align="center">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
- <el-tag :type="scope.row.withdraw_type === 'bank' ? 'info' : 'success'">
|
|
|
|
- {{ scope.row.withdraw_type_text || '-' }}
|
|
|
|
|
|
+ <el-tag :type="scope.row.accountType === 1 ? 'primary' : 'success'">
|
|
|
|
+ {{ getAccountTypeText(scope.row.accountType) }}
|
|
</el-tag>
|
|
</el-tag>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="提款渠道" min-width="100" align="center">
|
|
<el-table-column label="提款渠道" min-width="100" align="center">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
- <el-tag type="info">
|
|
|
|
- {{ scope.row.withdraw_channel_text || '-' }}
|
|
|
|
|
|
+ <el-tag :type="getChannelType(scope.row.channel)">
|
|
|
|
+ {{ getChannelText(scope.row.channel) }}
|
|
</el-tag>
|
|
</el-tag>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="币种" min-width="80" align="center">
|
|
<el-table-column label="币种" min-width="80" align="center">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
- {{ scope.row.currency || 'BDT' }}
|
|
|
|
|
|
+ {{ getCurrencyText(scope.row.currency) }}
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="提款金额" min-width="120" align="center">
|
|
<el-table-column label="提款金额" min-width="120" align="center">
|
|
@@ -75,33 +84,33 @@
|
|
<el-table-column label="状态" min-width="100" align="center">
|
|
<el-table-column label="状态" min-width="100" align="center">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
<el-tag :type="getStatusType(scope.row.status)">
|
|
<el-tag :type="getStatusType(scope.row.status)">
|
|
- {{ scope.row.status_text || '-' }}
|
|
|
|
|
|
+ {{ getStatusText(scope.row.status) }}
|
|
</el-tag>
|
|
</el-tag>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="收款银行" min-width="150" align="center">
|
|
<el-table-column label="收款银行" min-width="150" align="center">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
- {{ scope.row.bank_name || '-' }}
|
|
|
|
|
|
+ {{ scope.row.bank || '-' }}
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="收款账户名称" min-width="130" align="center">
|
|
<el-table-column label="收款账户名称" min-width="130" align="center">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
- {{ scope.row.account_name || '-' }}
|
|
|
|
|
|
+ {{ scope.row.bankAccountName || '-' }}
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="收款账户" min-width="160" align="center">
|
|
<el-table-column label="收款账户" min-width="160" align="center">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
- {{ scope.row.account_number || '-' }}
|
|
|
|
|
|
+ {{ scope.row.bankAccount || '-' }}
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column prop="create_time" label="下单时间" min-width="160" sortable="custom">
|
|
|
|
|
|
+ <el-table-column prop="transTime" label="下单时间" min-width="160" sortable="custom">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
- {{ scope.row.create_time || '-' }}
|
|
|
|
|
|
+ {{ scope.row.transTime || '-' }}
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="成功时间" min-width="160">
|
|
<el-table-column label="成功时间" min-width="160">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
- {{ scope.row.success_time || '--' }}
|
|
|
|
|
|
+ {{ scope.row.successTime || '--' }}
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column fixed="right" label="操作" min-width="80">
|
|
<el-table-column fixed="right" label="操作" min-width="80">
|
|
@@ -123,58 +132,74 @@
|
|
import { onMounted, reactive, ref } from 'vue';
|
|
import { onMounted, reactive, ref } from 'vue';
|
|
import { ElMessage } from 'element-plus';
|
|
import { ElMessage } from 'element-plus';
|
|
import { useModal, usePagination } from '@/sheep/hooks';
|
|
import { useModal, usePagination } from '@/sheep/hooks';
|
|
- import { withdrawMockData } from '@/sheep/mock/withdraw';
|
|
|
|
|
|
+ import { api, financeUtils } from '../finance.service';
|
|
import UserDetail from '../../user/list/detail.vue';
|
|
import UserDetail from '../../user/list/detail.vue';
|
|
import WithdrawDetail from './detail.vue';
|
|
import WithdrawDetail from './detail.vue';
|
|
|
|
+
|
|
const { pageData } = usePagination();
|
|
const { pageData } = usePagination();
|
|
|
|
|
|
|
|
+ // 当前状态标签
|
|
|
|
+ const currentStatus = ref('all');
|
|
|
|
+
|
|
|
|
+ // 当前搜索条件
|
|
|
|
+ const currentSearchParams = ref({});
|
|
|
|
+
|
|
// 搜索字段配置
|
|
// 搜索字段配置
|
|
const searchFields = reactive({
|
|
const searchFields = reactive({
|
|
- username: {
|
|
|
|
|
|
+ userName: {
|
|
type: 'input',
|
|
type: 'input',
|
|
label: '用户名',
|
|
label: '用户名',
|
|
placeholder: '请输入用户名',
|
|
placeholder: '请输入用户名',
|
|
width: 150,
|
|
width: 150,
|
|
},
|
|
},
|
|
- phone: {
|
|
|
|
|
|
+ userPhone: {
|
|
type: 'input',
|
|
type: 'input',
|
|
label: '手机号',
|
|
label: '手机号',
|
|
placeholder: '请输入手机号',
|
|
placeholder: '请输入手机号',
|
|
width: 150,
|
|
width: 150,
|
|
},
|
|
},
|
|
- order_no: {
|
|
|
|
|
|
+ orderNo: {
|
|
type: 'input',
|
|
type: 'input',
|
|
- label: '提款订单号',
|
|
|
|
|
|
+ label: '订单号',
|
|
placeholder: '请输入订单号',
|
|
placeholder: '请输入订单号',
|
|
width: 180,
|
|
width: 180,
|
|
},
|
|
},
|
|
- status: {
|
|
|
|
|
|
+ channel: {
|
|
type: 'select',
|
|
type: 'select',
|
|
- label: '提款状态',
|
|
|
|
- placeholder: '请选择状态',
|
|
|
|
|
|
+ label: '提现通道',
|
|
|
|
+ placeholder: '请选择通道',
|
|
width: 120,
|
|
width: 120,
|
|
options: [
|
|
options: [
|
|
- { label: '全部状态', value: 'all' },
|
|
|
|
- { label: '处理中', value: 'processing' },
|
|
|
|
- { label: '提款成功', value: 'success' },
|
|
|
|
- { label: '提款失败', value: 'failed' },
|
|
|
|
|
|
+ { label: 'TKPAY', value: 1 },
|
|
|
|
+ { label: '3QPAY', value: 2 },
|
|
],
|
|
],
|
|
},
|
|
},
|
|
- create_time: {
|
|
|
|
|
|
+ timeType: {
|
|
|
|
+ type: 'select',
|
|
|
|
+ label: '时间类型',
|
|
|
|
+ placeholder: '请选择时间类型',
|
|
|
|
+ width: 120,
|
|
|
|
+ options: [
|
|
|
|
+ { label: '下单时间', value: 1 },
|
|
|
|
+ { label: '成功时间', value: 2 },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ date_range: {
|
|
type: 'daterange',
|
|
type: 'daterange',
|
|
- label: '下单时间',
|
|
|
|
|
|
+ label: '时间范围',
|
|
placeholder: '请选择时间范围',
|
|
placeholder: '请选择时间范围',
|
|
- width: 240,
|
|
|
|
|
|
+ width: 400,
|
|
},
|
|
},
|
|
});
|
|
});
|
|
|
|
|
|
// 默认搜索值
|
|
// 默认搜索值
|
|
const defaultSearchValues = reactive({
|
|
const defaultSearchValues = reactive({
|
|
- username: '',
|
|
|
|
- phone: '',
|
|
|
|
- order_no: '',
|
|
|
|
- status: 'all',
|
|
|
|
- create_time: [],
|
|
|
|
|
|
+ userName: '',
|
|
|
|
+ userPhone: '',
|
|
|
|
+ orderNo: '',
|
|
|
|
+ channel: '',
|
|
|
|
+ timeType: 1, // 默认下单时间
|
|
|
|
+ date_range: [],
|
|
});
|
|
});
|
|
// 列表
|
|
// 列表
|
|
const table = reactive({
|
|
const table = reactive({
|
|
@@ -185,15 +210,13 @@
|
|
});
|
|
});
|
|
const loading = ref(true);
|
|
const loading = ref(true);
|
|
|
|
|
|
- // 获取状态类型
|
|
|
|
- function getStatusType(status) {
|
|
|
|
- const statusMap = {
|
|
|
|
- processing: 'warning',
|
|
|
|
- success: 'success',
|
|
|
|
- failed: 'danger',
|
|
|
|
- };
|
|
|
|
- return statusMap[status] || 'info';
|
|
|
|
- }
|
|
|
|
|
|
+ // 使用公共配置的函数
|
|
|
|
+ const getStatusType = (status) => financeUtils.getStatusType(status, 'withdraw');
|
|
|
|
+ const getStatusText = financeUtils.getWithdrawStatusText;
|
|
|
|
+ const getChannelType = financeUtils.getChannelType;
|
|
|
|
+ const getChannelText = financeUtils.getChannelText;
|
|
|
|
+ const getCurrencyText = financeUtils.getCurrencyText;
|
|
|
|
+ const getAccountTypeText = financeUtils.getAccountTypeText;
|
|
|
|
|
|
// 获取数据
|
|
// 获取数据
|
|
async function getData(page, searchParams = {}) {
|
|
async function getData(page, searchParams = {}) {
|
|
@@ -201,28 +224,28 @@
|
|
loading.value = true;
|
|
loading.value = true;
|
|
|
|
|
|
try {
|
|
try {
|
|
- // 处理时间范围参数
|
|
|
|
|
|
+ // 构建请求参数
|
|
let params = {
|
|
let params = {
|
|
page: pageData.page,
|
|
page: pageData.page,
|
|
size: pageData.size,
|
|
size: pageData.size,
|
|
- order: table.order,
|
|
|
|
- sort: table.sort,
|
|
|
|
...searchParams,
|
|
...searchParams,
|
|
};
|
|
};
|
|
|
|
|
|
// 处理日期范围
|
|
// 处理日期范围
|
|
- if (searchParams.create_time && searchParams.create_time.length === 2) {
|
|
|
|
- params.start_time = searchParams.create_time[0];
|
|
|
|
- params.end_time = searchParams.create_time[1];
|
|
|
|
- delete params.create_time;
|
|
|
|
|
|
+ if (searchParams.date_range && searchParams.date_range.length === 2) {
|
|
|
|
+ params.startTime = searchParams.date_range[0];
|
|
|
|
+ params.endTime = searchParams.date_range[1];
|
|
|
|
+ delete params.date_range;
|
|
}
|
|
}
|
|
|
|
|
|
- const result = withdrawMockData.getList(params);
|
|
|
|
- if (result.code == '200') {
|
|
|
|
- table.data = result.data.data;
|
|
|
|
- pageData.page = result.data.current_page;
|
|
|
|
- pageData.size = result.data.per_page;
|
|
|
|
- pageData.total = result.data.total;
|
|
|
|
|
|
+ // 调用真实API
|
|
|
|
+ const { code, data } = await api.withdraw.list(params, false);
|
|
|
|
+
|
|
|
|
+ if (code == '200') {
|
|
|
|
+ table.data = data.list || [];
|
|
|
|
+ pageData.page = data.pageNum || 1;
|
|
|
|
+ pageData.size = data.pageSize || 10;
|
|
|
|
+ pageData.total = data.total || 0;
|
|
}
|
|
}
|
|
} catch (error) {
|
|
} catch (error) {
|
|
console.error('获取数据失败:', error);
|
|
console.error('获取数据失败:', error);
|
|
@@ -231,6 +254,50 @@
|
|
loading.value = false;
|
|
loading.value = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ // 标签切换处理
|
|
|
|
+ const handleTabChange = (status) => {
|
|
|
|
+ currentStatus.value = status;
|
|
|
|
+
|
|
|
|
+ // 根据不同状态设置不同的筛选参数
|
|
|
|
+ let statusParams = {};
|
|
|
|
+
|
|
|
|
+ if (status !== 'all') {
|
|
|
|
+ statusParams.status = parseInt(status);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 整合搜索条件和状态筛选
|
|
|
|
+ const allParams = { ...currentSearchParams.value, ...statusParams };
|
|
|
|
+ getData(1, allParams);
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ // 搜索处理
|
|
|
|
+ const handleSearch = (searchParams) => {
|
|
|
|
+ currentSearchParams.value = searchParams;
|
|
|
|
+
|
|
|
|
+ // 获取当前tab的状态参数
|
|
|
|
+ let statusParams = {};
|
|
|
|
+ if (currentStatus.value !== 'all') {
|
|
|
|
+ statusParams.status = parseInt(currentStatus.value);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 整合搜索条件和状态筛选
|
|
|
|
+ const allParams = { ...searchParams, ...statusParams };
|
|
|
|
+ getData(1, allParams);
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ // 重置处理
|
|
|
|
+ const handleReset = () => {
|
|
|
|
+ currentSearchParams.value = {};
|
|
|
|
+
|
|
|
|
+ // 获取当前tab的状态参数
|
|
|
|
+ let statusParams = {};
|
|
|
|
+ if (currentStatus.value !== 'all') {
|
|
|
|
+ statusParams.status = parseInt(currentStatus.value);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ getData(1, statusParams);
|
|
|
|
+ };
|
|
|
|
+
|
|
// table 字段排序
|
|
// table 字段排序
|
|
function fieldFilter({ prop, order }) {
|
|
function fieldFilter({ prop, order }) {
|
|
table.order = order == 'ascending' ? 'asc' : 'desc';
|
|
table.order = order == 'ascending' ? 'asc' : 'desc';
|
|
@@ -252,6 +319,9 @@
|
|
// 审核操作后刷新列表
|
|
// 审核操作后刷新列表
|
|
getData();
|
|
getData();
|
|
},
|
|
},
|
|
|
|
+ close: () => {
|
|
|
|
+ getData();
|
|
|
|
+ },
|
|
},
|
|
},
|
|
);
|
|
);
|
|
}
|
|
}
|