feat: 新增归档中心页面并完善知识库与报销查询能力
新增前端归档中心视图及相关工具函数,扩充知识库文档分类和 提取器支持多种格式,增强编排器报销查询的多维度检索,优 化本体规则和用户代理审核消息,前端完善报销创建和审批详 情交互细节,补充单元测试覆盖。
This commit is contained in:
@@ -41,6 +41,7 @@ test('progress steps show approval operator time and current stay duration', ()
|
||||
const aiStep = request.progressSteps.find((step) => step.label === 'AI预审')
|
||||
const firstStep = request.progressSteps[0]
|
||||
|
||||
assert.equal(request.riskSummary, '无')
|
||||
assert.equal(firstStep.label, '创建单据')
|
||||
assert.equal(leaderStep.time, '李经理通过')
|
||||
assert.match(leaderStep.detail, /2026-05-20/)
|
||||
@@ -159,10 +160,57 @@ test('travel expense items describe departure return and lodging time below the
|
||||
assert.equal(request.expenseItems.find((item) => item.id === 'outbound-train')?.dayLabel, '出发时间')
|
||||
assert.equal(request.expenseItems.find((item) => item.id === 'return-train')?.dayLabel, '返回时间')
|
||||
assert.equal(request.expenseItems.find((item) => item.id === 'hotel')?.dayLabel, '住宿时间')
|
||||
assert.equal(request.expenseItems.find((item) => item.id === 'outbound-train')?.detail, '起始地-目的地')
|
||||
assert.equal(request.expenseItems.find((item) => item.id === 'return-train')?.detail, '起始地-目的地')
|
||||
assert.equal(request.expenseItems.find((item) => item.id === 'hotel')?.detail, '目的地酒店')
|
||||
assert.equal(request.expenseItems.at(-1)?.id, 'allowance')
|
||||
assert.equal(request.expenseItems.at(-1)?.dayLabel, '系统自动计算')
|
||||
})
|
||||
|
||||
test('ticket description helper does not show the destination city as detail text', () => {
|
||||
const request = mapExpenseClaimToRequest({
|
||||
id: 'claim-ticket-detail-helper',
|
||||
claim_no: 'EXP-202605-ROUTE',
|
||||
employee_name: '张三',
|
||||
department_name: '市场部',
|
||||
expense_type: 'travel',
|
||||
reason: '上海项目出差',
|
||||
location: '上海',
|
||||
amount: 520,
|
||||
invoice_count: 2,
|
||||
occurred_at: '2026-05-13T01:00:00.000Z',
|
||||
created_at: '2026-05-13T01:30:00.000Z',
|
||||
updated_at: '2026-05-13T03:30:00.000Z',
|
||||
status: 'draft',
|
||||
approval_stage: '待提交',
|
||||
risk_flags_json: [],
|
||||
items: [
|
||||
{
|
||||
id: 'flight',
|
||||
item_type: 'flight_ticket',
|
||||
item_reason: '广州白云-上海虹桥',
|
||||
item_location: '上海',
|
||||
item_date: '2026-05-13',
|
||||
item_amount: 320,
|
||||
invoice_id: 'flight.png'
|
||||
},
|
||||
{
|
||||
id: 'ship',
|
||||
item_type: 'ship_ticket',
|
||||
item_reason: '上海港-舟山港',
|
||||
item_location: '舟山',
|
||||
item_date: '2026-05-14',
|
||||
item_amount: 200,
|
||||
invoice_id: 'ship.png'
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
assert.equal(request.expenseItems.find((item) => item.id === 'flight')?.detail, '起始地-目的地')
|
||||
assert.equal(request.expenseItems.find((item) => item.id === 'ship')?.detail, '起始地-目的地')
|
||||
assert.equal(request.expenseItems.find((item) => item.id === 'ship')?.name, '轮船票')
|
||||
})
|
||||
|
||||
test('completed finance approval marks finance and archive progress steps', () => {
|
||||
const request = mapExpenseClaimToRequest({
|
||||
id: 'claim-finance-completed',
|
||||
@@ -202,6 +250,7 @@ test('completed finance approval marks finance and archive progress steps', () =
|
||||
const financeStep = request.progressSteps.find((step) => step.label === '财务审批')
|
||||
const archiveStep = request.progressSteps.find((step) => step.label === '归档入账')
|
||||
|
||||
assert.equal(request.riskSummary, '无')
|
||||
assert.equal(request.workflowNode, '归档入账')
|
||||
assert.equal(financeStep.time, '财务复核通过')
|
||||
assert.match(financeStep.detail, /2026-05-20/)
|
||||
|
||||
Reference in New Issue
Block a user