feat: 财务看板口径重构与半年模拟数据及报销状态注册表
- 重构 finance_dashboard 口径计算,新增模拟公司画像数据生成与筛选 - 引入 expense_claim_status_registry 统一报销状态流转 - 完善报销草稿流程、Item Sync 与本体解析器 - 优化总览页趋势图、分页组件与请求进度步骤 - 增强报销申请快速预览、本体工具与详情展示 - 新增半年报销模拟数据种子脚本与状态审计工具 - 补充财务看板、报销状态注册与模拟数据测试覆盖
This commit is contained in:
@@ -164,9 +164,10 @@ test('application preview renders ordered editable rows and submit text uses edi
|
||||
const rows = buildApplicationPreviewRows(editedPreview)
|
||||
assert.deepEqual(
|
||||
rows.map((row) => row.label),
|
||||
['申请类型', '姓名', '职级', '部门', '岗位', '直属领导', '行程时间', '地点', '事由', '天数', '出行方式', '住宿上限/天', '补贴标准/天', '交通费用口径', '规则测算参考', '系统预估费用']
|
||||
['申请类型', '姓名', '职级', '部门', '岗位', '直属领导', '出发时间', '返回时间', '地点', '事由', '天数', '出行方式', '住宿上限/天', '补贴标准/天', '交通费用口径', '规则测算参考', '系统预估费用']
|
||||
)
|
||||
assert.match(buildApplicationPreviewSubmitText(editedPreview), /行程时间:2026-05-25 至 2026-05-28/)
|
||||
assert.match(buildApplicationPreviewSubmitText(editedPreview), /出发时间:2026-05-25/)
|
||||
assert.match(buildApplicationPreviewSubmitText(editedPreview), /返回时间:2026-05-28/)
|
||||
assert.doesNotMatch(buildApplicationPreviewSubmitText(editedPreview), /发生时间:/)
|
||||
assert.equal(rows.find((row) => row.key === 'amount')?.value, '1900元')
|
||||
assert.equal(rows.find((row) => row.key === 'amount')?.highlight, true)
|
||||
@@ -212,7 +213,7 @@ test('application estimate builds deterministic mock transport amount and total'
|
||||
assert.equal(datedTrainEstimate.queryDate, '2026-05-25')
|
||||
assert.equal(datedTrainEstimate.amountDisplay, '1,100')
|
||||
assert.equal(datedTrainEstimate.source, 'mock_ticket_price_query_v1')
|
||||
assert.match(datedTrainEstimate.basisText, /查询耗时 \d+ms/)
|
||||
assert.equal(datedTrainEstimate.basisText, '预估交通费用 1,100元')
|
||||
assert.ok(datedTrainEstimate.simulatedLatencyMs >= 360)
|
||||
assert.ok(datedTrainEstimate.simulatedLatencyMs <= 779)
|
||||
assert.equal(resolveMockApplicationTransportWaitMs(datedTrainEstimate), 320)
|
||||
@@ -247,16 +248,43 @@ test('application preview uses selected date range and business-specific time la
|
||||
const rows = buildApplicationPreviewRows(preview)
|
||||
const submitText = buildApplicationPreviewSubmitText(preview)
|
||||
|
||||
assert.equal(resolveApplicationTimeLabel(preview.fields.applicationType), '行程时间')
|
||||
assert.equal(resolveApplicationTimeLabel(preview.fields.applicationType), '出发时间')
|
||||
assert.equal(preview.fields.time, '2026-02-20 至 2026-02-23')
|
||||
assert.equal(preview.fields.days, '4天')
|
||||
assert.equal(preview.fields.reason, '支撑国网仿生产环境部署')
|
||||
assert.equal(rows.find((row) => row.key === 'time')?.label, '行程时间')
|
||||
assert.match(submitText, /行程时间:2026-02-20 至 2026-02-23/)
|
||||
assert.equal(rows.find((row) => row.key === 'time')?.label, '出发时间')
|
||||
assert.equal(rows.find((row) => row.key === 'time')?.value, '2026-02-20')
|
||||
assert.equal(rows.find((row) => row.key === 'time_return')?.label, '返回时间')
|
||||
assert.equal(rows.find((row) => row.key === 'time_return')?.value, '2026-02-23')
|
||||
assert.match(submitText, /出发时间:2026-02-20/)
|
||||
assert.match(submitText, /返回时间:2026-02-23/)
|
||||
assert.match(submitText, /事由:支撑国网仿生产环境部署/)
|
||||
assert.doesNotMatch(submitText, /发生时间:/)
|
||||
})
|
||||
|
||||
test('application preview keeps labeled reason in structured travel form', () => {
|
||||
const preview = buildLocalApplicationPreview([
|
||||
'发生时间:2026-02-20 至 2026-02-23',
|
||||
'地点:上海',
|
||||
'事由:支撑国网仿生产环境建设',
|
||||
'天数:4天'
|
||||
].join('\n'), {
|
||||
name: '曹笑竹',
|
||||
grade: 'P5'
|
||||
})
|
||||
const rows = buildApplicationPreviewRows(preview)
|
||||
|
||||
assert.equal(preview.fields.applicationType, '差旅费用申请')
|
||||
assert.equal(preview.fields.time, '2026-02-20 至 2026-02-23')
|
||||
assert.equal(preview.fields.location, '上海')
|
||||
assert.equal(preview.fields.reason, '支撑国网仿生产环境建设')
|
||||
assert.equal(preview.fields.days, '4天')
|
||||
assert.equal(rows.find((row) => row.key === 'reason')?.value, '支撑国网仿生产环境建设')
|
||||
assert.equal(rows.find((row) => row.key === 'reason')?.missing, false)
|
||||
assert.equal(rows.find((row) => row.key === 'time')?.label, '出发时间')
|
||||
assert.equal(rows.find((row) => row.key === 'time_return')?.label, '返回时间')
|
||||
})
|
||||
|
||||
test('application preview cleans empty time labels and keeps only business reason', () => {
|
||||
const preview = buildLocalApplicationPreview('发生时间:,去九江出差3天,服务美团业务部署,预计费用1800元,火车', {
|
||||
name: '李文静',
|
||||
@@ -622,7 +650,7 @@ test('application duplicate confirmation flow marks submit step as blocked dupli
|
||||
status: 'succeeded',
|
||||
result: {
|
||||
answer: [
|
||||
'检测到同一申请人、同一申请类型、同一行程时间已存在申请单,系统没有重复创建。',
|
||||
'检测到同一申请人、同一申请类型、同一出发时间已存在申请单,系统没有重复创建。',
|
||||
'已有申请单号:AP-20260602010101-ABCDEFGH',
|
||||
'当前节点:直属领导审批'
|
||||
].join('\n')
|
||||
@@ -679,9 +707,8 @@ test('application preview merges rule center travel estimate into highlighted ro
|
||||
|
||||
assert.equal(estimatedPreview.fields.lodgingDailyCap, '600元/天')
|
||||
assert.equal(estimatedPreview.fields.subsidyDailyCap, '120元/天')
|
||||
assert.match(estimatedPreview.fields.transportPolicy, /参考票价/)
|
||||
assert.match(estimatedPreview.fields.transportPolicy, /2026-05-25/)
|
||||
assert.match(estimatedPreview.fields.transportPolicy, /查询耗时 \d+ms/)
|
||||
assert.equal(estimatedPreview.fields.transportPolicy, '预估交通费用 1,100元')
|
||||
assert.doesNotMatch(estimatedPreview.fields.transportPolicy, /参考票价|查询耗时|2026-05-25|真实票据/)
|
||||
assert.match(estimatedPreview.fields.policyEstimate, /交通 1,100元/)
|
||||
assert.match(estimatedPreview.fields.policyEstimate, /3,260元/)
|
||||
assert.equal(estimatedPreview.fields.transportEstimatedAmount, '1,100元')
|
||||
@@ -734,8 +761,8 @@ test('application preview editor refreshes transport estimate after mode change'
|
||||
assert.equal(message.applicationPreview.fields.transportMode, '飞机')
|
||||
assert.equal(message.applicationPreview.fields.transportEstimatedAmount, '2,330元')
|
||||
assert.equal(message.applicationPreview.fields.amount, '4,490元')
|
||||
assert.match(message.applicationPreview.fields.transportPolicy, /已查询 2026-05-25 飞机参考票价/)
|
||||
assert.match(message.applicationPreview.fields.transportPolicy, /查询耗时 \d+ms/)
|
||||
assert.equal(message.applicationPreview.fields.transportPolicy, '预估交通费用 2,330元')
|
||||
assert.doesNotMatch(message.applicationPreview.fields.transportPolicy, /参考票价|查询耗时|2026-05-25|真实票据/)
|
||||
assert.doesNotMatch(message.applicationPreview.fields.transportPolicy, /模拟/)
|
||||
assert.ok(persistCount >= 2)
|
||||
assert.equal(toastMessages.at(-1), '已更新出行方式和费用测算。')
|
||||
|
||||
@@ -30,6 +30,8 @@ test('expense application fields use labeled reason and filter resolved missing
|
||||
)
|
||||
|
||||
assert.equal(fields.timeRange, '2026-05-25 至 2026-05-27')
|
||||
assert.equal(fields.expenseTypeCode, 'travel')
|
||||
assert.equal(fields.expenseTypeLabel, '差旅费')
|
||||
assert.equal(fields.location, '上海')
|
||||
assert.equal(fields.reason, '支撑国网服务器部署')
|
||||
assert.deepEqual(
|
||||
|
||||
@@ -2,6 +2,10 @@ import assert from 'node:assert/strict'
|
||||
import test from 'node:test'
|
||||
|
||||
import { mapExpenseClaimToRequest } from '../src/composables/useRequests.js'
|
||||
import {
|
||||
buildApplicationDetailFactItems,
|
||||
buildRelatedApplicationFactItems
|
||||
} from '../src/utils/expenseApplicationDetail.js'
|
||||
|
||||
const CREATE_APPLICATION = '\u521b\u5efa\u7533\u8bf7'
|
||||
const DIRECT_MANAGER_APPROVAL = '\u76f4\u5c5e\u9886\u5bfc\u5ba1\u6279'
|
||||
@@ -110,6 +114,55 @@ test('application claims are mapped as application documents', () => {
|
||||
assert.equal(request.progressSteps.find((step) => step.label === WAIT_LEADER_LI_APPROVAL)?.current, true)
|
||||
})
|
||||
|
||||
test('travel application detail splits trip time into departure and return rows', () => {
|
||||
const request = mapExpenseClaimToRequest({
|
||||
id: 'claim-application-trip-time',
|
||||
claim_no: 'AP-20260602103045-TRIPTIME',
|
||||
employee_name: '张三',
|
||||
department_name: '交付部',
|
||||
manager_name: 'Leader Li',
|
||||
expense_type: 'travel_application',
|
||||
reason: '支撑国网仿生产环境部署',
|
||||
location: '上海',
|
||||
amount: 3000,
|
||||
invoice_count: 0,
|
||||
occurred_at: '2026-02-20T00:00:00.000Z',
|
||||
submitted_at: '2026-02-20T02:00:00.000Z',
|
||||
created_at: '2026-02-20T01:30:00.000Z',
|
||||
updated_at: '2026-02-20T02:00:00.000Z',
|
||||
status: 'submitted',
|
||||
approval_stage: '直属领导审批',
|
||||
risk_flags_json: [
|
||||
{
|
||||
source: 'application_detail',
|
||||
application_detail: {
|
||||
application_type: '差旅费用申请',
|
||||
time: '2026-02-20 至 2026-02-23',
|
||||
location: '上海',
|
||||
reason: '支撑国网仿生产环境部署',
|
||||
days: '4 天',
|
||||
transport_mode: '火车',
|
||||
amount: '3000'
|
||||
}
|
||||
}
|
||||
],
|
||||
items: []
|
||||
})
|
||||
|
||||
const factItems = buildApplicationDetailFactItems(request)
|
||||
assert.deepEqual(
|
||||
factItems
|
||||
.filter((item) => ['trip_start_time', 'trip_return_time'].includes(item.key))
|
||||
.map((item) => [item.label, item.value]),
|
||||
[
|
||||
['出发时间', '2026-02-20'],
|
||||
['返回时间', '2026-02-23']
|
||||
]
|
||||
)
|
||||
assert.equal(factItems.some((item) => item.label === '发生时间'), false)
|
||||
assert.equal(factItems.some((item) => item.label === '行程时间'), false)
|
||||
})
|
||||
|
||||
test('application claims wait for department P8 budget monitor after leader approval', () => {
|
||||
const request = mapExpenseClaimToRequest({
|
||||
id: 'claim-application-budget',
|
||||
@@ -679,11 +732,17 @@ test('paid reimbursement marks payment progress step as complete', () => {
|
||||
application_type: '差旅费用申请',
|
||||
application_content: '差旅费用申请 / 北京',
|
||||
application_reason: '支撑国网仿生产环境部署',
|
||||
application_days: '3 天',
|
||||
application_days: '4 天',
|
||||
application_location: '北京',
|
||||
application_amount: '3000',
|
||||
application_time: '2026-05-20T00:00:00.000Z',
|
||||
application_transport_mode: '高铁'
|
||||
application_time: '2026-05-20 至 2026-05-23',
|
||||
application_transport_mode: '高铁',
|
||||
application_lodging_daily_cap: '600元/天',
|
||||
application_subsidy_daily_cap: '120元/天',
|
||||
application_transport_policy: '按真实票据复核',
|
||||
application_policy_estimate: '交通按真实票据 + 住宿 2,400元 + 补贴 480元',
|
||||
application_rule_name: '差旅标准规则',
|
||||
application_rule_version: '2026.05'
|
||||
}
|
||||
}
|
||||
],
|
||||
@@ -709,8 +768,36 @@ test('paid reimbursement marks payment progress step as complete', () => {
|
||||
assert.equal(linkedStep.time, '已关联 APP-20260520-001')
|
||||
assert.equal(request.relatedApplication.claimNo, 'APP-20260520-001')
|
||||
assert.equal(request.relatedApplication.reason, '支撑国网仿生产环境部署')
|
||||
assert.equal(request.relatedApplication.days, '3 天')
|
||||
assert.equal(request.relatedApplication.days, '4 天')
|
||||
assert.equal(request.relatedApplication.time, '2026-05-20 至 2026-05-23')
|
||||
assert.equal(request.relatedApplication.tripStartDate, '2026-05-20')
|
||||
assert.equal(request.relatedApplication.tripEndDate, '2026-05-23')
|
||||
assert.equal(request.relatedApplication.transportMode, '高铁')
|
||||
assert.equal(request.relatedApplication.lodgingDailyCap, '600元/天')
|
||||
assert.equal(request.relatedApplication.subsidyDailyCap, '120元/天')
|
||||
assert.equal(request.relatedApplication.transportPolicy, '按真实票据复核')
|
||||
assert.equal(request.relatedApplication.policyEstimate, '交通按真实票据 + 住宿 2,400元 + 补贴 480元')
|
||||
assert.equal(request.relatedApplication.ruleLabel, '差旅标准规则 / 2026.05')
|
||||
assert.equal(request.relatedApplication.amountLabel, '¥3,000')
|
||||
assert.deepEqual(
|
||||
buildRelatedApplicationFactItems(request).map((item) => [item.label, item.value]),
|
||||
[
|
||||
['关联单据单号', 'APP-20260520-001'],
|
||||
['申请内容', '差旅费用申请 / 北京'],
|
||||
['出发时间', '2026-05-20'],
|
||||
['返回时间', '2026-05-23'],
|
||||
['申请天数', '4 天'],
|
||||
['申请事由', '支撑国网仿生产环境部署'],
|
||||
['申请地点', '北京'],
|
||||
['出行方式', '高铁'],
|
||||
['住宿上限/天', '600元/天'],
|
||||
['补贴标准/天', '120元/天'],
|
||||
['交通费用口径', '按真实票据复核'],
|
||||
['规则测算参考', '交通按真实票据 + 住宿 2,400元 + 补贴 480元'],
|
||||
['规则依据', '差旅标准规则 / 2026.05'],
|
||||
['预计金额', '¥3,000']
|
||||
]
|
||||
)
|
||||
})
|
||||
|
||||
test('reimbursement detail resolves linked application from guided entry context', () => {
|
||||
@@ -739,7 +826,14 @@ test('reimbursement detail resolves linked application from guided entry context
|
||||
application_reason: '支撑国网仿生产环境部署',
|
||||
application_location: '北京',
|
||||
application_amount: '3000',
|
||||
application_amount_label: '¥3,000'
|
||||
application_amount_label: '¥3,000',
|
||||
application_business_time: '2026-05-20 至 2026-05-23',
|
||||
application_days: '4 天',
|
||||
application_transport_mode: '高铁',
|
||||
application_lodging_daily_cap: '600元/天',
|
||||
application_subsidy_daily_cap: '120元/天',
|
||||
application_transport_policy: '按真实票据复核',
|
||||
application_policy_estimate: '交通按真实票据 + 住宿 2,400元 + 补贴 480元'
|
||||
},
|
||||
expense_scene_selection: {
|
||||
application_claim_no: 'AP-202605-001'
|
||||
@@ -752,7 +846,136 @@ test('reimbursement detail resolves linked application from guided entry context
|
||||
assert.equal(request.relatedApplication.claimNo, 'AP-202605-001')
|
||||
assert.equal(request.relatedApplication.reason, '支撑国网仿生产环境部署')
|
||||
assert.equal(request.relatedApplication.location, '北京')
|
||||
assert.equal(request.relatedApplication.time, '2026-05-20 至 2026-05-23')
|
||||
assert.equal(request.relatedApplication.tripStartDate, '2026-05-20')
|
||||
assert.equal(request.relatedApplication.tripEndDate, '2026-05-23')
|
||||
assert.equal(request.relatedApplication.days, '4 天')
|
||||
assert.equal(request.relatedApplication.transportMode, '高铁')
|
||||
assert.equal(request.relatedApplication.lodgingDailyCap, '600元/天')
|
||||
assert.equal(request.relatedApplication.subsidyDailyCap, '120元/天')
|
||||
assert.equal(request.relatedApplication.policyEstimate, '交通按真实票据 + 住宿 2,400元 + 补贴 480元')
|
||||
assert.equal(request.relatedApplication.amountLabel, '¥3,000')
|
||||
assert.deepEqual(request.expenseItems, [])
|
||||
})
|
||||
|
||||
test('reimbursement detail hides stale application placeholder and allowance rows before receipts', () => {
|
||||
const request = mapExpenseClaimToRequest({
|
||||
id: 'claim-linked-stale-placeholder',
|
||||
claim_no: 'EXP-20260520-010',
|
||||
employee_name: '张三',
|
||||
department_name: '交付部',
|
||||
expense_type: 'travel',
|
||||
reason: '支撑国网仿生产环境部署',
|
||||
location: '上海',
|
||||
amount: 3480,
|
||||
invoice_count: 0,
|
||||
occurred_at: '2026-02-20T00:00:00.000Z',
|
||||
created_at: '2026-05-20T01:30:00.000Z',
|
||||
updated_at: '2026-05-20T02:00:00.000Z',
|
||||
status: 'draft',
|
||||
approval_stage: '待提交',
|
||||
risk_flags_json: [
|
||||
{
|
||||
source: 'application_link',
|
||||
event_type: 'expense_reimbursement_application_linked',
|
||||
review_form_values: {
|
||||
application_claim_id: 'application-guided-stale',
|
||||
application_claim_no: 'AP-202605-010',
|
||||
application_reason: '支撑国网仿生产环境部署',
|
||||
application_location: '上海',
|
||||
application_amount: '3000',
|
||||
application_amount_label: '¥3,000',
|
||||
application_business_time: '2026-02-20 至 2026-02-23',
|
||||
application_days: '4 天',
|
||||
application_transport_mode: '火车'
|
||||
}
|
||||
}
|
||||
],
|
||||
items: [
|
||||
{
|
||||
id: 'placeholder-travel',
|
||||
item_type: 'travel',
|
||||
item_reason: '支撑国网仿生产环境部署',
|
||||
item_location: '上海',
|
||||
item_amount: 3000,
|
||||
item_date: '2026-02-20',
|
||||
invoice_id: ''
|
||||
},
|
||||
{
|
||||
id: 'stale-allowance',
|
||||
item_type: 'travel_allowance',
|
||||
item_reason: '系统自动计算出差补贴:上海市,1天,120.00元/天',
|
||||
item_location: '直辖市/特区',
|
||||
item_amount: 120,
|
||||
item_date: '2026-02-20',
|
||||
invoice_id: ''
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
assert.equal(request.relatedApplication.claimNo, 'AP-202605-010')
|
||||
assert.equal(request.relatedApplication.days, '4 天')
|
||||
assert.equal(request.amount, 0)
|
||||
assert.deepEqual(request.expenseItems, [])
|
||||
assert.equal(request.expenseTableSummary, '暂无费用明细')
|
||||
})
|
||||
|
||||
test('reimbursement detail hides stale allowance when linked application days differ', () => {
|
||||
const request = mapExpenseClaimToRequest({
|
||||
id: 'claim-linked-stale-allowance',
|
||||
claim_no: 'EXP-20260520-011',
|
||||
employee_name: '张三',
|
||||
department_name: '交付部',
|
||||
expense_type: 'travel',
|
||||
reason: '支撑国网仿生产环境部署',
|
||||
location: '上海',
|
||||
amount: 474,
|
||||
invoice_count: 1,
|
||||
occurred_at: '2026-02-20T00:00:00.000Z',
|
||||
created_at: '2026-05-20T01:30:00.000Z',
|
||||
updated_at: '2026-05-20T02:00:00.000Z',
|
||||
status: 'draft',
|
||||
approval_stage: '待提交',
|
||||
risk_flags_json: [
|
||||
{
|
||||
source: 'application_link',
|
||||
event_type: 'expense_reimbursement_application_linked',
|
||||
application_claim_no: 'AP-202605-011',
|
||||
application_detail: {
|
||||
application_reason: '支撑国网仿生产环境部署',
|
||||
application_location: '上海',
|
||||
application_time: '2026-02-20 至 2026-02-23',
|
||||
application_days: '4 天',
|
||||
application_transport_mode: '火车'
|
||||
}
|
||||
}
|
||||
],
|
||||
items: [
|
||||
{
|
||||
id: 'outbound-train',
|
||||
item_type: 'train_ticket',
|
||||
item_reason: '武汉-上海',
|
||||
item_location: '上海',
|
||||
item_amount: 354,
|
||||
item_date: '2026-02-20',
|
||||
invoice_id: 'ticket-1.png'
|
||||
},
|
||||
{
|
||||
id: 'stale-allowance',
|
||||
item_type: 'travel_allowance',
|
||||
item_reason: '系统自动计算出差补贴:上海市,1天,120.00元/天',
|
||||
item_location: '直辖市/特区',
|
||||
item_amount: 120,
|
||||
item_date: '2026-02-20',
|
||||
invoice_id: ''
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
assert.equal(request.relatedApplication.days, '4 天')
|
||||
assert.deepEqual(request.expenseItems.map((item) => item.id), ['outbound-train'])
|
||||
assert.equal(request.amount, 354)
|
||||
assert.equal(request.expenseTableSummary, '共 1 条费用明细,已关联 1 张票据')
|
||||
})
|
||||
|
||||
test('current direct manager step shows how long the claim has stayed there', () => {
|
||||
|
||||
@@ -232,7 +232,19 @@ test('guided reimbursement requires application selection for travel and enterta
|
||||
amount: 1800,
|
||||
occurred_at: '2026-05-20T08:00:00Z',
|
||||
status: 'approved',
|
||||
created_at: '2026-05-20T08:00:00Z'
|
||||
created_at: '2026-06-02T00:58:00Z',
|
||||
risk_flags_json: [{
|
||||
source: 'application_detail',
|
||||
application_detail: {
|
||||
application_business_time: '2026-05-20 至 2026-05-23',
|
||||
days: '4 天',
|
||||
transport_mode: '火车',
|
||||
lodging_daily_cap: '600元/天',
|
||||
subsidy_daily_cap: '120元/天',
|
||||
transport_policy: '按真实票据复核',
|
||||
policy_estimate: '住宿 2,400元 + 补贴 480元'
|
||||
}
|
||||
}]
|
||||
},
|
||||
{
|
||||
id: 'app-meal',
|
||||
@@ -285,6 +297,11 @@ test('guided reimbursement requires application selection for travel and enterta
|
||||
assert.equal(state.stepKey, 'summary')
|
||||
assert.equal(isGuidedReimbursementReadyForReview(state), true)
|
||||
assert.equal(state.values.application_claim_no, 'AP-202605-001')
|
||||
assert.equal(state.values.application_business_time, '2026-05-20 至 2026-05-23')
|
||||
assert.equal(state.values.application_days, '4 天')
|
||||
assert.equal(state.values.application_transport_mode, '火车')
|
||||
assert.equal(state.values.application_lodging_daily_cap, '600元/天')
|
||||
assert.equal(state.values.application_subsidy_daily_cap, '120元/天')
|
||||
const summaryText = buildGuidedReimbursementSummaryText(state)
|
||||
assert.match(summaryText, /关联申请单:AP-202605-001/)
|
||||
assert.match(summaryText, /草稿详情中上传对应票据/)
|
||||
@@ -297,7 +314,12 @@ test('guided reimbursement requires application selection for travel and enterta
|
||||
assert.equal(submitOptions.extraContext.review_form_values.business_location, '上海')
|
||||
assert.equal(submitOptions.extraContext.review_form_values.amount, '')
|
||||
assert.equal(submitOptions.extraContext.review_form_values.application_amount, '1800')
|
||||
assert.equal(submitOptions.extraContext.review_form_values.application_business_time, '2026-05-20')
|
||||
assert.equal(submitOptions.extraContext.review_form_values.application_business_time, '2026-05-20 至 2026-05-23')
|
||||
assert.equal(submitOptions.extraContext.review_form_values.application_days, '4 天')
|
||||
assert.equal(submitOptions.extraContext.review_form_values.transport_mode, '火车')
|
||||
assert.equal(submitOptions.extraContext.review_form_values.application_transport_mode, '火车')
|
||||
assert.equal(submitOptions.extraContext.review_form_values.application_lodging_daily_cap, '600元/天')
|
||||
assert.equal(submitOptions.extraContext.review_form_values.application_subsidy_daily_cap, '120元/天')
|
||||
assert.equal(submitOptions.extraContext.expense_scene_selection.application_claim_no, 'AP-202605-001')
|
||||
assert.match(submitOptions.rawText, /关联申请单:AP-202605-001/)
|
||||
assert.doesNotMatch(submitOptions.rawText, /事由:待补充/)
|
||||
@@ -377,6 +399,8 @@ test('guided flow is local until final confirmation or collected query handoff',
|
||||
assert.match(guidedFlowScript, /GUIDED_ACTION_SELECT_REQUIRED_APPLICATION/)
|
||||
assert.match(guidedFlowScript, /isGuidedReimbursementReadyForReview\(guidedFlowState\.value\)[\s\S]*pushReimbursementSummary\(\)/)
|
||||
assert.match(guidedFlowScript, /isGuidedReimbursementReadyForReview\(currentState\) && fileNames\.length[\s\S]*buildGuidedReviewSubmitOptions\(currentState, mergedFiles\)[\s\S]*skipDraftAssociationPrompt:\s*true[\s\S]*skipUserMessage:\s*true[\s\S]*submitExistingComposer\(submitOptions\)/)
|
||||
assert.doesNotMatch(guidedFlowScript, /amount:\s*applicationAmount/)
|
||||
assert.match(guidedFlowScript, /amount:\s*''/)
|
||||
assert.match(guidedFlowScript, /if \(!applications\.length\) \{[\s\S]*guidedFlowState\.value = createEmptyGuidedFlowState\(\)[\s\S]*meta: \['缺少可关联申请单'\][\s\S]*\}\)/)
|
||||
assert.doesNotMatch(guidedFlowScript, /meta: \['缺少可关联申请单'\],[\s\S]{0,120}suggestedActions: buildGuidedExpenseTypeActions\(\)/)
|
||||
assert.match(guidedFlowScript, /handleSceneSelectionApplicationGate/)
|
||||
|
||||
Reference in New Issue
Block a user