Browse Source

Merge branch 'zhangrenyuan/feature-20250917134308-现金管理' into milestone-20250913-现金管理

zhangyong/milestone-20250913-现金管理
zhangrenyuan 2 months ago
parent
commit
2af88cf3ea
  1. 125
      src/components/dialogs/ConfirmDialog.vue
  2. 7
      src/views/audit/bean/beanAudit.vue
  3. 111
      src/views/audit/gold/rechargeAudit.vue
  4. 39
      src/views/home.vue
  5. 8
      src/views/permissions/rolePermission.vue

125
src/components/dialogs/ConfirmDialog.vue

@ -0,0 +1,125 @@
<template>
<el-dialog
v-model="visible"
:width="width"
:close-on-click-modal="false"
:style="{
backgroundImage: 'url(/src/assets/SvgIcons/背景.svg)',
backgroundSize: 'cover',
backgroundPosition: 'center',
height: '400px'
}"
@close="handleClose">
<div class="confirm-content">
将要{{ message }}
<br>
</div>
<template #footer>
<div class="dialog-footer-button">
<el-button round class="custom-large-button" @click="handleCancel">
取消
</el-button>
<el-button round class="custom-large-button" type="primary" @click="handleConfirm">
通过
</el-button>
</div>
</template>
</el-dialog>
</template>
<script setup>
import { ref, watch } from 'vue'
//
const props = defineProps({
//
modelValue: {
type: Boolean,
default: false
},
//
width: {
type: String,
default: '700px'
},
//
message: {
type: String,
default: '通过该记录!'
}
})
//
const emit = defineEmits(['update:modelValue', 'confirm', 'cancel', 'close'])
//
const visible = ref(false)
// modelValue
watch(() => props.modelValue, (newVal) => {
visible.value = newVal
})
// visible
watch(visible, (newVal) => {
emit('update:modelValue', newVal)
})
//
const handleConfirm = () => {
emit('confirm')
visible.value = false
}
//
const handleCancel = () => {
emit('cancel')
visible.value = false
}
//
const handleClose = () => {
emit('close')
visible.value = false
}
</script>
<style scoped>
.confirm-content {
text-align: center;
font-size: 40px;
font-weight: bold;
color: #333;
line-height: 1.5;
padding: 20px;
position: absolute;
top: 57%;
left: 53%;
transform: translate(-50%, -50%);
width: 100%;
}
.dialog-footer-button {
display: flex;
justify-content: center;
align-items: center;
display: flex;
justify-content: center;
font-size: 50px;
gap: 10px;
height: 60px;
margin-top: 20px;
position: absolute;
top: 70%;
left: 30%;
}
.custom-large-button {
font-size: 20px !important;
height: 40px !important;
min-width: 40px !important;
padding: 0 40px !important;
}
</style>

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

@ -89,15 +89,15 @@
prop="operation" label="操作" width="400px">
<template #default="scope">
<div class="operation">
<el-popconfirm title="确定要通过此条记录吗?" @confirm="handleApprove(scope.row)">
<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 }">
<el-button size="small">取消</el-button>
<template #actions="{ confirm, cancel }">
<el-button size="small" @click="cancel">取消</el-button>
<el-button type="primary" size="small" :disabled="clicked" @click="confirm">
确认
</el-button>
@ -160,6 +160,7 @@ const reason = ref('')
const rejectRow = ref({
id: null
})//
const popconfirmRef = ref(null)
//
const hasbeanWait = ref(false) // beanWait:42

111
src/views/audit/gold/rechargeAudit.vue

