Browse Source

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

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

6
src/components/dialogs/ConfirmDialog.vue

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

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

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

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

@ -129,26 +129,19 @@
{{ row.auditTime ? moment(row.auditTime).format('YYYY-MM-DD HH:mm:ss') : '--' }}
</template>
</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">
<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">
:disabled="clicked || cancelClicked"type="primary"
@click="showApproveDialog(scope.row)">
通过
</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)">
:disabled="clicked || cancelClicked" type="primary"
@click="showRejectDialog(scope.row)">
驳回
</el-link>
</div>
@ -174,6 +167,16 @@
</span>
</template>
</el-dialog>
<!-- 新增使用ConfirmDialog组件 -->
<ConfirmDialog
v-model="approveDialogVisible"
message="通过该记录!"
@confirm="handleApproveConfirm"
@cancel="handleApproveCancel"
@close="handleApproveClose"
/>
</template>
<script setup>
@ -185,6 +188,7 @@ import { useAdminStore } from "@/store/index.js";
import { storeToRefs } from "pinia";
import dayjs from "dayjs";
import { permissionMapping, hasMenuPermission } from "@/utils/menuTreePermission.js"
import ConfirmDialog from '@/components/dialogs/ConfirmDialog.vue';
const adminStore = useAdminStore();
const { adminData, menuTree } = storeToRefs(adminStore);
@ -194,9 +198,11 @@ const defaultTime = [
]
//
const activeTimeRange = ref('')
const scopeValue = ref(null) //
const currentRecord = ref(null) //
const rejectDialogVisible = ref(false)
const rejectReason = ref('')
const approveDialogVisible = ref(false)
//
const STATUS = {
PENDING: 0, //
@ -296,7 +302,7 @@ const showRejectDialog = (row) => {
ElMessage.error('暂无权限')
return
}
scopeValue.value = row
currentRecord.value = row
rejectReason.value = ''
rejectDialogVisible.value = true
}
@ -361,22 +367,28 @@ const get = async function (val) {
}
}
const clicked = ref(false);
//
const handleApprove = async (row) => {
//
const showApproveDialog = (row) => {
if(!hasrefundWaitThough){
ElMessage.error('暂无权限')
return
}
currentRecord.value = row
approveDialogVisible.value = true
}
// 使handleApproveConfirmhandleApprove
const handleApproveConfirm = async () => {
clicked.value = true
try {
const params = {
orderCode: row.orderCode,
orderCode: currentRecord.value.orderCode,
auditId: adminData.value.id,
action: 1,// action1,2
rejectReason: ''
}
await API({ url: '/audit/audit', data: params })
ElMessage.success('审核通过成功')
approveDialogVisible.value = false
await get()
clicked.value = false
await getStats()
@ -384,8 +396,16 @@ const handleApprove = async (row) => {
console.error('审核通过失败', error)
ElMessage.error('操作失败')
}
}
//
const handleApproveCancel = () => {
approveDialogVisible.value = false
}
//
const handleApproveClose = () => {
approveDialogVisible.value = false
}
//
const cancelClicked = ref(false)
//
@ -402,7 +422,7 @@ const handleReject = async () => {
}
try {
const params = {
orderCode: scopeValue.value.orderCode,
orderCode: currentRecord.value.orderCode,
auditId: adminData.value.id,
action: 2,
rejectReason: rejectReason.value

Loading…
Cancel
Save