|
@ -21,8 +21,8 @@ |
|
|
</div> |
|
|
</div> |
|
|
<div class="selectRow"> |
|
|
<div class="selectRow"> |
|
|
<el-text class="text" size="large">所属地区:</el-text> |
|
|
<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> |
|
|
</div> |
|
|
</div> |
|
|
</el-col> |
|
|
</el-col> |
|
@ -51,9 +51,9 @@ |
|
|
|
|
|
|
|
|
<el-card > |
|
|
<el-card > |
|
|
<el-tabs v-model="activeName" type="card" @tab-click="handleClick"> |
|
|
<el-tabs v-model="activeName" type="card" @tab-click="handleClick"> |
|
|
<el-tab-pane label="待审核" name="wait"></el-tab-pane> |
|
|
|
|
|
<el-tab-pane label="已通过" name="pass"></el-tab-pane> |
|
|
|
|
|
<el-tab-pane label="已驳回" name="reject"></el-tab-pane> |
|
|
|
|
|
|
|
|
<el-tab-pane label="待审核" name="wait" v-if="hasrefundWait&&hasrefundWaitShow"></el-tab-pane> |
|
|
|
|
|
<el-tab-pane label="已通过" name="pass" v-if="hasrefundThrough"></el-tab-pane> |
|
|
|
|
|
<el-tab-pane label="已驳回" name="reject" v-if="hasrefundReject"></el-tab-pane> |
|
|
</el-tabs> |
|
|
</el-tabs> |
|
|
|
|
|
|
|
|
<div> |
|
|
<div> |
|
@ -118,12 +118,13 @@ |
|
|
{{ 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'" 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)"> |
|
|
<el-popconfirm title="确定要通过此条记录吗?" @confirm="handleApprove(scope.row)"> |
|
|
<template #reference> |
|
|
<template #reference> |
|
|
<el-button :disabled="clicked || cancelClicked" type="primary" text> |
|
|
|
|
|
|
|
|
<el-button v-if="hasrefundWaitThough" :disabled="clicked || cancelClicked" type="primary" text> |
|
|
通过 |
|
|
通过 |
|
|
</el-button> |
|
|
</el-button> |
|
|
</template> |
|
|
</template> |
|
@ -134,7 +135,8 @@ |
|
|
</el-button> |
|
|
</el-button> |
|
|
</template> |
|
|
</template> |
|
|
</el-popconfirm> |
|
|
</el-popconfirm> |
|
|
<el-button :disabled="clicked || cancelClicked" type="primary" text @click="showRejectDialog(scope.row)"> |
|
|
|
|
|
|
|
|
<el-button v-if="hasrefundWaitReject" :disabled="clicked || cancelClicked" type="primary" text |
|
|
|
|
|
@click="showRejectDialog(scope.row)"> |
|
|
驳回 |
|
|
驳回 |
|
|
</el-button> |
|
|
</el-button> |
|
|
</div> |
|
|
</div> |
|
@ -169,9 +171,8 @@ import API from '@/util/http.js' |
|
|
import moment from 'moment' |
|
|
import moment from 'moment' |
|
|
import { useAdminStore } from "@/store/index.js"; |
|
|
import { useAdminStore } from "@/store/index.js"; |
|
|
import { storeToRefs } from "pinia"; |
|
|
import { storeToRefs } from "pinia"; |
|
|
import { findMenuById, permissionMapping } from "@/utils/menuTreePermission.js" |
|
|
|
|
|
import dayjs from "dayjs"; |
|
|
import dayjs from "dayjs"; |
|
|
|
|
|
|
|
|
|
|
|
import { permissionMapping, hasMenuPermission } from "@/utils/menuTreePermission.js" |
|
|
const adminStore = useAdminStore(); |
|
|
const adminStore = useAdminStore(); |
|
|
const { adminData, menuTree } = storeToRefs(adminStore); |
|
|
const { adminData, menuTree } = storeToRefs(adminStore); |
|
|
const defaultTime = [ |
|
|
const defaultTime = [ |
|
@ -232,6 +233,28 @@ const activeName = ref('wait') |
|
|
const sortField = ref('') |
|
|
const sortField = ref('') |
|
|
const sortOrder = ref('') |
|
|
const sortOrder = ref('') |
|
|
const market = 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 = async() => { |
|
|
|
|
|
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) => { |
|
|
const handleSortChange = (column) => { |
|
|
if (column.prop === 'sumGold') { |
|
|
if (column.prop === 'sumGold') { |
|
@ -256,6 +279,10 @@ const handleSortChange = (column) => { |
|
|
} |
|
|
} |
|
|
// 显示驳回对话框 |
|
|
// 显示驳回对话框 |
|
|
const showRejectDialog = (row) => { |
|
|
const showRejectDialog = (row) => { |
|
|
|
|
|
if (!hasrefundWaitReject) { |
|
|
|
|
|
ElMessage.error('暂无权限') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
scopeValue.value = row |
|
|
scopeValue.value = row |
|
|
rejectReason.value = '' |
|
|
rejectReason.value = '' |
|
|
rejectDialogVisible.value = true |
|
|
rejectDialogVisible.value = true |
|
@ -272,6 +299,10 @@ const getRefundGoods = async () => { |
|
|
|
|
|
|
|
|
// 搜索方法 |
|
|
// 搜索方法 |
|
|
const get = async function (val) { |
|
|
const get = async function (val) { |
|
|
|
|
|
if (!hasrefundWaitShow) { |
|
|
|
|
|
ElMessage.error('暂无权限') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
try { |
|
|
try { |
|
|
if (typeof val === 'number') { |
|
|
if (typeof val === 'number') { |
|
|
pagination.value.pageNum = val |
|
|
pagination.value.pageNum = val |
|
@ -319,8 +350,11 @@ const get = async function (val) { |
|
|
const clicked = ref(false); |
|
|
const clicked = ref(false); |
|
|
// 通过 |
|
|
// 通过 |
|
|
const handleApprove = async (row) => { |
|
|
const handleApprove = async (row) => { |
|
|
|
|
|
if (!hasrefundWaitThough) { |
|
|
|
|
|
ElMessage.error('暂无权限') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
clicked.value = true |
|
|
clicked.value = true |
|
|
if (findMenuById(menuTree.value, permissionMapping.Refund_Approval)) { |
|
|
|
|
|
try { |
|
|
try { |
|
|
const params = { |
|
|
const params = { |
|
|
orderCode: row.orderCode, |
|
|
orderCode: row.orderCode, |
|
@ -337,17 +371,17 @@ const handleApprove = async (row) => { |
|
|
console.error('审核通过失败', error) |
|
|
console.error('审核通过失败', error) |
|
|
ElMessage.error('操作失败') |
|
|
ElMessage.error('操作失败') |
|
|
} |
|
|
} |
|
|
} else { |
|
|
|
|
|
ElMessage.warning('没有权限') |
|
|
|
|
|
clicked.value = false |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
//控制驳回确认按钮禁用状态 |
|
|
//控制驳回确认按钮禁用状态 |
|
|
const cancelClicked = ref(false) |
|
|
const cancelClicked = ref(false) |
|
|
// 处理驳回操作 |
|
|
// 处理驳回操作 |
|
|
const handleReject = async () => { |
|
|
const handleReject = async () => { |
|
|
|
|
|
if (!hasrefundWaitReject) { |
|
|
|
|
|
ElMessage.error('暂无权限') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
cancelClicked.value = true |
|
|
cancelClicked.value = true |
|
|
if (findMenuById(menuTree.value, permissionMapping.Refund_Approval)) { |
|
|
|
|
|
|
|
|
|
|
|
if (!rejectReason.value.trim()) { |
|
|
if (!rejectReason.value.trim()) { |
|
|
ElMessage.warning('请输入驳回理由') |
|
|
ElMessage.warning('请输入驳回理由') |
|
@ -371,13 +405,12 @@ const handleReject = async () => { |
|
|
console.error('驳回失败', error) |
|
|
console.error('驳回失败', error) |
|
|
ElMessage.error('操作失败') |
|
|
ElMessage.error('操作失败') |
|
|
} |
|
|
} |
|
|
} else { |
|
|
|
|
|
ElMessage.warning('没有权限') |
|
|
|
|
|
cancelClicked.value = false |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const getStats = async () => { |
|
|
const getStats = async () => { |
|
|
|
|
|
if (!hasrefundWaitShow) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
try { |
|
|
try { |
|
|
const params = { |
|
|
const params = { |
|
|
pageNum: pagination.value.pageNum, |
|
|
pageNum: pagination.value.pageNum, |
|
@ -473,26 +506,27 @@ const get7Days = function () { |
|
|
const handleClick = function (tab, event) { |
|
|
const handleClick = function (tab, event) { |
|
|
activeName.value = tab.props.name |
|
|
activeName.value = tab.props.name |
|
|
if (tab.props.name === 'wait') { |
|
|
if (tab.props.name === 'wait') { |
|
|
|
|
|
console.log(hasrefundWait.value); |
|
|
|
|
|
if (!hasrefundWait) { |
|
|
|
|
|
ElMessage.error('暂无权限') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
adminWait() |
|
|
adminWait() |
|
|
} else if (tab.props.name === 'pass') { |
|
|
} else if (tab.props.name === 'pass') { |
|
|
|
|
|
if (!hasrefundThrough.value) { |
|
|
|
|
|
ElMessage.error('暂无权限') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
adminPass() |
|
|
adminPass() |
|
|
} else if (tab.props.name === 'reject') { |
|
|
} 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 () { |
|
|
const adminWait = async function () { |
|
|
checkTab.value = 'pending' |
|
|
checkTab.value = 'pending' |
|
@ -580,6 +614,14 @@ const handleCurrentChange = function (val) { |
|
|
get() |
|
|
get() |
|
|
} |
|
|
} |
|
|
onMounted(async () => { |
|
|
onMounted(async () => { |
|
|
|
|
|
await initPermissions() |
|
|
|
|
|
if(hasrefundWaitShow.value){ |
|
|
|
|
|
searchForm.value.auditStatus = '0' |
|
|
|
|
|
}else if(hasrefundThrough.value){ |
|
|
|
|
|
searchForm.value.auditStatus = '1' |
|
|
|
|
|
}else if(hasrefundReject){ |
|
|
|
|
|
searchForm.value.auditStatus = '2' |
|
|
|
|
|
} |
|
|
getRefundGoods() |
|
|
getRefundGoods() |
|
|
await getMarket() |
|
|
await getMarket() |
|
|
await get() |
|
|
await get() |
|
|