fix:订单列表详情实付金额代理/企业不可见
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 6m22s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 6m22s
This commit is contained in:
@@ -233,6 +233,7 @@ export interface AssetPackageUsageRecord {
|
|||||||
reduction_pct?: number // 展示增幅比例(小数,如 0.428571)
|
reduction_pct?: number // 展示增幅比例(小数,如 0.428571)
|
||||||
enable_virtual_data?: boolean // 是否启用虚流量
|
enable_virtual_data?: boolean // 是否启用虚流量
|
||||||
paid_amount?: number // 实际支付金额(分)
|
paid_amount?: number // 实际支付金额(分)
|
||||||
|
retail_amount?: number // 零售价(分)
|
||||||
package_price?: number // 套餐价格(分)
|
package_price?: number // 套餐价格(分)
|
||||||
start_time?: string // 开始时间(兼容前端现有映射字段)
|
start_time?: string // 开始时间(兼容前端现有映射字段)
|
||||||
expire_time?: string // 到期时间(兼容前端现有映射字段)
|
expire_time?: string // 到期时间(兼容前端现有映射字段)
|
||||||
|
|||||||
@@ -193,8 +193,11 @@
|
|||||||
<ElDescriptionsItem label="套餐名称">
|
<ElDescriptionsItem label="套餐名称">
|
||||||
{{ currentPackage.package_name || '-' }}
|
{{ currentPackage.package_name || '-' }}
|
||||||
</ElDescriptionsItem>
|
</ElDescriptionsItem>
|
||||||
<ElDescriptionsItem label="套餐价格">
|
<ElDescriptionsItem label="套餐成本价格" v-if="isAdminOrPlatform">
|
||||||
{{ formatAmount(currentPackage.paid_amount || currentPackage.package_price || 0) }}
|
{{ formatAmount(currentPackage.paid_amount || 0) }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="套餐零售价">
|
||||||
|
{{ formatAmount(currentPackage.retail_amount || 0) }}
|
||||||
</ElDescriptionsItem>
|
</ElDescriptionsItem>
|
||||||
<ElDescriptionsItem label="套餐类型">
|
<ElDescriptionsItem label="套餐类型">
|
||||||
{{ getPackageTypeName(currentPackage.package_type) }}
|
{{ getPackageTypeName(currentPackage.package_type) }}
|
||||||
|
|||||||
@@ -48,9 +48,14 @@
|
|||||||
<span class="package-name-text">{{ scope.row.package_name }}</span>
|
<span class="package-name-text">{{ scope.row.package_name }}</span>
|
||||||
</template>
|
</template>
|
||||||
</ElTableColumn>
|
</ElTableColumn>
|
||||||
<ElTableColumn label="套餐价格" width="120">
|
<ElTableColumn v-if="isAdminOrPlatform" label="套餐成本价格" width="120">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ formatAmount(scope.row.paid_amount || scope.row.package_price || 0) }}
|
{{ formatAmount(scope.row.paid_amount || 0) }}
|
||||||
|
</template>
|
||||||
|
</ElTableColumn>
|
||||||
|
<ElTableColumn label="套餐零售价" width="120">
|
||||||
|
<template #default="scope">
|
||||||
|
{{ formatAmount(scope.row.retail_amount || 0) }}
|
||||||
</template>
|
</template>
|
||||||
</ElTableColumn>
|
</ElTableColumn>
|
||||||
<ElTableColumn prop="status_name" label="套餐状态" width="100">
|
<ElTableColumn prop="status_name" label="套餐状态" width="100">
|
||||||
|
|||||||
@@ -245,6 +245,7 @@ export function useAssetInfo() {
|
|||||||
order_no: pkg.order_no || '',
|
order_no: pkg.order_no || '',
|
||||||
package_name: pkg.package_name || '',
|
package_name: pkg.package_name || '',
|
||||||
paid_amount: pkg.paid_amount || 0,
|
paid_amount: pkg.paid_amount || 0,
|
||||||
|
retail_amount : pkg.retail_amount || 0,
|
||||||
real_total_mb: pkg.real_total_mb || 0,
|
real_total_mb: pkg.real_total_mb || 0,
|
||||||
real_used_mb: pkg.real_used_mb || 0,
|
real_used_mb: pkg.real_used_mb || 0,
|
||||||
real_remaining_mb: (pkg.real_total_mb || 0) - (pkg.real_used_mb || 0),
|
real_remaining_mb: (pkg.real_total_mb || 0) - (pkg.real_used_mb || 0),
|
||||||
|
|||||||
@@ -60,7 +60,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { h, onMounted, ref } from 'vue'
|
import { h, onMounted, ref, computed } from 'vue'
|
||||||
import { useRoute, useRouter } from 'vue-router'
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
import { ElButton, ElCard, ElIcon, ElImage, ElMessage, ElTable, ElTableColumn } from 'element-plus'
|
import { ElButton, ElCard, ElIcon, ElImage, ElMessage, ElTable, ElTableColumn } from 'element-plus'
|
||||||
import { ArrowLeft, Loading } from '@element-plus/icons-vue'
|
import { ArrowLeft, Loading } from '@element-plus/icons-vue'
|
||||||
@@ -75,6 +75,7 @@
|
|||||||
OrderPaymentMethod
|
OrderPaymentMethod
|
||||||
} from '@/types/api'
|
} from '@/types/api'
|
||||||
import { useAuth } from '@/composables/useAuth'
|
import { useAuth } from '@/composables/useAuth'
|
||||||
|
import { useUserStore } from '@/store/modules/user'
|
||||||
import { formatDateTime } from '@/utils/business/format'
|
import { formatDateTime } from '@/utils/business/format'
|
||||||
|
|
||||||
defineOptions({ name: 'OrderDetail' })
|
defineOptions({ name: 'OrderDetail' })
|
||||||
@@ -82,6 +83,7 @@
|
|||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const { hasAuth } = useAuth()
|
const { hasAuth } = useAuth()
|
||||||
|
const userStore = useUserStore()
|
||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const detailData = ref<Order | null>(null)
|
const detailData = ref<Order | null>(null)
|
||||||
@@ -174,11 +176,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 检查当前用户是否可以查看实付金额(代理账号和企业账号不能看到)
|
||||||
|
const canViewActualPaidAmount = computed(() => {
|
||||||
|
const userType = userStore.info.user_type
|
||||||
|
// 只有代理账号(3)和企业账号(4)不能看到实付金额
|
||||||
|
return userType !== 3 && userType !== 4
|
||||||
|
})
|
||||||
|
|
||||||
// 详情页配置
|
// 详情页配置
|
||||||
const detailSections: DetailSection[] = [
|
const detailSections = computed<DetailSection[]>(() => {
|
||||||
{
|
const baseFields = [
|
||||||
title: '基本信息',
|
|
||||||
fields: [
|
|
||||||
{ label: '订单号', prop: 'order_no' },
|
{ label: '订单号', prop: 'order_no' },
|
||||||
{
|
{
|
||||||
label: '订单类型',
|
label: '订单类型',
|
||||||
@@ -192,13 +199,20 @@
|
|||||||
label: '订单金额',
|
label: '订单金额',
|
||||||
prop: 'total_amount',
|
prop: 'total_amount',
|
||||||
formatter: (value) => formatCurrency(value)
|
formatter: (value) => formatCurrency(value)
|
||||||
},
|
}
|
||||||
{
|
]
|
||||||
|
|
||||||
|
// 只有非代理账号和非企业账号才能看到实付金额字段
|
||||||
|
if (canViewActualPaidAmount.value) {
|
||||||
|
baseFields.push({
|
||||||
label: '实付金额',
|
label: '实付金额',
|
||||||
prop: 'actual_paid_amount',
|
prop: 'actual_paid_amount',
|
||||||
formatter: (value) =>
|
formatter: (value) =>
|
||||||
value !== undefined && value !== null ? formatCurrency(value) : '-'
|
value !== undefined && value !== null ? formatCurrency(value) : '-'
|
||||||
},
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
baseFields.push(
|
||||||
{
|
{
|
||||||
label: '支付凭证',
|
label: '支付凭证',
|
||||||
fullWidth: true,
|
fullWidth: true,
|
||||||
@@ -284,7 +298,12 @@
|
|||||||
prop: 'updated_at',
|
prop: 'updated_at',
|
||||||
formatter: (value) => formatDateTime(value)
|
formatter: (value) => formatDateTime(value)
|
||||||
}
|
}
|
||||||
]
|
)
|
||||||
|
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
title: '基本信息',
|
||||||
|
fields: baseFields
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作者信息',
|
title: '操作者信息',
|
||||||
@@ -331,6 +350,7 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
})
|
||||||
|
|
||||||
// 返回上一页
|
// 返回上一页
|
||||||
const handleBack = () => {
|
const handleBack = () => {
|
||||||
|
|||||||
@@ -489,7 +489,8 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
// 列配置
|
// 列配置
|
||||||
const columnOptions = [
|
const columnOptions = computed(() => {
|
||||||
|
const options = [
|
||||||
{ label: '订单编号', prop: 'order_no' },
|
{ label: '订单编号', prop: 'order_no' },
|
||||||
{ label: '买家手机号', prop: 'buyer_phone' },
|
{ label: '买家手机号', prop: 'buyer_phone' },
|
||||||
{ label: '买家昵称', prop: 'buyer_nickname' },
|
{ label: '买家昵称', prop: 'buyer_nickname' },
|
||||||
@@ -504,11 +505,21 @@
|
|||||||
{ label: '支付状态', prop: 'payment_status' },
|
{ label: '支付状态', prop: 'payment_status' },
|
||||||
{ label: '佣金流程状态', prop: 'commission_status_name' },
|
{ label: '佣金流程状态', prop: 'commission_status_name' },
|
||||||
{ label: '佣金业务结果', prop: 'commission_result_name' },
|
{ label: '佣金业务结果', prop: 'commission_result_name' },
|
||||||
{ label: '订单金额', prop: 'total_amount' },
|
{ label: '订单金额', prop: 'total_amount' }
|
||||||
{ label: '实付金额', prop: 'actual_paid_amount' },
|
]
|
||||||
|
|
||||||
|
// 只有非代理账号和非企业账号才能看到实付金额选项
|
||||||
|
if (canViewActualPaidAmount.value) {
|
||||||
|
options.push({ label: '实付金额', prop: 'actual_paid_amount' })
|
||||||
|
}
|
||||||
|
|
||||||
|
options.push(
|
||||||
{ label: '支付方式', prop: 'payment_method' },
|
{ label: '支付方式', prop: 'payment_method' },
|
||||||
{ label: '支付时间', prop: 'paid_at' }
|
{ label: '支付时间', prop: 'paid_at' }
|
||||||
]
|
)
|
||||||
|
|
||||||
|
return options
|
||||||
|
})
|
||||||
|
|
||||||
const createFormRef = ref<FormInstance>()
|
const createFormRef = ref<FormInstance>()
|
||||||
const uploadRef = ref<UploadInstance>()
|
const uploadRef = ref<UploadInstance>()
|
||||||
@@ -858,8 +869,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 检查当前用户是否可以查看实付金额(代理账号和企业账号不能看到)
|
||||||
|
const canViewActualPaidAmount = computed(() => {
|
||||||
|
const userType = userStore.info.user_type
|
||||||
|
// 只有代理账号(3)和企业账号(4)不能看到实付金额
|
||||||
|
return userType !== 3 && userType !== 4
|
||||||
|
})
|
||||||
|
|
||||||
// 动态列配置
|
// 动态列配置
|
||||||
const { columnChecks, columns } = useCheckedColumns(() => [
|
const { columnChecks, columns } = useCheckedColumns(() => {
|
||||||
|
const baseColumns = [
|
||||||
{
|
{
|
||||||
prop: 'order_no',
|
prop: 'order_no',
|
||||||
label: '订单编号',
|
label: '订单编号',
|
||||||
@@ -998,8 +1017,12 @@
|
|||||||
label: '订单金额',
|
label: '订单金额',
|
||||||
width: 120,
|
width: 120,
|
||||||
formatter: (row: Order) => formatCurrency(row.total_amount)
|
formatter: (row: Order) => formatCurrency(row.total_amount)
|
||||||
},
|
}
|
||||||
{
|
]
|
||||||
|
|
||||||
|
// 只有非代理账号和非企业账号才能看到实付金额列
|
||||||
|
if (canViewActualPaidAmount.value) {
|
||||||
|
baseColumns.push({
|
||||||
prop: 'actual_paid_amount',
|
prop: 'actual_paid_amount',
|
||||||
label: '实付金额',
|
label: '实付金额',
|
||||||
width: 120,
|
width: 120,
|
||||||
@@ -1007,7 +1030,10 @@
|
|||||||
if (row.actual_paid_amount === undefined || row.actual_paid_amount === null) return '-'
|
if (row.actual_paid_amount === undefined || row.actual_paid_amount === null) return '-'
|
||||||
return formatCurrency(row.actual_paid_amount)
|
return formatCurrency(row.actual_paid_amount)
|
||||||
}
|
}
|
||||||
},
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
baseColumns.push(
|
||||||
{
|
{
|
||||||
prop: 'payment_method',
|
prop: 'payment_method',
|
||||||
label: '支付方式',
|
label: '支付方式',
|
||||||
@@ -1020,7 +1046,10 @@
|
|||||||
width: 180,
|
width: 180,
|
||||||
formatter: (row: Order) => (row.paid_at ? formatDateTime(row.paid_at) : '-')
|
formatter: (row: Order) => (row.paid_at ? formatDateTime(row.paid_at) : '-')
|
||||||
}
|
}
|
||||||
])
|
)
|
||||||
|
|
||||||
|
return baseColumns
|
||||||
|
})
|
||||||
|
|
||||||
// 当订单类型切换时,清空已选择的套餐
|
// 当订单类型切换时,清空已选择的套餐
|
||||||
watch(
|
watch(
|
||||||
|
|||||||
Reference in New Issue
Block a user