Files
SupplierSystem/docs/design/20260903-web-copilot-page-control.md
T
Ubuntu deb3e72750
CI / server typecheck + tests (push) Canceled after 0s
CI / web typecheck + tests + miniprogram syntax (push) Canceled after 0s
CI / eslint (观察项,C7 骨架) (push) Canceled after 0s
CI / npm audit (critical 硬拦) (push) Canceled after 0s
chore: 以 AI 生鲜配送系统 当前版本作为 SupplierSystem 起点
来源仓库:jxc/ai-fresh-delivery
来源提交:f0b1a180e2deb7e4673b9d1c8542619f7bc0f73d
快照树:  09f679334ff38f0ff25e907961c94a8223bcaedd(与来源 HEAD 工作树逐字节一致,3801 个文件)

按约定本仓库不带任何历史提交:来源仓库的历史中含真实凭据
(生产 SSH 私钥 deploy/id_rsa_tencent、server/.env、.env.tencent/.env.production/.env.gitea、
deploy/小程序AppSecret.txt,其中 MP_APPSECRET / S3 AccessKey 经哈希比对与线上同值),
整包推送会把这些凭据永久带入本仓库,故只取「当前版本」的单提交快照。
供应商系统后续开发自本提交开始。
2026-10-08 17:35:43 +08:00

54 lines
2.2 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.
# Web 助手:权限内导航与页面控制(录单样板)
日期:2026-09-03
## 目标 / 非目标
### 目标
- 管理员悬浮球改为对话编排器:按当前账号侧栏可见菜单导航;录单可灌入草稿、对话改行。
- 创建订单必须人确认,走录单页原提交闸门,不旁路写库。
- 拆条仍走 `parseOrderThreeLayer`(Web `includeParseCategory: true`)。Host 只编排。
### 非目标
- 其它业务页不接改数,只支持打开页面。
- 不改小程序、销售价/成本口径、订单状态机。
- Web 对话禁止调用 `submit_order`(API 渠道)。
- 不复活 `ChatBot.tsx`。
## 方案要点
- 可见页 = `useMenuLayout` + 与侧栏相同的权限过滤。
- 录单适配:`getSnapshot` / `applyIntent` / `requestCommit` → 只开 `SubmitConfirmModal`。
- `POST /api/mcp/order-entry/chat` 增加 `client: web_fab`:工具集不含 `submit_order`;返回 `ui_actions` 由前端执行。
- 解析成功走现有 `stashOrderEntryIntake`。
## 改动面
- 本文、`docs/design/README.md`、`docs/API.md`
- `server/src/mcp/*`、`server/src/routes/orderEntryAgent.ts`
- `src/utils/menuAccessFilter.ts`、`src/copilot/*`、`OrderEntryIntakeFab.tsx`、`Layout.tsx`、`CustomerOrder.tsx`
## 验收标准
- [x] 「竞价在哪」有权限则进 `/orders/bids`,无权限拒绝(`list_pages`/`propose_navigate` 以侧栏可见页为准)
- [x] 录单灌入后改数量只改草稿、不建单(`propose_page_patch` → `patchOrderItem`)
- [x] 「提交」只出录单页确认框;取消无新单(`requestCommit` → `submitOrder`)
- [x] Web 对话工具列表不含 `submit_order`
- [x] 无 `order_entry` 不能灌入录单草稿(解析仍走权限函数;FAB 可见性含 order_entry)
## 验证
- [x] `WEB_FAB_TOOL_SCHEMAS` 不含 `submit_order`
- [x] 侧栏过滤抽出 `filterRuntimeMenuByAccess`,Layout 与 FAB 共用
- [x] 拆条:文字走 `parseOrderThreeLayer`+`includeParseCategory`;图片走前端 `parse-order-three-layer`
- [x] 提交只开 `SubmitConfirmModal`,不调 API `submit_order`
- [ ] 浏览器手测导航/改数量/确认提交(需登录)
偏差:无。
## 风险与回滚
模型乱改行:必须匹配 `item_id` 或唯一品名。回滚:FAB 退回一次性表单。