diff --git a/web/src/pages/NewAssessment.tsx b/web/src/pages/NewAssessment.tsx index d2cff7c..38ffa51 100644 --- a/web/src/pages/NewAssessment.tsx +++ b/web/src/pages/NewAssessment.tsx @@ -681,6 +681,25 @@ export function NewAssessment(): JSX.Element { } } + // —— 收入口径校验:避免报价信息不足时静默生成「收入 0 元」的盈利分析。—— + const anyUnitPrice = apiPositions.some((p) => p.unitPrice !== undefined && p.unitPrice > 0); + if (pricingModel === 'per_head' || pricingModel === 'volume') { + if (!anyUnitPrice && mf === undefined) { + setError('报价信息不足:请在「报价与成本」步骤为岗位填写对客月单价,或填写管理费(元/人/月),否则盈利分析收入将为 0。'); + return; + } + } else if (pricingModel === 'cost_plus') { + if (mr === undefined && !anyUnitPrice) { + setError('报价信息不足:业务/服务外包(成本加成)需填写「成本加成率」(如 0.15)或为岗位填写「人月单价」,否则盈利分析收入将为 0。'); + return; + } + } else if (pricingModel === 'fixed_total') { + if (ct === undefined || ct <= 0) { + setError('报价信息不足:固定总价模式请填写「合同总额(含税,元)」,否则盈利分析收入将为 0。'); + return; + } + } + // 估算基准报价(供既有报告费用区):人头/产能=Σ人数×单价×月;固定总价=合同总额。 let baselineQuote = 0; if (pricingModel === 'fixed_total') { @@ -996,7 +1015,7 @@ export function NewAssessment(): JSX.Element { setClientTotalHeadcount(e.target.value)} placeholder="如 500" inputMode="numeric" /> {pricingModel === 'cost_plus' && ( - + setMarkupRate(e.target.value)} placeholder="0.15" inputMode="decimal" /> )}