feat: Sprint 2 — Stepper/InlineAlert组件 + 首页TaskCenter任务中心 + /workspace/next-actions API + Money.tsx BatchDetail集成工作流步骤条和质量门禁
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user