feat: 新增归档中心页面并完善知识库与报销查询能力
新增前端归档中心视图及相关工具函数,扩充知识库文档分类和 提取器支持多种格式,增强编排器报销查询的多维度检索,优 化本体规则和用户代理审核消息,前端完善报销创建和审批详 情交互细节,补充单元测试覆盖。
This commit is contained in:
100
web/tests/app-shell-detail-alerts.test.mjs
Normal file
100
web/tests/app-shell-detail-alerts.test.mjs
Normal file
@@ -0,0 +1,100 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import test from 'node:test'
|
||||
|
||||
import {
|
||||
buildDetailAlerts,
|
||||
hasMissingAttachment,
|
||||
hasPendingInfo
|
||||
} from '../src/utils/detailAlerts.js'
|
||||
|
||||
test('detail topbar ignores system allowance rows when checking missing tickets', () => {
|
||||
const request = {
|
||||
node: '直属领导审批',
|
||||
approvalKey: 'in_progress',
|
||||
typeCode: 'travel',
|
||||
typeLabel: '差旅费',
|
||||
reason: '上海项目出差',
|
||||
location: '上海',
|
||||
city: '上海',
|
||||
occurredDisplay: '2026-05-13 至 2026-05-15',
|
||||
amountValue: 1008,
|
||||
profilePosition: '待补充',
|
||||
profileGrade: '待补充',
|
||||
profileManager: '待补充',
|
||||
expenseItems: [
|
||||
{
|
||||
id: 'outbound-train',
|
||||
itemType: 'train_ticket',
|
||||
itemReason: '广州南-上海虹桥',
|
||||
itemLocation: '上海',
|
||||
itemDate: '2026-05-13',
|
||||
itemAmount: 354,
|
||||
invoiceId: 'outbound.png'
|
||||
},
|
||||
{
|
||||
id: 'hotel',
|
||||
itemType: 'hotel_ticket',
|
||||
itemReason: '上海中心酒店',
|
||||
itemLocation: '上海',
|
||||
itemDate: '2026-05-14',
|
||||
itemAmount: 354,
|
||||
invoiceId: 'hotel.png'
|
||||
},
|
||||
{
|
||||
id: 'allowance',
|
||||
itemType: 'travel_allowance',
|
||||
itemReason: '系统自动计算出差补贴',
|
||||
itemLocation: '上海',
|
||||
itemDate: '2026-05-15',
|
||||
itemAmount: 300,
|
||||
invoiceId: '',
|
||||
isSystemGenerated: true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
const alerts = buildDetailAlerts(request).map((item) => item.label)
|
||||
|
||||
assert.equal(hasMissingAttachment(request), false)
|
||||
assert.equal(hasPendingInfo(request), false)
|
||||
assert.deepEqual(alerts, ['直属领导审批'])
|
||||
})
|
||||
|
||||
test('detail topbar still flags real manual rows without required ticket info', () => {
|
||||
const request = {
|
||||
node: '待提交',
|
||||
approvalKey: 'draft',
|
||||
typeCode: 'travel',
|
||||
typeLabel: '差旅费',
|
||||
reason: '待补充',
|
||||
location: '待补充',
|
||||
city: '待补充',
|
||||
occurredDisplay: '待补充',
|
||||
amountValue: 0,
|
||||
expenseItems: [
|
||||
{
|
||||
id: 'manual-train',
|
||||
itemType: 'train_ticket',
|
||||
itemReason: '',
|
||||
itemLocation: '',
|
||||
itemDate: '',
|
||||
itemAmount: 0,
|
||||
invoiceId: ''
|
||||
},
|
||||
{
|
||||
id: 'allowance',
|
||||
itemType: 'travel_allowance',
|
||||
itemReason: '系统自动计算出差补贴',
|
||||
itemAmount: 300,
|
||||
invoiceId: '',
|
||||
isSystemGenerated: true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
const alerts = buildDetailAlerts(request).map((item) => item.label)
|
||||
|
||||
assert.equal(hasMissingAttachment(request), true)
|
||||
assert.equal(hasPendingInfo(request), true)
|
||||
assert.deepEqual(alerts, ['待提交', '缺少票据', '待补信息'])
|
||||
})
|
||||
Reference in New Issue
Block a user