feat: 审计链路
Some checks failed
构建并部署前端到测试环境 / build-and-deploy (push) Failing after 59s

This commit is contained in:
luo
2026-08-07 18:33:37 +08:00
parent fa3d7088f9
commit b8b2854aa6
54 changed files with 5448 additions and 12 deletions

View File

@@ -35,7 +35,7 @@
:total="pagination.total"
:marginTop="10"
:actions="getActions"
:actionsWidth="120"
:actionsWidth="160"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
>
@@ -438,10 +438,15 @@
getProcessingStatusText
} from '@/utils/business/approvalSummary'
import { RoutesAlias } from '@/router/routesAlias'
import { useUserStore } from '@/store/modules/user'
import { AUDIT_PERMISSIONS } from '@/config/constants/audit'
import { resolveAuditResourceTarget } from '@/utils/business/auditNavigation'
import { openAuditInvestigation } from '@/components/business/audit/investigationController'
defineOptions({ name: 'ExchangeManagement' })
const { hasAuth } = useAuth()
const userStore = useUserStore()
const router = useRouter()
const currentExchangeRow = ref<ExchangeResponse | null>(null)
@@ -1548,6 +1553,45 @@
const actions: any[] = []
const status = row.status
const flowType = row.flow_type || 'shipping' // 历史数据兼容
const userType = Number(userStore.info.user_type)
const entryPermission =
userType === 3 ? AUDIT_PERMISSIONS.agentActivity : AUDIT_PERMISSIONS.resourceTimeline
if (userType !== 4 && hasAuth(entryPermission)) {
const exchangeTarget = resolveAuditResourceTarget({
userType,
resourceType: 'exchange_order',
internalId: row.id,
businessIdentifier: row.exchange_no
})
if (exchangeTarget)
actions.push({
label: userType === 3 ? '活动记录' : '换货审计',
handler: () => openAuditInvestigation(exchangeTarget),
type: 'primary'
})
if ([1, 2].includes(userType)) {
const oldAssetTarget = resolveAuditResourceTarget({
resourceType: row.old_asset_type,
internalId: row.old_asset_id
})
if (oldAssetTarget)
actions.push({
label: '旧资产审计',
handler: () => openAuditInvestigation(oldAssetTarget),
type: 'primary'
})
const newAssetTarget = resolveAuditResourceTarget({
resourceType: row.new_asset_type || '',
internalId: row.new_asset_id
})
if (newAssetTarget)
actions.push({
label: '新资产审计',
handler: () => openAuditInvestigation(newAssetTarget),
type: 'primary'
})
}
}
// 直接换货不支持任何操作(发货、确认完成、取消)
if (flowType === 'direct') {