Files
shanxia2.0/docs/superpowers/specs/2026-07-31-pl-address-select-inline-create-design.md
T
zlwuandCursor 10c3c5470c chore: sync local PL/CRM/BX and migration work to new Gogs host
Bundle pending backend/web-admin feature updates, data-migration scripts,
and related docs so the V1.5 branch on the Tencent Cloud Gogs matches the
current workspace (excluding local secrets).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-01 09:19:21 +08:00

47 lines
2.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.
# 运输计划「从地址库选择」内嵌新增地址
**日期:** 2026-07-31
**状态:** 已实现
**选定方案:** 方案 1 — 在选择弹窗内嵌套「新增地址」弹窗;成功后自动选中并回填
## 1. 目标
在运输计划新增/编辑流程中,用户打开「从地址库选择」时,可直接新增地址库记录;新增成功后自动将该地址回填到运输计划表单(详细地址 + 经纬度),并关闭选择弹窗,无需再点「选择」。
## 2. 非目标
- 不改地址库管理页(`views/pl/transport-address/index.vue`)结构
- 不抽公共表单组件(后续有复用需求再抽)
- 不改后端 API
- 不改 `pl-address-with-library` 的回填逻辑(仍依赖 `select` 事件)
## 3. 交互
1. 「从地址库选择」弹窗列表区上方增加工具栏,主行动按钮「新增地址」(Plus 图标 + `type="primary"`)。
2. 点击后打开嵌套「新增地址」弹窗(`append-to-body`)。
3. 表单字段:地址名称、详细地址(地图选点)、联系人、联系电话、备注。状态固定 `1`(启用),表单不展示状态字段。
4. 确定:校验通过后调用 `transportAddressApi.create`;成功后提示「新增成功」,关闭新增弹窗,对返回记录调用与「选择」相同的 `handleConfirm`(`emit('select')` + 关闭选择弹窗)。
5. 取消:仅关闭新增弹窗,选择弹窗保持打开。
## 4. 改动文件
| 文件 | 变更 |
|------|------|
| `web-admin/src/components/business/pl-transport-address-select-dialog/index.vue` | 工具栏 + 嵌套新增弹窗 + 提交后自动 `select` |
## 5. 校验与 UI
- 必填:地址名称、详细地址、经纬度(地图选点)
- `label-position="top"`,`dialog-form-layout`,遮罩无 blur,底栏 Close / Check 图标
- 字段与地址库管理页新增表单对齐(除状态外)
## 6. 数据流
```
选择弹窗 → 新增弹窗 → transportAddressApi.create
→ TransportAddress
→ handleConfirm(row)
→ emit('select', row)
→ pl-address-with-library 回填 fullAddress / lng / lat
```