|
|
@ -21,8 +21,8 @@ |
|
|
|
</div> |
|
|
|
<div class="selectRow"> |
|
|
|
<el-text class="text" size="large">所属地区:</el-text> |
|
|
|
<el-cascader class="selectContent" style="width: 12vw;" v-model="selectedMarketPath" :options="market" placeholder="请选择所属地区" |
|
|
|
clearable @change="handleMarketChange" /> |
|
|
|
<el-cascader class="selectContent" style="width: 12vw;" v-model="selectedMarketPath" :options="market" |
|
|
|
placeholder="请选择所属地区" clearable @change="handleMarketChange" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-col> |
|
|
@ -169,9 +169,8 @@ import API from '@/util/http.js' |
|
|
|
import moment from 'moment' |
|
|
|
import { useAdminStore } from "@/store/index.js"; |
|
|
|
import { storeToRefs } from "pinia"; |
|
|
|
import { findMenuById, permissionMapping } from "@/utils/menuTreePermission.js" |
|
|
|
import dayjs from "dayjs"; |
|
|
|
|
|
|
|
import { permissionMapping, hasMenuPermission } from "@/utils/menuTreePermission.js" |
|
|
|
const adminStore = useAdminStore(); |
|
|
|
const { adminData, menuTree } = storeToRefs(adminStore); |
|
|
|
const defaultTime = [ |
|
|
@ -232,6 +231,28 @@ const activeName = ref('wait') |
|
|
|
const sortField = ref('') |
|
|
|
const sortOrder = ref('') |
|
|
|
const market = ref("") |
|
|
|
|
|
|
|
//退款操作权限 |
|
|
|
const hasrefundThrough = ref(false) // 退款审核已通过 |
|
|
|
const hasrefundReject = ref(false) // 退款审核已驳回 |
|
|
|
const hasrefundWait = ref(false) // 退款审核待审核 |
|
|
|
const hasrefundWaitShow = ref(false) // 退款审核待审核查看 |
|
|
|
const hasrefundWaitThough = ref(false) // 退款审核通过 |
|
|
|
const hasrefundWaitReject = ref(false) // 退款审核驳回 |
|
|
|
|
|
|
|
// 初始化权限状态 |
|
|
|
const initPermissions = () => { |
|
|
|
if (!menuTree.value || !menuTree.value.length) return; |
|
|
|
// 退款相关权限 |
|
|
|
hasrefundThrough.value = hasMenuPermission(menuTree.value, permissionMapping.refundThrough); |
|
|
|
hasrefundReject.value = hasMenuPermission(menuTree.value, permissionMapping.refundReject); |
|
|
|
hasrefundWait.value = hasMenuPermission(menuTree.value, permissionMapping.refundWait); |
|
|
|
hasrefundWaitShow.value = hasMenuPermission(menuTree.value, permissionMapping.refundWaitShow); |
|
|
|
hasrefundWaitThough.value = hasMenuPermission(menuTree.value, permissionMapping.refundWaitThough); |
|
|
|
hasrefundWaitReject.value = hasMenuPermission(menuTree.value, permissionMapping.refundWaitReject); |
|
|
|
console.log('退款权限赋值完成'); |
|
|
|
|
|
|
|
}; |
|
|
|
// 处理排序事件 |
|
|
|
const handleSortChange = (column) => { |
|
|
|
if (column.prop === 'sumGold') { |
|
|
@ -256,6 +277,10 @@ const handleSortChange = (column) => { |
|
|
|
} |
|
|
|
// 显示驳回对话框 |
|
|
|
const showRejectDialog = (row) => { |
|
|
|
if (!hasrefundWaitReject) { |
|
|
|
ElMessage.error('暂无权限') |
|
|
|
return |
|
|
|
} |
|
|
|
scopeValue.value = row |
|
|
|
rejectReason.value = '' |
|
|
|
rejectDialogVisible.value = true |
|
|
@ -272,6 +297,10 @@ const getRefundGoods = async () => { |
|
|
|
|
|
|
|
// 搜索方法 |
|
|
|
const get = async function (val) { |
|
|
|
if (!hasrefundWaitShow) { |
|
|
|
ElMessage.error('暂无权限') |
|
|
|
return |
|
|
|
} |
|
|
|
try { |
|
|
|
if (typeof val === 'number') { |
|
|
|
pagination.value.pageNum = val |
|
|
@ -319,8 +348,11 @@ const get = async function (val) { |
|
|
|
const clicked = ref(false); |
|
|
|
// 通过 |
|
|
|
const handleApprove = async (row) => { |
|
|
|
if (!hasrefundWaitThough) { |
|
|
|
ElMessage.error('暂无权限') |
|
|
|
return |
|
|
|
} |
|
|
|
clicked.value = true |
|
|
|
if (findMenuById(menuTree.value, permissionMapping.Refund_Approval)) { |
|
|
|
try { |
|
|
|
const params = { |
|
|
|
orderCode: row.orderCode, |
|
|
@ -337,17 +369,17 @@ const handleApprove = async (row) => { |
|
|
|
console.error('审核通过失败', error) |
|
|
|
ElMessage.error('操作失败') |
|
|
|
} |
|
|
|
} else { |
|
|
|
ElMessage.warning('没有权限') |
|
|
|
clicked.value = false |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
//控制驳回确认按钮禁用状态 |
|
|
|
const cancelClicked = ref(false) |
|
|
|
// 处理驳回操作 |
|
|
|
const handleReject = async () => { |
|
|
|
if (!hasrefundWaitReject) { |
|
|
|
ElMessage.error('暂无权限') |
|
|
|
return |
|
|
|
} |
|
|
|
cancelClicked.value = true |
|
|
|
if (findMenuById(menuTree.value, permissionMapping.Refund_Approval)) { |
|
|
|
|
|
|
|
if (!rejectReason.value.trim()) { |
|
|
|
ElMessage.warning('请输入驳回理由') |
|
|
@ -371,13 +403,12 @@ const handleReject = async () => { |
|
|
|
console.error('驳回失败', error) |
|
|
|
ElMessage.error('操作失败') |
|
|
|
} |
|
|
|
} else { |
|
|
|
ElMessage.warning('没有权限') |
|
|
|
cancelClicked.value = false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const getStats = async () => { |
|
|
|
if (!hasrefundWaitShow) { |
|
|
|
return |
|
|
|
} |
|
|
|
try { |
|
|
|
const params = { |
|
|
|
pageNum: pagination.value.pageNum, |
|
|
@ -473,26 +504,27 @@ const get7Days = function () { |
|
|
|
const handleClick = function (tab, event) { |
|
|
|
activeName.value = tab.props.name |
|
|
|
if (tab.props.name === 'wait') { |
|
|
|
console.log(hasrefundWait.value); |
|
|
|
if (!hasrefundWait) { |
|
|
|
ElMessage.error('暂无权限') |
|
|
|
return |
|
|
|
} |
|
|
|
adminWait() |
|
|
|
} else if (tab.props.name === 'pass') { |
|
|
|
if (hasrefundThrough.value) { |
|
|
|
ElMessage.error('暂无权限') |
|
|
|
return |
|
|
|
} |
|
|
|
adminPass() |
|
|
|
} else if (tab.props.name === 'reject') { |
|
|
|
adminReject() |
|
|
|
if (!hasrefundReject) { |
|
|
|
ElMessage.error('暂无权限') |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
// 当前状态 |
|
|
|
const getCurrentStatus = () => { |
|
|
|
switch (activeName.value) { |
|
|
|
case 'wait': |
|
|
|
return STATUS.PENDING |
|
|
|
case 'pass': |
|
|
|
return STATUS.APPROVED |
|
|
|
case 'reject': |
|
|
|
return STATUS.REJECTED |
|
|
|
default: |
|
|
|
return '' |
|
|
|
adminReject() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 待审核 |
|
|
|
const adminWait = async function () { |
|
|
|
checkTab.value = 'pending' |
|
|
@ -584,6 +616,7 @@ onMounted(async () => { |
|
|
|
await getMarket() |
|
|
|
await get() |
|
|
|
await getStats() |
|
|
|
initPermissions() |
|
|
|
}) |
|
|
|
</script> |
|
|
|
|
|
|
|