This commit is contained in:
@@ -314,7 +314,7 @@
|
||||
{{ scope.row.gateway_extend || '-' }}
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="操作" width="280" fixed="right">
|
||||
<ElTableColumn label="操作" width="260" fixed="right">
|
||||
<template #default="scope">
|
||||
<!-- 根据网络状态显示启用或停用按钮 -->
|
||||
<ElButton
|
||||
@@ -357,15 +357,6 @@
|
||||
>
|
||||
卡审计
|
||||
</ElButton>
|
||||
<ElButton
|
||||
v-if="getBindingAuditTarget(scope.row)"
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
@click="openBindingAudit(scope.row)"
|
||||
>
|
||||
绑定审计
|
||||
</ElButton>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
</ElTable>
|
||||
@@ -616,7 +607,6 @@
|
||||
|
||||
// Props
|
||||
interface BindingCard {
|
||||
id: number
|
||||
card_id?: number
|
||||
iccid: string
|
||||
msisdn?: string
|
||||
@@ -747,14 +737,17 @@
|
||||
const isSubjectActivityView = computed(() => [3, 4].includes(Number(userStore.info.user_type)))
|
||||
const auditTarget = computed(() => {
|
||||
const userType = Number(userStore.info.user_type)
|
||||
const isCard = props.cardInfo.asset_type === 'card'
|
||||
const permission =
|
||||
userType === 3
|
||||
? AUDIT_PERMISSIONS.agentActivity
|
||||
? isCard
|
||||
? AUDIT_PERMISSIONS.agentAssetInfoCardActivity
|
||||
: AUDIT_PERMISSIONS.agentAssetInfoDeviceActivity
|
||||
: userType === 4
|
||||
? AUDIT_PERMISSIONS.enterpriseActivity
|
||||
: props.cardInfo.asset_type === 'card'
|
||||
? AUDIT_PERMISSIONS.cardEntry
|
||||
: AUDIT_PERMISSIONS.deviceEntry
|
||||
? isCard
|
||||
? AUDIT_PERMISSIONS.enterpriseAssetInfoCardActivity
|
||||
: AUDIT_PERMISSIONS.enterpriseAssetInfoDeviceActivity
|
||||
: AUDIT_PERMISSIONS.assetInfoEntry
|
||||
if (!hasAuth(permission)) return null
|
||||
return resolveAuditResourceTarget({
|
||||
userType,
|
||||
@@ -771,10 +764,10 @@
|
||||
const userType = Number(userStore.info.user_type)
|
||||
const permission =
|
||||
userType === 3
|
||||
? AUDIT_PERMISSIONS.agentActivity
|
||||
? AUDIT_PERMISSIONS.agentAssetInfoBindingCardActivity
|
||||
: userType === 4
|
||||
? AUDIT_PERMISSIONS.enterpriseActivity
|
||||
: AUDIT_PERMISSIONS.cardEntry
|
||||
? AUDIT_PERMISSIONS.enterpriseAssetInfoBindingCardActivity
|
||||
: AUDIT_PERMISSIONS.assetInfoBindingCardEntry
|
||||
if (!hasAuth(permission)) return null
|
||||
return resolveAuditResourceTarget({
|
||||
userType,
|
||||
@@ -783,25 +776,10 @@
|
||||
businessIdentifier: card.iccid
|
||||
})
|
||||
}
|
||||
const getBindingAuditTarget = (card: BindingCard) => {
|
||||
if (
|
||||
![1, 2].includes(Number(userStore.info.user_type)) ||
|
||||
!hasAuth(AUDIT_PERMISSIONS.resourceTimeline)
|
||||
)
|
||||
return null
|
||||
return resolveAuditResourceTarget({
|
||||
resourceType: 'device_sim_binding',
|
||||
internalId: card.id
|
||||
})
|
||||
}
|
||||
const openBindingCardAudit = (card: BindingCard) => {
|
||||
const target = getBindingCardAuditTarget(card)
|
||||
if (target) openAuditInvestigation(target)
|
||||
}
|
||||
const openBindingAudit = (card: BindingCard) => {
|
||||
const target = getBindingAuditTarget(card)
|
||||
if (target) openAuditInvestigation(target)
|
||||
}
|
||||
const { width } = useWindowSize()
|
||||
|
||||
const CARD_MONTH_USAGE_PERMISSION = 'asset_info:view_card_month_usage'
|
||||
|
||||
@@ -296,7 +296,7 @@
|
||||
const descriptionsColumn = computed(() => {
|
||||
if (width.value <= 640) return 1
|
||||
if (width.value <= 1024) return 2
|
||||
return 4
|
||||
return 3
|
||||
})
|
||||
|
||||
const emit = defineEmits<{
|
||||
|
||||
@@ -45,15 +45,20 @@
|
||||
<ElButton type="primary" @click="handleQuery">查询</ElButton>
|
||||
<ElButton @click="handleReset()">重置</ElButton>
|
||||
<ElButton
|
||||
v-if="walletInfo?.wallet_id && hasAuth(AUDIT_PERMISSIONS.financeTimeline)"
|
||||
v-if="
|
||||
isPlatformAuditUser &&
|
||||
walletInfo?.wallet_id &&
|
||||
hasAuth(AUDIT_PERMISSIONS.assetInfoWalletFinance)
|
||||
"
|
||||
@click="openWalletAudit"
|
||||
>资金链路</ElButton
|
||||
>
|
||||
<ElButton
|
||||
v-if="
|
||||
isPlatformAuditUser &&
|
||||
walletInfo?.resource_type &&
|
||||
walletInfo?.resource_id &&
|
||||
hasAuth(AUDIT_PERMISSIONS.resourceTimeline)
|
||||
hasAuth(AUDIT_PERMISSIONS.assetInfoWalletAsset)
|
||||
"
|
||||
@click="openAssetAudit"
|
||||
>资产审计</ElButton
|
||||
@@ -182,7 +187,9 @@
|
||||
TransactionType
|
||||
} from '@/types/api'
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { AUDIT_PERMISSIONS } from '@/config/constants/audit'
|
||||
import { isPlatformAuditAccount } from '@/utils/business/auditAccess'
|
||||
import {
|
||||
resolveAuditResourceTarget,
|
||||
resolveFinanceAuditTarget
|
||||
@@ -204,6 +211,10 @@
|
||||
boundDeviceNo: ''
|
||||
})
|
||||
const { hasAuth } = useAuth()
|
||||
const userStore = useUserStore()
|
||||
const isPlatformAuditUser = computed(() =>
|
||||
isPlatformAuditAccount(userStore.info.user_type, userStore.isSuperAdmin)
|
||||
)
|
||||
|
||||
const openWalletAudit = () => {
|
||||
const target = resolveFinanceAuditTarget('wallet_id', props.walletInfo?.wallet_id)
|
||||
|
||||
@@ -3161,9 +3161,9 @@
|
||||
const userType = Number(userStore.getUserInfo.user_type)
|
||||
const auditPermission =
|
||||
userType === 3
|
||||
? AUDIT_PERMISSIONS.agentActivity
|
||||
? AUDIT_PERMISSIONS.agentDeviceActivity
|
||||
: userType === 4
|
||||
? AUDIT_PERMISSIONS.enterpriseActivity
|
||||
? AUDIT_PERMISSIONS.enterpriseDeviceActivity
|
||||
: AUDIT_PERMISSIONS.deviceEntry
|
||||
if (hasAuth(auditPermission)) {
|
||||
const auditTarget = resolveAuditResourceTarget({
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
{{ userType === 3 ? '活动记录' : '换货审计' }}
|
||||
</ElButton>
|
||||
<ElButton
|
||||
v-if="oldAssetAuditTarget && hasAuth(AUDIT_PERMISSIONS.resourceTimeline)"
|
||||
v-if="oldAssetAuditTarget && hasAuth(AUDIT_PERMISSIONS.exchangeOldAssetEntry)"
|
||||
type="primary"
|
||||
plain
|
||||
@click="openAuditInvestigation(oldAssetAuditTarget)"
|
||||
@@ -27,7 +27,7 @@
|
||||
旧资产审计
|
||||
</ElButton>
|
||||
<ElButton
|
||||
v-if="newAssetAuditTarget && hasAuth(AUDIT_PERMISSIONS.resourceTimeline)"
|
||||
v-if="newAssetAuditTarget && hasAuth(AUDIT_PERMISSIONS.exchangeNewAssetEntry)"
|
||||
type="primary"
|
||||
plain
|
||||
@click="openAuditInvestigation(newAssetAuditTarget)"
|
||||
@@ -77,10 +77,10 @@
|
||||
const exchangeId = ref<number>(0)
|
||||
const userType = computed(() => Number(userStore.info.user_type))
|
||||
const exchangeAuditPermission = computed(() =>
|
||||
userType.value === 3 ? AUDIT_PERMISSIONS.agentActivity : AUDIT_PERMISSIONS.resourceTimeline
|
||||
userType.value === 3 ? AUDIT_PERMISSIONS.agentExchangeActivity : AUDIT_PERMISSIONS.exchangeEntry
|
||||
)
|
||||
const exchangeAuditTarget = computed(() => {
|
||||
if (!exchangeDetail.value || userType.value === 4) return null
|
||||
if (!exchangeDetail.value || ![1, 2, 3].includes(userType.value)) return null
|
||||
return resolveAuditResourceTarget({
|
||||
userType: userType.value,
|
||||
resourceType: 'exchange_order',
|
||||
|
||||
@@ -1555,8 +1555,8 @@
|
||||
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)) {
|
||||
userType === 3 ? AUDIT_PERMISSIONS.agentExchangeActivity : AUDIT_PERMISSIONS.exchangeEntry
|
||||
if ([1, 2, 3].includes(userType) && hasAuth(entryPermission)) {
|
||||
const exchangeTarget = resolveAuditResourceTarget({
|
||||
userType,
|
||||
resourceType: 'exchange_order',
|
||||
@@ -1574,7 +1574,7 @@
|
||||
resourceType: row.old_asset_type,
|
||||
internalId: row.old_asset_id
|
||||
})
|
||||
if (oldAssetTarget)
|
||||
if (oldAssetTarget && hasAuth(AUDIT_PERMISSIONS.exchangeOldAssetEntry))
|
||||
actions.push({
|
||||
label: '旧资产审计',
|
||||
handler: () => openAuditInvestigation(oldAssetTarget),
|
||||
@@ -1584,7 +1584,7 @@
|
||||
resourceType: row.new_asset_type || '',
|
||||
internalId: row.new_asset_id
|
||||
})
|
||||
if (newAssetTarget)
|
||||
if (newAssetTarget && hasAuth(AUDIT_PERMISSIONS.exchangeNewAssetEntry))
|
||||
actions.push({
|
||||
label: '新资产审计',
|
||||
handler: () => openAuditInvestigation(newAssetTarget),
|
||||
|
||||
@@ -2315,9 +2315,9 @@
|
||||
const userType = Number(userStore.getUserInfo.user_type)
|
||||
const auditPermission =
|
||||
userType === 3
|
||||
? AUDIT_PERMISSIONS.agentActivity
|
||||
? AUDIT_PERMISSIONS.agentCardActivity
|
||||
: userType === 4
|
||||
? AUDIT_PERMISSIONS.enterpriseActivity
|
||||
? AUDIT_PERMISSIONS.enterpriseCardActivity
|
||||
: AUDIT_PERMISSIONS.cardEntry
|
||||
if (hasAuth(auditPermission)) {
|
||||
const auditTarget = resolveAuditResourceTarget({
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
{{ userType === 3 ? '活动记录' : '分配审计' }}
|
||||
</ElButton>
|
||||
<ElButton
|
||||
v-if="assetAuditTarget && hasAuth(AUDIT_PERMISSIONS.resourceTimeline)"
|
||||
v-if="assetAuditTarget && hasAuth(AUDIT_PERMISSIONS.assetAllocationAssetEntry)"
|
||||
type="primary"
|
||||
plain
|
||||
@click="openAuditInvestigation(assetAuditTarget)"
|
||||
@@ -67,10 +67,12 @@
|
||||
const detailData = ref<AssetAllocationRecord | null>(null)
|
||||
const userType = computed(() => Number(userStore.info.user_type))
|
||||
const recordAuditPermission = computed(() =>
|
||||
userType.value === 3 ? AUDIT_PERMISSIONS.agentActivity : AUDIT_PERMISSIONS.resourceTimeline
|
||||
userType.value === 3
|
||||
? AUDIT_PERMISSIONS.agentAssetAllocationActivity
|
||||
: AUDIT_PERMISSIONS.assetAllocationEntry
|
||||
)
|
||||
const recordAuditTarget = computed(() => {
|
||||
if (!detailData.value || userType.value === 4) return null
|
||||
if (!detailData.value || ![1, 2, 3].includes(userType.value)) return null
|
||||
return resolveAuditResourceTarget({
|
||||
userType: userType.value,
|
||||
resourceType: 'asset_allocation_record',
|
||||
|
||||
@@ -232,8 +232,10 @@
|
||||
const actions: Array<{ label: string; handler: () => void; type: 'primary' }> = []
|
||||
const userType = Number(userStore.info.user_type)
|
||||
const entryPermission =
|
||||
userType === 3 ? AUDIT_PERMISSIONS.agentActivity : AUDIT_PERMISSIONS.resourceTimeline
|
||||
if (!hasAuth(entryPermission) || userType === 4) return actions
|
||||
userType === 3
|
||||
? AUDIT_PERMISSIONS.agentAssetAllocationActivity
|
||||
: AUDIT_PERMISSIONS.assetAllocationEntry
|
||||
if (!hasAuth(entryPermission) || ![1, 2, 3].includes(userType)) return actions
|
||||
const recordTarget = resolveAuditResourceTarget({
|
||||
userType,
|
||||
resourceType: 'asset_allocation_record',
|
||||
@@ -252,7 +254,7 @@
|
||||
resourceType: row.asset_type,
|
||||
internalId: row.asset_id
|
||||
})
|
||||
if (assetTarget)
|
||||
if (assetTarget && hasAuth(AUDIT_PERMISSIONS.assetAllocationAssetEntry))
|
||||
actions.push({
|
||||
label: '资产审计',
|
||||
handler: () => openAuditInvestigation(assetTarget),
|
||||
|
||||
Reference in New Issue
Block a user