feat(web): 报销单新增关联申请单门控与草稿检测流程

- 新增 travelReimbursementAssociationGateModel,查询可关联申请单/草稿报销单并生成跳过/选择/单独新建动作,区分差旅费与业务招待费类型
- travelReimbursementApplicationLinkModel 补充 buildLinkedApplicationReferenceIndex/buildRequiredApplicationActions 等关联构建逻辑
- useTravelReimbursementSuggestedActions 接入 select_required_application/skip 系列动作,'我要报销'入口改为先走关联门控
- useWorkbenchAiActionRouter 新增 SKIP_REQUIRED_APPLICATION_LINK/SKIP_REIMBURSEMENT_DRAFT_CHECK 动作分发
- useWorkbenchAiExpenseFlow 暴露 startAiReimbursementAssociationGate,stewardPlanModel 待处理流程适配
- 新增 workbench-ai-action-router、workbench-ai-reimbursement-association-gate 测试并更新 guided-flow、steward-plan 测试
This commit is contained in:
caoxiaozhu
2026-06-22 15:55:59 +08:00
parent aa965da69d
commit ba444a514f
11 changed files with 1756 additions and 25 deletions

View File

@@ -83,3 +83,44 @@ test('steward pending flow confirmation builds candidate actions', () => {
assert.equal(actions[0].payload.flow_id, 'travel_application')
assert.equal(actions[1].payload.flow_id, 'travel_reimbursement')
})
test('steward ready application confirmation routes workbench action to inline preview table', () => {
const actions = buildStewardSuggestedActions({
plan_id: 'steward-plan-ready-application',
plan_status: 'ready',
tasks: [
{
task_id: 'task-application-beijing',
task_type: 'expense_application',
title: '费用申请 2026-06-23 北京',
summary: '明天前往北京出差3天支撑客户现场实施。',
assigned_agent: 'application_assistant',
ontology_fields: {
expense_type: 'travel',
time_range: '2026-06-23 至 2026-06-25',
location: '北京',
days: '3天',
reason: '支撑客户现场实施'
},
missing_fields: ['transport_mode']
}
],
confirmation_groups: [
{
confirmation_id: 'confirm-application-beijing',
action_type: 'confirm_create_application',
target_task_id: 'task-application-beijing'
}
]
})
assert.equal(actions.length, 1)
assert.equal(actions[0].label, '确定,先创建申请单')
assert.equal(actions[0].payload.steward_confirm_flow, true)
assert.equal(actions[0].payload.flow_id, 'travel_application')
assert.equal(actions[0].payload.expense_type, 'travel')
assert.equal(actions[0].payload.expense_type_label, '差旅费')
assert.match(actions[0].payload.carry_text, /支撑客户现场实施/)
assert.match(actions[0].payload.carry_text, /北京/)
assert.match(actions[0].payload.carry_text, /2026-06-23 至 2026-06-25/)
})