2025-09-08
转账管理完成 其他部分修改 去掉个人资料
This commit is contained in:
@@ -87,7 +87,7 @@
|
||||
<template #title>数据库监控</template>
|
||||
</el-menu-item> -->
|
||||
|
||||
<el-menu-item index="/profile">
|
||||
<el-menu-item v-if="false" index="/profile">
|
||||
<el-icon><UserFilled /></el-icon>
|
||||
<template #title>个人资料</template>
|
||||
</el-menu-item>
|
||||
@@ -149,15 +149,15 @@
|
||||
</div>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item command="profile">
|
||||
<el-dropdown-item v-if="false" command="profile">
|
||||
<el-icon><UserFilled /></el-icon>
|
||||
个人资料
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item command="changePassword">
|
||||
<el-dropdown-item v-if="false" command="changePassword">
|
||||
<el-icon><Lock /></el-icon>
|
||||
修改密码
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item divided command="logout">
|
||||
<el-dropdown-item command="logout">
|
||||
<el-icon><SwitchButton /></el-icon>
|
||||
退出登录
|
||||
</el-dropdown-item>
|
||||
|
||||
@@ -35,7 +35,7 @@ export const getImageUrl = (imagePath) => {
|
||||
// 如果图片路径以/uploads开头,直接返回原路径
|
||||
if (imagePath.startsWith('/uploads')) {
|
||||
// console.log('Image starts with /uploads, returning original path:', imagePath)
|
||||
return `${imagePath}`
|
||||
return `${cleanBaseURL}/jurongquan${imagePath}`
|
||||
}
|
||||
|
||||
// 在开发环境下,也需要根据路径前缀处理
|
||||
|
||||
@@ -167,8 +167,8 @@
|
||||
</el-icon>
|
||||
</el-avatar>
|
||||
<div class="activity-info">
|
||||
<div class="activity-title">{{ user.username }}</div>
|
||||
<div class="activity-desc">{{ user.phone }}</div>
|
||||
<div class="activity-title">{{ maskPhoneNumber(user.username) }}</div>
|
||||
<div class="activity-desc">{{ maskPhoneNumber(user.phone) }}</div>
|
||||
<div class="activity-time">{{ formatTime(user.created_at) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -202,7 +202,7 @@
|
||||
</div>
|
||||
<div class="activity-info">
|
||||
<div class="activity-title">+{{ commission.commission_amount }}</div>
|
||||
<div class="activity-desc">{{ commission.username+'('+commission.real_name+')' }}</div>
|
||||
<div class="activity-desc">{{ maskPhoneNumber(commission.username) + '('+ maskPhoneNumber(commission.real_name) +')' }}</div>
|
||||
<div class="activity-time">{{ formatTime(commission.created_at) }}</div>
|
||||
</div>
|
||||
<!-- <el-tag type="info" size="small">-->
|
||||
@@ -246,6 +246,7 @@ import {
|
||||
LegendComponent,
|
||||
GridComponent
|
||||
} from 'echarts/components'
|
||||
import {maskPhoneNumber} from "../utils/public_method";
|
||||
|
||||
// 注册 ECharts 组件
|
||||
use([
|
||||
|
||||
@@ -9,44 +9,64 @@
|
||||
<div class="search-section">
|
||||
<el-card>
|
||||
<el-form :model="searchForm" inline>
|
||||
<el-form-item label="用户手机号">
|
||||
<el-form-item label="关键词">
|
||||
<el-input
|
||||
v-model="searchForm.phone"
|
||||
placeholder="请输入用户手机号"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
v-model="searchForm.search"
|
||||
placeholder="请输入用户名或手机号"
|
||||
clearable
|
||||
style="width: 250px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="转账类型">
|
||||
<el-select
|
||||
v-model="searchForm.type"
|
||||
placeholder="请选择转账类型"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
>
|
||||
<el-option label="全部" value="" />
|
||||
<el-option label="转入" value="in" />
|
||||
<el-option label="转出" value="out" />
|
||||
</el-select>
|
||||
<!-- <el-form-item label="转账类型">-->
|
||||
<!-- <el-select-->
|
||||
<!-- v-model="searchForm.type"-->
|
||||
<!-- placeholder="请选择转账类型"-->
|
||||
<!-- clearable-->
|
||||
<!-- style="width: 150px"-->
|
||||
<!-- >-->
|
||||
<!-- <el-option label="全部" value=""/>-->
|
||||
<!-- <el-option label="转入" value="in"/>-->
|
||||
<!-- <el-option label="转出" value="out"/>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="最小金额">
|
||||
<el-input
|
||||
type="number"
|
||||
v-model="searchForm.min_amount"
|
||||
placeholder="请输入最小金额"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="最大金额">
|
||||
<el-input
|
||||
type="number"
|
||||
v-model="searchForm.max_amount"
|
||||
placeholder="请输入最大金额"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="时间范围">
|
||||
<el-date-picker
|
||||
v-model="searchForm.dateRange"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
v-model="searchForm.dateRange"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleSearch">
|
||||
<el-icon><Search /></el-icon>
|
||||
<el-icon>
|
||||
<Search/>
|
||||
</el-icon>
|
||||
搜索
|
||||
</el-button>
|
||||
<el-button @click="handleReset">
|
||||
<el-icon><Refresh /></el-icon>
|
||||
<el-icon>
|
||||
<Refresh/>
|
||||
</el-icon>
|
||||
重置
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
@@ -61,10 +81,12 @@
|
||||
<el-card class="stats-card">
|
||||
<div class="stats-content">
|
||||
<div class="stats-icon">
|
||||
<el-icon color="#409EFF"><Money /></el-icon>
|
||||
<el-icon color="#409EFF">
|
||||
<Money/>
|
||||
</el-icon>
|
||||
</div>
|
||||
<div class="stats-info">
|
||||
<div class="stats-value">{{ transferStats.totalAmount || 0 }}</div>
|
||||
<div class="stats-value">{{ transferStats.total_amount || 0 }}</div>
|
||||
<div class="stats-label">总转账金额</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -74,10 +96,12 @@
|
||||
<el-card class="stats-card">
|
||||
<div class="stats-content">
|
||||
<div class="stats-icon">
|
||||
<el-icon color="#67C23A"><TrendCharts /></el-icon>
|
||||
<el-icon color="#67C23A">
|
||||
<TrendCharts/>
|
||||
</el-icon>
|
||||
</div>
|
||||
<div class="stats-info">
|
||||
<div class="stats-value">{{ transferStats.totalCount || 0 }}</div>
|
||||
<div class="stats-value">{{ transferStats.total_transfers || 0 }}</div>
|
||||
<div class="stats-label">总转账笔数</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -87,11 +111,13 @@
|
||||
<el-card class="stats-card">
|
||||
<div class="stats-content">
|
||||
<div class="stats-icon">
|
||||
<el-icon color="#E6A23C"><ArrowUp /></el-icon>
|
||||
<el-icon color="#E6A23C">
|
||||
<Coin/>
|
||||
</el-icon>
|
||||
</div>
|
||||
<div class="stats-info">
|
||||
<div class="stats-value">{{ transferStats.inAmount || 0 }}</div>
|
||||
<div class="stats-label">转入金额</div>
|
||||
<div class="stats-value">{{ transferStats.today_amount || 0 }}</div>
|
||||
<div class="stats-label">今日账金额</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
@@ -100,11 +126,13 @@
|
||||
<el-card class="stats-card">
|
||||
<div class="stats-content">
|
||||
<div class="stats-icon">
|
||||
<el-icon color="#F56C6C"><ArrowDown /></el-icon>
|
||||
<el-icon color="#F56C6C">
|
||||
<List/>
|
||||
</el-icon>
|
||||
</div>
|
||||
<div class="stats-info">
|
||||
<div class="stats-value">{{ transferStats.outAmount || 0 }}</div>
|
||||
<div class="stats-label">转出金额</div>
|
||||
<div class="stats-value">{{ transferStats.today_transfers || 0 }}</div>
|
||||
<div class="stats-label">今日账笔数</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
@@ -116,46 +144,41 @@
|
||||
<div class="table-section">
|
||||
<el-card>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="transferList"
|
||||
stripe
|
||||
style="width: 100%"
|
||||
v-loading="loading"
|
||||
:data="transferList"
|
||||
stripe
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column prop="id" label="记录ID" width="100" />
|
||||
<el-table-column label="用户手机号" >
|
||||
<el-table-column prop="id" label="记录ID" width="100"/>
|
||||
<el-table-column label="转账流向">
|
||||
<template v-slot="scope">
|
||||
{{scope.row.from_real_name + '('+ maskPhoneNumber(scope.row.from_phone) +')->' + scope.row.to_real_name + '('+maskPhoneNumber(scope.row.to_phone)+')' }}
|
||||
{{
|
||||
scope.row.from_real_name + '(' + maskPhoneNumber(scope.row.from_phone) + ')->' + scope.row.to_real_name + '(' + maskPhoneNumber(scope.row.to_phone) + ')'
|
||||
}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="userName" label="用户姓名" width="100" />-->
|
||||
<!-- <el-table-column label="转账类型" width="100">-->
|
||||
<!-- <template v-slot="scope">-->
|
||||
<!-- <el-tag>-->
|
||||
<!-- <span v-if="scope.row.type=='deposit'">押金</span>-->
|
||||
<!-- <span v-if="scope.row.type=='withdraw'">撤回</span>-->
|
||||
<!-- <span v-if="scope.row.type=='transfer'">转账</span>-->
|
||||
<!-- </el-tag>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column prop="amount" label="转账金额" width="120">
|
||||
<!-- <el-table-column prop="userName" label="用户姓名" width="100" />-->
|
||||
<!-- <el-table-column label="转账类型" width="100">-->
|
||||
<!-- <template v-slot="scope">-->
|
||||
<!-- <el-tag>-->
|
||||
<!-- <span v-if="scope.row.type=='deposit'">押金</span>-->
|
||||
<!-- <span v-if="scope.row.type=='withdraw'">撤回</span>-->
|
||||
<!-- <span v-if="scope.row.type=='transfer'">转账</span>-->
|
||||
<!-- </el-tag>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column prop="amount" label="转账金额">
|
||||
<template #default="{ row }">
|
||||
<span :class="row.type === 'in' ? 'amount-in' : 'amount-out'">
|
||||
{{ row.type === 'in' ? '+' : '-' }}{{ row.amount }}
|
||||
<!-- :class="row.type === 'in' ? 'amount-in' : 'amount-out'"-->
|
||||
<span>
|
||||
{{ row.amount }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="balance" label="余额" width="120" />
|
||||
<el-table-column prop="description" label="转账说明" min-width="150" />
|
||||
<el-table-column prop="description" label="转账说明"/>
|
||||
<el-table-column prop="createdAt" label="转账时间" width="180">
|
||||
<template #default="{ row }">
|
||||
{{ formatIsoToCustom(row.created_at) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="getStatusType(row.status)">
|
||||
{{ getStatusText(row.status) }}
|
||||
</el-tag>
|
||||
{{ row.created_at }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -163,13 +186,13 @@
|
||||
<!-- 分页 -->
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
v-model:current-page="pagination.page"
|
||||
v-model:page-size="pagination.size"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:total="pagination.total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
v-model:current-page="pagination.page"
|
||||
v-model:page-size="pagination.size"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:total="pagination.total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
@@ -178,8 +201,8 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import {ref, reactive, onMounted} from 'vue'
|
||||
import {ElMessage} from 'element-plus'
|
||||
import {
|
||||
Search,
|
||||
Refresh,
|
||||
@@ -195,19 +218,28 @@ import {formatIsoToCustom, maskPhoneNumber} from '@/utils/public_method'
|
||||
// 响应式数据
|
||||
const loading = ref(false)
|
||||
const transferList = ref([])
|
||||
const transferStats = ref({})
|
||||
const transferStats = ref({
|
||||
completed_transfers: 0, // 已完成转移
|
||||
failed_transfers: 0, // 失败传输
|
||||
pending_transfers: 0, // 等待传输
|
||||
today_amount: 0, // 今日数量
|
||||
today_transfers: 0, // 今日转账
|
||||
total_amount: 0, // 总计数量
|
||||
total_transfers: 0 // 总计传输次数
|
||||
})
|
||||
|
||||
// 搜索表单
|
||||
const searchForm = reactive({
|
||||
phone: '',
|
||||
type: '',
|
||||
dateRange: []
|
||||
search: '',
|
||||
dateRange: [],
|
||||
min_amount: null,
|
||||
max_amount: null,
|
||||
})
|
||||
|
||||
// 分页信息
|
||||
const pagination = reactive({
|
||||
page: 1,
|
||||
size: 20,
|
||||
size: 50,
|
||||
total: 0
|
||||
})
|
||||
|
||||
@@ -218,61 +250,42 @@ const getTransferList = async () => {
|
||||
const params = {
|
||||
page: pagination.page,
|
||||
size: pagination.size,
|
||||
phone: searchForm.phone,
|
||||
type: searchForm.type
|
||||
search: searchForm.search,
|
||||
min_amount: searchForm.min_amount,
|
||||
max_amount: searchForm.max_amount
|
||||
}
|
||||
|
||||
|
||||
if (searchForm.dateRange && searchForm.dateRange.length === 2) {
|
||||
params.startDate = searchForm.dateRange[0]
|
||||
params.endDate = searchForm.dateRange[1]
|
||||
params.start_date = searchForm.dateRange[0]
|
||||
params.end_date = searchForm.dateRange[1].split(" ")[0] + ' 23:59:59'
|
||||
}
|
||||
|
||||
|
||||
const response = await api.transfers.getList(params)
|
||||
transferList.value = response.data.data.transfers
|
||||
pagination.total = response.data.data.pagination.total
|
||||
transferStats.value = response.data.data.stats
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
ElMessage.error('获取转账记录失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 获取转账统计
|
||||
const getTransferStats = async () => {
|
||||
try {
|
||||
const params = {
|
||||
phone: searchForm.phone,
|
||||
type: searchForm.type
|
||||
}
|
||||
|
||||
if (searchForm.dateRange && searchForm.dateRange.length === 2) {
|
||||
params.startDate = searchForm.dateRange[0]
|
||||
params.endDate = searchForm.dateRange[1]
|
||||
}
|
||||
|
||||
const response = await api.transfers.getStats(params)
|
||||
transferStats.value = response.data
|
||||
} catch (error) {
|
||||
ElMessage.error('获取统计数据失败')
|
||||
}
|
||||
}
|
||||
|
||||
// 搜索
|
||||
const handleSearch = () => {
|
||||
pagination.page = 1
|
||||
getTransferList()
|
||||
// getTransferStats()
|
||||
}
|
||||
|
||||
// 重置
|
||||
const handleReset = () => {
|
||||
searchForm.phone = ''
|
||||
searchForm.type = ''
|
||||
searchForm.search = ''
|
||||
searchForm.dateRange = []
|
||||
searchForm.min_amount = null
|
||||
searchForm.max_amount = null
|
||||
pagination.page = 1
|
||||
getTransferList()
|
||||
// getTransferStats()
|
||||
}
|
||||
|
||||
// 分页大小改变
|
||||
@@ -322,7 +335,6 @@ const getStatusText = (status) => {
|
||||
// 组件挂载时获取数据
|
||||
onMounted(() => {
|
||||
getTransferList()
|
||||
// getTransferStats()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -327,10 +327,6 @@ const handleSearch = () => {
|
||||
const handleReset = () => {
|
||||
Object.assign(searchForm, {
|
||||
keyword: '',
|
||||
status: '',
|
||||
city: '',
|
||||
district: '',
|
||||
sort: 'created_at_desc'
|
||||
})
|
||||
pagination.page = 1
|
||||
fetchUsers()
|
||||
|
||||
Reference in New Issue
Block a user