feat: 同步报销流程与工作台改动

This commit is contained in:
caoxiaozhu
2026-06-09 08:32:00 +00:00
parent e124e4bbcb
commit 25724c354f
64 changed files with 6518 additions and 687 deletions

View File

@@ -183,6 +183,7 @@ export function buildFallbackProgressSteps(requestModel = {}) {
const pendingPayment = approvalKey === 'pending_payment' || /待付款/.test(node)
const paid = /已付款/.test(node)
const completed = approvalKey === 'completed' || paid || /审批完成|申请完成|已完成/.test(node)
const archived = /申请归档|已归档/.test(node)
const hasRelatedApplication = Boolean(requestModel?.relatedApplication?.claimNo)
if (isApplicationDocumentRequest(requestModel)) {
@@ -207,11 +208,19 @@ export function buildFallbackProgressSteps(requestModel = {}) {
},
{
index: 3,
label: '审批完成',
time: completed ? '已完成' : '待处理',
done: completed,
active: completed,
current: false
label: '关联单据状态',
time: hasRelatedApplication ? '已关联' : completed ? '未关联' : '待处理',
done: archived,
active: completed || archived,
current: completed && !archived
},
{
index: 4,
label: '已归档',
time: archived ? '已完成' : '待处理',
done: archived,
active: archived,
current: archived
}
]
}
@@ -597,6 +606,7 @@ export function buildExpenseDraftIssues(item) {
export function buildDraftBlockingIssues(request, expenseItems) {
const issues = []
const isApplication = isApplicationDocumentRequest(request)
const locationRequired = isLocationRequiredExpenseType(request.typeCode)
const normalizedItems = Array.isArray(expenseItems) ? expenseItems : []
const itemAmountTotal = normalizedItems.reduce((sum, item) => {
@@ -611,6 +621,25 @@ export function buildDraftBlockingIssues(request, expenseItems) {
if (isPlaceholderValue(request.profileName)) {
issues.push('申请人未完善')
}
if (isApplication) {
if (isPlaceholderValue(request.typeLabel)) {
issues.push('申请类型未完善')
}
if (isPlaceholderValue(request.reason)) {
issues.push('申请事由未完善')
}
if (isPlaceholderValue(request.location)) {
issues.push('业务地点未完善')
}
if (isPlaceholderValue(request.occurredDisplay)) {
issues.push('申请时间未完善')
}
if (!Number.isFinite(Number(request.amountValue)) || Number(request.amountValue) <= 0) {
issues.push('预计总费用未完善')
}
return [...new Set(issues)]
}
if (isPlaceholderValue(request.typeLabel) && !hasValidItemType) {
issues.push('报销类型未完善')
}
@@ -657,18 +686,30 @@ export function mapIssueToAdvice(issue) {
if (text === '报销类型未完善') {
return '选择报销类型,明确本次费用归类。'
}
if (text === '申请类型未完善') {
return '补充申请类型,明确本次申请的费用或业务场景。'
}
if (text === '报销事由未完善') {
return '补充报销事由,说明本次费用用途。'
}
if (text === '申请事由未完善') {
return '补充申请事由,说明本次申请的业务背景。'
}
if (text === '业务地点未完善') {
return '补充业务地点,方便审核业务发生场景。'
}
if (text === '发生时间未完善') {
return '补充费用发生时间,确保单据时间完整。'
}
if (text === '申请时间未完善') {
return '补充申请时间或行程时间,确保申请周期完整。'
}
if (text === '报销金额未完善') {
return '补充报销金额,并与费用明细金额保持一致。'
}
if (text === '预计总费用未完善') {
return '补充预计总费用,供审批人判断预算占用和申请额度。'
}
const itemMatch = text.match(/^费用明细第\s*(\d+)\s*条(.+)$/)
if (!itemMatch) {