Commit Graph

470 Commits

Author SHA1 Message Date
wangjia b3c9d98eae feat: ¥1 首月特惠套餐(新店专享,每店限购一次,官网+App 同步上线)
- 后端:payPlans 新增 promo_first_month(¥1/30 天/标准版权益);下单强校验每店限购一次(仅 paid 计数,弃单可重下),已享用返回 409;新增 GET /license/promo-status 供前端置灰
- 官网:checkout 套餐段第二位插「🔥 首月特惠 ¥1」+ 推广横幅 + 划线原价 ¥299;首页价格区第二位插特惠卡(5 列);已享用自动置灰
- App:购买弹窗套餐段改三档(标准/特惠/高级),特惠选中显示推广横幅与划线价,已享用置灰并禁用提交
- 实付金额以 pay 侧为准,pay 需 seed promo_first_month 产品后生效

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
2026-07-03 22:25:07 +08:00
wangjia c7de728c18 feat(site): 导航登录态下拉菜单 + 个人信息/退出登录页,登录不再直跳 App
- 导航「进入系统 · 名字」改为下拉:个人信息 / 进入系统 / 退出登录,导航可重入刷新(window.jiuNavRender)
- 新增 /profile/(账号 / 门店 / 授权三卡,authFetch 实时拉取)与 /logout/(撤销会话 + 清本地凭证)
- 登录成功默认落地 /profile/(?next= 站内白名单不变),不再直跳 /app/
- auth.js 增加 jiuAuth.clear();site.css 含本轮下拉 / profile / 特惠卡样式

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
2026-07-03 22:24:55 +08:00
wangjia 24123eb93c feat(client): App 内在线购买/续费授权(管理员支付宝下单+到账轮询)
- 新增套餐目录 license_plans.dart(标准/高级 × 月付/年付,与官网 checkout 一致)
- license 模型/仓库新增 PurchaseOrder/PurchaseStatusInfo 与下单、查单接口
- 系统设置授权面板:管理员显示「在线购买 / 续费」按钮,弹窗选套餐→
  外部浏览器打开支付宝收银台→3s 轮询到账→自动刷新授权并展示新到期日
- 用户手册(docs.md + user-manual.html)同步补充在线购买入口说明

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
2026-07-03 21:57:03 +08:00
wangjia e0f721117f chore: release site-v1.1.1
Deploy Site / release-deploy-site (push) Successful in 24s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
site-v1.1.1
2026-07-03 21:18:28 +08:00
wangjia c010d8b416 fix(site): 官网 401 自动用 refresh_token 续签重试;资产加构建版本号破缓存
- 新增共享 auth.js(jiuAuth):access token 60 分钟过期后,checkout 提交/
  结果页轮询遇 401 自动 POST /auth/refresh 换新 token 并重试一次,仍失败
  才跳登录——修复「已登录点提交订单却被踢回登录页」
- 登录判定放宽为 access 或 refresh token 任一存在(refresh 7 天有效)
- 所有 JS/CSS 引用加 ?v=构建版本号:修复旧版 nav.js 被浏览器缓存后在新
  页面执行(右上角错位的旧用户面板、带引号的 "张三" 显示)
