fix(plan): 修正储蓄类模板提取计划逻辑错误
- 移除"是否生成说明"字段与"款项提取"配置的强依赖关系 - "是否希望生成一份允许减少名义金额的提取说明?"现在作为独立字段 - 删除错误的 watch 监听器,该监听器在选择"否"时会错误清除字段 - 更新校验逻辑:withdrawal_enabled 改为可选字段 - 更新架构文档:修正三层结构描述为字段结构说明 影响文件: - src/components/plan/PlanTemplates/SavingsTemplate.vue - docs/plan/plan-entry-architecture.md Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Showing
2 changed files
with
28 additions
and
28 deletions
| 1 | +## [2026-02-13] - 储蓄类模板提取计划逻辑修正 | ||
| 2 | + | ||
| 3 | +### 修复 | ||
| 4 | +- 修正储蓄类产品模板的提取计划逻辑错误 | ||
| 5 | +- 移除"是否生成说明"字段与"款项提取"配置的强依赖关系 | ||
| 6 | +- "是否希望生成一份允许减少名义金额的提取说明?"现在作为独立字段,不影响提取方案配置 | ||
| 7 | +- 删除错误的 watch 监听器,该监听器在选择"否"时会错误地清除所有提取计划字段 | ||
| 8 | +- 更新校验逻辑:`withdrawal_enabled` 字段改为可选,不再强制校验 | ||
| 9 | + | ||
| 10 | +### 文档 | ||
| 11 | +- 更新 `docs/plan/plan-entry-architecture.md` 架构文档 | ||
| 12 | +- 从"三层结构"改为"字段结构说明",明确字段1为独立字段 | ||
| 13 | +- 更新组件设计代码示例,移除错误的 `v-if` 条件和 watch 监听器 | ||
| 14 | + | ||
| 15 | +--- | ||
| 16 | + | ||
| 17 | +**详细信息**: | ||
| 18 | +- **影响文件**: src/components/plan/PlanTemplates/SavingsTemplate.vue, docs/plan/plan-entry-architecture.md | ||
| 19 | +- **技术栈**: Vue 3, Taro 4 | ||
| 20 | +- **测试状态**: 待测试 | ||
| 21 | +- **备注**: 提取方案配置现在始终显示(当配置启用时),不受"是否生成说明"字段影响 | ||
| 22 | + | ||
| 23 | +--- | ||
| 24 | + | ||
| 1 | ## [2026-02-13] - 消息详情页布局与状态优化 | 25 | ## [2026-02-13] - 消息详情页布局与状态优化 |
| 2 | 26 | ||
| 3 | ### 优化 | 27 | ### 优化 | ... | ... |
| ... | @@ -70,8 +70,7 @@ | ... | @@ -70,8 +70,7 @@ |
| 70 | class="mb-5" | 70 | class="mb-5" |
| 71 | /> | 71 | /> |
| 72 | 72 | ||
| 73 | - <!-- 仅当选择"是"时才显示以下内容 --> | 73 | + <!-- 款项提取配置(始终显示,不受上面字段影响) --> |
| 74 | - <template v-if="form.withdrawal_enabled === '是'"> | ||
| 75 | <h3 class="text-base font-semibold text-gray-900 mb-4">款项提取(允许减少名义金额)</h3> | 74 | <h3 class="text-base font-semibold text-gray-900 mb-4">款项提取(允许减少名义金额)</h3> |
| 76 | 75 | ||
| 77 | <!-- 提取选项:指定提取金额 / 最高固定提取金额 --> | 76 | <!-- 提取选项:指定提取金额 / 最高固定提取金额 --> |
| ... | @@ -165,7 +164,6 @@ | ... | @@ -165,7 +164,6 @@ |
| 165 | class="mb-5" | 164 | class="mb-5" |
| 166 | /> | 165 | /> |
| 167 | </template> | 166 | </template> |
| 168 | - </template> | ||
| 169 | </div> | 167 | </div> |
| 170 | </div> | 168 | </div> |
| 171 | 169 | ||
| ... | @@ -364,25 +362,6 @@ const onWithdrawalModeChange = (mode) => { | ... | @@ -364,25 +362,6 @@ const onWithdrawalModeChange = (mode) => { |
| 364 | } | 362 | } |
| 365 | 363 | ||
| 366 | /** | 364 | /** |
| 367 | - * 监听提取计划启用状态变化 | ||
| 368 | - * @description 当用户选择"否"时,清除所有提取计划相关字段 | ||
| 369 | - */ | ||
| 370 | -watch( | ||
| 371 | - () => form.withdrawal_enabled, | ||
| 372 | - (newValue) => { | ||
| 373 | - if (newValue === '否') { | ||
| 374 | - // 清除所有提取计划相关字段 | ||
| 375 | - delete form.withdrawal_mode | ||
| 376 | - delete form.specified_amount_type | ||
| 377 | - delete form.withdrawal_start_age | ||
| 378 | - delete form.withdrawal_period | ||
| 379 | - delete form.annual_withdrawal_amount | ||
| 380 | - delete form.annual_increase_percentage | ||
| 381 | - } | ||
| 382 | - } | ||
| 383 | -) | ||
| 384 | - | ||
| 385 | -/** | ||
| 386 | * 百分比输入限制(实时) | 365 | * 百分比输入限制(实时) |
| 387 | * @description 限制百分比输入为有效数值,最多2位小数 | 366 | * @description 限制百分比输入为有效数值,最多2位小数 |
| 388 | * 只允许输入数字和一个小数点 | 367 | * 只允许输入数字和一个小数点 |
| ... | @@ -453,17 +432,15 @@ const validate = () => { | ... | @@ -453,17 +432,15 @@ const validate = () => { |
| 453 | 432 | ||
| 454 | // 提取计划校验 | 433 | // 提取计划校验 |
| 455 | if (props.config.withdrawal_plan?.enabled) { | 434 | if (props.config.withdrawal_plan?.enabled) { |
| 456 | - if (!form.withdrawal_enabled) { | 435 | + // withdrawal_enabled 只是一个可选字段,不需要校验 |
| 457 | - Taro.showToast({ title: '请选择是否希望生成提取说明', icon: 'none' }) | 436 | + // 真正需要校验的是提取方案配置 |
| 458 | - return false | ||
| 459 | - } | ||
| 460 | 437 | ||
| 461 | - if (form.withdrawal_enabled === '是') { | ||
| 462 | if (!form.withdrawal_mode) { | 438 | if (!form.withdrawal_mode) { |
| 463 | Taro.showToast({ title: '请选择提取选项', icon: 'none' }) | 439 | Taro.showToast({ title: '请选择提取选项', icon: 'none' }) |
| 464 | return false | 440 | return false |
| 465 | } | 441 | } |
| 466 | 442 | ||
| 443 | + // 根据选择的提取模式进行校验 | ||
| 467 | if (form.withdrawal_mode === '指定提取金额') { | 444 | if (form.withdrawal_mode === '指定提取金额') { |
| 468 | if (!form.specified_amount_type) { | 445 | if (!form.specified_amount_type) { |
| 469 | Taro.showToast({ title: '请选择提取方式', icon: 'none' }) | 446 | Taro.showToast({ title: '请选择提取方式', icon: 'none' }) |
| ... | @@ -508,7 +485,6 @@ const validate = () => { | ... | @@ -508,7 +485,6 @@ const validate = () => { |
| 508 | } | 485 | } |
| 509 | } | 486 | } |
| 510 | } | 487 | } |
| 511 | - } | ||
| 512 | 488 | ||
| 513 | return true | 489 | return true |
| 514 | } | 490 | } | ... | ... |
-
Please register or login to post a comment