@ -145,20 +145,11 @@
<el-table-column v-if="activeName === 'wait'&&(hasrechargeWaitThough||hasrechargeWaitReject)&&hasrechargeWaitShow" 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="hasrechargeWaitThough"
:disabled="clicked || cancelClicked">
通过
</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="hasrechargeWaitThough"
:disabled="clicked || cancelClicked" type="primary"
@click="showApproveDialog(scope.row)">
通过
</el-link>
<el-link :underline="false" class="reject-btn" v-if="hasrechargeWaitReject"
:disabled="clicked || cancelClicked" type="primary"
@click="showRejectDialog(scope.row)">
@ -189,8 +180,19 @@
</span>
</template>
</el-dialog>
<!-- 新增使用ConfirmDialog组件 -->
<ConfirmDialog
v-model="approveDialogVisible"
message="通过该记录!"
@confirm="handleApproveConfirm"
@cancel="handleApproveCancel"
@close="handleApproveClose"
/>
</template>
<script setup>
import { onMounted, reactive, ref } from 'vue'
import { ElMessage } from 'element-plus'
@ -200,6 +202,8 @@ import moment from 'moment'
import { useAdminStore } from "@/store/index.js";
import { storeToRefs } from "pinia";
import ConfirmDialog from '@/components/dialogs/ConfirmDialog.vue'
const adminStore = useAdminStore();
const { adminData, menuTree } = storeToRefs(adminStore);
import { permissionMapping, hasMenuPermission } from "@/utils/menuTreePermission.js"
@ -246,6 +250,8 @@ const activity = ref([])
const market = ref("")
const rejectDialogVisible = ref(false)
const rejectReason = ref('')
const approveDialogVisible = ref(false)
//
const currentRecord = ref(null)
//
@ -575,32 +581,73 @@ const handlePagination = (type, val) => {
getStats()
}
const clicked = ref(false);
//
const handleApprove = async (row) => {
//
const showApproveDialog = (row) => {
if(!hasrechargeWaitThough){
ElMessage.error('暂无权限')
return
}
currentRecord.value = row
approveDialogVisible.value = true
}
// 使handleApproveConfirmhandleApprove
const handleApproveConfirm = async () => {
clicked.value = true
try {
const params = {
orderCode: row.orderCode,
auditId: adminData.value.id,
action: 1,
rejectReason: ''
}
await request({ url: '/audit/audit', data: params })
ElMessage.success('审核通过成功')
await getRecharge()
clicked.value = false
await getStats()
} catch (error) {
console.error('审核通过失败', error)
ElMessage.error('操作失败')
try {
const params = {
orderCode: currentRecord.value.orderCode,
auditId: adminData.value.id,
action: 1,
rejectReason: ''
}
await request({ url: '/audit/audit', data: params })
ElMessage.success('审核通过成功')
approveDialogVisible.value = false
await getRecharge()
clicked.value = false
await getStats()
} catch (error) {
console.error('审核通过失败', error)
ElMessage.error('操作失败')
clicked.value = false
}
}
//
const handleApproveCancel = () => {
approveDialogVisible.value = false
}
//
const handleApproveClose = () => {
approveDialogVisible.value = false
}
//
// const handleApprove = async (row) => {
// if(!hasrechargeWaitThough){
// ElMessage.error('')
// return
// }
// clicked.value = true
// try {
// const params = {
// orderCode: row.orderCode,
// auditId: adminData.value.id,
// action: 1,
// rejectReason: ''
// }
// await request({ url: '/audit/audit', data: params })
// ElMessage.success('')
// await getRecharge()
// clicked.value = false
// await getStats()
// } catch (error) {
// console.error('', error)
// ElMessage.error('')
// }
}
// }
const showRejectDialog = (row) => {
if(!hasrechargeWaitReject){
ElMessage.error('暂无权限')

39
src/views/home.vue

@ -11,6 +11,45 @@ import { filterMenu, getRoutePath } from "@/utils/menuUtils.js";
import SettingsIcon from '@/assets/blue.png';
// -----------------------------------
//
import API from '@/util/http.js' // HTTP
//
const refreshData = async () => {
try {
// durationshowclose×
ElMessage({ message: '数据刷新中,请稍候...', type: 'info' });
// Mysql
const response = await API({ url: '/Mysql', method: 'POST', data: {} });
if (response && response.code === 200) {
const currentRoute = route.fullPath;
router.replace('/blank'); //
setTimeout(() => {
router.replace(currentRoute); //
}, 10);
ElMessage.success('数据刷新成功');
} else {
ElMessage.error('数据刷新失败:' + (response?.msg || '未知错误'));
}
} catch (error) {
console.error('数据刷新异常:', error);
ElMessage.error('数据刷新异常,请重试');
}
}
// ---------------------------------------
//
const menuList = ref([])

8
src/views/permissions/rolePermission.vue

@ -600,7 +600,7 @@ onMounted(async function () {
</div>
<div>
<el-table :data="roleData" style="width: 82vw;height:62.3vh" show-overflow-tooltip
:row-style="{ height: '56px' }">
:row-style="{ height: '56px' }">
<el-table-column type="index" label="序号" width="100px" fixed="left">
<template #default="scope">
<span>{{
@ -676,7 +676,7 @@ onMounted(async function () {
<el-tree v-if="data.length > 0" :data="data" show-checkbox node-key="id"
:props="{ label: 'menuName', children: 'children' }" :checked-keys="addRole.checkedKeys"
:check-strictly="false" @check="handleCheckChange">
<template #default="{ node, data }">
<template #default="{ node }">
<span>{{ node.label }}</span>
</template>
</el-tree>
@ -718,7 +718,8 @@ onMounted(async function () {
:props="{ label: 'menuName', children: 'children' }"
:default-checked-keys="permissionEditRoleObj.checkedKeys" :check-strictly="false"
@check="handleEditRolePermissionCheck">
<template #default="{ node, data }">
<!-- <template #default="{ node, data }"> data删掉了不影响功能 -->
<template #default="{ node }">
<span>{{ node.label }}</span>
</template>
</el-tree>
@ -739,7 +740,6 @@ onMounted(async function () {
</template>
<style scoped lang="scss">
//
.add-item {
margin-bottom: 1vh;

Loading…
Cancel
Save