日期: 2026-05-17 状态: DRAFT 需求来源:
docs/中科兴皖需求V0.3.md§2.3
一次性实现中试服务管理下 6 个基础数据管理模块,涵盖后端 API、前端页面、路由和菜单配置。数据库表已全部建好(docs/sql/zkxw.sql),无数据。
| # | 模块 | 表 | 前端模板 | 复杂度 |
|---|---|---|---|---|
| 2.3.1 | 细胞产品类型管理 | biz_cell_product_type |
unit/index.vue |
简单 CRUD |
| 2.3.2 | 细胞产品规格管理 | biz_cell_product_spec |
unit/index.vue |
简单 CRUD |
| 2.3.3 | 细胞产品价格体系管理 | biz_cell_product_price |
unit/index.vue |
中等 — 含下拉关联 |
| 2.3.4 | 细胞产品项目价格管理 | biz_cell_product_project_system + biz_cell_product_project_system_item |
category/index.vue |
较复杂 — 主子表 |
| 2.3.5 | 渠道信息管理 | biz_channel + 4 张子表 |
product/index.vue |
复杂 — 多 tab + 子表 |
| 2.3.6 | 体检机构及项目价格 | biz_checkup_institution + 2 张子表 |
category/index.vue |
较复杂 — 主子表 |
2.3.1 → 2.3.2 → 2.3.3 → 2.3.4 → 2.3.6 → 2.3.5
理由:2.3.3 依赖 2.3.1/2.3.2 的下拉数据;2.3.4 依赖 2.3.3;2.3.5 渠道协议价格引用 2.3.1/2.3.2/2.3.3。
| 决策 | 选择 | 理由 |
|---|---|---|
| 后端路由文件 | backend/app/api/pilot_service.py 单文件 |
6 模块关联紧密,跟随 basic_info.py 模式 |
| 后端 CRUD 文件 | backend/app/crud/pilot_service.py 单文件 |
与路由文件对应 |
| 后端 Model | 在 backend/app/models/models.py 中追加 |
遵循现有单文件模式 |
| 前端 API | 在 web-admin/src/api/admin.ts 中追加 |
遵循现有模式 |
| 前端页面目录 | web-admin/src/views/pilot-service/{module}/index.vue |
独立一级路由 |
| 前端路由 | web-admin/src/router/modules/sqxp.ts 中追加 |
现有中试服务路由位置 |
| 菜单 SQL | docs/sql/sys_menu_pilot_service.sql |
独立增量 SQL |
| 渠道协议价格来源 | 同时支持价格体系(2.3.3)和项目价格体系(2.3.4) | 用户确认,方便渠道自由组合 |
backend/app/models/models.py)在文件末尾追加 13 个 SQLAlchemy Model 类。所有 Model 遵循现有模式:
id → 业务字段 → tenant_no, order_num, remark, create_by, create_dept_id, create_time, update_by, update_time, del_flag
新增 Model 清单:
BizCellProductType — biz_cell_product_typeBizCellProductSpec — biz_cell_product_specBizCellProductPrice — biz_cell_product_priceBizCellProductProjectSystem — biz_cell_product_project_systemBizCellProductProjectSystemItem — biz_cell_product_project_system_itemBizChannel — biz_channelBizChannelAgreement — biz_channel_agreementBizChannelAgreementProductPrice — biz_channel_agreement_product_priceBizChannelInvoice — biz_channel_invoiceBizChannelMailAddress — biz_channel_mail_addressBizCheckupInstitution — biz_checkup_institutionBizCheckupInstitutionInvoice — biz_checkup_institution_invoiceBizCheckupInstitutionProject — biz_checkup_institution_projectbackend/app/crud/pilot_service.py)单文件,按模块分段组织,每段包含:
_row_to_dict_xxx() — 转换为 camelCase 字典list_xxx() — 分页列表 + keyword 搜索 + tenant_no 过滤get_xxx() — 单条查询xxx_code_exists() — 唯一性校验(编码字段)create_xxx() — 新增update_xxx() — 更新soft_delete_xxx() — 软删除子表额外函数:
list_xxx_items(parent_id) — 按 parent_id 查子表列表create_xxx_item() / update_xxx_item() / soft_delete_xxx_item() — 子表 CRUDbackend/app/api/pilot_service.py)单文件,APIRouter(prefix="/web/admin", tags=["中试服务管理"])。
每个实体提供 4 个标准端点:
| 方法 | 路径 | 说明 | 权限 |
|---|---|---|---|
| GET | /cell-product-types |
分页列表 | require_menu_code |
| POST | /cell-product-types |
新增 | require_admin_or_super_admin |
| PUT | /cell-product-types/{id} |
更新 | require_admin_or_super_admin |
| DELETE | /cell-product-types/{id} |
删除 | require_admin_or_super_admin |
子表额外端点(如项目价格体系明细、渠道子表等):
| 方法 | 路径 | 说明 |
|---|---|---|
| GET | /cell-product-project-systems/{id}/items |
获取子表明细 |
| POST | /cell-product-project-systems/{id}/items |
新增子表行 |
| PUT | /project-system-items/{id} |
更新子表行 |
| DELETE | /project-system-items/{id} |
删除子表行 |
Pydantic Body Model 定义在路由文件内部,使用 alias 支持 camelCase。
渠道信息管理(2.3.5)因其复杂度,需要以下额外端点:
PUT /channel-agreements/{id}/activate 和 PUT /channel-agreements/{id}/voidbackend/app/api/__init__.py — 添加 from app.api.pilot_service import router as pilot_service_router + __all__backend/app/main.py — from app.api import ..., pilot_service_router + app.include_router(pilot_service_router, prefix=settings.API_V1_PREFIX)web-admin/src/api/admin.ts)追加以下 API 函数(每个实体 4 个:list / create / update / delete):
// 2.3.1 细胞产品类型
fetchCellProductTypeList / fetchCreateCellProductType / fetchUpdateCellProductType / fetchDeleteCellProductType
// 2.3.2 细胞产品规格
fetchCellProductSpecList / fetchCreateCellProductSpec / fetchUpdateCellProductSpec / fetchDeleteCellProductSpec
// 2.3.3 细胞产品价格体系
fetchCellProductPriceList / fetchCreateCellProductPrice / fetchUpdateCellProductPrice / fetchDeleteCellProductPrice
// 2.3.4 细胞产品项目价格体系
fetchProjectSystemList / fetchCreateProjectSystem / fetchUpdateProjectSystem / fetchDeleteProjectSystem
fetchProjectSystemItems / fetchCreateProjectSystemItem / fetchUpdateProjectSystemItem / fetchDeleteProjectSystemItem
// 2.3.5 渠道信息
fetchChannelList / fetchCreateChannel / fetchUpdateChannel / fetchDeleteChannel
fetchChannelInvoices / fetchCreateChannelInvoice / fetchUpdateChannelInvoice / fetchDeleteChannelInvoice
fetchChannelMailAddresses / fetchCreateChannelMailAddress / fetchUpdateChannelMailAddress / fetchDeleteChannelMailAddress
fetchChannelAgreements / fetchCreateChannelAgreement / fetchUpdateChannelAgreement / fetchDeleteChannelAgreement
fetchChannelAgreementPrices / fetchCreateChannelAgreementPrice / fetchUpdateChannelAgreementPrice / fetchDeleteChannelAgreementPrice
fetchActivateChannelAgreement / fetchVoidChannelAgreement
// 2.3.6 体检机构
fetchCheckupInstitutionList / fetchCreateCheckupInstitution / fetchUpdateCheckupInstitution / fetchDeleteCheckupInstitution
fetchCheckupInstitutionInvoices / fetchCreateCheckupInstitutionInvoice / ...
fetchCheckupInstitutionProjects / fetchCreateCheckupInstitutionProject / ...
web-admin/src/views/pilot-service/
├── cell-product-type/index.vue # 2.3.1 — 复制 unit/index.vue
├── cell-product-spec/index.vue # 2.3.2 — 复制 unit/index.vue
├── cell-product-price/index.vue # 2.3.3 — 复制 unit/index.vue,表单含下拉关联
├── project-price-system/index.vue # 2.3.4 — 复制 category/index.vue,主子表
├── channel/index.vue # 2.3.5 — 复制 product/index.vue,多 tab + 子表
└── checkup-institution/index.vue # 2.3.6 — 复制 category/index.vue,主子表
product_type_code)、类型名称(product_type_name)、排序号、备注、创建时间、操作SystemViewDialog,展示基本信息spec_code)、规格名称(spec_name)、排序号、备注、创建时间、操作SystemViewDialogproject_name)、项目编码(project_code)、细胞类型名称(cell_type_name)、规格(spec_text)、单价(unit_price)、排序号、备注、创建时间、操作cell_type_code + cell_type_name)spec_id + spec_text)system_name)、体系编码(system_code)、状态(tag)、排序号、备注、创建时间、操作source_price_id, project_name, project_code, cell_type_code, cell_type_name, spec_text, spec_id, cell_product_type_idunit_price 默认带入选中的价格,但可修改channel_name)、统一社会信用代码(credit_code)、渠道类型(tag)、联系人、联系电话、排序号、创建时间、操作institution_name)、机构地址、联系人、联系电话、状态(tag)、排序号、创建时间、操作在 web-admin/src/router/modules/sqxp.ts 中添加:
{
id: '80000000000000000000000000000001',
name: 'PilotService',
path: '/pilot-service',
component: '/index/index',
meta: {
title: '中试服务管理',
icon: 'ri:flask-line',
keepAlive: false,
roles: ['admin']
},
children: [
{
id: '80000000000000000000000000000002',
name: 'CellProductType',
path: 'cell-product-type',
component: '/pilot-service/cell-product-type/index',
meta: { title: '细胞产品类型管理', keepAlive: true }
},
{
id: '80000000000000000000000000000003',
name: 'CellProductSpec',
path: 'cell-product-spec',
component: '/pilot-service/cell-product-spec/index',
meta: { title: '细胞产品规格管理', keepAlive: true }
},
{
id: '80000000000000000000000000000004',
name: 'CellProductPrice',
path: 'cell-product-price',
component: '/pilot-service/cell-product-price/index',
meta: { title: '细胞产品价格体系管理', keepAlive: true }
},
{
id: '80000000000000000000000000000005',
name: 'ProjectPriceSystem',
path: 'project-price-system',
component: '/pilot-service/project-price-system/index',
meta: { title: '细胞产品项目价格管理', keepAlive: true }
},
{
id: '80000000000000000000000000000006',
name: 'Channel',
path: 'channel',
component: '/pilot-service/channel/index',
meta: { title: '渠道信息管理', keepAlive: true }
},
{
id: '80000000000000000000000000000007',
name: 'CheckupInstitution',
path: 'checkup-institution',
component: '/pilot-service/checkup-institution/index',
meta: { title: '体检机构及项目价格', keepAlive: true }
}
]
}
新增文件 docs/sql/sys_menu_pilot_service.sql,包含:
id=2)所有页面严格遵循 docs/web-admin-ui-spec-fresh-mint.md 和 AGENTS.md 中的 UI 约定:
#10b981(Fresh Mint),不使用小程序颜色label-position="top",使用 .dialog-form-layout + .form-grid-2backdrop-filter: none,max-height: calc(100vh - 100px) 只 body 滚动panel-top → h2.title-bar-heading 带竖线type="primary",工具栏"已选 N 项"在前order_num 排序字段(按 AGENTS.md 约定)fixed="right",min-width ≥ 260px| # | 文件 | 操作 |
|---|---|---|
| 1 | backend/app/models/models.py |
追加 13 个 Model |
| 2 | backend/app/crud/pilot_service.py |
新建 |
| 3 | backend/app/api/pilot_service.py |
新建 |
| 4 | backend/app/api/__init__.py |
追加 import + all |
| 5 | backend/app/main.py |
追加 include_router |
| 6 | web-admin/src/api/admin.ts |
追加 API 函数 |
| 7 | web-admin/src/views/pilot-service/cell-product-type/index.vue |
新建 |
| 8 | web-admin/src/views/pilot-service/cell-product-spec/index.vue |
新建 |
| 9 | web-admin/src/views/pilot-service/cell-product-price/index.vue |
新建 |
| 10 | web-admin/src/views/pilot-service/project-price-system/index.vue |
新建 |
| 11 | web-admin/src/views/pilot-service/channel/index.vue |
新建 |
| 12 | web-admin/src/views/pilot-service/checkup-institution/index.vue |
新建 |
| 13 | web-admin/src/router/modules/sqxp.ts |
追加路由 |
| 14 | docs/sql/sys_menu_pilot_service.sql |
新建 |
以下内容不在本次实现中(后续模块需要):
apply_data_scope)— 本次使用 require_admin_or_super_admin,后续按需添加