|
|
@ -22,11 +22,11 @@ |
|
|
|
</el-col> |
|
|
|
</el-card> |
|
|
|
|
|
|
|
<el-card> |
|
|
|
<el-card v-if="hasbeanWaitShow"> |
|
|
|
<el-tabs v-model="checkTab" type="card" @tab-click="handleClick"> |
|
|
|
<el-tab-pane label="待审核" name="pending"></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="pending" v-if="hasbeanWait"></el-tab-pane> |
|
|
|
<el-tab-pane label="已通过" name="pass" v-if="hasbeanThrough"></el-tab-pane> |
|
|
|
<el-tab-pane label="已驳回" name="reject" v-if="hasbeanReject"></el-tab-pane> |
|
|
|
</el-tabs> |
|
|
|
|
|
|
|
<div> |
|
|
@ -61,12 +61,12 @@ |
|
|
|
{{ row.auditTime ? moment(row.auditTime).format('YYYY-MM-DD HH:mm:ss') : '--' }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column v-if="checkTab === 'pending'" fixed="right" prop="operation" label="操作" width="400px"> |
|
|
|
<el-table-column v-if="checkTab === 'pending' &&(hasbeanWaitThough||hasbeanWaitReject)" fixed="right" prop="operation" label="操作" width="400px"> |
|
|
|
<template #default="scope"> |
|
|
|
<div class="operation"> |
|
|
|
<el-popconfirm title="确定要通过此条记录吗?" @confirm="handleApprove(scope.row)"> |
|
|
|
<template #reference> |
|
|
|
<el-button :disabled="clicked || cancelClicked" type="primary" text> |
|
|
|
<el-button v-if="hasbeanWaitThough" :disabled="clicked || cancelClicked" type="primary" text> |
|
|
|
通过 |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
@ -77,7 +77,7 @@ |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
</el-popconfirm> |
|
|
|
<el-button :disabled="clicked || cancelClicked" type="primary" text @click="showRejectDialog(scope.row)"> |
|
|
|
<el-button v-if="hasbeanWaitReject" :disabled="clicked || cancelClicked" type="primary" text @click="showRejectDialog(scope.row)"> |
|
|
|
驳回 |
|
|
|
</el-button> |
|
|
|
</div> |
|
|
@ -111,13 +111,13 @@ import moment from 'moment' |
|
|
|
import { useAdminStore } from "@/store/index.js"; |
|
|
|
import { storeToRefs } from "pinia"; |
|
|
|
import _ from 'lodash' |
|
|
|
import { permissionMapping, hasMenuPermission } from "@/utils/menuTreePermission.js" |
|
|
|
const defaultTime = [ |
|
|
|
new Date(2000, 1, 1, 0, 0, 0), |
|
|
|
new Date(2000, 2, 1, 23, 59, 59), |
|
|
|
] |
|
|
|
const adminStore = useAdminStore(); |
|
|
|
const { adminData, menuTree } = storeToRefs(adminStore); |
|
|
|
import { permissionMapping, findMenuById } from "@/utils/menuTreePermission.js" |
|
|
|
import dayjs from "dayjs"; |
|
|
|
|
|
|
|
const tableData = ref([]) |
|
|
@ -144,13 +144,12 @@ const hasbeanWaitReject = ref(false) // 金豆审核驳回(对应beanWaitReje |
|
|
|
// 初始化权限状态(补充金豆审核权限,与充值权限初始化逻辑并列) |
|
|
|
const initPermissions = () => { |
|
|
|
if (!menuTree.value || !menuTree.value.length) return; |
|
|
|
// 2. 金豆审核相关权限初始化(新增,与充值权限结构一致) |
|
|
|
hasbeanWait.value = hasMenuPermission(menuTree.value, permissionMapping.hasbeanWait); |
|
|
|
hasbeanThrough.value = hasMenuPermission(menuTree.value, permissionMapping.hasbeanThrough); |
|
|
|
hasbeanReject.value = hasMenuPermission(menuTree.value, permissionMapping.hasbeanReject); |
|
|
|
hasbeanWaitShow.value = hasMenuPermission(menuTree.value, permissionMapping.hasbeanWaitShow); |
|
|
|
hasbeanWaitThough.value = hasMenuPermission(menuTree.value, permissionMapping.hasbeanWaitThough); |
|
|
|
hasbeanWaitReject.value = hasMenuPermission(menuTree.value, permissionMapping.hasbeanWaitReject); |
|
|
|
hasbeanWait.value = hasMenuPermission(menuTree.value, permissionMapping.beanWait); |
|
|
|
hasbeanThrough.value = hasMenuPermission(menuTree.value, permissionMapping.beanThrough); |
|
|
|
hasbeanReject.value = hasMenuPermission(menuTree.value, permissionMapping.beanReject); |
|
|
|
hasbeanWaitShow.value = hasMenuPermission(menuTree.value, permissionMapping.beanWaitShow); |
|
|
|
hasbeanWaitThough.value = hasMenuPermission(menuTree.value, permissionMapping.beanWaitThough); |
|
|
|
hasbeanWaitReject.value = hasMenuPermission(menuTree.value, permissionMapping.beanWaitReject); |
|
|
|
}; |
|
|
|
const clicked = ref(false) |
|
|
|
// 状态常量 |
|
|
@ -212,7 +211,10 @@ const handleSearch = async function () { |
|
|
|
await getStats() |
|
|
|
} |
|
|
|
const get = async function () { |
|
|
|
if (findMenuById(menuTree.value, permissionMapping.View_Golden_Bean_Recharge_Audit)) { |
|
|
|
if (!hasbeanWaitShow) { |
|
|
|
ElMessage.error('暂无权限') |
|
|
|
return |
|
|
|
} |
|
|
|
try { |
|
|
|
if (dateRange.value && dateRange.value.length === 2) { |
|
|
|
if (checkTab.value === 'pending') { |
|
|
@ -226,10 +228,10 @@ const get = async function () { |
|
|
|
searchForm.value.createStartTime = '' |
|
|
|
searchForm.value.createEndTime = '' |
|
|
|
} |
|
|
|
if(checkTab.value === 'pending'){ |
|
|
|
if (checkTab.value === 'pending') { |
|
|
|
sortField.value = 'createTime' |
|
|
|
sortOrder.value = 'desc' |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
sortField.value = 'auditTime' |
|
|
|
sortOrder.value = 'desc' |
|
|
|
} |
|
|
@ -254,12 +256,12 @@ const get = async function () { |
|
|
|
} catch (error) { |
|
|
|
console.error('获取数据失败', error) |
|
|
|
} |
|
|
|
} else { |
|
|
|
ElMessage.error('无此权限') |
|
|
|
} |
|
|
|
} |
|
|
|
const getStats = async () => { |
|
|
|
if (findMenuById(menuTree.value, permissionMapping.View_Golden_Bean_Recharge_Audit)) { |
|
|
|
if (!hasbeanWaitShow) { |
|
|
|
ElMessage.error('暂无权限') |
|
|
|
return |
|
|
|
} |
|
|
|
try { |
|
|
|
const params = { |
|
|
|
jwcode: searchForm.value.jwcode, |
|
|
@ -283,14 +285,14 @@ const getStats = async () => { |
|
|
|
} catch (error) { |
|
|
|
console.log('请求失败', error) |
|
|
|
} |
|
|
|
} else { |
|
|
|
ElMessage.error('无此权限') |
|
|
|
} |
|
|
|
} |
|
|
|
// 处理通过操作 |
|
|
|
const handleApprove = async (row) => { |
|
|
|
if (!hasbeanWaitThough) { |
|
|
|
ElMessage.error('暂无权限') |
|
|
|
return |
|
|
|
} |
|
|
|
clicked.value = true |
|
|
|
if (findMenuById(menuTree.value, permissionMapping.Golden_Bean_Recharge_Approval)) { |
|
|
|
try { |
|
|
|
const params = { |
|
|
|
id: row.id, |
|
|
@ -305,15 +307,14 @@ const handleApprove = async (row) => { |
|
|
|
console.error('审核通过失败', error) |
|
|
|
ElMessage.error('操作失败') |
|
|
|
} |
|
|
|
} else { |
|
|
|
ElMessage.error('无此权限') |
|
|
|
clicked.value = false |
|
|
|
} |
|
|
|
} |
|
|
|
// 处理驳回操作 |
|
|
|
const handleReject = async () => { |
|
|
|
if (!hasbeanWaitReject) { |
|
|
|
ElMessage.error('暂无权限') |
|
|
|
return |
|
|
|
} |
|
|
|
cancelClicked.value = true |
|
|
|
if (findMenuById(menuTree.value, permissionMapping.Golden_Bean_Recharge_Approval)) { |
|
|
|
if (!reason.value.trim()) { |
|
|
|
ElMessage.warning('请输入驳回理由') |
|
|
|
return |
|
|
@ -334,10 +335,6 @@ const handleReject = async () => { |
|
|
|
console.error('驳回失败', error) |
|
|
|
ElMessage.error('操作失败') |
|
|
|
} |
|
|
|
} else { |
|
|
|
ElMessage.error('无此权限') |
|
|
|
cancelClicked.value = false |
|
|
|
} |
|
|
|
} |
|
|
|
const getToday = async function () { |
|
|
|
const today = dayjs() |
|
|
@ -390,10 +387,22 @@ const resetSearch = async function () { |
|
|
|
const handleClick = async function (tab) { |
|
|
|
checkTab.value = tab.props.name |
|
|
|
if (tab.props.name === 'pending') { |
|
|
|
if (!hasbeanWait) { |
|
|
|
ElMessage.error('暂无权限') |
|
|
|
return |
|
|
|
} |
|
|
|
adminWait() |
|
|
|
} else if (tab.props.name === 'pass') { |
|
|
|
if (!hasbeanThrough) { |
|
|
|
ElMessage.error('暂无权限') |
|
|
|
return |
|
|
|
} |
|
|
|
adminPass() |
|
|
|
} else if (tab.props.name === 'reject') { |
|
|
|
if (!hasbeanReject) { |
|
|
|
ElMessage.error('暂无权限') |
|
|
|
return |
|
|
|
} |
|
|
|
adminReject() |
|
|
|
} |
|
|
|
} |
|
|
@ -449,6 +458,10 @@ const throttledHandleApprove = _.throttle(handleApprove, 5000, { |
|
|
|
trailing: false |
|
|
|
}) |
|
|
|
const showRejectDialog = (row) => { |
|
|
|
if (!hasbeanWaitReject) { |
|
|
|
ElMessage.error('暂无权限') |
|
|
|
return |
|
|
|
} |
|
|
|
rejectRow.value.id = row.id |
|
|
|
reason.value = '' |
|
|
|
rejectVisible.value = true |
|
|
@ -487,6 +500,7 @@ const trimJwCode = () => { |
|
|
|
} |
|
|
|
} |
|
|
|
onMounted(async () => { |
|
|
|
initPermissions() |
|
|
|
getmarkets() |
|
|
|
await get() |
|
|
|
await getStats() |
|
|
|