feat(web): AI 文档详情引用解析与查询卡片增强

- 新增 aiDocumentDetailReference,统一解析 #ai-open-document-detail / #ai-open-application-detail 引用,兼容 A/R/D 短格式与 AP-/RE-/AD- 旧格式单号,提供 isBusinessDocumentReference 判定
- aiDocumentQueryModel 文档卡片接入详情引用,按申请单/报销单生成对应 href,HTML 渲染器识别单据记录表格并生成卡片链接
- PersonalWorkbenchAiMode 处理文档详情点击跳转,卡片样式重构为结构化布局并更新背景资源
- expenseApplicationPreview 补充事由字段,同步新增/更新 ai-document-detail-reference、document-query-model、html-renderer、workbench-ai-mode 等测试
- 更新公司通信费报销规则表
This commit is contained in:
caoxiaozhu
2026-06-21 22:49:53 +08:00
parent 3b74a330a3
commit 8b3495455b
15 changed files with 832 additions and 318 deletions

View File

@@ -19,6 +19,10 @@ const aiMode = readFileSync(
fileURLToPath(new URL('../src/components/business/PersonalWorkbenchAiMode.vue', import.meta.url)),
'utf8'
)
const aiDetailReference = readFileSync(
fileURLToPath(new URL('../src/utils/aiDocumentDetailReference.js', import.meta.url)),
'utf8'
)
test('workbench document detail keeps workbench as the return target', () => {
assert.match(workbench, /source:\s*'workbench'/)
@@ -35,12 +39,16 @@ test('workbench document detail keeps workbench as the return target', () => {
assert.match(appShellComposable, /router\.push\(\{ name: 'app-documents', query: buildDocumentReturnQuery\(\) \}\)/)
})
test('AI detail links wait for full document detail instead of rendering a half snapshot', () => {
assert.match(aiMode, /detailLookupOnly:\s*true/)
assert.match(aiMode, /params\.get\('claim_id'\)/)
assert.match(aiMode, /params\.get\('claim_no'\)/)
assert.match(aiMode, /claimId:\s*claimId \|\| reference/)
assert.match(aiMode, /claimNo:\s*claimNo \|\| reference/)
test('AI detail links resolve real claim identity before opening document detail', () => {
assert.match(aiMode, /buildAiDocumentDetailRequest/)
assert.match(aiMode, /parseAiApplicationDetailHref/)
assert.match(aiMode, /parseAiDocumentDetailHref/)
assert.match(aiDetailReference, /detailLookupOnly:\s*true/)
assert.match(aiDetailReference, /params\.get\('claim_id'\)/)
assert.match(aiDetailReference, /params\.get\('claim_no'\)/)
assert.match(aiDetailReference, /isBusinessDocumentReference/)
assert.match(aiDetailReference, /const claimId = explicitClaimId \|\| \(!referenceIsBusinessNo \? reference : ''\)/)
assert.match(aiDetailReference, /const claimNo = explicitClaimNo \|\| \(referenceIsBusinessNo \? reference : ''\)/)
assert.match(
appShell,
/v-else-if="activeView === 'documents' && detailMode && !selectedRequest"[\s\S]*正在加载完整单据详情/
@@ -49,10 +57,16 @@ test('AI detail links wait for full document detail instead of rendering a half
appShell,
/const detailPayload = request \|\| \{[\s\S]*detailLookupOnly:\s*true[\s\S]*\}/
)
assert.match(appShell, /isBusinessDocumentReference/)
assert.match(appShell, /const requestCandidates = Array\.isArray\(workbenchRequests\.value\)/)
assert.match(appShell, /claimId:\s*fallbackClaimId/)
assert.match(appShell, /claimNo:\s*fallbackClaimNo/)
assert.match(
appShellComposable,
/const isDetailLookupOnlyRequest = isDetailLookupOnlyPayload\(request\)[\s\S]*selectedRequestSnapshot\.value = isDetailLookupOnlyRequest \? null : request \|\| null/
)
assert.match(appShellComposable, /const workbenchRequests = computed/)
assert.match(appShellComposable, /workbenchRequests\.value\.find\(\(item\) => isSameRequestIdentity\(item, requestId\)\)/)
assert.match(
appShellComposable,
/void refreshSelectedRequestDetail\(isDetailLookupOnlyRequest \? requestId : request\)/