Files
smart_grid_iot/.trae/specs/generate-floor-options-from-building/spec.md
T
wk 7c915f8946 docs(specs): 新增现场勘察业务相关 spec 文档
- rework-survey-equipment-tree:勘察设备树明细模式重构
- fix-equipment-topology-display:设备拓扑图完整显示修复
- survey-detail-building-select:勘察明细所属建筑下拉
- generate-floor-options-from-building:按建筑楼层生成楼层下拉
- survey-progress-track-detail:进度跟踪跳转勘察明细页
- survey-complete-to-tech-review:勘察完成提交技术复核与复核按钮改名
2026-10-25 02:34:18 +08:00

70 lines
3.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 勘察明细设备表单:所在位置改为所属建筑下拉 Spec
## Why
勘察明细页新增/编辑设备时,「所在位置」目前是自由文本输入,无法与客户建筑体系关联,与设备管理台账页的「所属建筑」下拉选择不一致。
## What Changes
* 勘察明细页(`views/dispatch/survey/detail.vue`)两处设备表单(①新增/编辑客户设备弹窗 equipForm;②右侧节点属性面板 nodeForm):
* 「所在位置」文本输入 → 「所属建筑」下拉选择(`buildingId`,按工单客户过滤建筑,可清空选填)
* 同时增加「所在楼层」输入(`floorNo`,文本,选填)
* 「具体位置」(`location`)保留为可选文本输入
* 建筑下拉数据源:`customerBuildingApi.getList({ customerId, page: 1, pageSize: 999 })`,在工单详情加载成功与设备树刷新时按工单客户加载
* 提交与回显:新增/编辑设备与保存节点属性时携带 `buildingId`/`floorNo`/`location`;编辑选中节点与打开编辑弹窗时回显
* 与设备管理台账页「位置信息」区块保持一致(所属建筑/所在楼层/具体位置三件套,均为选填)
## Impact
* Affected specs: 勘察派单重构(rework-survey-equipment-tree)交付的勘察明细页设备维护能力
* Affected code:
* `client/src/views/dispatch/survey/detail.vue`(两处表单模板 + equipForm/nodeForm 数据模型 + 提交/回显/加载逻辑)
* 不改动:后端 `customer_equipment.service.ts`(create/update 已透传 buildingId/floorNo)、`api/customerEquipment.ts`(类型已含 buildingId/floorNo/location)、设备管理台账页、空间拓扑页
## ADDED Requirements
### Requirement: 设备表单按所属建筑选择位置
勘察明细页新增/编辑设备时,系统 SHALL 提供「所属建筑」下拉(按当前工单客户过滤建筑,可清空),并同时提供「所在楼层」与「具体位置」可选输入。
#### Scenario: 新增/编辑设备
* **WHEN** 用户在勘察明细页新增或编辑客户设备
* **THEN** 表单显示「所属建筑」下拉(选项为该客户的建筑)、「所在楼层」输入、「具体位置」输入,保存后设备携带 `buildingId`/`floorNo`/`location`,再次编辑时正确回显
## MODIFIED Requirements
### Requirement: 设备表单「所在位置」字段
* 原「所在位置」文本输入由「所属建筑」下拉 +「所在楼层」输入 +「具体位置」输入替代(两处表单均生效)
* `location` 数据保留可维护,「所属建筑」「所在楼层」为新增可维护字段
## REMOVED Requirements
### Requirement: 无 —— 仅调整勘察明细页设备表单的位置信息录入方式
**Reason**: 无移除
**Migration**: 无
## 假设(已与用户确认)
* 两处表单都改(弹窗 + 右侧属性面板)
* 「具体位置」(location)保留为可选文本输入
* 同时增加「所在楼层」(floorNo)输入
* 所属建筑/所在楼层/具体位置均为选填(与设备管理台账页一致,必填仍为设备名称/类型)