docs: 整理项目问题文档,修复审批列表数据混乱
- 新增 PROJECT_ISSUES.md 统一管理所有问题和解决方案 - 精简 CLAUDE.md,移除重复的问题记录部分 - 修复审批列表数据混乱问题(React 18 StrictMode + 状态管理) - 修复首次加载不显示数据问题(requestIdRef 清理时机) - 修复页码初始值错误(hasMore 默认值) - 修复后端响应序列化问题(Eloquent 模型转数组) - 添加审批人和抄送人重复校验 - 修复双 header 问题 - 调整申请页面 padding-bottom Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -103,6 +103,26 @@ class BusinessTripService
|
||||
throw new \Exception('当前状态无法提交');
|
||||
}
|
||||
|
||||
// 验证审批人和抄送人不能重复
|
||||
$approverIds = array_column($approvers, 'id');
|
||||
$ccUserIds = array_column($ccUsers, 'id');
|
||||
|
||||
// 检查审批人列表中是否有重复
|
||||
if (count($approverIds) !== count(array_unique($approverIds))) {
|
||||
throw new \Exception('审批人列表中有重复用户');
|
||||
}
|
||||
|
||||
// 检查抄送人列表中是否有重复
|
||||
if (count($ccUserIds) !== count(array_unique($ccUserIds))) {
|
||||
throw new \Exception('抄送人列表中有重复用户');
|
||||
}
|
||||
|
||||
// 检查审批人和抄送人是否有重叠
|
||||
$overlap = array_intersect($approverIds, $ccUserIds);
|
||||
if (!empty($overlap)) {
|
||||
throw new \Exception('审批人和抄送人不能是同一个人');
|
||||
}
|
||||
|
||||
// 获取审批流程(简化版:直接使用第一个审批人作为单人审批)
|
||||
$flow = ApprovalFlow::where('business_type', 'business_trip')
|
||||
->where('status', 1)
|
||||
|
||||
Reference in New Issue
Block a user