fix: bug
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 2m9s

This commit is contained in:
sexygoat
2026-04-23 14:59:05 +08:00
parent a9467e8a0c
commit a5e76313cb
28 changed files with 1284 additions and 702 deletions

View File

@@ -511,15 +511,46 @@
{ label: '套餐名称', prop: 'package_name' },
{ label: '所属系列', prop: 'series_name' },
{ label: '套餐类型', prop: 'package_type' },
{ label: '套餐周期类型', prop: 'calendar_type' },
{ label: '有效期', prop: 'duration_months' },
{ label: '真流量', prop: 'real_data_mb' },
{ label: '虚流量', prop: 'virtual_data_mb' },
{ label: '虚流量比例', prop: 'virtual_ratio' },
{ label: '有效期', prop: 'duration_months' },
{
label: '启用虚流量',
prop: 'enable_virtual_data',
formatter: (row: any) => (row.enable_virtual_data ? '是' : '否')
},
{
label: '流量重置周期',
prop: 'data_reset_cycle',
formatter: (row: any) => {
const map: Record<string, string> = {
daily: '每日',
weekly: '每周',
monthly: '每月',
none: '不重置'
}
return map[row.data_reset_cycle] || row.data_reset_cycle || '-'
}
},
{
label: '到期时间基准',
prop: 'expiry_base',
formatter: (row: any) => {
const map: Record<string, string> = {
from_activation: '实名激活',
from_purchase: '购买时'
}
return map[row.expiry_base] || row.expiry_base || '-'
}
},
{ label: '成本价', prop: 'cost_price' },
{ label: '建议售价', prop: 'suggested_retail_price' },
{ label: '上架状态', prop: 'shelf_status' },
{ label: '状态', prop: 'status' },
{ label: '创建时间', prop: 'created_at' }
{ label: '创建时间', prop: 'created_at' },
{ label: '更新时间', prop: 'updated_at' }
]
// 表单验证规则
@@ -729,6 +760,44 @@
width: 100,
formatter: (row: PackageResponse) => `${row.duration_months}`
},
{
prop: 'calendar_type',
label: '套餐周期类型',
width: 120,
formatter: (row: PackageResponse) => {
const map: Record<string, string> = {
natural_month: '自然月',
by_day: '按天'
}
return map[row.calendar_type] || row.calendar_type || '-'
}
},
{
prop: 'data_reset_cycle',
label: '流量重置周期',
width: 120,
formatter: (row: PackageResponse) => {
const map: Record<string, string> = {
daily: '每日',
weekly: '每周',
monthly: '每月',
none: '不重置'
}
return map[row.data_reset_cycle] || row.data_reset_cycle || '-'
}
},
{
prop: 'expiry_base',
label: '到期时间基准',
width: 120,
formatter: (row: PackageResponse) => {
const map: Record<string, string> = {
from_activation: '实名激活',
from_purchase: '购买时'
}
return map[row.expiry_base] || row.expiry_base || '-'
}
},
{
prop: 'cost_price',
label: '成本价',
@@ -850,8 +919,6 @@
)
onMounted(() => {
loadSeriesOptions()
loadSearchSeriesOptions()
getTableData()
})

View File

@@ -460,14 +460,46 @@
{ label: '系列编码', prop: 'series_code' },
{ label: '系列名称', prop: 'series_name' },
{ label: '描述', prop: 'description' },
{ label: '一次性佣金', prop: 'enable_one_time_commission' },
{ label: '佣金类型', prop: 'commission_type' },
{ label: '触发阈值', prop: 'commission_threshold' },
{ label: '触发类型', prop: 'trigger_type' },
{ label: '强充状态', prop: 'enable_force_recharge' },
{ label: '强充金额', prop: 'force_amount' },
{ label: '强充计算类型', prop: 'force_calc_type' },
{ label: '时效类型', prop: 'validity_type' },
{
label: '一次性佣金',
prop: 'enable_one_time_commission',
formatter: (row: any) => (row.enable_one_time_commission ? '启用' : '未启用')
},
{
label: '佣金类型',
prop: 'commission_type',
formatter: (row: any) => row.one_time_commission_config?.commission_type || '-'
},
{
label: '触发阈值',
prop: 'threshold',
formatter: (row: any) => row.one_time_commission_config?.threshold ?? '-'
},
{
label: '触发类型',
prop: 'trigger_type',
formatter: (row: any) => row.one_time_commission_config?.trigger_type || '-'
},
{
label: '强充状态',
prop: 'enable_force_recharge',
formatter: (row: any) => (row.one_time_commission_config?.enable_force_recharge ? '启用' : '未启用')
},
{
label: '强充金额',
prop: 'force_amount',
formatter: (row: any) => row.one_time_commission_config?.force_amount ?? '-'
},
{
label: '强充计算类型',
prop: 'force_calc_type',
formatter: (row: any) => row.one_time_commission_config?.force_calc_type || '-'
},
{
label: '时效类型',
prop: 'validity_type',
formatter: (row: any) => row.one_time_commission_config?.validity_type || '-'
},
{ label: '状态', prop: 'status' },
{ label: '创建时间', prop: 'created_at' }
]

