|
|
|
@ -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 |
|
|
|
} |
|
|
|
// 使用handleApproveConfirm函数代替handleApprove |
|
|
|
const handleApproveConfirm = async () => { |
|
|
|
clicked.value = true |
|
|
|
try { |
|
|
|
const params = { |
|
|
|
orderCode: row.orderCode, |
|
|
|
orderCode: currentRecord.value.orderCode, |
|
|
|
auditId: adminData.value.id, |
|
|
|
action: 1,// action的1是通过,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 |
|
|
|
|