Browse Source
Merge branch 'refs/heads/lihuilin/feature-20250815155204-金币优化' into milestone-20250815-金币优化
Merge branch 'refs/heads/lihuilin/feature-20250815155204-金币优化' into milestone-20250815-金币优化
# Conflicts: # src/views/consume/gold/addCoinConsume.vueyouhua/chongzhi
10 changed files with 270 additions and 262 deletions
-
4.env.development
-
6src/router/index.js
-
5src/utils/menuTreePermission.js
-
3src/utils/menuUtils.js
-
1src/views/audit/gold/rechargeAudit.vue
-
7src/views/audit/gold/refundAudit.vue
-
276src/views/consume/gold/addCoinConsume.vue
-
144src/views/history/history.vue
-
17src/views/usergold/bean/userbean.vue
-
3stats.html
@ -0,0 +1,144 @@ |
|||||
|
<template> |
||||
|
<el-card> |
||||
|
<el-text size="large>">姓名:</el-text> |
||||
|
<el-input v-model="searchObj.name" placeholder="请输入姓名" style="width: 12vw;margin-right:1vw" |
||||
|
clearable></el-input> |
||||
|
<el-text size="large>">精网号:</el-text> |
||||
|
<el-input v-model="searchObj.jwcode" placeholder="请输入精网号" style="width: 12vw;margin-right:1vw" |
||||
|
clearable></el-input> |
||||
|
<el-text size="large" style="width: 80px">充值时间:</el-text> |
||||
|
<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> |
||||
|
<el-button type="success" @click="resetSearch">重置</el-button> |
||||
|
<el-button type="primary" @click="get">查询</el-button> |
||||
|
</el-card> |
||||
|
<el-card style="margin-top:10px"> |
||||
|
<el-table :data="tableData"> |
||||
|
<el-table-column type="index" label="序号" width="55"> |
||||
|
<template #default="scope"> |
||||
|
{{ scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize }} |
||||
|
</template> |
||||
|
|
||||
|
</el-table-column> |
||||
|
<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> |
||||
|
<el-pagination class="pagination" v-model:current-page="pagination.pageNum" |
||||
|
v-model:page-size="pagination.pageSize" layout="total, sizes, prev, pager, next, jumper" |
||||
|
:total="pagination.total" @size-change="handlePageSizeChange" |
||||
|
@current-change="handleCurrentChange"></el-pagination> |
||||
|
</el-card> |
||||
|
</template> |
||||
|
<script setup> |
||||
|
import { onMounted, ref } from 'vue' |
||||
|
import { ElMessage } from 'element-plus' |
||||
|
import API from '@/util/http' |
||||
|
import moment from 'moment' |
||||
|
import { useAdminStore } from "@/store/index.js" |
||||
|
import { storeToRefs } from "pinia" |
||||
|
const adminStore = useAdminStore() |
||||
|
const { adminData, menuTree } = storeToRefs(adminStore) |
||||
|
import { permissionMapping, findMenuById } from "@/utils/menuTreePermission.js" |
||||
|
|
||||
|
const tableData = ref([]) |
||||
|
const dateRange = ref([]) |
||||
|
const searchObj = ref({ |
||||
|
name: '', |
||||
|
jwcode: '' |
||||
|
}) |
||||
|
const pagination = ref({ |
||||
|
pageNum: 1, |
||||
|
pageSize: 50, |
||||
|
total: 0 |
||||
|
}) |
||||
|
const get = async function () { |
||||
|
if (findMenuById(menuTree.value, permissionMapping.History_Query)) { |
||||
|
try { |
||||
|
if (!searchObj.value.name && !searchObj.value.jwcode) { |
||||
|
const res = await API.get('/admin/history', { |
||||
|
params: { |
||||
|
...searchObj.value, |
||||
|
startTime: dateRange.value[0], |
||||
|
endTime: dateRange.value[1] |
||||
|
} |
||||
|
}) |
||||
|
tableData.value = res.data |
||||
|
pagination.value.total = res.data.total |
||||
|
} else { |
||||
|
ElMessage.error('请输入姓名或精网号') |
||||
|
return |
||||
|
} |
||||
|
} catch (e) { |
||||
|
ElMessage.error(e.message) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
const resetSearch = function () { |
||||
|
searchObj.value = { |
||||
|
name: '', |
||||
|
jwcode: '' |
||||
|
} |
||||
|
dateRange.value = [] |
||||
|
get() |
||||
|
} |
||||
|
const getToday = function () { |
||||
|
const today = dayjs() |
||||
|
const startTime = today.startOf('day').format('YYYY-MM-DD HH:mm:ss') |
||||
|
const endTime = today.endOf('day').format('YYYY-MM-DD HH:mm:ss') |
||||
|
dateRange.value = [startTime, endTime] |
||||
|
console.log('dateRange', dateRange.value) |
||||
|
activeTimeRange.value = 'today' |
||||
|
get() |
||||
|
getStats() |
||||
|
} |
||||
|
const getYesterday = function () { |
||||
|
const today = dayjs() |
||||
|
const startTime = today.subtract(1, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss') |
||||
|
const endTime = today.subtract(1, 'day').endOf('day').format('YYYY-MM-DD HH:mm:ss') |
||||
|
dateRange.value = [startTime, endTime] |
||||
|
console.log('dateRange', dateRange.value) |
||||
|
activeTimeRange.value = 'yesterday' |
||||
|
get() |
||||
|
getStats() |
||||
|
} |
||||
|
const get7Days = function () { |
||||
|
const today = dayjs() |
||||
|
const startTime = today.subtract(6, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss') |
||||
|
const endTime = today.endOf('day').format('YYYY-MM-DD HH:mm:ss') |
||||
|
dateRange.value = [startTime, endTime] |
||||
|
console.log('dateRange', dateRange.value) |
||||
|
activeTimeRange.value = '7days' |
||||
|
get() |
||||
|
getStats() |
||||
|
} |
||||
|
const handleDatePickerChange = () => { |
||||
|
activeTimeRange.value = '' |
||||
|
} |
||||
|
const handlePageSizeChange = function (val) { |
||||
|
pagination.value.pageSize = val |
||||
|
get() |
||||
|
} |
||||
|
const handleCurrentChange = function (val) { |
||||
|
pagination.value.pageNum = val |
||||
|
get() |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<scope lang="scss" scoped> |
||||
|
.pagination { |
||||
|
display: flex; |
||||
|
margin-top: 0.5vh; |
||||
|
} |
||||
|
</scope> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue