|
|
@ -1,54 +1,202 @@ |
|
|
|
<!-- 合计数!!! --> |
|
|
|
<template> |
|
|
|
<el-row> |
|
|
|
<el-col> |
|
|
|
<el-card style="margin-bottom: 5px"> |
|
|
|
<el-row style="margin-bottom: 5px"> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-text size="large">精网号:</el-text> |
|
|
|
<el-input v-model="rechargeAudit.jwcode" placeholder="请输入精网号" style="width: 240px" clearable /> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-text size="large">活动名称:</el-text> |
|
|
|
<el-select v-model="rechargeAudit.activity" placeholder="请选择活动名称" style="width: 240px" clearable> |
|
|
|
<el-option v-for="item in activity" :key="item" :label="item" :value="item" /> |
|
|
|
</el-select> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-text size="large">充值方式:</el-text> |
|
|
|
<el-select v-model="rechargeAudit.payModel" placeholder="请选择充值方式" style="width: 240px" clearable> |
|
|
|
<el-option v-for="item in payModel" :key="item.value" :label="item.label" :value="item.value" /> |
|
|
|
</el-select> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<div class="head-card-element"> |
|
|
|
<el-text size="large">所属地区:</el-text> |
|
|
|
<el-select v-model="rechargeAudit.market" placeholder="请选择所属地区" style="width: 240px" clearable> |
|
|
|
<el-option v-for="item in market" :key="item" :label="item" :value="item" /> |
|
|
|
</el-select> |
|
|
|
</div> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="12"> |
|
|
|
<div class="time-controls"> |
|
|
|
<div class="time-group"> |
|
|
|
<el-text size="large">充值时间:</el-text> |
|
|
|
<el-date-picker v-model="getTime" type="datetimerange" range-separator="至" start-placeholder="起始时间" |
|
|
|
end-placeholder="结束时间" style="width: 400px" /> |
|
|
|
<el-button @click="getToday()" style="margin-left: 10px"> 今</el-button> |
|
|
|
<el-button @click="getYesterday()" style="margin-left: 10px"> 昨</el-button> |
|
|
|
<el-button @click="get7Days()" style="margin-left: 10px"> 近7天</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
<el-col :span="8"> |
|
|
|
<el-button @click="resetSearch" type="success">重置</el-button> |
|
|
|
<el-button type="primary" @click="handleSearch">查询</el-button> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-card> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col> |
|
|
|
<el-card> |
|
|
|
<el-tabs v-model="activeName" type="card" @tab-click="handleClick"> |
|
|
|
<el-tab-pane label="待审核" name="wait"></el-tab-pane> |
|
|
|
<el-tab-pane label="已通过" name="pass"></el-tab-pane> |
|
|
|
<el-tab-pane label="已驳回" name="reject"></el-tab-pane> |
|
|
|
|
|
|
|
<div> |
|
|
|
总条数:{{ }}条 |
|
|
|
总金币数:{{ }}金币 |
|
|
|
永久金币:{{ }}金币 |
|
|
|
免费金币:{{ }}金币 |
|
|
|
</div> |
|
|
|
</el-tabs> |
|
|
|
|
|
|
|
<!--表格--> |
|
|
|
<div style="height: 540px; overflow-y: auto"> |
|
|
|
<el-table :data="tableData" style="width: 100%" height="540px" @sort-change="handleSortChange" |
|
|
|
:row-style="{ height: '50px' }"> |
|
|
|
<el-table-column type="index" label="序号" width="100px" fixed="left"> |
|
|
|
<template #default="scope"> |
|
|
|
<span>{{ scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column fixed="left" prop="name" label="姓名" width="150px" /> |
|
|
|
<el-table-column fixed="left" prop="jwcode" label="精网号" width="110px" /> |
|
|
|
<el-table-column prop="market" label="所属地区" width="100px" /> |
|
|
|
<el-table-column prop="activity" label="活动名称" width="100px" show-overflow-tooltip /> |
|
|
|
<el-table-column prop="permanentGold" label="充值金额" sortable="custom" width="110px"> |
|
|
|
<template #default="scope">{{ scope.row.permanentGold / 100 }}</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="permanentGold" label="永久金币" width="110px" sortable="custom"> |
|
|
|
<template #default="scope">{{ scope.row.permanentGold / 100 }}</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="freeGold" label="免费金币" sortable="custom" width="110px"> |
|
|
|
<template #default="scope">{{ scope.row.freeGold / 100 }}</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="remark" label="备注" width="200px" show-overflow-tooltip /> |
|
|
|
|
|
|
|
<el-table-column prop="payModel" label="支付方式" width="110px" /> |
|
|
|
<el-table-column prop="voucher" label="支付凭证" width="110px"> |
|
|
|
<!-- 支付凭证列,支持点击放大预览 --> |
|
|
|
<template #default="scope"> |
|
|
|
<div v-if="scope.row.voucher" style="cursor: pointer;" @click="previewImage(scope.row.voucher)"> |
|
|
|
<img :src="scope.row.voucher" alt="支付凭证" style="width: 80px; height: auto;"> |
|
|
|
</div> |
|
|
|
<div v-else>--</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="adminName" label="提交人" width="100px" /> |
|
|
|
<el-table-column prop="rejectReason" v-if="activeName === 'reject'" label="驳回理由" width="200px" |
|
|
|
show-overflow-tooltip /> |
|
|
|
|
|
|
|
<el-table-column v-if="activeName!== 'wait'" prop="auditName" label="审核人" width="100px" /> |
|
|
|
<el-table-column prop="payTime" sortable="custom" label="付款时间" width="200px"> |
|
|
|
<template #default="scope"> |
|
|
|
{{ moment(scope.row.payTime).format('YYYY-MM-DD HH:mm:ss') }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="createTime" sortable="custom" label="提交时间" width="200px"> |
|
|
|
<template #default="scope"> |
|
|
|
{{ moment(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column v-if="activeName === 'wait'" |
|
|
|
fixed="right" prop="operation" label="操作" width="150px"> |
|
|
|
<template #default="scope"> |
|
|
|
<div class="operation"> |
|
|
|
<el-popconfirm title="确定要通过此条记录吗?" @confirm="handleApprove(scope.row)"> |
|
|
|
<template #reference> |
|
|
|
<el-button :disabled="scope.row.auditStatus === 1 || scope.row.auditStatus === 2" type="primary" text> |
|
|
|
通过 |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
</el-popconfirm> |
|
|
|
<el-button :disabled="scope.row.auditStatus === 1 || scope.row.auditStatus === 2" type="primary" text @click="showRejectDialog(scope.row)"> |
|
|
|
驳回 |
|
|
|
</el-button> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="pagination"> |
|
|
|
<el-pagination background :page-size="getObj.pageSize" :page-sizes="[5, 10, 20, 50, 100]" |
|
|
|
layout="total, sizes, prev, pager, next, jumper" :total="total" |
|
|
|
@size-change="handlePagination('size', $event)" |
|
|
|
@current-change="handlePagination('page', $event)"></el-pagination> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-dialog v-model="rejectDialogVisible" title="驳回理由" width="500px"> |
|
|
|
<el-form> |
|
|
|
<el-form-item label="驳回理由"> |
|
|
|
<el-input v-model="rejectReason" type="textarea" :rows="4" placeholder="请输入驳回理由" maxlength="200" show-word-limit /> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<template #footer> |
|
|
|
<span class="dialog-footer"> |
|
|
|
<el-button @click="rejectDialogVisible = false">取消</el-button> |
|
|
|
<el-button type="primary" @click="handleReject">确定</el-button> |
|
|
|
</span> |
|
|
|
</template> |
|
|
|
</el-dialog> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup> |
|
|
|
import {computed, onMounted, reactive, ref} from 'vue' |
|
|
|
import {dayjs, ElMessage} from 'element-plus' |
|
|
|
import { computed, onMounted, reactive, ref } from 'vue' |
|
|
|
import { ElMessage } from 'element-plus' |
|
|
|
import request from '@/util/http' |
|
|
|
import moment from 'moment' |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
===================工具方法============================ |
|
|
|
*/ |
|
|
|
|
|
|
|
// 精网号去空格 |
|
|
|
const trimJwCode = () => { |
|
|
|
if (rechargeAudit.value.jwcode) { |
|
|
|
rechargeAudit.value.jwcode = rechargeAudit.value.jwcode.replace(/\s/g, ''); |
|
|
|
} |
|
|
|
} |
|
|
|
const formatTime = (val) => val ? moment(val).format('YYYY-MM-DD HH:mm:ss') : '' |
|
|
|
|
|
|
|
const formatTime = (val) => val ? dayjs(val).format('YYYY-MM-DD HH:mm:ss') : '' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
===================数据============================ |
|
|
|
*/ |
|
|
|
//这是获取用户信息的接口 |
|
|
|
const adminData = ref({ |
|
|
|
|
|
|
|
}) |
|
|
|
// 这是获取用户信息的接口 |
|
|
|
const adminData = ref({}) |
|
|
|
// 充值明细表格 |
|
|
|
const tableData = ref([]) |
|
|
|
|
|
|
|
|
|
|
|
// 搜索表单数据 |
|
|
|
const rechargeAudit = ref({ |
|
|
|
jwcode: null,//精网号 |
|
|
|
activity: "", //活动名称 |
|
|
|
payModel: "",// 支付方式 |
|
|
|
jwcode: null, // 精网号 |
|
|
|
activity: "", // 活动名称 |
|
|
|
payModel: "", // 支付方式 |
|
|
|
startTime: "", // 充值时间开始 |
|
|
|
endTime: "", // 充值时间结束 |
|
|
|
market: "",//地区 |
|
|
|
market: "", // 地区 |
|
|
|
auditStatus: "0" |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// 搜索对象 |
|
|
|
const getObj = ref({ |
|
|
|
pageNum: 1, |
|
|
|
pageSize: 50 |
|
|
|
}) |
|
|
|
//分页总条目 |
|
|
|
// 分页总条目 |
|
|
|
const total = ref(50) |
|
|
|
// 搜索对象时间 |
|
|
|
const getTime = ref([]) |
|
|
@ -56,55 +204,27 @@ const activity = ref([]) |
|
|
|
// 搜索地区列表 |
|
|
|
const market = ref([]) |
|
|
|
// 驳回弹出框 |
|
|
|
const rejectVisible = ref(false) |
|
|
|
// 驳回对象 |
|
|
|
const rejectObj = ref({ |
|
|
|
token: "", |
|
|
|
orderCode: "", |
|
|
|
rejectReason: "", |
|
|
|
auditId: null, |
|
|
|
action: 2 |
|
|
|
|
|
|
|
}) |
|
|
|
// 通过对象 |
|
|
|
const passObj = ref({ |
|
|
|
token: "", |
|
|
|
orderCode: "", |
|
|
|
rejectReason: "", |
|
|
|
auditId: null, |
|
|
|
action: 1 |
|
|
|
}) |
|
|
|
//标签页默认是待审批 |
|
|
|
const rejectDialogVisible = ref(false) |
|
|
|
// 驳回理由 |
|
|
|
const rejectReason = ref('') |
|
|
|
// 当前行信息 |
|
|
|
const currentRecord = ref(null) |
|
|
|
// 标签页默认是待审批 |
|
|
|
const activeName = ref('wait') |
|
|
|
// 支付方式选项 |
|
|
|
const payModel = [ |
|
|
|
{ |
|
|
|
value: '微信', |
|
|
|
label: '微信' |
|
|
|
},{ |
|
|
|
value:'.....................................'// 待补充 |
|
|
|
}, |
|
|
|
{ |
|
|
|
value: '.....................................' // 待补充 |
|
|
|
} |
|
|
|
] |
|
|
|
// 表单验证ref |
|
|
|
const Ref = ref(null) |
|
|
|
// 统计合计数 |
|
|
|
const trueGold = ref(0) |
|
|
|
const trueCount = ref(0) |
|
|
|
const trueRGold = ref(0) |
|
|
|
const trueFGold = ref(0) |
|
|
|
|
|
|
|
// 待审核条数 |
|
|
|
const pendingCount = ref(0) |
|
|
|
// 待审核金币数 |
|
|
|
const pendingGold = ref(0) |
|
|
|
const pendingRGold = ref(0) |
|
|
|
const pendingFGold = ref(0) |
|
|
|
// 已通过条数 |
|
|
|
const approvedCount = ref(0) |
|
|
|
// 已通过金币数 |
|
|
|
const approvedGold = ref(0) |
|
|
|
const approvedRGold = ref(0) |
|
|
|
const approvedFGold = ref(0) |
|
|
|
// 已驳回条数 |
|
|
|
const rejectedCount = ref(0) |
|
|
|
// 已驳回金币数 |
|
|
@ -112,24 +232,19 @@ const rejectedGold = ref(0) |
|
|
|
const rejectedRGold = ref(0) |
|
|
|
const rejectedFGold = ref(0) |
|
|
|
|
|
|
|
|
|
|
|
// 新增排序字段和排序方式 |
|
|
|
const sortField = ref('') |
|
|
|
const sortOrder = ref('') |
|
|
|
|
|
|
|
// 表单验证 |
|
|
|
const rules = reactive({ |
|
|
|
rejectReason: [{required: true, message: '请输入驳回理由', trigger: 'blur'}] |
|
|
|
rejectReason: [{ required: true, message: '请输入驳回理由', trigger: 'blur' }] |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
===================方法============================ |
|
|
|
*/ |
|
|
|
const getAdminData = async function () { |
|
|
|
try { |
|
|
|
const result = await request({ |
|
|
|
url: 'http://18.143.76.3:10704/admin/userinfo', |
|
|
|
url: '/admin/userinfo', |
|
|
|
data: {} |
|
|
|
}) |
|
|
|
adminData.value = result |
|
|
@ -147,29 +262,25 @@ const getRecharge = async function (val) { |
|
|
|
getObj.value.pageNum = val |
|
|
|
} |
|
|
|
// 搜索参数时间赋值 |
|
|
|
if (getTime.value != null) { |
|
|
|
if (getTime.value.startTime != '' && getTime.value.endTime != '') { |
|
|
|
rechargeAudit.value.startTime = formatTime(getTime.value[0]) |
|
|
|
rechargeAudit.value.endTime = formatTime(getTime.value[1]) |
|
|
|
} |
|
|
|
if (getTime.value && getTime.value.length === 2) { |
|
|
|
rechargeAudit.value.startTime = formatTime(getTime.value[0]) |
|
|
|
rechargeAudit.value.endTime = formatTime(getTime.value[1]) |
|
|
|
} else { |
|
|
|
rechargeAudit.value.startTime = '' |
|
|
|
rechargeAudit.value.endTime = '' |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
console.log('搜索参数', getObj.value) |
|
|
|
|
|
|
|
// |
|
|
|
const result = await request({ |
|
|
|
url: 'http://192.168.8.94:8081/audit/selectRecharge', // todo 换接口 |
|
|
|
url: '/audit/selectRecharge', |
|
|
|
data: { |
|
|
|
pageNum: getObj.value.pageNum, |
|
|
|
pageSize: getObj.value.pageSize, |
|
|
|
rechargeAudit: { // 这个根据后端换一下 |
|
|
|
rechargeAudit: { |
|
|
|
...rechargeAudit.value, |
|
|
|
// sortField: sortField.value, |
|
|
|
// sortOrder: sortOrder.value |
|
|
|
sortField: sortField.value, |
|
|
|
sortOrder: sortOrder.value |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
@ -179,57 +290,18 @@ const getRecharge = async function (val) { |
|
|
|
total.value = result.total |
|
|
|
console.log('搜索结果', result.list) |
|
|
|
|
|
|
|
// 合计数接口 还没改 |
|
|
|
// 合计数的接口 |
|
|
|
// 复制一份rechargeVo.value,去掉排序和状态 |
|
|
|
const rechargeVo1 = {...rechargeAudit.value} |
|
|
|
// 合计数接口 |
|
|
|
const rechargeVo1 = { ...rechargeAudit.value } |
|
|
|
delete rechargeVo1.sortField |
|
|
|
delete rechargeVo1.sortOrder |
|
|
|
delete rechargeVo1.auditStatus |
|
|
|
const result2 = await request({ |
|
|
|
// url: 'http://192.168.8.94:8081/audit/selectRecharge', // todo 换接口 这是统计总数接口 |
|
|
|
url: '/audit/sumRechargeGold', |
|
|
|
data: rechargeVo1 |
|
|
|
}) |
|
|
|
// todo 没接口 |
|
|
|
/* // 统计合计数 |
|
|
|
if (result2.data) { |
|
|
|
result2.data.forEach((item) => { |
|
|
|
switch (item.auditStatus) { |
|
|
|
case '待审核': |
|
|
|
// 若 item.raudit 为空则赋值为 0 |
|
|
|
pendingCount.value = item.raudit || 0 |
|
|
|
// 若 item.sumRaudit 为空则赋值为 0 |
|
|
|
pendingGold.value = item.sumRaudit || 0 |
|
|
|
pendingRGold.value = item.sumRaudit1 || 0 |
|
|
|
pendingFGold.value = item.sumRaudit2 || 0 |
|
|
|
break |
|
|
|
case '已通过': |
|
|
|
approvedCount.value = item.raudit || 0 |
|
|
|
approvedGold.value = item.sumRaudit || 0 |
|
|
|
approvedRGold.value = item.sumRaudit1 || 0 |
|
|
|
approvedFGold.value = item.sumRaudit2 || 0 |
|
|
|
break |
|
|
|
case '已驳回': |
|
|
|
rejectedCount.value = item.raudit || 0 |
|
|
|
rejectedGold.value = item.sumRaudit || 0 |
|
|
|
rejectedRGold.value = item.sumRaudit1 || 0 |
|
|
|
rejectedFGold.value = item.sumRaudit2 || 0 |
|
|
|
break |
|
|
|
} |
|
|
|
}) |
|
|
|
}*/ |
|
|
|
|
|
|
|
trueGold.value = pendingGold.value + approvedGold.value + rejectedGold.value |
|
|
|
trueCount.value = pendingCount.value + approvedCount.value + rejectedCount.value |
|
|
|
trueRGold.value = pendingRGold.value + approvedRGold.value + rejectedRGold.value |
|
|
|
trueFGold.value = pendingFGold.value + approvedFGold.value + rejectedFGold.value |
|
|
|
|
|
|
|
console.log('搜索对象', getObj.value) |
|
|
|
// 存储表格数据 |
|
|
|
tableData.value = result.data.list |
|
|
|
console.log('tableData', tableData.value) |
|
|
|
// 存储分页总数 |
|
|
|
total.value = result.data.total |
|
|
|
console.log('total', total.value) |
|
|
|
} catch (error) { |
|
|
|
console.log('请求失败', error) |
|
|
@ -237,108 +309,104 @@ const getRecharge = async function (val) { |
|
|
|
} |
|
|
|
|
|
|
|
// 搜索 |
|
|
|
const search = function () { |
|
|
|
const handleSearch = function () { |
|
|
|
trimJwCode(); |
|
|
|
getObj.value.pageNum = 1 |
|
|
|
getObj.value.pageSize = 50 |
|
|
|
getRecharge() |
|
|
|
} |
|
|
|
|
|
|
|
// 重置 |
|
|
|
const reset = function () { |
|
|
|
delete rechargeAudit.value.activity |
|
|
|
delete rechargeAudit.value.jwcode |
|
|
|
delete rechargeAudit.value.payModel |
|
|
|
delete rechargeAudit.value.market |
|
|
|
delete rechargeAudit.value.startTime |
|
|
|
delete rechargeAudit.value.endTime |
|
|
|
getTime.value = {} |
|
|
|
const resetSearch = function () { |
|
|
|
rechargeAudit.value = { |
|
|
|
jwcode: "", |
|
|
|
activity: "", |
|
|
|
payModel: "", |
|
|
|
startTime: "", |
|
|
|
endTime: "", |
|
|
|
market: "", |
|
|
|
auditStatus: "0" |
|
|
|
} |
|
|
|
getTime.value = [] |
|
|
|
getRecharge() |
|
|
|
} |
|
|
|
|
|
|
|
// 今天 |
|
|
|
const getToday = function () { |
|
|
|
const today = new Date() |
|
|
|
const startTime = new Date( |
|
|
|
today.getFullYear(), |
|
|
|
today.getMonth(), |
|
|
|
today.getDate() |
|
|
|
today.getFullYear(), |
|
|
|
today.getMonth(), |
|
|
|
today.getDate() |
|
|
|
) |
|
|
|
const endTime = new Date( |
|
|
|
today.getFullYear(), |
|
|
|
today.getMonth(), |
|
|
|
today.getDate() + 1 |
|
|
|
today.getFullYear(), |
|
|
|
today.getMonth(), |
|
|
|
today.getDate() + 1 |
|
|
|
) |
|
|
|
getTime.value = [startTime, endTime] |
|
|
|
console.log('getTime', getTime.value) |
|
|
|
getRecharge() |
|
|
|
} |
|
|
|
|
|
|
|
// 昨天 |
|
|
|
const getYesterday = function () { |
|
|
|
const yesterday = new Date() |
|
|
|
yesterday.setDate(yesterday.getDate() - 1) |
|
|
|
const startTime = new Date( |
|
|
|
yesterday.getFullYear(), |
|
|
|
yesterday.getMonth(), |
|
|
|
yesterday.getDate() |
|
|
|
yesterday.getFullYear(), |
|
|
|
yesterday.getMonth(), |
|
|
|
yesterday.getDate() |
|
|
|
) |
|
|
|
const endTime = new Date( |
|
|
|
yesterday.getFullYear(), |
|
|
|
yesterday.getMonth(), |
|
|
|
yesterday.getDate() + 1 |
|
|
|
yesterday.getFullYear(), |
|
|
|
yesterday.getMonth(), |
|
|
|
yesterday.getDate() + 1 |
|
|
|
) |
|
|
|
getTime.value = [startTime, endTime] |
|
|
|
console.log('getTime', getTime.value) |
|
|
|
getRecharge() |
|
|
|
} |
|
|
|
|
|
|
|
// 近7天 |
|
|
|
const get7Days = function () { |
|
|
|
const today = new Date() |
|
|
|
const startTime = new Date( |
|
|
|
today.getFullYear(), |
|
|
|
today.getMonth(), |
|
|
|
today.getDate() - 6 |
|
|
|
today.getFullYear(), |
|
|
|
today.getMonth(), |
|
|
|
today.getDate() - 6 |
|
|
|
) |
|
|
|
const endTime = new Date( |
|
|
|
today.getFullYear(), |
|
|
|
today.getMonth(), |
|
|
|
today.getDate() + 1 |
|
|
|
today.getFullYear(), |
|
|
|
today.getMonth(), |
|
|
|
today.getDate() + 1 |
|
|
|
) |
|
|
|
getTime.value = [startTime, endTime] |
|
|
|
console.log('getTime', getTime.value) |
|
|
|
getRecharge() |
|
|
|
} |
|
|
|
//待审核充值明细 |
|
|
|
|
|
|
|
// 待审核充值明细 |
|
|
|
const adminWait = async function () { |
|
|
|
rechargeAudit.value.auditStatus = "0" |
|
|
|
getObj.value.pageNum = 1 |
|
|
|
await getRecharge() |
|
|
|
console.log('adminWait') |
|
|
|
|
|
|
|
trueCount.value = pendingCount.value |
|
|
|
trueGold.value = pendingGold.value |
|
|
|
trueRGold.value = pendingRGold.value |
|
|
|
trueFGold.value = pendingFGold.value |
|
|
|
} |
|
|
|
//已通过充值明细 |
|
|
|
|
|
|
|
// 已通过充值明细 |
|
|
|
const adminPass = async function () { |
|
|
|
rechargeAudit.value.auditStatus = "1" |
|
|
|
getObj.value.pageNum = 1 |
|
|
|
await getRecharge() |
|
|
|
console.log('adminPass') |
|
|
|
trueCount.value = approvedCount.value |
|
|
|
trueGold.value = approvedGold.value |
|
|
|
trueRGold.value = approvedRGold.value |
|
|
|
trueFGold.value = approvedFGold.value |
|
|
|
} |
|
|
|
//已驳回充值明细 |
|
|
|
|
|
|
|
// 已驳回充值明细 |
|
|
|
const adminReject = async function () { |
|
|
|
rechargeAudit.value.auditStatus = "2" |
|
|
|
getObj.value.pageNum = 1 |
|
|
|
await getRecharge() |
|
|
|
console.log('adminReject') |
|
|
|
trueCount.value = rejectedCount.value |
|
|
|
trueGold.value = rejectedGold.value |
|
|
|
trueRGold.value = rejectedRGold.value |
|
|
|
trueFGold.value = rejectedFGold.value |
|
|
|
} |
|
|
|
|
|
|
|
const handleClick = function (tab, event) { |
|
|
@ -352,11 +420,10 @@ const handleClick = function (tab, event) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const getActivity = async function () { |
|
|
|
try { |
|
|
|
const result = await request({ |
|
|
|
url: 'http://18.143.76.3:10704/general/activity', |
|
|
|
url: '/general/activity', |
|
|
|
data: {} |
|
|
|
}) |
|
|
|
activity.value = result.data |
|
|
@ -365,11 +432,12 @@ const getActivity = async function () { |
|
|
|
console.log('请求失败', error) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 地区下拉框 |
|
|
|
const getMarket = async function () { |
|
|
|
try { |
|
|
|
const result = await request({ |
|
|
|
url: 'http://18.143.76.3:10704/general/market', |
|
|
|
url: '/general/market', |
|
|
|
data: {} |
|
|
|
}) |
|
|
|
market.value = result.data |
|
|
@ -378,116 +446,64 @@ const getMarket = async function () { |
|
|
|
console.log('请求失败', error) |
|
|
|
} |
|
|
|
} |
|
|
|
const handlePageSizeChange = function (val) { |
|
|
|
getObj.value.pageSize = val |
|
|
|
getRecharge() |
|
|
|
} |
|
|
|
const handleCurrentChange = function (val) { |
|
|
|
getObj.value.pageNum = val |
|
|
|
|
|
|
|
const handlePagination = (type, val) => { |
|
|
|
if (type === 'size') { |
|
|
|
getObj.value.pageSize = val |
|
|
|
} else { |
|
|
|
getObj.value.pageNum = val |
|
|
|
} |
|
|
|
getRecharge() |
|
|
|
} |
|
|
|
|
|
|
|
// 编辑==================================== |
|
|
|
// 通过按钮 |
|
|
|
const pass = function (row) { |
|
|
|
// 通过初始化 |
|
|
|
// 审核id 就是当前登录人 即 adminId |
|
|
|
// passObj.value.auditId = adminData.value.adminId |
|
|
|
// todo 一定要删除 换成上面的 |
|
|
|
passObj.value.auditId = 1 |
|
|
|
passObj.value.orderCode = row.orderCode |
|
|
|
|
|
|
|
// passObj.value.auditStatus = 1 |
|
|
|
// passObj.value.rechargeId = row.rechargeId |
|
|
|
// passObj.value.detailId = row.detailId |
|
|
|
// passObj.value.jwcode = row.jwcode |
|
|
|
// passObj.value.paidGold = row.paidGold |
|
|
|
// passObj.value.freeGold = row.freeGold |
|
|
|
// passObj.value.adminName = adminData.value.adminName |
|
|
|
|
|
|
|
console.log('通过对象', passObj.value) |
|
|
|
} |
|
|
|
// 通过确认 |
|
|
|
const passConfirm = async function () { |
|
|
|
// 处理通过操作 |
|
|
|
const handleApprove = async (row) => { |
|
|
|
try { |
|
|
|
// 也许大概应该在点击确认时改变状态 |
|
|
|
passObj.value.action = 1 |
|
|
|
console.log('通过对象', passObj.value) |
|
|
|
// 发送POST请求 |
|
|
|
// passObj.value.flag = 0; |
|
|
|
const result = await request({ |
|
|
|
url: 'http://192.168.8.94:8081/audit/audit', |
|
|
|
data: passObj.value |
|
|
|
}) |
|
|
|
console.log('请求成功', result) |
|
|
|
await getRecharge() |
|
|
|
//提示 |
|
|
|
ElMessage({ |
|
|
|
type: 'success', |
|
|
|
message: '通过成功!' |
|
|
|
}) |
|
|
|
const params = { |
|
|
|
orderCode: row.orderCode, |
|
|
|
auditId: 1, // todo 替换为实际审核人ID |
|
|
|
action: 1, |
|
|
|
rejectReason: '' |
|
|
|
} |
|
|
|
await request({ url: '/audit/audit', data: params }) |
|
|
|
ElMessage.success('审核通过成功') |
|
|
|
getRecharge() |
|
|
|
} catch (error) { |
|
|
|
console.error('请求失败', error); |
|
|
|
ElMessage({ |
|
|
|
type: 'error', |
|
|
|
message: '出错了,不知道咋回事' |
|
|
|
}); |
|
|
|
console.error('审核通过失败', error) |
|
|
|
ElMessage.error('操作失败') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 打开驳回弹出框 |
|
|
|
const openRej = function () { |
|
|
|
rejectVisible.value = true |
|
|
|
// 显示驳回对话框 |
|
|
|
const showRejectDialog = (row) => { |
|
|
|
currentRecord.value = row |
|
|
|
rejectReason.value = '' // 清空之前的 |
|
|
|
rejectDialogVisible.value = true |
|
|
|
} |
|
|
|
// 关闭驳回弹出框 |
|
|
|
const closeRej = function () { |
|
|
|
rejectVisible.value = false |
|
|
|
} |
|
|
|
// 驳回按钮 |
|
|
|
const reject = function (row) { |
|
|
|
console.log('row', row) |
|
|
|
// 驳回初始化 |
|
|
|
// 审核id 就是当前登录人 即 adminId |
|
|
|
// rejectObj.value.auditId = adminData.value.adminId |
|
|
|
// todo 一定要删除 换成上面的 |
|
|
|
passObj.value.auditId = 1 |
|
|
|
|
|
|
|
rejectObj.value.orderCode = row.orderCode |
|
|
|
console.log('驳回对象', rejectObj.value) |
|
|
|
// 驳回理由 |
|
|
|
rejectObj.value.rejectReason = '' |
|
|
|
|
|
|
|
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 request({ |
|
|
|
url: 'http://192.168.8.94:8081/audit/audit', |
|
|
|
data: rejectObj.value |
|
|
|
}) |
|
|
|
console.log('请求成功', result) |
|
|
|
await getRecharge() |
|
|
|
closeRejectVisible()// 关闭弹出框 |
|
|
|
ElMessage({ |
|
|
|
type: 'success', |
|
|
|
message: '驳回成功!' |
|
|
|
}) |
|
|
|
} catch (error) { |
|
|
|
console.log('请求失败', error) |
|
|
|
} |
|
|
|
} else { |
|
|
|
ElMessage({ |
|
|
|
type: 'error', |
|
|
|
message: '请检查输入内容' |
|
|
|
}) |
|
|
|
|
|
|
|
// 处理驳回操作 |
|
|
|
const handleReject = async () => { |
|
|
|
if (!rejectReason.value.trim()) { |
|
|
|
ElMessage.warning('请输入驳回理由') |
|
|
|
return |
|
|
|
} |
|
|
|
try { |
|
|
|
const params = { |
|
|
|
orderCode: currentRecord.value.orderCode, |
|
|
|
auditId: 1, // todo 替换为实际审核人ID |
|
|
|
action: 2, |
|
|
|
rejectReason: rejectReason.value |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
await request({ url: '/audit/audit', data: params }) |
|
|
|
|
|
|
|
ElMessage.success('驳回操作成功') |
|
|
|
rejectDialogVisible.value = false |
|
|
|
getRecharge() |
|
|
|
} catch (error) { |
|
|
|
console.error('驳回操作失败', error) |
|
|
|
ElMessage.error('操作失败') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 处理排序事件 |
|
|
@ -530,219 +546,16 @@ const previewImage = (imageUrl) => { |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
/* |
|
|
|
===================监听============================ |
|
|
|
*/ |
|
|
|
|
|
|
|
/* |
|
|
|
===================计算属性============================ |
|
|
|
*/ |
|
|
|
|
|
|
|
// 保留两位小数 |
|
|
|
const formattedTrueGold = computed(() => trueGold.value.toFixed(2)) |
|
|
|
const formattedTrueRGold = computed(() => trueRGold.value.toFixed(2)) |
|
|
|
const formattedTrueFGold = computed(() => trueFGold.value.toFixed(2)) |
|
|
|
|
|
|
|
/* |
|
|
|
===================挂载============================ |
|
|
|
*/ |
|
|
|
// 挂载 |
|
|
|
onMounted(async function () { |
|
|
|
await getAdminData() |
|
|
|
// await getAdminData() |
|
|
|
await getActivity() |
|
|
|
await getRecharge() |
|
|
|
await getMarket() |
|
|
|
// await search() |
|
|
|
await getRecharge() |
|
|
|
}) |
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
<template> |
|
|
|
<el-row> |
|
|
|
<el-col> |
|
|
|
<el-card style="margin-bottom: 5px"> |
|
|
|
<el-row style="margin-bottom: 5px"> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-text size="large">精网号:</el-text> |
|
|
|
<el-input v-model="rechargeAudit.jwcode" placeholder="请输入精网号" style="width: 240px" clearable/> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-text size="large">活动名称:</el-text> |
|
|
|
<el-select v-model="rechargeAudit.activity" placeholder="请选择活动名称" style="width: 240px" clearable> |
|
|
|
<el-option v-for="item in activity" :key="item" :label="item" |
|
|
|
:value="item"/> |
|
|
|
</el-select> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-text size="large">充值方式:</el-text> |
|
|
|
<el-select v-model="rechargeAudit.payModel" placeholder="请选择充值方式" style="width: 240px" clearable> |
|
|
|
<el-option v-for="item in payModel" :key="item.value" :label="item.label" :value="item.value"/> |
|
|
|
</el-select> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<div class="head-card-element"> |
|
|
|
<el-text size="large">所属地区:</el-text> |
|
|
|
<el-select v-model="rechargeAudit.market" placeholder="请选择所属地区" style="width: 240px" clearable> |
|
|
|
<el-option v-for="item in market" :key="item" :label="item" :value="item"/> |
|
|
|
</el-select> |
|
|
|
</div> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="12"> |
|
|
|
<div class="time-controls"> |
|
|
|
<div class="time-group"> |
|
|
|
<el-text size="large">充值时间:</el-text> |
|
|
|
<el-date-picker v-model="getTime" type="datetimerange" range-separator="至" start-placeholder="起始时间" |
|
|
|
end-placeholder="结束时间" style="width: 400px"/> |
|
|
|
<el-button @click="getToday()" style="margin-left: 10px"> 今</el-button> |
|
|
|
<el-button @click="getYesterday()" style="margin-left: 10px"> 昨</el-button> |
|
|
|
<el-button @click="get7Days()" style="margin-left: 10px"> 近7天</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
<el-col :span="8"> |
|
|
|
<el-button @click="reset()" type="success">重置</el-button> |
|
|
|
<el-button type="primary" @click="get()">查询</el-button> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-card> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col> |
|
|
|
<el-card> |
|
|
|
<el-tabs v-model="activeName" type="card" @tab-click="handleClick"> |
|
|
|
<el-tab-pane label="待审核" name="wait"></el-tab-pane> |
|
|
|
<el-tab-pane label="已通过" name="pass"></el-tab-pane> |
|
|
|
<el-tab-pane label="已驳回" name="reject"></el-tab-pane> |
|
|
|
|
|
|
|
<div> <!--todo 改这里 总数的--> |
|
|
|
总条数:{{ trueCount }}条 |
|
|
|
总金币数:{{ formattedTrueGold / 100 }}金币 |
|
|
|
永久金币:{{ formattedTrueRGold / 100 }}金币 |
|
|
|
免费金币:{{ formattedTrueFGold / 100 }}金币 |
|
|
|
</div> |
|
|
|
</el-tabs> |
|
|
|
|
|
|
|
<!--表格--> |
|
|
|
<div style="height: 540px; overflow-y: auto"> |
|
|
|
<el-table :data="tableData" style="width: 100%" height="540px" @sort-change="handleSortChange" |
|
|
|
:row-style="{ height: '50px' }"> |
|
|
|
<el-table-column type="index" label="序号" width="100px" fixed="left"> |
|
|
|
<template #default="scope"> |
|
|
|
<span>{{ scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column fixed="left" prop="name" label="姓名" width="150px"/> |
|
|
|
<el-table-column fixed="left" prop="jwcode" label="精网号" width="110px"/> |
|
|
|
<el-table-column prop="market" label="所属地区" width="100px"/> |
|
|
|
<el-table-column prop="activity" label="活动名称" width="100px"/> |
|
|
|
<el-table-column prop="permanentGold" label="充值金额" sortable="custom" width="110px"> |
|
|
|
<template #default="scope">{{ scope.row.permanentGold / 100 }}</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="permanentGold" label="永久金币" width="110px" sortable="custom"> |
|
|
|
<template #default="scope">{{ scope.row.permanentGold / 100 }}</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="freeGold" label="免费金币" sortable="custom" width="110px"> |
|
|
|
<template #default="scope">{{ scope.row.freeGold / 100 }}</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="remark" label="备注" width="200px" show-overflow-tooltip/> |
|
|
|
|
|
|
|
<el-table-column prop="payModel" label="支付方式" width="110px"/> |
|
|
|
<el-table-column prop="voucher" label="支付凭证" width="110px"> |
|
|
|
<!-- 支付凭证列,支持点击放大预览 --> |
|
|
|
<template #default="scope"> |
|
|
|
<div v-if="scope.row.voucher" style="cursor: pointer;" @click="previewImage(scope.row.voucher)"> |
|
|
|
<img :src="scope.row.voucher" alt="支付凭证" style="width: 80px; height: auto;"> |
|
|
|
</div> |
|
|
|
<div v-else>--</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
|
|
|
|
<el-table-column prop="adminName" label="提交人" width="100px"/> |
|
|
|
<!-- |
|
|
|
字太多就悬停显示 |
|
|
|
--> |
|
|
|
<el-table-column prop="rejectReason" v-if="activeName === 'reject'" label="驳回理由" width="200px" |
|
|
|
show-overflow-tooltip/> |
|
|
|
|
|
|
|
<el-table-column v-if="activeName!== 'wait'" prop="auditName" label="审核人" width="100px"/> |
|
|
|
<el-table-column prop="payTime" sortable="custom" label="付款时间" width="200px"> |
|
|
|
<template #default="scope"> |
|
|
|
{{ moment(scope.row.payTime).format('YYYY-MM-DD HH:mm:ss') }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="createTime" sortable="custom" label="提交时间" width="200px"> |
|
|
|
<template #default="scope"> |
|
|
|
{{ moment(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column v-if="activeName === 'wait'" |
|
|
|
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.auditStatus === 1 || scope.row.auditStatus === 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.auditStatus === 1 || scope.row.auditStatus === 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" :page-sizes="[5, 10, 20, 50, 100]" |
|
|
|
layout="total, sizes, prev, pager, next, jumper" :total="total" |
|
|
|
@size-change="handlePageSizeChange" |
|
|
|
@current-change="handleCurrentChange"></el-pagination> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-dialog v-model="rejectVisible" title="驳回理由" width="500" :before-close="closeRej"> |
|
|
|
<template #footer> |
|
|
|
<el-form :model="rejectObj" ref="Ref" :rules="rules" label-width="auto" style="max-width: 600px"> |
|
|
|
<el-form-item prop="rejectReason" label="驳回理由:"> |
|
|
|
<el-input v-model="rejectObj.rejectReason" maxlength="150" show-word-limit style="width: 350px" |
|
|
|
type="textarea" |
|
|
|
placeholder="请输入内容"/> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
<div class="dialog-footer"> |
|
|
|
<<<<<<< HEAD |
|
|
|
<el-button @click="closeRejectVisible()">取消</el-button> |
|
|
|
<el-button type="primary" @click="rejectConfirm()"> 确定</el-button> |
|
|
|
======= |
|
|
|
<el-button @click="closeRej()">取消</el-button> |
|
|
|
<el-button type="primary" @click="rejectConfirm()"> 确定 </el-button> |
|
|
|
>>>>>>> lihuilin/feature-20250623164044-金币前端 |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-dialog> |
|
|
|
</template> |
|
|
|
|
|
|
|
<style scoped> |
|
|
|
.pagination { |
|
|
|
display: flex; |
|
|
@ -816,4 +629,4 @@ onMounted(async function () { |
|
|
|
text-overflow: ellipsis; |
|
|
|
white-space: nowrap; |
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |