7 changed files with 1434 additions and 372 deletions
-
538vue/gold-system/src/views/audit/rechargeAudit.vue
-
532vue/gold-system/src/views/audit/refundAudit.vue
-
25vue/gold-system/src/views/managerecharge/activity.vue
-
617vue/gold-system/src/views/managerecharge/rate.vue
-
25vue/gold-system/src/views/recharge/adminRecharge.vue
-
19vue/gold-system/src/views/recharge/allRecharge.vue
-
50vue/gold-system/src/views/workspace/index.vue
@ -1,13 +1,543 @@ |
|||||
<script setup> |
<script setup> |
||||
|
|
||||
|
import { ref, onMounted, reactive, computed } from "vue"; |
||||
|
import ElementPlus from "element-plus"; |
||||
|
import { ElMessage, ElMessageBox } from 'element-plus' |
||||
|
import { AiFillRead } from "vue-icons-plus/ai"; |
||||
|
import axios from 'axios'; |
||||
|
import moment from 'moment'; |
||||
|
// 变量 |
||||
|
// 充值明细表格 |
||||
|
const tableData = ref([]); |
||||
|
// 搜索====================================== |
||||
|
// 搜索rechargeVo |
||||
|
const rechargeVo = ref({}); |
||||
|
// 搜索对象 |
||||
|
const getObj = ref({ |
||||
|
pageNum: 1, |
||||
|
pageSize: 5, |
||||
|
}); |
||||
|
//分页总条目 |
||||
|
const total = ref(100); |
||||
|
// 搜索对象时间 |
||||
|
const getTime = ref([]); |
||||
|
// 搜索活动列表 |
||||
|
const activity = ref([]); |
||||
|
// 所有信息 |
||||
|
const allData = ref([]); |
||||
|
// 搜索地区列表 |
||||
|
const area = ref([]); |
||||
|
|
||||
|
// 编辑====================================== |
||||
|
// 驳回弹出框 |
||||
|
const rejectVisible = ref(false); |
||||
|
// 驳回对象 |
||||
|
const rejectObj = ref({}); |
||||
|
// 通过对象 |
||||
|
const passObj = ref({}); |
||||
|
|
||||
|
//标签页默认高亮选项 |
||||
|
const activeName = ref('all') |
||||
|
|
||||
|
// 支付方式选项 |
||||
|
const payWay = [ |
||||
|
{ |
||||
|
value: '微信', |
||||
|
label: '微信', |
||||
|
}, |
||||
|
{ |
||||
|
value: '支付宝', |
||||
|
label: '支付宝', |
||||
|
}, |
||||
|
{ |
||||
|
value: '银联', |
||||
|
label: '银联', |
||||
|
}, |
||||
|
{ |
||||
|
value: '信用卡', |
||||
|
label: '信用卡', |
||||
|
}, |
||||
|
{ |
||||
|
value: '借记卡', |
||||
|
label: '借记卡', |
||||
|
}, |
||||
|
] |
||||
|
|
||||
|
//表格高度 |
||||
|
const tableHeight = computed(function () { |
||||
|
return (getObj.value.pageSize + 2) * 60 + 'px'; |
||||
|
}); |
||||
|
|
||||
|
// 表单验证ref |
||||
|
const Ref = ref(null); |
||||
|
|
||||
|
// 方法 |
||||
|
// 搜索============================================================== |
||||
|
// 搜索方法 |
||||
|
const get = async function (val) { |
||||
|
try { |
||||
|
// 搜索参数页码赋值 |
||||
|
if (typeof val === 'number') { |
||||
|
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); |
||||
|
// 发送POST请求 |
||||
|
const result = await axios.post('http://192.168.8.93:10010/recharge/recharge', { ...getObj.value, rechargeVo: { ...rechargeVo.value } }); |
||||
|
|
||||
|
// 将响应结果存储到响应式数据中 |
||||
|
console.log('请求成功', result); |
||||
|
// 存储表格数据 |
||||
|
tableData.value = result.data.data.list; |
||||
|
console.log('tableData', tableData.value); |
||||
|
// 存储分页总数 |
||||
|
total.value = result.data.data.total; |
||||
|
console.log('total', total.value); |
||||
|
} catch (error) { |
||||
|
console.log('请求失败', error); |
||||
|
// 在这里可以处理错误逻辑,比如显示错误提示等 |
||||
|
} |
||||
|
} |
||||
|
// 重置 |
||||
|
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 () { |
||||
|
console.log('adminAll'); |
||||
|
rechargeVo.value.status = ''; |
||||
|
get(); |
||||
|
} |
||||
|
//待审核充值明细 |
||||
|
const adminWait = function () { |
||||
|
rechargeVo.value.status = 0; |
||||
|
get(); |
||||
|
console.log('adminWait'); |
||||
|
} |
||||
|
//已通过充值明细 |
||||
|
const adminPass = function () { |
||||
|
rechargeVo.value.status = 1; |
||||
|
get(); |
||||
|
console.log('adminPass'); |
||||
|
} |
||||
|
//点击标签页 |
||||
|
const handleClick = function (tab, event) { |
||||
|
if (tab.props.name === 'all') { |
||||
|
adminAll(); |
||||
|
} else if (tab.props.name === 'wait') { |
||||
|
adminWait(); |
||||
|
} else if (tab.props.name === 'pass') { |
||||
|
adminPass(); |
||||
|
} |
||||
|
} |
||||
|
// 获取活动名称 |
||||
|
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 checkNumber = function () { |
||||
|
if (typeof parseInt(getObj.value.pageNum) === 'number') { |
||||
|
console.log('总共有多少页' + Math.ceil(total.value / getObj.value.pageSize)); |
||||
|
if ((getObj.value.pageNum > 0) && (getObj.value.pageNum <= Math.ceil(total.value / getObj.value.pageSize))) { |
||||
|
console.log('输入的数字合法'); |
||||
|
get(); |
||||
|
} else { |
||||
|
//提示 |
||||
|
ElMessage({ |
||||
|
type: 'error', |
||||
|
message: '请检查输入内容', |
||||
|
}) |
||||
|
} |
||||
|
} else { |
||||
|
//提示 |
||||
|
ElMessage({ |
||||
|
type: 'error', |
||||
|
message: '请检查输入内容', |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 编辑==================================== |
||||
|
// 通过按钮 |
||||
|
const pass = function (row) { |
||||
|
// 通过初始化 |
||||
|
passObj.value.auditId = row.rechargeId; |
||||
|
passObj.value.status = 1; |
||||
|
console.log('通过对象', passObj.value); |
||||
|
} |
||||
|
|
||||
|
// 通过确认 |
||||
|
const passConfirm = async function () { |
||||
|
|
||||
|
try { |
||||
|
console.log('通过对象', passObj.value); |
||||
|
// 发送POST请求 |
||||
|
const result = await axios.post('http://192.168.8.93:10030/audit/audit/edit', passObj.value); |
||||
|
|
||||
|
// 将响应结果存储到响应式数据中 |
||||
|
console.log('请求成功', result); |
||||
|
// 刷新表格数据 |
||||
|
get(); |
||||
|
//提示 |
||||
|
ElMessage({ |
||||
|
type: 'success', |
||||
|
message: '通过成功!', |
||||
|
|
||||
|
}) |
||||
|
} catch (error) { |
||||
|
console.log('请求失败', error); |
||||
|
// 在这里可以处理错误逻辑,比如显示错误提示等 |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 打开驳回弹出框 |
||||
|
const openRejectVisible = function () { |
||||
|
rejectVisible.value = true; |
||||
|
} |
||||
|
// 关闭驳回弹出框 |
||||
|
const closeRejectVisible = function () { |
||||
|
rejectVisible.value = false; |
||||
|
} |
||||
|
// 驳回按钮 |
||||
|
const reject = function (row) { |
||||
|
// 驳回初始化 |
||||
|
rejectObj.value.auditId = row.rechargeId; |
||||
|
rejectObj.value.status = 2; |
||||
|
rejectObj.value.reson = ''; |
||||
|
console.log('驳回对象', rejectObj.value); |
||||
|
openRejectVisible(); |
||||
|
} |
||||
|
// 驳回确认 |
||||
|
const rejectConfirm = async function () { |
||||
|
Ref.value.validate(async (valid) => { |
||||
|
if (valid) { |
||||
|
try { |
||||
|
console.log('驳回对象', rejectObj.value); |
||||
|
// 发送POST请求 |
||||
|
const result = await axios.post('http://192.168.8.93:10030/audit/audit/edit', rejectObj.value); |
||||
|
|
||||
|
// 将响应结果存储到响应式数据中 |
||||
|
console.log('请求成功', result); |
||||
|
// 刷新表格数据 |
||||
|
get(); |
||||
|
// 关闭弹出框 |
||||
|
closeRejectVisible(); |
||||
|
//提示 |
||||
|
ElMessage({ |
||||
|
type: 'success', |
||||
|
message: '驳回成功!', |
||||
|
}) |
||||
|
} catch (error) { |
||||
|
console.log('请求失败', error); |
||||
|
// 在这里可以处理错误逻辑,比如显示错误提示等 |
||||
|
} |
||||
|
} else { |
||||
|
//提示 |
||||
|
ElMessage({ |
||||
|
type: 'error', |
||||
|
message: '请检查输入内容', |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
}) |
||||
|
|
||||
|
} |
||||
|
|
||||
|
// 表单验证 |
||||
|
|
||||
|
const rules = reactive({ |
||||
|
reson: [{ required: true, message: '请输入驳回理由', trigger: 'blur' },], |
||||
|
}) |
||||
|
|
||||
|
// 挂载 |
||||
|
onMounted(async function () { |
||||
|
await get(); |
||||
|
getActivity(); |
||||
|
await getArea(); |
||||
|
}) |
||||
|
|
||||
</script> |
</script> |
||||
|
|
||||
<template> |
<template> |
||||
<div> |
|
||||
<h1>Recharge Audit</h1> |
|
||||
</div> |
|
||||
|
<el-row> |
||||
|
<el-col> |
||||
|
<el-card style="margin-bottom: 20px"> |
||||
|
<el-row style="margin-bottom: 10px;"> |
||||
|
<el-col :span="8"> |
||||
|
<div class="head-card-element"> |
||||
|
<el-text class="mx-1" size="large">活动名称:</el-text> |
||||
|
<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> |
||||
|
</div> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<div class="head-card-element"> |
||||
|
<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" /> |
||||
|
</el-select> |
||||
|
</div> |
||||
|
|
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<div class="head-card-element"> |
||||
|
<el-text class="mx-1" size="large">所属地区:</el-text> |
||||
|
<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> |
||||
|
</div> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="21"> |
||||
|
<div class="head-card-element"> |
||||
|
<el-text class="mx-1" size="large">充值时间:</el-text> |
||||
|
<el-date-picker v-model="getTime" type="datetimerange" range-separator="至" |
||||
|
start-placeholder="起始时间" end-placeholder="结束时间" /> |
||||
|
<el-button style="margin-left: 10px;" @click="getToday()">今</el-button> |
||||
|
<el-button @click="getYesterday()">昨</el-button> |
||||
|
<el-button @click="get7Days()">近7天</el-button> |
||||
|
</div> |
||||
|
</el-col> |
||||
|
<el-col :span="3"> |
||||
|
<div class="head-card-btn"> |
||||
|
<el-button @click="reset()">重置</el-button> |
||||
|
<el-button type="primary" @click="get()">查询</el-button> |
||||
|
</div> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-card> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col> |
||||
|
<el-card> |
||||
|
<el-tabs v-model="activeName" type="card" class="demo-tabs" @tab-click="handleClick"> |
||||
|
<el-tab-pane label="全部" name="all"></el-tab-pane> |
||||
|
<el-tab-pane label="待审核" name="wait"></el-tab-pane> |
||||
|
<el-tab-pane label="已通过" name="pass"></el-tab-pane> |
||||
|
</el-tabs> |
||||
|
<div> |
||||
|
<el-table :data="tableData" :height="tableHeight" style="width: 100%"> |
||||
|
<el-table-column prop="username" label="姓名" width="100px" /> |
||||
|
<el-table-column prop="homilyId" label="精网号" width="150px" /> |
||||
|
<el-table-column prop="area" label="所属地区" width="100px" /> |
||||
|
<el-table-column prop="activityName" label="活动名称" width="150px" /> |
||||
|
<el-table-column prop="rechargeGold" label="充值金额" width="100px" /> |
||||
|
<el-table-column prop="rechargeWay" label="充值方式" width="100px" /> |
||||
|
<el-table-column prop="paidGold" 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="payWay" label="支付方式" width="100px" /> |
||||
|
<el-table-column prop="rechargeVoucher" label="支付凭证" width="150px"> |
||||
|
<template #default="scope"> |
||||
|
<el-image :src="scope.row.rechargeVoucher" alt="凭证" style="width: 50px; height: 50px" /> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="name" label="提交人" width="100px" /> |
||||
|
<el-table-column prop="status" label="状态" width="100px"> |
||||
|
<template #default="scope"> |
||||
|
<span v-if="scope.row.status === 1"> |
||||
|
<div class="status"> |
||||
|
<span class="green-dot"></span> |
||||
|
<span>已通过</span> |
||||
|
</div> |
||||
|
</span> |
||||
|
<span v-if="scope.row.status === 0"> |
||||
|
<div class="status"> |
||||
|
<span class="grey-dot"></span> |
||||
|
<span>待审核</span> |
||||
|
</div> |
||||
|
</span> |
||||
|
<span v-if="scope.row.status === 2"> |
||||
|
<div class="status"> |
||||
|
<span class="red-dot"></span> |
||||
|
<span>已驳回</span> |
||||
|
</div> |
||||
|
</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="reson" label="驳回理由" width="200px" show-overflow-tooltip /> |
||||
|
<el-table-column prop="rechargeTime" label="交款时间" width="200px"> |
||||
|
<template #default="scope"> |
||||
|
{{ moment(scope.row.rechargeTime).format('YYYY-MM-DD HH:mm:ss') }} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="createTime" label="提交时间" width="200px" /> |
||||
|
<el-table-column fixed="right" prop="operation" label="操作" width="150px"> |
||||
|
<template #default="scope"> |
||||
|
<div class="operation"> |
||||
|
<el-popconfirm title="确定要通过此条记录吗?" @confirm="passConfirm"> |
||||
|
<template #reference> |
||||
|
<el-button :disabled='((scope.row.status === 1 )||(scope.row.status === 2)) ? true : false' |
||||
|
type="primary" text @click="pass(scope.row)"> |
||||
|
通过 |
||||
|
</el-button> |
||||
|
</template> |
||||
|
<template #actions="{ confirm, cancel }"> |
||||
|
<el-button size="small" @click="cancel">取消</el-button> |
||||
|
<el-button type="primary" size="small" @click="confirm"> |
||||
|
确定 |
||||
|
</el-button> |
||||
|
</template> |
||||
|
</el-popconfirm> |
||||
|
<el-button :disabled='((scope.row.status === 1 )||(scope.row.status === 2)) ? true : false' type="primary" text |
||||
|
@click="reject(scope.row)"> |
||||
|
驳回 |
||||
|
</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</div> |
||||
|
|
||||
|
<!-- 分页 --> |
||||
|
<div class="pagination"> |
||||
|
<el-pagination background :page-size="getObj.pageSize" layout="slot" :total="total"> |
||||
|
<div>共{{ total }}条,每页 </div> |
||||
|
<el-select v-model="getObj.pageSize" class="page-size" @change="get()" style="width: 80px"> |
||||
|
<el-option v-for="item in [5, 6, 7, 8, 9, 10]" :key="item" :label="item" |
||||
|
:value="item"></el-option> |
||||
|
</el-select> |
||||
|
<div> 条</div> |
||||
|
</el-pagination> |
||||
|
<el-pagination background layout="prev, pager, next,slot" :page-size="getObj.pageSize" |
||||
|
:total="total" :current-page="getObj.pageNum" @current-change="get"> |
||||
|
<div>跳至</div> |
||||
|
<el-input v-model="getObj.pageNum" style="width: 40px;" @change="checkNumber" /> |
||||
|
<div>页</div> |
||||
|
</el-pagination> |
||||
|
</div> |
||||
|
</el-card> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
|
||||
|
<!-- 驳回弹出框 --> |
||||
|
<el-dialog v-model="rejectVisible" title="驳回理由" width="500" :before-close="closeRejectVisible"> |
||||
|
<template #footer> |
||||
|
|
||||
|
<el-form :model="rejectObj" ref="Ref" :rules="rules" label-width="auto" style="max-width: 600px"> |
||||
|
|
||||
|
<el-form-item prop="reson" label="驳回理由:"> |
||||
|
<el-input v-model="rejectObj.reson" maxlength="150" show-word-limit style="width: 350px" |
||||
|
type="textarea" placeholder="请输入内容" /> |
||||
|
</el-form-item> |
||||
|
|
||||
|
|
||||
|
</el-form> |
||||
|
|
||||
|
<div class="dialog-footer"> |
||||
|
<el-button @click="closeRejectVisible()">取消</el-button> |
||||
|
<el-button type="primary" @click="rejectConfirm()"> |
||||
|
确定 |
||||
|
</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
|
||||
</template> |
</template> |
||||
|
|
||||
<style scoped> |
<style scoped> |
||||
|
.pagination { |
||||
|
display: flex; |
||||
|
} |
||||
|
|
||||
|
.status { |
||||
|
display: flex; |
||||
|
} |
||||
|
|
||||
|
.operation { |
||||
|
display: flex; |
||||
|
} |
||||
|
|
||||
|
.head-card { |
||||
|
display: flex; |
||||
|
} |
||||
|
|
||||
|
.head-card-element { |
||||
|
margin-right: 20px; |
||||
|
} |
||||
|
|
||||
|
.head-card-btn { |
||||
|
margin-left: auto; |
||||
|
} |
||||
</style> |
</style> |
@ -1,13 +1,537 @@ |
|||||
<script setup> |
<script setup> |
||||
|
|
||||
|
import { ref, onMounted, reactive, computed } from "vue"; |
||||
|
import ElementPlus from "element-plus"; |
||||
|
import { ElMessage, ElMessageBox } from 'element-plus' |
||||
|
import { AiFillRead } from "vue-icons-plus/ai"; |
||||
|
import axios from 'axios'; |
||||
|
import moment from 'moment'; |
||||
|
// 变量 |
||||
|
// 充值明细表格 |
||||
|
const tableData = ref([]); |
||||
|
// 搜索====================================== |
||||
|
// 搜索rechargeVo |
||||
|
const rechargeVo = ref({}); |
||||
|
// 搜索对象 |
||||
|
const getObj = ref({ |
||||
|
pageNum: 1, |
||||
|
pageSize: 5, |
||||
|
}); |
||||
|
//分页总条目 |
||||
|
const total = ref(100); |
||||
|
// 搜索对象时间 |
||||
|
const getTime = ref([]); |
||||
|
// 搜索活动列表 |
||||
|
const activity = ref([]); |
||||
|
// 所有信息 |
||||
|
const allData = ref([]); |
||||
|
// 搜索地区列表 |
||||
|
const area = ref([]); |
||||
|
|
||||
|
// 编辑====================================== |
||||
|
// 驳回弹出框 |
||||
|
const rejectVisible = ref(false); |
||||
|
// 驳回对象 |
||||
|
const rejectObj = ref({}); |
||||
|
// 通过对象 |
||||
|
const passObj = ref({}); |
||||
|
|
||||
|
//标签页默认高亮选项 |
||||
|
const activeName = ref('all') |
||||
|
|
||||
|
// 支付方式选项 |
||||
|
const payWay = [ |
||||
|
{ |
||||
|
value: '微信', |
||||
|
label: '微信', |
||||
|
}, |
||||
|
{ |
||||
|
value: '支付宝', |
||||
|
label: '支付宝', |
||||
|
}, |
||||
|
{ |
||||
|
value: '银联', |
||||
|
label: '银联', |
||||
|
}, |
||||
|
{ |
||||
|
value: '信用卡', |
||||
|
label: '信用卡', |
||||
|
}, |
||||
|
{ |
||||
|
value: '借记卡', |
||||
|
label: '借记卡', |
||||
|
}, |
||||
|
] |
||||
|
|
||||
|
//表格高度 |
||||
|
const tableHeight = computed(function () { |
||||
|
return (getObj.value.pageSize + 2) * 60 + 'px'; |
||||
|
}); |
||||
|
|
||||
|
// 表单验证ref |
||||
|
const Ref = ref(null); |
||||
|
|
||||
|
// 方法 |
||||
|
// 搜索============================================================== |
||||
|
// 搜索方法 |
||||
|
const get = async function (val) { |
||||
|
try { |
||||
|
// 搜索参数页码赋值 |
||||
|
if (typeof val === 'number') { |
||||
|
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); |
||||
|
// 发送POST请求 |
||||
|
const result = await axios.post('http://192.168.8.93:10030/audit/audit/refund', { ...getObj.value, rechargeVo: { ...rechargeVo.value } }); |
||||
|
|
||||
|
// 将响应结果存储到响应式数据中 |
||||
|
console.log('请求成功', result); |
||||
|
// 存储表格数据 |
||||
|
tableData.value = result.data.data.list; |
||||
|
console.log('tableData', tableData.value); |
||||
|
// 存储分页总数 |
||||
|
total.value = result.data.data.total; |
||||
|
console.log('total', total.value); |
||||
|
} catch (error) { |
||||
|
console.log('请求失败', error); |
||||
|
// 在这里可以处理错误逻辑,比如显示错误提示等 |
||||
|
} |
||||
|
} |
||||
|
// 重置 |
||||
|
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 () { |
||||
|
console.log('adminAll'); |
||||
|
rechargeVo.value.status = ''; |
||||
|
get(); |
||||
|
} |
||||
|
//待审核充值明细 |
||||
|
const adminWait = function () { |
||||
|
rechargeVo.value.status = 0; |
||||
|
get(); |
||||
|
console.log('adminWait'); |
||||
|
} |
||||
|
//已通过充值明细 |
||||
|
const adminPass = function () { |
||||
|
rechargeVo.value.status = 1; |
||||
|
get(); |
||||
|
console.log('adminPass'); |
||||
|
} |
||||
|
//点击标签页 |
||||
|
const handleClick = function (tab, event) { |
||||
|
if (tab.props.name === 'all') { |
||||
|
adminAll(); |
||||
|
} else if (tab.props.name === 'wait') { |
||||
|
adminWait(); |
||||
|
} else if (tab.props.name === 'pass') { |
||||
|
adminPass(); |
||||
|
} |
||||
|
} |
||||
|
// 获取活动名称 |
||||
|
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 checkNumber = function () { |
||||
|
if (typeof parseInt(getObj.value.pageNum) === 'number') { |
||||
|
console.log('总共有多少页' + Math.ceil(total.value / getObj.value.pageSize)); |
||||
|
if ((getObj.value.pageNum > 0) && (getObj.value.pageNum <= Math.ceil(total.value / getObj.value.pageSize))) { |
||||
|
console.log('输入的数字合法'); |
||||
|
get(); |
||||
|
} else { |
||||
|
//提示 |
||||
|
ElMessage({ |
||||
|
type: 'error', |
||||
|
message: '请检查输入内容', |
||||
|
}) |
||||
|
} |
||||
|
} else { |
||||
|
//提示 |
||||
|
ElMessage({ |
||||
|
type: 'error', |
||||
|
message: '请检查输入内容', |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 编辑==================================== |
||||
|
// 通过按钮 |
||||
|
const pass = function (row) { |
||||
|
// 通过初始化 |
||||
|
passObj.value.auditId = row.rechargeId; |
||||
|
passObj.value.status = 1; |
||||
|
console.log('通过对象', passObj.value); |
||||
|
} |
||||
|
|
||||
|
// 通过确认 |
||||
|
const passConfirm = async function () { |
||||
|
|
||||
|
try { |
||||
|
console.log('通过对象', passObj.value); |
||||
|
// 发送POST请求 |
||||
|
const result = await axios.post('http://192.168.8.93:10030/audit/audit/edit', passObj.value); |
||||
|
|
||||
|
// 将响应结果存储到响应式数据中 |
||||
|
console.log('请求成功', result); |
||||
|
// 刷新表格数据 |
||||
|
get(); |
||||
|
//提示 |
||||
|
ElMessage({ |
||||
|
type: 'success', |
||||
|
message: '通过成功!', |
||||
|
|
||||
|
}) |
||||
|
} catch (error) { |
||||
|
console.log('请求失败', error); |
||||
|
// 在这里可以处理错误逻辑,比如显示错误提示等 |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 打开驳回弹出框 |
||||
|
const openRejectVisible = function () { |
||||
|
rejectVisible.value = true; |
||||
|
} |
||||
|
// 关闭驳回弹出框 |
||||
|
const closeRejectVisible = function () { |
||||
|
rejectVisible.value = false; |
||||
|
} |
||||
|
// 驳回按钮 |
||||
|
const reject = function (row) { |
||||
|
// 驳回初始化 |
||||
|
rejectObj.value.auditId = row.rechargeId; |
||||
|
rejectObj.value.status = 2; |
||||
|
rejectObj.value.reson = ''; |
||||
|
console.log('驳回对象', rejectObj.value); |
||||
|
openRejectVisible(); |
||||
|
} |
||||
|
// 驳回确认 |
||||
|
const rejectConfirm = async function () { |
||||
|
Ref.value.validate(async (valid) => { |
||||
|
if (valid) { |
||||
|
try { |
||||
|
console.log('驳回对象', rejectObj.value); |
||||
|
// 发送POST请求 |
||||
|
const result = await axios.post('http://192.168.8.93:10030/audit/audit/edit', rejectObj.value); |
||||
|
|
||||
|
// 将响应结果存储到响应式数据中 |
||||
|
console.log('请求成功', result); |
||||
|
// 刷新表格数据 |
||||
|
get(); |
||||
|
// 关闭弹出框 |
||||
|
closeRejectVisible(); |
||||
|
//提示 |
||||
|
ElMessage({ |
||||
|
type: 'success', |
||||
|
message: '驳回成功!', |
||||
|
}) |
||||
|
} catch (error) { |
||||
|
console.log('请求失败', error); |
||||
|
// 在这里可以处理错误逻辑,比如显示错误提示等 |
||||
|
} |
||||
|
} else { |
||||
|
//提示 |
||||
|
ElMessage({ |
||||
|
type: 'error', |
||||
|
message: '请检查输入内容', |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
}) |
||||
|
|
||||
|
} |
||||
|
|
||||
|
// 表单验证 |
||||
|
|
||||
|
const rules = reactive({ |
||||
|
reson: [{ required: true, message: '请输入驳回理由', trigger: 'blur' },], |
||||
|
}) |
||||
|
|
||||
|
// 挂载 |
||||
|
onMounted(async function () { |
||||
|
await get(); |
||||
|
getActivity(); |
||||
|
await getArea(); |
||||
|
}) |
||||
|
|
||||
</script> |
</script> |
||||
|
|
||||
<template> |
<template> |
||||
<div> |
|
||||
<h1>refundAudit</h1> |
|
||||
</div> |
|
||||
|
<el-row> |
||||
|
<el-col> |
||||
|
<el-card style="margin-bottom: 20px"> |
||||
|
<el-row style="margin-bottom: 10px;"> |
||||
|
<el-col :span="8"> |
||||
|
<div class="head-card-element"> |
||||
|
<el-text class="mx-1" size="large">活动名称:</el-text> |
||||
|
<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> |
||||
|
</div> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<div class="head-card-element"> |
||||
|
<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" /> |
||||
|
</el-select> |
||||
|
</div> |
||||
|
|
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<div class="head-card-element"> |
||||
|
<el-text class="mx-1" size="large">所属地区:</el-text> |
||||
|
<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> |
||||
|
</div> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="21"> |
||||
|
<div class="head-card-element"> |
||||
|
<el-text class="mx-1" size="large">充值时间:</el-text> |
||||
|
<el-date-picker v-model="getTime" type="datetimerange" range-separator="至" |
||||
|
start-placeholder="起始时间" end-placeholder="结束时间" /> |
||||
|
<el-button style="margin-left: 10px;" @click="getToday()">今</el-button> |
||||
|
<el-button @click="getYesterday()">昨</el-button> |
||||
|
<el-button @click="get7Days()">近7天</el-button> |
||||
|
</div> |
||||
|
</el-col> |
||||
|
<el-col :span="3"> |
||||
|
<div class="head-card-btn"> |
||||
|
<el-button @click="reset()">重置</el-button> |
||||
|
<el-button type="primary" @click="get()">查询</el-button> |
||||
|
</div> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-card> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col> |
||||
|
<el-card> |
||||
|
<el-tabs v-model="activeName" type="card" class="demo-tabs" @tab-click="handleClick"> |
||||
|
<el-tab-pane label="全部" name="all"></el-tab-pane> |
||||
|
<el-tab-pane label="待审核" name="wait"></el-tab-pane> |
||||
|
<el-tab-pane label="已通过" name="pass"></el-tab-pane> |
||||
|
</el-tabs> |
||||
|
<div> |
||||
|
<el-table :data="tableData" :height="tableHeight" style="width: 100%"> |
||||
|
<el-table-column prop="name" label="姓名" width="100px" /> |
||||
|
<el-table-column prop="homilyId" label="精网号" width="150px" /> |
||||
|
<el-table-column prop="area" label="所属地区" width="100px" /> |
||||
|
<el-table-column prop="refundType" label="退款类型" width="150px" /> |
||||
|
<el-table-column prop="goods" label="退款商品" width="100px" /> |
||||
|
<el-table-column prop="refundCoin" label="退款金币数" width="100px" > |
||||
|
<template #default="scope"> |
||||
|
<span>{{ scope.row.rechargeCoin+scope.row.freeCoin+scope.row.taskCoin }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="rechargeCoin" label="充值金币" width="100px" /> |
||||
|
<el-table-column prop="freeCoin" label="免费金币" width="100px" /> |
||||
|
<el-table-column prop="taskCoin" label="任务金币" width="100px" /> |
||||
|
<el-table-column prop="remark" label="备注" width="200px" show-overflow-tooltip /> |
||||
|
<el-table-column prop="adminName" label="提交人" width="100px" /> |
||||
|
<el-table-column prop="status" label="审核状态" width="100px"> |
||||
|
<template #default="scope"> |
||||
|
<span v-if="scope.row.status === 1"> |
||||
|
<div class="status"> |
||||
|
<span class="green-dot"></span> |
||||
|
<span>已通过</span> |
||||
|
</div> |
||||
|
</span> |
||||
|
<span v-if="scope.row.status === 0"> |
||||
|
<div class="status"> |
||||
|
<span class="grey-dot"></span> |
||||
|
<span>待审核</span> |
||||
|
</div> |
||||
|
</span> |
||||
|
<span v-if="scope.row.status === 2"> |
||||
|
<div class="status"> |
||||
|
<span class="red-dot"></span> |
||||
|
<span>已驳回</span> |
||||
|
</div> |
||||
|
</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="reson" label="驳回理由" width="200px" show-overflow-tooltip /> |
||||
|
<el-table-column prop="createTime" label="提交时间" width="200px" /> |
||||
|
<el-table-column fixed="right" prop="operation" label="操作" width="150px"> |
||||
|
<template #default="scope"> |
||||
|
<div class="operation"> |
||||
|
<el-popconfirm title="确定要通过此条记录吗?" @confirm="passConfirm"> |
||||
|
<template #reference> |
||||
|
<el-button :disabled='((scope.row.status === 1 )||(scope.row.status === 2)) ? true : false' |
||||
|
type="primary" text @click="pass(scope.row)"> |
||||
|
通过 |
||||
|
</el-button> |
||||
|
</template> |
||||
|
<template #actions="{ confirm, cancel }"> |
||||
|
<el-button size="small" @click="cancel">取消</el-button> |
||||
|
<el-button type="primary" size="small" @click="confirm"> |
||||
|
确定 |
||||
|
</el-button> |
||||
|
</template> |
||||
|
</el-popconfirm> |
||||
|
<el-button :disabled='((scope.row.status === 1 )||(scope.row.status === 2)) ? true : false' type="primary" text |
||||
|
@click="reject(scope.row)"> |
||||
|
驳回 |
||||
|
</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</div> |
||||
|
|
||||
|
<!-- 分页 --> |
||||
|
<div class="pagination"> |
||||
|
<el-pagination background :page-size="getObj.pageSize" layout="slot" :total="total"> |
||||
|
<div>共{{ total }}条,每页 </div> |
||||
|
<el-select v-model="getObj.pageSize" class="page-size" @change="get()" style="width: 80px"> |
||||
|
<el-option v-for="item in [5, 6, 7, 8, 9, 10]" :key="item" :label="item" |
||||
|
:value="item"></el-option> |
||||
|
</el-select> |
||||
|
<div> 条</div> |
||||
|
</el-pagination> |
||||
|
<el-pagination background layout="prev, pager, next,slot" :page-size="getObj.pageSize" |
||||
|
:total="total" :current-page="getObj.pageNum" @current-change="get"> |
||||
|
<div>跳至</div> |
||||
|
<el-input v-model="getObj.pageNum" style="width: 40px;" @change="checkNumber" /> |
||||
|
<div>页</div> |
||||
|
</el-pagination> |
||||
|
</div> |
||||
|
</el-card> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
|
||||
|
<!-- 驳回弹出框 --> |
||||
|
<el-dialog v-model="rejectVisible" title="驳回理由" width="500" :before-close="closeRejectVisible"> |
||||
|
<template #footer> |
||||
|
|
||||
|
<el-form :model="rejectObj" ref="Ref" :rules="rules" label-width="auto" style="max-width: 600px"> |
||||
|
|
||||
|
<el-form-item prop="reson" label="驳回理由:"> |
||||
|
<el-input v-model="rejectObj.reson" maxlength="150" show-word-limit style="width: 350px" |
||||
|
type="textarea" placeholder="请输入内容" /> |
||||
|
</el-form-item> |
||||
|
|
||||
|
|
||||
|
</el-form> |
||||
|
|
||||
|
<div class="dialog-footer"> |
||||
|
<el-button @click="closeRejectVisible()">取消</el-button> |
||||
|
<el-button type="primary" @click="rejectConfirm()"> |
||||
|
确定 |
||||
|
</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
|
||||
</template> |
</template> |
||||
|
|
||||
<style scoped> |
<style scoped> |
||||
|
.pagination { |
||||
|
display: flex; |
||||
|
} |
||||
|
|
||||
|
.status { |
||||
|
display: flex; |
||||
|
} |
||||
|
|
||||
|
.operation { |
||||
|
display: flex; |
||||
|
} |
||||
|
|
||||
|
.head-card { |
||||
|
display: flex; |
||||
|
} |
||||
|
|
||||
|
.head-card-element { |
||||
|
margin-right: 20px; |
||||
|
} |
||||
|
|
||||
|
.head-card-btn { |
||||
|
margin-left: auto; |
||||
|
} |
||||
</style> |
</style> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue