feat: 20260805 系统优化 - 身份证复制fallback/薪税日期筛选/社保版本修复/证据链导出/违纪证明/医疗期政策/绩效类型评级/合同作废/帮助更新
This commit is contained in:
@@ -101,6 +101,8 @@ export function BatchManager() {
|
||||
const [month, setMonth] = useState(new Date().toISOString().slice(0, 7))
|
||||
const [monthFrom, setMonthFrom] = useState('')
|
||||
const [monthTo, setMonthTo] = useState('')
|
||||
const [dateFrom, setDateFrom] = useState('')
|
||||
const [dateTo, setDateTo] = useState('')
|
||||
const [filterStatus, setFilterStatus] = useState<string>('')
|
||||
const [filterType, setFilterType] = useState<string>('')
|
||||
const [selectedBatchId, setSelectedBatchId] = useState<string | null>(null)
|
||||
@@ -120,12 +122,14 @@ export function BatchManager() {
|
||||
})
|
||||
|
||||
const { data: batches, isLoading } = useQuery<any[]>({
|
||||
queryKey: ['batches', month, monthFrom, monthTo, filterStatus, filterType],
|
||||
queryKey: ['batches', month, monthFrom, monthTo, dateFrom, dateTo, filterStatus, filterType],
|
||||
queryFn: async () => {
|
||||
const params: any = {}
|
||||
if (month && !monthFrom && !monthTo) params.month = month
|
||||
if (month && !monthFrom && !monthTo && !dateFrom && !dateTo) params.month = month
|
||||
if (monthFrom) params.monthFrom = monthFrom
|
||||
if (monthTo) params.monthTo = monthTo
|
||||
if (dateFrom) params.dateFrom = dateFrom
|
||||
if (dateTo) params.dateTo = dateTo
|
||||
if (filterStatus) params.status = filterStatus
|
||||
if (filterType) params.type = filterType
|
||||
return await payrollApi.batches(params)
|
||||
@@ -215,9 +219,15 @@ export function BatchManager() {
|
||||
<span className="text-xs text-gray-500">至</span>
|
||||
<Input type="month" value={monthTo} onChange={(e) => { setMonthTo(e.target.value); setMonth('') }} className="!w-36" />
|
||||
</div>
|
||||
{!monthFrom && !monthTo && (
|
||||
{!monthFrom && !monthTo && !dateFrom && !dateTo && (
|
||||
<Input type="month" value={month} onChange={(e) => setMonth(e.target.value)} className="!w-36 shrink-0" placeholder="单月" />
|
||||
)}
|
||||
<div className="flex items-center gap-1 shrink-0">
|
||||
<span className="text-xs text-gray-500">创建日期</span>
|
||||
<Input type="date" value={dateFrom} onChange={(e) => { setDateFrom(e.target.value); setMonth('') }} className="!w-36" placeholder="起始" />
|
||||
<span className="text-xs text-gray-500">~</span>
|
||||
<Input type="date" value={dateTo} onChange={(e) => { setDateTo(e.target.value); setMonth('') }} className="!w-36" placeholder="截止" />
|
||||
</div>
|
||||
<Select value={filterStatus} onChange={(e) => setFilterStatus(e.target.value)} className="!w-28 shrink-0">
|
||||
<option value="">全部状态</option>
|
||||
<option value="DRAFT">草稿</option>
|
||||
@@ -230,8 +240,8 @@ export function BatchManager() {
|
||||
<option value="BONUS">年终奖</option>
|
||||
<option value="SEVERANCE">补偿金</option>
|
||||
</Select>
|
||||
{(monthFrom || monthTo || filterStatus || filterType) && (
|
||||
<button onClick={() => { setMonthFrom(''); setMonthTo(''); setFilterStatus(''); setFilterType(''); setMonth(new Date().toISOString().slice(0, 7)) }} className="text-xs text-gray-500 hover:text-primary shrink-0">
|
||||
{(monthFrom || monthTo || dateFrom || dateTo || filterStatus || filterType) && (
|
||||
<button onClick={() => { setMonthFrom(''); setMonthTo(''); setDateFrom(''); setDateTo(''); setFilterStatus(''); setFilterType(''); setMonth(new Date().toISOString().slice(0, 7)) }} className="text-xs text-gray-500 hover:text-primary shrink-0">
|
||||
清除筛选
|
||||
</button>
|
||||
)}
|
||||
@@ -327,6 +337,7 @@ export function BatchManager() {
|
||||
<th className="py-2 px-3 text-right">公积金合计</th>
|
||||
<th className="py-2 px-3 text-right">个税合计</th>
|
||||
<th className="py-2 px-3 text-right">实发合计</th>
|
||||
<th className="py-2 px-3">创建时间</th>
|
||||
<th className="py-2 px-3">状态</th>
|
||||
<th className="py-2 px-3 text-right">操作</th>
|
||||
</tr>
|
||||
@@ -376,6 +387,7 @@ export function BatchManager() {
|
||||
<td className="py-2.5 px-3 text-right text-sm text-cyan-600">¥{fmt((batch.totalHousingOrg || 0) + (batch.totalHousingEmp || 0))}</td>
|
||||
<td className="py-2.5 px-3 text-right text-sm text-danger">¥{fmt(batch.totalTax)}</td>
|
||||
<td className="py-2.5 px-3 text-right text-sm font-bold text-safe">¥{fmt(batch.totalNetPay)}</td>
|
||||
<td className="py-2.5 px-3 text-xs text-gray-500">{batch.createdAt ? new Date(batch.createdAt).toLocaleString('zh-CN', { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit' }) : '-'}</td>
|
||||
<td className="py-2.5 px-3">
|
||||
{batch.status === 'ARCHIVED' ? (
|
||||
<span className="inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs bg-green-50 text-safe">
|
||||
|
||||
Reference in New Issue
Block a user