|
@ -1,40 +1,42 @@ |
|
|
<template> |
|
|
<template> |
|
|
|
|
|
<el-tabs v-model="activeName" type="card" @tab-click="handleClick"> |
|
|
|
|
|
<el-tab-pane label="金币查询(新)" name="new"></el-tab-pane> |
|
|
|
|
|
<el-tab-pane label="金币查询(旧)" name="old"></el-tab-pane> |
|
|
|
|
|
</el-tabs> |
|
|
<el-card> |
|
|
<el-card> |
|
|
<el-text size="large>">姓名:</el-text> |
|
|
|
|
|
|
|
|
<el-text size="large">姓名:</el-text> |
|
|
<el-input v-model="searchObj.name" placeholder="请输入姓名" style="width: 12vw;margin-right:1vw" |
|
|
<el-input v-model="searchObj.name" placeholder="请输入姓名" style="width: 12vw;margin-right:1vw" |
|
|
clearable></el-input> |
|
|
clearable></el-input> |
|
|
<el-text size="large>">精网号:</el-text> |
|
|
|
|
|
|
|
|
<el-text size="large">精网号:</el-text> |
|
|
<el-input v-model="searchObj.jwcode" placeholder="请输入精网号" style="width: 12vw;margin-right:1vw" |
|
|
<el-input v-model="searchObj.jwcode" placeholder="请输入精网号" style="width: 12vw;margin-right:1vw" |
|
|
clearable></el-input> |
|
|
clearable></el-input> |
|
|
<el-text size="large" style="width: 80px">充值时间:</el-text> |
|
|
<el-text size="large" style="width: 80px">充值时间:</el-text> |
|
|
<el-date-picker v-model="dateRange" type="datetimerange" range-separator="至" start-placeholder="开始时间" |
|
|
<el-date-picker v-model="dateRange" type="datetimerange" range-separator="至" start-placeholder="开始时间" |
|
|
end-placeholder="结束时间" style="width: 25vw;margin-right:1vw" @change="handleDatePickerChange" /> |
|
|
|
|
|
<el-button @click="getToday()" :type="activeTimeRange === 'today' ? 'primary' : ''">今</el-button> |
|
|
|
|
|
<el-button @click="getYesterday()" :type="activeTimeRange === 'yesterday' ? 'primary' : ''">昨</el-button> |
|
|
|
|
|
<el-button @click="get7Days()" :type="activeTimeRange === '7days' ? 'primary' : ''">近7天</el-button> |
|
|
|
|
|
|
|
|
end-placeholder="结束时间" style="width: 25vw;margin-right:1vw" @change="handleDatePickerChange" :default-time="defaultTime"/> |
|
|
<el-button type="success" @click="resetSearch">重置</el-button> |
|
|
<el-button type="success" @click="resetSearch">重置</el-button> |
|
|
<el-button type="primary" @click="get">查询</el-button> |
|
|
|
|
|
|
|
|
<el-button type="primary" v-if="activeName == 'new'" @click="get">查询</el-button> |
|
|
|
|
|
<el-button type="primary" v-else-if="activeName == 'old'" @click="getOld">查询</el-button> |
|
|
</el-card> |
|
|
</el-card> |
|
|
<el-card style="margin-top:10px"> |
|
|
<el-card style="margin-top:10px"> |
|
|
<el-table :data="tableData"> |
|
|
|
|
|
<el-table-column type="index" label="序号" width="55"> |
|
|
|
|
|
|
|
|
<el-table :data="tableData" style="width: 100%" height="600"> |
|
|
|
|
|
<el-table-column type="index" label="序号" width="55" header-align="center" align="center"> |
|
|
<template #default="scope"> |
|
|
<template #default="scope"> |
|
|
{{ scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize }} |
|
|
|
|
|
|
|
|
{{ scope.$index + 1 + (pagination.pageNum - 1) * pagination.pageSize }} |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column prop="name" label="客户姓名" width="120" show-overflow-tooltip /> |
|
|
<el-table-column prop="name" label="客户姓名" width="120" show-overflow-tooltip /> |
|
|
<el-table-column prop="jwcode" label="精网号" width="120" /> |
|
|
|
|
|
<el-table-column prop="" label="数量" width="120" /> |
|
|
|
|
|
<el-table-column prop="" label="更新类型" width="120" /> |
|
|
|
|
|
<el-table-column prop="" label="免费金币" width="120" /> |
|
|
|
|
|
<el-table-column prop="" label="永久金币" width="120" /> |
|
|
|
|
|
<el-table-column prop="" label="任务金币" width="120" /> |
|
|
|
|
|
<el-table-column prop="" label="操作人" width="120" /> |
|
|
|
|
|
<el-table-column prop="" label="更新时间" width="120" /> |
|
|
|
|
|
<el-table-column prop="" label="备注" width="120" /> |
|
|
|
|
|
|
|
|
<el-table-column prop="jwcode" label="精网号" width="130" header-align="center" align="center"/> |
|
|
|
|
|
<el-table-column prop="num" label="数量" width="120" header-align="center" align="center"/> |
|
|
|
|
|
<el-table-column prop="updateType" show-overflow-tooltip label="更新类型" width="150" header-align="center" align="center"/> |
|
|
|
|
|
<el-table-column v-if="activeName === 'new'" prop="freeGold" label="免费金币" width="120" header-align="center" align="center"/> |
|
|
|
|
|
<el-table-column v-if="activeName === 'new'" prop="permanentGold" label="永久金币" width="120" header-align="center" align="center"/> |
|
|
|
|
|
<el-table-column v-if="activeName === 'new'" prop="taskGold" label="任务金币" width="120" header-align="center" align="center"/> |
|
|
|
|
|
<el-table-column prop="operator" label="操作人" width="130" /> |
|
|
|
|
|
<el-table-column prop="createTime" label="更新时间" width="200" header-align="center" align="center"/> |
|
|
|
|
|
<el-table-column prop="remark" label="备注" show-overflow-tooltip min-width="250" header-align="center" align="center"/> |
|
|
</el-table> |
|
|
</el-table> |
|
|
<el-pagination class="pagination" v-model:current-page="pagination.pageNum" |
|
|
|
|
|
|
|
|
<el-pagination background style="margin-top:20px" v-model:current-page="pagination.pageNum" |
|
|
v-model:page-size="pagination.pageSize" layout="total, sizes, prev, pager, next, jumper" |
|
|
v-model:page-size="pagination.pageSize" layout="total, sizes, prev, pager, next, jumper" |
|
|
:total="pagination.total" @size-change="handlePageSizeChange" |
|
|
:total="pagination.total" @size-change="handlePageSizeChange" |
|
|
@current-change="handleCurrentChange"></el-pagination> |
|
|
@current-change="handleCurrentChange"></el-pagination> |
|
@ -43,14 +45,38 @@ |
|
|
<script setup> |
|
|
<script setup> |
|
|
import { onMounted, ref } from 'vue' |
|
|
import { onMounted, ref } from 'vue' |
|
|
import { ElMessage } from 'element-plus' |
|
|
import { ElMessage } from 'element-plus' |
|
|
import API from '@/util/http' |
|
|
|
|
|
|
|
|
import API from '@/util/http.js' |
|
|
import moment from 'moment' |
|
|
import moment from 'moment' |
|
|
import { useAdminStore } from "@/store/index.js" |
|
|
import { useAdminStore } from "@/store/index.js" |
|
|
import { storeToRefs } from "pinia" |
|
|
import { storeToRefs } from "pinia" |
|
|
|
|
|
import dayjs from 'dayjs' |
|
|
const adminStore = useAdminStore() |
|
|
const adminStore = useAdminStore() |
|
|
const { adminData, menuTree } = storeToRefs(adminStore) |
|
|
const { adminData, menuTree } = storeToRefs(adminStore) |
|
|
import { permissionMapping, findMenuById } from "@/utils/menuTreePermission.js" |
|
|
import { permissionMapping, findMenuById } from "@/utils/menuTreePermission.js" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const defaultTime = [ |
|
|
|
|
|
new Date(2000, 1, 1, 0, 0, 0), |
|
|
|
|
|
new Date(2000, 2, 1, 23, 59, 59), |
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
const activeName = ref('new') |
|
|
|
|
|
const handleClick = function (tab) { |
|
|
|
|
|
//resetSearch() |
|
|
|
|
|
activeName.value = tab.props.name |
|
|
|
|
|
if (tab.props.name === 'new') { |
|
|
|
|
|
//selectNew() |
|
|
|
|
|
resetSearch() |
|
|
|
|
|
tableData.value = [] |
|
|
|
|
|
console.log('新的'); |
|
|
|
|
|
|
|
|
|
|
|
} else if (tab.props.name === 'old') { |
|
|
|
|
|
//selectOld() |
|
|
|
|
|
resetSearch() |
|
|
|
|
|
console.log('旧的'); |
|
|
|
|
|
tableData.value = [] |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
const tableData = ref([]) |
|
|
const tableData = ref([]) |
|
|
const dateRange = ref([]) |
|
|
const dateRange = ref([]) |
|
|
const searchObj = ref({ |
|
|
const searchObj = ref({ |
|
@ -62,18 +88,49 @@ const pagination = ref({ |
|
|
pageSize: 50, |
|
|
pageSize: 50, |
|
|
total: 0 |
|
|
total: 0 |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
//获取旧表数据 |
|
|
|
|
|
const getOld = async function () { |
|
|
|
|
|
if (findMenuById(menuTree.value, permissionMapping.History_Query)) { |
|
|
|
|
|
try { |
|
|
|
|
|
if (searchObj.value.name || searchObj.value.jwcode) { |
|
|
|
|
|
const res = await API({url:'/history/getOldHistoryRecord', |
|
|
|
|
|
data: { |
|
|
|
|
|
...searchObj.value, |
|
|
|
|
|
startTime: dateRange.value[0], |
|
|
|
|
|
endTime: dateRange.value[1], |
|
|
|
|
|
pageNum:pagination.value.pageNum, |
|
|
|
|
|
pageSize:pagination.value.pageSize, |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
tableData.value = res.data.list |
|
|
|
|
|
console.log('tableData.value',res.data.list); |
|
|
|
|
|
pagination.value.total = res.data.total |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
ElMessage.error('请输入姓名或精网号') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
ElMessage.error(e.message) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
//获取新表数据 |
|
|
const get = async function () { |
|
|
const get = async function () { |
|
|
if (findMenuById(menuTree.value, permissionMapping.History_Query)) { |
|
|
if (findMenuById(menuTree.value, permissionMapping.History_Query)) { |
|
|
try { |
|
|
try { |
|
|
if (!searchObj.value.name && !searchObj.value.jwcode) { |
|
|
|
|
|
const res = await API.get('/admin/history', { |
|
|
|
|
|
params: { |
|
|
|
|
|
|
|
|
if (searchObj.value.name || searchObj.value.jwcode) { |
|
|
|
|
|
const res = await API({url:'/history/getNewHistoryRecord', |
|
|
|
|
|
data: { |
|
|
...searchObj.value, |
|
|
...searchObj.value, |
|
|
startTime: dateRange.value[0], |
|
|
startTime: dateRange.value[0], |
|
|
endTime: dateRange.value[1] |
|
|
|
|
|
|
|
|
endTime: dateRange.value[1], |
|
|
|
|
|
pageNum:pagination.value.pageNum, |
|
|
|
|
|
pageSize:pagination.value.pageSize, |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
tableData.value = res.data |
|
|
|
|
|
|
|
|
tableData.value = res.data.list |
|
|
pagination.value.total = res.data.total |
|
|
pagination.value.total = res.data.total |
|
|
} else { |
|
|
} else { |
|
|
ElMessage.error('请输入姓名或精网号') |
|
|
ElMessage.error('请输入姓名或精网号') |
|
@ -84,14 +141,14 @@ const get = async function () { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const activeTimeRange = ref('') |
|
|
const resetSearch = function () { |
|
|
const resetSearch = function () { |
|
|
searchObj.value = { |
|
|
searchObj.value = { |
|
|
name: '', |
|
|
name: '', |
|
|
jwcode: '' |
|
|
jwcode: '' |
|
|
} |
|
|
} |
|
|
dateRange.value = [] |
|
|
dateRange.value = [] |
|
|
get() |
|
|
|
|
|
|
|
|
//get() |
|
|
} |
|
|
} |
|
|
const getToday = function () { |
|
|
const getToday = function () { |
|
|
const today = dayjs() |
|
|
const today = dayjs() |
|
@ -101,7 +158,6 @@ const getToday = function () { |
|
|
console.log('dateRange', dateRange.value) |
|
|
console.log('dateRange', dateRange.value) |
|
|
activeTimeRange.value = 'today' |
|
|
activeTimeRange.value = 'today' |
|
|
get() |
|
|
get() |
|
|
getStats() |
|
|
|
|
|
} |
|
|
} |
|
|
const getYesterday = function () { |
|
|
const getYesterday = function () { |
|
|
const today = dayjs() |
|
|
const today = dayjs() |
|
@ -111,7 +167,6 @@ const getYesterday = function () { |
|
|
console.log('dateRange', dateRange.value) |
|
|
console.log('dateRange', dateRange.value) |
|
|
activeTimeRange.value = 'yesterday' |
|
|
activeTimeRange.value = 'yesterday' |
|
|
get() |
|
|
get() |
|
|
getStats() |
|
|
|
|
|
} |
|
|
} |
|
|
const get7Days = function () { |
|
|
const get7Days = function () { |
|
|
const today = dayjs() |
|
|
const today = dayjs() |
|
@ -121,7 +176,6 @@ const get7Days = function () { |
|
|
console.log('dateRange', dateRange.value) |
|
|
console.log('dateRange', dateRange.value) |
|
|
activeTimeRange.value = '7days' |
|
|
activeTimeRange.value = '7days' |
|
|
get() |
|
|
get() |
|
|
getStats() |
|
|
|
|
|
} |
|
|
} |
|
|
const handleDatePickerChange = () => { |
|
|
const handleDatePickerChange = () => { |
|
|
activeTimeRange.value = '' |
|
|
activeTimeRange.value = '' |
|
@ -137,8 +191,8 @@ const handleCurrentChange = function (val) { |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style scoped> |
|
|
<style scoped> |
|
|
.pagination { |
|
|
|
|
|
|
|
|
/* .pagination { |
|
|
display: flex; |
|
|
display: flex; |
|
|
margin-top: 0.5vh; |
|
|
margin-top: 0.5vh; |
|
|
} |
|
|
|
|
|
|
|
|
} */ |
|
|
</style> |
|
|
</style> |