Browse Source

style: 金币充值、退款审核金豆审核的《通过》对话框已更新完毕,todo驳回

zhangyong/milestone-20250913-现金管理
zhangrenyuan 1 month ago
parent
commit
2ba13b5c12
  1. 6
      src/components/dialogs/ConfirmDialog.vue
  2. 61
      src/views/audit/bean/beanAudit.vue
  3. 82
      src/views/audit/gold/refundAudit.vue

6
src/components/dialogs/ConfirmDialog.vue

@ -87,6 +87,8 @@ const handleClose = () => {
</script> </script>
<style scoped> <style scoped>
/* 将要**的样式 */
.confirm-content { .confirm-content {
text-align: center; text-align: center;
font-size: 40px; font-size: 40px;
@ -100,7 +102,7 @@ const handleClose = () => {
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
width: 100%; width: 100%;
} }
/* 确认取消按钮组样式 */
.dialog-footer-button { .dialog-footer-button {
display: flex; display: flex;
justify-content: center; justify-content: center;
@ -115,7 +117,7 @@ const handleClose = () => {
top: 70%; top: 70%;
left: 30%; left: 30%;
} }
/* 确认取消按钮样式 */
.custom-large-button { .custom-large-button {
font-size: 20px !important; font-size: 20px !important;
height: 40px !important; height: 40px !important;

61
src/views/audit/bean/beanAudit.vue

@ -59,8 +59,7 @@
免费金豆{{ format3(stats.freeBean) }}金豆 免费金豆{{ format3(stats.freeBean) }}金豆
</div> </div>
<el-table :data="tableData" height="55vh" @sort-change="handleSortChange"
:row-style="{ height: '50px' }">
<el-table :data="tableData" height="55vh" @sort-change="handleSortChange" :row-style="{ height: '50px' }">
<el-table-column type="index" label="序号" width="80"> <el-table-column type="index" label="序号" width="80">
<template #default="scope"> <template #default="scope">
{{ scope.$index + 1 + (pagination.pageNum - 1) * pagination.pageSize }} {{ scope.$index + 1 + (pagination.pageNum - 1) * pagination.pageSize }}
@ -89,20 +88,11 @@
prop="operation" label="操作" width="400px"> prop="operation" label="操作" width="400px">
<template #default="scope"> <template #default="scope">
<div class="operation"> <div class="operation">
<el-popconfirm title="确定要通过此条记录吗?" @confirm="handleApprove(scope.row)">
<template #reference>
<el-link :underline="false" class="pass-btn" v-if="hasbeanWaitThough"
:disabled="clicked || cancelClicked" type="primary">
通过
</el-link>
</template>
<template #actions="{ confirm, cancel }">
<el-button size="small" @click="cancel">取消</el-button>
<el-button type="primary" size="small" :disabled="clicked" @click="confirm">
确认
</el-button>
</template>
</el-popconfirm>
<el-link :underline="false" class="pass-btn" v-if="hasbeanWaitThough" :disabled="clicked || cancelClicked"
type="primary" @click="showApproveDialog(scope.row)">
通过
</el-link>
<el-link :underline="false" class="reject-btn" v-if="hasbeanWaitReject" :disabled="clicked || cancelClicked" <el-link :underline="false" class="reject-btn" v-if="hasbeanWaitReject" :disabled="clicked || cancelClicked"
type="primary" @click="showRejectDialog(scope.row)"> type="primary" @click="showRejectDialog(scope.row)">
驳回 驳回
@ -129,6 +119,16 @@
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
<ConfirmDialog
v-model="approveDialogVisible"
message="通过该记录!"
@confirm="handleApproveConfirm"
@cancel="handleApproveCancel"
@close="handleApproveClose"
/>
</template> </template>
<script setup> <script setup>
import { onMounted, ref } from 'vue' import { onMounted, ref } from 'vue'
@ -139,6 +139,7 @@ import { useAdminStore } from "@/store/index.js";
import { storeToRefs } from "pinia"; import { storeToRefs } from "pinia";
import _ from 'lodash' import _ from 'lodash'
import { permissionMapping, hasMenuPermission } from "@/utils/menuTreePermission.js" import { permissionMapping, hasMenuPermission } from "@/utils/menuTreePermission.js"
import ConfirmDialog from '@/components/dialogs/ConfirmDialog.vue';
const defaultTime = [ const defaultTime = [
new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 0, 0, 0),
@ -180,6 +181,9 @@ const initPermissions = async () => {
hasbeanWaitThough.value = hasMenuPermission(menuTree.value, permissionMapping.beanWaitThough); hasbeanWaitThough.value = hasMenuPermission(menuTree.value, permissionMapping.beanWaitThough);
hasbeanWaitReject.value = hasMenuPermission(menuTree.value, permissionMapping.beanWaitReject); hasbeanWaitReject.value = hasMenuPermission(menuTree.value, permissionMapping.beanWaitReject);
}; };
//
const approveDialogVisible = ref(false)
const clicked = ref(false) const clicked = ref(false)
// //
const STATUS = { const STATUS = {
@ -315,8 +319,19 @@ const getStats = async () => {
console.log('请求失败', error) console.log('请求失败', error)
} }
} }
//
const showApproveDialog = (row) => {
if (!hasbeanWaitThough) {
ElMessage.error('暂无权限')
return
}
approveDialogVisible.value = true
}
// //
const handleApprove = async (row) => {
// 使handleApproveConfirm使handleApprove
// handleApprove
const handleApproveConfirm = async (row) => {
if (!hasbeanWaitThough) { if (!hasbeanWaitThough) {
ElMessage.error('暂无权限') ElMessage.error('暂无权限')
return return
@ -329,6 +344,7 @@ const handleApprove = async (row) => {
} }
await API({ url: '/beanAudit/status1', data: params }) await API({ url: '/beanAudit/status1', data: params })
ElMessage.success('审核通过成功') ElMessage.success('审核通过成功')
approveDialogVisible.value = false
await get() await get()
clicked.value = false clicked.value = false
await getStats() await getStats()
@ -337,6 +353,14 @@ const handleApprove = async (row) => {
ElMessage.error('操作失败') ElMessage.error('操作失败')
} }
} }
//
const handleApproveCancel = () => {
approveDialogVisible.value = false
}
//
const handleApproveClose = () => {
approveDialogVisible.value = false
}
// //
const handleReject = async () => { const handleReject = async () => {
if (!hasbeanWaitReject) { if (!hasbeanWaitReject) {
@ -483,7 +507,8 @@ const format3 = (num) => {
// //
return num.toLocaleString('en-US') return num.toLocaleString('en-US')
} }
const throttledHandleApprove = _.throttle(handleApprove, 5000, {
// handleApproveConfirm
const throttledHandleApprove = _.throttle(handleApproveConfirm, 5000, {
trailing: false trailing: false
}) })
const showRejectDialog = (row) => { const showRejectDialog = (row) => {

82
src/views/audit/gold/refundAudit.vue

@ -70,7 +70,7 @@
format3((stats.permanentGolds + stats.freeGolds + stats.taskGolds).toFixed(2)) format3((stats.permanentGolds + stats.freeGolds + stats.taskGolds).toFixed(2))
}}金币&nbsp;&nbsp;&nbsp;&nbsp; }}金币&nbsp;&nbsp;&nbsp;&nbsp;
永久金币{{ format3(stats.permanentGolds.toFixed(2)) }}金币&nbsp;&nbsp;&nbsp;&nbsp; 永久金币{{ format3(stats.permanentGolds.toFixed(2)) }}金币&nbsp;&nbsp;&nbsp;&nbsp;
免费金币{{ format3(stats.freeGolds.toFixed(2)) }}金币&nbsp;&nbsp;&nbsp;&nbsp;
免费金币{{ format3(stats.freeGolds.toFixed(2)) }}金币&nbsp;&nbsp;&nbsp;&nbsp;
任务金币{{ format3(stats.taskGolds.toFixed(2)) }}金币 任务金币{{ format3(stats.taskGolds.toFixed(2)) }}金币
</div> </div>
@ -82,7 +82,7 @@
<el-table-column prop="market" label="所属地区" width="120" /> <el-table-column prop="market" label="所属地区" width="120" />
<el-table-column prop="orderCode" label="订单号" width="260px" show-overflow-tooltip /> <el-table-column prop="orderCode" label="订单号" width="260px" show-overflow-tooltip />
<el-table-column prop="refundType" label="退款类型" width="120" />
<el-table-column prop="refundType" label="退款类型" width="120" />
<el-table-column prop="refundModel" label="退款方式" width="120"> <el-table-column prop="refundModel" label="退款方式" width="120">
<template #default="{ row }"> <template #default="{ row }">
{{ row.refundModel === 0 ? '全部退款' : '部分退款' }} {{ row.refundModel === 0 ? '全部退款' : '部分退款' }}
@ -129,26 +129,19 @@
{{ row.auditTime ? moment(row.auditTime).format('YYYY-MM-DD HH:mm:ss') : '--' }} {{ row.auditTime ? moment(row.auditTime).format('YYYY-MM-DD HH:mm:ss') : '--' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="checkTab === 'pending' && (hasrefundWaitThough || hasrefundWaitReject) && hasrefundWaitShow"
fixed="right" prop="operation" label="操作" width="150px">
<el-table-column
v-if="checkTab === 'pending' && (hasrefundWaitThough || hasrefundWaitReject) && hasrefundWaitShow" fixed="right"
prop="operation" label="操作" width="150px">
<template #default="scope"> <template #default="scope">
<div class="operation"> <div class="operation">
<el-popconfirm title="确定要通过此条记录吗?" @confirm="handleApprove(scope.row)">
<template #reference>
<el-link :underline="false" class="pass-btn" v-if="hasrefundWaitThough"
:disabled="clicked || cancelClicked" type="primary">
通过
</el-link>
</template>
<template #actions="{ confirm, cancel }">
<el-button size="small" @click="cancel">取消</el-button>
<el-button type="primary" size="small" :disabled="clicked" @click="confirm">
确认
</el-button>
</template>
</el-popconfirm>
<el-link :underline="false" class="reject-btn" v-if="hasrefundWaitReject"
:disabled="clicked || cancelClicked" type="primary" @click="showRejectDialog(scope.row)">
<el-link :underline="false" class="pass-btn" v-if="hasrefundWaitThough"
:disabled="clicked || cancelClicked"type="primary"
@click="showApproveDialog(scope.row)">
通过
</el-link>
<el-link :underline="false" class="reject-btn" v-if="hasrefundWaitReject"
:disabled="clicked || cancelClicked" type="primary"
@click="showRejectDialog(scope.row)">
驳回 驳回
</el-link> </el-link>
</div> </div>
@ -174,6 +167,16 @@
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
<!-- 新增使用ConfirmDialog组件 -->
<ConfirmDialog
v-model="approveDialogVisible"
message="通过该记录!"
@confirm="handleApproveConfirm"
@cancel="handleApproveCancel"
@close="handleApproveClose"
/>
</template> </template>
<script setup> <script setup>
@ -185,6 +188,7 @@ import { useAdminStore } from "@/store/index.js";
import { storeToRefs } from "pinia"; import { storeToRefs } from "pinia";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { permissionMapping, hasMenuPermission } from "@/utils/menuTreePermission.js" import { permissionMapping, hasMenuPermission } from "@/utils/menuTreePermission.js"
import ConfirmDialog from '@/components/dialogs/ConfirmDialog.vue';
const adminStore = useAdminStore(); const adminStore = useAdminStore();
const { adminData, menuTree } = storeToRefs(adminStore); const { adminData, menuTree } = storeToRefs(adminStore);
@ -194,9 +198,11 @@ const defaultTime = [
] ]
// //
const activeTimeRange = ref('') const activeTimeRange = ref('')
const scopeValue = ref(null) //
const currentRecord = ref(null) //
const rejectDialogVisible = ref(false) const rejectDialogVisible = ref(false)
const rejectReason = ref('') const rejectReason = ref('')
const approveDialogVisible = ref(false)
// //
const STATUS = { const STATUS = {
PENDING: 0, // PENDING: 0, //
@ -296,7 +302,7 @@ const showRejectDialog = (row) => {
ElMessage.error('暂无权限') ElMessage.error('暂无权限')
return return
} }
scopeValue.value = row
currentRecord.value = row
rejectReason.value = '' rejectReason.value = ''
rejectDialogVisible.value = true rejectDialogVisible.value = true
} }
@ -361,22 +367,28 @@ const get = async function (val) {
} }
} }
const clicked = ref(false); const clicked = ref(false);
//
const handleApprove = async (row) => {
if (!hasrefundWaitThough) {
ElMessage.error('暂无权限')
return
}
//
const showApproveDialog = (row) => {
if(!hasrefundWaitThough){
ElMessage.error('暂无权限')
return
}
currentRecord.value = row
approveDialogVisible.value = true
}
// 使handleApproveConfirmhandleApprove
const handleApproveConfirm = async () => {
clicked.value = true clicked.value = true
try { try {
const params = { const params = {
orderCode: row.orderCode,
orderCode: currentRecord.value.orderCode,
auditId: adminData.value.id, auditId: adminData.value.id,
action: 1,// action1,2 action: 1,// action1,2
rejectReason: '' rejectReason: ''
} }
await API({ url: '/audit/audit', data: params }) await API({ url: '/audit/audit', data: params })
ElMessage.success('审核通过成功') ElMessage.success('审核通过成功')
approveDialogVisible.value = false
await get() await get()
clicked.value = false clicked.value = false
await getStats() await getStats()
@ -384,8 +396,16 @@ const handleApprove = async (row) => {
console.error('审核通过失败', error) console.error('审核通过失败', error)
ElMessage.error('操作失败') ElMessage.error('操作失败')
} }
} }
//
const handleApproveCancel = () => {
approveDialogVisible.value = false
}
//
const handleApproveClose = () => {
approveDialogVisible.value = false
}
// //
const cancelClicked = ref(false) const cancelClicked = ref(false)
// //
@ -402,7 +422,7 @@ const handleReject = async () => {
} }
try { try {
const params = { const params = {
orderCode: scopeValue.value.orderCode,
orderCode: currentRecord.value.orderCode,
auditId: adminData.value.id, auditId: adminData.value.id,
action: 2, action: 2,
rejectReason: rejectReason.value rejectReason: rejectReason.value

Loading…
Cancel
Save