feat: 财务看板口径重构与半年模拟数据及报销状态注册表
- 重构 finance_dashboard 口径计算,新增模拟公司画像数据生成与筛选 - 引入 expense_claim_status_registry 统一报销状态流转 - 完善报销草稿流程、Item Sync 与本体解析器 - 优化总览页趋势图、分页组件与请求进度步骤 - 增强报销申请快速预览、本体工具与详情展示 - 新增半年报销模拟数据种子脚本与状态审计工具 - 补充财务看板、报销状态注册与模拟数据测试覆盖
This commit is contained in:
@@ -99,6 +99,19 @@ export function resolveExpenseTypeCode(ontology) {
|
||||
return String(entity?.normalized_value || entity?.value || 'other').trim() || 'other'
|
||||
}
|
||||
|
||||
function looksLikeStructuredTravelApplication(prompt) {
|
||||
const text = String(prompt || '')
|
||||
return /(?:发生时间|业务发生时间|申请时间|时间)\s*[::]/.test(text)
|
||||
&& /(?:地点|业务地点|发生地点|目的地)\s*[::]/.test(text)
|
||||
&& /(?:天数|出差天数|申请天数)\s*[::]?\s*(?:\d+|[一二两三四五六七八九十]{1,3})\s*天/.test(text)
|
||||
}
|
||||
|
||||
function resolveApplicationExpenseTypeCode(ontology, prompt) {
|
||||
const code = resolveExpenseTypeCode(ontology)
|
||||
if (code !== 'other') return code
|
||||
return looksLikeStructuredTravelApplication(prompt) ? 'travel' : code
|
||||
}
|
||||
|
||||
export function resolveExpenseTypeLabel(code) {
|
||||
return EXPENSE_TYPE_LABELS[String(code || '').trim()] || EXPENSE_TYPE_LABELS.other
|
||||
}
|
||||
@@ -358,7 +371,7 @@ export function resolveAttachmentPolicy(expenseTypeCode, amount = 0) {
|
||||
}
|
||||
|
||||
export function buildApplicationFieldsFromOntology(ontology, prompt, currentUser = {}) {
|
||||
const expenseTypeCode = resolveExpenseTypeCode(ontology)
|
||||
const expenseTypeCode = resolveApplicationExpenseTypeCode(ontology, prompt)
|
||||
const amount = resolveApplicationAmount(ontology)
|
||||
const documentTypeEntity = resolveEntity(ontology, 'document_type')
|
||||
const workflowStageEntity = resolveEntity(ontology, 'workflow_stage')
|
||||
|
||||
Reference in New Issue
Block a user