diff --git a/frontend/src/pages/SocialInsurance.tsx b/frontend/src/pages/SocialInsurance.tsx index ecd3875..57ddc10 100644 --- a/frontend/src/pages/SocialInsurance.tsx +++ b/frontend/src/pages/SocialInsurance.tsx @@ -1096,12 +1096,16 @@ function SpecialDeductionTab({ month, setMonth }: { month: string; setMonth: (m: }, }) - // 查询所有员工列表(用于添加未录入的员工) + // 查询当月社保在保人员(只有缴纳社保的员工才需要填报专项附加扣除) const { data: employees = [] } = useQuery({ - queryKey: ['employees-for-deduction'], + queryKey: ['active-social-employees', month], queryFn: async () => { - const res = await api.get('/roster', { params: { pageSize: 999 } }) as any - return res.data?.items || res.data || [] + const res = await api.get('/social/active-declaration', { params: { month } }) as any + return (res.data?.items || []).map((item: any) => ({ + id: item.employeeId, + name: item.name, + department: item.department, + })) }, })