|
@ -2,7 +2,7 @@ |
|
|
import { ref, onMounted, reactive, computed } from "vue"; |
|
|
import { ref, onMounted, reactive, computed } from "vue"; |
|
|
import ElementPlus from "element-plus"; |
|
|
import ElementPlus from "element-plus"; |
|
|
import { AiFillRead } from "vue-icons-plus/ai"; |
|
|
import { AiFillRead } from "vue-icons-plus/ai"; |
|
|
|
|
|
|
|
|
|
|
|
import axios from 'axios'; |
|
|
// 变量 |
|
|
// 变量 |
|
|
// 用户对象假的 |
|
|
// 用户对象假的 |
|
|
const admin = ref({ |
|
|
const admin = ref({ |
|
@ -13,47 +13,54 @@ const admin = ref({ |
|
|
|
|
|
|
|
|
// 充值明细表格 |
|
|
// 充值明细表格 |
|
|
const tableData = ref([]); |
|
|
const tableData = ref([]); |
|
|
|
|
|
|
|
|
|
|
|
// 搜索=========================================== |
|
|
// 搜索recharge |
|
|
// 搜索recharge |
|
|
const rechargeVo = ref({ |
|
|
const rechargeVo = ref({ |
|
|
name: admin.value.name, |
|
|
|
|
|
area: admin.value.area, |
|
|
|
|
|
adminId: admin.value.adminId, |
|
|
adminId: admin.value.adminId, |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
// 搜索对象 |
|
|
// 搜索对象 |
|
|
const getObj = ref({ |
|
|
const getObj = ref({ |
|
|
pageNum: 1, |
|
|
pageNum: 1, |
|
|
pageSize: 5, |
|
|
pageSize: 5, |
|
|
}); |
|
|
}); |
|
|
//分页总条目 |
|
|
//分页总条目 |
|
|
const total = ref(100) |
|
|
|
|
|
//下拉框 |
|
|
|
|
|
const value = ref('') |
|
|
|
|
|
//默认高亮选项 |
|
|
|
|
|
|
|
|
const total = ref(100); |
|
|
|
|
|
// 搜索对象时间 |
|
|
|
|
|
const getTime = ref([]); |
|
|
|
|
|
// 搜索活动列表 |
|
|
|
|
|
const activity = ref([]); |
|
|
|
|
|
// 所有信息 |
|
|
|
|
|
const allData = ref([]); |
|
|
|
|
|
// 搜索地区列表 |
|
|
|
|
|
const area = ref([]); |
|
|
|
|
|
//标签页默认高亮选项 |
|
|
const activeName = ref('all') |
|
|
const activeName = ref('all') |
|
|
const options = [ |
|
|
|
|
|
|
|
|
// 支付方式选项 |
|
|
|
|
|
const payWay = [ |
|
|
{ |
|
|
{ |
|
|
value: 'Option1', |
|
|
|
|
|
label: 'Option1', |
|
|
|
|
|
|
|
|
value: '微信', |
|
|
|
|
|
label: '微信', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
value: 'Option2', |
|
|
|
|
|
label: 'Option2', |
|
|
|
|
|
|
|
|
value: '支付宝', |
|
|
|
|
|
label: '支付宝', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
value: 'Option3', |
|
|
|
|
|
label: 'Option3', |
|
|
|
|
|
|
|
|
value: '银联', |
|
|
|
|
|
label: '银联', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
value: 'Option4', |
|
|
|
|
|
label: 'Option4', |
|
|
|
|
|
|
|
|
value: '信用卡', |
|
|
|
|
|
label: '信用卡', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
value: 'Option5', |
|
|
|
|
|
label: 'Option5', |
|
|
|
|
|
|
|
|
value: '借记卡', |
|
|
|
|
|
label: '借记卡', |
|
|
}, |
|
|
}, |
|
|
] |
|
|
] |
|
|
|
|
|
// 删除========================================================== |
|
|
|
|
|
// 删除对象 |
|
|
|
|
|
const delObj = ref({}); |
|
|
|
|
|
|
|
|
//表格高度 |
|
|
//表格高度 |
|
|
const tableHeight = computed(function () { |
|
|
const tableHeight = computed(function () { |
|
@ -61,6 +68,7 @@ const tableHeight = computed(function () { |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
// 方法 |
|
|
// 方法 |
|
|
|
|
|
// 搜索=========================================================================== |
|
|
// 搜索方法 |
|
|
// 搜索方法 |
|
|
const get = async function (val) { |
|
|
const get = async function (val) { |
|
|
try { |
|
|
try { |
|
@ -68,6 +76,16 @@ const get = async function (val) { |
|
|
if (typeof val === 'number') { |
|
|
if (typeof val === 'number') { |
|
|
getObj.value.pageNum = val; |
|
|
getObj.value.pageNum = val; |
|
|
} |
|
|
} |
|
|
|
|
|
// 搜索参数时间赋值 |
|
|
|
|
|
if (getTime.value != null) { |
|
|
|
|
|
if (getTime.value.startDate != '' && getTime.value.endDate != '') { |
|
|
|
|
|
rechargeVo.value.startDate = getTime.value[0]; |
|
|
|
|
|
rechargeVo.value.endDate = getTime.value[1]; |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
rechargeVo.value.startDate = ''; |
|
|
|
|
|
rechargeVo.value.endDate = ''; |
|
|
|
|
|
} |
|
|
console.log('搜索参数', getObj.value); |
|
|
console.log('搜索参数', getObj.value); |
|
|
// 发送POST请求 |
|
|
// 发送POST请求 |
|
|
const result = await axios.post('http://192.168.8.93:10010/recharge/recharge', { ...getObj.value, rechargeVo: { ...rechargeVo.value } }); |
|
|
const result = await axios.post('http://192.168.8.93:10010/recharge/recharge', { ...getObj.value, rechargeVo: { ...rechargeVo.value } }); |
|
@ -86,7 +104,43 @@ const get = async function (val) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 重置 |
|
|
|
|
|
const reset = function () { |
|
|
|
|
|
rechargeVo.value.activityId = ''; |
|
|
|
|
|
rechargeVo.value.payWay = ''; |
|
|
|
|
|
rechargeVo.value.area = ''; |
|
|
|
|
|
rechargeVo.value.startDate = ''; |
|
|
|
|
|
rechargeVo.value.endDate = ''; |
|
|
|
|
|
get(); |
|
|
|
|
|
} |
|
|
|
|
|
// 今天 |
|
|
|
|
|
const getToday = function () { |
|
|
|
|
|
const today = new Date(); |
|
|
|
|
|
const startDate = new Date(today.getFullYear(), today.getMonth(), today.getDate()); |
|
|
|
|
|
const endDate = new Date(today.getFullYear(), today.getMonth(), today.getDate() + 1); |
|
|
|
|
|
getTime.value = [startDate, endDate]; |
|
|
|
|
|
console.log('getTime', getTime.value); |
|
|
|
|
|
get(); |
|
|
|
|
|
} |
|
|
|
|
|
// 昨天 |
|
|
|
|
|
const getYesterday = function () { |
|
|
|
|
|
const yesterday = new Date(); |
|
|
|
|
|
yesterday.setDate(yesterday.getDate() - 1); |
|
|
|
|
|
const startDate = new Date(yesterday.getFullYear(), yesterday.getMonth(), yesterday.getDate()); |
|
|
|
|
|
const endDate = new Date(yesterday.getFullYear(), yesterday.getMonth(), yesterday.getDate() + 1); |
|
|
|
|
|
getTime.value = [startDate, endDate]; |
|
|
|
|
|
console.log('getTime', getTime.value); |
|
|
|
|
|
get(); |
|
|
|
|
|
} |
|
|
|
|
|
// 近7天 |
|
|
|
|
|
const get7Days = function () { |
|
|
|
|
|
const today = new Date(); |
|
|
|
|
|
const startDate = new Date(today.getFullYear(), today.getMonth(), today.getDate() - 6); |
|
|
|
|
|
const endDate = new Date(today.getFullYear(), today.getMonth(), today.getDate() + 1); |
|
|
|
|
|
getTime.value = [startDate, endDate]; |
|
|
|
|
|
console.log('getTime', getTime.value); |
|
|
|
|
|
get(); |
|
|
|
|
|
} |
|
|
//全部充值明细 |
|
|
//全部充值明细 |
|
|
const adminAll = function () { |
|
|
const adminAll = function () { |
|
|
console.log('adminAll'); |
|
|
console.log('adminAll'); |
|
@ -123,12 +177,70 @@ const handleClick = function (tab, event) { |
|
|
adminReject(); |
|
|
adminReject(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
// 获取活动名称 |
|
|
|
|
|
const getActivity = async function () { |
|
|
|
|
|
try { |
|
|
|
|
|
// 发送POST请求 |
|
|
|
|
|
const result = await axios.post('http://192.168.8.93:10010/recharge/activity/select', {}); |
|
|
|
|
|
|
|
|
|
|
|
// 将响应结果存储到响应式数据中 |
|
|
|
|
|
console.log('请求成功', result); |
|
|
|
|
|
// 存储表格数据 |
|
|
|
|
|
activity.value = result.data.data; |
|
|
|
|
|
console.log('activity', activity.value); |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
console.log('请求失败', error); |
|
|
|
|
|
// 在这里可以处理错误逻辑,比如显示错误提示等 |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
// 获取地区 |
|
|
|
|
|
const getArea = async function () { |
|
|
|
|
|
try { |
|
|
|
|
|
// 发送POST请求 |
|
|
|
|
|
const result = await axios.post('http://192.168.8.93:10010/recharge/recharge', {}); |
|
|
|
|
|
// 将响应结果存储到响应式数据中 |
|
|
|
|
|
console.log('请求成功', result); |
|
|
|
|
|
// 存储全部数据 |
|
|
|
|
|
allData.value = result.data.data; |
|
|
|
|
|
console.log('allData', allData.value); |
|
|
|
|
|
// 分离并去重地区列表 |
|
|
|
|
|
area.value = [...new Set(allData.value.map(item => item.area))] |
|
|
|
|
|
console.log('地区', area.value); |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
console.log('请求失败', error); |
|
|
|
|
|
// 在这里可以处理错误逻辑,比如显示错误提示等 |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
const Delete = function (index, row) { |
|
|
|
|
|
console.log(index, row) |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
// 删除================================= |
|
|
|
|
|
// 点击删除按钮 |
|
|
|
|
|
const del = function (row) { |
|
|
|
|
|
delObj.value.rechargeId = row.rechargeId; |
|
|
|
|
|
console.log('delObj1', delObj.value); |
|
|
|
|
|
} |
|
|
|
|
|
// 确认删除按钮 |
|
|
|
|
|
const delConfirm = async function () { |
|
|
|
|
|
try { |
|
|
|
|
|
console.log('delObj2', delObj.value); |
|
|
|
|
|
const result = await axios.post('http://192.168.8.93:10010/recharge/recharge/edit', delObj.value); |
|
|
|
|
|
console.log('删除成功', result); |
|
|
|
|
|
// 刷新表格数据 |
|
|
|
|
|
get(); |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
console.log('请求失败', error); |
|
|
|
|
|
// 在这里可以处理错误逻辑,比如显示错误提示等 |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 挂载 |
|
|
|
|
|
onMounted(async function () { |
|
|
|
|
|
await get(); |
|
|
|
|
|
getActivity(); |
|
|
|
|
|
await getArea(); |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<template> |
|
|
<template> |
|
@ -139,17 +251,19 @@ const Delete = function (index, row) { |
|
|
<el-col :span="8"> |
|
|
<el-col :span="8"> |
|
|
<div class="head-card-element"> |
|
|
<div class="head-card-element"> |
|
|
<el-text class="mx-1" size="large">活动名称:</el-text> |
|
|
<el-text class="mx-1" size="large">活动名称:</el-text> |
|
|
<el-select v-model="value" placeholder="请选择活动名称" size="large" style="width: 240px"> |
|
|
|
|
|
<el-option v-for="item in options" :key="item.value" :label="item.label" |
|
|
|
|
|
:value="item.value" /> |
|
|
|
|
|
|
|
|
<el-select v-model="rechargeVo.activityId" placeholder="请选择活动名称" size="large" |
|
|
|
|
|
style="width: 240px"> |
|
|
|
|
|
<el-option v-for="item in activity" :key="item.activityId" :label="item.activityName" |
|
|
|
|
|
:value="item.activityId" /> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</div> |
|
|
</div> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="8"> |
|
|
<el-col :span="8"> |
|
|
<div class="head-card-element"> |
|
|
<div class="head-card-element"> |
|
|
<el-text class="mx-1" size="large">充值方式:</el-text> |
|
|
|
|
|
<el-select v-model="value" placeholder="请选择充值方式" size="large" style="width: 240px"> |
|
|
|
|
|
<el-option v-for="item in options" :key="item.value" :label="item.label" |
|
|
|
|
|
|
|
|
<el-text class="mx-1" size="large">支付方式:</el-text> |
|
|
|
|
|
<el-select v-model="rechargeVo.payWay" placeholder="请选择支付方式" size="large" |
|
|
|
|
|
style="width: 240px"> |
|
|
|
|
|
<el-option v-for="item in payWay" :key="item.value" :label="item.label" |
|
|
:value="item.value" /> |
|
|
:value="item.value" /> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</div> |
|
|
</div> |
|
@ -158,9 +272,9 @@ const Delete = function (index, row) { |
|
|
<el-col :span="8"> |
|
|
<el-col :span="8"> |
|
|
<div class="head-card-element"> |
|
|
<div class="head-card-element"> |
|
|
<el-text class="mx-1" size="large">所属地区:</el-text> |
|
|
<el-text class="mx-1" size="large">所属地区:</el-text> |
|
|
<el-select v-model="value" placeholder="请选择所属地区" size="large" style="width: 240px"> |
|
|
|
|
|
<el-option v-for="item in options" :key="item.value" :label="item.label" |
|
|
|
|
|
:value="item.value" /> |
|
|
|
|
|
|
|
|
<el-select v-model="rechargeVo.area" placeholder="请选择所属地区" size="large" |
|
|
|
|
|
style="width: 240px"> |
|
|
|
|
|
<el-option v-for="item in area" :key="item" :label="item" :value="item" /> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</div> |
|
|
</div> |
|
|
</el-col> |
|
|
</el-col> |
|
@ -171,15 +285,15 @@ const Delete = function (index, row) { |
|
|
<el-text class="mx-1" size="large">充值时间:</el-text> |
|
|
<el-text class="mx-1" size="large">充值时间:</el-text> |
|
|
<el-date-picker v-model="getTime" type="datetimerange" range-separator="至" |
|
|
<el-date-picker v-model="getTime" type="datetimerange" range-separator="至" |
|
|
start-placeholder="起始时间" end-placeholder="结束时间" /> |
|
|
start-placeholder="起始时间" end-placeholder="结束时间" /> |
|
|
<el-button style="margin-left: 10px;">今</el-button> |
|
|
|
|
|
<el-button>昨</el-button> |
|
|
|
|
|
<el-button>近7天</el-button> |
|
|
|
|
|
|
|
|
<el-button style="margin-left: 10px;" @click="getToday()">今</el-button> |
|
|
|
|
|
<el-button @click="getYesterday()">昨</el-button> |
|
|
|
|
|
<el-button @click="get7Days()">近7天</el-button> |
|
|
</div> |
|
|
</div> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="3"> |
|
|
<el-col :span="3"> |
|
|
<div class="head-card-btn"> |
|
|
<div class="head-card-btn"> |
|
|
<el-button>重置</el-button> |
|
|
|
|
|
<el-button type="primary">查询</el-button> |
|
|
|
|
|
|
|
|
<el-button @click="reset()">重置</el-button> |
|
|
|
|
|
<el-button type="primary" @click="get()" >查询</el-button> |
|
|
</div> |
|
|
</div> |
|
|
</el-col> |
|
|
</el-col> |
|
|
</el-row> |
|
|
</el-row> |
|
@ -197,7 +311,7 @@ const Delete = function (index, row) { |
|
|
</el-tabs> |
|
|
</el-tabs> |
|
|
<div> |
|
|
<div> |
|
|
<el-table :data="tableData" :height="tableHeight" style="width: 100%"> |
|
|
<el-table :data="tableData" :height="tableHeight" style="width: 100%"> |
|
|
<el-table-column prop="name" label="姓名" width="100px" /> |
|
|
|
|
|
|
|
|
<el-table-column prop="username" label="姓名" width="100px" /> |
|
|
<el-table-column prop="homilyId" label="精网号" width="150px" /> |
|
|
<el-table-column prop="homilyId" label="精网号" width="150px" /> |
|
|
<el-table-column prop="area" label="所属地区" width="100px" /> |
|
|
<el-table-column prop="area" label="所属地区" width="100px" /> |
|
|
<el-table-column prop="activityName" label="活动名称" width="150px" /> |
|
|
<el-table-column prop="activityName" label="活动名称" width="150px" /> |
|
@ -205,9 +319,9 @@ const Delete = function (index, row) { |
|
|
<el-table-column prop="paidGold" label="充值金币" width="100px" /> |
|
|
<el-table-column prop="paidGold" label="充值金币" width="100px" /> |
|
|
<el-table-column prop="freeGold" label="免费金币" width="100px" /> |
|
|
<el-table-column prop="freeGold" label="免费金币" width="100px" /> |
|
|
<el-table-column prop="remark" label="备注" width="200px" show-overflow-tooltip /> |
|
|
<el-table-column prop="remark" label="备注" width="200px" show-overflow-tooltip /> |
|
|
<el-table-column prop="rechargeWay" label="支付方式" width="100px" /> |
|
|
|
|
|
|
|
|
<el-table-column prop="payWay" label="支付方式" width="100px" /> |
|
|
<el-table-column prop="rechargeVoucher" label="支付凭证" width="150px" /> |
|
|
<el-table-column prop="rechargeVoucher" label="支付凭证" width="150px" /> |
|
|
<el-table-column prop="adminName" label="提交人" width="100px" /> |
|
|
|
|
|
|
|
|
<el-table-column prop="name" label="提交人" width="100px" /> |
|
|
<el-table-column prop="status" label="状态" width="100px"> |
|
|
<el-table-column prop="status" label="状态" width="100px"> |
|
|
<template #default="scope"> |
|
|
<template #default="scope"> |
|
|
<span v-if="scope.row.status === 1"> |
|
|
<span v-if="scope.row.status === 1"> |
|
@ -230,14 +344,14 @@ const Delete = function (index, row) { |
|
|
</span> |
|
|
</span> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column prop="reason" label="驳回理由" width="200px" show-overflow-tooltip /> |
|
|
|
|
|
|
|
|
<el-table-column prop="reson" label="驳回理由" width="200px" show-overflow-tooltip /> |
|
|
<el-table-column prop="rechargeTime" label="交款时间" width="200px" /> |
|
|
<el-table-column prop="rechargeTime" label="交款时间" width="200px" /> |
|
|
<el-table-column prop="createTime" label="提交时间" width="200px" /> |
|
|
<el-table-column prop="createTime" label="提交时间" width="200px" /> |
|
|
<el-table-column fixed="right" prop="operation" label="操作" width="150px"> |
|
|
<el-table-column fixed="right" prop="operation" label="操作" width="150px"> |
|
|
<template #default="scope"> |
|
|
<template #default="scope"> |
|
|
<el-popconfirm title="确定将此条活动删除吗?"> |
|
|
|
|
|
|
|
|
<el-popconfirm title="确定将此条活动修改(删除)吗?" @confirm="delConfirm"> |
|
|
<template #reference> |
|
|
<template #reference> |
|
|
<el-button type="primary" text @click="Delete(scope.$index, scope.row)"> |
|
|
|
|
|
|
|
|
<el-button type="primary" text @click="del(scope.row)"> |
|
|
修改 |
|
|
修改 |
|
|
</el-button> |
|
|
</el-button> |
|
|
</template> |
|
|
</template> |
|
|