feat: 报销审批流重构与管家计划全链路贯通

- 重构报销状态注册表、审批流路由与平台风险标记
- 完善管家意图规划器与模型计划构建器全链路
- 新增 OCR Worker 脚本、数据库会话管理与通知状态
- 优化文档中心、日志视图、预算中心与员工管理交互
- 增强工作台摘要、图标资源与全局主题样式
- 补充审批路由、状态注册、OCR 服务与管家规划器测试覆盖
This commit is contained in:
caoxiaozhu
2026-06-06 17:19:07 +08:00
parent f60cebadb8
commit e124e4bbcb
162 changed files with 9161 additions and 1941 deletions

View File

@@ -1,3 +1,5 @@
import { isApplicationRequestLike } from './documentClassification.js'
function parseNumber(value) {
const nextValue = Number(value)
return Number.isFinite(nextValue) ? nextValue : 0
@@ -139,6 +141,23 @@ function resolveStatusTone(approvalKey) {
return 'muted'
}
function resolveDocumentTypeLabel(request, requestId, title) {
const explicitLabel = normalizeText(request?.documentTypeLabel || request?.document_type_label)
const normalizedRequestId = normalizeText(requestId).toUpperCase()
if (
isApplicationRequestLike(request)
|| explicitLabel.includes('申请')
|| title.includes('申请')
|| normalizedRequestId.startsWith('SQ')
|| normalizedRequestId.startsWith('CL')
) {
return '申请单'
}
return explicitLabel || '报销单'
}
function resolveTodoAction(request) {
const approvalKey = normalizeText(request?.approvalKey)
const status = normalizeText(request?.status || request?.approvalStatus)
@@ -245,8 +264,7 @@ function buildProgressItems(ownedRequests) {
const title = normalizeText(request?.title || request?.note || request?.sceneLabel) || '费用单据'
const status = normalizeText(request?.approvalStatus || currentStep?.label) || '处理中'
const isApplication = title.includes('申请') || (requestId || '').toUpperCase().startsWith('SQ') || (requestId || '').toUpperCase().startsWith('CL')
const documentTypeLabel = isApplication ? '申请单' : '报销单'
const documentTypeLabel = resolveDocumentTypeLabel(request, requestId, title)
return {
id: requestId,