|
0 && selectedIds.size === employees.length} onChange={toggleSelectAll} />
|
姓名 |
- 身份证号 |
- 部门 |
- 状态 |
- 入职日期 |
+ {colVisible('department') && 部门 | }
+ {colVisible('status') && 状态 | }
+ {colVisible('hireDate') && 入职日期 | }
离职日期 |
- 月薪 |
- 合同类型 |
- 合同状态 |
- 合同到期 |
- 违纪 |
- 考勤 |
- 培训 |
- 绩效 |
- 工资条 |
+ {colVisible('position') && 职务 | }
+ {colVisible('phone') && 手机号 | }
+ {colVisible('gender') && 性别 | }
+ {colVisible('contractType') && 合同类型 | }
+ {colVisible('contractStatus') && 合同状态 | }
+ {colVisible('contractExpiry') && 合同到期 | }
+ {colVisible('socialStatus') && 社保状态 | }
+ {colVisible('records') && 记录 | }
操作 |
@@ -462,10 +517,17 @@ export default function Roster() {
ev.stopPropagation()}>
toggleSelect(e.id)} />
|
- {e.name} |
- {e.idCardMasked || '—'} |
- {e.department} |
-
+ |
+ {e.name}
+ {
+ ev.stopPropagation()
+ if (e.idCardNumber) {
+ navigator.clipboard.writeText(e.idCardNumber).then(() => toast.success('已复制身份证号')).catch(() => toast.error('复制失败'))
+ }
+ }}>{e.idCardMasked || '—'}
+ |
+ {colVisible('department') && {e.department} | }
+ {colVisible('status') &&
)}
- |
- {e.hireDate?.toString().slice(0, 10)} |
+ }
+ {colVisible('hireDate') && {e.hireDate?.toString().slice(0, 10)} | }
{e.hasTermination && e.latestTerminationDate && e.latestTerminationStatus !== 'CANCELLED' && e.latestTerminationStatus !== 'COMPLETED' ? (
@@ -494,8 +556,10 @@ export default function Roster() {
—
)}
|
- ¥{fmt(e.monthlySalary)} |
-
+ {colVisible('position') && | {e.position || '—'} | }
+ {colVisible('phone') && {e.phone || '—'} | }
+ {colVisible('gender') && {e.gender || '—'} | }
+ {colVisible('contractType') &&
{(() => {
const typeConfig: Record = {
FIXED: { label: '劳动合同-固定期', style: 'bg-blue-50 text-blue-700 border border-blue-200' },
@@ -511,8 +575,8 @@ export default function Roster() {
const cfg = typeConfig[ct] || typeConfig.UNSIGNED
return {cfg.label}
})()}
- |
-
+ | }
+ {colVisible('contractStatus') &&
{(() => {
const tagStyles: Record = {
expired: 'bg-red-50 text-danger',
@@ -536,8 +600,8 @@ export default function Roster() {
const text = statusTextMap[e.contractStatus] || '无合同'
return {text}
})()}
- |
-
+ | }
+ {colVisible('contractExpiry') &&
{(() => {
const endDate = e.latestContract?.endDate
if (!endDate) {
@@ -556,16 +620,42 @@ export default function Roster() {
if (diffDays <= 90) return {dateStr} ({diffDays}天)
return {dateStr}
})()}
- |
-
- {e.counts?.disciplinaryRecords ? (
- {e.counts.disciplinaryRecords}
- ) : 0}
- |
- {e.counts?.attendanceRecords || 0} |
- {e.counts?.trainingRecords || 0} |
- {e.counts?.performanceRecords || 0} |
- {e.counts?.payslips || 0} |
+ }
+ {colVisible('socialStatus') &&
+ {(() => {
+ const status = e.socialInsuranceStatus
+ if (!status) return —
+ const cfg: Record = {
+ ACTIVE: { label: '在保', style: 'bg-green-50 text-safe' },
+ SUSPENDED: { label: '停保', style: 'bg-amber-50 text-amber-600' },
+ UNINSURED: { label: '未参保', style: 'bg-red-50 text-danger' },
+ PENDING: { label: '待办理', style: 'bg-blue-50 text-blue-600' },
+ }
+ const c = cfg[status] || { label: status, style: 'bg-gray-100 text-gray-500' }
+ return {c.label}
+ })()}
+ | }
+ {colVisible('records') &&
+
+ {(() => {
+ const items = [
+ { label: '违纪', count: e.counts?.disciplinaryRecords || 0, danger: true },
+ { label: '考勤', count: e.counts?.attendanceRecords || 0 },
+ { label: '培训', count: e.counts?.trainingRecords || 0 },
+ { label: '绩效', count: e.counts?.performanceRecords || 0 },
+ { label: '工资条', count: e.counts?.payslips || 0 },
+ ]
+ return items.map((it, i) => (
+ 0 ? (it.danger ? 'bg-red-50 text-danger' : 'bg-gray-100 text-gray-600') : 'text-gray-300'}`}
+ >
+ {it.label}{it.count}
+
+ ))
+ })()}
+
+ | }
{e.status === 'ACTIVE' && (!e.hasTermination || e.latestTerminationStatus === 'CANCELLED' || e.latestTerminationStatus === 'COMPLETED') && (
@@ -589,7 +679,7 @@ export default function Roster() {
className="rounded-md p-1.5 text-gray-500 transition hover:bg-primary/10 hover:text-primary"
onClick={(ev) => {
ev.stopPropagation()
- window.location.hash = '#/money'
+ navigate('/money')
}}
>
@@ -667,6 +757,15 @@ export default function Roster() {
|
+