- nav.js 改经 jiuAuth 读 localStorage(JSON 解码,去掉引号显示)
- 登录页回填上次的门店编号与账号

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
2026-07-03 21:08:13 +08:00
wangjia 71909a76d7 chore: release site-v1.1.0(版本序列对齐,内容同 1.0.56)
Deploy Site / release-deploy-site (push) Successful in 26s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
site-v1.1.0
2026-07-03 20:49:31 +08:00
wangjia a79a4d4468 chore: release site-v1.0.56
Deploy Site / release-deploy-site (push) Successful in 25s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
site-v1.0.56
2026-07-03 20:42:56 +08:00
wangjia f4197e3c7d chore: release server-v1.1.2
Deploy Server / release-deploy-server (push) Successful in 1m3s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
server-v1.1.2
2026-07-03 20:41:55 +08:00
wangjia b856f5fec8 docs: 用户/开发手册 HTML 版、db-schema 补 license_purchases、CLAUDE.md 文档地图、pay 对接指南
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
2026-07-03 20:40:21 +08:00
wangjia d256e7ac85 feat(site): 官网全新重建(App 真相源风格)+ 四档套餐 + 在线购买流
- tokens.css/site.css 逐值对齐原型设计系统,icons 雪碧图,零外链;首页/下载/帮助/法务全站重皮肤,真实截图
- 注册与登录在官网内完成(写 shared_preferences_web 兼容 localStorage,不再跳 App)
- 价格区四档:免费/标准 299/高级 599/定制;登录后标准/高级按钮变「购买 / 续费」
- 新增 /checkout/(套餐+月付年付切换)与 /license/result/(支付回跳轮询到账)
- 登录页支持 ?next= 站内回跳;二维码措辞改「扫码看详情可分享」
- 下载页构建期真实下载链接+运行时 release 刷新;旧 features 页/死 CSS/dist 产物清理

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
2026-07-03 20:40:21 +08:00
wangjia 18925d7d15 feat(backend): 在线购买/续费对接 pay 收款中枢——下单/webhook 验签入账/续期叠加/查单兜底
- POST /license/purchase(仅管理员)建单并调 pay 下单,返回收银台 pay_url
- POST /pay/callback 公开接收器:HMAC 验签+时间戳窗口+按 out_trade_no 幂等+金额逐分核对,同事务续期
- 续期与兑换券同口径:未过期从到期日叠加、已过期从现在起算,写入 tier/max_devices/features
- 后台每 60s 查单兜底防 webhook 丢失;closed 标 failed
- 新表 license_purchases(schema.sql/AutoMigrate/testutil 同步);配置 PAY_SECRET/PAY_BASE_URL/PAY_RETURN_URL
- 契约真相源 ~/code/pay-contract openapi.yaml v1.0.0

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
2026-07-03 20:40:06 +08:00
wangjia fbcf573034 chore: release client-v1.1.1
Deploy Client / build-client-web (push) Successful in 53s
Deploy Client / build-windows (push) Successful in 2m10s
Deploy Client / build-macos (push) Successful in 3m19s
Deploy Client / build-android (push) Successful in 1m22s
Deploy Client / build-ios (push) Successful in 3m19s
Deploy Client / release-deploy-client (push) Successful in 1m32s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
client-v1.1.1
2026-07-03 14:32:34 +08:00
wangjia 5ae5c8bc34 chore: release server-v1.1.1
Deploy Server / release-deploy-server (push) Successful in 1m1s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
server-v1.1.1
2026-07-03 14:32:31 +08:00
wangjia d23aaa8771 docs(design): 原型同步(草稿 KPI 4 卡+warn 色登记、抽屉列/去¥、库存总价列演示数据重算)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
2026-07-03 14:31:50 +08:00
wangjia 2bf5b98ba2 feat(client): 草稿 KPI 卡(暗黄)+ 出库详情总售价列 + 明细去¥缩号 + 建单默认值 + 若干列名
- 出入库列表加草稿 KPI 卡(DsKpiTone.warn 新档,审核卡后,点击筛选草稿)
- 出库详情 7 列:售价后加总售价;明细行内价格去 ¥ 且缩一号(合计保留 ¥);
  5/7 列宽重排(系列/数量左移、进价(单瓶)不折行)
- 出库建单:数量默认=可用数量、售价默认=参考售价(product.sale_price)
- 入库详情列名:进价(单瓶)/总价;库存列表「单价」→「总价」(库存×成本);
  商品抽屉:成本价(单瓶)/总成本价
- 公开商品预览页加返回按钮(仅 App 内 canPop 时显示,扫码直达保持纯净)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
2026-07-03 14:31:50 +08:00
wangjia 4d1d69595b fix(backend): 财务汇总 500(only_full_group_by 预处理协议回归)+ summary 加 draft_count
- /finance/summary:SEC-001 给 JOIN 加 shop_id 条件后,MySQL 预处理协议推导不出
  p.name 函数依赖 → 1055(文本协议可过,CLI 无法复现)。GROUP BY 补 p.name 修复,
  并给该 handler 加错误日志(此前吞错致排查困难)。v1.0.85 起全店受影响。
