feat: 发薪日期多选+提前N天提醒+电子签设置区域修复
- Schema: 去掉 payrollFrequency,新增 payrollDays (JSON数组) + payrollReminderDays (Int) - 设置页: 发薪日期改为1-28号多选按钮,新增提前提醒天数设置 - 设置页: 恢复电子签署设置区域(3个开关:规章制度/工资条/入职文件) - 工作日历: 发薪日期作为 PAYROLL_DAY 事件显示 - 工作台: 提前N天提醒发薪日期,N可配置 - TaskCenter: 新增发薪提醒分类图标 - seed文件: 更新为 payrollDays 格式
This commit is contained in:
@@ -1184,7 +1184,27 @@ export async function getMonthlyCalendar(orgId: string, month: string) {
|
||||
}
|
||||
}
|
||||
|
||||
// 7. 自定义日历事件
|
||||
// 7. 发薪日期
|
||||
const org = await prisma.organization.findUnique({
|
||||
where: { id: orgId },
|
||||
select: { payrollDays: true },
|
||||
})
|
||||
const payrollDays = Array.isArray(org?.payrollDays) ? org.payrollDays as number[] : []
|
||||
for (const day of payrollDays) {
|
||||
const dateStr = `${month}-${String(day).padStart(2, '0')}`
|
||||
const payrollDate = new Date(parseInt(year), monthNum - 1, day)
|
||||
if (payrollDate >= monthStart && payrollDate <= monthEnd) {
|
||||
events.push({
|
||||
date: dateStr,
|
||||
type: 'PAYROLL_DAY',
|
||||
title: `发薪日(每月${day}号)`,
|
||||
actionUrl: '/money',
|
||||
priority: 'medium',
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 8. 自定义日历事件
|
||||
const customEvents = await prisma.calendarEvent.findMany({
|
||||
where: {
|
||||
orgId,
|
||||
|
||||
Reference in New Issue
Block a user