feat: 同步报销流程与工作台改动

This commit is contained in:
caoxiaozhu
2026-06-09 08:32:00 +00:00
parent e124e4bbcb
commit 25724c354f
64 changed files with 6518 additions and 687 deletions

View File

@@ -71,6 +71,9 @@ test('workbench summary builds real user notifications and progress from request
assert.equal(summary.todoItems.length, 1)
assert.equal(summary.todoItems[0].target.id, 'claim-1')
assert.equal(summary.progressItems.length, 1)
assert.match(summary.progressItems[0].prompt, /单据进度/)
assert.doesNotMatch(summary.progressItems[0].prompt, /费用进度/)
assert.equal(summary.progressItems[0].applicantLabel, '张三')
assert.deepEqual(
summary.progressItems[0].steps.map((step) => step.label),
['创建单据', '待提交', '直属领导审批', '财务审批']
@@ -136,3 +139,65 @@ test('workbench progress keeps application document type for AP claims', () => {
['申请单', '申请单']
)
})
test('workbench progress includes application rows without backend progress steps', () => {
const summary = buildWorkbenchSummary(
[
{
id: 'AP-202606060001-NOSTEPS',
claimId: 'application-without-steps',
claimNo: 'AP-202606060001-NOSTEPS',
documentTypeCode: 'application',
person: currentUser.name,
title: '上海出差申请',
approvalKey: 'in_progress',
approvalStatus: '直属领导审批',
amount: 1880,
updatedAt: '2026-06-06T09:00:00+08:00'
}
],
currentUser
)
assert.equal(summary.progressItems.length, 1)
assert.equal(summary.progressItems[0].documentTypeLabel, '申请单')
assert.equal(summary.progressItems[0].applicantLabel, currentUser.name)
assert.deepEqual(
summary.progressItems[0].steps.map((step) => step.label),
['创建申请', '直属领导审批', '关联单据状态', '已归档']
)
assert.equal(summary.progressItems[0].steps[1].current, true)
})
test('workbench progress includes application documents assigned to current approver', () => {
const approverUser = {
name: '李经理',
username: 'manager@example.com',
roleCodes: ['approver']
}
const summary = buildWorkbenchSummary(
[
{
id: 'AP-202606060002-APPROVAL',
claimId: 'application-for-approver',
claimNo: 'AP-202606060002-APPROVAL',
documentTypeCode: 'application',
person: '张三',
managerName: '李经理',
title: '北京出差申请',
approvalKey: 'in_progress',
approvalStatus: '直属领导审批',
workflowNode: '直属领导审批',
amount: 2600,
updatedAt: '2026-06-06T11:00:00+08:00'
}
],
approverUser
)
assert.equal(summary.totalCount, 0)
assert.equal(summary.progressItems.length, 1)
assert.equal(summary.progressItems[0].documentTypeLabel, '申请单')
assert.equal(summary.progressItems[0].applicantLabel, '张三')
assert.equal(summary.progressItems[0].requestId, 'AP-202606060002-APPROVAL')
})