This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
## Context
|
||||
|
||||
代理注册申请由公开注册接口创建,后台需要按数据范围查询申请并展示审批提交状态。恢复审批只恢复原企业微信审批提交,不创建新的注册申请或审批实例。
|
||||
|
||||
## Decisions
|
||||
|
||||
- 使用列表页 + 独立详情页,详情页 URL 为 `/shop-management/agent-distribution-registrations/detail/:id`。
|
||||
- 列表和详情均使用后端返回的 `status`、`approval_status`、`submission_status` 和名称字段,不在前端推导状态。
|
||||
- 恢复按钮仅由后端返回的 `recoverable` 控制,并使用独立 `agent_distribution_registration:recover_approval` 权限。
|
||||
- 详情响应直接消费后端完整手机号和注册地址,不展示密码或内部审批字段。
|
||||
|
||||
## Risks / Mitigations
|
||||
|
||||
- 状态可能在列表与详情之间发生变化 → 详情和恢复成功/失败后重新加载后端数据。
|
||||
- 恢复请求并发冲突 → 后端返回错误时提示并刷新详情,不做乐观更新。
|
||||
- 手机号属于敏感业务数据 → 页面仅受注册申请列表/详情权限和后端数据范围控制。
|
||||
@@ -0,0 +1,31 @@
|
||||
# Change: 增加代理注册申请后台管理
|
||||
|
||||
## Why
|
||||
|
||||
后台目前无法查看代理扫码注册申请,也无法处理企业微信审批提交失败或结果未知的注册申请。根据 `docs/产品迭代8月份/代理注册管理.md`,需要提供申请列表、详情和恢复原审批提交入口。
|
||||
|
||||
## What Changes
|
||||
|
||||
- 新增后台代理注册申请列表页,支持状态、申请/决定时间、手机号、关键字、直接上级店铺和提交异常筛选。
|
||||
- 新增注册申请详情页,展示完整手机号、注册地址、申请店铺、分销码、业务状态、审批状态和企微提交状态。
|
||||
- 当 `recoverable = true` 时显示“恢复审批”,调用 `POST /api/admin/agent-distribution-registrations/{id}/recover-approval`,成功后刷新详情。
|
||||
- 新增代理注册申请 API、类型、路由和权限编码。
|
||||
- 权限编码:列表 `agent_distribution_registration:list`、详情 `agent_distribution_registration:detail`、恢复审批 `agent_distribution_registration:recover_approval`。
|
||||
|
||||
## Impact
|
||||
|
||||
- Affected specs: `agent-distribution-registration`
|
||||
- Affected code:
|
||||
- `src/api/modules/agentDistribution.ts`
|
||||
- `src/types/api/agentDistribution.ts`
|
||||
- `src/config/constants/augustIteration.ts`
|
||||
- `src/router/routesAlias.ts`
|
||||
- `src/router/routes/asyncRoutes.ts`
|
||||
- `src/views/shop-management/agent-distribution-registrations/index.vue`
|
||||
- `src/views/shop-management/agent-distribution-registrations/detail.vue`
|
||||
- `src/locales/langs/zh.json`
|
||||
- `docs/权限.md`
|
||||
- Out of scope:
|
||||
- C 端注册流程和代理登录流程。
|
||||
- 后端审批、数据库和企业微信回调实现。
|
||||
- 修改注册申请业务资料或审批结果。
|
||||
@@ -0,0 +1,33 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Agent Registration Application List
|
||||
|
||||
The admin frontend SHALL provide a paginated agent registration application list with the documented filters and backend response statuses.
|
||||
|
||||
#### Scenario: Filter registration applications
|
||||
|
||||
- **WHEN** an authorized user selects status, time, phone, keyword, parent shop, or submission anomaly filters
|
||||
- **THEN** the frontend MUST send those filters to `GET /api/admin/agent-distribution-registrations`
|
||||
- **AND** the list MUST display business, approval, and submission status names from the response
|
||||
|
||||
### Requirement: Agent Registration Application Detail
|
||||
|
||||
The admin frontend SHALL provide a detail page for `GET /api/admin/agent-distribution-registrations/{id}` and display the complete registration information returned by the backend.
|
||||
|
||||
#### Scenario: Open registration detail
|
||||
|
||||
- **WHEN** an authorized user opens a registration application
|
||||
- **THEN** the frontend MUST request the application detail by ID
|
||||
- **AND** MUST display the phone, address, shop, distribution code, business status, approval status, and submission status
|
||||
- **AND** MUST NOT display password or internal approval fields not present in the response
|
||||
|
||||
### Requirement: Recover Agent Registration Approval
|
||||
|
||||
The frontend SHALL expose `POST /api/admin/agent-distribution-registrations/{id}/recover-approval` only when `recoverable = true` and the user has the recovery permission.
|
||||
|
||||
#### Scenario: Recover approval
|
||||
|
||||
- **GIVEN** a registration response has `recoverable = true`
|
||||
- **WHEN** the user confirms “恢复审批”
|
||||
- **THEN** the frontend MUST call the recovery endpoint with only the registration ID
|
||||
- **AND** MUST refresh the detail after success or a state conflict
|
||||
@@ -0,0 +1,17 @@
|
||||
## 1. API And Types
|
||||
|
||||
- [x] 1.1 增加代理注册申请列表、详情和恢复审批 TypeScript 类型。
|
||||
- [x] 1.2 扩展 `AgentDistributionService`:列表、详情、恢复审批接口。
|
||||
- [x] 1.3 增加唯一权限常量 `list`、`detail`、`recoverApproval`。
|
||||
|
||||
## 2. Pages And Routes
|
||||
|
||||
- [x] 2.1 新增注册申请列表页和筛选条件。
|
||||
- [x] 2.2 新增详情页和审批/提交状态展示。
|
||||
- [x] 2.3 接入“恢复审批”按钮、确认、错误提示和刷新。
|
||||
- [x] 2.4 增加店铺管理下的列表/详情路由与中英文菜单文案。
|
||||
|
||||
## 3. Documentation And Verification
|
||||
|
||||
- [x] 3.1 将页面、详情和恢复审批权限写入 `docs/权限.md`。
|
||||
- [x] 3.2 运行类型检查、lint、编码检查、构建和 OpenSpec 校验。
|
||||
Reference in New Issue
Block a user