feat:代理现金余额不足100元展示、店铺业务员选择展示与筛选
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m34s

This commit is contained in:
luo
2026-07-20 12:17:02 +08:00
parent ca338dd345
commit e95dc8e4f5
12 changed files with 334 additions and 49 deletions

View File

@@ -0,0 +1,29 @@
# Change: 店铺平台业务员选择、展示与筛选
## Why
当前店铺没有记录负责的平台业务员,运营无法在新建、编辑、列表和详情中维护或查看业务归属。需要为店铺绑定可选的平台业务员,该绑定仅用于业务归属和通知关系,不承载分销、佣金或发展层级语义。
## What Changes
- 在店铺新建和编辑表单新增可清空、可搜索的“平台业务员”选择器。
- 候选业务员复用启用的平台账号查询接口,展示账号名和手机号摘要。
- 扩展店铺创建、更新、列表查询、列表返回和详情返回的数据契约,支持 `business_owner_account_id` 及业务员展示字段。
- 在店铺列表新增业务员列和按业务员筛选项,在店铺详情展示业务员名称和手机号摘要。
- 已停用的已绑定业务员仅用于历史列表和详情展示,不能作为新建或编辑表单的候选项。
- 不新增分销、佣金、发展层级或其他业务结算行为。
## Impact
- Affected specs: `shop-management`
- Affected code:
- `src/api/modules/shop.ts`
- `src/types/api/shop.ts`
- 平台账号查询 API 类型或服务模块
- `src/views/shop-management/list/index.vue`
- 店铺详情页或详情抽屉的展示配置
- API contracts:
- `POST /api/admin/shops`
- `PUT /api/admin/shops/{id}`
- `GET /api/admin/shops`
- `GET /api/admin/accounts?account_type=platform&status=1`

View File

@@ -0,0 +1,80 @@
## ADDED Requirements
### Requirement: Shop Platform Salesperson Assignment
The system SHALL allow users to assign or clear an optional platform salesperson for a shop during shop creation and editing. The assignment SHALL represent only business ownership and notification relationship and MUST NOT create distribution, commission, or hierarchy behavior.
#### Scenario: Assign an enabled platform account during shop creation
- **GIVEN** 用户进入店铺新建表单
- **WHEN** 用户在“平台业务员”可搜索下拉中选择一个启用的平台账号
- **THEN** 系统 MUST 提交该账号的 `business_owner_account_id`
- **AND** 候选项 MUST 展示账号名和手机号摘要
#### Scenario: Edit a shop salesperson assignment
- **GIVEN** 用户进入已存在店铺的编辑表单
- **WHEN** 用户选择不同的启用平台账号
- **THEN** 系统 MUST 在 `PUT /api/admin/shops/{id}` 请求中提交新的 `business_owner_account_id`
#### Scenario: Clear a shop salesperson assignment
- **GIVEN** 店铺已绑定平台业务员
- **WHEN** 用户清空“平台业务员”选择器并提交编辑表单
- **THEN** 系统 MUST 提交 `business_owner_account_id: null`
- **AND** 店铺不再关联该业务员
#### Scenario: Do not expose disabled accounts as editable candidates
- **WHEN** 用户打开或搜索“平台业务员”选择器
- **THEN** 系统 MUST 仅查询 `account_type=platform``status=1` 的账号
- **AND** 已停用平台账号 MUST NOT 作为新建或编辑候选项显示
#### Scenario: No eligible salesperson exists
- **GIVEN** 不存在启用的平台账号
- **WHEN** 用户打开“平台业务员”选择器
- **THEN** 系统 MUST 显示无可选账号状态
- **AND** 用户仍 MUST 能够不选择业务员完成表单提交
### Requirement: Shop Salesperson List Filtering And Display
The shop list SHALL display the assigned salesperson and support filtering by `business_owner_account_id`.
#### Scenario: Display salesperson in shop list
- **WHEN** 用户查看店铺列表
- **THEN** 列表 MUST 显示业务员列
- **AND** 已绑定业务员的行 MUST 展示 `business_owner_name``business_owner_phone_masked`
#### Scenario: Filter shops by salesperson
- **WHEN** 用户在店铺列表选择一个平台业务员作为筛选条件
- **THEN** 前端 MUST 在 `GET /api/admin/shops` 请求中提交该账号的 `business_owner_account_id`
- **AND** 列表 MUST 仅展示后端返回的匹配店铺
#### Scenario: Display historical disabled salesperson in list
- **GIVEN** 店铺历史上已绑定的平台业务员后来被停用
- **WHEN** 用户查看店铺列表
- **THEN** 列表 MUST 继续展示该店铺返回的 `business_owner_name``business_owner_phone_masked`
### Requirement: Shop Detail Salesperson Display
The shop detail SHALL display the assigned salesperson name and masked phone from the shop detail response, including historical assignments to disabled accounts.
#### Scenario: Display salesperson in shop detail
- **WHEN** 用户查看已绑定平台业务员的店铺详情
- **THEN** 页面 MUST 展示业务员名称和手机号摘要
#### Scenario: Display historical disabled salesperson in detail
- **GIVEN** 店铺绑定的业务员已停用
- **WHEN** 用户查看该店铺详情
- **THEN** 页面 MUST 继续使用详情响应中的 `business_owner_name``business_owner_phone_masked` 展示历史业务员信息
#### Scenario: Do not add distribution or commission semantics
- **WHEN** 用户查看店铺新建、编辑、列表或详情页面
- **THEN** 页面 MUST NOT 将平台业务员描述为分销关系、佣金关系或发展层级

View File

@@ -0,0 +1,27 @@
## 1. API Contract
- [x] 1.1 更新店铺创建和编辑请求类型,支持可空的 `business_owner_account_id`
- [x] 1.2 更新店铺列表查询类型,支持 `business_owner_account_id` 筛选参数。
- [x] 1.3 更新店铺列表和详情响应类型,读取业务员 ID、名称和脱敏手机号字段。
- [x] 1.4 复用启用平台账号查询接口,读取 `account_id``account_name``phone_masked` 作为候选项。
## 2. Shop Form UI
- [x] 2.1 在店铺新建和编辑表单增加可搜索、可清空的“平台业务员”下拉选择。
- [x] 2.2 候选项展示账号名和手机号摘要,仅查询并展示启用的平台账号。
- [x] 2.3 支持清空已选择业务员,并按 `business_owner_account_id: null` 提交。
- [x] 2.4 已停用业务员不出现在编辑候选项中。
## 3. Shop List And Detail UI
- [x] 3.1 在店铺列表增加业务员列,展示业务员名称和手机号摘要。
- [x] 3.2 在店铺列表搜索区增加按业务员筛选项,并提交选中的 `business_owner_account_id`
- [x] 3.3 在店铺详情展示业务员名称和手机号摘要;已停用但历史绑定的业务员仍正常显示。
## 4. Verification
- [ ] 4.1 验证创建、编辑、清空业务员和无可选账号状态。
- [ ] 4.2 验证列表业务员展示和按业务员筛选正确。
- [ ] 4.3 验证详情对历史停用业务员仍能展示名称和手机号摘要。
- [x] 4.4 确认页面不引入分销、佣金或发展层级文案。
- [x] 4.5 运行相关前端校验,并执行 `openspec validate update-shop-salesperson-selection --strict`