修正 ERP 边界与资产页面一致性(05-30-fix-erp-boundary-asset-consistency)

这个提交包含在:
2026-05-30 23:06:02 +08:00
父节点 16fd9bdf52
当前提交 f299ceeb74
共修改 47 个文件,包含 476 行新增和 1633 行删除
@@ -361,8 +361,9 @@ point and prevents each route from inventing a different title/action layout.
- `个人设置` stays in the topbar account menu. Notifications stay in the topbar
bell and notification center.
- Finance labels should use work names such as `付款`, `应付账款` and `票据`;
internal platform words like `AP 运营`, `ERP 集成` and `功能开关` should be
hidden behind management wording or renamed for users.
internal platform words like `AP 运营` and `功能开关` should be hidden behind
management wording or renamed for users. `ERP 集成` is not a hyb-oa product
entry.
- `更多` is a lightweight collapsed row for low-frequency, frozen, staged or
occasional entries; do not add a sidebar explanation card, subtitle or
onboarding copy around it.
@@ -652,7 +653,7 @@ screen.
- Procurement ledgers in V1 are request, approval, attachment, light
acceptance/archive and relation surfaces for project, contract and payment/AP
context. Do not design `/purchase-requests` as purchase-order lifecycle,
inventory, three-way matching, supplier-lifecycle, tendering or ERP software.
inventory, three-way matching, supplier-lifecycle or tendering software.
Approved procurement means the request was approved; it does not imply paid,
received into inventory or converted into a fixed asset.
- Project pages in V1 are light project ledgers for status, owner/member,
@@ -665,10 +666,11 @@ screen.
- Finance ledgers in V1 are payment-preparation, payment-batch, receipt-audit,
AP-status, invoice/OCR-status and agency-accounting handover summaries. Do
not design payment, AP or invoice pages as online banking, bank-statement
ingestion, ERP/general-ledger, voucher-generation, auto-reconciliation, tax
filing or full accounting software. Real payment stays in offline banking or
existing finance/accounting workflows; OA records status, evidence and
handover summaries.
ingestion, general-ledger, voucher-generation, auto-reconciliation, tax filing
or full accounting software. Real payment stays in offline banking or existing
finance/accounting workflows; OA records status, evidence and handover
summaries. hyb-oa does not connect to ERP now and does not plan ERP
integration later.
- Payment, AP and invoice pages default to task/exception visibility: `付款`
shows review, payment-marking, receipt and exception attention before batch
creation; `应付账款` shows pending payment, exceptions, risks and differences
@@ -710,7 +712,8 @@ subsystem.
- The default `/assets` view answers where the asset is, who uses it, who is
responsible for it, what state it is in and whether it needs inventory or
handover. Do not lead with depreciation, accounting subjects or ERP sync.
handover. Do not lead with depreciation, accounting subjects or external
finance sync.
- Register physical items that must be returned, transferred, inventoried or
protected, such as computers, monitors, disks, equipment and security media.
Do not create `FA` cards for ordinary consumables.
@@ -738,9 +741,10 @@ subsystem.
- Move depreciation, residual value, accounting subject and monthly
depreciation voucher concepts out of the OA primary UI unless a later Trellis
task explicitly scopes accounting-ledger work.
- Keep classification maintenance, ERP sync, raw metadata and advanced filters
behind management, collapsed or advanced surfaces so they do not dominate the
asset list/detail first screen.
- Keep classification maintenance, raw metadata and advanced filters behind
management, collapsed or advanced surfaces so they do not dominate the asset
list/detail first screen. Do not show ERP sync state or ERP asset numbers in
the asset UI.
- Mobile asset lookup should prefer QR scan and fall back to asset number or
serial number input. Do not require heavy photo inventory unless a later task
explicitly scopes it.
@@ -1141,9 +1145,10 @@ request, frontend click or message attempt as final business completion.
- Enterprise WeChat owns daily HR/attendance actions: check-in, leave, missed
punch, outing and overtime. OA shows mirror, history, exception, audit and
emergency-takeover records for those domains.
- ERP, agency accounting, bank, OCR and Enterprise WeChat messages are external
- Agency accounting, bank, OCR and Enterprise WeChat messages are external
capabilities or delivery channels. They do not replace OA server-side
permissions or state machines.
permissions or state machines. ERP is outside hyb-oa's product boundary and
must not appear as a current or future user-facing integration.
- Show final labels such as `已同步`, `已发送`, `已付款` and `识别完成` only when the
relevant external system has returned a clear success acknowledgement.
- Use in-progress labels such as `同步中`, `等待回执`, `银行处理中`, `识别中` and
@@ -1152,8 +1157,8 @@ request, frontend click or message attempt as final business completion.
such as `银行回执未返回` or `OCR 识别失败,需重新上传 PDF`.
- Do not expose raw external error codes, payloads, full URLs, secrets, tokens
or debug traces to ordinary users.
- External writes, payment execution, ERP sync, Enterprise WeChat resend and OCR
retry must be controlled by permissions and state-driven actions.
- External writes, payment execution, Enterprise WeChat resend and OCR retry
must be controlled by permissions and state-driven actions.
- Retry confirmation should explain which object will be retried, whether it may
send duplicate external messages, external-system impact and audit effect.
- External sync state should not block unrelated primary flows. If it blocks a
@@ -1165,8 +1170,9 @@ request, frontend click or message attempt as final business completion.
unless OA emergency takeover is explicitly enabled.
- Enterprise WeChat messages carry desensitized summary and OA deeplink only;
they do not carry sensitive attachment text or final payment/approval actions.
- If bank, ERP, agency accounting or another integration is not connected or not
confirmed, UI copy must not imply the capability already completed.
- If bank, agency accounting or another enabled integration is not connected or
not confirmed, UI copy must not imply the capability already completed. Do not
use ERP as a placeholder for future integration copy.
**Why**: External integrations are asynchronous and failure-prone. Conservative
copy prevents users from trusting a state the system has not actually verified.
@@ -1176,7 +1182,7 @@ copy prevents users from trusting a state the system has not actually verified.
- `cd client && npm run typecheck`
- `cd client && npm run build`
- Focused Playwright coverage when changing Enterprise WeChat boundary copy,
OCR status, bank/payment callbacks, ERP/accounting sync status, retry
OCR status, bank/payment callbacks, accounting handover status, retry
controls, external failure messages or integration diagnostics.
## Convention: Verification And User-Testable Claims
@@ -0,0 +1,3 @@
{"file": ".trellis/spec/hyb-oa/frontend-react-vite-design.md", "reason": "检查列表/详情/动作区是否符合统一成熟页面规则"}
{"file": "docs/产品设计规则.md", "reason": "检查无 ERP、员工姓名编号、资产业务边界是否沉淀"}
{"file": ".trellis/spec/hyb-oa/security-privacy.md", "reason": "检查敏感信息和外部系统文案没有误暴露"}
@@ -0,0 +1,3 @@
{"file": ".trellis/spec/hyb-oa/frontend-react-vite-design.md", "reason": "统一前端页面基线、资产台账和详情页动作区规则"}
{"file": "docs/产品设计规则.md", "reason": "产品边界、无 ERP 口径、资产管理业务事实"}
{"file": ".trellis/spec/hyb-oa/security-privacy.md", "reason": "资产敏感字段与外部系统文案清理的隐私边界"}
@@ -0,0 +1,13 @@
# 实施说明
## 设计决策
- ERP 是产品边界外能力:当前 UI、导航、设置、功能开关和默认业务详情不再暴露 ERP 入口、同步状态或未来接入口径。
- 资产首屏按业务台账处理:列表只负责查找、状态和进入详情,详情采用主内容区加 PC 右侧操作面板。
- 资产操作区集中承接保存、领用、归还和调拨,按钮横向排列,普通解释文案不默认展示。
- 账号默认展示中文姓名和员工编号;已有本地账号的 `employee_no` 不强制更新,因为数据库约束把员工号视为不可变字段。
## 验证限制
- 本地真实资产 E2E 受数据库迁移漂移阻断,当前库缺少 `asset_cards.asset_type` 和 `purchase_requests.project_id` 等列;本任务不擅自执行数据库迁移。
- 资产页面已用 mock API 做浏览器检查,验证无 ERP 文案、右侧操作区、中文姓名和员工号展示。
@@ -0,0 +1,67 @@
# 修正 ERP 边界与资产页面一致性
## Goal
把用户反馈的产品边界和资产页面一致性问题收口到同一批改造:OA 不再出现 ERP 作为当前或未来接入对象;账号展示使用中文姓名和员工编号;资产列表、资产详情和资产操作区回到全系统统一的成熟企业台账/详情页规则。
## What I already know
- 目标用户是国内、小于 10 人的科技初创公司,页面应优先采用成熟 OA / Feishu / Ant Design Pro 式常规交互,不做创新型操作命名或解释性堆砌。
- 用户明确确认:系统中没有 ERP,以后也不会有 ERP。
- 员工账号应有中文姓名和员工编号,不能在真实可见路径里默认展示 `Admin`、`Employee`、`Finance Manager` 这类英文角色名。
- `client/src/pages/AssetRegistryPage.tsx` 的资产列表仍使用页面本地 `Table` 组件结构,视觉密度和报销等列表不一致。
- 资产详情页仍是单列大卡堆叠,存在基础信息、责任归档、流转、ERP 同步、AI 建议、保存动作等多处操作与说明,和统一详情工作区的右侧状态/动作面板不一致。
- `server/src/scripts/seed-dev.js` 默认开发账号姓名为英文角色名;`client/tests/e2e/helpers/auth.ts` 和多条 E2E fixture 也有英文名。
- `docs/产品设计规则.md` 和 `.trellis/spec/hyb-oa/frontend-react-vite-design.md` 已有部分 no-ERP 事实,但仍把 ERP 写成“外部能力/外部系统”或资产高级轨道。
## Requirements
- 用户可见 UI、导航、设置、功能开关和资产/采购/报销详情的默认路径不得出现 ERP 文案、ERP 入口或 ERP 未来接入口径。
- 后端 API、数据库表、历史迁移或内部代码中的 `erp_*` 技术遗留不在本任务大拆;但不能通过前端入口、菜单或说明暴露为产品能力。
- 开发和自动化默认账号改为中文姓名,并保留员工编号。测试代码中需要登录识别的用户对象也应同步中文显示名。
- 资产列表采用与报销列表一致的业务台账样式:单列列表首屏、统一 `PrimaryTable` + `table-row/table-td` 密度、右侧操作列、移动端卡片尾部动作。
- 资产台账工具只承接低频管理能力,例如分类维护、高级筛选和新建资产;首屏不把工具详情铺在左侧或常驻在列表旁。
- 资产详情采用统一详情工作区:顶部摘要、主内容区信息/证据、PC 右侧状态与操作面板,移动端保持单列和底部/就近主动作。
- 资产流转动作集中到详情操作区,按钮横向排列;基础信息保存、领用、归还、调拨等动作位置稳定,不分散在多个大卡下方。
- 资产详情默认减少解释性句子,仅保留安全/权限/高敏字段等必要边界提示。
## Scope
- 前端页面:资产台账/详情、报销详情财务导出暴露面、顶部账号展示、导航/设置/功能开关中的 ERP 入口隐藏。
- 开发与测试账号:开发种子和常用 E2E fixture 的默认显示名改为中文,并保留员工编号展示。
- 事实源:更新 `docs/产品设计规则.md` 和 `.trellis/spec/hyb-oa/frontend-react-vite-design.md` 中的 no-ERP 和资产详情操作区规则。
- 验证:前端类型检查、构建、聚焦 Playwright/mock 视觉检查、Trellis task 校验、governance 和 diff 检查。
## Acceptance Criteria
- [x] `/assets` PC 首屏资产列表和报销等台账使用一致的表格密度、右侧操作列和单列首屏结构。
- [x] 资产详情 PC 端出现统一右侧状态/动作面板;流转、保存、返回等动作不再分散在页面底部或独立大块中。
- [x] 资产详情默认不显示 ERP 同步状态、ERP 资产编号或 ERP 重试操作。
- [x] 管理入口、功能开关和普通业务页面不再向用户展示 ERP 作为系统能力。
- [x] 开发/E2E 默认账号中文显示名与员工编号同步,顶部账号、人员选择和测试 fixture 不再默认依赖英文角色名。
- [x] 文档和 Trellis spec 固化:OA 无 ERP,未来也不规划接入;资产页不以 ERP/会计固定资产账为产品口径。
- [x] 前端类型检查、构建、相关 Playwright 或截图检查通过;Trellis governance 和 `git diff --check` 通过。真实资产 E2E 因本地数据库 schema 漂移阻断,已记录在 `implement.md`。
## Out of Scope
- 不删除历史数据库迁移、已有后端 ERP 命名服务、历史 API 路径或老数据表,以免扩大破坏面;本任务只清理产品暴露面和当前默认 UI。
- 不引入新的外部系统、财务软件、总账、银行直连、自动凭证或折旧模块。
- 不重做资产数据模型、盘点任务引擎或二维码贴标全流程。
- 不修改公网真实数据,除非后续部署/验证步骤明确需要并获得批准。
## Test Plan
- `cd client && npm run typecheck`
- `cd client && npm run build`
- 聚焦 Playwright:资产列表/详情、跨页面 UI 一致性、登录/顶部账号显示相关用例。
- `python3 ./.trellis/scripts/task.py validate 05-30-fix-erp-boundary-asset-consistency`
- `node scripts/qa/check-trellis-governance.mjs`
- `git diff --check`
- 若需要告知线上可测,部署后再跑公网 `/ready`、bundle copy 扫描和可用凭据范围内的 live smoke。
## Technical Notes
- 主要前端文件:`client/src/pages/AssetRegistryPage.tsx`、`client/src/pages/ErpIntegrationPage.tsx`、`client/src/pages/SystemSettingsPage.tsx`、`client/src/pages/FeatureFlagsPage.tsx`、`client/src/features/navigation/schema.ts`。
- 账号/fixture:`server/src/scripts/seed-dev.js`、`server/src/scripts/seed-trialrun.js`、`client/tests/e2e/helpers/auth.ts` 和涉及 mock `me.name` 的 E2E。
- 事实源:`docs/产品设计规则.md`、`.trellis/spec/hyb-oa/frontend-react-vite-design.md`。
- 设计裁决按 `frontend-design` skill 和现有成熟企业页面基线执行。
@@ -0,0 +1,33 @@
{
"id": "fix-erp-boundary-asset-consistency",
"name": "fix-erp-boundary-asset-consistency",
"title": "修正 ERP 边界与资产页面一致性",
"description": "清理用户可见 ERP 产品暴露,统一资产台账/详情交互,并同步中文姓名与员工编号展示。",
"status": "in_progress",
"dev_type": null,
"scope": "client,server,docs,trellis-spec",
"package": null,
"priority": "P2",
"creator": "shunli",
"assignee": "shunli",
"createdAt": "2026-05-30",
"completedAt": null,
"branch": null,
"base_branch": "main",
"worktree_path": null,
"commit": null,
"pr_url": null,
"subtasks": [],
"children": [],
"parent": null,
"relatedFiles": [
"client/src/pages/AssetRegistryPage.tsx",
"client/src/pages/ReimbursementDetailPage.tsx",
"client/src/components/navigation/Topbar.tsx",
"server/src/scripts/seed-dev.js",
"docs/产品设计规则.md",
".trellis/spec/hyb-oa/frontend-react-vite-design.md"
],
"notes": "",
"meta": {}
}