CASHV 增加付款批次银行回单附件
这个提交包含在:
@@ -145,6 +145,7 @@ test("E2E 报销支付批次主链路:提交 -> 审批 -> 创建批次 -> 复
|
||||
await createCard.getByPlaceholder("例如:2026Q2-财务付款批次-01").fill(batchName);
|
||||
await createCard.getByPlaceholder("用逗号或换行分隔 reimbursement / travel_order ID").fill(reimbursementId);
|
||||
await createCard.locator('input[type="date"]').fill(paymentDate);
|
||||
await createCard.locator("select").nth(1).selectOption("bank");
|
||||
await createCard.getByPlaceholder("例如 PBX").fill("R78PB");
|
||||
await createCard.getByRole("button", { name: "创建批次" }).click();
|
||||
|
||||
@@ -181,6 +182,23 @@ test("E2E 报销支付批次主链路:提交 -> 审批 -> 创建批次 -> 复
|
||||
const executedBatchDetailCard = page.locator(".card-std").filter({ hasText: batchName }).filter({ hasText: "复核进度:" }).last();
|
||||
await expect(executedBatchDetailCard).toBeVisible();
|
||||
await expect(executedBatchDetailCard).toContainText("复核进度:1/1");
|
||||
const receiptCard = page.locator(".card-std").filter({ hasText: "银行回单附件" }).first();
|
||||
await expect(receiptCard).toBeVisible();
|
||||
await receiptCard.locator('input[type="file"]').setInputFiles({
|
||||
name: "r78-bank-receipt.pdf",
|
||||
mimeType: "application/pdf",
|
||||
buffer: Buffer.from(`%PDF-1.4\npayment receipt ${marker}\n%%EOF\n`, "utf8"),
|
||||
});
|
||||
const receiptUploadResponsePromise = page.waitForResponse((response) => {
|
||||
const url = new URL(response.url());
|
||||
return response.request().method() === "POST" &&
|
||||
url.pathname === `/api/payment-batches/${batchId}/receipt-attachments` &&
|
||||
response.ok();
|
||||
});
|
||||
await receiptCard.getByRole("button", { name: "上传" }).click();
|
||||
await receiptUploadResponsePromise;
|
||||
await expect(receiptCard).toContainText("r78-bank-receipt.pdf");
|
||||
|
||||
const executeBatchResponsePromise = page.waitForResponse((response) => {
|
||||
const url = new URL(response.url());
|
||||
return response.request().method() === "POST" &&
|
||||
@@ -213,6 +231,16 @@ test("E2E 报销支付批次主链路:提交 -> 审批 -> 创建批次 -> 复
|
||||
paymentAudit.items.some((item) => item.targetId === reimbursementId && item.extra?.idempotent === false),
|
||||
"付款动作应写入报销付款审计",
|
||||
).toBe(true);
|
||||
const receiptAudit = await apiGetData<{
|
||||
items: Array<{ action: string; targetId: string | null; extra: Record<string, unknown> }>;
|
||||
}>(
|
||||
adminApi.api,
|
||||
"/api/audit-logs?action=PAYMENT_BATCH_RECEIPT_UPLOADED&page=1&pageSize=20",
|
||||
);
|
||||
expect(
|
||||
receiptAudit.items.some((item) => item.targetId === batchId && Array.isArray(item.extra?.attachmentIds)),
|
||||
"银行回单上传应写入付款批次审计",
|
||||
).toBe(true);
|
||||
|
||||
await page.goto("/ap-operations");
|
||||
await expect(page.getByRole("tab", { name: /财务台账/ })).toBeVisible();
|
||||
|
||||
在新工单中引用
屏蔽一个用户