- 出入库 summary 新增 draft_count(草稿单数 KPI 卡数据源)。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
2026-07-03 14:31:50 +08:00
wangjia cd3cc0d8fe chore: release client-v1.1.0
Deploy Client / build-client-web (push) Successful in 1m0s
Deploy Client / build-windows (push) Successful in 2m6s
Deploy Client / build-macos (push) Successful in 2m45s
Deploy Client / build-android (push) Successful in 1m18s
Deploy Client / build-ios (push) Successful in 3m38s
Deploy Client / release-deploy-client (push) Successful in 1m33s
出库成本/售价/利润重设计作为 minor 里程碑:1.0.88 → 1.1.0(同内容重标,与 server-v1.1.0 配套)。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
client-v1.1.0
2026-07-03 13:01:16 +08:00
wangjia 56359f9623 chore: release server-v1.1.0
Deploy Server / release-deploy-server (push) Successful in 53s
定价字段消歧+利润模型作为 minor 里程碑:1.0.86 → 1.1.0(同内容重标)。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
server-v1.1.0
2026-07-03 12:56:40 +08:00
wangjia 3852d70520 chore: release client-v1.0.88
Deploy Client / build-client-web (push) Successful in 52s
Deploy Client / build-macos (push) Successful in 2m49s
Deploy Client / build-android (push) Successful in 1m21s
Deploy Client / build-ios (push) Successful in 3m11s
Deploy Client / build-windows (push) Successful in 2m16s
Deploy Client / release-deploy-client (push) Successful in 1m31s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
client-v1.0.88
2026-07-03 12:45:40 +08:00
wangjia 8d5e8c8be9 chore: release server-v1.0.86
Deploy Server / release-deploy-server (push) Successful in 1m3s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
server-v1.0.86
2026-07-03 12:45:12 +08:00
wangjia 85a6eb9150 docs: 定价重设计原型同步(stock-in.js 双模式/详情三列)+ CLAUDE.md 定价口径节 + db-schema/CONTRACT 更新
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
2026-07-03 12:44:22 +08:00
wangjia 979ca3c83b feat(client): 出库明细成本/售价/利润三列重设计 + 建单利润列 + 入库列头统一
- 出库详情抽屉(管理员):数量/成本价/售价/利润 + 合计金额/合计利润 双行;
  operator 见 售价/小计(服务端抹零+前端隐藏双保险);利润负数 danger
- 出库建单:商品名称下带编码(字体同系列列);金额列→利润列(实时);
  底栏合计利润(仅管理员);进价列仅管理员;提交发新 key(cost_price/sale_price)
- 入库建单列头:进价(单瓶)/ 参考售价 / 总进价
- 退单弹窗金额改售价口径(与冲应收一致);打印保留待定价回退成本兼容
- models 字段随后端消歧改名;golden 重打;新增抽屉双形态 widget 测试

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
2026-07-03 12:44:22 +08:00
wangjia 4fd0bb8b83 feat(backend): 出入库定价字段消歧 + 总利润落库 + 成本仅管理员可见
- 字段重命名(旧列弃用保留,启动幂等回填 BackfillPricingColumns):
  入库 unit_price/total_price/total_amount → cost_price/cost_amount/cost_total;
  出库同前缀 + 新增 sale_amount(售价小计)/ sale_total(应收)/ profit_total(总利润)
- 建单落三值;确认售价联动重算 sale_amount/sale_total/profit_total;
  确认进价回填成本后联动重算受影响出库单利润(recalcStockOutProfit)
- 出库 List/Get 对 operator/readonly 抹零成本与利润(stripStockOutCost 服务端兜底)
- 兼容一版:Create/Update 接受旧 key unit_price 回落(v1.0.87 及之前客户端)
- SUM 聚合/价格趋势/导入/种子工具同步切新列;测试全量改名 + 6 个新回归

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
2026-07-03 12:44:22 +08:00
wangjia 607b8aa763 devops: jiu 证书切 certbot webroot 自动续期(letsencrypt live 路径)
ali 上重签 jiu.51yanmei.com(authenticator 由 dns-cloudflare 切 webroot,NS 迁阿里云后
旧方式必失败);certbot-renew.timer 启用 + deploy 钩子自动 reload;dry-run 通过;
EC2 同步的证书副本(/etc/nginx/ssl)已删除。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
2026-07-03 10:55:24 +08:00
wangjia 0b5e27b6b9 chore: release client-v1.0.87
Deploy Client / build-client-web (push) Successful in 55s
Deploy Client / build-macos (push) Successful in 2m47s
Deploy Client / build-android (push) Successful in 1m45s
Deploy Client / build-ios (push) Successful in 3m24s
Deploy Client / build-windows (push) Successful in 2m1s
Deploy Client / release-deploy-client (push) Successful in 1m35s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
client-v1.0.87
2026-07-03 10:01:00 +08:00
wangjia 7cd63048e5 chore: release server-v1.0.85
Deploy Server / release-deploy-server (push) Successful in 53s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
server-v1.0.85
2026-07-03 09:59:59 +08:00
wangjia 70e144e345 Merge branch 'worktree-front-refactor':前端照原型重建 + 备案回切 + 安全加固
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
2026-07-03 09:59:01 +08:00
wangjia 48d6fc1c25 feat(site): 隐私政策/服务条款/系统要求页面
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
2026-07-03 09:58:30 +08:00
wangjia d5b11c0943 docs: 发版前评审/安全审计报告、迁移 runbook、CLAUDE.md 表格口径更新
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
2026-07-03 09:58:30 +08:00
wangjia 824992fe6e devops: 备案通过回切 https 域名 + 流水线 Ali 单轨
- nginx-jiu-ali.conf:443 ssl+http2 正式入口(HSTS/XFO/nosniff 安全头、
  ACME webroot 续期通道、80→443 跳转);8443 明文过渡口拆除
