fix: 线下签署登记标题英文转中文+完成时间时区+签署记录角标
1. documentTitle 中 contractType 枚举值转中文
(LABOR→劳务协议、FIXED→固定期限劳动合同等)
2. 签署日期解析改为本地时区构造(new Date(y,m-1,d,12)),
避免 new Date('2026-08-16') 被解析为 UTC 00:00 导致
本地 +8 显示为 08:00:00
3. 签署记录 Tab 增加数字角标显示总记录数
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
@@ -3,7 +3,7 @@ import { usePageSize } from '../../hooks/usePageSize'
|
||||
import { toast } from 'sonner'
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
|
||||
import { useConfirm } from '../../hooks/useConfirm'
|
||||
import { Calculator, AlertCircle, Info, Upload, Layers, Settings as SettingsIcon, Archive, Plus, Trash2, AlertTriangle, Download, FileText, X, ChevronLeft, Clock, Users, TrendingDown, TrendingUp, BadgeCheck } from 'lucide-react'
|
||||
import { Calculator, AlertCircle, Info, Upload, Layers, Settings as SettingsIcon, Archive, Plus, Trash2, AlertTriangle, Download, FileText, X, ChevronLeft, Clock, Users, TrendingDown, TrendingUp, BadgeCheck, DollarSign } from 'lucide-react'
|
||||
import { Stepper, type Step } from '../../components/ui/Stepper'
|
||||
import { InlineAlert } from '../../components/ui/InlineAlert'
|
||||
import PageGuide from '../../components/ui/PageGuide'
|
||||
@@ -556,6 +556,22 @@ function BatchDetail({ batchId, onBack }: { batchId: string; onBack: () => void
|
||||
},
|
||||
})
|
||||
|
||||
const fetchBonusMutation = useMutation({
|
||||
mutationFn: () => payrollApi.fetchBonusToBatch(batchId),
|
||||
onSuccess: (res: any) => {
|
||||
queryClient.invalidateQueries({ queryKey: ['batch-detail'] })
|
||||
queryClient.invalidateQueries({ queryKey: ['batches'] })
|
||||
if (res.data?.filled > 0) {
|
||||
toast.success(res.data.message)
|
||||
} else {
|
||||
toast.info(res.data?.message || '无提成奖金数据')
|
||||
}
|
||||
},
|
||||
onError: () => {
|
||||
toast.error('获取提成奖金失败')
|
||||
},
|
||||
})
|
||||
|
||||
const importPayrollMutation = useMutation({
|
||||
mutationFn: async (file: File) => {
|
||||
const token = useAuthStore.getState().accessToken
|
||||
@@ -774,6 +790,16 @@ function BatchDetail({ batchId, onBack }: { batchId: string; onBack: () => void
|
||||
<Calculator className="w-4 h-4 mr-1" />
|
||||
{importOvertimeMutation.isPending ? '导入中...' : '导入加班费'}
|
||||
</Button>
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="sm"
|
||||
onClick={() => fetchBonusMutation.mutate()}
|
||||
disabled={fetchBonusMutation.isPending || isArchived}
|
||||
title="从提成奖金模块按月拉取填充奖金字段"
|
||||
>
|
||||
<DollarSign className="w-4 h-4 mr-1" />
|
||||
{fetchBonusMutation.isPending ? '获取中...' : '获取提成奖金'}
|
||||
</Button>
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={async () => {
|
||||
|
||||
Reference in New Issue
Block a user