This commit is contained in:
parent
fe641618e1
commit
4f0ba2fa59
|
|
@ -0,0 +1,6 @@
|
||||||
|
import { request } from '@/api';
|
||||||
|
|
||||||
|
// 获取跟单记录列表
|
||||||
|
export const getFollowListApi = (params: any) => {
|
||||||
|
return request.get('/orderRecords/followList', {...params})
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
import { request } from '@/api';
|
||||||
|
|
||||||
|
// 获取带单记录列表
|
||||||
|
export const getLeadListApi = (params: any) => {
|
||||||
|
return request.get('/orderRecords/singleList', {...params})
|
||||||
|
}
|
||||||
|
|
@ -349,11 +349,27 @@ const staticMenuList = ref<ElMenuItem[]>(
|
||||||
path: 'agent', // index="agent"
|
path: 'agent', // index="agent"
|
||||||
icon: 'UserFilled', // 对应 <UserFilled /> 图标
|
icon: 'UserFilled', // 对应 <UserFilled /> 图标
|
||||||
children: [
|
children: [
|
||||||
//客户统计
|
|
||||||
//客户列表
|
//客户列表
|
||||||
|
{
|
||||||
|
id: 132,
|
||||||
|
label: '客户列表',
|
||||||
|
path: '/agent/customerList', // index="13-2"
|
||||||
|
icon: ''
|
||||||
|
},
|
||||||
//客户交易订单
|
//客户交易订单
|
||||||
//返佣流水
|
{
|
||||||
|
id: 133,
|
||||||
|
label: '客户交易订单',
|
||||||
|
path: '/agent/customerTradeOrder', // index="13-3"
|
||||||
|
icon: ''
|
||||||
|
},
|
||||||
//客户资金流水
|
//客户资金流水
|
||||||
|
{
|
||||||
|
id: 135,
|
||||||
|
label: '客户资金流水',
|
||||||
|
path: '/agent/customerCapitalFlow', // index="13-5"
|
||||||
|
icon: ''
|
||||||
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
// 通知管理(子菜单)
|
// 通知管理(子菜单)
|
||||||
|
|
|
||||||
|
|
@ -334,6 +334,43 @@ const routes = [
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
//代理管理
|
||||||
|
{
|
||||||
|
path: 'agent',
|
||||||
|
name: 'Agent',
|
||||||
|
meta: {
|
||||||
|
title: '代理管理', // 左侧菜单显示的标题
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
//客户列表
|
||||||
|
{
|
||||||
|
path: 'customerList',
|
||||||
|
name: 'CustomerList',
|
||||||
|
component: () => import('@/views/agent/customerList/index.vue'),
|
||||||
|
meta: {
|
||||||
|
title: '客户列表', // 左侧菜单显示的标题
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//客户交易订单
|
||||||
|
{
|
||||||
|
path: 'customerTradeOrder',
|
||||||
|
name: 'CustomerTradeOrder',
|
||||||
|
component: () => import('@/views/agent/customerTradeOrder/index.vue'),
|
||||||
|
meta: {
|
||||||
|
title: '客户交易订单', // 左侧菜单显示的标题
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//客户资金流水
|
||||||
|
{
|
||||||
|
path: 'customerCapitalFlow',
|
||||||
|
name: 'CustomerCapitalFlow',
|
||||||
|
component: () => import('@/views/agent/customerCapitalFlow/index.vue'),
|
||||||
|
meta: {
|
||||||
|
title: '客户资金流水', // 左侧菜单显示的标题
|
||||||
|
}
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
客户资金流水
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
客户列表
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
客户交易订单
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
@ -1,5 +1,119 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="follow-record">
|
||||||
跟单记录
|
<!-- 搜索 -->
|
||||||
|
<FollowRecordSearch :search-form="searchForm" :search-options="searchOptions" @search="handleSearch"
|
||||||
|
@reset="handleReset">
|
||||||
|
<template #button="{ form }">
|
||||||
|
<el-button type="primary" @click="handleExport()">
|
||||||
|
导出
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</FollowRecordSearch>
|
||||||
|
<!-- 表格 -->
|
||||||
|
<FollowRecordTable :table-data="tableTree" :columns="tableColumnsOptions" row-key="id" />
|
||||||
|
|
||||||
|
<!-- 分页 -->
|
||||||
|
<FollowRecordPagination v-model="currentPage" v-model:pageSizeValue="pageSize" :total="total"
|
||||||
|
@change="handleChange" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
// 组件
|
||||||
|
import FollowRecordSearch from '@/components/common/Search.vue'
|
||||||
|
import FollowRecordTable from '@/components/common/Table.vue'
|
||||||
|
import FollowRecordPagination from '@/components/common/Pagination.vue'
|
||||||
|
// 配置以及表单验证
|
||||||
|
import { search, tableColumns } from './options'
|
||||||
|
|
||||||
|
// 接口
|
||||||
|
import { getFollowListApi } from '@/api/modules/personalized/followRecord'
|
||||||
|
|
||||||
|
// 导出表格
|
||||||
|
import { exportToExcel } from '@/utils/exportToExcel'
|
||||||
|
/**
|
||||||
|
* @description: 定义搜索数据
|
||||||
|
*/
|
||||||
|
const searchOptions = ref(search)
|
||||||
|
const searchForm = ref({
|
||||||
|
orderNo: '',
|
||||||
|
startTime: '',
|
||||||
|
endTime: '',
|
||||||
|
})
|
||||||
|
/**
|
||||||
|
* @description: 定义表格数据
|
||||||
|
*/
|
||||||
|
const tableTree = ref([])
|
||||||
|
const tableColumnsOptions = ref(tableColumns)
|
||||||
|
/**
|
||||||
|
* @description: 定义分页数据
|
||||||
|
*/
|
||||||
|
const currentPage = ref(1)
|
||||||
|
const pageSize = ref(10)
|
||||||
|
const total = ref(0)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 定义公共请求数据方法
|
||||||
|
*/
|
||||||
|
const getFollowList = async () => {
|
||||||
|
const params = {
|
||||||
|
page: currentPage.value,
|
||||||
|
page_size: pageSize.value,
|
||||||
|
start_time: searchForm.value.startTime.length > 0 ? `${searchForm.value.startTime} 0:00:00` : '2026-01-01 0:00:00',
|
||||||
|
end_time: searchForm.value.endTime.length > 0 ? `${searchForm.value.endTime} 23:59:59` : '2026-03-01 23:59:59',
|
||||||
|
order_no: searchForm.value.orderNo,
|
||||||
|
}
|
||||||
|
const data: any = await getFollowListApi(params)
|
||||||
|
// table数据映射
|
||||||
|
tableTree.value = data.data.map((item: any) => ({
|
||||||
|
orderNo: item.order_id,
|
||||||
|
followAccount: item.user.username,
|
||||||
|
symbol: item.variety_id,
|
||||||
|
tradeQty: item.num,
|
||||||
|
tradeTime: item.created_at,
|
||||||
|
closeProfit: '后续添加'
|
||||||
|
}))
|
||||||
|
|
||||||
|
//分页数据
|
||||||
|
total.value = data.total
|
||||||
|
currentPage.value = data.current_page
|
||||||
|
pageSize.value = Number(data.per_page)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 页面加载完成需要请求的数据
|
||||||
|
*/
|
||||||
|
onMounted(() => {
|
||||||
|
getFollowList()
|
||||||
|
})
|
||||||
|
/**
|
||||||
|
* @description: 定义搜索方法
|
||||||
|
*/
|
||||||
|
const handleSearch = async () => {
|
||||||
|
console.log("搜索");
|
||||||
|
getFollowList()
|
||||||
|
}
|
||||||
|
const handleReset = () => {
|
||||||
|
console.log('重置搜索')
|
||||||
|
searchForm.value = {
|
||||||
|
orderNo: '',
|
||||||
|
startTime: '',
|
||||||
|
endTime: '',
|
||||||
|
}
|
||||||
|
getFollowList()
|
||||||
|
}
|
||||||
|
const handleExport = () => {
|
||||||
|
exportToExcel({
|
||||||
|
tableData: tableTree.value,
|
||||||
|
columns: tableColumnsOptions.value,
|
||||||
|
title: '导出跟单记录',
|
||||||
|
defaultFileNamePrefix: '跟单记录',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @description: 定义分页方法
|
||||||
|
*/
|
||||||
|
const handleChange = (page: { currentPage: number, size: number }) => {
|
||||||
|
currentPage.value = page.currentPage
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
export const search = [
|
||||||
|
// 订单号
|
||||||
|
{ prop: 'orderNo', label: '订单号', type: 'input' as const, placeholder: '请输入订单号',width: '200px' },
|
||||||
|
//开始时间
|
||||||
|
{
|
||||||
|
prop: 'startTime', label: '开始时间', type: 'date' as const, dateType: 'date' as const, // 时间范围选择器
|
||||||
|
valueFormat: 'YYYY-MM-DD', placeholder: '请选择开始时间', width: '150px'
|
||||||
|
},
|
||||||
|
//结束时间
|
||||||
|
{
|
||||||
|
prop: 'endTime', label: '结束时间', type: 'date' as const, dateType: 'date' as const, // 时间范围选择器
|
||||||
|
valueFormat: 'YYYY-MM-DD', placeholder: '请选择结束时间', width: '150px'
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
export const tableColumns = [
|
||||||
|
// 订单号
|
||||||
|
{ prop: 'orderNo', label: '订单号' },
|
||||||
|
// 跟单账户
|
||||||
|
{ prop: 'followAccount', label: '跟单账户' },
|
||||||
|
// 交易品种
|
||||||
|
{ prop: 'symbol', label: '交易品种' },
|
||||||
|
// 交易数量
|
||||||
|
{ prop: 'tradeQty', label: '交易数量' },
|
||||||
|
// 交易时间
|
||||||
|
{ prop: 'tradeTime', label: '交易时间' },
|
||||||
|
// 平仓盈亏
|
||||||
|
{ prop: 'closeProfit', label: '平仓盈亏' },
|
||||||
|
]
|
||||||
|
|
@ -1,5 +1,119 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="follow-record">
|
||||||
带单记录
|
<!-- 搜索 -->
|
||||||
|
<LeadRecordSearch :search-form="searchForm" :search-options="searchOptions" @search="handleSearch"
|
||||||
|
@reset="handleReset">
|
||||||
|
<template #button="{ form }">
|
||||||
|
<el-button type="primary" @click="handleExport()">
|
||||||
|
导出
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</LeadRecordSearch>
|
||||||
|
<!-- 表格 -->
|
||||||
|
<LeadRecordTable :table-data="tableTree" :columns="tableColumnsOptions" row-key="id" />
|
||||||
|
|
||||||
|
<!-- 分页 -->
|
||||||
|
<LeadRecordPagination v-model="currentPage" v-model:pageSizeValue="pageSize" :total="total"
|
||||||
|
@change="handleChange" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
// 组件
|
||||||
|
import LeadRecordSearch from '@/components/common/Search.vue'
|
||||||
|
import LeadRecordTable from '@/components/common/Table.vue'
|
||||||
|
import LeadRecordPagination from '@/components/common/Pagination.vue'
|
||||||
|
// 配置以及表单验证
|
||||||
|
import { search, tableColumns } from './options'
|
||||||
|
|
||||||
|
// 接口
|
||||||
|
import { getFollowListApi } from '@/api/modules/personalized/followRecord'
|
||||||
|
|
||||||
|
// 导出表格
|
||||||
|
import { exportToExcel } from '@/utils/exportToExcel'
|
||||||
|
/**
|
||||||
|
* @description: 定义搜索数据
|
||||||
|
*/
|
||||||
|
const searchOptions = ref(search)
|
||||||
|
const searchForm = ref({
|
||||||
|
orderNo: '',
|
||||||
|
startTime: '',
|
||||||
|
endTime: '',
|
||||||
|
})
|
||||||
|
/**
|
||||||
|
* @description: 定义表格数据
|
||||||
|
*/
|
||||||
|
const tableTree = ref([])
|
||||||
|
const tableColumnsOptions = ref(tableColumns)
|
||||||
|
/**
|
||||||
|
* @description: 定义分页数据
|
||||||
|
*/
|
||||||
|
const currentPage = ref(1)
|
||||||
|
const pageSize = ref(10)
|
||||||
|
const total = ref(0)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 定义公共请求数据方法
|
||||||
|
*/
|
||||||
|
const getFollowList = async () => {
|
||||||
|
const params = {
|
||||||
|
page: currentPage.value,
|
||||||
|
page_size: pageSize.value,
|
||||||
|
start_time: searchForm.value.startTime.length > 0 ? `${searchForm.value.startTime} 0:00:00` : '2026-01-01 0:00:00',
|
||||||
|
end_time: searchForm.value.endTime.length > 0 ? `${searchForm.value.endTime} 23:59:59` : '2026-03-01 23:59:59',
|
||||||
|
order_no: searchForm.value.orderNo,
|
||||||
|
}
|
||||||
|
const data: any = await getFollowListApi(params)
|
||||||
|
// table数据映射
|
||||||
|
tableTree.value = data.data.map((item: any) => ({
|
||||||
|
orderNo: item.order_id,
|
||||||
|
followAccount: item.user.username,
|
||||||
|
symbol: item.variety_id,
|
||||||
|
tradeQty: item.num,
|
||||||
|
tradeTime: item.created_at,
|
||||||
|
closeProfit: '后续添加'
|
||||||
|
}))
|
||||||
|
|
||||||
|
//分页数据
|
||||||
|
total.value = data.total
|
||||||
|
currentPage.value = data.current_page
|
||||||
|
pageSize.value = Number(data.per_page)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 页面加载完成需要请求的数据
|
||||||
|
*/
|
||||||
|
onMounted(() => {
|
||||||
|
getFollowList()
|
||||||
|
})
|
||||||
|
/**
|
||||||
|
* @description: 定义搜索方法
|
||||||
|
*/
|
||||||
|
const handleSearch = async () => {
|
||||||
|
console.log("搜索");
|
||||||
|
getFollowList()
|
||||||
|
}
|
||||||
|
const handleReset = () => {
|
||||||
|
console.log('重置搜索')
|
||||||
|
searchForm.value = {
|
||||||
|
orderNo: '',
|
||||||
|
startTime: '',
|
||||||
|
endTime: '',
|
||||||
|
}
|
||||||
|
getFollowList()
|
||||||
|
}
|
||||||
|
const handleExport = () => {
|
||||||
|
exportToExcel({
|
||||||
|
tableData: tableTree.value,
|
||||||
|
columns: tableColumnsOptions.value,
|
||||||
|
title: '导出带单记录',
|
||||||
|
defaultFileNamePrefix: '带单记录',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @description: 定义分页方法
|
||||||
|
*/
|
||||||
|
const handleChange = (page: { currentPage: number, size: number }) => {
|
||||||
|
currentPage.value = page.currentPage
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
export const search = [
|
||||||
|
// 订单号
|
||||||
|
{ prop: 'orderNo', label: '订单号', type: 'input' as const, placeholder: '请输入订单号',width: '200px' },
|
||||||
|
//开始时间
|
||||||
|
{
|
||||||
|
prop: 'startTime', label: '开始时间', type: 'date' as const, dateType: 'date' as const, // 时间范围选择器
|
||||||
|
valueFormat: 'YYYY-MM-DD', placeholder: '请选择开始时间', width: '150px'
|
||||||
|
},
|
||||||
|
//结束时间
|
||||||
|
{
|
||||||
|
prop: 'endTime', label: '结束时间', type: 'date' as const, dateType: 'date' as const, // 时间范围选择器
|
||||||
|
valueFormat: 'YYYY-MM-DD', placeholder: '请选择结束时间', width: '150px'
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
export const tableColumns = [
|
||||||
|
// 订单号
|
||||||
|
{ prop: 'orderNo', label: '订单号' },
|
||||||
|
// 跟单账户
|
||||||
|
{ prop: 'followAccount', label: '跟单账户' },
|
||||||
|
// 交易品种
|
||||||
|
{ prop: 'symbol', label: '交易品种' },
|
||||||
|
// 交易数量
|
||||||
|
{ prop: 'tradeQty', label: '交易数量' },
|
||||||
|
// 交易时间
|
||||||
|
{ prop: 'tradeTime', label: '交易时间' },
|
||||||
|
// 平仓盈亏
|
||||||
|
{ prop: 'closeProfit', label: '平仓盈亏' },
|
||||||
|
]
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
<PositionStatTable :table-data="tableTree" :columns="tableColumnsOptions" row-key="id" />
|
<PositionStatTable :table-data="tableTree" :columns="tableColumnsOptions" row-key="id" />
|
||||||
|
|
||||||
<!-- 分页 -->
|
<!-- 分页 -->
|
||||||
<PositionStatPagination :current-page="currentPage" :page-size="pageSize" :total="total" @change="handleChange" />
|
<PositionStatPagination v-model="currentPage" v-model:pageSizeValue="pageSize" :total="total" @change="handleChange" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue