feat: 完善审批退回流程与报销申请关联
后端优化报销单访问策略和常量定义,增强退回原因和审批状态 流转,前端完善退回对话框和审批交互组件,新增报销申请关联 模型,优化文档中心行数据和审批收件箱工具函数,增强引导 流程和会话模型,补充单元测试覆盖。
This commit is contained in:
@@ -1,23 +1,18 @@
|
||||
import { mapExpenseClaimToRequest } from '../composables/useRequests.js'
|
||||
import {
|
||||
canApproveLeaderExpenseClaims,
|
||||
canManageExpenseClaims,
|
||||
isCurrentDirectManagerForRequest,
|
||||
isCurrentRequestApplicant,
|
||||
isFinanceUser
|
||||
} from './accessControl.js'
|
||||
|
||||
export function canProcessApprovalRequest(request, currentUser) {
|
||||
const node = String(request?.workflowNode || '').trim()
|
||||
const currentName = String(currentUser?.name || '').trim()
|
||||
const applicantName = String(request?.person || request?.employeeName || '').trim()
|
||||
|
||||
if (currentName && applicantName && currentName === applicantName) {
|
||||
if (isCurrentRequestApplicant(request, currentUser)) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (canManageExpenseClaims(currentUser)) {
|
||||
return true
|
||||
}
|
||||
|
||||
if (isFinanceUser(currentUser) && node.includes('财务')) {
|
||||
return true
|
||||
}
|
||||
@@ -29,7 +24,11 @@ export function canProcessApprovalRequest(request, currentUser) {
|
||||
|| node.includes('负责人审批')
|
||||
)
|
||||
|
||||
return canApproveLeaderExpenseClaims(currentUser) && isLeaderApprovalNode
|
||||
return (
|
||||
canApproveLeaderExpenseClaims(currentUser)
|
||||
&& isLeaderApprovalNode
|
||||
&& isCurrentDirectManagerForRequest(request, currentUser)
|
||||
)
|
||||
}
|
||||
|
||||
export function listPendingApprovalRequests(claimsPayload, currentUser) {
|
||||
|
||||
Reference in New Issue
Block a user