|
@ -1,98 +1,58 @@ |
|
|
<!-- 支付凭证!!! --> |
|
|
|
|
|
<template> |
|
|
<template> |
|
|
<el-row> |
|
|
|
|
|
<el-col> |
|
|
|
|
|
<el-card style="margin-bottom: 20px;margin-top:10px"> |
|
|
|
|
|
<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"> |
|
|
|
|
|
<el-text class="mx-1" size="large">所属地区:</el-text> |
|
|
|
|
|
<el-cascader |
|
|
|
|
|
v-model="selectedMarketPath" |
|
|
|
|
|
:options="market" |
|
|
|
|
|
placeholder="请选择所属地区" |
|
|
|
|
|
clearable |
|
|
|
|
|
style="width:180px" |
|
|
|
|
|
@change="handleMarketChange" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
<el-row> |
|
|
|
|
|
<el-col :span="12"> |
|
|
|
|
|
<div class="time-controls"> |
|
|
|
|
|
<div class="time-group"> |
|
|
|
|
|
<el-text size="large" style="width: 80px">充值时间:</el-text> |
|
|
|
|
|
<el-date-picker v-model="getTime" type="datetimerange" range-separator="至" start-placeholder="起始时间" |
|
|
|
|
|
end-placeholder="结束时间" style="width: 400px" @change="handleDatePickerChange" |
|
|
|
|
|
:default-time="defaultTime" |
|
|
|
|
|
/> |
|
|
|
|
|
<el-button @click="getToday()" style="margin-left: 10px" |
|
|
|
|
|
:type="activeTimeRange === 'today' ? 'primary' : ''"> 今 |
|
|
|
|
|
</el-button> |
|
|
|
|
|
<el-button @click="getYesterday()" style="margin-left: 10px" |
|
|
|
|
|
:type="activeTimeRange === 'yesterday' ? 'primary' : ''"> 昨 |
|
|
|
|
|
</el-button> |
|
|
|
|
|
<el-button @click="get7Days()" style="margin-left: 10px" |
|
|
|
|
|
:type="activeTimeRange === '7days' ? 'primary' : ''"> 近7天 |
|
|
|
|
|
</el-button> |
|
|
|
|
|
<el-button @click="resetSearch" type="success">重置</el-button> |
|
|
|
|
|
<el-button type="primary" @click="handleSearch">查询</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
</el-col> |
|
|
|
|
|
|
|
|
|
|
|
</el-row> |
|
|
|
|
|
</el-card> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
<el-row> |
|
|
|
|
|
<el-col> |
|
|
|
|
|
|
|
|
<el-card style="margin-bottom: 0.5vh;margin-top: 0.5vh"> |
|
|
|
|
|
<el-col style="margin-bottom: 0.5vh"> |
|
|
|
|
|
<el-text size="large">精网号:</el-text> |
|
|
|
|
|
<el-input v-model="rechargeAudit.jwcode" placeholder="请输入精网号" style="width: 12vw;margin-right:1vw" clearable /> |
|
|
|
|
|
|
|
|
|
|
|
<el-text size="large">活动名称:</el-text> |
|
|
|
|
|
<el-select v-model="rechargeAudit.activity" placeholder="请选择活动名称" style="width: 12vw;margin-right:1vw" clearable> |
|
|
|
|
|
<el-option v-for="item in activity" :key="item" :label="item" :value="item" /> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
|
|
|
|
|
|
<el-text size="large">支付方式:</el-text> |
|
|
|
|
|
<el-select v-model="rechargeAudit.payModel" placeholder="请选择支付方式" style="width: 12vw;margin-right:1vw" clearable> |
|
|
|
|
|
<el-option v-for="item in payModel" :key="item.value" :label="item.label" :value="item.value" /> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
|
|
|
|
|
|
<el-text size="large">所属地区:</el-text> |
|
|
|
|
|
<el-cascader v-model="selectedMarketPath" :options="market" placeholder="请选择所属地区" clearable style="width:12vw" |
|
|
|
|
|
@change="handleMarketChange" /> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col> |
|
|
|
|
|
<el-text size="large">充值时间:</el-text> |
|
|
|
|
|
<el-date-picker v-model="getTime" type="datetimerange" range-separator="至" start-placeholder="起始时间" |
|
|
|
|
|
end-placeholder="结束时间" class="time-controls" style="margin-right:1vw;width:25vw" |
|
|
|
|
|
@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 @click="resetSearch" type="success">重置</el-button> |
|
|
|
|
|
<el-button @click="handleSearch"type="primary" >查询</el-button> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
</el-card> |
|
|
<el-card> |
|
|
<el-card> |
|
|
<el-tabs v-model="activeName" type="card" @tab-click="handleClick"> |
|
|
<el-tabs v-model="activeName" type="card" @tab-click="handleClick"> |
|
|
<el-tab-pane label="待审核" name="wait"></el-tab-pane> |
|
|
<el-tab-pane label="待审核" name="wait"></el-tab-pane> |
|
|
<el-tab-pane label="已通过" name="pass"></el-tab-pane> |
|
|
<el-tab-pane label="已通过" name="pass"></el-tab-pane> |
|
|
<el-tab-pane label="已驳回" name="reject"></el-tab-pane> |
|
|
<el-tab-pane label="已驳回" name="reject"></el-tab-pane> |
|
|
|
|
|
|
|
|
<div> |
|
|
<div> |
|
|
总条数:{{ format3(stats.totalNum) }}条 |
|
|
总条数:{{ format3(stats.totalNum) }}条 |
|
|
|
|
|
|
|
|
总金币数:{{ format3(stats.permanentGolds + stats.freeGolds + stats.taskGolds) }}金币 |
|
|
总金币数:{{ format3(stats.permanentGolds + stats.freeGolds + stats.taskGolds) }}金币 |
|
|
永久金币:{{ format3(stats.permanentGolds) }}金币 |
|
|
永久金币:{{ format3(stats.permanentGolds) }}金币 |
|
|
免费金币:{{ format3(stats.freeGolds) }}金币 |
|
|
免费金币:{{ format3(stats.freeGolds) }}金币 |
|
|
<!-- 任务金币:{{ stats.taskGolds.toFixed(2) }}金币--> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</el-tabs> |
|
|
</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 :data="tableData" style="width: 100vw;height:55vh" @sort-change="handleSortChange" |
|
|
|
|
|
:row-style="{ height: '50px' }"> |
|
|
<el-table-column type="index" label="序号" width="100px" fixed="left"> |
|
|
<el-table-column type="index" label="序号" width="100px" fixed="left"> |
|
|
<template #default="scope"> |
|
|
<template #default="scope"> |
|
|
<span>{{ scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize }}</span> |
|
|
<span>{{ scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize }}</span> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</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 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="money" label="充值金额" sortable="custom" width="110px"> |
|
|
<el-table-column prop="money" label="充值金额" sortable="custom" width="110px"> |
|
|
<template #default="scope">{{ scope.row.permanentGold / 100 }}</template> |
|
|
<template #default="scope">{{ scope.row.permanentGold / 100 }}</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
@ -102,23 +62,22 @@ |
|
|
<el-table-column prop="freeGold" label="免费金币" sortable="custom" width="110px"> |
|
|
<el-table-column prop="freeGold" label="免费金币" sortable="custom" width="110px"> |
|
|
<template #default="scope">{{ (scope.row.freeGold) / 100 }}</template> |
|
|
<template #default="scope">{{ (scope.row.freeGold) / 100 }}</template> |
|
|
</el-table-column> |
|
|
</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="remark" label="备注" width="200px" show-overflow-tooltip /> |
|
|
|
|
|
<el-table-column prop="payModel" label="支付方式" width="110px" /> |
|
|
<el-table-column prop="voucher" label="支付凭证" width="110px"> |
|
|
<el-table-column prop="voucher" label="支付凭证" width="110px"> |
|
|
<template #default="scope"> |
|
|
<template #default="scope"> |
|
|
<div v-if="scope.row.voucher" |
|
|
<div v-if="scope.row.voucher" |
|
|
style="display: flex; justify-content: center; align-items: center; cursor: pointer;" |
|
|
|
|
|
@click="previewImage(scope.row.voucher)"> |
|
|
|
|
|
|
|
|
style="display: flex; justify-content: center; align-items: center; cursor: pointer;" |
|
|
|
|
|
@click="previewImage(scope.row.voucher)"> |
|
|
<img :src="scope.row.voucher" alt="支付凭证" style="width: auto; height: 40px;"> |
|
|
<img :src="scope.row.voucher" alt="支付凭证" style="width: auto; height: 40px;"> |
|
|
</div> |
|
|
</div> |
|
|
<div v-else style="display: flex; justify-content: center; align-items: center; height: 40px;">--</div> |
|
|
<div v-else style="display: flex; justify-content: center; align-items: center; height: 40px;">--</div> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column prop="adminName" label="提交人" width="100px"/> |
|
|
|
|
|
|
|
|
<el-table-column prop="adminName" label="提交人" width="100px" /> |
|
|
<el-table-column prop="rejectReason" v-if="activeName === 'reject'" label="驳回理由" width="200px" |
|
|
<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"/> |
|
|
|
|
|
|
|
|
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"> |
|
|
<el-table-column prop="payTime" sortable="custom" label="付款时间" width="200px"> |
|
|
<template #default="scope"> |
|
|
<template #default="scope"> |
|
|
{{ moment(scope.row.payTime).format('YYYY-MM-DD HH:mm:ss') }} |
|
|
{{ moment(scope.row.payTime).format('YYYY-MM-DD HH:mm:ss') }} |
|
@ -139,37 +98,30 @@ |
|
|
<div class="operation"> |
|
|
<div class="operation"> |
|
|
<el-popconfirm title="确定要通过此条记录吗?" @confirm="handleApprove(scope.row)"> |
|
|
<el-popconfirm title="确定要通过此条记录吗?" @confirm="handleApprove(scope.row)"> |
|
|
<template #reference> |
|
|
<template #reference> |
|
|
<el-button :disabled="scope.row.auditStatus === 1 || scope.row.auditStatus === 2" type="primary" |
|
|
|
|
|
text> |
|
|
|
|
|
|
|
|
<el-button :disabled="scope.row.auditStatus === 1 || scope.row.auditStatus === 2" type="primary" text> |
|
|
通过 |
|
|
通过 |
|
|
</el-button> |
|
|
</el-button> |
|
|
</template> |
|
|
</template> |
|
|
</el-popconfirm> |
|
|
</el-popconfirm> |
|
|
<el-button :disabled="scope.row.auditStatus === 1 || scope.row.auditStatus === 2" type="primary" text |
|
|
|
|
|
@click="showRejectDialog(scope.row)"> |
|
|
|
|
|
|
|
|
<el-button :disabled="scope.row.auditStatus === 1 || scope.row.auditStatus === 2" type="primary" text @click="showRejectDialog(scope.row)"> |
|
|
驳回 |
|
|
驳回 |
|
|
</el-button> |
|
|
</el-button> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
</el-table> |
|
|
</el-table> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="pagination"> |
|
|
<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> |
|
|
|
|
|
|
|
|
<el-pagination :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> |
|
|
</div> |
|
|
</el-card> |
|
|
</el-card> |
|
|
</el-col> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog v-model="rejectDialogVisible" title="驳回理由" width="500px"> |
|
|
<el-dialog v-model="rejectDialogVisible" title="驳回理由" width="500px"> |
|
|
<el-form> |
|
|
<el-form> |
|
|
<el-form-item label="驳回理由" required> |
|
|
<el-form-item label="驳回理由" required> |
|
|
<el-input v-model="rejectReason" type="textarea" :rows="4" placeholder="请输入驳回理由" maxlength="200" |
|
|
|
|
|
show-word-limit/> |
|
|
|
|
|
|
|
|
<el-input v-model="rejectReason" type="textarea" :rows="4" placeholder="请输入驳回理由" maxlength="200" show-word-limit /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
<template #footer> |
|
|
<template #footer> |
|
@ -182,41 +134,37 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script setup> |
|
|
<script setup> |
|
|
import {onMounted, reactive, ref} from 'vue' |
|
|
|
|
|
import {ElMessage} from 'element-plus' |
|
|
|
|
|
|
|
|
import { onMounted, reactive, ref } from 'vue' |
|
|
|
|
|
import { ElMessage } from 'element-plus' |
|
|
import request from '@/util/http.js' |
|
|
import request from '@/util/http.js' |
|
|
import API from '@/util/http.js' |
|
|
import API from '@/util/http.js' |
|
|
import moment from 'moment' |
|
|
import moment from 'moment' |
|
|
import {useAdminStore} from "@/store/index.js"; |
|
|
|
|
|
import {storeToRefs} from "pinia"; |
|
|
|
|
|
import {findMenuById, permissionMapping} from "@/utils/menuTreePermission.js" |
|
|
|
|
|
|
|
|
import { useAdminStore } from "@/store/index.js"; |
|
|
|
|
|
import { storeToRefs } from "pinia"; |
|
|
|
|
|
const adminStore = useAdminStore(); |
|
|
|
|
|
const { adminData, menuTree } = storeToRefs(adminStore); |
|
|
|
|
|
import { findMenuById, permissionMapping } from "@/utils/menuTreePermission.js" |
|
|
import dayjs from "dayjs"; |
|
|
import dayjs from "dayjs"; |
|
|
// 精网号去空格 |
|
|
|
|
|
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 defaultTime = [ |
|
|
|
|
|
new Date(2000, 1, 1, 0, 0, 0), |
|
|
|
|
|
new Date(2000, 2, 1, 23, 59, 59), |
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
// 这是获取用户信息的接口 |
|
|
|
|
|
const adminData = ref({}) |
|
|
|
|
|
// 充值明细表格 |
|
|
|
|
|
const tableData = ref([]) |
|
|
const tableData = ref([]) |
|
|
// 标记当前激活的时间范围按钮 |
|
|
|
|
|
|
|
|
// 当前激活的时间按钮 |
|
|
const activeTimeRange = ref('') |
|
|
const activeTimeRange = ref('') |
|
|
// 日期选择器变化时清除按钮激活状态 |
|
|
|
|
|
const handleDatePickerChange = () => { |
|
|
|
|
|
activeTimeRange.value = '' |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 搜索表单数据 |
|
|
|
|
|
|
|
|
const total = ref(50) |
|
|
|
|
|
// 搜索对象时间 |
|
|
|
|
|
const getTime = ref([]) |
|
|
|
|
|
const activity = ref([]) |
|
|
|
|
|
const market = ref("") |
|
|
|
|
|
const rejectDialogVisible = ref(false) |
|
|
|
|
|
const rejectReason = ref('') |
|
|
|
|
|
// 当前行信息 |
|
|
|
|
|
const currentRecord = ref(null) |
|
|
|
|
|
// 标签页默认是待审批 |
|
|
|
|
|
const activeName = ref('wait') |
|
|
|
|
|
const sortField = ref('') |
|
|
|
|
|
const sortOrder = ref('') |
|
|
|
|
|
// 存储地区选择变化 |
|
|
|
|
|
const selectedMarketPath = ref("") |
|
|
|
|
|
// 搜索表单 |
|
|
const rechargeAudit = ref({ |
|
|
const rechargeAudit = ref({ |
|
|
jwcode: "", // 精网号 |
|
|
jwcode: "", // 精网号 |
|
|
activity: "", // 活动名称 |
|
|
activity: "", // 活动名称 |
|
@ -226,31 +174,13 @@ const rechargeAudit = ref({ |
|
|
market: "", // 地区 |
|
|
market: "", // 地区 |
|
|
auditStatus: "0", |
|
|
auditStatus: "0", |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
// 搜索对象 |
|
|
// 搜索对象 |
|
|
const getObj = ref({ |
|
|
const getObj = ref({ |
|
|
pageNum: 1, |
|
|
pageNum: 1, |
|
|
pageSize: 50 |
|
|
pageSize: 50 |
|
|
}) |
|
|
}) |
|
|
// 分页总条目 |
|
|
|
|
|
const total = ref(50) |
|
|
|
|
|
// 搜索对象时间 |
|
|
|
|
|
const getTime = ref([]) |
|
|
|
|
|
const activity = ref([]) |
|
|
|
|
|
// 搜索地区列表 |
|
|
|
|
|
const market = ref("") |
|
|
|
|
|
// 驳回弹出框 |
|
|
|
|
|
const rejectDialogVisible = ref(false) |
|
|
|
|
|
// 驳回理由 |
|
|
|
|
|
const rejectReason = ref('') |
|
|
|
|
|
// 当前行信息 |
|
|
|
|
|
const currentRecord = ref(null) |
|
|
|
|
|
// 标签页默认是待审批 |
|
|
|
|
|
const activeName = ref('wait') |
|
|
|
|
|
// 支付方式选项 |
|
|
// 支付方式选项 |
|
|
const payModel = [ |
|
|
const payModel = [ |
|
|
|
|
|
|
|
|
// 现金、支票、刷卡、其他(各地区电子支付) |
|
|
|
|
|
{ |
|
|
{ |
|
|
value: '现金', |
|
|
value: '现金', |
|
|
label: '现金' |
|
|
label: '现金' |
|
@ -268,8 +198,6 @@ const payModel = [ |
|
|
label: '其他(各地区电子支付)' |
|
|
label: '其他(各地区电子支付)' |
|
|
}, |
|
|
}, |
|
|
] |
|
|
] |
|
|
// 表单验证ref |
|
|
|
|
|
const Ref = ref(null) |
|
|
|
|
|
// 统计合计数 |
|
|
// 统计合计数 |
|
|
const stats = ref({ |
|
|
const stats = ref({ |
|
|
totalNum: 0, |
|
|
totalNum: 0, |
|
@ -278,38 +206,13 @@ const stats = ref({ |
|
|
freeGolds: 0, |
|
|
freeGolds: 0, |
|
|
taskGolds: 0 |
|
|
taskGolds: 0 |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 新增排序字段和排序方式 |
|
|
|
|
|
const sortField = ref('') |
|
|
|
|
|
const sortOrder = ref('') |
|
|
|
|
|
|
|
|
|
|
|
// 表单验证 |
|
|
// 表单验证 |
|
|
const rules = reactive({ |
|
|
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: '/admin/userinfo', |
|
|
|
|
|
data: {} |
|
|
|
|
|
}) |
|
|
|
|
|
adminData.value = result |
|
|
|
|
|
console.log('用户信息', adminData.value) |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
console.log('请求失败', error) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 搜索方法 |
|
|
// 搜索方法 |
|
|
const getRecharge = async function (val) { |
|
|
const getRecharge = async function (val) { |
|
|
try { |
|
|
try { |
|
|
// 搜索参数页码赋值 |
|
|
|
|
|
if (typeof val === 'number') { |
|
|
|
|
|
getObj.value.pageNum = val |
|
|
|
|
|
} |
|
|
|
|
|
// 搜索参数时间赋值 |
|
|
|
|
|
if (getTime.value && getTime.value.length === 2) { |
|
|
if (getTime.value && getTime.value.length === 2) { |
|
|
rechargeAudit.value.startTime = formatTime(getTime.value[0]) |
|
|
rechargeAudit.value.startTime = formatTime(getTime.value[0]) |
|
|
rechargeAudit.value.endTime = formatTime(getTime.value[1]) |
|
|
rechargeAudit.value.endTime = formatTime(getTime.value[1]) |
|
@ -317,8 +220,6 @@ const getRecharge = async function (val) { |
|
|
rechargeAudit.value.startTime = '' |
|
|
rechargeAudit.value.startTime = '' |
|
|
rechargeAudit.value.endTime = '' |
|
|
rechargeAudit.value.endTime = '' |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
console.log('搜索参数', getObj.value) |
|
|
|
|
|
if (rechargeAudit.value.market === '总部' || rechargeAudit.value.market === '研发部') { |
|
|
if (rechargeAudit.value.market === '总部' || rechargeAudit.value.market === '研发部') { |
|
|
rechargeAudit.value.market = ''; |
|
|
rechargeAudit.value.market = ''; |
|
|
} |
|
|
} |
|
@ -326,11 +227,9 @@ const getRecharge = async function (val) { |
|
|
if (rechargeAudit.value.jwcode) { |
|
|
if (rechargeAudit.value.jwcode) { |
|
|
// 纯数字 |
|
|
// 纯数字 |
|
|
const numberRegex = /^\d{1,9}$/; |
|
|
const numberRegex = /^\d{1,9}$/; |
|
|
|
|
|
|
|
|
// 检查是否不是数字 |
|
|
// 检查是否不是数字 |
|
|
if (!numberRegex.test(rechargeAudit.value.jwcode)) { |
|
|
if (!numberRegex.test(rechargeAudit.value.jwcode)) { |
|
|
ElMessage.error('请检查精网号格式') |
|
|
ElMessage.error('请检查精网号格式') |
|
|
|
|
|
|
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -346,9 +245,7 @@ const getRecharge = async function (val) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
// 存储表格数据 |
|
|
|
|
|
tableData.value = result.list |
|
|
tableData.value = result.list |
|
|
// 存储总条数 |
|
|
|
|
|
total.value = result.total |
|
|
total.value = result.total |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
console.log('请求失败', error) |
|
|
console.log('请求失败', error) |
|
@ -366,7 +263,6 @@ const getStats = async () => { |
|
|
if (rechargeAudit.value.jwcode) { |
|
|
if (rechargeAudit.value.jwcode) { |
|
|
// 纯数字 |
|
|
// 纯数字 |
|
|
const numberRegex = /^\d{1,9}$/; |
|
|
const numberRegex = /^\d{1,9}$/; |
|
|
|
|
|
|
|
|
// 检查是否不是数字 |
|
|
// 检查是否不是数字 |
|
|
if (!numberRegex.test(rechargeAudit.value.jwcode)) { |
|
|
if (!numberRegex.test(rechargeAudit.value.jwcode)) { |
|
|
// ElMessage.error('精网号必须为数字格式') |
|
|
// ElMessage.error('精网号必须为数字格式') |
|
@ -405,8 +301,7 @@ const resetSearch = function () { |
|
|
startTime: "", |
|
|
startTime: "", |
|
|
endTime: "", |
|
|
endTime: "", |
|
|
market: "", |
|
|
market: "", |
|
|
auditStatus: rechargeAudit.value.auditStatus, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auditStatus: rechargeAudit.value.auditStatus |
|
|
} |
|
|
} |
|
|
selectedMarketPath.value = [] |
|
|
selectedMarketPath.value = [] |
|
|
getTime.value = [] |
|
|
getTime.value = [] |
|
@ -420,7 +315,6 @@ const getToday = function () { |
|
|
const today = dayjs() |
|
|
const today = dayjs() |
|
|
const startTime = today.startOf('day').format('YYYY-MM-DD HH:mm:ss') |
|
|
const startTime = today.startOf('day').format('YYYY-MM-DD HH:mm:ss') |
|
|
const endTime = today.endOf('day').format('YYYY-MM-DD HH:mm:ss') |
|
|
const endTime = today.endOf('day').format('YYYY-MM-DD HH:mm:ss') |
|
|
|
|
|
|
|
|
getTime.value = [startTime, endTime] |
|
|
getTime.value = [startTime, endTime] |
|
|
console.log('getTime', getTime.value) |
|
|
console.log('getTime', getTime.value) |
|
|
activeTimeRange.value = 'today' // 标记当前激活状态 |
|
|
activeTimeRange.value = 'today' // 标记当前激活状态 |
|
@ -430,11 +324,9 @@ const getToday = function () { |
|
|
|
|
|
|
|
|
// 昨天 |
|
|
// 昨天 |
|
|
const getYesterday = function () { |
|
|
const getYesterday = function () { |
|
|
|
|
|
|
|
|
const today = dayjs() |
|
|
const today = dayjs() |
|
|
const startTime = today.subtract(1, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss') |
|
|
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') |
|
|
const endTime = today.subtract(1, 'day').endOf('day').format('YYYY-MM-DD HH:mm:ss') |
|
|
|
|
|
|
|
|
getTime.value = [startTime, endTime] |
|
|
getTime.value = [startTime, endTime] |
|
|
console.log('getTime', getTime.value) |
|
|
console.log('getTime', getTime.value) |
|
|
activeTimeRange.value = 'yesterday' // 标记当前激活状态 |
|
|
activeTimeRange.value = 'yesterday' // 标记当前激活状态 |
|
@ -444,7 +336,6 @@ const getYesterday = function () { |
|
|
|
|
|
|
|
|
// 近7天 |
|
|
// 近7天 |
|
|
const get7Days = function () { |
|
|
const get7Days = function () { |
|
|
|
|
|
|
|
|
const today = dayjs() |
|
|
const today = dayjs() |
|
|
const startTime = today.subtract(6, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss') |
|
|
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') |
|
|
const endTime = today.endOf('day').format('YYYY-MM-DD HH:mm:ss') |
|
@ -492,7 +383,6 @@ const handleClick = function (tab, event) { |
|
|
adminReject() |
|
|
adminReject() |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const getActivity = async function () { |
|
|
const getActivity = async function () { |
|
|
try { |
|
|
try { |
|
|
const result = await request({ |
|
|
const result = await request({ |
|
@ -505,8 +395,6 @@ const getActivity = async function () { |
|
|
console.log('请求失败', error) |
|
|
console.log('请求失败', error) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handlePagination = (type, val) => { |
|
|
const handlePagination = (type, val) => { |
|
|
if (type === 'size') { |
|
|
if (type === 'size') { |
|
|
getObj.value.pageSize = val |
|
|
getObj.value.pageSize = val |
|
@ -516,11 +404,6 @@ const handlePagination = (type, val) => { |
|
|
getRecharge() |
|
|
getRecharge() |
|
|
getStats() |
|
|
getStats() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const adminStore = useAdminStore(); |
|
|
|
|
|
const {menuTree} = storeToRefs(adminStore); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 处理通过操作 |
|
|
// 处理通过操作 |
|
|
const handleApprove = async (row) => { |
|
|
const handleApprove = async (row) => { |
|
|
if (findMenuById(menuTree.value, permissionMapping.Recharge_Approval)) { |
|
|
if (findMenuById(menuTree.value, permissionMapping.Recharge_Approval)) { |
|
@ -531,7 +414,7 @@ const handleApprove = async (row) => { |
|
|
action: 1, |
|
|
action: 1, |
|
|
rejectReason: '' |
|
|
rejectReason: '' |
|
|
} |
|
|
} |
|
|
await request({url: '/audit/audit', data: params}) |
|
|
|
|
|
|
|
|
await request({ url: '/audit/audit', data: params }) |
|
|
ElMessage.success('审核通过成功') |
|
|
ElMessage.success('审核通过成功') |
|
|
await getRecharge() |
|
|
await getRecharge() |
|
|
await getStats() |
|
|
await getStats() |
|
@ -544,19 +427,15 @@ const handleApprove = async (row) => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 显示驳回对话框 |
|
|
|
|
|
const showRejectDialog = (row) => { |
|
|
const showRejectDialog = (row) => { |
|
|
currentRecord.value = row |
|
|
currentRecord.value = row |
|
|
rejectReason.value = '' // 清空之前的 |
|
|
|
|
|
|
|
|
rejectReason.value = '' |
|
|
if (findMenuById(menuTree.value, permissionMapping.Recharge_Approval)) { |
|
|
if (findMenuById(menuTree.value, permissionMapping.Recharge_Approval)) { |
|
|
|
|
|
|
|
|
rejectDialogVisible.value = true |
|
|
rejectDialogVisible.value = true |
|
|
} else { |
|
|
} else { |
|
|
ElMessage.error('无权限') |
|
|
ElMessage.error('无权限') |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 处理驳回操作 |
|
|
// 处理驳回操作 |
|
|
const handleReject = async () => { |
|
|
const handleReject = async () => { |
|
|
if (findMenuById(menuTree.value, permissionMapping.Recharge_Approval)) { |
|
|
if (findMenuById(menuTree.value, permissionMapping.Recharge_Approval)) { |
|
@ -573,8 +452,7 @@ const handleReject = async () => { |
|
|
rejectReason: rejectReason.value |
|
|
rejectReason: rejectReason.value |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
await request({url: '/audit/audit', data: params}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await request({ url: '/audit/audit', data: params }) |
|
|
ElMessage.success('驳回操作成功') |
|
|
ElMessage.success('驳回操作成功') |
|
|
rejectDialogVisible.value = false |
|
|
rejectDialogVisible.value = false |
|
|
await getRecharge() |
|
|
await getRecharge() |
|
@ -587,7 +465,6 @@ const handleReject = async () => { |
|
|
ElMessage.error('无权限') |
|
|
ElMessage.error('无权限') |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 处理排序事件 |
|
|
// 处理排序事件 |
|
|
const handleSortChange = (column) => { |
|
|
const handleSortChange = (column) => { |
|
|
console.log('排序字段:', column.prop) |
|
|
console.log('排序字段:', column.prop) |
|
@ -638,9 +515,6 @@ const previewImage = (imageUrl) => { |
|
|
document.body.removeChild(viewer); |
|
|
document.body.removeChild(viewer); |
|
|
}); |
|
|
}); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
// 存储地区选择变化 |
|
|
|
|
|
const selectedMarketPath = ref("") |
|
|
|
|
|
const handleMarketChange = (value) => { |
|
|
const handleMarketChange = (value) => { |
|
|
if (value && value.length > 0) { |
|
|
if (value && value.length > 0) { |
|
|
rechargeAudit.value.market = value[value.length - 1] |
|
|
rechargeAudit.value.market = value[value.length - 1] |
|
@ -649,28 +523,22 @@ const handleMarketChange = (value) => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const props = {multiple: true} |
|
|
|
|
|
|
|
|
const props = { multiple: true } |
|
|
// 获取地区,修改为级联下拉框 |
|
|
// 获取地区,修改为级联下拉框 |
|
|
const getMarket = async function () { |
|
|
const getMarket = async function () { |
|
|
try { |
|
|
try { |
|
|
// 发送POST请求 |
|
|
|
|
|
const result = await API({ |
|
|
const result = await API({ |
|
|
|
|
|
|
|
|
url: '/market/selectMarket', |
|
|
url: '/market/selectMarket', |
|
|
}); |
|
|
}); |
|
|
// 将响应结果存储到响应式数据中 |
|
|
|
|
|
console.log('请求成功', result) |
|
|
console.log('请求成功', result) |
|
|
|
|
|
|
|
|
// 递归转换树形结构为级联选择器需要的格式(跳过第一级节点) |
|
|
// 递归转换树形结构为级联选择器需要的格式(跳过第一级节点) |
|
|
const transformTree = (nodes) => { |
|
|
const transformTree = (nodes) => { |
|
|
// 直接处理第一级节点的子节点 |
|
|
// 直接处理第一级节点的子节点 |
|
|
const allChildren = nodes.flatMap(node => node.children || []); |
|
|
const allChildren = nodes.flatMap(node => node.children || []); |
|
|
|
|
|
|
|
|
return allChildren.map(child => { |
|
|
return allChildren.map(child => { |
|
|
const grandchildren = child.children && child.children.length |
|
|
const grandchildren = child.children && child.children.length |
|
|
? transformTree([child]) // 递归处理子节点 |
|
|
|
|
|
: null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
? transformTree([child]) // 递归处理子节点 |
|
|
|
|
|
: null; |
|
|
return { |
|
|
return { |
|
|
value: child.name, |
|
|
value: child.name, |
|
|
label: child.name, |
|
|
label: child.name, |
|
@ -678,24 +546,33 @@ const getMarket = async function () { |
|
|
}; |
|
|
}; |
|
|
}); |
|
|
}); |
|
|
}; |
|
|
}; |
|
|
// 存储地区信息 |
|
|
|
|
|
market.value = transformTree(result.data) |
|
|
market.value = transformTree(result.data) |
|
|
console.log('转换后的地区树==============', market.value) |
|
|
console.log('转换后的地区树==============', market.value) |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
console.log('请求失败', error) |
|
|
console.log('请求失败', error) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
// 每三位添加逗号 |
|
|
const format3 = (num) => { |
|
|
const format3 = (num) => { |
|
|
// 每三位添加逗号 |
|
|
|
|
|
return num.toLocaleString('en-US') |
|
|
|
|
|
|
|
|
return num.toLocaleString('en-US') |
|
|
} |
|
|
} |
|
|
|
|
|
// 日期选择器变化时清除按钮激活状态 |
|
|
|
|
|
const handleDatePickerChange = () => { |
|
|
|
|
|
activeTimeRange.value = '' |
|
|
|
|
|
} |
|
|
|
|
|
// 精网号去空格 |
|
|
|
|
|
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') : '' |
|
|
// 挂载 |
|
|
// 挂载 |
|
|
onMounted(async function () { |
|
|
onMounted(async function () { |
|
|
await getAdminData() |
|
|
|
|
|
await getActivity() |
|
|
await getActivity() |
|
|
await getMarket() |
|
|
await getMarket() |
|
|
await getRecharge() |
|
|
await getRecharge() |
|
|
console.log('111') |
|
|
|
|
|
|
|
|
console.log("看看通信来的用户身份", adminData.value) |
|
|
await getStats() |
|
|
await getStats() |
|
|
}) |
|
|
}) |
|
|
</script> |
|
|
</script> |
|
@ -703,74 +580,18 @@ onMounted(async function () { |
|
|
<style scoped> |
|
|
<style scoped> |
|
|
.pagination { |
|
|
.pagination { |
|
|
display: flex; |
|
|
display: flex; |
|
|
|
|
|
margin-top: 0.5vh; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.operation { |
|
|
.operation { |
|
|
display: flex; |
|
|
display: flex; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.green-dot { |
|
|
|
|
|
background-color: #67C23A; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.grey-dot { |
|
|
|
|
|
background-color: #909399; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.red-dot { |
|
|
|
|
|
background-color: #F56C6C; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.time-controls { |
|
|
.time-controls { |
|
|
display: flex; |
|
|
display: flex; |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.time-group { |
|
|
|
|
|
display: flex; |
|
|
display: flex; |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
gap: 10px; |
|
|
gap: 10px; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.quick-buttons { |
|
|
|
|
|
display: flex; |
|
|
|
|
|
align-items: center; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.status { |
|
|
|
|
|
display: flex; |
|
|
|
|
|
align-items: center; |
|
|
|
|
|
/* 确保子元素垂直居中对齐 */ |
|
|
|
|
|
gap: 6px; |
|
|
|
|
|
/* 设置圆点和文字之间的间距 */ |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.green-dot, |
|
|
|
|
|
.grey-dot, |
|
|
|
|
|
.red-dot { |
|
|
|
|
|
display: inline-block; |
|
|
|
|
|
width: 8px; |
|
|
|
|
|
height: 8px; |
|
|
|
|
|
border-radius: 50%; |
|
|
|
|
|
flex-shrink: 0; |
|
|
|
|
|
/* 防止圆点在空间不足时缩小 */ |
|
|
|
|
|
margin: 0; |
|
|
|
|
|
/* 移除原有的 margin-right */ |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* 备注列样式 */ |
|
|
|
|
|
.remark-cell { |
|
|
|
|
|
display: block; |
|
|
|
|
|
width: 100%; |
|
|
|
|
|
overflow: hidden; |
|
|
|
|
|
text-overflow: ellipsis; |
|
|
|
|
|
white-space: nowrap; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* 设置单元格内容溢出隐藏 */ |
|
|
|
|
|
.el-table .el-table__cell { |
|
|
|
|
|
overflow: hidden; |
|
|
|
|
|
text-overflow: ellipsis; |
|
|
|
|
|
white-space: nowrap; |
|
|
|
|
|
} |
|
|
|
|
|
</style> |
|
|
</style> |