fix: 新增代理系列授权
Some checks failed
构建并部署前端到测试环境 / build-and-deploy (push) Has been cancelled

This commit is contained in:
sexygoat
2026-04-29 16:11:54 +08:00
parent 9b4d956032
commit 1141b6c92d

View File

@@ -328,9 +328,8 @@
style="width: 150px" style="width: 150px"
/> />
<span v-if="pkg.original_cost_price" class="min-cost-hint"> <span v-if="pkg.original_cost_price" class="min-cost-hint">
(: ¥{{ pkg.original_cost_price.toFixed(2) }}, 最高: ¥{{ (成本: ¥{{ pkg.original_cost_price.toFixed(2) }}, 建议售价:
(pkg.original_cost_price * 1.5).toFixed(2) {{ formatSuggestedRetailPrice(pkg.suggested_retail_price) }})
}})
</span> </span>
</div> </div>
<ElButton type="danger" size="small" @click="removePackage(index)" <ElButton type="danger" size="small" @click="removePackage(index)"
@@ -1055,7 +1054,12 @@
force_recharge_amount: undefined, force_recharge_amount: undefined,
force_recharge_locked: false, // 强充是否被套餐系列锁定 force_recharge_locked: false, // 强充是否被套餐系列锁定
series_force_recharge_amount: 0, // 系列强充金额(元) series_force_recharge_amount: 0, // 系列强充金额(元)
packages: [] as Array<{ package_id: number; cost_price: number }> // 套餐配置 packages: [] as Array<{
package_id: number
cost_price: number
original_cost_price?: number
suggested_retail_price?: number
}> // 套餐配置
}) })
// 动态验证规则 // 动态验证规则
@@ -1397,6 +1401,13 @@
return pkg ? pkg.package_name : `套餐ID: ${packageId}` return pkg ? pkg.package_name : `套餐ID: ${packageId}`
} }
const formatSuggestedRetailPrice = (suggestedRetailPrice?: number | null) => {
if (suggestedRetailPrice === undefined || suggestedRetailPrice === null) {
return '-'
}
return `¥${(suggestedRetailPrice * 1.5).toFixed(2)}`
}
// 监听套餐选择变化 // 监听套餐选择变化
watch(selectedPackageIds, (newIds, oldIds) => { watch(selectedPackageIds, (newIds, oldIds) => {
// 找出新增的ID // 找出新增的ID
@@ -1413,7 +1424,11 @@
form.packages.push({ form.packages.push({
package_id: id, package_id: id,
cost_price: costPrice, cost_price: costPrice,
original_cost_price: costPrice // 保存原始成本价用于验证 original_cost_price: costPrice, // 保存原始成本价用于验证
suggested_retail_price:
pkg?.suggested_retail_price !== undefined && pkg?.suggested_retail_price !== null
? pkg.suggested_retail_price / 100
: undefined
}) })
} }
}) })
@@ -1850,7 +1865,12 @@
return { return {
package_id: pkg.package_id, package_id: pkg.package_id,
cost_price: pkg.cost_price / 100, // 将分转换为元 cost_price: pkg.cost_price / 100, // 将分转换为元
original_cost_price: originalCostPrice // 保存原始成本价用于验证 original_cost_price: originalCostPrice, // 保存原始成本价用于验证
suggested_retail_price:
pkgOption?.suggested_retail_price !== undefined &&
pkgOption?.suggested_retail_price !== null
? pkgOption.suggested_retail_price / 100
: undefined
} }
}) })
selectedPackageIds.value = detail.packages.map((pkg) => pkg.package_id) selectedPackageIds.value = detail.packages.map((pkg) => pkg.package_id)