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