Files
zkxw/docs/superpowers/plans/2026-10-13-mobile-protocol-price-total-sync.md
T
2026-10-14 12:32:03 +08:00

33 lines
1.3 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.
# 移动端协议单优惠价/合同/总金额联动 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: 纯函数 + 测试
- [x] `applyPreferentialPriceToPayment` / `shouldFollowProtocolTotal` / `nextProtocolTotalFromSamples`
- [x] 单测覆盖空合同补价、手填不覆盖、force 覆盖、yjf 锁定、follow 开关
### Task 2: ProtocolSamplePaymentPanel
- [x] samples watch 维护 lastPreferentialByCode 并调用 applyPreferentialPriceToPayment
### Task 3: MarketModuleForm
- [x] follow 标志 + watch 合计写回 protocolTotalAmount
- [x] 展示样本合同合计与 mismatch hint
- [x] 用户编辑总金额时更新 follow
### Task 4: Verify
- [x] node --test protocol-sample-payment + parity;手工清单