feat: 完善报销单审批流程及退回原因追踪
新增直属领导审批通过接口和审批待办列表查询,报销单退回 支持原因码分类和审批环节标记,优化票据附件去重和路径 回退查找,前端新增退回原因对话框、审批收件箱和工作台 图标组件,补充工具函数和单元测试覆盖。
This commit is contained in:
42
web/tests/reimbursementTextInference.test.mjs
Normal file
42
web/tests/reimbursementTextInference.test.mjs
Normal file
@@ -0,0 +1,42 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import test from 'node:test'
|
||||
|
||||
import {
|
||||
buildLocalExtractionProgressMessages,
|
||||
buildLocalIntentPreview,
|
||||
inferLocalFlowCandidates,
|
||||
summarizeSemanticIntentDetail
|
||||
} from '../src/utils/reimbursementTextInference.js'
|
||||
|
||||
const ridingFareMessage = '业务发生时间:2026-03-04,送客户去林萃小区办事,请报销乘车费用'
|
||||
|
||||
test('local flow intent preview names transport expense for riding fare text', () => {
|
||||
const candidates = inferLocalFlowCandidates(ridingFareMessage)
|
||||
|
||||
assert.equal(candidates.time, '2026-03-04')
|
||||
assert.equal(candidates.event, '交通出行')
|
||||
assert.equal(candidates.expenseType, '交通费')
|
||||
assert.match(buildLocalIntentPreview(ridingFareMessage), /交通费/)
|
||||
assert.ok(
|
||||
buildLocalExtractionProgressMessages(ridingFareMessage).some(
|
||||
(item) => item.includes('交通出行') && item.includes('交通费')
|
||||
)
|
||||
)
|
||||
})
|
||||
|
||||
test('semantic intent detail includes recognized expense type', () => {
|
||||
assert.equal(
|
||||
summarizeSemanticIntentDetail({
|
||||
scenario: 'expense',
|
||||
intent: 'draft',
|
||||
entities_json: [
|
||||
{
|
||||
type: 'expense_type',
|
||||
value: '交通',
|
||||
normalized_value: 'transport'
|
||||
}
|
||||
]
|
||||
}),
|
||||
'已识别为报销场景,当前目标是草稿生成,费用类型为交通费'
|
||||
)
|
||||
})
|
||||
Reference in New Issue
Block a user