- 客户端构建 URL 全量回切 https://jiu.51yanmei.com(compile×5/local_test/
  release-client/notify)
- 流水线去 EC2:deploy-client/site 单轨 Ali、manual 回滚与每日备份切 ali、
  seed/reset/debug-db 改容器内取密码(SEC-003,退役 DB_PASSWORD secret)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
2026-07-03 09:58:30 +08:00
wangjia 6238b86dcb feat(client): 登录/注册页照原型重建,ds 真相源组件族统一全部屏
- 登录/注册(login.html/register.html 1:1):两栏卡片+品牌渐变面板+主题小衣服
  pill(onSurface 变体)+记住我(记录并预填最近账号)+原型式 toast 校验;
  登录 fidelity 1.4–2.1% 三主题全绿;注册暂不入闸(少 门店编号/兑换券 字段,
  已记 CONTRACT,screens.mjs 留存根)
- ds 原子补齐:DsToast(.toast 单例)/DsCheck(.check/.agree)/DsButton lg 档/
  DsSelect 替换全部旧 DropdownButton/DsField label 在上/DsInput 后缀与密码形态
- 全屏统一:对话框按钮全 DsButton、盒式输入主题钉死(visualDensity.standard、
  h38、InputDecorationTheme 渗漏修复)、图标全 lucide、JetBrains Mono 三端同源、
  BrandMark 真相源 logo、只读模式写操作全量守卫(WriteGuard+DsToast)
- 出入库列表:版式对齐原型(卡片对齐+搜索框居中)、KPI 近30天滚动、结清后
  失效财务应收应付表;商品编辑抽屉介绍库改搜索下拉、图片双击全屏预览
- 删除旧 UI 死代码:DataTableCard/FormDialog/PageScaffold/SearchChip/
  SelectProductDialog/tabStateProvider
- golden/fidelity:stock-in/out 补注册(9%)、login 入册(8%)、goldens 全量重打;
  修复 pubspec flutter_web_plugins 非法声明(CI pub get 阻断)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
2026-07-03 09:58:14 +08:00
wangjia ca7595b113 feat(backend): 出入库汇总近30天滚动窗口 + 跨租户安全加固
- summaryBounds:本月/近30天滚动双口径(stock-in/out Summary ?window=rolling30)
- security(SEC-001):新增 ownership.go ensureShopRef 写入侧防线(stock-in/out/finance/
  盘点建单的 warehouse/partner/product 外键归属校验);读取侧全部 Preload 补
  shop_id 作用域,finance Summary JOIN 补租户条件;回归测试 CrossTenantRefs
- security(SEC-002):release 模式 JWT 密钥为空/默认值时拒绝启动
- gofmt 对齐若干 model/cmd 文件

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
2026-07-03 09:57:52 +08:00
wangjia 69890b9935 chore: release server-v1.0.84
Deploy Server / release-deploy-server (push) Successful in 57s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
server-v1.0.84
2026-07-02 22:27:13 +08:00
wangjia 493e9b45b3 devops: 割接后 server 部署轨道切为仅 Ali 主轨(移除 EC2 轨)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
2026-07-02 22:27:13 +08:00
wangjia 9099c4af99 feat(backend): 出入库编码搜索双路匹配+建单填快照;finance 趋势/日期区间;partner/product 拼音搜索
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
2026-07-02 22:27:13 +08:00
wangjia af56055eef chore: release server-v1.0.83
Deploy Server / release-deploy-server (push) Successful in 2m10s
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
server-v1.0.83
2026-07-02 11:47:13 +08:00
wangjia d0c71a9252 fix(backend): 往来单位下拉返回全部 + 入库售价写入产品
- partner List 分页上限 200→1000:避免下拉请求大页被 ValidatePageSize
  回退到默认 20(超上限返回默认值而非截断),供应商/客户下拉一次取全部
