实现 B-2b 统一报销工作台迁移(reimbursement-form-shared-component-migration)

这个提交包含在:
2026-09-02 07:35:01 +08:00
父节点 6bca91a360
当前提交 abdd250325
共修改 38 个文件,包含 1850 行新增和 2723 行删除
@@ -94,7 +94,12 @@ const pendingTaskDetail = {
entityType: "reimbursement",
currentStatus: "submitted",
currentStepId: pendingTask.stepId,
contextData: { standardViolations: [] },
contextData: {
standardViolations: [],
budgetCheck: null,
budgetCheckStatus: "not_applicable",
parseStatus: "ready",
},
startedAt: "2026-05-05T08:50:00.000Z",
completedAt: null,
},
@@ -115,6 +120,57 @@ const pendingTaskDetail = {
history: [],
};
const pendingReimbursementDetail = {
...pendingTaskDetail.reimbursement,
submitterId: "employee-mock-2",
ownerId: "employee-mock-2",
departmentId: "dept-1",
department: { id: "dept-1", name: "研发" },
submittedAt: "2026-05-05T08:50:00.000Z",
projectId: null,
linkedTravelRequestId: null,
linkedTravelRequest: null,
invoices: [
{
id: "invoice-r89-1",
status: "bound",
invoiceCode: "044001900111",
invoiceNumber: "R8900001",
invoiceDate: "2026-05-05",
sellerName: "测试供应商",
totalAmount: "1683.00",
originalName: "r89-invoice.pdf",
mimeType: "application/pdf",
linkedItemId: "item-r89-1",
amountEvidenceStatus: "verified",
},
],
attachments: [],
budgetHint: null,
workflowProgress: { currentStepIndex: 0, totalSteps: 1, steps: [] },
processingProgress: { stages: [] },
approvalHistory: [],
riskFlags: [],
items: [
{
id: "item-r89-1",
expenseTypeId: "expense-r89-1",
expenseDate: "2026-05-05",
amount: "1683.00",
description: "R89 移动审批验证",
assetPriorApprovalBasis: null,
expenseType: {
id: "expense-r89-1",
code: "TRAVEL",
name: "交通费",
category: "travel",
enabled: true,
requiresInvoice: true,
},
},
],
};
function navigationItem(key: string, href: string, label: string, icon: string, placement = "main") {
return { key, href, label, icon, placement, permissionCodes: [], featureFlagKey: null };
}
@@ -328,6 +384,11 @@ async function mockR89Apis(page: Page) {
return;
}
if (path === `/api/reimbursements/${pendingReimbursementDetail.id}`) {
await fulfillJson(route, pendingReimbursementDetail);
return;
}
if (path === `/api/employees/${mockMe.id}/profile`) {
await fulfillJson(route, {
employee: {
@@ -422,7 +483,8 @@ test.describe("R89 移动底部导航与核心页面", () => {
await expect(page).toHaveURL(/\/mobile\/approvals/);
await expect(page.getByTestId("mobile-approvals-list")).toBeVisible();
await page.getByTestId(`mobile-approvals-task-${pendingTask.id}`).click();
await expect(page.getByTestId("mobile-approvals-detail")).toBeVisible();
await expect(page.getByTestId("reimbursement-mobile-workspace")).toBeVisible();
await expect(page.getByTestId("reimbursement-approval-evidence")).toBeVisible();
await expect(page.getByTestId("mobile-approvals-approve")).toBeVisible();
await expect(page.getByTestId("mobile-approvals-reject")).toBeVisible();
await page.getByTestId("mobile-approvals-approve").click();
@@ -430,13 +492,12 @@ test.describe("R89 移动底部导航与核心页面", () => {
await page.getByTestId("workflow-action-confirm-cancel").click();
await page.context().setOffline(true);
await page.evaluate(() => window.dispatchEvent(new Event("offline")));
await page.getByTestId("mobile-approvals-approve").click();
await expect(page.getByTestId("workflow-action-confirm-dialog")).toContainText("只会保存为待同步草稿");
await page.getByTestId("workflow-action-confirm-cancel").click();
await expect(page.getByTestId("mobile-approvals-approve")).toBeDisabled();
await expect(page.getByTestId("reimbursement-mobile-workspace")).toContainText("报销审批需联网核对完整报销内容");
await page.context().setOffline(false);
await page.evaluate(() => window.dispatchEvent(new Event("online")));
await attachScreenshot(page, testInfo, "r97-mobile-approvals.png");
await page.getByTestId("mobile-approvals-detail-header").getByRole("button", { name: "返回" }).click();
await page.getByTestId("mobile-reimbursement-detail-header").getByRole("button", { name: "返回" }).click();
await expect(page).toHaveURL(/\/mobile\/approvals/);
await page.getByTestId("mobile-nav-reimbursements").click();