fix: 优先引导下载银行制单(09-08-reimbursement-payment-closeout)
ci-e2e / e2e (push) Canceled after 0s
ci-minimal / check-minimal (push) Canceled after 0s

这个提交包含在:
2026-09-09 09:05:17 +08:00
父节点 e8cad812ad
当前提交 b9185308a6
共修改 10 个文件,包含 526 行新增和 17 行删除
@@ -2872,3 +2872,60 @@ isManagementPath(pathname, permissions);
<Eye aria-hidden="true" />
</button>
```
## Scenario: Payment Detail Guides First Order Before Receipt
### Scope / Trigger
The selected payment-batch detail after independent review, not the default
payment ledger landing page. Reuse the existing desktop and mobile action model.
### Signatures
`PaymentBatchesPage.paymentActionModel`, `canExportPaymentOrder`,
`paymentOrderExportCount`, `needsBankReceipt`, `canRegisterPaymentComplete`.
The backend remains authoritative for reviewed status, role and snapshot checks.
### Contracts
- A reviewed, exportable bank batch with no generated order and no receipt uses
`下载银行制单` as its single primary action. Do not ask for a bank receipt before
exposing the first order needed to make that payment.
- Keep `上传银行回单` in `更多` for users who already paid manually; generating an
order is not a new hard prerequisite for recording a legitimate payment.
- After first generation, use `上传银行回单` as primary and put re-download in
`更多`. With an existing receipt, keep `登记付款完成` primary even if no order
was generated. Unknown receipt state is not an empty receipt list.
- Re-download requires a reason and the duplicate-bank-submission warning.
Download success must not execute a payment, upload a receipt or mark paid.
- Legacy/non-bank/non-exportable batches retain the existing manual flow.
Do not add roles, bypass backend guards or change the payment state machine.
### Validation / Error Matrix
| State | Primary | Additional route |
| --- | --- | --- |
| Reviewed, exportable, first order, no receipt | Download order | Manual receipt upload in more |
| Order generated, no receipt | Upload receipt | Re-download in more |
| Receipt already present | Register payment complete | Existing allowed order actions |
| Download fails | Keep download step | Reason dialog remains; no payment mutation |
| Receipt query fails | No upload/complete primary inferred from absence | Reload/error feedback |
### Good / Bad Cases
Good: finance downloads the approved batch file, then receives a receipt prompt.
Bad: hiding first generation behind more while prompting for a not-yet-existing
receipt; or requiring an export before accepting an already-completed manual payment.
### Tests Required
Desktop/mobile first download, reason/cancel, received BIFF8 bytes, re-download
warning and no payment mutation, manual upload via the actual file chooser,
existing-receipt and non-bank behavior, and unknown-receipt refusal. Keep backend
authorization and independent workbook parsing tests separate from browser mocks.
### Wrong vs Correct
Wrong: a visible action or a generated file proves money was paid.
Correct: file generation, bank execution and OA payment registration are distinct
events. Synthetic browser/backend/container checks do not prove real bank acceptance.