2026-10-13-mobile-protocol-price-total-sync.md 1.3 KB

移动端协议单优惠价/合同/总金额联动 Implementation Plan

For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (- [ ]) syntax for tracking.

Goal: 样本优惠价变更同步合同金额;协议总金额未手改时跟随样本合同合计。

Architecture: 纯函数对齐 Web applyPreferentialPriceToPayment;Panel 扩展 samples watch;Form 维护 follow 标志与合计提示。

Tech Stack: Vue 3 + Vant;Node test runner

Design: docs/superpowers/specs/2026-10-13-mobile-protocol-price-total-sync-design.md


Task 1: 纯函数 + 测试

  • applyPreferentialPriceToPayment / shouldFollowProtocolTotal / nextProtocolTotalFromSamples
  • 单测覆盖空合同补价、手填不覆盖、force 覆盖、yjf 锁定、follow 开关

Task 2: ProtocolSamplePaymentPanel

  • samples watch 维护 lastPreferentialByCode 并调用 applyPreferentialPriceToPayment

Task 3: MarketModuleForm

  • follow 标志 + watch 合计写回 protocolTotalAmount
  • 展示样本合同合计与 mismatch hint
  • 用户编辑总金额时更新 follow

Task 4: Verify

  • node --test protocol-sample-payment + parity;手工清单