View File

@@ -459,10 +459,16 @@
<ElRow :gutter="20">
<ElCol :span="12">
<ElFormItem label="启用强制充值">
<ElSwitch v-model="form.enable_force_recharge" />
<ElSwitch
v-model="form.enable_force_recharge"
:disabled="form.force_recharge_locked && isAgentAccount"
/>
</ElFormItem>
</ElCol>
<ElCol :span="12" v-if="form.enable_force_recharge">
<ElCol
:span="12"
v-if="form.enable_force_recharge && !(form.force_recharge_locked && isAgentAccount)"
>
<ElFormItem label="强充金额(元)" prop="force_recharge_amount">
<ElInputNumber
v-model="form.force_recharge_amount"
@@ -625,10 +631,13 @@
<ElRow :gutter="20">
<ElCol :span="12">
<ElFormItem label="启用强制充值">
<ElSwitch v-model="form.enable_force_recharge" />
<ElSwitch
v-model="form.enable_force_recharge"
:disabled="form.force_recharge_locked && isAgentAccount"
/>
</ElFormItem>
</ElCol>
<ElCol :span="12" v-if="form.enable_force_recharge">
<ElCol :span="12" v-if="form.enable_force_recharge && !(form.force_recharge_locked && isAgentAccount)">
<ElFormItem label="强充金额(元)" prop="force_recharge_amount">
<ElInputNumber
v-model="form.force_recharge_amount"
@@ -783,6 +792,8 @@
import type { SearchFormItem } from '@/types'
import { useCheckedColumns } from '@/composables/useCheckedColumns'
import { useAuth } from '@/composables/useAuth'
import { useUserStore } from '@/store/modules/user'
import { storeToRefs } from 'pinia'
import { formatDateTime } from '@/utils/business/format'
import {
CommonStatus,
@@ -797,6 +808,9 @@
const { hasAuth } = useAuth()
const router = useRouter()
const userStore = useUserStore()
const { info: userInfo } = storeToRefs(userStore)
const isAgentAccount = computed(() => userInfo.value.user_type === 3)
const dialogVisible = ref(false)
const loading = ref(false)
@@ -1036,6 +1050,7 @@
}>, // 梯度配置(包含完整字段,从系列继承)
enable_force_recharge: false,
force_recharge_amount: undefined,
force_recharge_locked: false, // 强充是否被套餐系列锁定
series_force_recharge_amount: 0, // 系列强充金额(元)
packages: [] as Array<{ package_id: number; cost_price: number }> // 套餐配置
})
@@ -1207,6 +1222,27 @@
)
}
},
{
prop: 'force_recharge_locked',
label: '强充锁定',
width: 100,
formatter: (row: ShopSeriesGrantResponse) => {
return h(
ElTag,
{ type: row.force_recharge_locked ? 'danger' : 'success', size: 'small' },
() => (row.force_recharge_locked ? '是' : '否')
)
}
},
{
prop: 'force_recharge_amount',
label: '强充金额',
width: 100,
formatter: (row: ShopSeriesGrantResponse) => {
if (!row.force_recharge_enabled) return '-'
return `¥${((row.force_recharge_amount || 0) / 100).toFixed(2)}`
}
},
{
prop: 'package_count',
label: '套餐数量',
@@ -1794,6 +1830,7 @@
form.force_recharge_amount = detail.force_recharge_amount
? detail.force_recharge_amount / 100
: undefined
form.force_recharge_locked = detail.force_recharge_locked || false
// 设置套餐数据
if (detail.packages && detail.packages.length > 0) {
@@ -1842,6 +1879,7 @@
form.commission_tiers = []
form.enable_force_recharge = false
form.force_recharge_amount = undefined
form.force_recharge_locked = false
form.packages = []
selectedPackageIds.value = []
packageOptions.value = [] // 清空套餐选项
@@ -1874,6 +1912,7 @@
form.commission_tiers = []
form.enable_force_recharge = false
form.force_recharge_amount = undefined
form.force_recharge_locked = false
form.packages = []
selectedPackageIds.value = []
}