feat: 扩展风险规则体系、审批动态路由与预算中心列表化改造
- 新增 25+ 条风险规则(预算/报销/申请/通用类),完善风险规则模拟与反馈发布机制 - 引入费用审批动态路由、平台风险分级、预审与风险阶段管理 - 预算中心列表化改造,优化票据夹仪表盘与数字员工工作看板 - 新增 Hermes 风险线索收集器、Agent 链路追踪中心 - 扩展数字员工能力库(18 个领域 Skill)与交通费用自动预估 - 完善报销申请快速预览、权限控制与前端测试覆盖
This commit is contained in:
@@ -101,6 +101,7 @@ export function useTravelReimbursementGuidedFlow({
|
||||
lockSuggestedActionMessage,
|
||||
submitExistingComposer,
|
||||
currentUser,
|
||||
refreshCurrentUserFromBackend,
|
||||
toast
|
||||
}) {
|
||||
const guidedPendingFiles = ref([])
|
||||
@@ -151,9 +152,19 @@ export function useTravelReimbursementGuidedFlow({
|
||||
persistAndScroll()
|
||||
}
|
||||
|
||||
function startGuidedApplicationTemplate() {
|
||||
async function resolveApplicationPreviewUser() {
|
||||
const user = currentUser?.value || {}
|
||||
if (String(user.position || '').trim() || typeof refreshCurrentUserFromBackend !== 'function') {
|
||||
return user
|
||||
}
|
||||
|
||||
await refreshCurrentUserFromBackend({ silent: true })
|
||||
return currentUser?.value || user
|
||||
}
|
||||
|
||||
async function startGuidedApplicationTemplate() {
|
||||
resetGuidedFlowState()
|
||||
const applicationPreview = buildApplicationTemplatePreview(currentUser?.value || {})
|
||||
const applicationPreview = buildApplicationTemplatePreview(await resolveApplicationPreviewUser())
|
||||
pushAssistant(buildLocalApplicationPreviewMessage(applicationPreview), {
|
||||
meta: ['申请模板'],
|
||||
applicationPreview
|
||||
@@ -171,10 +182,10 @@ export function useTravelReimbursementGuidedFlow({
|
||||
persistAndScroll()
|
||||
}
|
||||
|
||||
function handleGuidedShortcut(shortcut) {
|
||||
async function handleGuidedShortcut(shortcut) {
|
||||
const actionType = normalizeText(shortcut?.action)
|
||||
if (actionType === GUIDED_ACTION_START_APPLICATION) {
|
||||
startGuidedApplicationTemplate()
|
||||
await startGuidedApplicationTemplate()
|
||||
return true
|
||||
}
|
||||
if (actionType === GUIDED_ACTION_START_REIMBURSEMENT) {
|
||||
@@ -245,6 +256,7 @@ export function useTravelReimbursementGuidedFlow({
|
||||
claimsPayload = await fetchExpenseClaims()
|
||||
} catch (error) {
|
||||
console.warn('Fetch reimbursement applications failed:', error)
|
||||
guidedFlowState.value = createEmptyGuidedFlowState()
|
||||
pushAssistant('查询可关联申请单时出现异常,请稍后再试。为避免直接报销,我先暂停当前流程。', {
|
||||
meta: ['申请单查询失败']
|
||||
})
|
||||
@@ -254,10 +266,9 @@ export function useTravelReimbursementGuidedFlow({
|
||||
|
||||
const applications = filterRequiredApplicationCandidates(claimsPayload, expenseType, currentUser?.value || {})
|
||||
if (!applications.length) {
|
||||
guidedFlowState.value = createGuidedReimbursementState()
|
||||
guidedFlowState.value = createEmptyGuidedFlowState()
|
||||
pushAssistant(buildRequiredApplicationMissingText(expenseType), {
|
||||
meta: ['缺少可关联申请单'],
|
||||
suggestedActions: buildGuidedExpenseTypeActions()
|
||||
meta: ['缺少可关联申请单']
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user