- 入库明细 sale_price 建独立产品时写入 product.SalePrice(建议售价);
  SalePrice 为 gorm:"-" 仅作建库入参,不落 stock_in_items 表
- 补 partner 大页返回全部、入库售价入产品两条回归测试

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-02 11:44:50 +08:00
wangjia 1bd8b8f877 chore: release server-v1.0.82
Deploy Server / release-deploy-server (push) Successful in 1m52s
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
server-v1.0.82
2026-07-02 08:48:57 +08:00
wangjia a3a722689e feat(client): 出入库列表按原型重建(KPI/详情抽屉/详细搜索/工具栏/选中复制/窗口尺寸)
- 列表重建:KPI 卡、状态+时间列、操作改眼睛开右侧详情抽屉、重置右置
- 详情抽屉(order_detail_drawer) 100% 还原原型 + SelectionArea 可选中复制
- 详细搜索弹窗:ComboSearchField/滚轮日期、字段重构、白底盒子按钮
- 工具栏:搜索框×清除+占位精简、供应商/客户下拉取全部、状态菜单收窄
- 加载不白屏(半透明遮罩)、输入框与下拉等高、windows/macOS 默认窗口尺寸调大

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-02 08:48:01 +08:00
wangjia 998bbab546 feat(backend): 出入库搜索重构 + 商品编码搜索 + KPI/确认售价/详细搜索
- 搜索 keyword 命中改为 单号/酒名(名+拼音)/商品编码,去掉往来单位匹配
- applyStockOrderDetailFilters 合并明细过滤为单条子查询(同一明细语义)+ 新增 product_code
- 新增出入库 KPI summary、出库确认售价(confirm-sale) 及路由
- 补充/更新对应单元测试

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-02 08:47:44 +08:00
wangjia 2c2bb7ccb3 fix(client): rebase 到 main 后适配打印线与 token 体系
main 的打印代码引用了分支已删除的 AppTheme(app_theme.dart)。按「冲突以 main 逻辑为准」
保留 main 的打印预览流程,把三处 AppTheme.* 颜色迁移到分支 token 体系:
- stock_in/out_list 单据详情顶栏:brand50/border/primaryDark → context.tokens.*
- order_print_preview_dialog:import 换 context_tokens,primary/textSecondary → tokens.primary/muted
form 屏改用 main 的 showStock{In,Out}OrderPrint 打印预览入口,随之刷新 12 张 form golden 基线。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 20:54:54 +08:00
wangjia 8a8043573c refactor(client): 库存屏移除预警/流水死 tab 及关联死代码
build() 只渲染库存视图(预警并入 KPI 缺货卡点击筛选、流水移到商品详情),
_buildWarningTab/_buildLogTab/_warningCard/_logCard/_DirectionBadge 已成死代码,
连同未用的 data_table_card/tab_state_provider/page_scaffold import 一并移除(约 -290 行)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 20:46:53 +08:00
wangjia ce18ed3fc9 fix(client): 状态下拉对照原型 .menu(白底圆角 + 选中蓝勾蓝字)
实现原是 Material 默认下拉(灰底 + 灰高亮块),改为对照原型 .menu/.menu-item:
白底圆角描边、选中项 lucide check 蓝勾 + 蓝字 fw600、去掉 initialValue 灰高亮。

注:此菜单样式多处复用(主题器/用户/列设置),下一步抽成 DsMenu 统一。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TSKEiHsvauyxYUW2itzUXX
2026-07-01 20:46:53 +08:00
wangjia 0f1a66f160 feat(client): KPI 图标改用 lucide(与原型同源图形库)
原型图标源自 lucide-static(icons.js)。引入 lucide_icons_flutter 包,
库存屏 KPI 图标改 LucideIcons.box/database/box/triangleAlert,与原型一模一样
(不再用 Material 凑近似)。golden_harness 加载 Lucide package 字体(family 带
packages/ 前缀),golden 正确渲染。flutter test 242 通过。

