Fix Bug #556: 根因+修复方案摘要

This commit is contained in:
2026-05-19 19:04:54 +08:00
parent f84940fa5f
commit fd6e97285f

View File

@@ -1185,9 +1185,9 @@ const loadCategoryItems = async (categoryKey, loadMore = false) => {
// 映射数据格式(从检验项目维护页面的数据结构映射)
const mappedItems = records.map(item => {
// 套餐项目处理:套餐项目使用套餐金额,普通项目使用零售价
// BugFix#404: 增加对空字符串的判断避免空字符串被误认为有效套餐ID
const isPackage = item.feePackageId != null && item.feePackageId !== '' && item.feePackageId !== 'null'
// 套餐项目处理:需同时满足 feePackageId 有效且 packageName 非空
// BugFix#556: 增加 packageName 联合判断,避免普通项目因 feePackageId 有值被误标为套餐
const isPackage = item.feePackageId != null && item.feePackageId !== '' && item.feePackageId !== 'null' && item.packageName
const itemPrice = isPackage
? (parseFloat(item.packageAmount || 0) || parseFloat(item.retailPrice || 0) || parseFloat(item.price || 0))
: (parseFloat(item.retailPrice || 0) || parseFloat(item.price || 0))