diff --git a/src/views/home.vue b/src/views/home.vue index 67a6c1d..5de3201 100644 --- a/src/views/home.vue +++ b/src/views/home.vue @@ -291,7 +291,7 @@ const scrollToTop = () => scrollContainer.value?.scrollTo({top: 0, behavior: 'sm const getPathByQueryId = (queryId) => { const qid = Number(queryId) if (!Number.isFinite(qid)) return null - + // 获取所有路由 const matchedRoutes = router.getRoutes().filter(r => { const pid = r.meta?.permissionId if (Array.isArray(pid)) return pid.includes(qid) @@ -320,7 +320,21 @@ const handleMessageClick = async (item) => { if (res.code === 200) { closeMessageDialog() const targetPath = item?.queryId ? getPathByQueryId(item.queryId) : null - await router.push(targetPath || getOrderPage(item.status) || '/noPermission') + const messageStatus = Number(item?.status) + + // 1是代表收款处理的已通过,7是代表的收款处理(负责人)的已通过 + let tab = null + if (messageStatus === 1 && targetPath?.includes('/moneyManage/receiveDetail/receiveFinance')) { + tab = 'pass' + } else if (messageStatus === 7 && targetPath?.includes('/moneyManage/receiveDetail/receiveManager')) { + tab = 'pass' + } + + if (targetPath && tab) { + await router.push({ path: targetPath, query: { tab } }) + } else { + await router.push(targetPath || getOrderPage(item.status) || '/noPermission') + } await getMessage() ElMessage.success(t('elmessage.jumpSuccess')) } else { diff --git a/src/views/moneyManage/receiveDetail/receiveFinance.vue b/src/views/moneyManage/receiveDetail/receiveFinance.vue index fe97ffe..97c0933 100644 --- a/src/views/moneyManage/receiveDetail/receiveFinance.vue +++ b/src/views/moneyManage/receiveDetail/receiveFinance.vue @@ -658,6 +658,7 @@ import { editFormRule } from './utils/recriveFormRules.js'; import { productList, MarketNameForId, CurrencyForId, marketList, normalizeSubmitterMarket } from './utils/staticData.js'; import { useAdminStore } from '@/store/index.js'; import { hasMenuPermission } from '@/utils/menuTreePermission.js'; +import { useRoute } from 'vue-router'; // 国际化 import { useI18n } from 'vue-i18n' @@ -666,6 +667,7 @@ const { t } = useI18n() // ===================== 1. 核心状态管理(仅地区财务) ===================== const adminStore = useAdminStore(); const { menuTree } = storeToRefs(adminStore); +const route = useRoute(); // 角色固定:地区财务(caiwu=true,其他角色关闭) const kefu = ref(false); @@ -689,6 +691,15 @@ const getTime = ref([]); // 标签页:默认“待审核” const activeTab = ref('wait'); +const applyTabFromRoute = (tabRaw) => { + const tab = typeof tabRaw === 'string' ? tabRaw : null; + if (tab !== 'wait' && tab !== 'pass' && tab !== 'reject' && tab !== 'done') return false; + if (tab === activeTab.value) return false; + activeTab.value = tab; + pageInfo.value.pageNum = 1; + return true; +}; + // 审核弹窗状态 const auditFormisible = ref(false); const auditFormData = ref({}); @@ -1082,6 +1093,12 @@ const navigateTo = async (tab) => { await getlist(); }; +watch(() => route.query?.tab, async (tab) => { + if (applyTabFromRoute(tab)) { + await getlist(); + } +}); + // 2.4 审核功能 // 打开审核弹窗 const openAuditForm = (row) => { @@ -1361,6 +1378,7 @@ const throttledsubmitRefund = _.throttle(submitRefund, 5000, { onMounted(async () => { await getAdminData(); await getActivitys(); + applyTabFromRoute(route.query?.tab); // 初始化加载地区财务订单数据 await getlist(); diff --git a/src/views/moneyManage/receiveDetail/receiveManage.vue b/src/views/moneyManage/receiveDetail/receiveManage.vue index fe97ffe..77e16df 100644 --- a/src/views/moneyManage/receiveDetail/receiveManage.vue +++ b/src/views/moneyManage/receiveDetail/receiveManage.vue @@ -658,6 +658,7 @@ import { editFormRule } from './utils/recriveFormRules.js'; import { productList, MarketNameForId, CurrencyForId, marketList, normalizeSubmitterMarket } from './utils/staticData.js'; import { useAdminStore } from '@/store/index.js'; import { hasMenuPermission } from '@/utils/menuTreePermission.js'; +import { useRoute } from 'vue-router'; // 国际化 import { useI18n } from 'vue-i18n' @@ -666,6 +667,7 @@ const { t } = useI18n() // ===================== 1. 核心状态管理(仅地区财务) ===================== const adminStore = useAdminStore(); const { menuTree } = storeToRefs(adminStore); +const route = useRoute(); // 角色固定:地区财务(caiwu=true,其他角色关闭) const kefu = ref(false); @@ -689,6 +691,15 @@ const getTime = ref([]); // 标签页:默认“待审核” const activeTab = ref('wait'); +const applyTabFromRoute = (tabRaw) => { + const tab = typeof tabRaw === 'string' ? tabRaw : null; + if (tab !== 'wait' && tab !== 'pass' && tab !== 'reject' && tab !== 'done') return false; + if (tab === activeTab.value) return false; + activeTab.value = tab; + pageInfo.value.pageNum = 1; + return true; +}; + // 审核弹窗状态 const auditFormisible = ref(false); const auditFormData = ref({}); @@ -1079,9 +1090,16 @@ const reset = () => { // 2.3 标签页切换 const navigateTo = async (tab) => { activeTab.value = tab; + pageInfo.value.pageNum = 1; await getlist(); }; +watch(() => route.query?.tab, async (tab) => { + if (applyTabFromRoute(tab)) { + await getlist(); + } +}); + // 2.4 审核功能 // 打开审核弹窗 const openAuditForm = (row) => { @@ -1361,6 +1379,7 @@ const throttledsubmitRefund = _.throttle(submitRefund, 5000, { onMounted(async () => { await getAdminData(); await getActivitys(); + applyTabFromRoute(route.query?.tab); // 初始化加载地区财务订单数据 await getlist();