fix: 优化门店健康分评分公式 - 正态分布(均值63, 标准差9)

This commit is contained in:
freedakgmail
2026-07-30 09:07:16 +08:00
parent 268e085ffa
commit efb27127e2
2 changed files with 34 additions and 25 deletions
@@ -240,7 +240,7 @@ function HealthScoreTab({ navigate }: { navigate: (path: string) => void }) {
{ key: 'health_score', label: '健康分' },
{ key: 'received', label: '实收' },
{ key: 'avg_margin', label: '毛利率' },
{ key: 'over_cost_rate', label: '超耗率' },
{ key: 'avg_cost_variance_pct', label: '成本差异率' },
{ key: 'repeat_rate_pct', label: '复购率' },
{ key: 'task_completion_rate', label: '完成率' },
]}
@@ -268,7 +268,7 @@ function HealthScoreTab({ navigate }: { navigate: (path: string) => void }) {
{ key: 'received', label: '实收', align: 'right', render: (r) => formatCurrency(r.received) },
{ key: 'avg_bill_value', label: '客单价', align: 'right', render: (r) => formatCurrency(r.avg_bill_value) },
{ key: 'avg_margin', label: '毛利率', align: 'right', render: (r) => `${r.avg_margin}%` },
{ key: 'over_cost_rate', label: '超耗率', align: 'right', render: (r) => `${r.over_cost_rate}%` },
{ key: 'avg_cost_variance_pct', label: '成本差异率', align: 'right', render: (r) => `${r.avg_cost_variance_pct}%` },
{ key: 'repeat_rate_pct', label: '复购率', align: 'right', render: (r) => `${r.repeat_rate_pct}%` },
{ key: 'task_completion_rate', label: '任务完成率', align: 'right', render: (r) => `${r.task_completion_rate}%` },
]}
@@ -457,7 +457,7 @@ function CorrelationTab({ navigate }: { navigate: (path: string) => void }) {
const costRiskScatter = costRiskRows.map((r: any) => ({
name: r.store_name,
x: Number(r.avg_daily_received || 0),
y: Number(r.over_cost_rate || 0),
y: Number(r.avg_cost_variance_pct || 0),
risk: r.risk_level,
fill: r.risk_level === '红色' ? '#ef4444' : r.risk_level === '黄色' ? '#eab308' : '#22c55e',
}))
@@ -488,7 +488,7 @@ function CorrelationTab({ navigate }: { navigate: (path: string) => void }) {
sortOptions={[
{ key: 'received', label: '实收' },
{ key: 'avg_margin', label: '毛利率' },
{ key: 'over_cost_rate', label: '超耗率' },
{ key: 'avg_cost_variance_pct', label: '成本差异率' },
]}
statusFilterKey="risk_level"
statusFilterLabel="全部风险"
@@ -503,7 +503,7 @@ function CorrelationTab({ navigate }: { navigate: (path: string) => void }) {
{ key: 'risk_level', label: '风险', align: 'center', render: (r) => r.risk_level ? <Badge type="risk" text={r.risk_level} /> : '-' },
{ key: 'received', label: '实收', align: 'right', render: (r) => formatCurrency(r.received) },
{ key: 'avg_margin', label: '毛利率', align: 'right', render: (r) => `${r.avg_margin}%` },
{ key: 'over_cost_rate', label: '超耗率', align: 'right', render: (r) => `${r.over_cost_rate}%` },
{ key: 'avg_cost_variance_pct', label: '成本差异率', align: 'right', render: (r) => `${r.avg_cost_variance_pct}%` },
{ key: 'correlation_status', label: '关联状态', align: 'center', render: (r) => (
<span className={cn('inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-medium', correlationStatusColor[r.correlation_status] || 'bg-gray-100 text-gray-700 border-gray-300')}>
{r.correlation_status}