完善自媒体渠道修改
This commit is contained in:
2026-05-19 16:39:29 +08:00
parent 1cb00e9fbe
commit 26b442b5da
2 changed files with 26 additions and 2 deletions
+20 -1
View File
@@ -89,7 +89,15 @@
<el-table class="mt-4" size="large" v-loading="pager.loading" :data="pager.lists">
<el-table-column label="日期" prop="cost_date" min-width="120" />
<el-table-column label="自媒体渠道" prop="media_channel_name" min-width="120" />
<el-table-column label="自媒体渠道" min-width="160">
<template #default="{ row }">
<span v-if="getChannelGroupLabel(row.media_channel_code)">
<el-tag size="small" class="mr-1">{{ getChannelGroupLabel(row.media_channel_code) }}</el-tag>
{{ row.media_channel_name }}
</span>
<span v-else>{{ row.media_channel_name }}</span>
</template>
</el-table-column>
<el-table-column label="部门" prop="dept_name" min-width="140" />
<el-table-column label="账户消耗" min-width="120">
<template #default="{ row }">¥{{ row.amount }}</template>
@@ -213,6 +221,17 @@ const deptOptions = computed<DeptOption[]>(() => {
const defaultMediaChannelCode = computed(() => String(pager.extend.default_media_channel_code || ''))
const getChannelGroupLabel = (channelCode: string): string => {
if (!channelCode) return ''
for (const group of mediaChannelGroups.value) {
const channel = group.channels.find(ch => ch.channel_code === channelCode)
if (channel) {
return group.group_name
}
}
return ''
}
const treeProps = {
value: 'id',
label: 'name',