feat: 完善审批退回流程与报销申请关联
后端优化报销单访问策略和常量定义,增强退回原因和审批状态 流转,前端完善退回对话框和审批交互组件,新增报销申请关联 模型,优化文档中心行数据和审批收件箱工具函数,增强引导 流程和会话模型,补充单元测试覆盖。
This commit is contained in:
@@ -17,6 +17,10 @@ import {
|
||||
shouldUseLocalApplicationPreview
|
||||
} from '../src/utils/expenseApplicationPreview.js'
|
||||
import { renderMarkdown } from '../src/utils/markdown.js'
|
||||
import {
|
||||
createMessage as createConversationMessage,
|
||||
hasMeaningfulSessionMessages
|
||||
} from '../src/views/scripts/travelReimbursementConversationModel.js'
|
||||
|
||||
const submitComposerScript = readFileSync(
|
||||
fileURLToPath(new URL('../src/views/scripts/useTravelReimbursementSubmitComposer.js', import.meta.url)),
|
||||
@@ -217,6 +221,23 @@ test('application quick start renders a template without model review', () => {
|
||||
assert.match(buildApplicationPreviewFooterMessage(preview), /当前还需要补充/)
|
||||
})
|
||||
|
||||
test('application quick start template counts as deletable session content', () => {
|
||||
const welcomeMessage = createConversationMessage('assistant', '欢迎语', [], {
|
||||
isWelcome: true,
|
||||
welcomeQuickActions: [{ label: '快速发起申请', action: 'start_guided_application' }]
|
||||
})
|
||||
const templateMessage = createConversationMessage('assistant', '申请模板', [], {
|
||||
applicationPreview: buildApplicationTemplatePreview({
|
||||
name: '测试员工',
|
||||
departmentName: '财务部',
|
||||
grade: 'P5'
|
||||
})
|
||||
})
|
||||
|
||||
assert.equal(hasMeaningfulSessionMessages([welcomeMessage]), false)
|
||||
assert.equal(hasMeaningfulSessionMessages([welcomeMessage, templateMessage]), true)
|
||||
})
|
||||
|
||||
test('application session shows intent flow, persists preview, and supports inline table edit', () => {
|
||||
assert.match(submitComposerScript, /shouldUseLocalApplicationPreview/)
|
||||
assert.match(submitComposerScript, /buildLocalApplicationPreviewMessage/)
|
||||
@@ -228,7 +249,7 @@ test('application session shows intent flow, persists preview, and supports inli
|
||||
assert.match(submitComposerScript, /startFlowStep\('intent'/)
|
||||
assert.match(submitComposerScript, /startFlowStep\('application-review-preview'/)
|
||||
assert.match(submitComposerScript, /completeFlowStep\('intent'/)
|
||||
assert.match(submitComposerScript, /insightPanelCollapsed\.value = true/)
|
||||
assert.doesNotMatch(submitComposerScript, /insightPanelCollapsed\.value = true/)
|
||||
assert.doesNotMatch(submitComposerScript, /void refineApplicationPreviewWithModel/)
|
||||
assert.match(submitComposerScript, /return null[\s\S]*const hasUnsavedReviewDraft/)
|
||||
assert.ok(
|
||||
@@ -239,7 +260,7 @@ test('application session shows intent flow, persists preview, and supports inli
|
||||
assert.match(createViewScript, /const isApplicationSession = computed/)
|
||||
assert.match(createViewScript, /insightPanelCollapsed,/)
|
||||
assert.doesNotMatch(createViewScript, /if \(isApplicationSession\.value\) \{\s*return false\s*\}/)
|
||||
assert.match(createViewScript, /flowSteps\.value\.length > 0/)
|
||||
assert.match(createViewScript, /activeFlowSteps\.value\.length > 0/)
|
||||
assert.match(createViewScript, /useApplicationPreviewEditor/)
|
||||
assert.match(createViewScript, /message-bubble-application-preview/)
|
||||
assert.match(createViewScript, /buildApplicationPreviewFooterMessage/)
|
||||
@@ -248,6 +269,8 @@ test('application session shows intent flow, persists preview, and supports inli
|
||||
assert.match(createViewScript, /user_input_text: applicationSubmitText/)
|
||||
assert.match(conversationModelScript, /applicationPreview: null/)
|
||||
assert.match(conversationModelScript, /applicationPreview: message\.applicationPreview \|\| null/)
|
||||
assert.match(conversationModelScript, /\|\| message\.applicationPreview/)
|
||||
assert.match(createViewScript, /hasMeaningfulSessionMessages\(messages\.value\)/)
|
||||
|
||||
assert.match(messageItemTemplate, /class="application-preview-table"/)
|
||||
assert.match(messageItemTemplate, /class="application-preview-footer application-preview-footer-missing"/)
|
||||
|
||||
Reference in New Issue
Block a user