后续:侧栏/顶栏/状态栏图标也逐步换 lucide(对照 shell.js)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TSKEiHsvauyxYUW2itzUXX
2026-07-01 20:46:53 +08:00
wangjia 6d20359482 fix(client): 补提交 ds_table.dart(库存屏依赖)+ 库存移动端 golden
ds_table.dart 在 ds 地基提交后新建、库存屏提交时漏 add,补回避免仓库缺文件。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TSKEiHsvauyxYUW2itzUXX
2026-07-01 20:46:53 +08:00
wangjia 348d118bb9 refactor(client): 库存屏改用 ds 组件库重写(屏内零内联样式)
按「屏只组合组件、不写样式」用 widgets/ds/ 重写库存屏:
- KPI: KpiCard → DsKpi(4 卡,ic 右上 + mono 数字 + 缺货 accent)
- 表格: DataTableCard → DsTable(列头漏斗 header + 状态 DsBadge 圆点 + 库存 accent 染色 + 分页)
- 工具栏: TextField → DsSearchBox;状态内联 chip → DsChip;重置/导出 → DsButton
- _buildInventoryCell 改返回 Widget(供 DsRow.cells),状态走 _dsStatusBadge(DsBadge)
- 颜色全走 token(闸 0 违规),analyze 0 error,flutter test 242 通过

旧 DataTableCard/KpiCard/StatusPill 依赖仅剩未用的预警/流水 tab,下一步清理。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TSKEiHsvauyxYUW2itzUXX
2026-07-01 20:46:53 +08:00
wangjia 76f1b13eb4 feat(client): ds 组件库地基(镜像 atoms.css 原子,屏重写前置)
按「先建单一组件源、屏只组合不重写样式」重立组件层:
- 新建 widgets/ds/:DsButton(.btn ghost/primary/danger/sm) · DsBadge(.badge+圆点) ·
  DsChip(.chip 状态筹码) · DsSearchBox(.searchbox) · DsKpi(.kpi 含 .ic 右上块+环比 .d)
- 每个组件一对一对照 atoms.css 尺寸/间距/圆角/字号,颜色/尺寸全引 token(0 硬编码,颜色闸过)
- 现有 KpiCard/StatusPill 等逐步迁入 ds/ 废弃

下一步:建 DsTable(表格+列头漏斗+分页+状态徽章用 DsBadge)→ 用 ds 组件重写库存屏。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TSKEiHsvauyxYUW2itzUXX
2026-07-01 20:46:53 +08:00
wangjia dea46115cf fix(client): 真机字体改回系统默认(PingFang,对齐原型) + 原型去新增入库
- themes.dart 不再全局强制 NotoSansSC:真机用系统字体(macOS/iOS=PingFang SC,
  与原型 --font 一致),消除真机字体偏离原型;Noto 仅 golden 测试加载(CI 无中文字体)
- 原型 inventory.html 同步去掉「新增入库」按钮,与代码保持一致

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TSKEiHsvauyxYUW2itzUXX
2026-07-01 20:46:53 +08:00
wangjia 8d3f902f3b feat(client): Phase 2 库存屏照原型重建(去tab/KPI货值/库存·成本价·单价列)
照原型 inventory.html 把库存屏从「3 tab」重排为单视图:
- 去 3 tab(库存查询/预警/流水)→ 单视图;预警并入 KPI 缺货卡点击筛选;流水移商品详情
- 头部:库存管理 + 共 N 个 SKU·数据实时 + 列设置/导出(盘点/新增入库去掉,走专门菜单)
- KPI 4 卡走全店汇总接口:SKU总数/库存货值(Σqty×进价)/在库数量/缺货预警(可点筛选)
- 表格 12 列:加 库存(低库存染色)/成本价(进价)/单价(售价);操作列只「查看详情」;状态圆点
- 仓库/备注默认隐藏;工具栏 搜索+状态筛选+重置
- 后端 GET /inventory/summary 全店汇总(守 shop_id);前端 model/repository/provider 配套
- golden_harness:monospace 指向 Noto(消等宽数字黑块,全 golden 受益);库存屏存量 grey 清零

后端编译/库存测试通过;前端 analyze 0 error,flutter test 242 通过;代码端颜色闸 0 违规。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TSKEiHsvauyxYUW2itzUXX
2026-07-01 20:46:53 +08:00
wangjia ff45100eed feat(backend): 库存接口带出售价 sale_price(库存屏成本价/单价两列地基)
照原型库存表「成本价(进价)+单价(售价)」两列:
- 库存查询 SELECT 加 p.sale_price AS sale_price;成本价 unit_price 补 p.purchase_price 兜底
- inventoryRow 加 SalePrice;前端 Inventory model 加 salePrice
- 多租户隔离不变(baseWhere 仍 inv.shop_id);库存测试通过

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TSKEiHsvauyxYUW2itzUXX
2026-07-01 20:46:53 +08:00