diff --git a/web/src/pages/Dashboard.tsx b/web/src/pages/Dashboard.tsx index e10d51a..8dd4124 100644 --- a/web/src/pages/Dashboard.tsx +++ b/web/src/pages/Dashboard.tsx @@ -170,8 +170,8 @@ export function Dashboard(): JSX.Element { } else { setDrafts([]); } - // 审批人指派(风控/管理层待办软过滤用)。 - if (role === '风控' || role === '管理层') { + // 审批人指派:风控/管理层用于待办过滤;销售用于查看自己项目的审批进度。 + if (role === '风控' || role === '管理层' || role === '商务/销售') { fetchAssignments().then(setAssignments).catch(() => setAssignments({})); } else { setAssignments({}); @@ -323,6 +323,34 @@ export function Dashboard(): JSX.Element { const todoCount = summary.byStatus[TODO_STATUS[role] ?? ''] ?? 0; const isSales = role === '商务/销售'; + + // 销售首页:为自己的项目显示审批进度(阶段 + 当前审批人)。 + const approvalProgressCol: TableColumn = { + key: 'progress', + header: '审批进度', + render: (r) => { + const a = assignments[r.id]; + const stage = (() => { + switch (r.status) { + case 'draft': return { text: '待申报(草稿)', sub: '尚未报送,点「查看」进入后申报', color: '#64748B' }; + case 'pending_risk_review': return { text: '风控审核中', sub: a?.riskReviewerName ? `审批人:${a.riskReviewerName}` : '待分配风控', color: '#B45309' }; + case 'risk_reviewed': + case 'pending_management_approval': return { text: '管理层审批中', sub: a?.managerName ? `审批人:${a.managerName}` : '待分配管理层', color: '#4F46E5' }; + case 'approved': return { text: '已通过 ✓', sub: '审批完成', color: '#15803D' }; + case 'rejected': return { text: '已驳回', sub: '请修改后重新提交', color: '#BE123C' }; + case 'abandoned': return { text: '已放弃', sub: '流程终止', color: '#475569' }; + default: return { text: r.status, sub: '', color: colorVar('color.text.secondary') }; + } + })(); + return ( +
+ {stage.text} + {stage.sub && {stage.sub}} +
+ ); + }, + }; + const historyColumns = isSales ? [...columns.slice(0, -1), approvalProgressCol, columns[columns.length - 1]!] : columns; const summaryItems = [ { label: isSales ? '我的评估' : '全部评估', value: summary.total, tone: colorVar('color.brand.primary') }, { label: isSales ? '被驳回(待处理)' : '我的待办', value: todoCount, tone: colorVar('color.risk.high') }, @@ -599,7 +627,7 @@ export function Dashboard(): JSX.Element { - 评估历史 + {isSales ? '我的申报 · 审批进度' : '评估历史'} 服务端分页 · 共 {total} 条 @@ -690,7 +718,7 @@ export function Dashboard(): JSX.Element { ) : ( <> row.id} caption="全部评估记录列表"