修复审批详情报销入口(07-27-yang-jun-reimbursement-readiness)
这个提交包含在:
@@ -168,6 +168,65 @@ reference, not a copy of Feishu or Ant Design branding.
|
||||
| `请假记录` / `考勤` | 业务台账列表 or record view | Enterprise WeChat-owned records, mirror status, exceptions and audit | Ordinary users do not see OA daily leave/punch approval creation; OA emergency entry only for authorized emergency/admin scope. |
|
||||
| Mobile routes | Mobile expression of the same template | Top status/focus, card list or sectioned detail | One bottom safe-area primary action; secondary actions in `更多` or confirmation. |
|
||||
|
||||
## Scenario: Approval Task Business Detail Exit
|
||||
|
||||
### 1. Scope / Trigger
|
||||
|
||||
- Trigger: an approval task detail shows only a business summary while the approver must inspect line items, invoices, attachments or other evidence before acting.
|
||||
|
||||
### 2. Signatures
|
||||
|
||||
- Mobile reimbursement target: `/mobile/reimbursements/:reimbursementId`.
|
||||
- PC reimbursement target: `/reimbursements/:reimbursementId`.
|
||||
- Mobile source state: `<Link state={{ from: currentMobileSource }}>`.
|
||||
|
||||
### 3. Contracts
|
||||
|
||||
- The pending-task list card continues to open `/mobile/approvals/:taskId`; do not confuse task selection with the separate business-detail exit inside the task detail.
|
||||
- When `WorkflowTaskDetail.reimbursement` exists, the task detail exposes an explicitly named `查看完整报销单` or `查看报销单` link near the reimbursement summary.
|
||||
- Reuse the existing business detail route and its permissions. Do not duplicate reimbursement items, invoice or attachment viewers inside the approval page merely to add reachability.
|
||||
- Mobile navigation passes the current approval task URL through the existing `state.from` convention so the business detail back button returns to that task. This is a one-level source contract, not a new nested return stack.
|
||||
- Approval actions remain on the approval task page. Opening the business detail does not approve, reject, return or mutate the task.
|
||||
|
||||
### 4. Validation & Error Matrix
|
||||
|
||||
- Task has a reimbursement -> show the reimbursement-detail link.
|
||||
- Task is another entity type -> do not show a reimbursement link; add that entity's route only in a scoped task.
|
||||
- Reimbursement summary is absent -> render no broken or guessed target.
|
||||
- Business detail permission fails -> preserve the existing permission-denied behavior; do not expand roles from the frontend.
|
||||
|
||||
### 5. Good/Base/Bad Cases
|
||||
|
||||
- Good: approver opens the task, follows `查看完整报销单`, inspects evidence, returns to the same task and then chooses an approval action.
|
||||
- Base: a completed reimbursement task still provides the read-only business-detail exit when its existing detail permission allows it.
|
||||
- Bad: make a static-looking summary card secretly clickable, change the pending-list click handler, or copy a partial invoice/attachment viewer into the task page.
|
||||
|
||||
### 6. Tests Required
|
||||
|
||||
- Mobile E2E: task detail -> reimbursement detail -> items/evidence visible -> back to the same task -> approval actions still visible.
|
||||
- PC E2E: task detail link -> existing reimbursement detail route and overview visible.
|
||||
- Assert non-reimbursement task details do not receive a reimbursement target.
|
||||
- Run `cd client && npm run typecheck && npm run build`.
|
||||
|
||||
### 7. Wrong vs Correct
|
||||
|
||||
#### Wrong
|
||||
|
||||
```tsx
|
||||
<div onClick={() => handleTaskSelection(task.id)}>报销摘要</div>
|
||||
```
|
||||
|
||||
#### Correct
|
||||
|
||||
```tsx
|
||||
<Link
|
||||
to={`/mobile/reimbursements/${encodeURIComponent(reimbursement.id)}`}
|
||||
state={{ from: currentMobileSource }}
|
||||
>
|
||||
查看完整报销单
|
||||
</Link>
|
||||
```
|
||||
|
||||
**Implementation order for design refactors**:
|
||||
|
||||
1. A-class frequent pages: workbench, pending tasks, workflow task detail,
|
||||
|
||||
在新工单中引用
屏蔽一个用户