feat: Sprint 2 — Stepper/InlineAlert组件 + 首页TaskCenter任务中心 + /workspace/next-actions API + Money.tsx BatchDetail集成工作流步骤条和质量门禁

This commit is contained in:
selfrelease
2026-07-31 17:52:02 +08:00
parent c181d3fa45
commit 55b6867c9c
6 changed files with 484 additions and 0 deletions
+35
View File
@@ -4,6 +4,8 @@ import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
import { useConfirm } from '../hooks/useConfirm'
import * as XLSX from 'xlsx'
import { Calculator, AlertCircle, Info, Check, Upload, Layers, Settings as SettingsIcon, Archive, Plus, Trash2, AlertTriangle, Download, FileText, X, ChevronLeft, Wallet, LayoutTemplate, Clock, Receipt, Users, TrendingDown, TrendingUp, BadgeCheck } from 'lucide-react'
import { Stepper, type Step } from '../components/ui/Stepper'
import { InlineAlert } from '../components/ui/InlineAlert'
import api from '../lib/api'
import { useAuthStore } from '../store/authStore'
import Card from '../components/ui/Card'
@@ -934,6 +936,39 @@ function BatchDetail({ batchId, onBack }: { batchId: string; onBack: () => void
)}
</div>
{/* 发薪工作流步骤条 */}
<Card className="p-4">
<Stepper
steps={[
{ key: 'edit', title: '编辑薪资', description: '填写/导入工资数据', status: isArchived ? 'complete' : 'current' },
{ key: 'review', title: '核对汇总', description: '检查应发/个税/实发', status: isArchived ? 'complete' : 'pending' },
{ key: 'archive', title: '归档锁定', description: '归档后不可编辑', status: isArchived ? 'complete' : 'pending' },
{ key: 'publish', title: '发布工资条', description: '员工端可见', status: batch.payslipPublished ? 'complete' : 'pending' },
] as Step[]}
/>
</Card>
{/* 质量门禁 — 草稿状态下检查异常 */}
{!isArchived && batch.entries.length > 0 && (
<>
{batch.entries.some((e: any) => e.totalPay > 0 && e.netPay <= 0) && (
<InlineAlert type="error" title="存在实发为负的员工">
/ 0
</InlineAlert>
)}
{batch.entries.some((e: any) => e.baseSalary === 0 && e.bonus === 0 && e.totalPay === 0) && (
<InlineAlert type="warning" title="存在全零记录">
0
</InlineAlert>
)}
{batch.entries.some((e: any) => e.riskWarnings && e.riskWarnings.length > 0) && (
<InlineAlert type="warning" title="存在风险预警">
/
</InlineAlert>
)}
</>
)}
{/* 批次汇总 */}
<div className="grid grid-cols-2 md:grid-cols-4 gap-3">
<Card className="flex items-center gap-3">