feat(web): 差旅领导意见事件结构化与申请审批信息增强
- applicationApproval 新增按日期/时间/审批角色拆分格式化,buildLeaderApprovalEvents 补充 dateLabel/timeLabel/roleLabel 字段 - TravelRequestDetailView 领导意见事件改为日期+时间+审批人结构化展示,travel-request-detail-view.css 重构对应样式 - travelReimbursementAttachmentModel 微调附件标识,同步更新 application-approval-info、travel-request-detail-leader-approval、attachment-association-confirmation 测试 - 更新公司通信费报销规则表
This commit is contained in:
@@ -37,6 +37,42 @@ function formatDateTime(value) {
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}`
|
||||
}
|
||||
|
||||
function formatDateLabel(value) {
|
||||
const date = toDate(value)
|
||||
if (!date) {
|
||||
return ''
|
||||
}
|
||||
const year = date.getFullYear()
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(date.getDate()).padStart(2, '0')
|
||||
return `${year}-${month}-${day}`
|
||||
}
|
||||
|
||||
function formatTimeLabel(value) {
|
||||
const date = toDate(value)
|
||||
if (!date) {
|
||||
return ''
|
||||
}
|
||||
const hours = String(date.getHours()).padStart(2, '0')
|
||||
const minutes = String(date.getMinutes()).padStart(2, '0')
|
||||
return `${hours}:${minutes}`
|
||||
}
|
||||
|
||||
function resolveApprovalRole(event, returned) {
|
||||
return resolveDisplayName(
|
||||
event?.operator_position,
|
||||
event?.operatorPosition,
|
||||
event?.operator_title,
|
||||
event?.operatorTitle,
|
||||
event?.approver_position,
|
||||
event?.approverPosition,
|
||||
event?.approval_role,
|
||||
event?.approvalRole,
|
||||
event?.previous_approval_stage,
|
||||
event?.previousApprovalStage
|
||||
) || (returned ? '直属领导审批节点' : '直属领导')
|
||||
}
|
||||
|
||||
function getRiskFlags(request) {
|
||||
const flags = request?.riskFlags || request?.risk_flags_json || []
|
||||
return Array.isArray(flags) ? flags : []
|
||||
@@ -102,6 +138,8 @@ export function buildLeaderApprovalEvents(request) {
|
||||
request?.managerName
|
||||
) || '直属领导'
|
||||
const time = formatDateTime(rawTime)
|
||||
const dateLabel = formatDateLabel(rawTime) || '待记录'
|
||||
const timeLabel = formatTimeLabel(rawTime)
|
||||
const opinion = normalizeText(event.opinion)
|
||||
|| normalizeText(event.leader_opinion || event.leaderOpinion)
|
||||
|| normalizeText(event.reason)
|
||||
@@ -115,7 +153,10 @@ export function buildLeaderApprovalEvents(request) {
|
||||
tone: returned ? 'danger' : 'success',
|
||||
title: returned ? '领导退回' : '领导审批通过',
|
||||
operator,
|
||||
role: resolveApprovalRole(event, returned),
|
||||
time,
|
||||
dateLabel,
|
||||
timeLabel,
|
||||
sortAt: rawTime,
|
||||
opinion,
|
||||
returnCount,
|
||||
|
||||
Reference in New Issue
Block a user