chore(config): 忽略文档解析生成的临时文件
- 添加 docs/parse-audit/ 到 .gitignore - 添加 docs/parsed-backup/ 到 .gitignore - 从版本控制中移除已跟踪的临时文件 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Showing
16 changed files
with
4 additions
and
4570 deletions
| 1 | -# 产品配置审核 - 计划书模版2.docx | ||
| 2 | - | ||
| 3 | -**解析时间**: 2026/2/15 11:18:47 | ||
| 4 | -**原始文件**: 计划书模版2.docx | ||
| 5 | -**数据来源**: docs/to-parse/计划书模版2.docx | ||
| 6 | - | ||
| 7 | ---- | ||
| 8 | - | ||
| 9 | -## 📋 产品基本信息 | ||
| 10 | - | ||
| 11 | -| 字段 | 提取值 | 需要确认 | | ||
| 12 | -|------|--------|---------| | ||
| 13 | -| 产品名称 | 宏摯傳承保障計劃 - 性別, 年齡, 出生年月日 | ✅ 请核对产品名称 | | ||
| 14 | -| 产品类型 | savings | ✅ 请确认产品类型 | | ||
| 15 | -| 币种 | USD | ✅ 请确认币种 | | ||
| 16 | -| form_sn | `savings-product-ef3dd50b` | ✅ 请确认 form_sn 唯一性 | | ||
| 17 | -| 缴费年期 | ["整付","3年","5年","10年","15年"] | ✅ 请确认缴费年期选项 | | ||
| 18 | -| 年龄范围 | 0-75岁 | ✅ 请确认年龄范围 | | ||
| 19 | -| 保险期间 | 终身 | ✅ 请确认保险期间 | | ||
| 20 | - | ||
| 21 | - | ||
| 22 | -### 💰 储蓄类产品特有字段 | ||
| 23 | - | ||
| 24 | -| 字段 | 提取值 | 需要确认 | | ||
| 25 | -|------|--------|---------| | ||
| 26 | -| 提取方式 | ["最高固定提取金额"] | ✅ 请确认提取方式 | | ||
| 27 | -| 提取期 | ["1年","3年","5年","10年"] | ✅ 请确认提取期选项 | | ||
| 28 | - | ||
| 29 | - | ||
| 30 | ---- | ||
| 31 | - | ||
| 32 | -## 🤖 智能字段提取报告 | ||
| 33 | - | ||
| 34 | -### 匹配统计 | ||
| 35 | - | ||
| 36 | -- ✅ 成功匹配: 4 字段 | ||
| 37 | -- ⚠️ 使用默认值: 3 字段 | ||
| 38 | -- ❌ 未匹配(需人工补充): 0 字段 | ||
| 39 | - | ||
| 40 | -### ✅ 已成功匹配的字段 | ||
| 41 | - | ||
| 42 | -- product_name | ||
| 43 | -- product_type | ||
| 44 | -- payment_periods | ||
| 45 | -- withdrawal_modes | ||
| 46 | - | ||
| 47 | - | ||
| 48 | -### ⚠️ 使用默认值的字段 | ||
| 49 | - | ||
| 50 | -- **currency**: 未找到字段 "currency",使用默认值: "USD" | ||
| 51 | -- **age_range**: 未找到字段 "age_range",使用默认值: {"min":0,"max":75} | ||
| 52 | -- **insurance_period**: 未找到字段 "insurance_period",使用默认值: "终身" | ||
| 53 | - | ||
| 54 | - | ||
| 55 | - | ||
| 56 | - | ||
| 57 | ---- | ||
| 58 | - | ||
| 59 | -## 🧾 配置预览 | ||
| 60 | - | ||
| 61 | -```javascript | ||
| 62 | -{ | ||
| 63 | - "product_name": "宏摯傳承保障計劃 - 性別, 年齡, 出生年月日", | ||
| 64 | - "product_type": "savings", | ||
| 65 | - "currency": "USD", | ||
| 66 | - "form_sn": "savings-product-ef3dd50b", | ||
| 67 | - "payment_periods": [ | ||
| 68 | - "整付", | ||
| 69 | - "3年", | ||
| 70 | - "5年", | ||
| 71 | - "10年", | ||
| 72 | - "15年" | ||
| 73 | - ], | ||
| 74 | - "age_range": { | ||
| 75 | - "min": 0, | ||
| 76 | - "max": 75 | ||
| 77 | - }, | ||
| 78 | - "insurance_period": "终身", | ||
| 79 | - "is_savings": true, | ||
| 80 | - "withdrawal_modes": [ | ||
| 81 | - "最高固定提取金额" | ||
| 82 | - ], | ||
| 83 | - "withdrawal_periods": [ | ||
| 84 | - "1年", | ||
| 85 | - "3年", | ||
| 86 | - "5年", | ||
| 87 | - "10年" | ||
| 88 | - ] | ||
| 89 | -} | ||
| 90 | -``` | ||
| 91 | - | ||
| 92 | ---- | ||
| 93 | - | ||
| 94 | -## 📝 表单字段 (form_schema) | ||
| 95 | - | ||
| 96 | -```javascript | ||
| 97 | -{ | ||
| 98 | - "base_fields": [], | ||
| 99 | - "withdrawal_fields": [], | ||
| 100 | - "reset_map": {} | ||
| 101 | -} | ||
| 102 | -``` | ||
| 103 | - | ||
| 104 | ---- | ||
| 105 | - | ||
| 106 | -## 🔄 提交字段映射 (submit_mapping) | ||
| 107 | - | ||
| 108 | -```javascript | ||
| 109 | -{} | ||
| 110 | -``` | ||
| 111 | - | ||
| 112 | ---- | ||
| 113 | - | ||
| 114 | -## 🧩 生成配置片段 | ||
| 115 | - | ||
| 116 | -```javascript | ||
| 117 | -/** | ||
| 118 | - * 宏摯傳承保障計劃 - 性別, 年齡, 出生年月日 | ||
| 119 | - * @added 2026-02-15T03:18:47.616Z | ||
| 120 | - * @source docs/to-parse/计划书模版2.docx | ||
| 121 | - */ | ||
| 122 | - 'savings-product-ef3dd50b': { | ||
| 123 | - name: '宏摯傳承保障計劃 - 性別, 年齡, 出生年月日', | ||
| 124 | - component: 'SavingsTemplate', | ||
| 125 | - category: 'savings', | ||
| 126 | - config: { | ||
| 127 | - currency: 'USD', | ||
| 128 | - payment_periods: ["整付","3年","5年","10年","15年"], | ||
| 129 | - age_range: { min: 0, max: 75 }, | ||
| 130 | - insurance_period: '终身', | ||
| 131 | - withdrawal_plan: { | ||
| 132 | - enabled: true, | ||
| 133 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 134 | - default_currency: 'USD', | ||
| 135 | - withdrawal_modes: ["最高固定提取金额"], | ||
| 136 | - withdrawal_periods: ["1年","3年","5年","10年"] | ||
| 137 | - }, | ||
| 138 | - form_schema: savingsFormSchema, | ||
| 139 | - submit_mapping: savingsSubmitMapping | ||
| 140 | - } | ||
| 141 | - } | ||
| 142 | -``` | ||
| 143 | - | ||
| 144 | ---- | ||
| 145 | - | ||
| 146 | -## ✅ 审核检查清单 | ||
| 147 | - | ||
| 148 | -### 基础信息 | ||
| 149 | -- [ ] 产品名称正确 | ||
| 150 | -- [ ] 产品类型正确(savings/critical-illness/life-insurance) | ||
| 151 | -- [ ] 币种正确(USD/CNY/HKD/EUR) | ||
| 152 | -- [ ] form_sn 唯一且符合命名规范 | ||
| 153 | - | ||
| 154 | -### 缴费与年龄 | ||
| 155 | -- [ ] 缴费年期选项完整且正确 | ||
| 156 | -- [ ] 年龄范围合理 | ||
| 157 | -- [ ] 保险期间正确 | ||
| 158 | - | ||
| 159 | -### 储蓄类特有(如适用) | ||
| 160 | -- [ ] 提取方式正确 | ||
| 161 | -- [ ] 提取期选项完整 | ||
| 162 | -- [ ] 表单字段定义完整 | ||
| 163 | -- [ ] 提交字段映射正确 | ||
| 164 | - | ||
| 165 | ---- | ||
| 166 | - | ||
| 167 | -## 📋 审核后操作 | ||
| 168 | - | ||
| 169 | -### 确认无误 | ||
| 170 | -```bash | ||
| 171 | -# 1. 移动到 approved 目录 | ||
| 172 | -mv docs/parse-audit/pending/计划书模版2/2026-02-15-计划书模版2-宏摯傳承保障計劃-性別-年齡-出生年月日.md \ | ||
| 173 | - docs/parse-audit/approved/ | ||
| 174 | - | ||
| 175 | -# 2. 合并到正式配置 | ||
| 176 | -# 手动复制或使用工具合并到 src/config/plan-templates.js | ||
| 177 | - | ||
| 178 | -# 3. 删除待审核文件(可选) | ||
| 179 | -rm docs/parse-audit/pending/计划书模版2/2026-02-15-计划书模版2-宏摯傳承保障計劃-性別-年齡-出生年月日.md | ||
| 180 | -``` | ||
| 181 | - | ||
| 182 | -### 需要修改 | ||
| 183 | -1. 编辑本文件修正内容 | ||
| 184 | -2. 重新提交审核 | ||
| 185 | - | ||
| 186 | -### 放弃本次解析 | ||
| 187 | -```bash | ||
| 188 | -rm docs/parse-audit/pending/计划书模版2/2026-02-15-计划书模版2-宏摯傳承保障計劃-性別-年齡-出生年月日.md | ||
| 189 | -``` | ||
| 190 | - | ||
| 191 | ---- | ||
| 192 | - | ||
| 193 | -## 审核状态 | ||
| 194 | - | ||
| 195 | -- [ ] 待审核 | ||
| 196 | -- [ ] 已通过 | ||
| 197 | -- [ ] 已拒绝 | ||
| 198 | - | ||
| 199 | -## 审核意见 | ||
| 200 | - | ||
| 201 | -```text | ||
| 202 | -``` |
| 1 | -# 产品配置审核 - 计划书模版2.docx | ||
| 2 | - | ||
| 3 | -**解析时间**: 2026/2/15 11:18:47 | ||
| 4 | -**原始文件**: 计划书模版2.docx | ||
| 5 | -**数据来源**: docs/to-parse/计划书模版2.docx | ||
| 6 | - | ||
| 7 | ---- | ||
| 8 | - | ||
| 9 | -## 📋 产品基本信息 | ||
| 10 | - | ||
| 11 | -| 字段 | 提取值 | 需要确认 | | ||
| 12 | -|------|--------|---------| | ||
| 13 | -| 产品名称 | 宏摯家傳承保險計劃- 性別, 年齡, 出生年月日 | ✅ 请核对产品名称 | | ||
| 14 | -| 产品类型 | savings | ✅ 请确认产品类型 | | ||
| 15 | -| 币种 | USD | ✅ 请确认币种 | | ||
| 16 | -| form_sn | `savings-product-aaaa60f8` | ✅ 请确认 form_sn 唯一性 | | ||
| 17 | -| 缴费年期 | ["整付","3年","5年"] | ✅ 请确认缴费年期选项 | | ||
| 18 | -| 年龄范围 | 0-75岁 | ✅ 请确认年龄范围 | | ||
| 19 | -| 保险期间 | 终身 | ✅ 请确认保险期间 | | ||
| 20 | - | ||
| 21 | - | ||
| 22 | -### 💰 储蓄类产品特有字段 | ||
| 23 | - | ||
| 24 | -| 字段 | 提取值 | 需要确认 | | ||
| 25 | -|------|--------|---------| | ||
| 26 | -| 提取方式 | ["年龄指定金额","最高固定金额"] | ✅ 请确认提取方式 | | ||
| 27 | -| 提取期 | ["1年","3年","5年","10年"] | ✅ 请确认提取期选项 | | ||
| 28 | - | ||
| 29 | - | ||
| 30 | ---- | ||
| 31 | - | ||
| 32 | -## 🤖 智能字段提取报告 | ||
| 33 | - | ||
| 34 | -### 匹配统计 | ||
| 35 | - | ||
| 36 | -- ✅ 成功匹配: 2 字段 | ||
| 37 | -- ⚠️ 使用默认值: 4 字段 | ||
| 38 | -- ❌ 未匹配(需人工补充): 0 字段 | ||
| 39 | - | ||
| 40 | -### ✅ 已成功匹配的字段 | ||
| 41 | - | ||
| 42 | -- product_name | ||
| 43 | -- payment_periods | ||
| 44 | - | ||
| 45 | - | ||
| 46 | -### ⚠️ 使用默认值的字段 | ||
| 47 | - | ||
| 48 | -- **product_type**: 未找到字段 "product_type",使用默认值: "savings" | ||
| 49 | -- **currency**: 未找到字段 "currency",使用默认值: "USD" | ||
| 50 | -- **age_range**: 未找到字段 "age_range",使用默认值: {"min":0,"max":75} | ||
| 51 | -- **insurance_period**: 未找到字段 "insurance_period",使用默认值: "终身" | ||
| 52 | - | ||
| 53 | - | ||
| 54 | - | ||
| 55 | - | ||
| 56 | ---- | ||
| 57 | - | ||
| 58 | -## 🧾 配置预览 | ||
| 59 | - | ||
| 60 | -```javascript | ||
| 61 | -{ | ||
| 62 | - "product_name": "宏摯家傳承保險計劃- 性別, 年齡, 出生年月日", | ||
| 63 | - "product_type": "savings", | ||
| 64 | - "currency": "USD", | ||
| 65 | - "form_sn": "savings-product-aaaa60f8", | ||
| 66 | - "payment_periods": [ | ||
| 67 | - "整付", | ||
| 68 | - "3年", | ||
| 69 | - "5年" | ||
| 70 | - ], | ||
| 71 | - "age_range": { | ||
| 72 | - "min": 0, | ||
| 73 | - "max": 75 | ||
| 74 | - }, | ||
| 75 | - "insurance_period": "终身", | ||
| 76 | - "is_savings": true, | ||
| 77 | - "withdrawal_modes": [ | ||
| 78 | - "年龄指定金额", | ||
| 79 | - "最高固定金额" | ||
| 80 | - ], | ||
| 81 | - "withdrawal_periods": [ | ||
| 82 | - "1年", | ||
| 83 | - "3年", | ||
| 84 | - "5年", | ||
| 85 | - "10年" | ||
| 86 | - ] | ||
| 87 | -} | ||
| 88 | -``` | ||
| 89 | - | ||
| 90 | ---- | ||
| 91 | - | ||
| 92 | -## 📝 表单字段 (form_schema) | ||
| 93 | - | ||
| 94 | -```javascript | ||
| 95 | -{ | ||
| 96 | - "base_fields": [], | ||
| 97 | - "withdrawal_fields": [], | ||
| 98 | - "reset_map": {} | ||
| 99 | -} | ||
| 100 | -``` | ||
| 101 | - | ||
| 102 | ---- | ||
| 103 | - | ||
| 104 | -## 🔄 提交字段映射 (submit_mapping) | ||
| 105 | - | ||
| 106 | -```javascript | ||
| 107 | -{} | ||
| 108 | -``` | ||
| 109 | - | ||
| 110 | ---- | ||
| 111 | - | ||
| 112 | -## 🧩 生成配置片段 | ||
| 113 | - | ||
| 114 | -```javascript | ||
| 115 | -/** | ||
| 116 | - * 宏摯家傳承保險計劃- 性別, 年齡, 出生年月日 | ||
| 117 | - * @added 2026-02-15T03:18:47.644Z | ||
| 118 | - * @source docs/to-parse/计划书模版2.docx | ||
| 119 | - */ | ||
| 120 | - 'savings-product-aaaa60f8': { | ||
| 121 | - name: '宏摯家傳承保險計劃- 性別, 年齡, 出生年月日', | ||
| 122 | - component: 'SavingsTemplate', | ||
| 123 | - category: 'savings', | ||
| 124 | - config: { | ||
| 125 | - currency: 'USD', | ||
| 126 | - payment_periods: ["整付","3年","5年"], | ||
| 127 | - age_range: { min: 0, max: 75 }, | ||
| 128 | - insurance_period: '终身', | ||
| 129 | - withdrawal_plan: { | ||
| 130 | - enabled: true, | ||
| 131 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 132 | - default_currency: 'USD', | ||
| 133 | - withdrawal_modes: ["年龄指定金额","最高固定金额"], | ||
| 134 | - withdrawal_periods: ["1年","3年","5年","10年"] | ||
| 135 | - }, | ||
| 136 | - form_schema: savingsFormSchema, | ||
| 137 | - submit_mapping: savingsSubmitMapping | ||
| 138 | - } | ||
| 139 | - } | ||
| 140 | -``` | ||
| 141 | - | ||
| 142 | ---- | ||
| 143 | - | ||
| 144 | -## ✅ 审核检查清单 | ||
| 145 | - | ||
| 146 | -### 基础信息 | ||
| 147 | -- [ ] 产品名称正确 | ||
| 148 | -- [ ] 产品类型正确(savings/critical-illness/life-insurance) | ||
| 149 | -- [ ] 币种正确(USD/CNY/HKD/EUR) | ||
| 150 | -- [ ] form_sn 唯一且符合命名规范 | ||
| 151 | - | ||
| 152 | -### 缴费与年龄 | ||
| 153 | -- [ ] 缴费年期选项完整且正确 | ||
| 154 | -- [ ] 年龄范围合理 | ||
| 155 | -- [ ] 保险期间正确 | ||
| 156 | - | ||
| 157 | -### 储蓄类特有(如适用) | ||
| 158 | -- [ ] 提取方式正确 | ||
| 159 | -- [ ] 提取期选项完整 | ||
| 160 | -- [ ] 表单字段定义完整 | ||
| 161 | -- [ ] 提交字段映射正确 | ||
| 162 | - | ||
| 163 | ---- | ||
| 164 | - | ||
| 165 | -## 📋 审核后操作 | ||
| 166 | - | ||
| 167 | -### 确认无误 | ||
| 168 | -```bash | ||
| 169 | -# 1. 移动到 approved 目录 | ||
| 170 | -mv docs/parse-audit/pending/计划书模版2/2026-02-15-计划书模版2-宏摯家傳承保險計劃-性別-年齡-出生年月日.md \ | ||
| 171 | - docs/parse-audit/approved/ | ||
| 172 | - | ||
| 173 | -# 2. 合并到正式配置 | ||
| 174 | -# 手动复制或使用工具合并到 src/config/plan-templates.js | ||
| 175 | - | ||
| 176 | -# 3. 删除待审核文件(可选) | ||
| 177 | -rm docs/parse-audit/pending/计划书模版2/2026-02-15-计划书模版2-宏摯家傳承保險計劃-性別-年齡-出生年月日.md | ||
| 178 | -``` | ||
| 179 | - | ||
| 180 | -### 需要修改 | ||
| 181 | -1. 编辑本文件修正内容 | ||
| 182 | -2. 重新提交审核 | ||
| 183 | - | ||
| 184 | -### 放弃本次解析 | ||
| 185 | -```bash | ||
| 186 | -rm docs/parse-audit/pending/计划书模版2/2026-02-15-计划书模版2-宏摯家傳承保險計劃-性別-年齡-出生年月日.md | ||
| 187 | -``` | ||
| 188 | - | ||
| 189 | ---- | ||
| 190 | - | ||
| 191 | -## 审核状态 | ||
| 192 | - | ||
| 193 | -- [ ] 待审核 | ||
| 194 | -- [ ] 已通过 | ||
| 195 | -- [ ] 已拒绝 | ||
| 196 | - | ||
| 197 | -## 审核意见 | ||
| 198 | - | ||
| 199 | -```text | ||
| 200 | -``` |
| 1 | -# 产品配置审核 - 计划书模版2.docx | ||
| 2 | - | ||
| 3 | -**解析时间**: 2026/2/15 11:18:47 | ||
| 4 | -**原始文件**: 计划书模版2.docx | ||
| 5 | -**数据来源**: docs/to-parse/计划书模版2.docx | ||
| 6 | - | ||
| 7 | ---- | ||
| 8 | - | ||
| 9 | -## 📋 产品基本信息 | ||
| 10 | - | ||
| 11 | -| 字段 | 提取值 | 需要确认 | | ||
| 12 | -|------|--------|---------| | ||
| 13 | -| 产品名称 | 宏浚傳承保障計劃 | ✅ 请核对产品名称 | | ||
| 14 | -| 产品类型 | savings | ✅ 请确认产品类型 | | ||
| 15 | -| 币种 | USD | ✅ 请确认币种 | | ||
| 16 | -| form_sn | `savings-product-d1581522` | ✅ 请确认 form_sn 唯一性 | | ||
| 17 | -| 缴费年期 | ["整付","2年","5年"] | ✅ 请确认缴费年期选项 | | ||
| 18 | -| 年龄范围 | 0-75岁 | ✅ 请确认年龄范围 | | ||
| 19 | -| 保险期间 | 终身 | ✅ 请确认保险期间 | | ||
| 20 | - | ||
| 21 | - | ||
| 22 | -### 💰 储蓄类产品特有字段 | ||
| 23 | - | ||
| 24 | -| 字段 | 提取值 | 需要确认 | | ||
| 25 | -|------|--------|---------| | ||
| 26 | -| 提取方式 | ["年龄指定金额","最高固定金额"] | ✅ 请确认提取方式 | | ||
| 27 | -| 提取期 | ["1年","3年","5年","10年"] | ✅ 请确认提取期选项 | | ||
| 28 | - | ||
| 29 | - | ||
| 30 | ---- | ||
| 31 | - | ||
| 32 | -## 🤖 智能字段提取报告 | ||
| 33 | - | ||
| 34 | -### 匹配统计 | ||
| 35 | - | ||
| 36 | -- ✅ 成功匹配: 2 字段 | ||
| 37 | -- ⚠️ 使用默认值: 4 字段 | ||
| 38 | -- ❌ 未匹配(需人工补充): 0 字段 | ||
| 39 | - | ||
| 40 | -### ✅ 已成功匹配的字段 | ||
| 41 | - | ||
| 42 | -- product_name | ||
| 43 | -- payment_periods | ||
| 44 | - | ||
| 45 | - | ||
| 46 | -### ⚠️ 使用默认值的字段 | ||
| 47 | - | ||
| 48 | -- **product_type**: 未找到字段 "product_type",使用默认值: "savings" | ||
| 49 | -- **currency**: 未找到字段 "currency",使用默认值: "USD" | ||
| 50 | -- **age_range**: 未找到字段 "age_range",使用默认值: {"min":0,"max":75} | ||
| 51 | -- **insurance_period**: 未找到字段 "insurance_period",使用默认值: "终身" | ||
| 52 | - | ||
| 53 | - | ||
| 54 | - | ||
| 55 | - | ||
| 56 | ---- | ||
| 57 | - | ||
| 58 | -## 🧾 配置预览 | ||
| 59 | - | ||
| 60 | -```javascript | ||
| 61 | -{ | ||
| 62 | - "product_name": "宏浚傳承保障計劃", | ||
| 63 | - "product_type": "savings", | ||
| 64 | - "currency": "USD", | ||
| 65 | - "form_sn": "savings-product-d1581522", | ||
| 66 | - "payment_periods": [ | ||
| 67 | - "整付", | ||
| 68 | - "2年", | ||
| 69 | - "5年" | ||
| 70 | - ], | ||
| 71 | - "age_range": { | ||
| 72 | - "min": 0, | ||
| 73 | - "max": 75 | ||
| 74 | - }, | ||
| 75 | - "insurance_period": "终身", | ||
| 76 | - "is_savings": true, | ||
| 77 | - "withdrawal_modes": [ | ||
| 78 | - "年龄指定金额", | ||
| 79 | - "最高固定金额" | ||
| 80 | - ], | ||
| 81 | - "withdrawal_periods": [ | ||
| 82 | - "1年", | ||
| 83 | - "3年", | ||
| 84 | - "5年", | ||
| 85 | - "10年" | ||
| 86 | - ] | ||
| 87 | -} | ||
| 88 | -``` | ||
| 89 | - | ||
| 90 | ---- | ||
| 91 | - | ||
| 92 | -## 📝 表单字段 (form_schema) | ||
| 93 | - | ||
| 94 | -```javascript | ||
| 95 | -{ | ||
| 96 | - "base_fields": [], | ||
| 97 | - "withdrawal_fields": [], | ||
| 98 | - "reset_map": {} | ||
| 99 | -} | ||
| 100 | -``` | ||
| 101 | - | ||
| 102 | ---- | ||
| 103 | - | ||
| 104 | -## 🔄 提交字段映射 (submit_mapping) | ||
| 105 | - | ||
| 106 | -```javascript | ||
| 107 | -{} | ||
| 108 | -``` | ||
| 109 | - | ||
| 110 | ---- | ||
| 111 | - | ||
| 112 | -## 🧩 生成配置片段 | ||
| 113 | - | ||
| 114 | -```javascript | ||
| 115 | -/** | ||
| 116 | - * 宏浚傳承保障計劃 | ||
| 117 | - * @added 2026-02-15T03:18:47.644Z | ||
| 118 | - * @source docs/to-parse/计划书模版2.docx | ||
| 119 | - */ | ||
| 120 | - 'savings-product-d1581522': { | ||
| 121 | - name: '宏浚傳承保障計劃', | ||
| 122 | - component: 'SavingsTemplate', | ||
| 123 | - category: 'savings', | ||
| 124 | - config: { | ||
| 125 | - currency: 'USD', | ||
| 126 | - payment_periods: ["整付","2年","5年"], | ||
| 127 | - age_range: { min: 0, max: 75 }, | ||
| 128 | - insurance_period: '终身', | ||
| 129 | - withdrawal_plan: { | ||
| 130 | - enabled: true, | ||
| 131 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 132 | - default_currency: 'USD', | ||
| 133 | - withdrawal_modes: ["年龄指定金额","最高固定金额"], | ||
| 134 | - withdrawal_periods: ["1年","3年","5年","10年"] | ||
| 135 | - }, | ||
| 136 | - form_schema: savingsFormSchema, | ||
| 137 | - submit_mapping: savingsSubmitMapping | ||
| 138 | - } | ||
| 139 | - } | ||
| 140 | -``` | ||
| 141 | - | ||
| 142 | ---- | ||
| 143 | - | ||
| 144 | -## ✅ 审核检查清单 | ||
| 145 | - | ||
| 146 | -### 基础信息 | ||
| 147 | -- [ ] 产品名称正确 | ||
| 148 | -- [ ] 产品类型正确(savings/critical-illness/life-insurance) | ||
| 149 | -- [ ] 币种正确(USD/CNY/HKD/EUR) | ||
| 150 | -- [ ] form_sn 唯一且符合命名规范 | ||
| 151 | - | ||
| 152 | -### 缴费与年龄 | ||
| 153 | -- [ ] 缴费年期选项完整且正确 | ||
| 154 | -- [ ] 年龄范围合理 | ||
| 155 | -- [ ] 保险期间正确 | ||
| 156 | - | ||
| 157 | -### 储蓄类特有(如适用) | ||
| 158 | -- [ ] 提取方式正确 | ||
| 159 | -- [ ] 提取期选项完整 | ||
| 160 | -- [ ] 表单字段定义完整 | ||
| 161 | -- [ ] 提交字段映射正确 | ||
| 162 | - | ||
| 163 | ---- | ||
| 164 | - | ||
| 165 | -## 📋 审核后操作 | ||
| 166 | - | ||
| 167 | -### 确认无误 | ||
| 168 | -```bash | ||
| 169 | -# 1. 移动到 approved 目录 | ||
| 170 | -mv docs/parse-audit/pending/计划书模版2/2026-02-15-计划书模版2-宏浚傳承保障計劃.md \ | ||
| 171 | - docs/parse-audit/approved/ | ||
| 172 | - | ||
| 173 | -# 2. 合并到正式配置 | ||
| 174 | -# 手动复制或使用工具合并到 src/config/plan-templates.js | ||
| 175 | - | ||
| 176 | -# 3. 删除待审核文件(可选) | ||
| 177 | -rm docs/parse-audit/pending/计划书模版2/2026-02-15-计划书模版2-宏浚傳承保障計劃.md | ||
| 178 | -``` | ||
| 179 | - | ||
| 180 | -### 需要修改 | ||
| 181 | -1. 编辑本文件修正内容 | ||
| 182 | -2. 重新提交审核 | ||
| 183 | - | ||
| 184 | -### 放弃本次解析 | ||
| 185 | -```bash | ||
| 186 | -rm docs/parse-audit/pending/计划书模版2/2026-02-15-计划书模版2-宏浚傳承保障計劃.md | ||
| 187 | -``` | ||
| 188 | - | ||
| 189 | ---- | ||
| 190 | - | ||
| 191 | -## 审核状态 | ||
| 192 | - | ||
| 193 | -- [ ] 待审核 | ||
| 194 | -- [ ] 已通过 | ||
| 195 | -- [ ] 已拒绝 | ||
| 196 | - | ||
| 197 | -## 审核意见 | ||
| 198 | - | ||
| 199 | -```text | ||
| 200 | -``` |
| 1 | -# 产品配置审核 - 计划书模版2.docx | ||
| 2 | - | ||
| 3 | -**解析时间**: 2026/2/15 11:18:47 | ||
| 4 | -**原始文件**: 计划书模版2.docx | ||
| 5 | -**数据来源**: docs/to-parse/计划书模版2.docx | ||
| 6 | - | ||
| 7 | ---- | ||
| 8 | - | ||
| 9 | -## 📋 产品基本信息 | ||
| 10 | - | ||
| 11 | -| 字段 | 提取值 | 需要确认 | | ||
| 12 | -|------|--------|---------| | ||
| 13 | -| 产品名称 | 赤霞珠終身壽險計劃2基本人壽保障選項 | ✅ 请核对产品名称 | | ||
| 14 | -| 产品类型 | savings | ✅ 请确认产品类型 | | ||
| 15 | -| 币种 | USD | ✅ 请确认币种 | | ||
| 16 | -| form_sn | `savings-2-031c1237` | ✅ 请确认 form_sn 唯一性 | | ||
| 17 | -| 缴费年期 | ["5年","8年","12年","15年"] | ✅ 请确认缴费年期选项 | | ||
| 18 | -| 年龄范围 | 0-75岁 | ✅ 请确认年龄范围 | | ||
| 19 | -| 保险期间 | 终身 | ✅ 请确认保险期间 | | ||
| 20 | - | ||
| 21 | - | ||
| 22 | -### 💰 储蓄类产品特有字段 | ||
| 23 | - | ||
| 24 | -| 字段 | 提取值 | 需要确认 | | ||
| 25 | -|------|--------|---------| | ||
| 26 | -| 提取方式 | ["年龄指定金额","最高固定金额"] | ✅ 请确认提取方式 | | ||
| 27 | -| 提取期 | ["1年","3年","5年","10年"] | ✅ 请确认提取期选项 | | ||
| 28 | - | ||
| 29 | - | ||
| 30 | ---- | ||
| 31 | - | ||
| 32 | -## 🤖 智能字段提取报告 | ||
| 33 | - | ||
| 34 | -### 匹配统计 | ||
| 35 | - | ||
| 36 | -- ✅ 成功匹配: 2 字段 | ||
| 37 | -- ⚠️ 使用默认值: 4 字段 | ||
| 38 | -- ❌ 未匹配(需人工补充): 0 字段 | ||
| 39 | - | ||
| 40 | -### ✅ 已成功匹配的字段 | ||
| 41 | - | ||
| 42 | -- product_name | ||
| 43 | -- payment_periods | ||
| 44 | - | ||
| 45 | - | ||
| 46 | -### ⚠️ 使用默认值的字段 | ||
| 47 | - | ||
| 48 | -- **product_type**: 未找到字段 "product_type",使用默认值: "savings" | ||
| 49 | -- **currency**: 未找到字段 "currency",使用默认值: "USD" | ||
| 50 | -- **age_range**: 未找到字段 "age_range",使用默认值: {"min":0,"max":75} | ||
| 51 | -- **insurance_period**: 未找到字段 "insurance_period",使用默认值: "终身" | ||
| 52 | - | ||
| 53 | - | ||
| 54 | - | ||
| 55 | - | ||
| 56 | ---- | ||
| 57 | - | ||
| 58 | -## 🧾 配置预览 | ||
| 59 | - | ||
| 60 | -```javascript | ||
| 61 | -{ | ||
| 62 | - "product_name": "赤霞珠終身壽險計劃2基本人壽保障選項", | ||
| 63 | - "product_type": "savings", | ||
| 64 | - "currency": "USD", | ||
| 65 | - "form_sn": "savings-2-031c1237", | ||
| 66 | - "payment_periods": [ | ||
| 67 | - "5年", | ||
| 68 | - "8年", | ||
| 69 | - "12年", | ||
| 70 | - "15年" | ||
| 71 | - ], | ||
| 72 | - "age_range": { | ||
| 73 | - "min": 0, | ||
| 74 | - "max": 75 | ||
| 75 | - }, | ||
| 76 | - "insurance_period": "终身", | ||
| 77 | - "is_savings": true, | ||
| 78 | - "withdrawal_modes": [ | ||
| 79 | - "年龄指定金额", | ||
| 80 | - "最高固定金额" | ||
| 81 | - ], | ||
| 82 | - "withdrawal_periods": [ | ||
| 83 | - "1年", | ||
| 84 | - "3年", | ||
| 85 | - "5年", | ||
| 86 | - "10年" | ||
| 87 | - ] | ||
| 88 | -} | ||
| 89 | -``` | ||
| 90 | - | ||
| 91 | ---- | ||
| 92 | - | ||
| 93 | -## 📝 表单字段 (form_schema) | ||
| 94 | - | ||
| 95 | -```javascript | ||
| 96 | -{ | ||
| 97 | - "base_fields": [], | ||
| 98 | - "withdrawal_fields": [], | ||
| 99 | - "reset_map": {} | ||
| 100 | -} | ||
| 101 | -``` | ||
| 102 | - | ||
| 103 | ---- | ||
| 104 | - | ||
| 105 | -## 🔄 提交字段映射 (submit_mapping) | ||
| 106 | - | ||
| 107 | -```javascript | ||
| 108 | -{} | ||
| 109 | -``` | ||
| 110 | - | ||
| 111 | ---- | ||
| 112 | - | ||
| 113 | -## 🧩 生成配置片段 | ||
| 114 | - | ||
| 115 | -```javascript | ||
| 116 | -/** | ||
| 117 | - * 赤霞珠終身壽險計劃2基本人壽保障選項 | ||
| 118 | - * @added 2026-02-15T03:18:47.645Z | ||
| 119 | - * @source docs/to-parse/计划书模版2.docx | ||
| 120 | - */ | ||
| 121 | - 'savings-2-031c1237': { | ||
| 122 | - name: '赤霞珠終身壽險計劃2基本人壽保障選項', | ||
| 123 | - component: 'SavingsTemplate', | ||
| 124 | - category: 'savings', | ||
| 125 | - config: { | ||
| 126 | - currency: 'USD', | ||
| 127 | - payment_periods: ["5年","8年","12年","15年"], | ||
| 128 | - age_range: { min: 0, max: 75 }, | ||
| 129 | - insurance_period: '终身', | ||
| 130 | - withdrawal_plan: { | ||
| 131 | - enabled: true, | ||
| 132 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 133 | - default_currency: 'USD', | ||
| 134 | - withdrawal_modes: ["年龄指定金额","最高固定金额"], | ||
| 135 | - withdrawal_periods: ["1年","3年","5年","10年"] | ||
| 136 | - }, | ||
| 137 | - form_schema: savingsFormSchema, | ||
| 138 | - submit_mapping: savingsSubmitMapping | ||
| 139 | - } | ||
| 140 | - } | ||
| 141 | -``` | ||
| 142 | - | ||
| 143 | ---- | ||
| 144 | - | ||
| 145 | -## ✅ 审核检查清单 | ||
| 146 | - | ||
| 147 | -### 基础信息 | ||
| 148 | -- [ ] 产品名称正确 | ||
| 149 | -- [ ] 产品类型正确(savings/critical-illness/life-insurance) | ||
| 150 | -- [ ] 币种正确(USD/CNY/HKD/EUR) | ||
| 151 | -- [ ] form_sn 唯一且符合命名规范 | ||
| 152 | - | ||
| 153 | -### 缴费与年龄 | ||
| 154 | -- [ ] 缴费年期选项完整且正确 | ||
| 155 | -- [ ] 年龄范围合理 | ||
| 156 | -- [ ] 保险期间正确 | ||
| 157 | - | ||
| 158 | -### 储蓄类特有(如适用) | ||
| 159 | -- [ ] 提取方式正确 | ||
| 160 | -- [ ] 提取期选项完整 | ||
| 161 | -- [ ] 表单字段定义完整 | ||
| 162 | -- [ ] 提交字段映射正确 | ||
| 163 | - | ||
| 164 | ---- | ||
| 165 | - | ||
| 166 | -## 📋 审核后操作 | ||
| 167 | - | ||
| 168 | -### 确认无误 | ||
| 169 | -```bash | ||
| 170 | -# 1. 移动到 approved 目录 | ||
| 171 | -mv docs/parse-audit/pending/计划书模版2/2026-02-15-计划书模版2-赤霞珠終身壽險計劃2基本人壽保障選項.md \ | ||
| 172 | - docs/parse-audit/approved/ | ||
| 173 | - | ||
| 174 | -# 2. 合并到正式配置 | ||
| 175 | -# 手动复制或使用工具合并到 src/config/plan-templates.js | ||
| 176 | - | ||
| 177 | -# 3. 删除待审核文件(可选) | ||
| 178 | -rm docs/parse-audit/pending/计划书模版2/2026-02-15-计划书模版2-赤霞珠終身壽險計劃2基本人壽保障選項.md | ||
| 179 | -``` | ||
| 180 | - | ||
| 181 | -### 需要修改 | ||
| 182 | -1. 编辑本文件修正内容 | ||
| 183 | -2. 重新提交审核 | ||
| 184 | - | ||
| 185 | -### 放弃本次解析 | ||
| 186 | -```bash | ||
| 187 | -rm docs/parse-audit/pending/计划书模版2/2026-02-15-计划书模版2-赤霞珠終身壽險計劃2基本人壽保障選項.md | ||
| 188 | -``` | ||
| 189 | - | ||
| 190 | ---- | ||
| 191 | - | ||
| 192 | -## 审核状态 | ||
| 193 | - | ||
| 194 | -- [ ] 待审核 | ||
| 195 | -- [ ] 已通过 | ||
| 196 | -- [ ] 已拒绝 | ||
| 197 | - | ||
| 198 | -## 审核意见 | ||
| 199 | - | ||
| 200 | -```text | ||
| 201 | -``` |
docs/parsed-backup/backup-log.jsonl
deleted
100644 → 0
| 1 | -{"action":"update","backup_file":"/Users/huyirui/program/itomix/git/manulife-weapp/docs/parsed-backup/plan-templates.backup.1771074633927.js","target_file":"/Users/huyirui/program/itomix/git/manulife-weapp/src/config/plan-templates.js","form_sn_list":["savings-product-30b41aae"],"at":"2026-02-14T13:10:33.928Z"} | ||
| 2 | -{"action":"update","backup_file":"/Users/huyirui/program/itomix/git/manulife-weapp/docs/parsed-backup/plan-templates.backup.1771077530778.js","target_file":"/Users/huyirui/program/itomix/git/manulife-weapp/src/config/plan-templates.js","form_sn_list":["savings-2-148b3acd"],"at":"2026-02-14T13:58:50.779Z"} | ||
| 3 | -{"action":"update","backup_file":"/Users/huyirui/program/itomix/git/manulife-weapp/docs/parsed-backup/plan-templates.backup.1771077569110.js","target_file":"/Users/huyirui/program/itomix/git/manulife-weapp/src/config/plan-templates.js","form_sn_list":["savings-readme-a4296d1f"],"at":"2026-02-14T13:59:29.110Z"} | ||
| 4 | -{"action":"update","backup_file":"/Users/huyirui/program/itomix/git/manulife-weapp/docs/parsed-backup/plan-templates.backup.1771077989896.js","target_file":"/Users/huyirui/program/itomix/git/manulife-weapp/src/config/plan-templates.js","form_sn_list":["savings-readme-a4296d1f"],"at":"2026-02-14T14:06:29.896Z"} | ||
| 5 | -{"action":"update","backup_file":"/Users/huyirui/program/itomix/git/manulife-weapp/docs/parsed-backup/plan-templates.backup.1771078080604.js","target_file":"/Users/huyirui/program/itomix/git/manulife-weapp/src/config/plan-templates.js","form_sn_list":["savings-readme-a4296d1f"],"at":"2026-02-14T14:08:00.605Z"} | ||
| 6 | -{"action":"update","backup_file":"/Users/huyirui/program/itomix/git/manulife-weapp/docs/parsed-backup/plan-templates.backup.1771078351660.js","target_file":"/Users/huyirui/program/itomix/git/manulife-weapp/src/config/plan-templates.js","form_sn_list":["savings-2-148b3acd"],"at":"2026-02-14T14:12:31.660Z"} | ||
| 7 | -{"action":"update","backup_file":"/Users/huyirui/program/itomix/git/manulife-weapp/docs/parsed-backup/plan-templates.backup.1771080130974.js","target_file":"/Users/huyirui/program/itomix/git/manulife-weapp/src/config/plan-templates.js","form_sn_list":["savings-2-55bcffc2"],"at":"2026-02-14T14:42:10.974Z"} | ||
| 8 | -{"action":"update","backup_file":"/Users/huyirui/program/itomix/git/manulife-weapp/docs/parsed-backup/plan-templates.backup.1771137003708.js","target_file":"/Users/huyirui/program/itomix/git/manulife-weapp/src/config/plan-templates.js","form_sn_list":["life-insurance-3-d8fde07d"],"at":"2026-02-15T06:30:03.709Z"} |
docs/parsed-backup/parse-audit.jsonl
deleted
100644 → 0
| 1 | -{"at":"2026-02-14T13:10:33.928Z","mode":"single","options":{"dry_run":false},"summary":{"total":1,"success":1,"failed":0,"duration_ms":3,"success_list":[{"form_sn":"savings-product-30b41aae","product_name":"测试计划书-智享未来","file":"测试计划书-智享未来.md"}],"failed_list":[]},"change_summary":{"ok":true,"dry_run":false,"updated_count":1,"form_sn_list":["savings-product-30b41aae"],"conflicts":[],"reason":null}} | ||
| 2 | -{"at":"2026-02-14T13:58:50.780Z","mode":"single","options":{"dry_run":false},"summary":{"total":1,"success":1,"failed":0,"duration_ms":2,"success_list":[{"form_sn":"savings-2-148b3acd","product_name":"测试计划书-智享未来2","file":"测试计划书-智享未来2.md"}],"failed_list":[]},"change_summary":{"ok":true,"dry_run":false,"updated_count":1,"form_sn_list":["savings-2-148b3acd"],"conflicts":[],"reason":null}} | ||
| 3 | -{"at":"2026-02-14T13:59:29.111Z","mode":"single","options":{"dry_run":false},"summary":{"total":1,"success":1,"failed":0,"duration_ms":2,"success_list":[{"form_sn":"savings-readme-a4296d1f","product_name":"README","file":"README.md"}],"failed_list":[]},"change_summary":{"ok":true,"dry_run":false,"updated_count":1,"form_sn_list":["savings-readme-a4296d1f"],"conflicts":[],"reason":null}} | ||
| 4 | -{"at":"2026-02-14T14:06:15.148Z","mode":"single","options":{"dry_run":false},"summary":{"total":1,"success":1,"failed":0,"duration_ms":2,"success_list":[{"form_sn":"savings-readme-a4296d1f","product_name":"README","file":"README.md"}],"failed_list":[]},"change_summary":{"ok":false,"dry_run":false,"updated_count":0,"form_sn_list":[],"conflicts":["savings-readme-a4296d1f"],"reason":"conflict"}} | ||
| 5 | -{"at":"2026-02-14T14:06:29.897Z","mode":"single","options":{"dry_run":false},"summary":{"total":1,"success":1,"failed":0,"duration_ms":2,"success_list":[{"form_sn":"savings-readme-a4296d1f","product_name":"README","file":"README.md"}],"failed_list":[]},"change_summary":{"ok":true,"dry_run":false,"updated_count":1,"form_sn_list":["savings-readme-a4296d1f"],"conflicts":[],"reason":null}} | ||
| 6 | -{"at":"2026-02-14T14:08:00.605Z","mode":"single","options":{"dry_run":false},"summary":{"total":1,"success":1,"failed":0,"duration_ms":2,"success_list":[{"form_sn":"savings-readme-a4296d1f","product_name":"README","file":"README.md"}],"failed_list":[]},"change_summary":{"ok":true,"dry_run":false,"updated_count":1,"form_sn_list":["savings-readme-a4296d1f"],"conflicts":[],"reason":null}} | ||
| 7 | -{"at":"2026-02-14T14:12:31.661Z","mode":"single","options":{"dry_run":false},"summary":{"total":1,"success":1,"failed":0,"duration_ms":1,"success_list":[{"form_sn":"savings-2-148b3acd","product_name":"测试计划书-智享未来2","file":"测试计划书-智享未来2.md"}],"failed_list":[]},"change_summary":{"ok":true,"dry_run":false,"updated_count":1,"form_sn_list":["savings-2-148b3acd"],"conflicts":[],"reason":null}} | ||
| 8 | -{"at":"2026-02-14T14:34:05.582Z","mode":"single","options":{"dry_run":false},"summary":{"total":1,"success":1,"failed":0,"duration_ms":2,"success_list":[{"form_sn":"savings-2-148b3acd","product_name":"测试计划书-智享未来2","file":"测试计划书-智享未来2.md"}],"failed_list":[]},"change_summary":{"ok":false,"dry_run":false,"updated_count":0,"form_sn_list":[],"conflicts":["savings-2-148b3acd"],"reason":"conflict"}} | ||
| 9 | -{"at":"2026-02-14T14:34:22.438Z","mode":"single","options":{"dry_run":false},"summary":{"total":1,"success":1,"failed":0,"duration_ms":2,"success_list":[{"form_sn":"savings-2-148b3acd","product_name":"测试计划书-智享未来2","file":"测试计划书-智享未来2.md"}],"failed_list":[]},"change_summary":{"ok":false,"dry_run":false,"updated_count":0,"form_sn_list":[],"conflicts":["savings-2-148b3acd"],"reason":"conflict"}} | ||
| 10 | -{"at":"2026-02-14T14:34:50.292Z","mode":"single","options":{"dry_run":false},"summary":{"total":1,"success":1,"failed":0,"duration_ms":1153,"success_list":[{"form_sn":"savings-2-148b3acd","product_name":"测试计划书-智享未来2","file":"测试计划书-智享未来2.md"}],"failed_list":[]},"change_summary":{"ok":false,"dry_run":false,"updated_count":0,"form_sn_list":[],"conflicts":["savings-2-148b3acd"],"reason":"conflict"}} | ||
| 11 | -{"at":"2026-02-14T14:35:12.489Z","mode":"single","options":{"dry_run":false},"summary":{"total":1,"success":1,"failed":0,"duration_ms":6,"success_list":[{"form_sn":"savings-2-148b3acd","product_name":"测试计划书-智享未来2","file":"测试计划书-智享未来2.md"}],"failed_list":[]},"change_summary":{"ok":false,"dry_run":false,"updated_count":0,"form_sn_list":[],"conflicts":["savings-2-148b3acd"],"reason":"conflict"}} | ||
| 12 | -{"at":"2026-02-14T14:35:32.726Z","mode":"single","options":{"dry_run":false},"summary":{"total":1,"success":1,"failed":0,"duration_ms":2,"success_list":[{"form_sn":"savings-2-148b3acd","product_name":"测试计划书-智享未来2","file":"测试计划书-智享未来2.md"}],"failed_list":[]},"change_summary":{"ok":false,"dry_run":false,"updated_count":0,"form_sn_list":[],"conflicts":["savings-2-148b3acd"],"reason":"conflict"}} | ||
| 13 | -{"at":"2026-02-14T14:42:10.975Z","mode":"single","options":{"dry_run":false},"summary":{"total":1,"success":1,"failed":0,"duration_ms":28,"success_list":[{"form_sn":"savings-2-55bcffc2","product_name":"计划书模版2","file":"计划书模版2.docx"}],"failed_list":[]},"change_summary":{"ok":true,"dry_run":false,"updated_count":1,"form_sn_list":["savings-2-55bcffc2"],"conflicts":[],"reason":null}} | ||
| 14 | -{"at":"2026-02-14T15:16:37.454Z","mode":"single","options":{"dry_run":true},"summary":{"total":1,"success":1,"failed":0,"duration_ms":39,"success_list":[{"form_sn":"savings-product-54cf664a","product_name":"智享未来储蓄计划书","file":"测试计划书-智享未来2.md"}],"failed_list":[]},"change_summary":{"ok":true,"dry_run":true,"updated_count":1,"form_sn_list":["savings-product-54cf664a"],"conflicts":[],"reason":null,"diff_preview":"--- plan-templates.js\n+++ plan-templates.js\n+ /**\n+ * 智享未来储蓄计划书\n+ * @added 2026-02-14T15:16:37.415Z\n+ * @source docs/to-parse/测试计划书-智享未来2.md\n+ */\n+ 'savings-product-54cf664a': {\n+ name: '智享未来储蓄计划书',\n+ component: 'SavingsTemplate',\n+ category: 'savings',\n+ config: {\n+ currency: 'USD',\n+ payment_periods: [\"整付\",\"3年\",\"5年\"],\n+ age_range: { min: 0, max: 75 },\n+ insurance_period: '终身',\n+ withdrawal_plan: {\n+ enabled: true,\n+ currencies: ['HKD', 'USD', 'CNY'],\n+ default_currency: 'USD',\n+ withdrawal_modes: [\"年龄指定金额\",\"最高固定金额\"],\n+ withdrawal_periods: [\"1年\",\"3年\",\"5年\",\"10年\"]\n+ },\n+ form_schema: savingsFormSchema,\n+ submit_mapping: savingsSubmitMapping\n+ }\n+ }"}} | ||
| 15 | -{"at":"2026-02-14T15:24:05.580Z","mode":"batch","options":{"dry_run":true},"summary":{"total":1,"success":1,"failed":0,"duration_ms":41,"success_list":[{"form_sn":"savings-2-55bcffc2","product_name":"计划书模版2","file":"计划书模版2.docx"}],"failed_list":[]},"change_summary":{"ok":true,"dry_run":true,"updated_count":1,"form_sn_list":["savings-2-55bcffc2"],"conflicts":[],"reason":null,"diff_preview":"--- plan-templates.js\n+++ plan-templates.js\n+ /**\n+ * 计划书模版2\n+ * @added 2026-02-14T15:24:05.564Z\n+ * @source docs/to-parse/计划书模版2.docx\n+ */\n+ 'savings-2-55bcffc2': {\n+ name: '计划书模版2',\n+ component: 'SavingsTemplate',\n+ category: 'savings',\n+ config: {\n+ currency: 'USD',\n+ payment_periods: [\"整付\",\"3年\",\"5年\"],\n+ age_range: { min: 0, max: 75 },\n+ insurance_period: '终身',\n+ withdrawal_plan: {\n+ enabled: true,\n+ currencies: ['HKD', 'USD', 'CNY'],\n+ default_currency: 'USD',\n+ withdrawal_modes: [\"年龄指定金额\",\"最高固定金额\"],\n+ withdrawal_periods: [\"1年\",\"3年\",\"5年\",\"10年\"]\n+ },\n+ form_schema: savingsFormSchema,\n+ submit_mapping: savingsSubmitMapping\n+ }\n+ }"}} | ||
| 16 | -{"at":"2026-02-14T15:29:02.807Z","mode":"batch","options":{"dry_run":true},"summary":{"total":2,"success":2,"failed":0,"duration_ms":50,"success_list":[{"form_sn":"savings-2-55bcffc2","product_name":"计划书模版2","file":"计划书模版2.docx"},{"form_sn":"savings-3-8f4f27ad","product_name":"计划书模版3","file":"计划书模版3.docx"}],"failed_list":[]},"change_summary":{"ok":true,"dry_run":true,"updated_count":2,"form_sn_list":["savings-2-55bcffc2","savings-3-8f4f27ad"],"conflicts":[],"reason":null,"diff_preview":"--- plan-templates.js\n+++ plan-templates.js\n+ /**\n+ * 计划书模版2\n+ * @added 2026-02-14T15:29:02.781Z\n+ * @source docs/to-parse/计划书模版2.docx\n+ */\n+ 'savings-2-55bcffc2': {\n+ name: '计划书模版2',\n+ component: 'SavingsTemplate',\n+ category: 'savings',\n+ config: {\n+ currency: 'USD',\n+ payment_periods: [\"整付\",\"3年\",\"5年\"],\n+ age_range: { min: 0, max: 75 },\n+ insurance_period: '终身',\n+ withdrawal_plan: {\n+ enabled: true,\n+ currencies: ['HKD', 'USD', 'CNY'],\n+ default_currency: 'USD',\n+ withdrawal_modes: [\"年龄指定金额\",\"最高固定金额\"],\n+ withdrawal_periods: [\"1年\",\"3年\",\"5年\",\"10年\"]\n+ },\n+ form_schema: savingsFormSchema,\n+ submit_mapping: savingsSubmitMapping\n+ }\n+ },\n+ \n+ /**\n+ * 计划书模版3\n+ * @added 2026-02-14T15:29:02.804Z\n+ * @source docs/to-parse/计划书模版3.docx\n+ */\n+ 'savings-3-8f4f27ad': {\n+ name: '计划书模版3',\n+ component: 'SavingsTemplate',\n+ category: 'savings',\n+ config: {\n+ currency: 'USD',\n+ payment_periods: [\"整付\",\"3年\",\"5年\"],\n+ age_range: { min: 0, max: 75 },\n+ insurance_period: '终身',\n+ withdrawal_plan: {\n+ enabled: true,\n+ currencies: ['HKD', 'USD', 'CNY'],\n+ default_currency: 'USD',\n+ withdrawal_modes: [\"年龄指定金额\",\"最高固定金额\"],\n+ withdrawal_periods: [\"1年\",\"3年\",\"5年\",\"10年\"]\n+ },\n+ form_schema: savingsFormSchema,\n+ submit_mapping: savingsSubmitMapping\n+ }\n+ }"}} | ||
| 17 | -{"at":"2026-02-14T15:30:22.307Z","mode":"batch","options":{"dry_run":true},"summary":{"total":2,"success":2,"failed":0,"duration_ms":49,"success_list":[{"form_sn":"savings-2-55bcffc2","product_name":"计划书模版2","file":"计划书模版2.docx"},{"form_sn":"savings-3-8f4f27ad","product_name":"计划书模版3","file":"计划书模版3.docx"}],"failed_list":[]},"change_summary":{"ok":true,"dry_run":true,"updated_count":2,"form_sn_list":["savings-2-55bcffc2","savings-3-8f4f27ad"],"conflicts":[],"reason":null,"diff_preview":"--- plan-templates.js\n+++ plan-templates.js\n+ /**\n+ * 计划书模版2\n+ * @added 2026-02-14T15:30:22.283Z\n+ * @source docs/to-parse/计划书模版2.docx\n+ */\n+ 'savings-2-55bcffc2': {\n+ name: '计划书模版2',\n+ component: 'SavingsTemplate',\n+ category: 'savings',\n+ config: {\n+ currency: 'USD',\n+ payment_periods: [\"整付\",\"3年\",\"5年\"],\n+ age_range: { min: 0, max: 75 },\n+ insurance_period: '终身',\n+ withdrawal_plan: {\n+ enabled: true,\n+ currencies: ['HKD', 'USD', 'CNY'],\n+ default_currency: 'USD',\n+ withdrawal_modes: [\"年龄指定金额\",\"最高固定金额\"],\n+ withdrawal_periods: [\"1年\",\"3年\",\"5年\",\"10年\"]\n+ },\n+ form_schema: savingsFormSchema,\n+ submit_mapping: savingsSubmitMapping\n+ }\n+ },\n+ \n+ /**\n+ * 计划书模版3\n+ * @added 2026-02-14T15:30:22.304Z\n+ * @source docs/to-parse/计划书模版3.docx\n+ */\n+ 'savings-3-8f4f27ad': {\n+ name: '计划书模版3',\n+ component: 'SavingsTemplate',\n+ category: 'savings',\n+ config: {\n+ currency: 'USD',\n+ payment_periods: [\"整付\",\"3年\",\"5年\"],\n+ age_range: { min: 0, max: 75 },\n+ insurance_period: '终身',\n+ withdrawal_plan: {\n+ enabled: true,\n+ currencies: ['HKD', 'USD', 'CNY'],\n+ default_currency: 'USD',\n+ withdrawal_modes: [\"年龄指定金额\",\"最高固定金额\"],\n+ withdrawal_periods: [\"1年\",\"3年\",\"5年\",\"10年\"]\n+ },\n+ form_schema: savingsFormSchema,\n+ submit_mapping: savingsSubmitMapping\n+ }\n+ }"}} | ||
| 18 | -{"at":"2026-02-14T15:51:38.101Z","mode":"batch","options":{"dry_run":true},"summary":{"total":2,"success":2,"failed":0,"duration_ms":47,"success_list":[{"form_sn":"savings-2-55bcffc2","product_name":"计划书模版2","file":"计划书模版2.docx"},{"form_sn":"savings-3-8f4f27ad","product_name":"计划书模版3","file":"计划书模版3.docx"}],"failed_list":[]},"change_summary":{"ok":true,"dry_run":true,"updated_count":2,"form_sn_list":["savings-2-55bcffc2","savings-3-8f4f27ad"],"conflicts":[],"reason":null,"diff_preview":"--- plan-templates.js\n+++ plan-templates.js\n+ /**\n+ * 计划书模版2\n+ * @added 2026-02-14T15:51:38.078Z\n+ * @source docs/to-parse/计划书模版2.docx\n+ */\n+ 'savings-2-55bcffc2': {\n+ name: '计划书模版2',\n+ component: 'SavingsTemplate',\n+ category: 'savings',\n+ config: {\n+ currency: 'USD',\n+ payment_periods: [\"整付\",\"3年\",\"5年\"],\n+ age_range: { min: 0, max: 75 },\n+ insurance_period: '终身',\n+ withdrawal_plan: {\n+ enabled: true,\n+ currencies: ['HKD', 'USD', 'CNY'],\n+ default_currency: 'USD',\n+ withdrawal_modes: [\"年龄指定金额\",\"最高固定金额\"],\n+ withdrawal_periods: [\"1年\",\"3年\",\"5年\",\"10年\"]\n+ },\n+ form_schema: savingsFormSchema,\n+ submit_mapping: savingsSubmitMapping\n+ }\n+ },\n+ \n+ /**\n+ * 计划书模版3\n+ * @added 2026-02-14T15:51:38.098Z\n+ * @source docs/to-parse/计划书模版3.docx\n+ */\n+ 'savings-3-8f4f27ad': {\n+ name: '计划书模版3',\n+ component: 'SavingsTemplate',\n+ category: 'savings',\n+ config: {\n+ currency: 'USD',\n+ payment_periods: [\"整付\",\"3年\",\"5年\"],\n+ age_range: { min: 0, max: 75 },\n+ insurance_period: '终身',\n+ withdrawal_plan: {\n+ enabled: true,\n+ currencies: ['HKD', 'USD', 'CNY'],\n+ default_currency: 'USD',\n+ withdrawal_modes: [\"年龄指定金额\",\"最高固定金额\"],\n+ withdrawal_periods: [\"1年\",\"3年\",\"5年\",\"10年\"]\n+ },\n+ form_schema: savingsFormSchema,\n+ submit_mapping: savingsSubmitMapping\n+ }\n+ }"}} | ||
| 19 | -{"at":"2026-02-14T15:58:54.732Z","mode":"batch","options":{"dry_run":true},"summary":{"total":2,"success":2,"failed":0,"duration_ms":51,"success_list":[{"form_sn":"savings-2-55bcffc2","product_name":"计划书模版2","file":"计划书模版2.docx"},{"form_sn":"savings-3-8f4f27ad","product_name":"计划书模版3","file":"计划书模版3.docx"}],"failed_list":[]},"change_summary":{"ok":true,"dry_run":true,"updated_count":2,"form_sn_list":["savings-2-55bcffc2","savings-3-8f4f27ad"],"conflicts":[],"reason":null,"diff_preview":"--- plan-templates.js\n+++ plan-templates.js\n+ /**\n+ * 计划书模版2\n+ * @added 2026-02-14T15:58:54.707Z\n+ * @source docs/to-parse/计划书模版2.docx\n+ */\n+ 'savings-2-55bcffc2': {\n+ name: '计划书模版2',\n+ component: 'SavingsTemplate',\n+ category: 'savings',\n+ config: {\n+ currency: 'USD',\n+ payment_periods: [\"整付\"],\n+ age_range: { min: 0, max: 75 },\n+ insurance_period: '终身',\n+ withdrawal_plan: {\n+ enabled: true,\n+ currencies: ['HKD', 'USD', 'CNY'],\n+ default_currency: 'USD',\n+ withdrawal_modes: [\"指定提取金额\",\"最高固定提取金额\"],\n+ withdrawal_periods: [\"1年\",\"3年\",\"5年\",\"10年\"]\n+ },\n+ form_schema: savingsFormSchema,\n+ submit_mapping: savingsSubmitMapping\n+ }\n+ },\n+ \n+ /**\n+ * 计划书模版3\n+ * @added 2026-02-14T15:58:54.729Z\n+ * @source docs/to-parse/计划书模版3.docx\n+ */\n+ 'savings-3-8f4f27ad': {\n+ name: '计划书模版3',\n+ component: 'SavingsTemplate',\n+ category: 'savings',\n+ config: {\n+ currency: 'USD',\n+ payment_periods: [\"5年\"],\n+ age_range: { min: 0, max: 75 },\n+ insurance_period: '终身',\n+ withdrawal_plan: {\n+ enabled: true,\n+ currencies: ['HKD', 'USD', 'CNY'],\n+ default_currency: 'USD',\n+ withdrawal_modes: [\"年龄指定金额\",\"最高固定金额\"],\n+ withdrawal_periods: [\"1年\",\"3年\",\"5年\",\"10年\"]\n+ },\n+ form_schema: savingsFormSchema,\n+ submit_mapping: savingsSubmitMapping\n+ }\n+ }"}} | ||
| 20 | -{"at":"2026-02-14T16:37:53.682Z","mode":"single","options":{"dry_run":true},"summary":{"total_docs":1,"total_products":4,"success":4,"failed":0,"duration_ms":48,"success_list":[{"form_sn":"savings-product-ef3dd50b","product_name":"宏摯傳承保障計劃 - 性別, 年齡, 出生年月日","file":"计划书模版2.docx"},{"form_sn":"savings-product-aaaa60f8","product_name":"宏摯家傳承保險計劃- 性別, 年齡, 出生年月日","file":"计划书模版2.docx"},{"form_sn":"savings-product-d1581522","product_name":"宏浚傳承保障計劃","file":"计划书模版2.docx"},{"form_sn":"savings-2-031c1237","product_name":"赤霞珠終身壽險計劃2基本人壽保障選項","file":"计划书模版2.docx"}],"failed_list":[]},"change_summary":{"ok":false,"dry_run":false,"updated_count":0,"form_sn_list":[],"conflicts":[],"reason":"insert_not_found"}} | ||
| 21 | -{"at":"2026-02-14T16:38:42.112Z","mode":"single","options":{"dry_run":true},"summary":{"total_docs":1,"total_products":4,"success":4,"failed":0,"duration_ms":47,"success_list":[{"form_sn":"savings-product-ef3dd50b","product_name":"宏摯傳承保障計劃 - 性別, 年齡, 出生年月日","file":"计划书模版2.docx"},{"form_sn":"savings-product-aaaa60f8","product_name":"宏摯家傳承保險計劃- 性別, 年齡, 出生年月日","file":"计划书模版2.docx"},{"form_sn":"savings-product-d1581522","product_name":"宏浚傳承保障計劃","file":"计划书模版2.docx"},{"form_sn":"savings-2-031c1237","product_name":"赤霞珠終身壽險計劃2基本人壽保障選項","file":"计划书模版2.docx"}],"failed_list":[]},"change_summary":{"ok":false,"dry_run":false,"updated_count":0,"form_sn_list":[],"conflicts":[],"reason":"insert_not_found"}} | ||
| 22 | -{"at":"2026-02-14T16:39:13.208Z","mode":"single","options":{"dry_run":true},"summary":{"total_docs":1,"total_products":4,"success":4,"failed":0,"duration_ms":46,"success_list":[{"form_sn":"savings-product-ef3dd50b","product_name":"宏摯傳承保障計劃 - 性別, 年齡, 出生年月日","file":"计划书模版2.docx"},{"form_sn":"savings-product-aaaa60f8","product_name":"宏摯家傳承保險計劃- 性別, 年齡, 出生年月日","file":"计划书模版2.docx"},{"form_sn":"savings-product-d1581522","product_name":"宏浚傳承保障計劃","file":"计划书模版2.docx"},{"form_sn":"savings-2-031c1237","product_name":"赤霞珠終身壽險計劃2基本人壽保障選項","file":"计划书模版2.docx"}],"failed_list":[]},"change_summary":{"ok":false,"dry_run":false,"updated_count":0,"form_sn_list":[],"conflicts":[],"reason":"insert_not_found"}} | ||
| 23 | -{"at":"2026-02-14T16:39:23.952Z","mode":"single","options":{"dry_run":true},"summary":{"total_docs":1,"total_products":4,"success":4,"failed":0,"duration_ms":46,"success_list":[{"form_sn":"savings-product-ef3dd50b","product_name":"宏摯傳承保障計劃 - 性別, 年齡, 出生年月日","file":"计划书模版2.docx"},{"form_sn":"savings-product-aaaa60f8","product_name":"宏摯家傳承保險計劃- 性別, 年齡, 出生年月日","file":"计划书模版2.docx"},{"form_sn":"savings-product-d1581522","product_name":"宏浚傳承保障計劃","file":"计划书模版2.docx"},{"form_sn":"savings-2-031c1237","product_name":"赤霞珠終身壽險計劃2基本人壽保障選項","file":"计划书模版2.docx"}],"failed_list":[]},"change_summary":{"ok":false,"dry_run":false,"updated_count":0,"form_sn_list":[],"conflicts":[],"reason":"insert_not_found"}} | ||
| 24 | -{"at":"2026-02-14T16:39:56.947Z","mode":"single","options":{"dry_run":true},"summary":{"total_docs":1,"total_products":4,"success":4,"failed":0,"duration_ms":46,"success_list":[{"form_sn":"savings-product-ef3dd50b","product_name":"宏摯傳承保障計劃 - 性別, 年齡, 出生年月日","file":"计划书模版2.docx"},{"form_sn":"savings-product-aaaa60f8","product_name":"宏摯家傳承保險計劃- 性別, 年齡, 出生年月日","file":"计划书模版2.docx"},{"form_sn":"savings-product-d1581522","product_name":"宏浚傳承保障計劃","file":"计划书模版2.docx"},{"form_sn":"savings-2-031c1237","product_name":"赤霞珠終身壽險計劃2基本人壽保障選項","file":"计划书模版2.docx"}],"failed_list":[]},"change_summary":{"ok":false,"dry_run":false,"updated_count":0,"form_sn_list":[],"conflicts":[],"reason":"insert_not_found"}} | ||
| 25 | -{"at":"2026-02-14T16:41:18.047Z","mode":"single","options":{"dry_run":true},"summary":{"total_docs":1,"total_products":4,"success":4,"failed":0,"duration_ms":46,"success_list":[{"form_sn":"savings-product-ef3dd50b","product_name":"宏摯傳承保障計劃 - 性別, 年齡, 出生年月日","file":"计划书模版2.docx"},{"form_sn":"savings-product-aaaa60f8","product_name":"宏摯家傳承保險計劃- 性別, 年齡, 出生年月日","file":"计划书模版2.docx"},{"form_sn":"savings-product-d1581522","product_name":"宏浚傳承保障計劃","file":"计划书模版2.docx"},{"form_sn":"savings-2-031c1237","product_name":"赤霞珠終身壽險計劃2基本人壽保障選項","file":"计划书模版2.docx"}],"failed_list":[]},"change_summary":{"ok":true,"dry_run":true,"updated_count":4,"form_sn_list":["savings-product-ef3dd50b","savings-product-aaaa60f8","savings-product-d1581522","savings-2-031c1237"],"conflicts":[],"reason":null,"diff_preview":"--- plan-templates.js\n+++ plan-templates.js\n+ /**\n+ * 宏摯傳承保障計劃 - 性別, 年齡, 出生年月日\n+ * @added 2026-02-14T16:41:18.029Z\n+ * @source docs/to-parse/计划书模版2.docx\n+ */\n+ 'savings-product-ef3dd50b': {\n+ name: '宏摯傳承保障計劃 - 性別, 年齡, 出生年月日',\n+ component: 'SavingsTemplate',\n+ category: 'savings',\n+ config: {\n+ currency: 'USD',\n+ payment_periods: [\"整付\",\"3年\",\"5年\",\"10年\",\"15年\"],\n+ age_range: { min: 0, max: 75 },\n+ insurance_period: '终身',\n+ withdrawal_plan: {\n+ enabled: true,\n+ currencies: ['HKD', 'USD', 'CNY'],\n+ default_currency: 'USD',\n+ withdrawal_modes: [\"最高固定提取金额\"],\n+ withdrawal_periods: [\"1年\",\"3年\",\"5年\",\"10年\"]\n+ },\n+ form_schema: savingsFormSchema,\n+ submit_mapping: savingsSubmitMapping\n+ }\n+ },\n+ \n+ /**\n+ * 宏摯家傳承保險計劃- 性別, 年齡, 出生年月日\n+ * @added 2026-02-14T16:41:18.044Z\n+ * @source docs/to-parse/计划书模版2.docx\n+ */\n+ 'savings-product-aaaa60f8': {\n+ name: '宏摯家傳承保險計劃- 性別, 年齡, 出生年月日',\n+ component: 'SavingsTemplate',\n+ category: 'savings',\n+ config: {\n+ currency: 'USD',\n+ payment_periods: [\"整付\",\"3年\",\"5年\"],\n+ age_range: { min: 0, max: 75 },\n+ insurance_period: '终身',\n+ withdrawal_plan: {\n+ enabled: true,\n+ currencies: ['HKD', 'USD', 'CNY'],\n+ default_currency: 'USD',\n+ withdrawal_modes: [\"年龄指定金额\",\"最高固定金额\"],\n+ withdrawal_periods: [\"1年\",\"3年\",\"5年\",\"10年\"]\n+ },\n+ form_schema: savingsFormSchema,\n+ submit_mapping: savingsSubmitMapping\n+ }\n+ },\n+ \n+ /**\n+ * 宏浚傳承保障計劃\n+ * @added 2026-02-14T16:41:18.044Z\n+ * @source docs/to-parse/计划书模版2.docx\n+ */\n+ 'savings-product-d1581522': {"}} | ||
| 26 | -{"at":"2026-02-14T16:41:27.896Z","mode":"single","options":{"dry_run":true},"summary":{"total_docs":1,"total_products":4,"success":4,"failed":0,"duration_ms":47,"success_list":[{"form_sn":"savings-product-ef3dd50b","product_name":"宏摯傳承保障計劃 - 性別, 年齡, 出生年月日","file":"计划书模版2.docx"},{"form_sn":"savings-product-aaaa60f8","product_name":"宏摯家傳承保險計劃- 性別, 年齡, 出生年月日","file":"计划书模版2.docx"},{"form_sn":"savings-product-d1581522","product_name":"宏浚傳承保障計劃","file":"计划书模版2.docx"},{"form_sn":"savings-2-031c1237","product_name":"赤霞珠終身壽險計劃2基本人壽保障選項","file":"计划书模版2.docx"}],"failed_list":[]},"change_summary":{"ok":true,"dry_run":true,"updated_count":4,"form_sn_list":["savings-product-ef3dd50b","savings-product-aaaa60f8","savings-product-d1581522","savings-2-031c1237"],"conflicts":[],"reason":null,"diff_preview":"--- plan-templates.js\n+++ plan-templates.js\n+ /**\n+ * 宏摯傳承保障計劃 - 性別, 年齡, 出生年月日\n+ * @added 2026-02-14T16:41:27.878Z\n+ * @source docs/to-parse/计划书模版2.docx\n+ */\n+ 'savings-product-ef3dd50b': {\n+ name: '宏摯傳承保障計劃 - 性別, 年齡, 出生年月日',\n+ component: 'SavingsTemplate',\n+ category: 'savings',\n+ config: {\n+ currency: 'USD',\n+ payment_periods: [\"整付\",\"3年\",\"5年\",\"10年\",\"15年\"],\n+ age_range: { min: 0, max: 75 },\n+ insurance_period: '终身',\n+ withdrawal_plan: {\n+ enabled: true,\n+ currencies: ['HKD', 'USD', 'CNY'],\n+ default_currency: 'USD',\n+ withdrawal_modes: [\"最高固定提取金额\"],\n+ withdrawal_periods: [\"1年\",\"3年\",\"5年\",\"10年\"]\n+ },\n+ form_schema: savingsFormSchema,\n+ submit_mapping: savingsSubmitMapping\n+ }\n+ },\n+ \n+ /**\n+ * 宏摯家傳承保險計劃- 性別, 年齡, 出生年月日\n+ * @added 2026-02-14T16:41:27.893Z\n+ * @source docs/to-parse/计划书模版2.docx\n+ */\n+ 'savings-product-aaaa60f8': {\n+ name: '宏摯家傳承保險計劃- 性別, 年齡, 出生年月日',\n+ component: 'SavingsTemplate',\n+ category: 'savings',\n+ config: {\n+ currency: 'USD',\n+ payment_periods: [\"整付\",\"3年\",\"5年\"],\n+ age_range: { min: 0, max: 75 },\n+ insurance_period: '终身',\n+ withdrawal_plan: {\n+ enabled: true,\n+ currencies: ['HKD', 'USD', 'CNY'],\n+ default_currency: 'USD',\n+ withdrawal_modes: [\"年龄指定金额\",\"最高固定金额\"],\n+ withdrawal_periods: [\"1年\",\"3年\",\"5年\",\"10年\"]\n+ },\n+ form_schema: savingsFormSchema,\n+ submit_mapping: savingsSubmitMapping\n+ }\n+ },\n+ \n+ /**\n+ * 宏浚傳承保障計劃\n+ * @added 2026-02-14T16:41:27.893Z\n+ * @source docs/to-parse/计划书模版2.docx\n+ */\n+ 'savings-product-d1581522': {"}} | ||
| 27 | -{"at":"2026-02-15T02:10:06.819Z","mode":"batch","options":{"dry_run":true},"summary":{"total_docs":2,"total_products":5,"success":5,"failed":0,"duration_ms":73,"success_list":[{"form_sn":"savings-product-ef3dd50b","product_name":"宏摯傳承保障計劃 - 性別, 年齡, 出生年月日","file":"计划书模版2.docx"},{"form_sn":"savings-product-aaaa60f8","product_name":"宏摯家傳承保險計劃- 性別, 年齡, 出生年月日","file":"计划书模版2.docx"},{"form_sn":"savings-product-d1581522","product_name":"宏浚傳承保障計劃","file":"计划书模版2.docx"},{"form_sn":"savings-2-031c1237","product_name":"赤霞珠終身壽險計劃2基本人壽保障選項","file":"计划书模版2.docx"},{"form_sn":"savings-3-8f4f27ad","product_name":"计划书模版3","file":"计划书模版3.docx"}],"failed_list":[],"total":5},"change_summary":{"ok":true,"dry_run":true,"updated_count":5,"form_sn_list":["savings-product-ef3dd50b","savings-product-aaaa60f8","savings-product-d1581522","savings-2-031c1237","savings-3-8f4f27ad"],"conflicts":[],"reason":null,"diff_preview":"--- plan-templates.js\n+++ plan-templates.js\n+ /**\n+ * 宏摯傳承保障計劃 - 性別, 年齡, 出生年月日\n+ * @added 2026-02-15T02:10:06.768Z\n+ * @source docs/to-parse/计划书模版2.docx\n+ */\n+ 'savings-product-ef3dd50b': {\n+ name: '宏摯傳承保障計劃 - 性別, 年齡, 出生年月日',\n+ component: 'SavingsTemplate',\n+ category: 'savings',\n+ config: {\n+ currency: 'USD',\n+ payment_periods: [\"整付\",\"3年\",\"5年\",\"10年\",\"15年\"],\n+ age_range: { min: 0, max: 75 },\n+ insurance_period: '终身',\n+ withdrawal_plan: {\n+ enabled: true,\n+ currencies: ['HKD', 'USD', 'CNY'],\n+ default_currency: 'USD',\n+ withdrawal_modes: [\"最高固定提取金额\"],\n+ withdrawal_periods: [\"1年\",\"3年\",\"5年\",\"10年\"]\n+ },\n+ form_schema: savingsFormSchema,\n+ submit_mapping: savingsSubmitMapping\n+ }\n+ },\n+ \n+ /**\n+ * 宏摯家傳承保險計劃- 性別, 年齡, 出生年月日\n+ * @added 2026-02-15T02:10:06.803Z\n+ * @source docs/to-parse/计划书模版2.docx\n+ */\n+ 'savings-product-aaaa60f8': {\n+ name: '宏摯家傳承保險計劃- 性別, 年齡, 出生年月日',\n+ component: 'SavingsTemplate',\n+ category: 'savings',\n+ config: {\n+ currency: 'USD',\n+ payment_periods: [\"整付\",\"3年\",\"5年\"],\n+ age_range: { min: 0, max: 75 },\n+ insurance_period: '终身',\n+ withdrawal_plan: {\n+ enabled: true,\n+ currencies: ['HKD', 'USD', 'CNY'],\n+ default_currency: 'USD',\n+ withdrawal_modes: [\"年龄指定金额\",\"最高固定金额\"],\n+ withdrawal_periods: [\"1年\",\"3年\",\"5年\",\"10年\"]\n+ },\n+ form_schema: savingsFormSchema,\n+ submit_mapping: savingsSubmitMapping\n+ }\n+ },\n+ \n+ /**\n+ * 宏浚傳承保障計劃\n+ * @added 2026-02-15T02:10:06.803Z\n+ * @source docs/to-parse/计划书模版2.docx\n+ */\n+ 'savings-product-d1581522': {"}} | ||
| 28 | -{"at":"2026-02-15T02:19:44.455Z","mode":"batch","options":{"dry_run":true},"summary":{"total_docs":1,"total_products":1,"success":1,"failed":0,"duration_ms":39,"success_list":[{"form_sn":"savings-3-8f4f27ad","product_name":"计划书模版3","file":"计划书模版3.docx"}],"failed_list":[],"total":1},"change_summary":{"ok":true,"dry_run":true,"updated_count":1,"form_sn_list":["savings-3-8f4f27ad"],"conflicts":[],"reason":null,"diff_preview":"--- plan-templates.js\n+++ plan-templates.js\n+ /**\n+ * 计划书模版3\n+ * @added 2026-02-15T02:19:44.438Z\n+ * @source docs/to-parse/计划书模版3.docx\n+ */\n+ 'savings-3-8f4f27ad': {\n+ name: '计划书模版3',\n+ component: 'SavingsTemplate',\n+ category: 'savings',\n+ config: {\n+ currency: 'USD',\n+ payment_periods: [\"5年\",\"8年\",\"12年\",\"15年\"],\n+ age_range: { min: 0, max: 75 },\n+ insurance_period: '终身',\n+ withdrawal_plan: {\n+ enabled: true,\n+ currencies: ['HKD', 'USD', 'CNY'],\n+ default_currency: 'USD',\n+ withdrawal_modes: [\"年龄指定金额\",\"最高固定金额\"],\n+ withdrawal_periods: [\"1年\",\"3年\",\"5年\",\"10年\"]\n+ },\n+ form_schema: savingsFormSchema,\n+ submit_mapping: savingsSubmitMapping\n+ }\n+ }"}} | ||
| 29 | -{"at":"2026-02-15T02:20:31.001Z","mode":"batch","options":{"dry_run":true},"summary":{"total_docs":1,"total_products":4,"success":4,"failed":0,"duration_ms":47,"success_list":[{"form_sn":"savings-product-ef3dd50b","product_name":"宏摯傳承保障計劃 - 性別, 年齡, 出生年月日","file":"计划书模版2.docx"},{"form_sn":"savings-product-aaaa60f8","product_name":"宏摯家傳承保險計劃- 性別, 年齡, 出生年月日","file":"计划书模版2.docx"},{"form_sn":"savings-product-d1581522","product_name":"宏浚傳承保障計劃","file":"计划书模版2.docx"},{"form_sn":"savings-2-031c1237","product_name":"赤霞珠終身壽險計劃2基本人壽保障選項","file":"计划书模版2.docx"}],"failed_list":[],"total":4},"change_summary":{"ok":true,"dry_run":true,"updated_count":4,"form_sn_list":["savings-product-ef3dd50b","savings-product-aaaa60f8","savings-product-d1581522","savings-2-031c1237"],"conflicts":[],"reason":null,"diff_preview":"--- plan-templates.js\n+++ plan-templates.js\n+ /**\n+ * 宏摯傳承保障計劃 - 性別, 年齡, 出生年月日\n+ * @added 2026-02-15T02:20:30.982Z\n+ * @source docs/to-parse/计划书模版2.docx\n+ */\n+ 'savings-product-ef3dd50b': {\n+ name: '宏摯傳承保障計劃 - 性別, 年齡, 出生年月日',\n+ component: 'SavingsTemplate',\n+ category: 'savings',\n+ config: {\n+ currency: 'USD',\n+ payment_periods: [\"整付\",\"3年\",\"5年\",\"10年\",\"15年\"],\n+ age_range: { min: 0, max: 75 },\n+ insurance_period: '终身',\n+ withdrawal_plan: {\n+ enabled: true,\n+ currencies: ['HKD', 'USD', 'CNY'],\n+ default_currency: 'USD',\n+ withdrawal_modes: [\"最高固定提取金额\"],\n+ withdrawal_periods: [\"1年\",\"3年\",\"5年\",\"10年\"]\n+ },\n+ form_schema: savingsFormSchema,\n+ submit_mapping: savingsSubmitMapping\n+ }\n+ },\n+ \n+ /**\n+ * 宏摯家傳承保險計劃- 性別, 年齡, 出生年月日\n+ * @added 2026-02-15T02:20:30.997Z\n+ * @source docs/to-parse/计划书模版2.docx\n+ */\n+ 'savings-product-aaaa60f8': {\n+ name: '宏摯家傳承保險計劃- 性別, 年齡, 出生年月日',\n+ component: 'SavingsTemplate',\n+ category: 'savings',\n+ config: {\n+ currency: 'USD',\n+ payment_periods: [\"整付\",\"3年\",\"5年\"],\n+ age_range: { min: 0, max: 75 },\n+ insurance_period: '终身',\n+ withdrawal_plan: {\n+ enabled: true,\n+ currencies: ['HKD', 'USD', 'CNY'],\n+ default_currency: 'USD',\n+ withdrawal_modes: [\"年龄指定金额\",\"最高固定金额\"],\n+ withdrawal_periods: [\"1年\",\"3年\",\"5年\",\"10年\"]\n+ },\n+ form_schema: savingsFormSchema,\n+ submit_mapping: savingsSubmitMapping\n+ }\n+ },\n+ \n+ /**\n+ * 宏浚傳承保障計劃\n+ * @added 2026-02-15T02:20:30.997Z\n+ * @source docs/to-parse/计划书模版2.docx\n+ */\n+ 'savings-product-d1581522': {"}} | ||
| 30 | -{"at":"2026-02-15T03:18:47.647Z","mode":"batch","options":{"dry_run":true},"summary":{"total_docs":1,"total_products":4,"success":4,"failed":0,"duration_ms":54,"success_list":[{"form_sn":"savings-product-ef3dd50b","product_name":"宏摯傳承保障計劃 - 性別, 年齡, 出生年月日","file":"计划书模版2.docx"},{"form_sn":"savings-product-aaaa60f8","product_name":"宏摯家傳承保險計劃- 性別, 年齡, 出生年月日","file":"计划书模版2.docx"},{"form_sn":"savings-product-d1581522","product_name":"宏浚傳承保障計劃","file":"计划书模版2.docx"},{"form_sn":"savings-2-031c1237","product_name":"赤霞珠終身壽險計劃2基本人壽保障選項","file":"计划书模版2.docx"}],"failed_list":[],"total":4},"change_summary":{"ok":true,"dry_run":true,"updated_count":4,"form_sn_list":["savings-product-ef3dd50b","savings-product-aaaa60f8","savings-product-d1581522","savings-2-031c1237"],"conflicts":[],"reason":null,"diff_preview":"--- plan-templates.js\n+++ plan-templates.js\n+ /**\n+ * 宏摯傳承保障計劃 - 性別, 年齡, 出生年月日\n+ * @added 2026-02-15T03:18:47.616Z\n+ * @source docs/to-parse/计划书模版2.docx\n+ */\n+ 'savings-product-ef3dd50b': {\n+ name: '宏摯傳承保障計劃 - 性別, 年齡, 出生年月日',\n+ component: 'SavingsTemplate',\n+ category: 'savings',\n+ config: {\n+ currency: 'USD',\n+ payment_periods: [\"整付\",\"3年\",\"5年\",\"10年\",\"15年\"],\n+ age_range: { min: 0, max: 75 },\n+ insurance_period: '终身',\n+ withdrawal_plan: {\n+ enabled: true,\n+ currencies: ['HKD', 'USD', 'CNY'],\n+ default_currency: 'USD',\n+ withdrawal_modes: [\"最高固定提取金额\"],\n+ withdrawal_periods: [\"1年\",\"3年\",\"5年\",\"10年\"]\n+ },\n+ form_schema: savingsFormSchema,\n+ submit_mapping: savingsSubmitMapping\n+ }\n+ },\n+ \n+ /**\n+ * 宏摯家傳承保險計劃- 性別, 年齡, 出生年月日\n+ * @added 2026-02-15T03:18:47.644Z\n+ * @source docs/to-parse/计划书模版2.docx\n+ */\n+ 'savings-product-aaaa60f8': {\n+ name: '宏摯家傳承保險計劃- 性別, 年齡, 出生年月日',\n+ component: 'SavingsTemplate',\n+ category: 'savings',\n+ config: {\n+ currency: 'USD',\n+ payment_periods: [\"整付\",\"3年\",\"5年\"],\n+ age_range: { min: 0, max: 75 },\n+ insurance_period: '终身',\n+ withdrawal_plan: {\n+ enabled: true,\n+ currencies: ['HKD', 'USD', 'CNY'],\n+ default_currency: 'USD',\n+ withdrawal_modes: [\"年龄指定金额\",\"最高固定金额\"],\n+ withdrawal_periods: [\"1年\",\"3年\",\"5年\",\"10年\"]\n+ },\n+ form_schema: savingsFormSchema,\n+ submit_mapping: savingsSubmitMapping\n+ }\n+ },\n+ \n+ /**\n+ * 宏浚傳承保障計劃\n+ * @added 2026-02-15T03:18:47.644Z\n+ * @source docs/to-parse/计划书模版2.docx\n+ */\n+ 'savings-product-d1581522': {"}} | ||
| 31 | -{"at":"2026-02-15T05:43:33.427Z","mode":"single","options":{"dry_run":true},"summary":{"total_docs":1,"total_products":1,"success":1,"failed":0,"duration_ms":39,"success_list":[{"form_sn":"savings-4-a204daaf","product_name":"计划书模版4","file":"计划书模版4.docx"}],"failed_list":[],"total":1},"change_summary":{"ok":true,"dry_run":true,"updated_count":1,"form_sn_list":["savings-4-a204daaf"],"conflicts":[],"reason":null,"diff_preview":"--- plan-templates.js\n+++ plan-templates.js\n+ /**\n+ * 计划书模版4\n+ * @added 2026-02-15T05:43:33.409Z\n+ * @source docs/to-parse/计划书模版4.docx\n+ */\n+ 'savings-4-a204daaf': {\n+ name: '计划书模版4',\n+ component: 'SavingsTemplate',\n+ category: 'savings',\n+ config: {\n+ currency: 'USD',\n+ payment_periods: [\"5年\",\"12年\",\"15年\"],\n+ age_range: { min: 0, max: 75 },\n+ insurance_period: '终身',\n+ withdrawal_plan: {\n+ enabled: true,\n+ currencies: ['HKD', 'USD', 'CNY'],\n+ default_currency: 'USD',\n+ withdrawal_modes: [\"年龄指定金额\",\"最高固定金额\"],\n+ withdrawal_periods: [\"1年\",\"3年\",\"5年\",\"10年\"]\n+ },\n+ form_schema: savingsFormSchema,\n+ submit_mapping: savingsSubmitMapping\n+ }\n+ }"}} | ||
| 32 | -{"at":"2026-02-15T05:45:13.034Z","mode":"batch","options":{"dry_run":true},"summary":{"total_docs":1,"total_products":1,"success":1,"failed":0,"duration_ms":39,"success_list":[{"form_sn":"savings-4-a204daaf","product_name":"计划书模版4","file":"计划书模版4.docx"}],"failed_list":[],"total":1},"change_summary":{"ok":true,"dry_run":true,"updated_count":1,"form_sn_list":["savings-4-a204daaf"],"conflicts":[],"reason":null,"diff_preview":"--- plan-templates.js\n+++ plan-templates.js\n+ /**\n+ * 计划书模版4\n+ * @added 2026-02-15T05:45:13.016Z\n+ * @source docs/to-parse/计划书模版4.docx\n+ */\n+ 'savings-4-a204daaf': {\n+ name: '计划书模版4',\n+ component: 'SavingsTemplate',\n+ category: 'savings',\n+ config: {\n+ currency: 'USD',\n+ payment_periods: [\"5年\",\"12年\",\"15年\"],\n+ age_range: { min: 0, max: 75 },\n+ insurance_period: '终身',\n+ withdrawal_plan: {\n+ enabled: true,\n+ currencies: ['HKD', 'USD', 'CNY'],\n+ default_currency: 'USD',\n+ withdrawal_modes: [\"年龄指定金额\",\"最高固定金额\"],\n+ withdrawal_periods: [\"1年\",\"3年\",\"5年\",\"10年\"]\n+ },\n+ form_schema: savingsFormSchema,\n+ submit_mapping: savingsSubmitMapping\n+ }\n+ }"}} | ||
| 33 | -{"at":"2026-02-15T06:08:21.190Z","mode":"single","options":{"dry_run":true},"summary":{"total_docs":1,"total_products":1,"success":1,"failed":0,"duration_ms":51,"success_list":[{"form_sn":"life-insurance-3-d8fde07d","product_name":"长宁終身壽險計劃3","file":"计划书模版4.docx"}],"failed_list":[],"total":1},"change_summary":{"ok":true,"dry_run":true,"updated_count":1,"form_sn_list":["life-insurance-3-d8fde07d"],"conflicts":[],"reason":null,"diff_preview":"--- plan-templates.js\n+++ plan-templates.js\n+ /**\n+ * 长宁終身壽險計劃3\n+ * @added 2026-02-15T06:08:21.159Z\n+ * @source docs/to-parse/计划书模版4.docx\n+ */\n+ 'life-insurance-3-d8fde07d': {\n+ name: '长宁終身壽險計劃3',\n+ component: 'LifeInsuranceTemplate',\n+ config: {\n+ currency: 'USD',\n+ payment_periods: [\"5年\",\"12年\",\"15年\"],\n+ age_range: { min: 0, max: 75 },\n+ insurance_period: '终身',\n+ form_schema: protectionFormSchema,\n+ submit_mapping: baseSubmitMapping\n+ }\n+ }"}} | ||
| 34 | -{"at":"2026-02-15T06:12:50.918Z","mode":"single","options":{"dry_run":true},"summary":{"total_docs":1,"total_products":1,"success":1,"failed":0,"duration_ms":39,"success_list":[{"form_sn":"life-insurance-3-d8fde07d","product_name":"长宁終身壽險計劃3","file":"计划书模版4.docx"}],"failed_list":[],"total":1},"change_summary":{"ok":true,"dry_run":true,"updated_count":1,"form_sn_list":["life-insurance-3-d8fde07d"],"conflicts":[],"reason":null,"diff_preview":"--- plan-templates.js\n+++ plan-templates.js\n+ /**\n+ * 长宁終身壽險計劃3\n+ * @added 2026-02-15T06:12:50.901Z\n+ * @source docs/to-parse/计划书模版4.docx\n+ */\n+ 'life-insurance-3-d8fde07d': {\n+ name: '长宁終身壽險計劃3',\n+ component: 'LifeInsuranceTemplate',\n+ config: {\n+ currency: 'USD',\n+ payment_periods: [\"5年\",\"12年\",\"15年\",\"终身\"],\n+ age_range: { min: 0, max: 75 },\n+ insurance_period: '终身',\n+ form_schema: protectionFormSchema,\n+ submit_mapping: baseSubmitMapping\n+ }\n+ }"}} | ||
| 35 | -{"at":"2026-02-15T06:13:11.114Z","mode":"single","options":{"dry_run":true},"summary":{"total_docs":1,"total_products":1,"success":1,"failed":0,"duration_ms":39,"success_list":[{"form_sn":"life-insurance-3-d8fde07d","product_name":"长宁終身壽險計劃3","file":"计划书模版4.docx"}],"failed_list":[],"total":1},"change_summary":{"ok":true,"dry_run":true,"updated_count":1,"form_sn_list":["life-insurance-3-d8fde07d"],"conflicts":[],"reason":null,"diff_preview":"--- plan-templates.js\n+++ plan-templates.js\n+ /**\n+ * 长宁終身壽險計劃3\n+ * @added 2026-02-15T06:13:11.097Z\n+ * @source docs/to-parse/计划书模版4.docx\n+ */\n+ 'life-insurance-3-d8fde07d': {\n+ name: '长宁終身壽險計劃3',\n+ component: 'LifeInsuranceTemplate',\n+ config: {\n+ currency: 'USD',\n+ payment_periods: [\"5年\",\"12年\",\"15年\",\"终身\"],\n+ age_range: { min: 0, max: 75 },\n+ insurance_period: '终身',\n+ form_schema: protectionFormSchema,\n+ submit_mapping: baseSubmitMapping\n+ }\n+ }"}} | ||
| 36 | -{"at":"2026-02-15T06:17:26.826Z","mode":"single","options":{"dry_run":true},"summary":{"total_docs":1,"total_products":1,"success":1,"failed":0,"duration_ms":38,"success_list":[{"form_sn":"life-insurance-3-d8fde07d","product_name":"长宁終身壽險計劃3","file":"计划书模版4.docx"}],"failed_list":[],"total":1},"change_summary":{"ok":true,"dry_run":true,"updated_count":1,"form_sn_list":["life-insurance-3-d8fde07d"],"conflicts":[],"reason":null,"diff_preview":"--- plan-templates.js\n+++ plan-templates.js\n+ /**\n+ * 长宁終身壽險計劃3\n+ * @added 2026-02-15T06:17:26.808Z\n+ * @source docs/to-parse/计划书模版4.docx\n+ */\n+ 'life-insurance-3-d8fde07d': {\n+ name: '长宁終身壽險計劃3',\n+ component: 'LifeInsuranceTemplate',\n+ config: {\n+ currency: 'USD',\n+ payment_periods: [\"5年\",\"12年\",\"15年\",\"20年\"],\n+ age_range: { min: 0, max: 75 },\n+ insurance_period: '终身',\n+ form_schema: protectionFormSchema,\n+ submit_mapping: baseSubmitMapping\n+ }\n+ }"}} | ||
| 37 | -{"at":"2026-02-15T06:17:45.723Z","mode":"single","options":{"dry_run":true},"summary":{"total_docs":1,"total_products":1,"success":1,"failed":0,"duration_ms":38,"success_list":[{"form_sn":"life-insurance-3-d8fde07d","product_name":"长宁終身壽險計劃3","file":"计划书模版4.docx"}],"failed_list":[],"total":1},"change_summary":{"ok":true,"dry_run":true,"updated_count":1,"form_sn_list":["life-insurance-3-d8fde07d"],"conflicts":[],"reason":null,"diff_preview":"--- plan-templates.js\n+++ plan-templates.js\n+ /**\n+ * 长宁終身壽險計劃3\n+ * @added 2026-02-15T06:17:45.705Z\n+ * @source docs/to-parse/计划书模版4.docx\n+ */\n+ 'life-insurance-3-d8fde07d': {\n+ name: '长宁終身壽險計劃3',\n+ component: 'LifeInsuranceTemplate',\n+ config: {\n+ currency: 'USD',\n+ payment_periods: [\"5年\",\"12年\",\"15年\",\"20年\"],\n+ age_range: { min: 0, max: 75 },\n+ insurance_period: '终身',\n+ form_schema: protectionFormSchema,\n+ submit_mapping: baseSubmitMapping\n+ }\n+ }"}} | ||
| 38 | -{"at":"2026-02-15T06:30:03.709Z","mode":"single","options":{"dry_run":false},"summary":{"total_docs":1,"total_products":1,"success":1,"failed":0,"duration_ms":39,"success_list":[{"form_sn":"life-insurance-3-d8fde07d","product_name":"长宁終身壽險計劃3","file":"计划书模版4.docx"}],"failed_list":[],"total":1},"change_summary":{"ok":true,"dry_run":false,"updated_count":1,"form_sn_list":["life-insurance-3-d8fde07d"],"conflicts":[],"reason":null}} |
| 1 | -/** | ||
| 2 | - * 计划书模版配置 | ||
| 3 | - * | ||
| 4 | - * @description 定义产品 form_sn 到模版组件和配置的映射关系 | ||
| 5 | - * @module config/plan-templates | ||
| 6 | - * @author Claude Code | ||
| 7 | - * @created 2026-02-06 | ||
| 8 | - * @updated 2026-02-13 - 新增文档解析工具入口 | ||
| 9 | - * | ||
| 10 | - * --- 快速添加新产品(开发工具) --- | ||
| 11 | - * 开发环境可使用以下工具快速添加新产品配置: | ||
| 12 | - * 1. 文档解析工具:/admin/document-parser/index (上传 PDF/Word,AI 自动解析) | ||
| 13 | - * 2. API 配置工具:/admin/document-parser/config (配置 AI 服务) | ||
| 14 | - * | ||
| 15 | - * 使用方式: | ||
| 16 | - * - 上传产品文档 → AI 自动提取配置 → 生成配置代码 → 复制到此文件 | ||
| 17 | - * | ||
| 18 | - * --- 手动添加步骤 --- | ||
| 19 | - * 1. 找到对应的产品分类(人寿/重疾/储蓄) | ||
| 20 | - * 2. 复制现有配置作为模板 | ||
| 21 | - * 3. 修改 name, currency, payment_periods, age_range 等字段 | ||
| 22 | - * 4. 确保 form_sn 唯一(建议使用产品英文标识 + 版本号) | ||
| 23 | - */ | ||
| 24 | - | ||
| 25 | -/** | ||
| 26 | - * 计划书模版配置映射 | ||
| 27 | - * @description form_sn 为产品 API 返回的字段,用于标识该产品使用的计划书模版 | ||
| 28 | - * | ||
| 29 | - * @example | ||
| 30 | - * // 产品 API 返回 | ||
| 31 | - * { | ||
| 32 | - * id: 1, | ||
| 33 | - * product_name: "WIOP3E 盈传创富保障计划 3 - 优选版", | ||
| 34 | - * form_sn: "life-insurance-wiop3e" // 对应下面的配置 key | ||
| 35 | - * } | ||
| 36 | - */ | ||
| 37 | -export const PLAN_TEMPLATES = { | ||
| 38 | - // 人寿保险产品 - WIOP3E | ||
| 39 | - 'life-insurance-wiop3e': { | ||
| 40 | - name: 'WIOP3E 盈传创富保障计划 3 - 优选版', | ||
| 41 | - component: 'LifeInsuranceTemplate', | ||
| 42 | - config: { | ||
| 43 | - currency: 'USD', // 币种:USD/CNY/HKD/EUR | ||
| 44 | - payment_periods: [ | ||
| 45 | - // 缴费年期选项 | ||
| 46 | - '整付(0-75 岁)', | ||
| 47 | - '5 年(0-70 岁)', | ||
| 48 | - '10 年(0-70 岁)' | ||
| 49 | - ], | ||
| 50 | - age_range: { min: 0, max: 75 }, // 年龄范围 | ||
| 51 | - insurance_period: '终身' // 保险期间 | ||
| 52 | - } | ||
| 53 | - }, | ||
| 54 | - | ||
| 55 | - // 人寿保险产品 - WIOP3 | ||
| 56 | - 'life-insurance-wiop3': { | ||
| 57 | - name: 'WIOP3 - 盈传创富保障计划 3', | ||
| 58 | - component: 'LifeInsuranceTemplate', | ||
| 59 | - config: { | ||
| 60 | - currency: 'USD', | ||
| 61 | - payment_periods: [ | ||
| 62 | - '整付(0-75 岁)', | ||
| 63 | - '5 年(0-70 岁)', | ||
| 64 | - '10 年(0-70 岁)' | ||
| 65 | - ], | ||
| 66 | - age_range: { min: 0, max: 75 }, | ||
| 67 | - insurance_period: '终身' | ||
| 68 | - } | ||
| 69 | - }, | ||
| 70 | - | ||
| 71 | - // 重疾保险产品 - MPC | ||
| 72 | - 'critical-illness-mpc': { | ||
| 73 | - name: 'MPC 守护无间重疾', | ||
| 74 | - component: 'CriticalIllnessTemplate', | ||
| 75 | - config: { | ||
| 76 | - currency: 'USD', | ||
| 77 | - payment_periods: [ | ||
| 78 | - '10 年(15 日 - 65 岁)', | ||
| 79 | - '20 年(15 日 - 65 岁)', | ||
| 80 | - '25 年(15 日 - 60 岁)' | ||
| 81 | - ], | ||
| 82 | - age_range: { min: 0, max: 65 }, | ||
| 83 | - insurance_period: '终身' | ||
| 84 | - } | ||
| 85 | - }, | ||
| 86 | - | ||
| 87 | - // 重疾保险产品 - MBC PRO | ||
| 88 | - 'critical-illness-mbc-pro': { | ||
| 89 | - name: 'MBC PRO 活跃人生重疾保 PRO', | ||
| 90 | - component: 'CriticalIllnessTemplate', | ||
| 91 | - config: { | ||
| 92 | - currency: 'USD', | ||
| 93 | - payment_periods: [ | ||
| 94 | - '10 年(15 日 - 65 岁)', | ||
| 95 | - '20 年(15 日 - 65 岁)', | ||
| 96 | - '25 年(15 日 - 60 岁)' | ||
| 97 | - ], | ||
| 98 | - age_range: { min: 0, max: 65 }, | ||
| 99 | - insurance_period: '终身' | ||
| 100 | - } | ||
| 101 | - }, | ||
| 102 | - | ||
| 103 | - // 重疾保险产品 - MBC2 | ||
| 104 | - 'critical-illness-mbc2': { | ||
| 105 | - name: 'MBC2 活跃人生重疾保 2', | ||
| 106 | - component: 'CriticalIllnessTemplate', | ||
| 107 | - config: { | ||
| 108 | - currency: 'USD', | ||
| 109 | - payment_periods: [ | ||
| 110 | - '10 年(15 日 - 65 岁)', | ||
| 111 | - '20 年(15 日 - 65 岁)', | ||
| 112 | - '25 年(15 日 - 60 岁)' | ||
| 113 | - ], | ||
| 114 | - age_range: { min: 0, max: 65 }, | ||
| 115 | - insurance_period: '终身' | ||
| 116 | - } | ||
| 117 | - }, | ||
| 118 | - | ||
| 119 | - // ====== 储蓄型产品(统一逻辑) ====== | ||
| 120 | - | ||
| 121 | - // GS - 宏挚传承保障计划 | ||
| 122 | - 'savings-gs': { | ||
| 123 | - name: '宏挚传承保障计划', | ||
| 124 | - component: 'SavingsTemplate', | ||
| 125 | - category: 'savings', // 储蓄型产品 | ||
| 126 | - config: { | ||
| 127 | - currency: 'USD', // 默认美元 | ||
| 128 | - payment_periods: [ | ||
| 129 | - '整付', | ||
| 130 | - '3 年', | ||
| 131 | - '5 年', | ||
| 132 | - '10 年', | ||
| 133 | - '15 年', | ||
| 134 | - ], | ||
| 135 | - age_range: { min: 0, max: 100 }, | ||
| 136 | - insurance_period: '终身', | ||
| 137 | - // 提取计划配置 | ||
| 138 | - withdrawal_plan: { | ||
| 139 | - enabled: true, | ||
| 140 | - currencies: ['HKD', 'USD', 'CNY'], // 支持的币种 | ||
| 141 | - default_currency: 'USD', // 统一为美元 | ||
| 142 | - withdrawal_modes: [ | ||
| 143 | - '年龄指定金额', // 方式1 | ||
| 144 | - '最高固定金额' // 方式2 | ||
| 145 | - ], | ||
| 146 | - withdrawal_periods: [ | ||
| 147 | - '1年', | ||
| 148 | - '2年', | ||
| 149 | - '3年', | ||
| 150 | - '5年', | ||
| 151 | - '10年', | ||
| 152 | - '15年', | ||
| 153 | - '20年', | ||
| 154 | - '终身' | ||
| 155 | - ] | ||
| 156 | - } | ||
| 157 | - } | ||
| 158 | - }, | ||
| 159 | - | ||
| 160 | - // GC - 宏挚家传保险计划 | ||
| 161 | - 'savings-gc': { | ||
| 162 | - name: '宏挚家传保险计划', | ||
| 163 | - component: 'SavingsTemplate', | ||
| 164 | - category: 'savings', | ||
| 165 | - config: { | ||
| 166 | - currency: 'USD', | ||
| 167 | - payment_periods: [ | ||
| 168 | - '整付', | ||
| 169 | - '3 年', | ||
| 170 | - '5 年', | ||
| 171 | - ], | ||
| 172 | - age_range: { min: 0, max: 100 }, | ||
| 173 | - insurance_period: '终身', | ||
| 174 | - withdrawal_plan: { | ||
| 175 | - enabled: true, | ||
| 176 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 177 | - default_currency: 'USD', // 统一为美元 | ||
| 178 | - withdrawal_modes: ['年龄指定金额', '最高固定金额'], | ||
| 179 | - withdrawal_periods: [ | ||
| 180 | - '1年', | ||
| 181 | - '2年', | ||
| 182 | - '3年', | ||
| 183 | - '5年', | ||
| 184 | - '10年', | ||
| 185 | - '15年', | ||
| 186 | - '20年', | ||
| 187 | - '终身' | ||
| 188 | - ] | ||
| 189 | - } | ||
| 190 | - } | ||
| 191 | - }, | ||
| 192 | - | ||
| 193 | - // FA - 宏浚传承保障计划 | ||
| 194 | - 'savings-fa': { | ||
| 195 | - name: '宏浚传承保障计划', | ||
| 196 | - component: 'SavingsTemplate', | ||
| 197 | - category: 'savings', | ||
| 198 | - config: { | ||
| 199 | - currency: 'USD', | ||
| 200 | - payment_periods: [ | ||
| 201 | - '整付', | ||
| 202 | - '2 年', | ||
| 203 | - '5 年', | ||
| 204 | - ], | ||
| 205 | - age_range: { min: 0, max: 100 }, | ||
| 206 | - insurance_period: '终身', | ||
| 207 | - withdrawal_plan: { | ||
| 208 | - enabled: true, | ||
| 209 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 210 | - default_currency: 'USD', // 统一为美元 | ||
| 211 | - withdrawal_modes: ['年龄指定金额', '最高固定金额'], | ||
| 212 | - withdrawal_periods: [ | ||
| 213 | - '1年', | ||
| 214 | - '2年', | ||
| 215 | - '3年', | ||
| 216 | - '5年', | ||
| 217 | - '10年', | ||
| 218 | - '15年', | ||
| 219 | - '20年', | ||
| 220 | - '终身' | ||
| 221 | - ] | ||
| 222 | - } | ||
| 223 | - } | ||
| 224 | - }, | ||
| 225 | - | ||
| 226 | - // LV2 - 赤霞珠终身寿险计划2(储蓄型终身寿险) | ||
| 227 | - 'savings-lv2': { | ||
| 228 | - name: '赤霞珠终身寿险计划2', | ||
| 229 | - component: 'SavingsTemplate', | ||
| 230 | - category: 'savings', | ||
| 231 | - config: { | ||
| 232 | - currency: 'USD', | ||
| 233 | - payment_periods: [ | ||
| 234 | - '5 年', | ||
| 235 | - '8 年', | ||
| 236 | - '12 年', | ||
| 237 | - '15 年', | ||
| 238 | - ], | ||
| 239 | - age_range: { min: 0, max: 100 }, | ||
| 240 | - insurance_period: '终身', | ||
| 241 | - withdrawal_plan: { | ||
| 242 | - enabled: true, | ||
| 243 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 244 | - default_currency: 'USD', // 统一为美元 | ||
| 245 | - withdrawal_modes: ['年龄指定金额', '最高固定金额'], | ||
| 246 | - withdrawal_periods: [ | ||
| 247 | - '1年', | ||
| 248 | - '2年', | ||
| 249 | - '3年', | ||
| 250 | - '5年', | ||
| 251 | - '10年', | ||
| 252 | - '15年', | ||
| 253 | - '20年', | ||
| 254 | - '终身' | ||
| 255 | - ] | ||
| 256 | - } | ||
| 257 | - } | ||
| 258 | - } | ||
| 259 | -} | ||
| 260 | - | ||
| 261 | -/** | ||
| 262 | - * 全局功能开关 | ||
| 263 | - * @description 用于控制实验性功能或未来扩展功能的开关 | ||
| 264 | - * | ||
| 265 | - * @example 开启多币种功能:设置 MULTI_CURRENCY_ENABLED = true | ||
| 266 | - */ | ||
| 267 | -export const FEATURE_FLAGS = { | ||
| 268 | - /** | ||
| 269 | - * 多币种切换功能 | ||
| 270 | - * @description false: 方案 1 - 固定币种(当前实现) | ||
| 271 | - * true: 方案 2 - 支持多币种切换(未来扩展) | ||
| 272 | - * @type {boolean} | ||
| 273 | - */ | ||
| 274 | - MULTI_CURRENCY_ENABLED: false | ||
| 275 | -} | ||
| 276 | - | ||
| 277 | -/** | ||
| 278 | - * 币种符号映射 | ||
| 279 | - * @description 币种代码到符号的映射关系 | ||
| 280 | - */ | ||
| 281 | -export const CURRENCY_SYMBOLS = { | ||
| 282 | - CNY: '¥', // 人民币 | ||
| 283 | - USD: '$', // 美元 | ||
| 284 | - HKD: 'HK$', // 港币 | ||
| 285 | - EUR: '€' // 欧元 | ||
| 286 | -} | ||
| 287 | - | ||
| 288 | -/** | ||
| 289 | - * 币种完整信息映射 | ||
| 290 | - * @description 币种代码到完整信息的映射(用于多币种模式) | ||
| 291 | - */ | ||
| 292 | -export const CURRENCY_MAP = { | ||
| 293 | - CNY: { label: '人民币', symbol: '¥', value: 'CNY' }, | ||
| 294 | - USD: { label: '美元', symbol: '$', value: 'USD' }, | ||
| 295 | - HKD: { label: '港币', symbol: 'HK$', value: 'HKD' }, | ||
| 296 | - EUR: { label: '欧元', symbol: '€', value: 'EUR' } | ||
| 297 | -} | ||
| 298 | - | ||
| 299 | -/** | ||
| 300 | - * 根据 form_sn 获取模版配置 | ||
| 301 | - * @param {string} formSn - 产品 API 返回的 form_sn 字段 | ||
| 302 | - * @returns {Object|null} 模版配置对象,未找到返回 null | ||
| 303 | - * | ||
| 304 | - * @example | ||
| 305 | - * const config = getTemplateConfig('life-insurance-wiop3e') | ||
| 306 | - * // 返回: { name: 'WIOP3E...', component: 'LifeInsuranceTemplate', config: {...} } | ||
| 307 | - */ | ||
| 308 | -export function getTemplateConfig(formSn) { | ||
| 309 | - if (!formSn) { | ||
| 310 | - console.warn('[plan-templates] form_sn 为空') | ||
| 311 | - return null | ||
| 312 | - } | ||
| 313 | - | ||
| 314 | - const config = PLAN_TEMPLATES[formSn] | ||
| 315 | - if (!config) { | ||
| 316 | - console.error(`[plan-templates] 未找到模版配置: ${formSn}`) | ||
| 317 | - return null | ||
| 318 | - } | ||
| 319 | - | ||
| 320 | - return config | ||
| 321 | -} | ||
| 322 | - | ||
| 323 | -/** | ||
| 324 | - * 获取币种符号 | ||
| 325 | - * @param {string} currencyCode - 币种代码(CNY/USD/HKD/EUR) | ||
| 326 | - * @returns {string} 币种符号 | ||
| 327 | - * | ||
| 328 | - * @example | ||
| 329 | - * const symbol = getCurrencySymbol('USD') // 返回: '$' | ||
| 330 | - */ | ||
| 331 | -export function getCurrencySymbol(currencyCode) { | ||
| 332 | - return CURRENCY_SYMBOLS[currencyCode] || '¥' | ||
| 333 | -} |
| 1 | -/** | ||
| 2 | - * 计划书模版配置 | ||
| 3 | - * | ||
| 4 | - * @description 定义产品 form_sn 到模版组件和配置的映射关系 | ||
| 5 | - * @module config/plan-templates | ||
| 6 | - * @author Claude Code | ||
| 7 | - * @created 2026-02-06 | ||
| 8 | - * @updated 2026-02-13 - 新增文档解析工具入口 | ||
| 9 | - * | ||
| 10 | - * --- 快速添加新产品(开发工具) --- | ||
| 11 | - * 开发环境可使用以下工具快速添加新产品配置: | ||
| 12 | - * 1. 文档解析工具:/admin/document-parser/index (上传 PDF/Word,AI 自动解析) | ||
| 13 | - * 2. API 配置工具:/admin/document-parser/config (配置 AI 服务) | ||
| 14 | - * | ||
| 15 | - * 使用方式: | ||
| 16 | - * - 上传产品文档 → AI 自动提取配置 → 生成配置代码 → 复制到此文件 | ||
| 17 | - * | ||
| 18 | - * --- 手动添加步骤 --- | ||
| 19 | - * 1. 找到对应的产品分类(人寿/重疾/储蓄) | ||
| 20 | - * 2. 复制现有配置作为模板 | ||
| 21 | - * 3. 修改 name, currency, payment_periods, age_range 等字段 | ||
| 22 | - * 4. 确保 form_sn 唯一(建议使用产品英文标识 + 版本号) | ||
| 23 | - */ | ||
| 24 | - | ||
| 25 | -/** | ||
| 26 | - * 计划书模版配置映射 | ||
| 27 | - * @description form_sn 为产品 API 返回的字段,用于标识该产品使用的计划书模版 | ||
| 28 | - * | ||
| 29 | - * @example | ||
| 30 | - * // 产品 API 返回 | ||
| 31 | - * { | ||
| 32 | - * id: 1, | ||
| 33 | - * product_name: "WIOP3E 盈传创富保障计划 3 - 优选版", | ||
| 34 | - * form_sn: "life-insurance-wiop3e" // 对应下面的配置 key | ||
| 35 | - * } | ||
| 36 | - */ | ||
| 37 | -export const PLAN_TEMPLATES = { | ||
| 38 | - // 人寿保险产品 - WIOP3E | ||
| 39 | - 'life-insurance-wiop3e': { | ||
| 40 | - name: 'WIOP3E 盈传创富保障计划 3 - 优选版', | ||
| 41 | - component: 'LifeInsuranceTemplate', | ||
| 42 | - config: { | ||
| 43 | - currency: 'USD', // 币种:USD/CNY/HKD/EUR | ||
| 44 | - payment_periods: [ | ||
| 45 | - // 缴费年期选项 | ||
| 46 | - '整付(0-75 岁)', | ||
| 47 | - '5 年(0-70 岁)', | ||
| 48 | - '10 年(0-70 岁)' | ||
| 49 | - ], | ||
| 50 | - age_range: { min: 0, max: 75 }, // 年龄范围 | ||
| 51 | - insurance_period: '终身' // 保险期间 | ||
| 52 | - } | ||
| 53 | - }, | ||
| 54 | - | ||
| 55 | - // 人寿保险产品 - WIOP3 | ||
| 56 | - 'life-insurance-wiop3': { | ||
| 57 | - name: 'WIOP3 - 盈传创富保障计划 3', | ||
| 58 | - component: 'LifeInsuranceTemplate', | ||
| 59 | - config: { | ||
| 60 | - currency: 'USD', | ||
| 61 | - payment_periods: [ | ||
| 62 | - '整付(0-75 岁)', | ||
| 63 | - '5 年(0-70 岁)', | ||
| 64 | - '10 年(0-70 岁)' | ||
| 65 | - ], | ||
| 66 | - age_range: { min: 0, max: 75 }, | ||
| 67 | - insurance_period: '终身' | ||
| 68 | - } | ||
| 69 | - }, | ||
| 70 | - | ||
| 71 | - // 重疾保险产品 - MPC | ||
| 72 | - 'critical-illness-mpc': { | ||
| 73 | - name: 'MPC 守护无间重疾', | ||
| 74 | - component: 'CriticalIllnessTemplate', | ||
| 75 | - config: { | ||
| 76 | - currency: 'USD', | ||
| 77 | - payment_periods: [ | ||
| 78 | - '10 年(15 日 - 65 岁)', | ||
| 79 | - '20 年(15 日 - 65 岁)', | ||
| 80 | - '25 年(15 日 - 60 岁)' | ||
| 81 | - ], | ||
| 82 | - age_range: { min: 0, max: 65 }, | ||
| 83 | - insurance_period: '终身' | ||
| 84 | - } | ||
| 85 | - }, | ||
| 86 | - | ||
| 87 | - // 重疾保险产品 - MBC PRO | ||
| 88 | - 'critical-illness-mbc-pro': { | ||
| 89 | - name: 'MBC PRO 活跃人生重疾保 PRO', | ||
| 90 | - component: 'CriticalIllnessTemplate', | ||
| 91 | - config: { | ||
| 92 | - currency: 'USD', | ||
| 93 | - payment_periods: [ | ||
| 94 | - '10 年(15 日 - 65 岁)', | ||
| 95 | - '20 年(15 日 - 65 岁)', | ||
| 96 | - '25 年(15 日 - 60 岁)' | ||
| 97 | - ], | ||
| 98 | - age_range: { min: 0, max: 65 }, | ||
| 99 | - insurance_period: '终身' | ||
| 100 | - } | ||
| 101 | - }, | ||
| 102 | - | ||
| 103 | - // 重疾保险产品 - MBC2 | ||
| 104 | - 'critical-illness-mbc2': { | ||
| 105 | - name: 'MBC2 活跃人生重疾保 2', | ||
| 106 | - component: 'CriticalIllnessTemplate', | ||
| 107 | - config: { | ||
| 108 | - currency: 'USD', | ||
| 109 | - payment_periods: [ | ||
| 110 | - '10 年(15 日 - 65 岁)', | ||
| 111 | - '20 年(15 日 - 65 岁)', | ||
| 112 | - '25 年(15 日 - 60 岁)' | ||
| 113 | - ], | ||
| 114 | - age_range: { min: 0, max: 65 }, | ||
| 115 | - insurance_period: '终身' | ||
| 116 | - } | ||
| 117 | - }, | ||
| 118 | - | ||
| 119 | - // ====== 储蓄型产品(统一逻辑) ====== | ||
| 120 | - | ||
| 121 | - // GS - 宏挚传承保障计划 | ||
| 122 | - 'savings-gs': { | ||
| 123 | - name: '宏挚传承保障计划', | ||
| 124 | - component: 'SavingsTemplate', | ||
| 125 | - category: 'savings', // 储蓄型产品 | ||
| 126 | - config: { | ||
| 127 | - currency: 'USD', // 默认美元 | ||
| 128 | - payment_periods: [ | ||
| 129 | - '整付', | ||
| 130 | - '3 年', | ||
| 131 | - '5 年', | ||
| 132 | - '10 年', | ||
| 133 | - '15 年', | ||
| 134 | - ], | ||
| 135 | - age_range: { min: 0, max: 100 }, | ||
| 136 | - insurance_period: '终身', | ||
| 137 | - // 提取计划配置 | ||
| 138 | - withdrawal_plan: { | ||
| 139 | - enabled: true, | ||
| 140 | - currencies: ['HKD', 'USD', 'CNY'], // 支持的币种 | ||
| 141 | - default_currency: 'USD', // 统一为美元 | ||
| 142 | - withdrawal_modes: [ | ||
| 143 | - '年龄指定金额', // 方式1 | ||
| 144 | - '最高固定金额' // 方式2 | ||
| 145 | - ], | ||
| 146 | - withdrawal_periods: [ | ||
| 147 | - '1年', | ||
| 148 | - '2年', | ||
| 149 | - '3年', | ||
| 150 | - '5年', | ||
| 151 | - '10年', | ||
| 152 | - '15年', | ||
| 153 | - '20年', | ||
| 154 | - '终身' | ||
| 155 | - ] | ||
| 156 | - } | ||
| 157 | - } | ||
| 158 | - }, | ||
| 159 | - | ||
| 160 | - // GC - 宏挚家传保险计划 | ||
| 161 | - 'savings-gc': { | ||
| 162 | - name: '宏挚家传保险计划', | ||
| 163 | - component: 'SavingsTemplate', | ||
| 164 | - category: 'savings', | ||
| 165 | - config: { | ||
| 166 | - currency: 'USD', | ||
| 167 | - payment_periods: [ | ||
| 168 | - '整付', | ||
| 169 | - '3 年', | ||
| 170 | - '5 年', | ||
| 171 | - ], | ||
| 172 | - age_range: { min: 0, max: 100 }, | ||
| 173 | - insurance_period: '终身', | ||
| 174 | - withdrawal_plan: { | ||
| 175 | - enabled: true, | ||
| 176 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 177 | - default_currency: 'USD', // 统一为美元 | ||
| 178 | - withdrawal_modes: ['年龄指定金额', '最高固定金额'], | ||
| 179 | - withdrawal_periods: [ | ||
| 180 | - '1年', | ||
| 181 | - '2年', | ||
| 182 | - '3年', | ||
| 183 | - '5年', | ||
| 184 | - '10年', | ||
| 185 | - '15年', | ||
| 186 | - '20年', | ||
| 187 | - '终身' | ||
| 188 | - ] | ||
| 189 | - } | ||
| 190 | - } | ||
| 191 | - }, | ||
| 192 | - | ||
| 193 | - // FA - 宏浚传承保障计划 | ||
| 194 | - 'savings-fa': { | ||
| 195 | - name: '宏浚传承保障计划', | ||
| 196 | - component: 'SavingsTemplate', | ||
| 197 | - category: 'savings', | ||
| 198 | - config: { | ||
| 199 | - currency: 'USD', | ||
| 200 | - payment_periods: [ | ||
| 201 | - '整付', | ||
| 202 | - '2 年', | ||
| 203 | - '5 年', | ||
| 204 | - ], | ||
| 205 | - age_range: { min: 0, max: 100 }, | ||
| 206 | - insurance_period: '终身', | ||
| 207 | - withdrawal_plan: { | ||
| 208 | - enabled: true, | ||
| 209 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 210 | - default_currency: 'USD', // 统一为美元 | ||
| 211 | - withdrawal_modes: ['年龄指定金额', '最高固定金额'], | ||
| 212 | - withdrawal_periods: [ | ||
| 213 | - '1年', | ||
| 214 | - '2年', | ||
| 215 | - '3年', | ||
| 216 | - '5年', | ||
| 217 | - '10年', | ||
| 218 | - '15年', | ||
| 219 | - '20年', | ||
| 220 | - '终身' | ||
| 221 | - ] | ||
| 222 | - } | ||
| 223 | - } | ||
| 224 | - }, | ||
| 225 | - | ||
| 226 | - // LV2 - 赤霞珠终身寿险计划2(储蓄型终身寿险) | ||
| 227 | - 'savings-lv2': { | ||
| 228 | - name: '赤霞珠终身寿险计划2', | ||
| 229 | - component: 'SavingsTemplate', | ||
| 230 | - category: 'savings', | ||
| 231 | - config: { | ||
| 232 | - currency: 'USD', | ||
| 233 | - payment_periods: [ | ||
| 234 | - '5 年', | ||
| 235 | - '8 年', | ||
| 236 | - '12 年', | ||
| 237 | - '15 年', | ||
| 238 | - ], | ||
| 239 | - age_range: { min: 0, max: 100 }, | ||
| 240 | - insurance_period: '终身', | ||
| 241 | - withdrawal_plan: { | ||
| 242 | - enabled: true, | ||
| 243 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 244 | - default_currency: 'USD', // 统一为美元 | ||
| 245 | - withdrawal_modes: ['年龄指定金额', '最高固定金额'], | ||
| 246 | - withdrawal_periods: [ | ||
| 247 | - '1年', | ||
| 248 | - '2年', | ||
| 249 | - '3年', | ||
| 250 | - '5年', | ||
| 251 | - '10年', | ||
| 252 | - '15年', | ||
| 253 | - '20年', | ||
| 254 | - '终身' | ||
| 255 | - ] | ||
| 256 | - } | ||
| 257 | - } | ||
| 258 | - } | ||
| 259 | -} | ||
| 260 | - | ||
| 261 | -/** | ||
| 262 | - * 全局功能开关 | ||
| 263 | - * @description 用于控制实验性功能或未来扩展功能的开关 | ||
| 264 | - * | ||
| 265 | - * @example 开启多币种功能:设置 MULTI_CURRENCY_ENABLED = true | ||
| 266 | - */ | ||
| 267 | -export const FEATURE_FLAGS = { | ||
| 268 | - /** | ||
| 269 | - * 多币种切换功能 | ||
| 270 | - * @description false: 方案 1 - 固定币种(当前实现) | ||
| 271 | - * true: 方案 2 - 支持多币种切换(未来扩展) | ||
| 272 | - * @type {boolean} | ||
| 273 | - */ | ||
| 274 | - MULTI_CURRENCY_ENABLED: false | ||
| 275 | -} | ||
| 276 | - | ||
| 277 | -/** | ||
| 278 | - * 币种符号映射 | ||
| 279 | - * @description 币种代码到符号的映射关系 | ||
| 280 | - */ | ||
| 281 | -export const CURRENCY_SYMBOLS = { | ||
| 282 | - CNY: '¥', // 人民币 | ||
| 283 | - USD: '$', // 美元 | ||
| 284 | - HKD: 'HK$', // 港币 | ||
| 285 | - EUR: '€' // 欧元 | ||
| 286 | -} | ||
| 287 | - | ||
| 288 | -/** | ||
| 289 | - * 币种完整信息映射 | ||
| 290 | - * @description 币种代码到完整信息的映射(用于多币种模式) | ||
| 291 | - */ | ||
| 292 | -export const CURRENCY_MAP = { | ||
| 293 | - CNY: { label: '人民币', symbol: '¥', value: 'CNY' }, | ||
| 294 | - USD: { label: '美元', symbol: '$', value: 'USD' }, | ||
| 295 | - HKD: { label: '港币', symbol: 'HK$', value: 'HKD' }, | ||
| 296 | - EUR: { label: '欧元', symbol: '€', value: 'EUR' } | ||
| 297 | -} | ||
| 298 | - | ||
| 299 | -/** | ||
| 300 | - * 根据 form_sn 获取模版配置 | ||
| 301 | - * @param {string} formSn - 产品 API 返回的 form_sn 字段 | ||
| 302 | - * @returns {Object|null} 模版配置对象,未找到返回 null | ||
| 303 | - * | ||
| 304 | - * @example | ||
| 305 | - * const config = getTemplateConfig('life-insurance-wiop3e') | ||
| 306 | - * // 返回: { name: 'WIOP3E...', component: 'LifeInsuranceTemplate', config: {...} } | ||
| 307 | - */ | ||
| 308 | -export function getTemplateConfig(formSn) { | ||
| 309 | - if (!formSn) { | ||
| 310 | - console.warn('[plan-templates] form_sn 为空') | ||
| 311 | - return null | ||
| 312 | - } | ||
| 313 | - | ||
| 314 | - const config = PLAN_TEMPLATES[formSn] | ||
| 315 | - if (!config) { | ||
| 316 | - console.error(`[plan-templates] 未找到模版配置: ${formSn}`) | ||
| 317 | - return null | ||
| 318 | - } | ||
| 319 | - | ||
| 320 | - return config | ||
| 321 | -} | ||
| 322 | - | ||
| 323 | -/** | ||
| 324 | - * 获取币种符号 | ||
| 325 | - * @param {string} currencyCode - 币种代码(CNY/USD/HKD/EUR) | ||
| 326 | - * @returns {string} 币种符号 | ||
| 327 | - * | ||
| 328 | - * @example | ||
| 329 | - * const symbol = getCurrencySymbol('USD') // 返回: '$' | ||
| 330 | - */ | ||
| 331 | -export function getCurrencySymbol(currencyCode) { | ||
| 332 | - return CURRENCY_SYMBOLS[currencyCode] || '¥' | ||
| 333 | -} |
| 1 | -/** | ||
| 2 | - * 计划书模版配置 | ||
| 3 | - * | ||
| 4 | - * @description 定义产品 form_sn 到模版组件和配置的映射关系 | ||
| 5 | - * @module config/plan-templates | ||
| 6 | - * @author Claude Code | ||
| 7 | - * @created 2026-02-06 | ||
| 8 | - * @updated 2026-02-13 - 新增文档解析工具入口 | ||
| 9 | - * | ||
| 10 | - * --- 快速添加新产品(开发工具) --- | ||
| 11 | - * 开发环境可使用以下工具快速添加新产品配置: | ||
| 12 | - * 1. 文档解析工具:/admin/document-parser/index (上传 PDF/Word,AI 自动解析) | ||
| 13 | - * 2. API 配置工具:/admin/document-parser/config (配置 AI 服务) | ||
| 14 | - * | ||
| 15 | - * 使用方式: | ||
| 16 | - * - 上传产品文档 → AI 自动提取配置 → 生成配置代码 → 复制到此文件 | ||
| 17 | - * | ||
| 18 | - * --- 手动添加步骤 --- | ||
| 19 | - * 1. 找到对应的产品分类(人寿/重疾/储蓄) | ||
| 20 | - * 2. 复制现有配置作为模板 | ||
| 21 | - * 3. 修改 name, currency, payment_periods, age_range 等字段 | ||
| 22 | - * 4. 确保 form_sn 唯一(建议使用产品英文标识 + 版本号) | ||
| 23 | - */ | ||
| 24 | - | ||
| 25 | -/** | ||
| 26 | - * 计划书模版配置映射 | ||
| 27 | - * @description form_sn 为产品 API 返回的字段,用于标识该产品使用的计划书模版 | ||
| 28 | - * | ||
| 29 | - * @example | ||
| 30 | - * // 产品 API 返回 | ||
| 31 | - * { | ||
| 32 | - * id: 1, | ||
| 33 | - * product_name: "WIOP3E 盈传创富保障计划 3 - 优选版", | ||
| 34 | - * form_sn: "life-insurance-wiop3e" // 对应下面的配置 key | ||
| 35 | - * } | ||
| 36 | - */ | ||
| 37 | -// 基础提交字段映射(适用于人寿/重疾等通用表单) | ||
| 38 | -const baseSubmitMapping = { | ||
| 39 | - customer_name: { api_field: 'customer_name' }, | ||
| 40 | - gender: { api_field: 'customer_gender' }, | ||
| 41 | - birthday: { api_field: 'customer_birthday' }, | ||
| 42 | - smoker: { api_field: 'smoking_status' }, | ||
| 43 | - coverage: { api_field: 'annual_premium', transform: 'fen_to_yuan' }, | ||
| 44 | - payment_period: { api_field: 'payment_years' }, | ||
| 45 | - total_amount: { api_field: 'total_premium', transform: 'fen_to_yuan' } | ||
| 46 | -} | ||
| 47 | - | ||
| 48 | -// 人寿/重疾基础表单 Schema(通用保障类) | ||
| 49 | -const protectionFormSchema = { | ||
| 50 | - base_fields: [ | ||
| 51 | - { id: 'customer_name', key: 'customer_name', type: 'name', label: '申请人', placeholder: '请输入申请人', required: true }, | ||
| 52 | - { id: 'gender', key: 'gender', type: 'radio', label: '性别', options: ['男', '女'], required: true }, | ||
| 53 | - { id: 'birthday', key: 'birthday', type: 'date', label: '出生年月日', placeholder: '请选择年月日', required: true }, | ||
| 54 | - { id: 'smoker', key: 'smoker', type: 'radio', label: '是否吸烟', options: ['是', '否'], required: true }, | ||
| 55 | - { id: 'coverage', key: 'coverage', type: 'amount', label: '保额', placeholder: '请输入保额', input_label: '请输入保额金额', required: true, currency_from: 'currency' }, | ||
| 56 | - { id: 'payment_period', key: 'payment_period', type: 'payment_period', label: '缴费年期', required: true, options_from: 'payment_periods' } | ||
| 57 | - ] | ||
| 58 | -} | ||
| 59 | - | ||
| 60 | -// 储蓄类提交字段映射(在基础映射上追加提取计划字段) | ||
| 61 | -const savingsSubmitMapping = { | ||
| 62 | - ...baseSubmitMapping, | ||
| 63 | - withdrawal_enabled: { api_field: 'allow_reduce_amount' }, | ||
| 64 | - withdrawal_mode: { api_field: 'withdrawal_option' }, | ||
| 65 | - withdrawal_method: { api_field: 'withdrawal_method' }, | ||
| 66 | - annual_withdrawal_amount: { api_field: 'annual_withdrawal_amount', transform: 'fen_to_yuan' }, | ||
| 67 | - annual_increase_percentage: { api_field: 'annual_increase_percentage' }, | ||
| 68 | - withdrawal_start_age_specified: { api_field: 'withdrawal_start_age' }, | ||
| 69 | - withdrawal_period_specified: { api_field: 'withdrawal_period' }, | ||
| 70 | - withdrawal_start_age_fixed: { api_field: 'withdrawal_start_age' }, | ||
| 71 | - withdrawal_period_fixed: { api_field: 'withdrawal_period' } | ||
| 72 | -} | ||
| 73 | - | ||
| 74 | -// 储蓄类表单 Schema(渲染 + 校验 + 联动的唯一入口) | ||
| 75 | -const savingsFormSchema = { | ||
| 76 | - // 基础字段:非提取计划部分 | ||
| 77 | - base_fields: [ | ||
| 78 | - { id: 'customer_name', key: 'customer_name', type: 'name', label: '申请人', placeholder: '请输入申请人', required: true }, | ||
| 79 | - { id: 'gender', key: 'gender', type: 'radio', label: '性别', options: ['男', '女'], required: true }, | ||
| 80 | - { id: 'birthday', key: 'birthday', type: 'date', label: '出生年月日', placeholder: '请选择年月日', required: true }, | ||
| 81 | - { id: 'smoker', key: 'smoker', type: 'radio', label: '是否吸烟', options: ['是', '否'], required: true }, | ||
| 82 | - { id: 'coverage', key: 'coverage', type: 'amount', label: '年缴保费', placeholder: '请输入年缴保费', input_label: '请输入年缴保费金额', required: true, currency_from: 'currency' }, | ||
| 83 | - { id: 'payment_period', key: 'payment_period', type: 'payment_period', label: '缴费年期', required: true, options_from: 'payment_periods' } | ||
| 84 | - ], | ||
| 85 | - // 提取计划字段:由 withdrawal_plan 开关控制 | ||
| 86 | - withdrawal_fields: [ | ||
| 87 | - { id: 'withdrawal_enabled', key: 'withdrawal_enabled', type: 'radio', label: '是否希望生成一份允许减少名义金额的提取说明?', options: ['是', '否'], required: true, default: '否' }, | ||
| 88 | - { id: 'withdrawal_mode', key: 'withdrawal_mode', type: 'radio', label: '提取选项', options: ['指定提取金额', '最高固定提取金额'], required: true, default: '指定提取金额', section_title: '款项提取(允许减少名义金额)' }, | ||
| 89 | - { id: 'withdrawal_method', key: 'withdrawal_method', type: 'radio', label: '提取方式', options: ['按年岁'], required: true, default: '按年岁', show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 90 | - { id: 'annual_withdrawal_amount', key: 'annual_withdrawal_amount', type: 'amount', label: '每年提取金额', placeholder: '请输入每年提取金额', input_label: '请输入每年提取金额', required: true, currency_from: 'withdrawal_plan.default_currency', show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 91 | - { id: 'withdrawal_start_age_specified', key: 'withdrawal_start_age_specified', type: 'age', label: '由几岁开始', placeholder: '请输入开始提取年龄', required: true, show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 92 | - { id: 'withdrawal_period_specified', key: 'withdrawal_period_specified', type: 'select', label: '提取期(年)', placeholder: '请选择提取期', required: true, options_from: 'withdrawal_plan.withdrawal_periods', show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 93 | - { id: 'annual_increase_percentage', key: 'annual_increase_percentage', type: 'percentage', label: '每年递增提取之百分比(%)', placeholder: '请输入递增百分比', required: true, show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 94 | - { id: 'withdrawal_start_age_fixed', key: 'withdrawal_start_age_fixed', type: 'age', label: '按年岁:由几岁开始', placeholder: '请输入开始提取年龄', required: true, show_when: [{ field: 'withdrawal_mode', equals: '最高固定提取金额' }] }, | ||
| 95 | - { id: 'withdrawal_period_fixed', key: 'withdrawal_period_fixed', type: 'select', label: '按年岁:提取期(年)', placeholder: '请选择提取期', required: true, options_from: 'withdrawal_plan.withdrawal_periods', show_when: [{ field: 'withdrawal_mode', equals: '最高固定提取金额' }] } | ||
| 96 | - ], | ||
| 97 | - // 提取模式切换时的清空逻辑,避免脏字段影响提交 | ||
| 98 | - reset_map: { | ||
| 99 | - withdrawal_mode: { | ||
| 100 | - '最高固定提取金额': ['annual_withdrawal_amount', 'annual_increase_percentage', 'withdrawal_start_age_specified', 'withdrawal_period_specified'], | ||
| 101 | - '指定提取金额': ['withdrawal_start_age_fixed', 'withdrawal_period_fixed'] | ||
| 102 | - } | ||
| 103 | - } | ||
| 104 | -} | ||
| 105 | - | ||
| 106 | -export const PLAN_TEMPLATES = { | ||
| 107 | - // 人寿保险产品 - WIOP3E | ||
| 108 | - 'life-insurance-wiop3e': { | ||
| 109 | - name: 'WIOP3E 盈传创富保障计划 3 - 优选版', | ||
| 110 | - component: 'LifeInsuranceTemplate', | ||
| 111 | - config: { | ||
| 112 | - currency: 'USD', // 币种:USD/CNY/HKD/EUR | ||
| 113 | - payment_periods: [ | ||
| 114 | - // 缴费年期选项 | ||
| 115 | - '整付(0-75 岁)', | ||
| 116 | - '5 年(0-70 岁)', | ||
| 117 | - '10 年(0-70 岁)' | ||
| 118 | - ], | ||
| 119 | - age_range: { min: 0, max: 75 }, // 年龄范围 | ||
| 120 | - insurance_period: '终身', // 保险期间 | ||
| 121 | - form_schema: protectionFormSchema, | ||
| 122 | - submit_mapping: baseSubmitMapping | ||
| 123 | - } | ||
| 124 | - }, | ||
| 125 | - | ||
| 126 | - // 人寿保险产品 - WIOP3 | ||
| 127 | - 'life-insurance-wiop3': { | ||
| 128 | - name: 'WIOP3 - 盈传创富保障计划 3', | ||
| 129 | - component: 'LifeInsuranceTemplate', | ||
| 130 | - config: { | ||
| 131 | - currency: 'USD', | ||
| 132 | - payment_periods: [ | ||
| 133 | - '整付(0-75 岁)', | ||
| 134 | - '5 年(0-70 岁)', | ||
| 135 | - '10 年(0-70 岁)' | ||
| 136 | - ], | ||
| 137 | - age_range: { min: 0, max: 75 }, | ||
| 138 | - insurance_period: '终身', | ||
| 139 | - form_schema: protectionFormSchema, | ||
| 140 | - submit_mapping: baseSubmitMapping | ||
| 141 | - } | ||
| 142 | - }, | ||
| 143 | - | ||
| 144 | - // 重疾保险产品 - MPC | ||
| 145 | - 'critical-illness-mpc': { | ||
| 146 | - name: 'MPC 守护无间重疾', | ||
| 147 | - component: 'CriticalIllnessTemplate', | ||
| 148 | - config: { | ||
| 149 | - currency: 'USD', | ||
| 150 | - payment_periods: [ | ||
| 151 | - '10 年(15 日 - 65 岁)', | ||
| 152 | - '20 年(15 日 - 65 岁)', | ||
| 153 | - '25 年(15 日 - 60 岁)' | ||
| 154 | - ], | ||
| 155 | - age_range: { min: 0, max: 65 }, | ||
| 156 | - insurance_period: '终身', | ||
| 157 | - form_schema: protectionFormSchema, | ||
| 158 | - submit_mapping: baseSubmitMapping | ||
| 159 | - } | ||
| 160 | - }, | ||
| 161 | - | ||
| 162 | - // 重疾保险产品 - MBC PRO | ||
| 163 | - 'critical-illness-mbc-pro': { | ||
| 164 | - name: 'MBC PRO 活跃人生重疾保 PRO', | ||
| 165 | - component: 'CriticalIllnessTemplate', | ||
| 166 | - config: { | ||
| 167 | - currency: 'USD', | ||
| 168 | - payment_periods: [ | ||
| 169 | - '10 年(15 日 - 65 岁)', | ||
| 170 | - '20 年(15 日 - 65 岁)', | ||
| 171 | - '25 年(15 日 - 60 岁)' | ||
| 172 | - ], | ||
| 173 | - age_range: { min: 0, max: 65 }, | ||
| 174 | - insurance_period: '终身', | ||
| 175 | - form_schema: protectionFormSchema, | ||
| 176 | - submit_mapping: baseSubmitMapping | ||
| 177 | - } | ||
| 178 | - }, | ||
| 179 | - | ||
| 180 | - // 重疾保险产品 - MBC2 | ||
| 181 | - 'critical-illness-mbc2': { | ||
| 182 | - name: 'MBC2 活跃人生重疾保 2', | ||
| 183 | - component: 'CriticalIllnessTemplate', | ||
| 184 | - config: { | ||
| 185 | - currency: 'USD', | ||
| 186 | - payment_periods: [ | ||
| 187 | - '10 年(15 日 - 65 岁)', | ||
| 188 | - '20 年(15 日 - 65 岁)', | ||
| 189 | - '25 年(15 日 - 60 岁)' | ||
| 190 | - ], | ||
| 191 | - age_range: { min: 0, max: 65 }, | ||
| 192 | - insurance_period: '终身', | ||
| 193 | - form_schema: protectionFormSchema, | ||
| 194 | - submit_mapping: baseSubmitMapping | ||
| 195 | - } | ||
| 196 | - }, | ||
| 197 | - | ||
| 198 | - // ====== 储蓄型产品(统一逻辑) ====== | ||
| 199 | - | ||
| 200 | - // GS - 宏挚传承保障计划 | ||
| 201 | - 'savings-gs': { | ||
| 202 | - name: '宏挚传承保障计划', | ||
| 203 | - component: 'SavingsTemplate', | ||
| 204 | - category: 'savings', // 储蓄型产品 | ||
| 205 | - config: { | ||
| 206 | - currency: 'USD', // 默认美元 | ||
| 207 | - payment_periods: [ | ||
| 208 | - '整付', | ||
| 209 | - '3 年', | ||
| 210 | - '5 年', | ||
| 211 | - '10 年', | ||
| 212 | - '15 年', | ||
| 213 | - ], | ||
| 214 | - age_range: { min: 0, max: 100 }, | ||
| 215 | - insurance_period: '终身', | ||
| 216 | - // 提取计划配置 | ||
| 217 | - withdrawal_plan: { | ||
| 218 | - enabled: true, | ||
| 219 | - currencies: ['HKD', 'USD', 'CNY'], // 支持的币种 | ||
| 220 | - default_currency: 'USD', // 统一为美元 | ||
| 221 | - withdrawal_modes: ['指定提取金额', '最高固定提取金额'], | ||
| 222 | - withdrawal_periods: [ | ||
| 223 | - '1年', | ||
| 224 | - '2年', | ||
| 225 | - '3年', | ||
| 226 | - '5年', | ||
| 227 | - '10年', | ||
| 228 | - '15年', | ||
| 229 | - '20年', | ||
| 230 | - '终身' | ||
| 231 | - ] | ||
| 232 | - }, | ||
| 233 | - form_schema: savingsFormSchema, | ||
| 234 | - submit_mapping: savingsSubmitMapping | ||
| 235 | - } | ||
| 236 | - }, | ||
| 237 | - | ||
| 238 | - // GC - 宏挚家传保险计划 | ||
| 239 | - 'savings-gc': { | ||
| 240 | - name: '宏挚家传保险计划', | ||
| 241 | - component: 'SavingsTemplate', | ||
| 242 | - category: 'savings', | ||
| 243 | - config: { | ||
| 244 | - currency: 'USD', | ||
| 245 | - payment_periods: [ | ||
| 246 | - '整付', | ||
| 247 | - '3 年', | ||
| 248 | - '5 年', | ||
| 249 | - ], | ||
| 250 | - age_range: { min: 0, max: 100 }, | ||
| 251 | - insurance_period: '终身', | ||
| 252 | - withdrawal_plan: { | ||
| 253 | - enabled: true, | ||
| 254 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 255 | - default_currency: 'USD', // 统一为美元 | ||
| 256 | - withdrawal_modes: ['指定提取金额', '最高固定提取金额'], | ||
| 257 | - withdrawal_periods: [ | ||
| 258 | - '1年', | ||
| 259 | - '2年', | ||
| 260 | - '3年', | ||
| 261 | - '5年', | ||
| 262 | - '10年', | ||
| 263 | - '15年', | ||
| 264 | - '20年', | ||
| 265 | - '终身' | ||
| 266 | - ] | ||
| 267 | - }, | ||
| 268 | - form_schema: savingsFormSchema, | ||
| 269 | - submit_mapping: savingsSubmitMapping | ||
| 270 | - } | ||
| 271 | - }, | ||
| 272 | - | ||
| 273 | - // FA - 宏浚传承保障计划 | ||
| 274 | - 'savings-fa': { | ||
| 275 | - name: '宏浚传承保障计划', | ||
| 276 | - component: 'SavingsTemplate', | ||
| 277 | - category: 'savings', | ||
| 278 | - config: { | ||
| 279 | - currency: 'USD', | ||
| 280 | - payment_periods: [ | ||
| 281 | - '整付', | ||
| 282 | - '2 年', | ||
| 283 | - '5 年', | ||
| 284 | - ], | ||
| 285 | - age_range: { min: 0, max: 100 }, | ||
| 286 | - insurance_period: '终身', | ||
| 287 | - withdrawal_plan: { | ||
| 288 | - enabled: true, | ||
| 289 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 290 | - default_currency: 'USD', // 统一为美元 | ||
| 291 | - withdrawal_modes: ['指定提取金额', '最高固定提取金额'], | ||
| 292 | - withdrawal_periods: [ | ||
| 293 | - '1年', | ||
| 294 | - '2年', | ||
| 295 | - '3年', | ||
| 296 | - '5年', | ||
| 297 | - '10年', | ||
| 298 | - '15年', | ||
| 299 | - '20年', | ||
| 300 | - '终身' | ||
| 301 | - ] | ||
| 302 | - }, | ||
| 303 | - form_schema: savingsFormSchema, | ||
| 304 | - submit_mapping: savingsSubmitMapping | ||
| 305 | - } | ||
| 306 | - }, | ||
| 307 | - | ||
| 308 | - // LV2 - 赤霞珠终身寿险计划2(储蓄型终身寿险) | ||
| 309 | - 'savings-lv2': { | ||
| 310 | - name: '赤霞珠终身寿险计划2', | ||
| 311 | - component: 'SavingsTemplate', | ||
| 312 | - category: 'savings', | ||
| 313 | - config: { | ||
| 314 | - currency: 'USD', | ||
| 315 | - payment_periods: [ | ||
| 316 | - '5 年', | ||
| 317 | - '8 年', | ||
| 318 | - '12 年', | ||
| 319 | - '15 年', | ||
| 320 | - ], | ||
| 321 | - age_range: { min: 0, max: 100 }, | ||
| 322 | - insurance_period: '终身', | ||
| 323 | - withdrawal_plan: { | ||
| 324 | - enabled: true, | ||
| 325 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 326 | - default_currency: 'USD', // 统一为美元 | ||
| 327 | - withdrawal_modes: ['指定提取金额', '最高固定提取金额'], | ||
| 328 | - withdrawal_periods: [ | ||
| 329 | - '1年', | ||
| 330 | - '2年', | ||
| 331 | - '3年', | ||
| 332 | - '5年', | ||
| 333 | - '10年', | ||
| 334 | - '15年', | ||
| 335 | - '20年', | ||
| 336 | - '终身' | ||
| 337 | - ] | ||
| 338 | - }, | ||
| 339 | - form_schema: savingsFormSchema, | ||
| 340 | - submit_mapping: savingsSubmitMapping | ||
| 341 | - } | ||
| 342 | - } | ||
| 343 | -} | ||
| 344 | - | ||
| 345 | -/** | ||
| 346 | - * 全局功能开关 | ||
| 347 | - * @description 用于控制实验性功能或未来扩展功能的开关 | ||
| 348 | - * | ||
| 349 | - * @example 开启多币种功能:设置 MULTI_CURRENCY_ENABLED = true | ||
| 350 | - */ | ||
| 351 | -export const FEATURE_FLAGS = { | ||
| 352 | - /** | ||
| 353 | - * 多币种切换功能 | ||
| 354 | - * @description false: 方案 1 - 固定币种(当前实现) | ||
| 355 | - * true: 方案 2 - 支持多币种切换(未来扩展) | ||
| 356 | - * @type {boolean} | ||
| 357 | - */ | ||
| 358 | - MULTI_CURRENCY_ENABLED: false | ||
| 359 | -} | ||
| 360 | - | ||
| 361 | -/** | ||
| 362 | - * 币种符号映射 | ||
| 363 | - * @description 币种代码到符号的映射关系 | ||
| 364 | - */ | ||
| 365 | -export const CURRENCY_SYMBOLS = { | ||
| 366 | - CNY: '¥', // 人民币 | ||
| 367 | - USD: '$', // 美元 | ||
| 368 | - HKD: 'HK$', // 港币 | ||
| 369 | - EUR: '€' // 欧元 | ||
| 370 | -} | ||
| 371 | - | ||
| 372 | -/** | ||
| 373 | - * 币种完整信息映射 | ||
| 374 | - * @description 币种代码到完整信息的映射(用于多币种模式) | ||
| 375 | - */ | ||
| 376 | -export const CURRENCY_MAP = { | ||
| 377 | - CNY: { label: '人民币', symbol: '¥', value: 'CNY' }, | ||
| 378 | - USD: { label: '美元', symbol: '$', value: 'USD' }, | ||
| 379 | - HKD: { label: '港币', symbol: 'HK$', value: 'HKD' }, | ||
| 380 | - EUR: { label: '欧元', symbol: '€', value: 'EUR' } | ||
| 381 | -} | ||
| 382 | - | ||
| 383 | -/** | ||
| 384 | - * 根据 form_sn 获取模版配置 | ||
| 385 | - * @param {string} formSn - 产品 API 返回的 form_sn 字段 | ||
| 386 | - * @returns {Object|null} 模版配置对象,未找到返回 null | ||
| 387 | - * | ||
| 388 | - * @example | ||
| 389 | - * const config = getTemplateConfig('life-insurance-wiop3e') | ||
| 390 | - * // 返回: { name: 'WIOP3E...', component: 'LifeInsuranceTemplate', config: {...} } | ||
| 391 | - */ | ||
| 392 | -export function getTemplateConfig(formSn) { | ||
| 393 | - if (!formSn) { | ||
| 394 | - console.warn('[plan-templates] form_sn 为空') | ||
| 395 | - return null | ||
| 396 | - } | ||
| 397 | - | ||
| 398 | - const config = PLAN_TEMPLATES[formSn] | ||
| 399 | - if (!config) { | ||
| 400 | - console.error(`[plan-templates] 未找到模版配置: ${formSn}`) | ||
| 401 | - return null | ||
| 402 | - } | ||
| 403 | - | ||
| 404 | - return config | ||
| 405 | -} | ||
| 406 | - | ||
| 407 | -/** | ||
| 408 | - * 获取币种符号 | ||
| 409 | - * @param {string} currencyCode - 币种代码(CNY/USD/HKD/EUR) | ||
| 410 | - * @returns {string} 币种符号 | ||
| 411 | - * | ||
| 412 | - * @example | ||
| 413 | - * const symbol = getCurrencySymbol('USD') // 返回: '$' | ||
| 414 | - */ | ||
| 415 | -export function getCurrencySymbol(currencyCode) { | ||
| 416 | - return CURRENCY_SYMBOLS[currencyCode] || '¥' | ||
| 417 | -} |
| 1 | -/** | ||
| 2 | - * 计划书模版配置 | ||
| 3 | - * | ||
| 4 | - * @description 定义产品 form_sn 到模版组件和配置的映射关系 | ||
| 5 | - * @module config/plan-templates | ||
| 6 | - * @author Claude Code | ||
| 7 | - * @created 2026-02-06 | ||
| 8 | - * @updated 2026-02-13 - 新增文档解析工具入口 | ||
| 9 | - * | ||
| 10 | - * --- 快速添加新产品(开发工具) --- | ||
| 11 | - * 开发环境可使用以下工具快速添加新产品配置: | ||
| 12 | - * 1. 文档解析工具:/admin/document-parser/index (上传 PDF/Word,AI 自动解析) | ||
| 13 | - * 2. API 配置工具:/admin/document-parser/config (配置 AI 服务) | ||
| 14 | - * | ||
| 15 | - * 使用方式: | ||
| 16 | - * - 上传产品文档 → AI 自动提取配置 → 生成配置代码 → 复制到此文件 | ||
| 17 | - * | ||
| 18 | - * --- 手动添加步骤 --- | ||
| 19 | - * 1. 找到对应的产品分类(人寿/重疾/储蓄) | ||
| 20 | - * 2. 复制现有配置作为模板 | ||
| 21 | - * 3. 修改 name, currency, payment_periods, age_range 等字段 | ||
| 22 | - * 4. 确保 form_sn 唯一(建议使用产品英文标识 + 版本号) | ||
| 23 | - */ | ||
| 24 | - | ||
| 25 | -/** | ||
| 26 | - * 计划书模版配置映射 | ||
| 27 | - * @description form_sn 为产品 API 返回的字段,用于标识该产品使用的计划书模版 | ||
| 28 | - * | ||
| 29 | - * @example | ||
| 30 | - * // 产品 API 返回 | ||
| 31 | - * { | ||
| 32 | - * id: 1, | ||
| 33 | - * product_name: "WIOP3E 盈传创富保障计划 3 - 优选版", | ||
| 34 | - * form_sn: "life-insurance-wiop3e" // 对应下面的配置 key | ||
| 35 | - * } | ||
| 36 | - */ | ||
| 37 | -// 基础提交字段映射(适用于人寿/重疾等通用表单) | ||
| 38 | -const baseSubmitMapping = { | ||
| 39 | - customer_name: { api_field: 'customer_name' }, | ||
| 40 | - gender: { api_field: 'customer_gender' }, | ||
| 41 | - birthday: { api_field: 'customer_birthday' }, | ||
| 42 | - smoker: { api_field: 'smoking_status' }, | ||
| 43 | - coverage: { api_field: 'annual_premium', transform: 'fen_to_yuan' }, | ||
| 44 | - payment_period: { api_field: 'payment_years' }, | ||
| 45 | - total_amount: { api_field: 'total_premium', transform: 'fen_to_yuan' } | ||
| 46 | -} | ||
| 47 | - | ||
| 48 | -// 人寿/重疾基础表单 Schema(通用保障类) | ||
| 49 | -const protectionFormSchema = { | ||
| 50 | - base_fields: [ | ||
| 51 | - { id: 'customer_name', key: 'customer_name', type: 'name', label: '申请人', placeholder: '请输入申请人', required: true }, | ||
| 52 | - { id: 'gender', key: 'gender', type: 'radio', label: '性别', options: ['男', '女'], required: true }, | ||
| 53 | - { id: 'birthday', key: 'birthday', type: 'date', label: '出生年月日', placeholder: '请选择年月日', required: true }, | ||
| 54 | - { id: 'smoker', key: 'smoker', type: 'radio', label: '是否吸烟', options: ['是', '否'], required: true }, | ||
| 55 | - { id: 'coverage', key: 'coverage', type: 'amount', label: '保额', placeholder: '请输入保额', input_label: '请输入保额金额', required: true, currency_from: 'currency' }, | ||
| 56 | - { id: 'payment_period', key: 'payment_period', type: 'payment_period', label: '缴费年期', required: true, options_from: 'payment_periods' } | ||
| 57 | - ] | ||
| 58 | -} | ||
| 59 | - | ||
| 60 | -// 储蓄类提交字段映射(在基础映射上追加提取计划字段) | ||
| 61 | -const savingsSubmitMapping = { | ||
| 62 | - ...baseSubmitMapping, | ||
| 63 | - withdrawal_enabled: { api_field: 'allow_reduce_amount' }, | ||
| 64 | - withdrawal_mode: { api_field: 'withdrawal_option' }, | ||
| 65 | - withdrawal_method: { api_field: 'withdrawal_method' }, | ||
| 66 | - annual_withdrawal_amount: { api_field: 'annual_withdrawal_amount', transform: 'fen_to_yuan' }, | ||
| 67 | - annual_increase_percentage: { api_field: 'annual_increase_percentage' }, | ||
| 68 | - withdrawal_start_age_specified: { api_field: 'withdrawal_start_age' }, | ||
| 69 | - withdrawal_period_specified: { api_field: 'withdrawal_period' }, | ||
| 70 | - withdrawal_start_age_fixed: { api_field: 'withdrawal_start_age' }, | ||
| 71 | - withdrawal_period_fixed: { api_field: 'withdrawal_period' } | ||
| 72 | -} | ||
| 73 | - | ||
| 74 | -// 储蓄类表单 Schema(渲染 + 校验 + 联动的唯一入口) | ||
| 75 | -const savingsFormSchema = { | ||
| 76 | - // 基础字段:非提取计划部分 | ||
| 77 | - base_fields: [ | ||
| 78 | - { id: 'customer_name', key: 'customer_name', type: 'name', label: '申请人', placeholder: '请输入申请人', required: true }, | ||
| 79 | - { id: 'gender', key: 'gender', type: 'radio', label: '性别', options: ['男', '女'], required: true }, | ||
| 80 | - { id: 'birthday', key: 'birthday', type: 'date', label: '出生年月日', placeholder: '请选择年月日', required: true }, | ||
| 81 | - { id: 'smoker', key: 'smoker', type: 'radio', label: '是否吸烟', options: ['是', '否'], required: true }, | ||
| 82 | - { id: 'coverage', key: 'coverage', type: 'amount', label: '年缴保费', placeholder: '请输入年缴保费', input_label: '请输入年缴保费金额', required: true, currency_from: 'currency' }, | ||
| 83 | - { id: 'payment_period', key: 'payment_period', type: 'payment_period', label: '缴费年期', required: true, options_from: 'payment_periods' } | ||
| 84 | - ], | ||
| 85 | - // 提取计划字段:由 withdrawal_plan 开关控制 | ||
| 86 | - withdrawal_fields: [ | ||
| 87 | - { id: 'withdrawal_enabled', key: 'withdrawal_enabled', type: 'radio', label: '是否希望生成一份允许减少名义金额的提取说明?', options: ['是', '否'], required: true, default: '否' }, | ||
| 88 | - { id: 'withdrawal_mode', key: 'withdrawal_mode', type: 'radio', label: '提取选项', options: ['指定提取金额', '最高固定提取金额'], required: true, default: '指定提取金额', section_title: '款项提取(允许减少名义金额)' }, | ||
| 89 | - { id: 'withdrawal_method', key: 'withdrawal_method', type: 'radio', label: '提取方式', options: ['按年岁'], required: true, default: '按年岁', show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 90 | - { id: 'annual_withdrawal_amount', key: 'annual_withdrawal_amount', type: 'amount', label: '每年提取金额', placeholder: '请输入每年提取金额', input_label: '请输入每年提取金额', required: true, currency_from: 'withdrawal_plan.default_currency', show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 91 | - { id: 'withdrawal_start_age_specified', key: 'withdrawal_start_age_specified', type: 'age', label: '由几岁开始', placeholder: '请输入开始提取年龄', required: true, show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 92 | - { id: 'withdrawal_period_specified', key: 'withdrawal_period_specified', type: 'select', label: '提取期(年)', placeholder: '请选择提取期', required: true, options_from: 'withdrawal_plan.withdrawal_periods', show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 93 | - { id: 'annual_increase_percentage', key: 'annual_increase_percentage', type: 'percentage', label: '每年递增提取之百分比(%)', placeholder: '请输入递增百分比', required: true, show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 94 | - { id: 'withdrawal_start_age_fixed', key: 'withdrawal_start_age_fixed', type: 'age', label: '按年岁:由几岁开始', placeholder: '请输入开始提取年龄', required: true, show_when: [{ field: 'withdrawal_mode', equals: '最高固定提取金额' }] }, | ||
| 95 | - { id: 'withdrawal_period_fixed', key: 'withdrawal_period_fixed', type: 'select', label: '按年岁:提取期(年)', placeholder: '请选择提取期', required: true, options_from: 'withdrawal_plan.withdrawal_periods', show_when: [{ field: 'withdrawal_mode', equals: '最高固定提取金额' }] } | ||
| 96 | - ], | ||
| 97 | - // 提取模式切换时的清空逻辑,避免脏字段影响提交 | ||
| 98 | - reset_map: { | ||
| 99 | - withdrawal_mode: { | ||
| 100 | - '最高固定提取金额': ['annual_withdrawal_amount', 'annual_increase_percentage', 'withdrawal_start_age_specified', 'withdrawal_period_specified'], | ||
| 101 | - '指定提取金额': ['withdrawal_start_age_fixed', 'withdrawal_period_fixed'] | ||
| 102 | - } | ||
| 103 | - } | ||
| 104 | -} | ||
| 105 | - | ||
| 106 | -export const PLAN_TEMPLATES = { | ||
| 107 | - // 人寿保险产品 - WIOP3E | ||
| 108 | - 'life-insurance-wiop3e': { | ||
| 109 | - name: 'WIOP3E 盈传创富保障计划 3 - 优选版', | ||
| 110 | - component: 'LifeInsuranceTemplate', | ||
| 111 | - config: { | ||
| 112 | - currency: 'USD', // 币种:USD/CNY/HKD/EUR | ||
| 113 | - payment_periods: [ | ||
| 114 | - // 缴费年期选项 | ||
| 115 | - '整付(0-75 岁)', | ||
| 116 | - '5 年(0-70 岁)', | ||
| 117 | - '10 年(0-70 岁)' | ||
| 118 | - ], | ||
| 119 | - age_range: { min: 0, max: 75 }, // 年龄范围 | ||
| 120 | - insurance_period: '终身', // 保险期间 | ||
| 121 | - form_schema: protectionFormSchema, | ||
| 122 | - submit_mapping: baseSubmitMapping | ||
| 123 | - } | ||
| 124 | - }, | ||
| 125 | - | ||
| 126 | - // 人寿保险产品 - WIOP3 | ||
| 127 | - 'life-insurance-wiop3': { | ||
| 128 | - name: 'WIOP3 - 盈传创富保障计划 3', | ||
| 129 | - component: 'LifeInsuranceTemplate', | ||
| 130 | - config: { | ||
| 131 | - currency: 'USD', | ||
| 132 | - payment_periods: [ | ||
| 133 | - '整付(0-75 岁)', | ||
| 134 | - '5 年(0-70 岁)', | ||
| 135 | - '10 年(0-70 岁)' | ||
| 136 | - ], | ||
| 137 | - age_range: { min: 0, max: 75 }, | ||
| 138 | - insurance_period: '终身', | ||
| 139 | - form_schema: protectionFormSchema, | ||
| 140 | - submit_mapping: baseSubmitMapping | ||
| 141 | - } | ||
| 142 | - }, | ||
| 143 | - | ||
| 144 | - // 重疾保险产品 - MPC | ||
| 145 | - 'critical-illness-mpc': { | ||
| 146 | - name: 'MPC 守护无间重疾', | ||
| 147 | - component: 'CriticalIllnessTemplate', | ||
| 148 | - config: { | ||
| 149 | - currency: 'USD', | ||
| 150 | - payment_periods: [ | ||
| 151 | - '10 年(15 日 - 65 岁)', | ||
| 152 | - '20 年(15 日 - 65 岁)', | ||
| 153 | - '25 年(15 日 - 60 岁)' | ||
| 154 | - ], | ||
| 155 | - age_range: { min: 0, max: 65 }, | ||
| 156 | - insurance_period: '终身', | ||
| 157 | - form_schema: protectionFormSchema, | ||
| 158 | - submit_mapping: baseSubmitMapping | ||
| 159 | - } | ||
| 160 | - }, | ||
| 161 | - | ||
| 162 | - // 重疾保险产品 - MBC PRO | ||
| 163 | - 'critical-illness-mbc-pro': { | ||
| 164 | - name: 'MBC PRO 活跃人生重疾保 PRO', | ||
| 165 | - component: 'CriticalIllnessTemplate', | ||
| 166 | - config: { | ||
| 167 | - currency: 'USD', | ||
| 168 | - payment_periods: [ | ||
| 169 | - '10 年(15 日 - 65 岁)', | ||
| 170 | - '20 年(15 日 - 65 岁)', | ||
| 171 | - '25 年(15 日 - 60 岁)' | ||
| 172 | - ], | ||
| 173 | - age_range: { min: 0, max: 65 }, | ||
| 174 | - insurance_period: '终身', | ||
| 175 | - form_schema: protectionFormSchema, | ||
| 176 | - submit_mapping: baseSubmitMapping | ||
| 177 | - } | ||
| 178 | - }, | ||
| 179 | - | ||
| 180 | - // 重疾保险产品 - MBC2 | ||
| 181 | - 'critical-illness-mbc2': { | ||
| 182 | - name: 'MBC2 活跃人生重疾保 2', | ||
| 183 | - component: 'CriticalIllnessTemplate', | ||
| 184 | - config: { | ||
| 185 | - currency: 'USD', | ||
| 186 | - payment_periods: [ | ||
| 187 | - '10 年(15 日 - 65 岁)', | ||
| 188 | - '20 年(15 日 - 65 岁)', | ||
| 189 | - '25 年(15 日 - 60 岁)' | ||
| 190 | - ], | ||
| 191 | - age_range: { min: 0, max: 65 }, | ||
| 192 | - insurance_period: '终身', | ||
| 193 | - form_schema: protectionFormSchema, | ||
| 194 | - submit_mapping: baseSubmitMapping | ||
| 195 | - } | ||
| 196 | - }, | ||
| 197 | - | ||
| 198 | - // ====== 储蓄型产品(统一逻辑) ====== | ||
| 199 | - | ||
| 200 | - // GS - 宏挚传承保障计划 | ||
| 201 | - 'savings-gs': { | ||
| 202 | - name: '宏挚传承保障计划', | ||
| 203 | - component: 'SavingsTemplate', | ||
| 204 | - category: 'savings', // 储蓄型产品 | ||
| 205 | - config: { | ||
| 206 | - currency: 'USD', // 默认美元 | ||
| 207 | - payment_periods: [ | ||
| 208 | - '整付', | ||
| 209 | - '3 年', | ||
| 210 | - '5 年', | ||
| 211 | - '10 年', | ||
| 212 | - '15 年', | ||
| 213 | - ], | ||
| 214 | - age_range: { min: 0, max: 100 }, | ||
| 215 | - insurance_period: '终身', | ||
| 216 | - // 提取计划配置 | ||
| 217 | - withdrawal_plan: { | ||
| 218 | - enabled: true, | ||
| 219 | - currencies: ['HKD', 'USD', 'CNY'], // 支持的币种 | ||
| 220 | - default_currency: 'USD', // 统一为美元 | ||
| 221 | - withdrawal_modes: ['指定提取金额', '最高固定提取金额'], | ||
| 222 | - withdrawal_periods: [ | ||
| 223 | - '1年', | ||
| 224 | - '2年', | ||
| 225 | - '3年', | ||
| 226 | - '5年', | ||
| 227 | - '10年', | ||
| 228 | - '15年', | ||
| 229 | - '20年', | ||
| 230 | - '终身' | ||
| 231 | - ] | ||
| 232 | - }, | ||
| 233 | - form_schema: savingsFormSchema, | ||
| 234 | - submit_mapping: savingsSubmitMapping | ||
| 235 | - } | ||
| 236 | - }, | ||
| 237 | - | ||
| 238 | - // GC - 宏挚家传保险计划 | ||
| 239 | - 'savings-gc': { | ||
| 240 | - name: '宏挚家传保险计划', | ||
| 241 | - component: 'SavingsTemplate', | ||
| 242 | - category: 'savings', | ||
| 243 | - config: { | ||
| 244 | - currency: 'USD', | ||
| 245 | - payment_periods: [ | ||
| 246 | - '整付', | ||
| 247 | - '3 年', | ||
| 248 | - '5 年', | ||
| 249 | - ], | ||
| 250 | - age_range: { min: 0, max: 100 }, | ||
| 251 | - insurance_period: '终身', | ||
| 252 | - withdrawal_plan: { | ||
| 253 | - enabled: true, | ||
| 254 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 255 | - default_currency: 'USD', // 统一为美元 | ||
| 256 | - withdrawal_modes: ['指定提取金额', '最高固定提取金额'], | ||
| 257 | - withdrawal_periods: [ | ||
| 258 | - '1年', | ||
| 259 | - '2年', | ||
| 260 | - '3年', | ||
| 261 | - '5年', | ||
| 262 | - '10年', | ||
| 263 | - '15年', | ||
| 264 | - '20年', | ||
| 265 | - '终身' | ||
| 266 | - ] | ||
| 267 | - }, | ||
| 268 | - form_schema: savingsFormSchema, | ||
| 269 | - submit_mapping: savingsSubmitMapping | ||
| 270 | - } | ||
| 271 | - }, | ||
| 272 | - | ||
| 273 | - // FA - 宏浚传承保障计划 | ||
| 274 | - 'savings-fa': { | ||
| 275 | - name: '宏浚传承保障计划', | ||
| 276 | - component: 'SavingsTemplate', | ||
| 277 | - category: 'savings', | ||
| 278 | - config: { | ||
| 279 | - currency: 'USD', | ||
| 280 | - payment_periods: [ | ||
| 281 | - '整付', | ||
| 282 | - '2 年', | ||
| 283 | - '5 年', | ||
| 284 | - ], | ||
| 285 | - age_range: { min: 0, max: 100 }, | ||
| 286 | - insurance_period: '终身', | ||
| 287 | - withdrawal_plan: { | ||
| 288 | - enabled: true, | ||
| 289 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 290 | - default_currency: 'USD', // 统一为美元 | ||
| 291 | - withdrawal_modes: ['指定提取金额', '最高固定提取金额'], | ||
| 292 | - withdrawal_periods: [ | ||
| 293 | - '1年', | ||
| 294 | - '2年', | ||
| 295 | - '3年', | ||
| 296 | - '5年', | ||
| 297 | - '10年', | ||
| 298 | - '15年', | ||
| 299 | - '20年', | ||
| 300 | - '终身' | ||
| 301 | - ] | ||
| 302 | - }, | ||
| 303 | - form_schema: savingsFormSchema, | ||
| 304 | - submit_mapping: savingsSubmitMapping | ||
| 305 | - } | ||
| 306 | - }, | ||
| 307 | - | ||
| 308 | - // LV2 - 赤霞珠终身寿险计划2(储蓄型终身寿险) | ||
| 309 | - 'savings-lv2': { | ||
| 310 | - name: '赤霞珠终身寿险计划2', | ||
| 311 | - component: 'SavingsTemplate', | ||
| 312 | - category: 'savings', | ||
| 313 | - config: { | ||
| 314 | - currency: 'USD', | ||
| 315 | - payment_periods: [ | ||
| 316 | - '5 年', | ||
| 317 | - '8 年', | ||
| 318 | - '12 年', | ||
| 319 | - '15 年', | ||
| 320 | - ], | ||
| 321 | - age_range: { min: 0, max: 100 }, | ||
| 322 | - insurance_period: '终身', | ||
| 323 | - withdrawal_plan: { | ||
| 324 | - enabled: true, | ||
| 325 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 326 | - default_currency: 'USD', // 统一为美元 | ||
| 327 | - withdrawal_modes: ['指定提取金额', '最高固定提取金额'], | ||
| 328 | - withdrawal_periods: [ | ||
| 329 | - '1年', | ||
| 330 | - '2年', | ||
| 331 | - '3年', | ||
| 332 | - '5年', | ||
| 333 | - '10年', | ||
| 334 | - '15年', | ||
| 335 | - '20年', | ||
| 336 | - '终身' | ||
| 337 | - ] | ||
| 338 | - }, | ||
| 339 | - form_schema: savingsFormSchema, | ||
| 340 | - submit_mapping: savingsSubmitMapping | ||
| 341 | - } | ||
| 342 | - }, | ||
| 343 | - | ||
| 344 | - /** | ||
| 345 | - * 测试计划书-智享未来 | ||
| 346 | - * @added 2026-02-14T13:10:33.924Z | ||
| 347 | - * @source docs/to-parse/测试计划书-智享未来.md | ||
| 348 | - */ | ||
| 349 | - 'savings-product-30b41aae': { | ||
| 350 | - name: '测试计划书-智享未来', | ||
| 351 | - component: 'SavingsTemplate', | ||
| 352 | - category: 'savings', | ||
| 353 | - config: { | ||
| 354 | - currency: 'USD', | ||
| 355 | - payment_periods: ["整付", "3年", "5年"], | ||
| 356 | - age_range: { min: 0, max: 75 }, | ||
| 357 | - insurance_period: '终身', | ||
| 358 | - withdrawal_plan: { | ||
| 359 | - enabled: true, | ||
| 360 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 361 | - default_currency: 'USD', | ||
| 362 | - withdrawal_modes: ["年龄指定金额", "最高固定金额"], | ||
| 363 | - withdrawal_periods: ["1年", "3年", "5年", "10年"] | ||
| 364 | - }, | ||
| 365 | - form_schema: savingsFormSchema, | ||
| 366 | - submit_mapping: savingsSubmitMapping | ||
| 367 | - } | ||
| 368 | - } | ||
| 369 | -} | ||
| 370 | - | ||
| 371 | -/** | ||
| 372 | - * 全局功能开关 | ||
| 373 | - * @description 用于控制实验性功能或未来扩展功能的开关 | ||
| 374 | - * | ||
| 375 | - * @example 开启多币种功能:设置 MULTI_CURRENCY_ENABLED = true | ||
| 376 | - */ | ||
| 377 | -export const FEATURE_FLAGS = { | ||
| 378 | - /** | ||
| 379 | - * 多币种切换功能 | ||
| 380 | - * @description false: 方案 1 - 固定币种(当前实现) | ||
| 381 | - * true: 方案 2 - 支持多币种切换(未来扩展) | ||
| 382 | - * @type {boolean} | ||
| 383 | - */ | ||
| 384 | - MULTI_CURRENCY_ENABLED: false | ||
| 385 | -} | ||
| 386 | - | ||
| 387 | -/** | ||
| 388 | - * 币种符号映射 | ||
| 389 | - * @description 币种代码到符号的映射关系 | ||
| 390 | - */ | ||
| 391 | -export const CURRENCY_SYMBOLS = { | ||
| 392 | - CNY: '¥', // 人民币 | ||
| 393 | - USD: '$', // 美元 | ||
| 394 | - HKD: 'HK$', // 港币 | ||
| 395 | - EUR: '€' // 欧元 | ||
| 396 | -} | ||
| 397 | - | ||
| 398 | -/** | ||
| 399 | - * 币种完整信息映射 | ||
| 400 | - * @description 币种代码到完整信息的映射(用于多币种模式) | ||
| 401 | - */ | ||
| 402 | -export const CURRENCY_MAP = { | ||
| 403 | - CNY: { label: '人民币', symbol: '¥', value: 'CNY' }, | ||
| 404 | - USD: { label: '美元', symbol: '$', value: 'USD' }, | ||
| 405 | - HKD: { label: '港币', symbol: 'HK$', value: 'HKD' }, | ||
| 406 | - EUR: { label: '欧元', symbol: '€', value: 'EUR' } | ||
| 407 | -} | ||
| 408 | - | ||
| 409 | -/** | ||
| 410 | - * 根据 form_sn 获取模版配置 | ||
| 411 | - * @param {string} formSn - 产品 API 返回的 form_sn 字段 | ||
| 412 | - * @returns {Object|null} 模版配置对象,未找到返回 null | ||
| 413 | - * | ||
| 414 | - * @example | ||
| 415 | - * const config = getTemplateConfig('life-insurance-wiop3e') | ||
| 416 | - * // 返回: { name: 'WIOP3E...', component: 'LifeInsuranceTemplate', config: {...} } | ||
| 417 | - */ | ||
| 418 | -export function getTemplateConfig(formSn) { | ||
| 419 | - if (!formSn) { | ||
| 420 | - console.warn('[plan-templates] form_sn 为空') | ||
| 421 | - return null | ||
| 422 | - } | ||
| 423 | - | ||
| 424 | - const config = PLAN_TEMPLATES[formSn] | ||
| 425 | - if (!config) { | ||
| 426 | - console.error(`[plan-templates] 未找到模版配置: ${formSn}`) | ||
| 427 | - return null | ||
| 428 | - } | ||
| 429 | - | ||
| 430 | - return config | ||
| 431 | -} | ||
| 432 | - | ||
| 433 | -/** | ||
| 434 | - * 获取币种符号 | ||
| 435 | - * @param {string} currencyCode - 币种代码(CNY/USD/HKD/EUR) | ||
| 436 | - * @returns {string} 币种符号 | ||
| 437 | - * | ||
| 438 | - * @example | ||
| 439 | - * const symbol = getCurrencySymbol('USD') // 返回: '$' | ||
| 440 | - */ | ||
| 441 | -export function getCurrencySymbol(currencyCode) { | ||
| 442 | - return CURRENCY_SYMBOLS[currencyCode] || '¥' | ||
| 443 | -} |
| 1 | -/** | ||
| 2 | - * 计划书模版配置 | ||
| 3 | - * | ||
| 4 | - * @description 定义产品 form_sn 到模版组件和配置的映射关系 | ||
| 5 | - * @module config/plan-templates | ||
| 6 | - * @author Claude Code | ||
| 7 | - * @created 2026-02-06 | ||
| 8 | - * @updated 2026-02-13 - 新增文档解析工具入口 | ||
| 9 | - * | ||
| 10 | - * --- 快速添加新产品(开发工具) --- | ||
| 11 | - * 开发环境可使用以下工具快速添加新产品配置: | ||
| 12 | - * 1. 文档解析工具:/admin/document-parser/index (上传 PDF/Word,AI 自动解析) | ||
| 13 | - * 2. API 配置工具:/admin/document-parser/config (配置 AI 服务) | ||
| 14 | - * | ||
| 15 | - * 使用方式: | ||
| 16 | - * - 上传产品文档 → AI 自动提取配置 → 生成配置代码 → 复制到此文件 | ||
| 17 | - * | ||
| 18 | - * --- 手动添加步骤 --- | ||
| 19 | - * 1. 找到对应的产品分类(人寿/重疾/储蓄) | ||
| 20 | - * 2. 复制现有配置作为模板 | ||
| 21 | - * 3. 修改 name, currency, payment_periods, age_range 等字段 | ||
| 22 | - * 4. 确保 form_sn 唯一(建议使用产品英文标识 + 版本号) | ||
| 23 | - */ | ||
| 24 | - | ||
| 25 | -/** | ||
| 26 | - * 计划书模版配置映射 | ||
| 27 | - * @description form_sn 为产品 API 返回的字段,用于标识该产品使用的计划书模版 | ||
| 28 | - * | ||
| 29 | - * @example | ||
| 30 | - * // 产品 API 返回 | ||
| 31 | - * { | ||
| 32 | - * id: 1, | ||
| 33 | - * product_name: "WIOP3E 盈传创富保障计划 3 - 优选版", | ||
| 34 | - * form_sn: "life-insurance-wiop3e" // 对应下面的配置 key | ||
| 35 | - * } | ||
| 36 | - */ | ||
| 37 | -// 基础提交字段映射(适用于人寿/重疾等通用表单) | ||
| 38 | -const baseSubmitMapping = { | ||
| 39 | - customer_name: { api_field: 'customer_name' }, | ||
| 40 | - gender: { api_field: 'customer_gender' }, | ||
| 41 | - birthday: { api_field: 'customer_birthday' }, | ||
| 42 | - smoker: { api_field: 'smoking_status' }, | ||
| 43 | - coverage: { api_field: 'annual_premium', transform: 'fen_to_yuan' }, | ||
| 44 | - payment_period: { api_field: 'payment_years' }, | ||
| 45 | - total_amount: { api_field: 'total_premium', transform: 'fen_to_yuan' } | ||
| 46 | -} | ||
| 47 | - | ||
| 48 | -// 人寿/重疾基础表单 Schema(通用保障类) | ||
| 49 | -const protectionFormSchema = { | ||
| 50 | - base_fields: [ | ||
| 51 | - { id: 'customer_name', key: 'customer_name', type: 'name', label: '申请人', placeholder: '请输入申请人', required: true }, | ||
| 52 | - { id: 'gender', key: 'gender', type: 'radio', label: '性别', options: ['男', '女'], required: true }, | ||
| 53 | - { id: 'birthday', key: 'birthday', type: 'date', label: '出生年月日', placeholder: '请选择年月日', required: true }, | ||
| 54 | - { id: 'smoker', key: 'smoker', type: 'radio', label: '是否吸烟', options: ['是', '否'], required: true }, | ||
| 55 | - { id: 'coverage', key: 'coverage', type: 'amount', label: '保额', placeholder: '请输入保额', input_label: '请输入保额金额', required: true, currency_from: 'currency' }, | ||
| 56 | - { id: 'payment_period', key: 'payment_period', type: 'payment_period', label: '缴费年期', required: true, options_from: 'payment_periods' } | ||
| 57 | - ] | ||
| 58 | -} | ||
| 59 | - | ||
| 60 | -// 储蓄类提交字段映射(在基础映射上追加提取计划字段) | ||
| 61 | -const savingsSubmitMapping = { | ||
| 62 | - ...baseSubmitMapping, | ||
| 63 | - withdrawal_enabled: { api_field: 'allow_reduce_amount' }, | ||
| 64 | - withdrawal_mode: { api_field: 'withdrawal_option' }, | ||
| 65 | - withdrawal_method: { api_field: 'withdrawal_method' }, | ||
| 66 | - annual_withdrawal_amount: { api_field: 'annual_withdrawal_amount', transform: 'fen_to_yuan' }, | ||
| 67 | - annual_increase_percentage: { api_field: 'annual_increase_percentage' }, | ||
| 68 | - withdrawal_start_age_specified: { api_field: 'withdrawal_start_age' }, | ||
| 69 | - withdrawal_period_specified: { api_field: 'withdrawal_period' }, | ||
| 70 | - withdrawal_start_age_fixed: { api_field: 'withdrawal_start_age' }, | ||
| 71 | - withdrawal_period_fixed: { api_field: 'withdrawal_period' } | ||
| 72 | -} | ||
| 73 | - | ||
| 74 | -// 储蓄类表单 Schema(渲染 + 校验 + 联动的唯一入口) | ||
| 75 | -const savingsFormSchema = { | ||
| 76 | - // 基础字段:非提取计划部分 | ||
| 77 | - base_fields: [ | ||
| 78 | - { id: 'customer_name', key: 'customer_name', type: 'name', label: '申请人', placeholder: '请输入申请人', required: true }, | ||
| 79 | - { id: 'gender', key: 'gender', type: 'radio', label: '性别', options: ['男', '女'], required: true }, | ||
| 80 | - { id: 'birthday', key: 'birthday', type: 'date', label: '出生年月日', placeholder: '请选择年月日', required: true }, | ||
| 81 | - { id: 'smoker', key: 'smoker', type: 'radio', label: '是否吸烟', options: ['是', '否'], required: true }, | ||
| 82 | - { id: 'coverage', key: 'coverage', type: 'amount', label: '年缴保费', placeholder: '请输入年缴保费', input_label: '请输入年缴保费金额', required: true, currency_from: 'currency' }, | ||
| 83 | - { id: 'payment_period', key: 'payment_period', type: 'payment_period', label: '缴费年期', required: true, options_from: 'payment_periods' } | ||
| 84 | - ], | ||
| 85 | - // 提取计划字段:由 withdrawal_plan 开关控制 | ||
| 86 | - withdrawal_fields: [ | ||
| 87 | - { id: 'withdrawal_enabled', key: 'withdrawal_enabled', type: 'radio', label: '是否希望生成一份允许减少名义金额的提取说明?', options: ['是', '否'], required: true, default: '否' }, | ||
| 88 | - { id: 'withdrawal_mode', key: 'withdrawal_mode', type: 'radio', label: '提取选项', options: ['指定提取金额', '最高固定提取金额'], required: true, default: '指定提取金额', section_title: '款项提取(允许减少名义金额)' }, | ||
| 89 | - { id: 'withdrawal_method', key: 'withdrawal_method', type: 'radio', label: '提取方式', options: ['按年岁'], required: true, default: '按年岁', show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 90 | - { id: 'annual_withdrawal_amount', key: 'annual_withdrawal_amount', type: 'amount', label: '每年提取金额', placeholder: '请输入每年提取金额', input_label: '请输入每年提取金额', required: true, currency_from: 'withdrawal_plan.default_currency', show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 91 | - { id: 'withdrawal_start_age_specified', key: 'withdrawal_start_age_specified', type: 'age', label: '由几岁开始', placeholder: '请输入开始提取年龄', required: true, show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 92 | - { id: 'withdrawal_period_specified', key: 'withdrawal_period_specified', type: 'select', label: '提取期(年)', placeholder: '请选择提取期', required: true, options_from: 'withdrawal_plan.withdrawal_periods', show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 93 | - { id: 'annual_increase_percentage', key: 'annual_increase_percentage', type: 'percentage', label: '每年递增提取之百分比(%)', placeholder: '请输入递增百分比', required: true, show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 94 | - { id: 'withdrawal_start_age_fixed', key: 'withdrawal_start_age_fixed', type: 'age', label: '按年岁:由几岁开始', placeholder: '请输入开始提取年龄', required: true, show_when: [{ field: 'withdrawal_mode', equals: '最高固定提取金额' }] }, | ||
| 95 | - { id: 'withdrawal_period_fixed', key: 'withdrawal_period_fixed', type: 'select', label: '按年岁:提取期(年)', placeholder: '请选择提取期', required: true, options_from: 'withdrawal_plan.withdrawal_periods', show_when: [{ field: 'withdrawal_mode', equals: '最高固定提取金额' }] } | ||
| 96 | - ], | ||
| 97 | - // 提取模式切换时的清空逻辑,避免脏字段影响提交 | ||
| 98 | - reset_map: { | ||
| 99 | - withdrawal_mode: { | ||
| 100 | - '最高固定提取金额': ['annual_withdrawal_amount', 'annual_increase_percentage', 'withdrawal_start_age_specified', 'withdrawal_period_specified'], | ||
| 101 | - '指定提取金额': ['withdrawal_start_age_fixed', 'withdrawal_period_fixed'] | ||
| 102 | - } | ||
| 103 | - } | ||
| 104 | -} | ||
| 105 | - | ||
| 106 | -export const PLAN_TEMPLATES = { | ||
| 107 | - // 人寿保险产品 - WIOP3E | ||
| 108 | - 'life-insurance-wiop3e': { | ||
| 109 | - name: 'WIOP3E 盈传创富保障计划 3 - 优选版', | ||
| 110 | - component: 'LifeInsuranceTemplate', | ||
| 111 | - config: { | ||
| 112 | - currency: 'USD', // 币种:USD/CNY/HKD/EUR | ||
| 113 | - payment_periods: [ | ||
| 114 | - // 缴费年期选项 | ||
| 115 | - '整付(0-75 岁)', | ||
| 116 | - '5 年(0-70 岁)', | ||
| 117 | - '10 年(0-70 岁)' | ||
| 118 | - ], | ||
| 119 | - age_range: { min: 0, max: 75 }, // 年龄范围 | ||
| 120 | - insurance_period: '终身', // 保险期间 | ||
| 121 | - form_schema: protectionFormSchema, | ||
| 122 | - submit_mapping: baseSubmitMapping | ||
| 123 | - } | ||
| 124 | - }, | ||
| 125 | - | ||
| 126 | - // 人寿保险产品 - WIOP3 | ||
| 127 | - 'life-insurance-wiop3': { | ||
| 128 | - name: 'WIOP3 - 盈传创富保障计划 3', | ||
| 129 | - component: 'LifeInsuranceTemplate', | ||
| 130 | - config: { | ||
| 131 | - currency: 'USD', | ||
| 132 | - payment_periods: [ | ||
| 133 | - '整付(0-75 岁)', | ||
| 134 | - '5 年(0-70 岁)', | ||
| 135 | - '10 年(0-70 岁)' | ||
| 136 | - ], | ||
| 137 | - age_range: { min: 0, max: 75 }, | ||
| 138 | - insurance_period: '终身', | ||
| 139 | - form_schema: protectionFormSchema, | ||
| 140 | - submit_mapping: baseSubmitMapping | ||
| 141 | - } | ||
| 142 | - }, | ||
| 143 | - | ||
| 144 | - // 重疾保险产品 - MPC | ||
| 145 | - 'critical-illness-mpc': { | ||
| 146 | - name: 'MPC 守护无间重疾', | ||
| 147 | - component: 'CriticalIllnessTemplate', | ||
| 148 | - config: { | ||
| 149 | - currency: 'USD', | ||
| 150 | - payment_periods: [ | ||
| 151 | - '10 年(15 日 - 65 岁)', | ||
| 152 | - '20 年(15 日 - 65 岁)', | ||
| 153 | - '25 年(15 日 - 60 岁)' | ||
| 154 | - ], | ||
| 155 | - age_range: { min: 0, max: 65 }, | ||
| 156 | - insurance_period: '终身', | ||
| 157 | - form_schema: protectionFormSchema, | ||
| 158 | - submit_mapping: baseSubmitMapping | ||
| 159 | - } | ||
| 160 | - }, | ||
| 161 | - | ||
| 162 | - // 重疾保险产品 - MBC PRO | ||
| 163 | - 'critical-illness-mbc-pro': { | ||
| 164 | - name: 'MBC PRO 活跃人生重疾保 PRO', | ||
| 165 | - component: 'CriticalIllnessTemplate', | ||
| 166 | - config: { | ||
| 167 | - currency: 'USD', | ||
| 168 | - payment_periods: [ | ||
| 169 | - '10 年(15 日 - 65 岁)', | ||
| 170 | - '20 年(15 日 - 65 岁)', | ||
| 171 | - '25 年(15 日 - 60 岁)' | ||
| 172 | - ], | ||
| 173 | - age_range: { min: 0, max: 65 }, | ||
| 174 | - insurance_period: '终身', | ||
| 175 | - form_schema: protectionFormSchema, | ||
| 176 | - submit_mapping: baseSubmitMapping | ||
| 177 | - } | ||
| 178 | - }, | ||
| 179 | - | ||
| 180 | - // 重疾保险产品 - MBC2 | ||
| 181 | - 'critical-illness-mbc2': { | ||
| 182 | - name: 'MBC2 活跃人生重疾保 2', | ||
| 183 | - component: 'CriticalIllnessTemplate', | ||
| 184 | - config: { | ||
| 185 | - currency: 'USD', | ||
| 186 | - payment_periods: [ | ||
| 187 | - '10 年(15 日 - 65 岁)', | ||
| 188 | - '20 年(15 日 - 65 岁)', | ||
| 189 | - '25 年(15 日 - 60 岁)' | ||
| 190 | - ], | ||
| 191 | - age_range: { min: 0, max: 65 }, | ||
| 192 | - insurance_period: '终身', | ||
| 193 | - form_schema: protectionFormSchema, | ||
| 194 | - submit_mapping: baseSubmitMapping | ||
| 195 | - } | ||
| 196 | - }, | ||
| 197 | - | ||
| 198 | - // ====== 储蓄型产品(统一逻辑) ====== | ||
| 199 | - | ||
| 200 | - // GS - 宏挚传承保障计划 | ||
| 201 | - 'savings-gs': { | ||
| 202 | - name: '宏挚传承保障计划', | ||
| 203 | - component: 'SavingsTemplate', | ||
| 204 | - category: 'savings', // 储蓄型产品 | ||
| 205 | - config: { | ||
| 206 | - currency: 'USD', // 默认美元 | ||
| 207 | - payment_periods: [ | ||
| 208 | - '整付', | ||
| 209 | - '3 年', | ||
| 210 | - '5 年', | ||
| 211 | - '10 年', | ||
| 212 | - '15 年', | ||
| 213 | - ], | ||
| 214 | - age_range: { min: 0, max: 100 }, | ||
| 215 | - insurance_period: '终身', | ||
| 216 | - // 提取计划配置 | ||
| 217 | - withdrawal_plan: { | ||
| 218 | - enabled: true, | ||
| 219 | - currencies: ['HKD', 'USD', 'CNY'], // 支持的币种 | ||
| 220 | - default_currency: 'USD', // 统一为美元 | ||
| 221 | - withdrawal_modes: ['指定提取金额', '最高固定提取金额'], | ||
| 222 | - withdrawal_periods: [ | ||
| 223 | - '1年', | ||
| 224 | - '2年', | ||
| 225 | - '3年', | ||
| 226 | - '5年', | ||
| 227 | - '10年', | ||
| 228 | - '15年', | ||
| 229 | - '20年', | ||
| 230 | - '终身' | ||
| 231 | - ] | ||
| 232 | - }, | ||
| 233 | - form_schema: savingsFormSchema, | ||
| 234 | - submit_mapping: savingsSubmitMapping | ||
| 235 | - } | ||
| 236 | - }, | ||
| 237 | - | ||
| 238 | - // GC - 宏挚家传保险计划 | ||
| 239 | - 'savings-gc': { | ||
| 240 | - name: '宏挚家传保险计划', | ||
| 241 | - component: 'SavingsTemplate', | ||
| 242 | - category: 'savings', | ||
| 243 | - config: { | ||
| 244 | - currency: 'USD', | ||
| 245 | - payment_periods: [ | ||
| 246 | - '整付', | ||
| 247 | - '3 年', | ||
| 248 | - '5 年', | ||
| 249 | - ], | ||
| 250 | - age_range: { min: 0, max: 100 }, | ||
| 251 | - insurance_period: '终身', | ||
| 252 | - withdrawal_plan: { | ||
| 253 | - enabled: true, | ||
| 254 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 255 | - default_currency: 'USD', // 统一为美元 | ||
| 256 | - withdrawal_modes: ['指定提取金额', '最高固定提取金额'], | ||
| 257 | - withdrawal_periods: [ | ||
| 258 | - '1年', | ||
| 259 | - '2年', | ||
| 260 | - '3年', | ||
| 261 | - '5年', | ||
| 262 | - '10年', | ||
| 263 | - '15年', | ||
| 264 | - '20年', | ||
| 265 | - '终身' | ||
| 266 | - ] | ||
| 267 | - }, | ||
| 268 | - form_schema: savingsFormSchema, | ||
| 269 | - submit_mapping: savingsSubmitMapping | ||
| 270 | - } | ||
| 271 | - }, | ||
| 272 | - | ||
| 273 | - // FA - 宏浚传承保障计划 | ||
| 274 | - 'savings-fa': { | ||
| 275 | - name: '宏浚传承保障计划', | ||
| 276 | - component: 'SavingsTemplate', | ||
| 277 | - category: 'savings', | ||
| 278 | - config: { | ||
| 279 | - currency: 'USD', | ||
| 280 | - payment_periods: [ | ||
| 281 | - '整付', | ||
| 282 | - '2 年', | ||
| 283 | - '5 年', | ||
| 284 | - ], | ||
| 285 | - age_range: { min: 0, max: 100 }, | ||
| 286 | - insurance_period: '终身', | ||
| 287 | - withdrawal_plan: { | ||
| 288 | - enabled: true, | ||
| 289 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 290 | - default_currency: 'USD', // 统一为美元 | ||
| 291 | - withdrawal_modes: ['指定提取金额', '最高固定提取金额'], | ||
| 292 | - withdrawal_periods: [ | ||
| 293 | - '1年', | ||
| 294 | - '2年', | ||
| 295 | - '3年', | ||
| 296 | - '5年', | ||
| 297 | - '10年', | ||
| 298 | - '15年', | ||
| 299 | - '20年', | ||
| 300 | - '终身' | ||
| 301 | - ] | ||
| 302 | - }, | ||
| 303 | - form_schema: savingsFormSchema, | ||
| 304 | - submit_mapping: savingsSubmitMapping | ||
| 305 | - } | ||
| 306 | - }, | ||
| 307 | - | ||
| 308 | - // LV2 - 赤霞珠终身寿险计划2(储蓄型终身寿险) | ||
| 309 | - 'savings-lv2': { | ||
| 310 | - name: '赤霞珠终身寿险计划2', | ||
| 311 | - component: 'SavingsTemplate', | ||
| 312 | - category: 'savings', | ||
| 313 | - config: { | ||
| 314 | - currency: 'USD', | ||
| 315 | - payment_periods: [ | ||
| 316 | - '5 年', | ||
| 317 | - '8 年', | ||
| 318 | - '12 年', | ||
| 319 | - '15 年', | ||
| 320 | - ], | ||
| 321 | - age_range: { min: 0, max: 100 }, | ||
| 322 | - insurance_period: '终身', | ||
| 323 | - withdrawal_plan: { | ||
| 324 | - enabled: true, | ||
| 325 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 326 | - default_currency: 'USD', // 统一为美元 | ||
| 327 | - withdrawal_modes: ['指定提取金额', '最高固定提取金额'], | ||
| 328 | - withdrawal_periods: [ | ||
| 329 | - '1年', | ||
| 330 | - '2年', | ||
| 331 | - '3年', | ||
| 332 | - '5年', | ||
| 333 | - '10年', | ||
| 334 | - '15年', | ||
| 335 | - '20年', | ||
| 336 | - '终身' | ||
| 337 | - ] | ||
| 338 | - }, | ||
| 339 | - form_schema: savingsFormSchema, | ||
| 340 | - submit_mapping: savingsSubmitMapping | ||
| 341 | - } | ||
| 342 | - }, | ||
| 343 | - | ||
| 344 | - /** | ||
| 345 | - * 测试计划书-智享未来 | ||
| 346 | - * @added 2026-02-14T13:10:33.924Z | ||
| 347 | - * @source docs/to-parse/测试计划书-智享未来.md | ||
| 348 | - */ | ||
| 349 | - 'savings-product-30b41aae': { | ||
| 350 | - name: '测试计划书-智享未来', | ||
| 351 | - component: 'SavingsTemplate', | ||
| 352 | - category: 'savings', | ||
| 353 | - config: { | ||
| 354 | - currency: 'USD', | ||
| 355 | - payment_periods: ["整付", "3年", "5年"], | ||
| 356 | - age_range: { min: 0, max: 75 }, | ||
| 357 | - insurance_period: '终身', | ||
| 358 | - withdrawal_plan: { | ||
| 359 | - enabled: true, | ||
| 360 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 361 | - default_currency: 'USD', | ||
| 362 | - withdrawal_modes: ["年龄指定金额", "最高固定金额"], | ||
| 363 | - withdrawal_periods: ["1年", "3年", "5年", "10年"] | ||
| 364 | - }, | ||
| 365 | - form_schema: savingsFormSchema, | ||
| 366 | - submit_mapping: savingsSubmitMapping | ||
| 367 | - } | ||
| 368 | - }, | ||
| 369 | - | ||
| 370 | - /** | ||
| 371 | - * 测试计划书-智享未来2 | ||
| 372 | - * @added 2026-02-14T13:58:50.776Z | ||
| 373 | - * @source docs/to-parse/测试计划书-智享未来2.md | ||
| 374 | - */ | ||
| 375 | - 'savings-2-148b3acd': { | ||
| 376 | - name: '测试计划书-智享未来2', | ||
| 377 | - component: 'SavingsTemplate', | ||
| 378 | - category: 'savings', | ||
| 379 | - config: { | ||
| 380 | - currency: 'USD', | ||
| 381 | - payment_periods: ["整付","3年","5年"], | ||
| 382 | - age_range: { min: 0, max: 75 }, | ||
| 383 | - insurance_period: '终身', | ||
| 384 | - withdrawal_plan: { | ||
| 385 | - enabled: true, | ||
| 386 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 387 | - default_currency: 'USD', | ||
| 388 | - withdrawal_modes: ["年龄指定金额","最高固定金额"], | ||
| 389 | - withdrawal_periods: ["1年","3年","5年","10年"] | ||
| 390 | - }, | ||
| 391 | - form_schema: { | ||
| 392 | - "base_fields": [], | ||
| 393 | - "withdrawal_fields": [], | ||
| 394 | - "reset_map": {} | ||
| 395 | - }, | ||
| 396 | - submit_mapping: savingsSubmitMapping | ||
| 397 | - } | ||
| 398 | - }} | ||
| 399 | - | ||
| 400 | -/** | ||
| 401 | - * 全局功能开关 | ||
| 402 | - * @description 用于控制实验性功能或未来扩展功能的开关 | ||
| 403 | - * | ||
| 404 | - * @example 开启多币种功能:设置 MULTI_CURRENCY_ENABLED = true | ||
| 405 | - */ | ||
| 406 | -export const FEATURE_FLAGS = { | ||
| 407 | - /** | ||
| 408 | - * 多币种切换功能 | ||
| 409 | - * @description false: 方案 1 - 固定币种(当前实现) | ||
| 410 | - * true: 方案 2 - 支持多币种切换(未来扩展) | ||
| 411 | - * @type {boolean} | ||
| 412 | - */ | ||
| 413 | - MULTI_CURRENCY_ENABLED: false | ||
| 414 | -} | ||
| 415 | - | ||
| 416 | -/** | ||
| 417 | - * 币种符号映射 | ||
| 418 | - * @description 币种代码到符号的映射关系 | ||
| 419 | - */ | ||
| 420 | -export const CURRENCY_SYMBOLS = { | ||
| 421 | - CNY: '¥', // 人民币 | ||
| 422 | - USD: '$', // 美元 | ||
| 423 | - HKD: 'HK$', // 港币 | ||
| 424 | - EUR: '€' // 欧元 | ||
| 425 | -} | ||
| 426 | - | ||
| 427 | -/** | ||
| 428 | - * 币种完整信息映射 | ||
| 429 | - * @description 币种代码到完整信息的映射(用于多币种模式) | ||
| 430 | - */ | ||
| 431 | -export const CURRENCY_MAP = { | ||
| 432 | - CNY: { label: '人民币', symbol: '¥', value: 'CNY' }, | ||
| 433 | - USD: { label: '美元', symbol: '$', value: 'USD' }, | ||
| 434 | - HKD: { label: '港币', symbol: 'HK$', value: 'HKD' }, | ||
| 435 | - EUR: { label: '欧元', symbol: '€', value: 'EUR' } | ||
| 436 | -} | ||
| 437 | - | ||
| 438 | -/** | ||
| 439 | - * 根据 form_sn 获取模版配置 | ||
| 440 | - * @param {string} formSn - 产品 API 返回的 form_sn 字段 | ||
| 441 | - * @returns {Object|null} 模版配置对象,未找到返回 null | ||
| 442 | - * | ||
| 443 | - * @example | ||
| 444 | - * const config = getTemplateConfig('life-insurance-wiop3e') | ||
| 445 | - * // 返回: { name: 'WIOP3E...', component: 'LifeInsuranceTemplate', config: {...} } | ||
| 446 | - */ | ||
| 447 | -export function getTemplateConfig(formSn) { | ||
| 448 | - if (!formSn) { | ||
| 449 | - console.warn('[plan-templates] form_sn 为空') | ||
| 450 | - return null | ||
| 451 | - } | ||
| 452 | - | ||
| 453 | - const config = PLAN_TEMPLATES[formSn] | ||
| 454 | - if (!config) { | ||
| 455 | - console.error(`[plan-templates] 未找到模版配置: ${formSn}`) | ||
| 456 | - return null | ||
| 457 | - } | ||
| 458 | - | ||
| 459 | - return config | ||
| 460 | -} | ||
| 461 | - | ||
| 462 | -/** | ||
| 463 | - * 获取币种符号 | ||
| 464 | - * @param {string} currencyCode - 币种代码(CNY/USD/HKD/EUR) | ||
| 465 | - * @returns {string} 币种符号 | ||
| 466 | - * | ||
| 467 | - * @example | ||
| 468 | - * const symbol = getCurrencySymbol('USD') // 返回: '$' | ||
| 469 | - */ | ||
| 470 | -export function getCurrencySymbol(currencyCode) { | ||
| 471 | - return CURRENCY_SYMBOLS[currencyCode] || '¥' | ||
| 472 | -} |
| 1 | -/** | ||
| 2 | - * 计划书模版配置 | ||
| 3 | - * | ||
| 4 | - * @description 定义产品 form_sn 到模版组件和配置的映射关系 | ||
| 5 | - * @module config/plan-templates | ||
| 6 | - * @author Claude Code | ||
| 7 | - * @created 2026-02-06 | ||
| 8 | - * @updated 2026-02-13 - 新增文档解析工具入口 | ||
| 9 | - * | ||
| 10 | - * --- 快速添加新产品(开发工具) --- | ||
| 11 | - * 开发环境可使用以下工具快速添加新产品配置: | ||
| 12 | - * 1. 文档解析工具:/admin/document-parser/index (上传 PDF/Word,AI 自动解析) | ||
| 13 | - * 2. API 配置工具:/admin/document-parser/config (配置 AI 服务) | ||
| 14 | - * | ||
| 15 | - * 使用方式: | ||
| 16 | - * - 上传产品文档 → AI 自动提取配置 → 生成配置代码 → 复制到此文件 | ||
| 17 | - * | ||
| 18 | - * --- 手动添加步骤 --- | ||
| 19 | - * 1. 找到对应的产品分类(人寿/重疾/储蓄) | ||
| 20 | - * 2. 复制现有配置作为模板 | ||
| 21 | - * 3. 修改 name, currency, payment_periods, age_range 等字段 | ||
| 22 | - * 4. 确保 form_sn 唯一(建议使用产品英文标识 + 版本号) | ||
| 23 | - */ | ||
| 24 | - | ||
| 25 | -/** | ||
| 26 | - * 计划书模版配置映射 | ||
| 27 | - * @description form_sn 为产品 API 返回的字段,用于标识该产品使用的计划书模版 | ||
| 28 | - * | ||
| 29 | - * @example | ||
| 30 | - * // 产品 API 返回 | ||
| 31 | - * { | ||
| 32 | - * id: 1, | ||
| 33 | - * product_name: "WIOP3E 盈传创富保障计划 3 - 优选版", | ||
| 34 | - * form_sn: "life-insurance-wiop3e" // 对应下面的配置 key | ||
| 35 | - * } | ||
| 36 | - */ | ||
| 37 | -// 基础提交字段映射(适用于人寿/重疾等通用表单) | ||
| 38 | -const baseSubmitMapping = { | ||
| 39 | - customer_name: { api_field: 'customer_name' }, | ||
| 40 | - gender: { api_field: 'customer_gender' }, | ||
| 41 | - birthday: { api_field: 'customer_birthday' }, | ||
| 42 | - smoker: { api_field: 'smoking_status' }, | ||
| 43 | - coverage: { api_field: 'annual_premium', transform: 'fen_to_yuan' }, | ||
| 44 | - payment_period: { api_field: 'payment_years' }, | ||
| 45 | - total_amount: { api_field: 'total_premium', transform: 'fen_to_yuan' } | ||
| 46 | -} | ||
| 47 | - | ||
| 48 | -// 人寿/重疾基础表单 Schema(通用保障类) | ||
| 49 | -const protectionFormSchema = { | ||
| 50 | - base_fields: [ | ||
| 51 | - { id: 'customer_name', key: 'customer_name', type: 'name', label: '申请人', placeholder: '请输入申请人', required: true }, | ||
| 52 | - { id: 'gender', key: 'gender', type: 'radio', label: '性别', options: ['男', '女'], required: true }, | ||
| 53 | - { id: 'birthday', key: 'birthday', type: 'date', label: '出生年月日', placeholder: '请选择年月日', required: true }, | ||
| 54 | - { id: 'smoker', key: 'smoker', type: 'radio', label: '是否吸烟', options: ['是', '否'], required: true }, | ||
| 55 | - { id: 'coverage', key: 'coverage', type: 'amount', label: '保额', placeholder: '请输入保额', input_label: '请输入保额金额', required: true, currency_from: 'currency' }, | ||
| 56 | - { id: 'payment_period', key: 'payment_period', type: 'payment_period', label: '缴费年期', required: true, options_from: 'payment_periods' } | ||
| 57 | - ] | ||
| 58 | -} | ||
| 59 | - | ||
| 60 | -// 储蓄类提交字段映射(在基础映射上追加提取计划字段) | ||
| 61 | -const savingsSubmitMapping = { | ||
| 62 | - ...baseSubmitMapping, | ||
| 63 | - withdrawal_enabled: { api_field: 'allow_reduce_amount' }, | ||
| 64 | - withdrawal_mode: { api_field: 'withdrawal_option' }, | ||
| 65 | - withdrawal_method: { api_field: 'withdrawal_method' }, | ||
| 66 | - annual_withdrawal_amount: { api_field: 'annual_withdrawal_amount', transform: 'fen_to_yuan' }, | ||
| 67 | - annual_increase_percentage: { api_field: 'annual_increase_percentage' }, | ||
| 68 | - withdrawal_start_age_specified: { api_field: 'withdrawal_start_age' }, | ||
| 69 | - withdrawal_period_specified: { api_field: 'withdrawal_period' }, | ||
| 70 | - withdrawal_start_age_fixed: { api_field: 'withdrawal_start_age' }, | ||
| 71 | - withdrawal_period_fixed: { api_field: 'withdrawal_period' } | ||
| 72 | -} | ||
| 73 | - | ||
| 74 | -// 储蓄类表单 Schema(渲染 + 校验 + 联动的唯一入口) | ||
| 75 | -const savingsFormSchema = { | ||
| 76 | - // 基础字段:非提取计划部分 | ||
| 77 | - base_fields: [ | ||
| 78 | - { id: 'customer_name', key: 'customer_name', type: 'name', label: '申请人', placeholder: '请输入申请人', required: true }, | ||
| 79 | - { id: 'gender', key: 'gender', type: 'radio', label: '性别', options: ['男', '女'], required: true }, | ||
| 80 | - { id: 'birthday', key: 'birthday', type: 'date', label: '出生年月日', placeholder: '请选择年月日', required: true }, | ||
| 81 | - { id: 'smoker', key: 'smoker', type: 'radio', label: '是否吸烟', options: ['是', '否'], required: true }, | ||
| 82 | - { id: 'coverage', key: 'coverage', type: 'amount', label: '年缴保费', placeholder: '请输入年缴保费', input_label: '请输入年缴保费金额', required: true, currency_from: 'currency' }, | ||
| 83 | - { id: 'payment_period', key: 'payment_period', type: 'payment_period', label: '缴费年期', required: true, options_from: 'payment_periods' } | ||
| 84 | - ], | ||
| 85 | - // 提取计划字段:由 withdrawal_plan 开关控制 | ||
| 86 | - withdrawal_fields: [ | ||
| 87 | - { id: 'withdrawal_enabled', key: 'withdrawal_enabled', type: 'radio', label: '是否希望生成一份允许减少名义金额的提取说明?', options: ['是', '否'], required: true, default: '否' }, | ||
| 88 | - { id: 'withdrawal_mode', key: 'withdrawal_mode', type: 'radio', label: '提取选项', options: ['指定提取金额', '最高固定提取金额'], required: true, default: '指定提取金额', section_title: '款项提取(允许减少名义金额)' }, | ||
| 89 | - { id: 'withdrawal_method', key: 'withdrawal_method', type: 'radio', label: '提取方式', options: ['按年岁'], required: true, default: '按年岁', show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 90 | - { id: 'annual_withdrawal_amount', key: 'annual_withdrawal_amount', type: 'amount', label: '每年提取金额', placeholder: '请输入每年提取金额', input_label: '请输入每年提取金额', required: true, currency_from: 'withdrawal_plan.default_currency', show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 91 | - { id: 'withdrawal_start_age_specified', key: 'withdrawal_start_age_specified', type: 'age', label: '由几岁开始', placeholder: '请输入开始提取年龄', required: true, show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 92 | - { id: 'withdrawal_period_specified', key: 'withdrawal_period_specified', type: 'select', label: '提取期(年)', placeholder: '请选择提取期', required: true, options_from: 'withdrawal_plan.withdrawal_periods', show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 93 | - { id: 'annual_increase_percentage', key: 'annual_increase_percentage', type: 'percentage', label: '每年递增提取之百分比(%)', placeholder: '请输入递增百分比', required: true, show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 94 | - { id: 'withdrawal_start_age_fixed', key: 'withdrawal_start_age_fixed', type: 'age', label: '按年岁:由几岁开始', placeholder: '请输入开始提取年龄', required: true, show_when: [{ field: 'withdrawal_mode', equals: '最高固定提取金额' }] }, | ||
| 95 | - { id: 'withdrawal_period_fixed', key: 'withdrawal_period_fixed', type: 'select', label: '按年岁:提取期(年)', placeholder: '请选择提取期', required: true, options_from: 'withdrawal_plan.withdrawal_periods', show_when: [{ field: 'withdrawal_mode', equals: '最高固定提取金额' }] } | ||
| 96 | - ], | ||
| 97 | - // 提取模式切换时的清空逻辑,避免脏字段影响提交 | ||
| 98 | - reset_map: { | ||
| 99 | - withdrawal_mode: { | ||
| 100 | - '最高固定提取金额': ['annual_withdrawal_amount', 'annual_increase_percentage', 'withdrawal_start_age_specified', 'withdrawal_period_specified'], | ||
| 101 | - '指定提取金额': ['withdrawal_start_age_fixed', 'withdrawal_period_fixed'] | ||
| 102 | - } | ||
| 103 | - } | ||
| 104 | -} | ||
| 105 | - | ||
| 106 | -export const PLAN_TEMPLATES = { | ||
| 107 | - // 人寿保险产品 - WIOP3E | ||
| 108 | - 'life-insurance-wiop3e': { | ||
| 109 | - name: 'WIOP3E 盈传创富保障计划 3 - 优选版', | ||
| 110 | - component: 'LifeInsuranceTemplate', | ||
| 111 | - config: { | ||
| 112 | - currency: 'USD', // 币种:USD/CNY/HKD/EUR | ||
| 113 | - payment_periods: [ | ||
| 114 | - // 缴费年期选项 | ||
| 115 | - '整付(0-75 岁)', | ||
| 116 | - '5 年(0-70 岁)', | ||
| 117 | - '10 年(0-70 岁)' | ||
| 118 | - ], | ||
| 119 | - age_range: { min: 0, max: 75 }, // 年龄范围 | ||
| 120 | - insurance_period: '终身', // 保险期间 | ||
| 121 | - form_schema: protectionFormSchema, | ||
| 122 | - submit_mapping: baseSubmitMapping | ||
| 123 | - } | ||
| 124 | - }, | ||
| 125 | - | ||
| 126 | - // 人寿保险产品 - WIOP3 | ||
| 127 | - 'life-insurance-wiop3': { | ||
| 128 | - name: 'WIOP3 - 盈传创富保障计划 3', | ||
| 129 | - component: 'LifeInsuranceTemplate', | ||
| 130 | - config: { | ||
| 131 | - currency: 'USD', | ||
| 132 | - payment_periods: [ | ||
| 133 | - '整付(0-75 岁)', | ||
| 134 | - '5 年(0-70 岁)', | ||
| 135 | - '10 年(0-70 岁)' | ||
| 136 | - ], | ||
| 137 | - age_range: { min: 0, max: 75 }, | ||
| 138 | - insurance_period: '终身', | ||
| 139 | - form_schema: protectionFormSchema, | ||
| 140 | - submit_mapping: baseSubmitMapping | ||
| 141 | - } | ||
| 142 | - }, | ||
| 143 | - | ||
| 144 | - // 重疾保险产品 - MPC | ||
| 145 | - 'critical-illness-mpc': { | ||
| 146 | - name: 'MPC 守护无间重疾', | ||
| 147 | - component: 'CriticalIllnessTemplate', | ||
| 148 | - config: { | ||
| 149 | - currency: 'USD', | ||
| 150 | - payment_periods: [ | ||
| 151 | - '10 年(15 日 - 65 岁)', | ||
| 152 | - '20 年(15 日 - 65 岁)', | ||
| 153 | - '25 年(15 日 - 60 岁)' | ||
| 154 | - ], | ||
| 155 | - age_range: { min: 0, max: 65 }, | ||
| 156 | - insurance_period: '终身', | ||
| 157 | - form_schema: protectionFormSchema, | ||
| 158 | - submit_mapping: baseSubmitMapping | ||
| 159 | - } | ||
| 160 | - }, | ||
| 161 | - | ||
| 162 | - // 重疾保险产品 - MBC PRO | ||
| 163 | - 'critical-illness-mbc-pro': { | ||
| 164 | - name: 'MBC PRO 活跃人生重疾保 PRO', | ||
| 165 | - component: 'CriticalIllnessTemplate', | ||
| 166 | - config: { | ||
| 167 | - currency: 'USD', | ||
| 168 | - payment_periods: [ | ||
| 169 | - '10 年(15 日 - 65 岁)', | ||
| 170 | - '20 年(15 日 - 65 岁)', | ||
| 171 | - '25 年(15 日 - 60 岁)' | ||
| 172 | - ], | ||
| 173 | - age_range: { min: 0, max: 65 }, | ||
| 174 | - insurance_period: '终身', | ||
| 175 | - form_schema: protectionFormSchema, | ||
| 176 | - submit_mapping: baseSubmitMapping | ||
| 177 | - } | ||
| 178 | - }, | ||
| 179 | - | ||
| 180 | - // 重疾保险产品 - MBC2 | ||
| 181 | - 'critical-illness-mbc2': { | ||
| 182 | - name: 'MBC2 活跃人生重疾保 2', | ||
| 183 | - component: 'CriticalIllnessTemplate', | ||
| 184 | - config: { | ||
| 185 | - currency: 'USD', | ||
| 186 | - payment_periods: [ | ||
| 187 | - '10 年(15 日 - 65 岁)', | ||
| 188 | - '20 年(15 日 - 65 岁)', | ||
| 189 | - '25 年(15 日 - 60 岁)' | ||
| 190 | - ], | ||
| 191 | - age_range: { min: 0, max: 65 }, | ||
| 192 | - insurance_period: '终身', | ||
| 193 | - form_schema: protectionFormSchema, | ||
| 194 | - submit_mapping: baseSubmitMapping | ||
| 195 | - } | ||
| 196 | - }, | ||
| 197 | - | ||
| 198 | - // ====== 储蓄型产品(统一逻辑) ====== | ||
| 199 | - | ||
| 200 | - // GS - 宏挚传承保障计划 | ||
| 201 | - 'savings-gs': { | ||
| 202 | - name: '宏挚传承保障计划', | ||
| 203 | - component: 'SavingsTemplate', | ||
| 204 | - category: 'savings', // 储蓄型产品 | ||
| 205 | - config: { | ||
| 206 | - currency: 'USD', // 默认美元 | ||
| 207 | - payment_periods: [ | ||
| 208 | - '整付', | ||
| 209 | - '3 年', | ||
| 210 | - '5 年', | ||
| 211 | - '10 年', | ||
| 212 | - '15 年', | ||
| 213 | - ], | ||
| 214 | - age_range: { min: 0, max: 100 }, | ||
| 215 | - insurance_period: '终身', | ||
| 216 | - // 提取计划配置 | ||
| 217 | - withdrawal_plan: { | ||
| 218 | - enabled: true, | ||
| 219 | - currencies: ['HKD', 'USD', 'CNY'], // 支持的币种 | ||
| 220 | - default_currency: 'USD', // 统一为美元 | ||
| 221 | - withdrawal_modes: ['指定提取金额', '最高固定提取金额'], | ||
| 222 | - withdrawal_periods: [ | ||
| 223 | - '1年', | ||
| 224 | - '2年', | ||
| 225 | - '3年', | ||
| 226 | - '5年', | ||
| 227 | - '10年', | ||
| 228 | - '15年', | ||
| 229 | - '20年', | ||
| 230 | - '终身' | ||
| 231 | - ] | ||
| 232 | - }, | ||
| 233 | - form_schema: savingsFormSchema, | ||
| 234 | - submit_mapping: savingsSubmitMapping | ||
| 235 | - } | ||
| 236 | - }, | ||
| 237 | - | ||
| 238 | - // GC - 宏挚家传保险计划 | ||
| 239 | - 'savings-gc': { | ||
| 240 | - name: '宏挚家传保险计划', | ||
| 241 | - component: 'SavingsTemplate', | ||
| 242 | - category: 'savings', | ||
| 243 | - config: { | ||
| 244 | - currency: 'USD', | ||
| 245 | - payment_periods: [ | ||
| 246 | - '整付', | ||
| 247 | - '3 年', | ||
| 248 | - '5 年', | ||
| 249 | - ], | ||
| 250 | - age_range: { min: 0, max: 100 }, | ||
| 251 | - insurance_period: '终身', | ||
| 252 | - withdrawal_plan: { | ||
| 253 | - enabled: true, | ||
| 254 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 255 | - default_currency: 'USD', // 统一为美元 | ||
| 256 | - withdrawal_modes: ['指定提取金额', '最高固定提取金额'], | ||
| 257 | - withdrawal_periods: [ | ||
| 258 | - '1年', | ||
| 259 | - '2年', | ||
| 260 | - '3年', | ||
| 261 | - '5年', | ||
| 262 | - '10年', | ||
| 263 | - '15年', | ||
| 264 | - '20年', | ||
| 265 | - '终身' | ||
| 266 | - ] | ||
| 267 | - }, | ||
| 268 | - form_schema: savingsFormSchema, | ||
| 269 | - submit_mapping: savingsSubmitMapping | ||
| 270 | - } | ||
| 271 | - }, | ||
| 272 | - | ||
| 273 | - // FA - 宏浚传承保障计划 | ||
| 274 | - 'savings-fa': { | ||
| 275 | - name: '宏浚传承保障计划', | ||
| 276 | - component: 'SavingsTemplate', | ||
| 277 | - category: 'savings', | ||
| 278 | - config: { | ||
| 279 | - currency: 'USD', | ||
| 280 | - payment_periods: [ | ||
| 281 | - '整付', | ||
| 282 | - '2 年', | ||
| 283 | - '5 年', | ||
| 284 | - ], | ||
| 285 | - age_range: { min: 0, max: 100 }, | ||
| 286 | - insurance_period: '终身', | ||
| 287 | - withdrawal_plan: { | ||
| 288 | - enabled: true, | ||
| 289 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 290 | - default_currency: 'USD', // 统一为美元 | ||
| 291 | - withdrawal_modes: ['指定提取金额', '最高固定提取金额'], | ||
| 292 | - withdrawal_periods: [ | ||
| 293 | - '1年', | ||
| 294 | - '2年', | ||
| 295 | - '3年', | ||
| 296 | - '5年', | ||
| 297 | - '10年', | ||
| 298 | - '15年', | ||
| 299 | - '20年', | ||
| 300 | - '终身' | ||
| 301 | - ] | ||
| 302 | - }, | ||
| 303 | - form_schema: savingsFormSchema, | ||
| 304 | - submit_mapping: savingsSubmitMapping | ||
| 305 | - } | ||
| 306 | - }, | ||
| 307 | - | ||
| 308 | - // LV2 - 赤霞珠终身寿险计划2(储蓄型终身寿险) | ||
| 309 | - 'savings-lv2': { | ||
| 310 | - name: '赤霞珠终身寿险计划2', | ||
| 311 | - component: 'SavingsTemplate', | ||
| 312 | - category: 'savings', | ||
| 313 | - config: { | ||
| 314 | - currency: 'USD', | ||
| 315 | - payment_periods: [ | ||
| 316 | - '5 年', | ||
| 317 | - '8 年', | ||
| 318 | - '12 年', | ||
| 319 | - '15 年', | ||
| 320 | - ], | ||
| 321 | - age_range: { min: 0, max: 100 }, | ||
| 322 | - insurance_period: '终身', | ||
| 323 | - withdrawal_plan: { | ||
| 324 | - enabled: true, | ||
| 325 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 326 | - default_currency: 'USD', // 统一为美元 | ||
| 327 | - withdrawal_modes: ['指定提取金额', '最高固定提取金额'], | ||
| 328 | - withdrawal_periods: [ | ||
| 329 | - '1年', | ||
| 330 | - '2年', | ||
| 331 | - '3年', | ||
| 332 | - '5年', | ||
| 333 | - '10年', | ||
| 334 | - '15年', | ||
| 335 | - '20年', | ||
| 336 | - '终身' | ||
| 337 | - ] | ||
| 338 | - }, | ||
| 339 | - form_schema: savingsFormSchema, | ||
| 340 | - submit_mapping: savingsSubmitMapping | ||
| 341 | - } | ||
| 342 | - }, | ||
| 343 | - | ||
| 344 | - /** | ||
| 345 | - * 测试计划书-智享未来 | ||
| 346 | - * @added 2026-02-14T13:10:33.924Z | ||
| 347 | - * @source docs/to-parse/测试计划书-智享未来.md | ||
| 348 | - */ | ||
| 349 | - 'savings-product-30b41aae': { | ||
| 350 | - name: '测试计划书-智享未来', | ||
| 351 | - component: 'SavingsTemplate', | ||
| 352 | - category: 'savings', | ||
| 353 | - config: { | ||
| 354 | - currency: 'USD', | ||
| 355 | - payment_periods: ["整付", "3年", "5年"], | ||
| 356 | - age_range: { min: 0, max: 75 }, | ||
| 357 | - insurance_period: '终身', | ||
| 358 | - withdrawal_plan: { | ||
| 359 | - enabled: true, | ||
| 360 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 361 | - default_currency: 'USD', | ||
| 362 | - withdrawal_modes: ["年龄指定金额", "最高固定金额"], | ||
| 363 | - withdrawal_periods: ["1年", "3年", "5年", "10年"] | ||
| 364 | - }, | ||
| 365 | - form_schema: savingsFormSchema, | ||
| 366 | - submit_mapping: savingsSubmitMapping | ||
| 367 | - } | ||
| 368 | - }, | ||
| 369 | - | ||
| 370 | -} | ||
| 371 | - | ||
| 372 | -/** | ||
| 373 | - * 全局功能开关 | ||
| 374 | - * @description 用于控制实验性功能或未来扩展功能的开关 | ||
| 375 | - * | ||
| 376 | - * @example 开启多币种功能:设置 MULTI_CURRENCY_ENABLED = true | ||
| 377 | - */ | ||
| 378 | -export const FEATURE_FLAGS = { | ||
| 379 | - /** | ||
| 380 | - * 多币种切换功能 | ||
| 381 | - * @description false: 方案 1 - 固定币种(当前实现) | ||
| 382 | - * true: 方案 2 - 支持多币种切换(未来扩展) | ||
| 383 | - * @type {boolean} | ||
| 384 | - */ | ||
| 385 | - MULTI_CURRENCY_ENABLED: false | ||
| 386 | -} | ||
| 387 | - | ||
| 388 | -/** | ||
| 389 | - * 币种符号映射 | ||
| 390 | - * @description 币种代码到符号的映射关系 | ||
| 391 | - */ | ||
| 392 | -export const CURRENCY_SYMBOLS = { | ||
| 393 | - CNY: '¥', // 人民币 | ||
| 394 | - USD: '$', // 美元 | ||
| 395 | - HKD: 'HK$', // 港币 | ||
| 396 | - EUR: '€' // 欧元 | ||
| 397 | -} | ||
| 398 | - | ||
| 399 | -/** | ||
| 400 | - * 币种完整信息映射 | ||
| 401 | - * @description 币种代码到完整信息的映射(用于多币种模式) | ||
| 402 | - */ | ||
| 403 | -export const CURRENCY_MAP = { | ||
| 404 | - CNY: { label: '人民币', symbol: '¥', value: 'CNY' }, | ||
| 405 | - USD: { label: '美元', symbol: '$', value: 'USD' }, | ||
| 406 | - HKD: { label: '港币', symbol: 'HK$', value: 'HKD' }, | ||
| 407 | - EUR: { label: '欧元', symbol: '€', value: 'EUR' } | ||
| 408 | -} | ||
| 409 | - | ||
| 410 | -/** | ||
| 411 | - * 根据 form_sn 获取模版配置 | ||
| 412 | - * @param {string} formSn - 产品 API 返回的 form_sn 字段 | ||
| 413 | - * @returns {Object|null} 模版配置对象,未找到返回 null | ||
| 414 | - * | ||
| 415 | - * @example | ||
| 416 | - * const config = getTemplateConfig('life-insurance-wiop3e') | ||
| 417 | - * // 返回: { name: 'WIOP3E...', component: 'LifeInsuranceTemplate', config: {...} } | ||
| 418 | - */ | ||
| 419 | -export function getTemplateConfig(formSn) { | ||
| 420 | - if (!formSn) { | ||
| 421 | - console.warn('[plan-templates] form_sn 为空') | ||
| 422 | - return null | ||
| 423 | - } | ||
| 424 | - | ||
| 425 | - const config = PLAN_TEMPLATES[formSn] | ||
| 426 | - if (!config) { | ||
| 427 | - console.error(`[plan-templates] 未找到模版配置: ${formSn}`) | ||
| 428 | - return null | ||
| 429 | - } | ||
| 430 | - | ||
| 431 | - return config | ||
| 432 | -} | ||
| 433 | - | ||
| 434 | -/** | ||
| 435 | - * 获取币种符号 | ||
| 436 | - * @param {string} currencyCode - 币种代码(CNY/USD/HKD/EUR) | ||
| 437 | - * @returns {string} 币种符号 | ||
| 438 | - * | ||
| 439 | - * @example | ||
| 440 | - * const symbol = getCurrencySymbol('USD') // 返回: '$' | ||
| 441 | - */ | ||
| 442 | -export function getCurrencySymbol(currencyCode) { | ||
| 443 | - return CURRENCY_SYMBOLS[currencyCode] || '¥' | ||
| 444 | -} |
| 1 | -/** | ||
| 2 | - * 计划书模版配置 | ||
| 3 | - * | ||
| 4 | - * @description 定义产品 form_sn 到模版组件和配置的映射关系 | ||
| 5 | - * @module config/plan-templates | ||
| 6 | - * @author Claude Code | ||
| 7 | - * @created 2026-02-06 | ||
| 8 | - * @updated 2026-02-13 - 新增文档解析工具入口 | ||
| 9 | - * | ||
| 10 | - * --- 快速添加新产品(开发工具) --- | ||
| 11 | - * 开发环境可使用以下工具快速添加新产品配置: | ||
| 12 | - * 1. 文档解析工具:/admin/document-parser/index (上传 PDF/Word,AI 自动解析) | ||
| 13 | - * 2. API 配置工具:/admin/document-parser/config (配置 AI 服务) | ||
| 14 | - * | ||
| 15 | - * 使用方式: | ||
| 16 | - * - 上传产品文档 → AI 自动提取配置 → 生成配置代码 → 复制到此文件 | ||
| 17 | - * | ||
| 18 | - * --- 手动添加步骤 --- | ||
| 19 | - * 1. 找到对应的产品分类(人寿/重疾/储蓄) | ||
| 20 | - * 2. 复制现有配置作为模板 | ||
| 21 | - * 3. 修改 name, currency, payment_periods, age_range 等字段 | ||
| 22 | - * 4. 确保 form_sn 唯一(建议使用产品英文标识 + 版本号) | ||
| 23 | - */ | ||
| 24 | - | ||
| 25 | -/** | ||
| 26 | - * 计划书模版配置映射 | ||
| 27 | - * @description form_sn 为产品 API 返回的字段,用于标识该产品使用的计划书模版 | ||
| 28 | - * | ||
| 29 | - * @example | ||
| 30 | - * // 产品 API 返回 | ||
| 31 | - * { | ||
| 32 | - * id: 1, | ||
| 33 | - * product_name: "WIOP3E 盈传创富保障计划 3 - 优选版", | ||
| 34 | - * form_sn: "life-insurance-wiop3e" // 对应下面的配置 key | ||
| 35 | - * } | ||
| 36 | - */ | ||
| 37 | -// 基础提交字段映射(适用于人寿/重疾等通用表单) | ||
| 38 | -const baseSubmitMapping = { | ||
| 39 | - customer_name: { api_field: 'customer_name' }, | ||
| 40 | - gender: { api_field: 'customer_gender' }, | ||
| 41 | - birthday: { api_field: 'customer_birthday' }, | ||
| 42 | - smoker: { api_field: 'smoking_status' }, | ||
| 43 | - coverage: { api_field: 'annual_premium', transform: 'fen_to_yuan' }, | ||
| 44 | - payment_period: { api_field: 'payment_years' }, | ||
| 45 | - total_amount: { api_field: 'total_premium', transform: 'fen_to_yuan' } | ||
| 46 | -} | ||
| 47 | - | ||
| 48 | -// 人寿/重疾基础表单 Schema(通用保障类) | ||
| 49 | -const protectionFormSchema = { | ||
| 50 | - base_fields: [ | ||
| 51 | - { id: 'customer_name', key: 'customer_name', type: 'name', label: '申请人', placeholder: '请输入申请人', required: true }, | ||
| 52 | - { id: 'gender', key: 'gender', type: 'radio', label: '性别', options: ['男', '女'], required: true }, | ||
| 53 | - { id: 'birthday', key: 'birthday', type: 'date', label: '出生年月日', placeholder: '请选择年月日', required: true }, | ||
| 54 | - { id: 'smoker', key: 'smoker', type: 'radio', label: '是否吸烟', options: ['是', '否'], required: true }, | ||
| 55 | - { id: 'coverage', key: 'coverage', type: 'amount', label: '保额', placeholder: '请输入保额', input_label: '请输入保额金额', required: true, currency_from: 'currency' }, | ||
| 56 | - { id: 'payment_period', key: 'payment_period', type: 'payment_period', label: '缴费年期', required: true, options_from: 'payment_periods' } | ||
| 57 | - ] | ||
| 58 | -} | ||
| 59 | - | ||
| 60 | -// 储蓄类提交字段映射(在基础映射上追加提取计划字段) | ||
| 61 | -const savingsSubmitMapping = { | ||
| 62 | - ...baseSubmitMapping, | ||
| 63 | - withdrawal_enabled: { api_field: 'allow_reduce_amount' }, | ||
| 64 | - withdrawal_mode: { api_field: 'withdrawal_option' }, | ||
| 65 | - withdrawal_method: { api_field: 'withdrawal_method' }, | ||
| 66 | - annual_withdrawal_amount: { api_field: 'annual_withdrawal_amount', transform: 'fen_to_yuan' }, | ||
| 67 | - annual_increase_percentage: { api_field: 'annual_increase_percentage' }, | ||
| 68 | - withdrawal_start_age_specified: { api_field: 'withdrawal_start_age' }, | ||
| 69 | - withdrawal_period_specified: { api_field: 'withdrawal_period' }, | ||
| 70 | - withdrawal_start_age_fixed: { api_field: 'withdrawal_start_age' }, | ||
| 71 | - withdrawal_period_fixed: { api_field: 'withdrawal_period' } | ||
| 72 | -} | ||
| 73 | - | ||
| 74 | -// 储蓄类表单 Schema(渲染 + 校验 + 联动的唯一入口) | ||
| 75 | -const savingsFormSchema = { | ||
| 76 | - // 基础字段:非提取计划部分 | ||
| 77 | - base_fields: [ | ||
| 78 | - { id: 'customer_name', key: 'customer_name', type: 'name', label: '申请人', placeholder: '请输入申请人', required: true }, | ||
| 79 | - { id: 'gender', key: 'gender', type: 'radio', label: '性别', options: ['男', '女'], required: true }, | ||
| 80 | - { id: 'birthday', key: 'birthday', type: 'date', label: '出生年月日', placeholder: '请选择年月日', required: true }, | ||
| 81 | - { id: 'smoker', key: 'smoker', type: 'radio', label: '是否吸烟', options: ['是', '否'], required: true }, | ||
| 82 | - { id: 'coverage', key: 'coverage', type: 'amount', label: '年缴保费', placeholder: '请输入年缴保费', input_label: '请输入年缴保费金额', required: true, currency_from: 'currency' }, | ||
| 83 | - { id: 'payment_period', key: 'payment_period', type: 'payment_period', label: '缴费年期', required: true, options_from: 'payment_periods' } | ||
| 84 | - ], | ||
| 85 | - // 提取计划字段:由 withdrawal_plan 开关控制 | ||
| 86 | - withdrawal_fields: [ | ||
| 87 | - { id: 'withdrawal_enabled', key: 'withdrawal_enabled', type: 'radio', label: '是否希望生成一份允许减少名义金额的提取说明?', options: ['是', '否'], required: true, default: '否' }, | ||
| 88 | - { id: 'withdrawal_mode', key: 'withdrawal_mode', type: 'radio', label: '提取选项', options: ['指定提取金额', '最高固定提取金额'], required: true, default: '指定提取金额', section_title: '款项提取(允许减少名义金额)' }, | ||
| 89 | - { id: 'withdrawal_method', key: 'withdrawal_method', type: 'radio', label: '提取方式', options: ['按年岁'], required: true, default: '按年岁', show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 90 | - { id: 'annual_withdrawal_amount', key: 'annual_withdrawal_amount', type: 'amount', label: '每年提取金额', placeholder: '请输入每年提取金额', input_label: '请输入每年提取金额', required: true, currency_from: 'withdrawal_plan.default_currency', show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 91 | - { id: 'withdrawal_start_age_specified', key: 'withdrawal_start_age_specified', type: 'age', label: '由几岁开始', placeholder: '请输入开始提取年龄', required: true, show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 92 | - { id: 'withdrawal_period_specified', key: 'withdrawal_period_specified', type: 'select', label: '提取期(年)', placeholder: '请选择提取期', required: true, options_from: 'withdrawal_plan.withdrawal_periods', show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 93 | - { id: 'annual_increase_percentage', key: 'annual_increase_percentage', type: 'percentage', label: '每年递增提取之百分比(%)', placeholder: '请输入递增百分比', required: true, show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 94 | - { id: 'withdrawal_start_age_fixed', key: 'withdrawal_start_age_fixed', type: 'age', label: '按年岁:由几岁开始', placeholder: '请输入开始提取年龄', required: true, show_when: [{ field: 'withdrawal_mode', equals: '最高固定提取金额' }] }, | ||
| 95 | - { id: 'withdrawal_period_fixed', key: 'withdrawal_period_fixed', type: 'select', label: '按年岁:提取期(年)', placeholder: '请选择提取期', required: true, options_from: 'withdrawal_plan.withdrawal_periods', show_when: [{ field: 'withdrawal_mode', equals: '最高固定提取金额' }] } | ||
| 96 | - ], | ||
| 97 | - // 提取模式切换时的清空逻辑,避免脏字段影响提交 | ||
| 98 | - reset_map: { | ||
| 99 | - withdrawal_mode: { | ||
| 100 | - '最高固定提取金额': ['annual_withdrawal_amount', 'annual_increase_percentage', 'withdrawal_start_age_specified', 'withdrawal_period_specified'], | ||
| 101 | - '指定提取金额': ['withdrawal_start_age_fixed', 'withdrawal_period_fixed'] | ||
| 102 | - } | ||
| 103 | - } | ||
| 104 | -} | ||
| 105 | - | ||
| 106 | -export const PLAN_TEMPLATES = { | ||
| 107 | - // 人寿保险产品 - WIOP3E | ||
| 108 | - 'life-insurance-wiop3e': { | ||
| 109 | - name: 'WIOP3E 盈传创富保障计划 3 - 优选版', | ||
| 110 | - component: 'LifeInsuranceTemplate', | ||
| 111 | - config: { | ||
| 112 | - currency: 'USD', // 币种:USD/CNY/HKD/EUR | ||
| 113 | - payment_periods: [ | ||
| 114 | - // 缴费年期选项 | ||
| 115 | - '整付(0-75 岁)', | ||
| 116 | - '5 年(0-70 岁)', | ||
| 117 | - '10 年(0-70 岁)' | ||
| 118 | - ], | ||
| 119 | - age_range: { min: 0, max: 75 }, // 年龄范围 | ||
| 120 | - insurance_period: '终身', // 保险期间 | ||
| 121 | - form_schema: protectionFormSchema, | ||
| 122 | - submit_mapping: baseSubmitMapping | ||
| 123 | - } | ||
| 124 | - }, | ||
| 125 | - | ||
| 126 | - // 人寿保险产品 - WIOP3 | ||
| 127 | - 'life-insurance-wiop3': { | ||
| 128 | - name: 'WIOP3 - 盈传创富保障计划 3', | ||
| 129 | - component: 'LifeInsuranceTemplate', | ||
| 130 | - config: { | ||
| 131 | - currency: 'USD', | ||
| 132 | - payment_periods: [ | ||
| 133 | - '整付(0-75 岁)', | ||
| 134 | - '5 年(0-70 岁)', | ||
| 135 | - '10 年(0-70 岁)' | ||
| 136 | - ], | ||
| 137 | - age_range: { min: 0, max: 75 }, | ||
| 138 | - insurance_period: '终身', | ||
| 139 | - form_schema: protectionFormSchema, | ||
| 140 | - submit_mapping: baseSubmitMapping | ||
| 141 | - } | ||
| 142 | - }, | ||
| 143 | - | ||
| 144 | - // 重疾保险产品 - MPC | ||
| 145 | - 'critical-illness-mpc': { | ||
| 146 | - name: 'MPC 守护无间重疾', | ||
| 147 | - component: 'CriticalIllnessTemplate', | ||
| 148 | - config: { | ||
| 149 | - currency: 'USD', | ||
| 150 | - payment_periods: [ | ||
| 151 | - '10 年(15 日 - 65 岁)', | ||
| 152 | - '20 年(15 日 - 65 岁)', | ||
| 153 | - '25 年(15 日 - 60 岁)' | ||
| 154 | - ], | ||
| 155 | - age_range: { min: 0, max: 65 }, | ||
| 156 | - insurance_period: '终身', | ||
| 157 | - form_schema: protectionFormSchema, | ||
| 158 | - submit_mapping: baseSubmitMapping | ||
| 159 | - } | ||
| 160 | - }, | ||
| 161 | - | ||
| 162 | - // 重疾保险产品 - MBC PRO | ||
| 163 | - 'critical-illness-mbc-pro': { | ||
| 164 | - name: 'MBC PRO 活跃人生重疾保 PRO', | ||
| 165 | - component: 'CriticalIllnessTemplate', | ||
| 166 | - config: { | ||
| 167 | - currency: 'USD', | ||
| 168 | - payment_periods: [ | ||
| 169 | - '10 年(15 日 - 65 岁)', | ||
| 170 | - '20 年(15 日 - 65 岁)', | ||
| 171 | - '25 年(15 日 - 60 岁)' | ||
| 172 | - ], | ||
| 173 | - age_range: { min: 0, max: 65 }, | ||
| 174 | - insurance_period: '终身', | ||
| 175 | - form_schema: protectionFormSchema, | ||
| 176 | - submit_mapping: baseSubmitMapping | ||
| 177 | - } | ||
| 178 | - }, | ||
| 179 | - | ||
| 180 | - // 重疾保险产品 - MBC2 | ||
| 181 | - 'critical-illness-mbc2': { | ||
| 182 | - name: 'MBC2 活跃人生重疾保 2', | ||
| 183 | - component: 'CriticalIllnessTemplate', | ||
| 184 | - config: { | ||
| 185 | - currency: 'USD', | ||
| 186 | - payment_periods: [ | ||
| 187 | - '10 年(15 日 - 65 岁)', | ||
| 188 | - '20 年(15 日 - 65 岁)', | ||
| 189 | - '25 年(15 日 - 60 岁)' | ||
| 190 | - ], | ||
| 191 | - age_range: { min: 0, max: 65 }, | ||
| 192 | - insurance_period: '终身', | ||
| 193 | - form_schema: protectionFormSchema, | ||
| 194 | - submit_mapping: baseSubmitMapping | ||
| 195 | - } | ||
| 196 | - }, | ||
| 197 | - | ||
| 198 | - // ====== 储蓄型产品(统一逻辑) ====== | ||
| 199 | - | ||
| 200 | - // GS - 宏挚传承保障计划 | ||
| 201 | - 'savings-gs': { | ||
| 202 | - name: '宏挚传承保障计划', | ||
| 203 | - component: 'SavingsTemplate', | ||
| 204 | - category: 'savings', // 储蓄型产品 | ||
| 205 | - config: { | ||
| 206 | - currency: 'USD', // 默认美元 | ||
| 207 | - payment_periods: [ | ||
| 208 | - '整付', | ||
| 209 | - '3 年', | ||
| 210 | - '5 年', | ||
| 211 | - '10 年', | ||
| 212 | - '15 年', | ||
| 213 | - ], | ||
| 214 | - age_range: { min: 0, max: 100 }, | ||
| 215 | - insurance_period: '终身', | ||
| 216 | - // 提取计划配置 | ||
| 217 | - withdrawal_plan: { | ||
| 218 | - enabled: true, | ||
| 219 | - currencies: ['HKD', 'USD', 'CNY'], // 支持的币种 | ||
| 220 | - default_currency: 'USD', // 统一为美元 | ||
| 221 | - withdrawal_modes: ['指定提取金额', '最高固定提取金额'], | ||
| 222 | - withdrawal_periods: [ | ||
| 223 | - '1年', | ||
| 224 | - '2年', | ||
| 225 | - '3年', | ||
| 226 | - '5年', | ||
| 227 | - '10年', | ||
| 228 | - '15年', | ||
| 229 | - '20年', | ||
| 230 | - '终身' | ||
| 231 | - ] | ||
| 232 | - }, | ||
| 233 | - form_schema: savingsFormSchema, | ||
| 234 | - submit_mapping: savingsSubmitMapping | ||
| 235 | - } | ||
| 236 | - }, | ||
| 237 | - | ||
| 238 | - // GC - 宏挚家传保险计划 | ||
| 239 | - 'savings-gc': { | ||
| 240 | - name: '宏挚家传保险计划', | ||
| 241 | - component: 'SavingsTemplate', | ||
| 242 | - category: 'savings', | ||
| 243 | - config: { | ||
| 244 | - currency: 'USD', | ||
| 245 | - payment_periods: [ | ||
| 246 | - '整付', | ||
| 247 | - '3 年', | ||
| 248 | - '5 年', | ||
| 249 | - ], | ||
| 250 | - age_range: { min: 0, max: 100 }, | ||
| 251 | - insurance_period: '终身', | ||
| 252 | - withdrawal_plan: { | ||
| 253 | - enabled: true, | ||
| 254 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 255 | - default_currency: 'USD', // 统一为美元 | ||
| 256 | - withdrawal_modes: ['指定提取金额', '最高固定提取金额'], | ||
| 257 | - withdrawal_periods: [ | ||
| 258 | - '1年', | ||
| 259 | - '2年', | ||
| 260 | - '3年', | ||
| 261 | - '5年', | ||
| 262 | - '10年', | ||
| 263 | - '15年', | ||
| 264 | - '20年', | ||
| 265 | - '终身' | ||
| 266 | - ] | ||
| 267 | - }, | ||
| 268 | - form_schema: savingsFormSchema, | ||
| 269 | - submit_mapping: savingsSubmitMapping | ||
| 270 | - } | ||
| 271 | - }, | ||
| 272 | - | ||
| 273 | - // FA - 宏浚传承保障计划 | ||
| 274 | - 'savings-fa': { | ||
| 275 | - name: '宏浚传承保障计划', | ||
| 276 | - component: 'SavingsTemplate', | ||
| 277 | - category: 'savings', | ||
| 278 | - config: { | ||
| 279 | - currency: 'USD', | ||
| 280 | - payment_periods: [ | ||
| 281 | - '整付', | ||
| 282 | - '2 年', | ||
| 283 | - '5 年', | ||
| 284 | - ], | ||
| 285 | - age_range: { min: 0, max: 100 }, | ||
| 286 | - insurance_period: '终身', | ||
| 287 | - withdrawal_plan: { | ||
| 288 | - enabled: true, | ||
| 289 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 290 | - default_currency: 'USD', // 统一为美元 | ||
| 291 | - withdrawal_modes: ['指定提取金额', '最高固定提取金额'], | ||
| 292 | - withdrawal_periods: [ | ||
| 293 | - '1年', | ||
| 294 | - '2年', | ||
| 295 | - '3年', | ||
| 296 | - '5年', | ||
| 297 | - '10年', | ||
| 298 | - '15年', | ||
| 299 | - '20年', | ||
| 300 | - '终身' | ||
| 301 | - ] | ||
| 302 | - }, | ||
| 303 | - form_schema: savingsFormSchema, | ||
| 304 | - submit_mapping: savingsSubmitMapping | ||
| 305 | - } | ||
| 306 | - }, | ||
| 307 | - | ||
| 308 | - // LV2 - 赤霞珠终身寿险计划2(储蓄型终身寿险) | ||
| 309 | - 'savings-lv2': { | ||
| 310 | - name: '赤霞珠终身寿险计划2', | ||
| 311 | - component: 'SavingsTemplate', | ||
| 312 | - category: 'savings', | ||
| 313 | - config: { | ||
| 314 | - currency: 'USD', | ||
| 315 | - payment_periods: [ | ||
| 316 | - '5 年', | ||
| 317 | - '8 年', | ||
| 318 | - '12 年', | ||
| 319 | - '15 年', | ||
| 320 | - ], | ||
| 321 | - age_range: { min: 0, max: 100 }, | ||
| 322 | - insurance_period: '终身', | ||
| 323 | - withdrawal_plan: { | ||
| 324 | - enabled: true, | ||
| 325 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 326 | - default_currency: 'USD', // 统一为美元 | ||
| 327 | - withdrawal_modes: ['指定提取金额', '最高固定提取金额'], | ||
| 328 | - withdrawal_periods: [ | ||
| 329 | - '1年', | ||
| 330 | - '2年', | ||
| 331 | - '3年', | ||
| 332 | - '5年', | ||
| 333 | - '10年', | ||
| 334 | - '15年', | ||
| 335 | - '20年', | ||
| 336 | - '终身' | ||
| 337 | - ] | ||
| 338 | - }, | ||
| 339 | - form_schema: savingsFormSchema, | ||
| 340 | - submit_mapping: savingsSubmitMapping | ||
| 341 | - } | ||
| 342 | - }, | ||
| 343 | - | ||
| 344 | -} | ||
| 345 | - | ||
| 346 | -/** | ||
| 347 | - * 全局功能开关 | ||
| 348 | - * @description 用于控制实验性功能或未来扩展功能的开关 | ||
| 349 | - * | ||
| 350 | - * @example 开启多币种功能:设置 MULTI_CURRENCY_ENABLED = true | ||
| 351 | - */ | ||
| 352 | -export const FEATURE_FLAGS = { | ||
| 353 | - /** | ||
| 354 | - * 多币种切换功能 | ||
| 355 | - * @description false: 方案 1 - 固定币种(当前实现) | ||
| 356 | - * true: 方案 2 - 支持多币种切换(未来扩展) | ||
| 357 | - * @type {boolean} | ||
| 358 | - */ | ||
| 359 | - MULTI_CURRENCY_ENABLED: false | ||
| 360 | -} | ||
| 361 | - | ||
| 362 | -/** | ||
| 363 | - * 币种符号映射 | ||
| 364 | - * @description 币种代码到符号的映射关系 | ||
| 365 | - */ | ||
| 366 | -export const CURRENCY_SYMBOLS = { | ||
| 367 | - CNY: '¥', // 人民币 | ||
| 368 | - USD: '$', // 美元 | ||
| 369 | - HKD: 'HK$', // 港币 | ||
| 370 | - EUR: '€' // 欧元 | ||
| 371 | -} | ||
| 372 | - | ||
| 373 | -/** | ||
| 374 | - * 币种完整信息映射 | ||
| 375 | - * @description 币种代码到完整信息的映射(用于多币种模式) | ||
| 376 | - */ | ||
| 377 | -export const CURRENCY_MAP = { | ||
| 378 | - CNY: { label: '人民币', symbol: '¥', value: 'CNY' }, | ||
| 379 | - USD: { label: '美元', symbol: '$', value: 'USD' }, | ||
| 380 | - HKD: { label: '港币', symbol: 'HK$', value: 'HKD' }, | ||
| 381 | - EUR: { label: '欧元', symbol: '€', value: 'EUR' } | ||
| 382 | -} | ||
| 383 | - | ||
| 384 | -/** | ||
| 385 | - * 根据 form_sn 获取模版配置 | ||
| 386 | - * @param {string} formSn - 产品 API 返回的 form_sn 字段 | ||
| 387 | - * @returns {Object|null} 模版配置对象,未找到返回 null | ||
| 388 | - * | ||
| 389 | - * @example | ||
| 390 | - * const config = getTemplateConfig('life-insurance-wiop3e') | ||
| 391 | - * // 返回: { name: 'WIOP3E...', component: 'LifeInsuranceTemplate', config: {...} } | ||
| 392 | - */ | ||
| 393 | -export function getTemplateConfig(formSn) { | ||
| 394 | - if (!formSn) { | ||
| 395 | - console.warn('[plan-templates] form_sn 为空') | ||
| 396 | - return null | ||
| 397 | - } | ||
| 398 | - | ||
| 399 | - const config = PLAN_TEMPLATES[formSn] | ||
| 400 | - if (!config) { | ||
| 401 | - console.error(`[plan-templates] 未找到模版配置: ${formSn}`) | ||
| 402 | - return null | ||
| 403 | - } | ||
| 404 | - | ||
| 405 | - return config | ||
| 406 | -} | ||
| 407 | - | ||
| 408 | -/** | ||
| 409 | - * 获取币种符号 | ||
| 410 | - * @param {string} currencyCode - 币种代码(CNY/USD/HKD/EUR) | ||
| 411 | - * @returns {string} 币种符号 | ||
| 412 | - * | ||
| 413 | - * @example | ||
| 414 | - * const symbol = getCurrencySymbol('USD') // 返回: '$' | ||
| 415 | - */ | ||
| 416 | -export function getCurrencySymbol(currencyCode) { | ||
| 417 | - return CURRENCY_SYMBOLS[currencyCode] || '¥' | ||
| 418 | -} |
| 1 | -/** | ||
| 2 | - * 计划书模版配置 | ||
| 3 | - * | ||
| 4 | - * @description 定义产品 form_sn 到模版组件和配置的映射关系 | ||
| 5 | - * @module config/plan-templates | ||
| 6 | - * @author Claude Code | ||
| 7 | - * @created 2026-02-06 | ||
| 8 | - * @updated 2026-02-13 - 新增文档解析工具入口 | ||
| 9 | - * | ||
| 10 | - * --- 快速添加新产品(开发工具) --- | ||
| 11 | - * 开发环境可使用以下工具快速添加新产品配置: | ||
| 12 | - * 1. 文档解析工具:/admin/document-parser/index (上传 PDF/Word,AI 自动解析) | ||
| 13 | - * 2. API 配置工具:/admin/document-parser/config (配置 AI 服务) | ||
| 14 | - * | ||
| 15 | - * 使用方式: | ||
| 16 | - * - 上传产品文档 → AI 自动提取配置 → 生成配置代码 → 复制到此文件 | ||
| 17 | - * | ||
| 18 | - * --- 手动添加步骤 --- | ||
| 19 | - * 1. 找到对应的产品分类(人寿/重疾/储蓄) | ||
| 20 | - * 2. 复制现有配置作为模板 | ||
| 21 | - * 3. 修改 name, currency, payment_periods, age_range 等字段 | ||
| 22 | - * 4. 确保 form_sn 唯一(建议使用产品英文标识 + 版本号) | ||
| 23 | - */ | ||
| 24 | - | ||
| 25 | -/** | ||
| 26 | - * 计划书模版配置映射 | ||
| 27 | - * @description form_sn 为产品 API 返回的字段,用于标识该产品使用的计划书模版 | ||
| 28 | - * | ||
| 29 | - * @example | ||
| 30 | - * // 产品 API 返回 | ||
| 31 | - * { | ||
| 32 | - * id: 1, | ||
| 33 | - * product_name: "WIOP3E 盈传创富保障计划 3 - 优选版", | ||
| 34 | - * form_sn: "life-insurance-wiop3e" // 对应下面的配置 key | ||
| 35 | - * } | ||
| 36 | - */ | ||
| 37 | -// 基础提交字段映射(适用于人寿/重疾等通用表单) | ||
| 38 | -const baseSubmitMapping = { | ||
| 39 | - customer_name: { api_field: 'customer_name' }, | ||
| 40 | - gender: { api_field: 'customer_gender' }, | ||
| 41 | - birthday: { api_field: 'customer_birthday' }, | ||
| 42 | - smoker: { api_field: 'smoking_status' }, | ||
| 43 | - coverage: { api_field: 'annual_premium', transform: 'fen_to_yuan' }, | ||
| 44 | - payment_period: { api_field: 'payment_years' }, | ||
| 45 | - total_amount: { api_field: 'total_premium', transform: 'fen_to_yuan' } | ||
| 46 | -} | ||
| 47 | - | ||
| 48 | -// 人寿/重疾基础表单 Schema(通用保障类) | ||
| 49 | -const protectionFormSchema = { | ||
| 50 | - base_fields: [ | ||
| 51 | - { id: 'customer_name', key: 'customer_name', type: 'name', label: '申请人', placeholder: '请输入申请人', required: true }, | ||
| 52 | - { id: 'gender', key: 'gender', type: 'radio', label: '性别', options: ['男', '女'], required: true }, | ||
| 53 | - { id: 'birthday', key: 'birthday', type: 'date', label: '出生年月日', placeholder: '请选择年月日', required: true }, | ||
| 54 | - { id: 'smoker', key: 'smoker', type: 'radio', label: '是否吸烟', options: ['是', '否'], required: true }, | ||
| 55 | - { id: 'coverage', key: 'coverage', type: 'amount', label: '保额', placeholder: '请输入保额', input_label: '请输入保额金额', required: true, currency_from: 'currency' }, | ||
| 56 | - { id: 'payment_period', key: 'payment_period', type: 'payment_period', label: '缴费年期', required: true, options_from: 'payment_periods' } | ||
| 57 | - ] | ||
| 58 | -} | ||
| 59 | - | ||
| 60 | -// 储蓄类提交字段映射(在基础映射上追加提取计划字段) | ||
| 61 | -const savingsSubmitMapping = { | ||
| 62 | - ...baseSubmitMapping, | ||
| 63 | - withdrawal_enabled: { api_field: 'allow_reduce_amount' }, | ||
| 64 | - withdrawal_mode: { api_field: 'withdrawal_option' }, | ||
| 65 | - withdrawal_method: { api_field: 'withdrawal_method' }, | ||
| 66 | - annual_withdrawal_amount: { api_field: 'annual_withdrawal_amount', transform: 'fen_to_yuan' }, | ||
| 67 | - annual_increase_percentage: { api_field: 'annual_increase_percentage' }, | ||
| 68 | - withdrawal_start_age_specified: { api_field: 'withdrawal_start_age' }, | ||
| 69 | - withdrawal_period_specified: { api_field: 'withdrawal_period' }, | ||
| 70 | - withdrawal_start_age_fixed: { api_field: 'withdrawal_start_age' }, | ||
| 71 | - withdrawal_period_fixed: { api_field: 'withdrawal_period' } | ||
| 72 | -} | ||
| 73 | - | ||
| 74 | -// 储蓄类表单 Schema(渲染 + 校验 + 联动的唯一入口) | ||
| 75 | -const savingsFormSchema = { | ||
| 76 | - // 基础字段:非提取计划部分 | ||
| 77 | - base_fields: [ | ||
| 78 | - { id: 'customer_name', key: 'customer_name', type: 'name', label: '申请人', placeholder: '请输入申请人', required: true }, | ||
| 79 | - { id: 'gender', key: 'gender', type: 'radio', label: '性别', options: ['男', '女'], required: true }, | ||
| 80 | - { id: 'birthday', key: 'birthday', type: 'date', label: '出生年月日', placeholder: '请选择年月日', required: true }, | ||
| 81 | - { id: 'smoker', key: 'smoker', type: 'radio', label: '是否吸烟', options: ['是', '否'], required: true }, | ||
| 82 | - { id: 'coverage', key: 'coverage', type: 'amount', label: '年缴保费', placeholder: '请输入年缴保费', input_label: '请输入年缴保费金额', required: true, currency_from: 'currency' }, | ||
| 83 | - { id: 'payment_period', key: 'payment_period', type: 'payment_period', label: '缴费年期', required: true, options_from: 'payment_periods' } | ||
| 84 | - ], | ||
| 85 | - // 提取计划字段:由 withdrawal_plan 开关控制 | ||
| 86 | - withdrawal_fields: [ | ||
| 87 | - { id: 'withdrawal_enabled', key: 'withdrawal_enabled', type: 'radio', label: '是否希望生成一份允许减少名义金额的提取说明?', options: ['是', '否'], required: true, default: '否' }, | ||
| 88 | - { id: 'withdrawal_mode', key: 'withdrawal_mode', type: 'radio', label: '提取选项', options: ['指定提取金额', '最高固定提取金额'], required: true, default: '指定提取金额', section_title: '款项提取(允许减少名义金额)' }, | ||
| 89 | - { id: 'withdrawal_method', key: 'withdrawal_method', type: 'radio', label: '提取方式', options: ['按年岁'], required: true, default: '按年岁', show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 90 | - { id: 'annual_withdrawal_amount', key: 'annual_withdrawal_amount', type: 'amount', label: '每年提取金额', placeholder: '请输入每年提取金额', input_label: '请输入每年提取金额', required: true, currency_from: 'withdrawal_plan.default_currency', show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 91 | - { id: 'withdrawal_start_age_specified', key: 'withdrawal_start_age_specified', type: 'age', label: '由几岁开始', placeholder: '请输入开始提取年龄', required: true, show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 92 | - { id: 'withdrawal_period_specified', key: 'withdrawal_period_specified', type: 'select', label: '提取期(年)', placeholder: '请选择提取期', required: true, options_from: 'withdrawal_plan.withdrawal_periods', show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 93 | - { id: 'annual_increase_percentage', key: 'annual_increase_percentage', type: 'percentage', label: '每年递增提取之百分比(%)', placeholder: '请输入递增百分比', required: true, show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 94 | - { id: 'withdrawal_start_age_fixed', key: 'withdrawal_start_age_fixed', type: 'age', label: '按年岁:由几岁开始', placeholder: '请输入开始提取年龄', required: true, show_when: [{ field: 'withdrawal_mode', equals: '最高固定提取金额' }] }, | ||
| 95 | - { id: 'withdrawal_period_fixed', key: 'withdrawal_period_fixed', type: 'select', label: '按年岁:提取期(年)', placeholder: '请选择提取期', required: true, options_from: 'withdrawal_plan.withdrawal_periods', show_when: [{ field: 'withdrawal_mode', equals: '最高固定提取金额' }] } | ||
| 96 | - ], | ||
| 97 | - // 提取模式切换时的清空逻辑,避免脏字段影响提交 | ||
| 98 | - reset_map: { | ||
| 99 | - withdrawal_mode: { | ||
| 100 | - '最高固定提取金额': ['annual_withdrawal_amount', 'annual_increase_percentage', 'withdrawal_start_age_specified', 'withdrawal_period_specified'], | ||
| 101 | - '指定提取金额': ['withdrawal_start_age_fixed', 'withdrawal_period_fixed'] | ||
| 102 | - } | ||
| 103 | - } | ||
| 104 | -} | ||
| 105 | - | ||
| 106 | -export const PLAN_TEMPLATES = { | ||
| 107 | - // 人寿保险产品 - WIOP3E | ||
| 108 | - 'life-insurance-wiop3e': { | ||
| 109 | - name: 'WIOP3E 盈传创富保障计划 3 - 优选版', | ||
| 110 | - component: 'LifeInsuranceTemplate', | ||
| 111 | - config: { | ||
| 112 | - currency: 'USD', // 币种:USD/CNY/HKD/EUR | ||
| 113 | - payment_periods: [ | ||
| 114 | - // 缴费年期选项 | ||
| 115 | - '整付(0-75 岁)', | ||
| 116 | - '5 年(0-70 岁)', | ||
| 117 | - '10 年(0-70 岁)' | ||
| 118 | - ], | ||
| 119 | - age_range: { min: 0, max: 75 }, // 年龄范围 | ||
| 120 | - insurance_period: '终身', // 保险期间 | ||
| 121 | - form_schema: protectionFormSchema, | ||
| 122 | - submit_mapping: baseSubmitMapping | ||
| 123 | - } | ||
| 124 | - }, | ||
| 125 | - | ||
| 126 | - // 人寿保险产品 - WIOP3 | ||
| 127 | - 'life-insurance-wiop3': { | ||
| 128 | - name: 'WIOP3 - 盈传创富保障计划 3', | ||
| 129 | - component: 'LifeInsuranceTemplate', | ||
| 130 | - config: { | ||
| 131 | - currency: 'USD', | ||
| 132 | - payment_periods: [ | ||
| 133 | - '整付(0-75 岁)', | ||
| 134 | - '5 年(0-70 岁)', | ||
| 135 | - '10 年(0-70 岁)' | ||
| 136 | - ], | ||
| 137 | - age_range: { min: 0, max: 75 }, | ||
| 138 | - insurance_period: '终身', | ||
| 139 | - form_schema: protectionFormSchema, | ||
| 140 | - submit_mapping: baseSubmitMapping | ||
| 141 | - } | ||
| 142 | - }, | ||
| 143 | - | ||
| 144 | - // 重疾保险产品 - MPC | ||
| 145 | - 'critical-illness-mpc': { | ||
| 146 | - name: 'MPC 守护无间重疾', | ||
| 147 | - component: 'CriticalIllnessTemplate', | ||
| 148 | - config: { | ||
| 149 | - currency: 'USD', | ||
| 150 | - payment_periods: [ | ||
| 151 | - '10 年(15 日 - 65 岁)', | ||
| 152 | - '20 年(15 日 - 65 岁)', | ||
| 153 | - '25 年(15 日 - 60 岁)' | ||
| 154 | - ], | ||
| 155 | - age_range: { min: 0, max: 65 }, | ||
| 156 | - insurance_period: '终身', | ||
| 157 | - form_schema: protectionFormSchema, | ||
| 158 | - submit_mapping: baseSubmitMapping | ||
| 159 | - } | ||
| 160 | - }, | ||
| 161 | - | ||
| 162 | - // 重疾保险产品 - MBC PRO | ||
| 163 | - 'critical-illness-mbc-pro': { | ||
| 164 | - name: 'MBC PRO 活跃人生重疾保 PRO', | ||
| 165 | - component: 'CriticalIllnessTemplate', | ||
| 166 | - config: { | ||
| 167 | - currency: 'USD', | ||
| 168 | - payment_periods: [ | ||
| 169 | - '10 年(15 日 - 65 岁)', | ||
| 170 | - '20 年(15 日 - 65 岁)', | ||
| 171 | - '25 年(15 日 - 60 岁)' | ||
| 172 | - ], | ||
| 173 | - age_range: { min: 0, max: 65 }, | ||
| 174 | - insurance_period: '终身', | ||
| 175 | - form_schema: protectionFormSchema, | ||
| 176 | - submit_mapping: baseSubmitMapping | ||
| 177 | - } | ||
| 178 | - }, | ||
| 179 | - | ||
| 180 | - // 重疾保险产品 - MBC2 | ||
| 181 | - 'critical-illness-mbc2': { | ||
| 182 | - name: 'MBC2 活跃人生重疾保 2', | ||
| 183 | - component: 'CriticalIllnessTemplate', | ||
| 184 | - config: { | ||
| 185 | - currency: 'USD', | ||
| 186 | - payment_periods: [ | ||
| 187 | - '10 年(15 日 - 65 岁)', | ||
| 188 | - '20 年(15 日 - 65 岁)', | ||
| 189 | - '25 年(15 日 - 60 岁)' | ||
| 190 | - ], | ||
| 191 | - age_range: { min: 0, max: 65 }, | ||
| 192 | - insurance_period: '终身', | ||
| 193 | - form_schema: protectionFormSchema, | ||
| 194 | - submit_mapping: baseSubmitMapping | ||
| 195 | - } | ||
| 196 | - }, | ||
| 197 | - | ||
| 198 | - // ====== 储蓄型产品(统一逻辑) ====== | ||
| 199 | - | ||
| 200 | - // GS - 宏挚传承保障计划 | ||
| 201 | - 'savings-gs': { | ||
| 202 | - name: '宏挚传承保障计划', | ||
| 203 | - component: 'SavingsTemplate', | ||
| 204 | - category: 'savings', // 储蓄型产品 | ||
| 205 | - config: { | ||
| 206 | - currency: 'USD', // 默认美元 | ||
| 207 | - payment_periods: [ | ||
| 208 | - '整付', | ||
| 209 | - '3 年', | ||
| 210 | - '5 年', | ||
| 211 | - '10 年', | ||
| 212 | - '15 年', | ||
| 213 | - ], | ||
| 214 | - age_range: { min: 0, max: 100 }, | ||
| 215 | - insurance_period: '终身', | ||
| 216 | - // 提取计划配置 | ||
| 217 | - withdrawal_plan: { | ||
| 218 | - enabled: true, | ||
| 219 | - currencies: ['HKD', 'USD', 'CNY'], // 支持的币种 | ||
| 220 | - default_currency: 'USD', // 统一为美元 | ||
| 221 | - withdrawal_modes: ['指定提取金额', '最高固定提取金额'], | ||
| 222 | - withdrawal_periods: [ | ||
| 223 | - '1年', | ||
| 224 | - '2年', | ||
| 225 | - '3年', | ||
| 226 | - '5年', | ||
| 227 | - '10年', | ||
| 228 | - '15年', | ||
| 229 | - '20年', | ||
| 230 | - '终身' | ||
| 231 | - ] | ||
| 232 | - }, | ||
| 233 | - form_schema: savingsFormSchema, | ||
| 234 | - submit_mapping: savingsSubmitMapping | ||
| 235 | - } | ||
| 236 | - }, | ||
| 237 | - | ||
| 238 | - // GC - 宏挚家传保险计划 | ||
| 239 | - 'savings-gc': { | ||
| 240 | - name: '宏挚家传保险计划', | ||
| 241 | - component: 'SavingsTemplate', | ||
| 242 | - category: 'savings', | ||
| 243 | - config: { | ||
| 244 | - currency: 'USD', | ||
| 245 | - payment_periods: [ | ||
| 246 | - '整付', | ||
| 247 | - '3 年', | ||
| 248 | - '5 年', | ||
| 249 | - ], | ||
| 250 | - age_range: { min: 0, max: 100 }, | ||
| 251 | - insurance_period: '终身', | ||
| 252 | - withdrawal_plan: { | ||
| 253 | - enabled: true, | ||
| 254 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 255 | - default_currency: 'USD', // 统一为美元 | ||
| 256 | - withdrawal_modes: ['指定提取金额', '最高固定提取金额'], | ||
| 257 | - withdrawal_periods: [ | ||
| 258 | - '1年', | ||
| 259 | - '2年', | ||
| 260 | - '3年', | ||
| 261 | - '5年', | ||
| 262 | - '10年', | ||
| 263 | - '15年', | ||
| 264 | - '20年', | ||
| 265 | - '终身' | ||
| 266 | - ] | ||
| 267 | - }, | ||
| 268 | - form_schema: savingsFormSchema, | ||
| 269 | - submit_mapping: savingsSubmitMapping | ||
| 270 | - } | ||
| 271 | - }, | ||
| 272 | - | ||
| 273 | - // FA - 宏浚传承保障计划 | ||
| 274 | - 'savings-fa': { | ||
| 275 | - name: '宏浚传承保障计划', | ||
| 276 | - component: 'SavingsTemplate', | ||
| 277 | - category: 'savings', | ||
| 278 | - config: { | ||
| 279 | - currency: 'USD', | ||
| 280 | - payment_periods: [ | ||
| 281 | - '整付', | ||
| 282 | - '2 年', | ||
| 283 | - '5 年', | ||
| 284 | - ], | ||
| 285 | - age_range: { min: 0, max: 100 }, | ||
| 286 | - insurance_period: '终身', | ||
| 287 | - withdrawal_plan: { | ||
| 288 | - enabled: true, | ||
| 289 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 290 | - default_currency: 'USD', // 统一为美元 | ||
| 291 | - withdrawal_modes: ['指定提取金额', '最高固定提取金额'], | ||
| 292 | - withdrawal_periods: [ | ||
| 293 | - '1年', | ||
| 294 | - '2年', | ||
| 295 | - '3年', | ||
| 296 | - '5年', | ||
| 297 | - '10年', | ||
| 298 | - '15年', | ||
| 299 | - '20年', | ||
| 300 | - '终身' | ||
| 301 | - ] | ||
| 302 | - }, | ||
| 303 | - form_schema: savingsFormSchema, | ||
| 304 | - submit_mapping: savingsSubmitMapping | ||
| 305 | - } | ||
| 306 | - }, | ||
| 307 | - | ||
| 308 | - // LV2 - 赤霞珠终身寿险计划2(储蓄型终身寿险) | ||
| 309 | - 'savings-lv2': { | ||
| 310 | - name: '赤霞珠终身寿险计划2', | ||
| 311 | - component: 'SavingsTemplate', | ||
| 312 | - category: 'savings', | ||
| 313 | - config: { | ||
| 314 | - currency: 'USD', | ||
| 315 | - payment_periods: [ | ||
| 316 | - '5 年', | ||
| 317 | - '8 年', | ||
| 318 | - '12 年', | ||
| 319 | - '15 年', | ||
| 320 | - ], | ||
| 321 | - age_range: { min: 0, max: 100 }, | ||
| 322 | - insurance_period: '终身', | ||
| 323 | - withdrawal_plan: { | ||
| 324 | - enabled: true, | ||
| 325 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 326 | - default_currency: 'USD', // 统一为美元 | ||
| 327 | - withdrawal_modes: ['指定提取金额', '最高固定提取金额'], | ||
| 328 | - withdrawal_periods: [ | ||
| 329 | - '1年', | ||
| 330 | - '2年', | ||
| 331 | - '3年', | ||
| 332 | - '5年', | ||
| 333 | - '10年', | ||
| 334 | - '15年', | ||
| 335 | - '20年', | ||
| 336 | - '终身' | ||
| 337 | - ] | ||
| 338 | - }, | ||
| 339 | - form_schema: savingsFormSchema, | ||
| 340 | - submit_mapping: savingsSubmitMapping | ||
| 341 | - } | ||
| 342 | - }, | ||
| 343 | - | ||
| 344 | - | ||
| 345 | -} | ||
| 346 | - | ||
| 347 | -/** | ||
| 348 | - * 全局功能开关 | ||
| 349 | - * @description 用于控制实验性功能或未来扩展功能的开关 | ||
| 350 | - * | ||
| 351 | - * @example 开启多币种功能:设置 MULTI_CURRENCY_ENABLED = true | ||
| 352 | - */ | ||
| 353 | -export const FEATURE_FLAGS = { | ||
| 354 | - /** | ||
| 355 | - * 多币种切换功能 | ||
| 356 | - * @description false: 方案 1 - 固定币种(当前实现) | ||
| 357 | - * true: 方案 2 - 支持多币种切换(未来扩展) | ||
| 358 | - * @type {boolean} | ||
| 359 | - */ | ||
| 360 | - MULTI_CURRENCY_ENABLED: false | ||
| 361 | -} | ||
| 362 | - | ||
| 363 | -/** | ||
| 364 | - * 币种符号映射 | ||
| 365 | - * @description 币种代码到符号的映射关系 | ||
| 366 | - */ | ||
| 367 | -export const CURRENCY_SYMBOLS = { | ||
| 368 | - CNY: '¥', // 人民币 | ||
| 369 | - USD: '$', // 美元 | ||
| 370 | - HKD: 'HK$', // 港币 | ||
| 371 | - EUR: '€' // 欧元 | ||
| 372 | -} | ||
| 373 | - | ||
| 374 | -/** | ||
| 375 | - * 币种完整信息映射 | ||
| 376 | - * @description 币种代码到完整信息的映射(用于多币种模式) | ||
| 377 | - */ | ||
| 378 | -export const CURRENCY_MAP = { | ||
| 379 | - CNY: { label: '人民币', symbol: '¥', value: 'CNY' }, | ||
| 380 | - USD: { label: '美元', symbol: '$', value: 'USD' }, | ||
| 381 | - HKD: { label: '港币', symbol: 'HK$', value: 'HKD' }, | ||
| 382 | - EUR: { label: '欧元', symbol: '€', value: 'EUR' } | ||
| 383 | -} | ||
| 384 | - | ||
| 385 | -/** | ||
| 386 | - * 根据 form_sn 获取模版配置 | ||
| 387 | - * @param {string} formSn - 产品 API 返回的 form_sn 字段 | ||
| 388 | - * @returns {Object|null} 模版配置对象,未找到返回 null | ||
| 389 | - * | ||
| 390 | - * @example | ||
| 391 | - * const config = getTemplateConfig('life-insurance-wiop3e') | ||
| 392 | - * // 返回: { name: 'WIOP3E...', component: 'LifeInsuranceTemplate', config: {...} } | ||
| 393 | - */ | ||
| 394 | -export function getTemplateConfig(formSn) { | ||
| 395 | - if (!formSn) { | ||
| 396 | - console.warn('[plan-templates] form_sn 为空') | ||
| 397 | - return null | ||
| 398 | - } | ||
| 399 | - | ||
| 400 | - const config = PLAN_TEMPLATES[formSn] | ||
| 401 | - if (!config) { | ||
| 402 | - console.error(`[plan-templates] 未找到模版配置: ${formSn}`) | ||
| 403 | - return null | ||
| 404 | - } | ||
| 405 | - | ||
| 406 | - return config | ||
| 407 | -} | ||
| 408 | - | ||
| 409 | -/** | ||
| 410 | - * 获取币种符号 | ||
| 411 | - * @param {string} currencyCode - 币种代码(CNY/USD/HKD/EUR) | ||
| 412 | - * @returns {string} 币种符号 | ||
| 413 | - * | ||
| 414 | - * @example | ||
| 415 | - * const symbol = getCurrencySymbol('USD') // 返回: '$' | ||
| 416 | - */ | ||
| 417 | -export function getCurrencySymbol(currencyCode) { | ||
| 418 | - return CURRENCY_SYMBOLS[currencyCode] || '¥' | ||
| 419 | -} |
| 1 | -/** | ||
| 2 | - * 计划书模版配置 | ||
| 3 | - * | ||
| 4 | - * @description 定义产品 form_sn 到模版组件和配置的映射关系 | ||
| 5 | - * @module config/plan-templates | ||
| 6 | - * @author Claude Code | ||
| 7 | - * @created 2026-02-06 | ||
| 8 | - * @updated 2026-02-13 - 新增文档解析工具入口 | ||
| 9 | - * | ||
| 10 | - * --- 快速添加新产品(开发工具) --- | ||
| 11 | - * 开发环境可使用以下工具快速添加新产品配置: | ||
| 12 | - * 1. 文档解析工具:/admin/document-parser/index (上传 PDF/Word,AI 自动解析) | ||
| 13 | - * 2. API 配置工具:/admin/document-parser/config (配置 AI 服务) | ||
| 14 | - * | ||
| 15 | - * 使用方式: | ||
| 16 | - * - 上传产品文档 → AI 自动提取配置 → 生成配置代码 → 复制到此文件 | ||
| 17 | - * | ||
| 18 | - * --- 手动添加步骤 --- | ||
| 19 | - * 1. 找到对应的产品分类(人寿/重疾/储蓄) | ||
| 20 | - * 2. 复制现有配置作为模板 | ||
| 21 | - * 3. 修改 name, currency, payment_periods, age_range 等字段 | ||
| 22 | - * 4. 确保 form_sn 唯一(建议使用产品英文标识 + 版本号) | ||
| 23 | - */ | ||
| 24 | - | ||
| 25 | -/** | ||
| 26 | - * 计划书模版配置映射 | ||
| 27 | - * @description form_sn 为产品 API 返回的字段,用于标识该产品使用的计划书模版 | ||
| 28 | - * | ||
| 29 | - * @example | ||
| 30 | - * // 产品 API 返回 | ||
| 31 | - * { | ||
| 32 | - * id: 1, | ||
| 33 | - * product_name: "WIOP3E 盈传创富保障计划 3 - 优选版", | ||
| 34 | - * form_sn: "life-insurance-wiop3e" // 对应下面的配置 key | ||
| 35 | - * } | ||
| 36 | - */ | ||
| 37 | -// 基础提交字段映射(适用于人寿/重疾等通用表单) | ||
| 38 | -const baseSubmitMapping = { | ||
| 39 | - customer_name: { api_field: 'customer_name' }, | ||
| 40 | - gender: { api_field: 'customer_gender' }, | ||
| 41 | - birthday: { api_field: 'customer_birthday' }, | ||
| 42 | - smoker: { api_field: 'smoking_status' }, | ||
| 43 | - coverage: { api_field: 'annual_premium', transform: 'fen_to_yuan' }, | ||
| 44 | - payment_period: { api_field: 'payment_years' }, | ||
| 45 | - total_amount: { api_field: 'total_premium', transform: 'fen_to_yuan' } | ||
| 46 | -} | ||
| 47 | - | ||
| 48 | -// 人寿/重疾基础表单 Schema(通用保障类) | ||
| 49 | -const protectionFormSchema = { | ||
| 50 | - base_fields: [ | ||
| 51 | - { id: 'customer_name', key: 'customer_name', type: 'name', label: '申请人', placeholder: '请输入申请人', required: true }, | ||
| 52 | - { id: 'gender', key: 'gender', type: 'radio', label: '性别', options: ['男', '女'], required: true }, | ||
| 53 | - { id: 'birthday', key: 'birthday', type: 'date', label: '出生年月日', placeholder: '请选择年月日', required: true }, | ||
| 54 | - { id: 'smoker', key: 'smoker', type: 'radio', label: '是否吸烟', options: ['是', '否'], required: true }, | ||
| 55 | - { id: 'coverage', key: 'coverage', type: 'amount', label: '保额', placeholder: '请输入保额', input_label: '请输入保额金额', required: true, currency_from: 'currency' }, | ||
| 56 | - { id: 'payment_period', key: 'payment_period', type: 'payment_period', label: '缴费年期', required: true, options_from: 'payment_periods' } | ||
| 57 | - ] | ||
| 58 | -} | ||
| 59 | - | ||
| 60 | -// 储蓄类提交字段映射(在基础映射上追加提取计划字段) | ||
| 61 | -const savingsSubmitMapping = { | ||
| 62 | - ...baseSubmitMapping, | ||
| 63 | - withdrawal_enabled: { api_field: 'allow_reduce_amount' }, | ||
| 64 | - withdrawal_mode: { api_field: 'withdrawal_option' }, | ||
| 65 | - withdrawal_method: { api_field: 'withdrawal_method' }, | ||
| 66 | - annual_withdrawal_amount: { api_field: 'annual_withdrawal_amount', transform: 'fen_to_yuan' }, | ||
| 67 | - annual_increase_percentage: { api_field: 'annual_increase_percentage' }, | ||
| 68 | - withdrawal_start_age_specified: { api_field: 'withdrawal_start_age' }, | ||
| 69 | - withdrawal_period_specified: { api_field: 'withdrawal_period' }, | ||
| 70 | - withdrawal_start_age_fixed: { api_field: 'withdrawal_start_age' }, | ||
| 71 | - withdrawal_period_fixed: { api_field: 'withdrawal_period' } | ||
| 72 | -} | ||
| 73 | - | ||
| 74 | -// 储蓄类表单 Schema(渲染 + 校验 + 联动的唯一入口) | ||
| 75 | -const savingsFormSchema = { | ||
| 76 | - // 基础字段:非提取计划部分 | ||
| 77 | - base_fields: [ | ||
| 78 | - { id: 'customer_name', key: 'customer_name', type: 'name', label: '申请人', placeholder: '请输入申请人', required: true }, | ||
| 79 | - { id: 'gender', key: 'gender', type: 'radio', label: '性别', options: ['男', '女'], required: true }, | ||
| 80 | - { id: 'birthday', key: 'birthday', type: 'date', label: '出生年月日', placeholder: '请选择年月日', required: true }, | ||
| 81 | - { id: 'smoker', key: 'smoker', type: 'radio', label: '是否吸烟', options: ['是', '否'], required: true }, | ||
| 82 | - { id: 'coverage', key: 'coverage', type: 'amount', label: '年缴保费', placeholder: '请输入年缴保费', input_label: '请输入年缴保费金额', required: true, currency_from: 'currency' }, | ||
| 83 | - { id: 'payment_period', key: 'payment_period', type: 'payment_period', label: '缴费年期', required: true, options_from: 'payment_periods' } | ||
| 84 | - ], | ||
| 85 | - // 提取计划字段:由 withdrawal_plan 开关控制 | ||
| 86 | - withdrawal_fields: [ | ||
| 87 | - { id: 'withdrawal_enabled', key: 'withdrawal_enabled', type: 'radio', label: '是否希望生成一份允许减少名义金额的提取说明?', options: ['是', '否'], required: true, default: '否' }, | ||
| 88 | - { id: 'withdrawal_mode', key: 'withdrawal_mode', type: 'radio', label: '提取选项', options: ['指定提取金额', '最高固定提取金额'], required: true, default: '指定提取金额', section_title: '款项提取(允许减少名义金额)' }, | ||
| 89 | - { id: 'withdrawal_method', key: 'withdrawal_method', type: 'radio', label: '提取方式', options: ['按年岁'], required: true, default: '按年岁', show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 90 | - { id: 'annual_withdrawal_amount', key: 'annual_withdrawal_amount', type: 'amount', label: '每年提取金额', placeholder: '请输入每年提取金额', input_label: '请输入每年提取金额', required: true, currency_from: 'withdrawal_plan.default_currency', show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 91 | - { id: 'withdrawal_start_age_specified', key: 'withdrawal_start_age_specified', type: 'age', label: '由几岁开始', placeholder: '请输入开始提取年龄', required: true, show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 92 | - { id: 'withdrawal_period_specified', key: 'withdrawal_period_specified', type: 'select', label: '提取期(年)', placeholder: '请选择提取期', required: true, options_from: 'withdrawal_plan.withdrawal_periods', show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 93 | - { id: 'annual_increase_percentage', key: 'annual_increase_percentage', type: 'percentage', label: '每年递增提取之百分比(%)', placeholder: '请输入递增百分比', required: true, show_when: [{ field: 'withdrawal_mode', equals: '指定提取金额' }] }, | ||
| 94 | - { id: 'withdrawal_start_age_fixed', key: 'withdrawal_start_age_fixed', type: 'age', label: '按年岁:由几岁开始', placeholder: '请输入开始提取年龄', required: true, show_when: [{ field: 'withdrawal_mode', equals: '最高固定提取金额' }] }, | ||
| 95 | - { id: 'withdrawal_period_fixed', key: 'withdrawal_period_fixed', type: 'select', label: '按年岁:提取期(年)', placeholder: '请选择提取期', required: true, options_from: 'withdrawal_plan.withdrawal_periods', show_when: [{ field: 'withdrawal_mode', equals: '最高固定提取金额' }] } | ||
| 96 | - ], | ||
| 97 | - // 提取模式切换时的清空逻辑,避免脏字段影响提交 | ||
| 98 | - reset_map: { | ||
| 99 | - withdrawal_mode: { | ||
| 100 | - '最高固定提取金额': ['annual_withdrawal_amount', 'annual_increase_percentage', 'withdrawal_start_age_specified', 'withdrawal_period_specified'], | ||
| 101 | - '指定提取金额': ['withdrawal_start_age_fixed', 'withdrawal_period_fixed'] | ||
| 102 | - } | ||
| 103 | - } | ||
| 104 | -} | ||
| 105 | - | ||
| 106 | -export const PLAN_TEMPLATES = { | ||
| 107 | - // 人寿保险产品 - WIOP3E | ||
| 108 | - 'life-insurance-wiop3e': { | ||
| 109 | - name: 'WIOP3E 盈传创富保障计划 3 - 优选版', | ||
| 110 | - component: 'LifeInsuranceTemplate', | ||
| 111 | - config: { | ||
| 112 | - currency: 'USD', // 币种:USD/CNY/HKD/EUR | ||
| 113 | - payment_periods: [ | ||
| 114 | - // 缴费年期选项 | ||
| 115 | - '整付(0-75 岁)', | ||
| 116 | - '5 年(0-70 岁)', | ||
| 117 | - '10 年(0-70 岁)' | ||
| 118 | - ], | ||
| 119 | - age_range: { min: 0, max: 75 }, // 年龄范围 | ||
| 120 | - insurance_period: '终身', // 保险期间 | ||
| 121 | - form_schema: protectionFormSchema, | ||
| 122 | - submit_mapping: baseSubmitMapping | ||
| 123 | - } | ||
| 124 | - }, | ||
| 125 | - | ||
| 126 | - // 人寿保险产品 - WIOP3 | ||
| 127 | - 'life-insurance-wiop3': { | ||
| 128 | - name: 'WIOP3 - 盈传创富保障计划 3', | ||
| 129 | - component: 'LifeInsuranceTemplate', | ||
| 130 | - config: { | ||
| 131 | - currency: 'USD', | ||
| 132 | - payment_periods: [ | ||
| 133 | - '整付(0-75 岁)', | ||
| 134 | - '5 年(0-70 岁)', | ||
| 135 | - '10 年(0-70 岁)' | ||
| 136 | - ], | ||
| 137 | - age_range: { min: 0, max: 75 }, | ||
| 138 | - insurance_period: '终身', | ||
| 139 | - form_schema: protectionFormSchema, | ||
| 140 | - submit_mapping: baseSubmitMapping | ||
| 141 | - } | ||
| 142 | - }, | ||
| 143 | - | ||
| 144 | - // 重疾保险产品 - MPC | ||
| 145 | - 'critical-illness-mpc': { | ||
| 146 | - name: 'MPC 守护无间重疾', | ||
| 147 | - component: 'CriticalIllnessTemplate', | ||
| 148 | - config: { | ||
| 149 | - currency: 'USD', | ||
| 150 | - payment_periods: [ | ||
| 151 | - '10 年(15 日 - 65 岁)', | ||
| 152 | - '20 年(15 日 - 65 岁)', | ||
| 153 | - '25 年(15 日 - 60 岁)' | ||
| 154 | - ], | ||
| 155 | - age_range: { min: 0, max: 65 }, | ||
| 156 | - insurance_period: '终身', | ||
| 157 | - form_schema: protectionFormSchema, | ||
| 158 | - submit_mapping: baseSubmitMapping | ||
| 159 | - } | ||
| 160 | - }, | ||
| 161 | - | ||
| 162 | - // 重疾保险产品 - MBC PRO | ||
| 163 | - 'critical-illness-mbc-pro': { | ||
| 164 | - name: 'MBC PRO 活跃人生重疾保 PRO', | ||
| 165 | - component: 'CriticalIllnessTemplate', | ||
| 166 | - config: { | ||
| 167 | - currency: 'USD', | ||
| 168 | - payment_periods: [ | ||
| 169 | - '10 年(15 日 - 65 岁)', | ||
| 170 | - '20 年(15 日 - 65 岁)', | ||
| 171 | - '25 年(15 日 - 60 岁)' | ||
| 172 | - ], | ||
| 173 | - age_range: { min: 0, max: 65 }, | ||
| 174 | - insurance_period: '终身', | ||
| 175 | - form_schema: protectionFormSchema, | ||
| 176 | - submit_mapping: baseSubmitMapping | ||
| 177 | - } | ||
| 178 | - }, | ||
| 179 | - | ||
| 180 | - // 重疾保险产品 - MBC2 | ||
| 181 | - 'critical-illness-mbc2': { | ||
| 182 | - name: 'MBC2 活跃人生重疾保 2', | ||
| 183 | - component: 'CriticalIllnessTemplate', | ||
| 184 | - config: { | ||
| 185 | - currency: 'USD', | ||
| 186 | - payment_periods: [ | ||
| 187 | - '10 年(15 日 - 65 岁)', | ||
| 188 | - '20 年(15 日 - 65 岁)', | ||
| 189 | - '25 年(15 日 - 60 岁)' | ||
| 190 | - ], | ||
| 191 | - age_range: { min: 0, max: 65 }, | ||
| 192 | - insurance_period: '终身', | ||
| 193 | - form_schema: protectionFormSchema, | ||
| 194 | - submit_mapping: baseSubmitMapping | ||
| 195 | - } | ||
| 196 | - }, | ||
| 197 | - | ||
| 198 | - // ====== 储蓄型产品(统一逻辑) ====== | ||
| 199 | - | ||
| 200 | - // GS - 宏挚传承保障计划 | ||
| 201 | - 'savings-gs': { | ||
| 202 | - name: '宏挚传承保障计划', | ||
| 203 | - component: 'SavingsTemplate', | ||
| 204 | - category: 'savings', // 储蓄型产品 | ||
| 205 | - config: { | ||
| 206 | - currency: 'USD', // 默认美元 | ||
| 207 | - payment_periods: [ | ||
| 208 | - '整付', | ||
| 209 | - '3 年', | ||
| 210 | - '5 年', | ||
| 211 | - '10 年', | ||
| 212 | - '15 年', | ||
| 213 | - ], | ||
| 214 | - age_range: { min: 0, max: 100 }, | ||
| 215 | - insurance_period: '终身', | ||
| 216 | - // 提取计划配置 | ||
| 217 | - withdrawal_plan: { | ||
| 218 | - enabled: true, | ||
| 219 | - currencies: ['HKD', 'USD', 'CNY'], // 支持的币种 | ||
| 220 | - default_currency: 'USD', // 统一为美元 | ||
| 221 | - withdrawal_modes: ['指定提取金额', '最高固定提取金额'], | ||
| 222 | - withdrawal_periods: [ | ||
| 223 | - '1年', | ||
| 224 | - '2年', | ||
| 225 | - '3年', | ||
| 226 | - '5年', | ||
| 227 | - '10年', | ||
| 228 | - '15年', | ||
| 229 | - '20年', | ||
| 230 | - '终身' | ||
| 231 | - ] | ||
| 232 | - }, | ||
| 233 | - form_schema: savingsFormSchema, | ||
| 234 | - submit_mapping: savingsSubmitMapping | ||
| 235 | - } | ||
| 236 | - }, | ||
| 237 | - | ||
| 238 | - // GC - 宏挚家传保险计划 | ||
| 239 | - 'savings-gc': { | ||
| 240 | - name: '宏挚家传保险计划', | ||
| 241 | - component: 'SavingsTemplate', | ||
| 242 | - category: 'savings', | ||
| 243 | - config: { | ||
| 244 | - currency: 'USD', | ||
| 245 | - payment_periods: [ | ||
| 246 | - '整付', | ||
| 247 | - '3 年', | ||
| 248 | - '5 年', | ||
| 249 | - ], | ||
| 250 | - age_range: { min: 0, max: 100 }, | ||
| 251 | - insurance_period: '终身', | ||
| 252 | - withdrawal_plan: { | ||
| 253 | - enabled: true, | ||
| 254 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 255 | - default_currency: 'USD', // 统一为美元 | ||
| 256 | - withdrawal_modes: ['指定提取金额', '最高固定提取金额'], | ||
| 257 | - withdrawal_periods: [ | ||
| 258 | - '1年', | ||
| 259 | - '2年', | ||
| 260 | - '3年', | ||
| 261 | - '5年', | ||
| 262 | - '10年', | ||
| 263 | - '15年', | ||
| 264 | - '20年', | ||
| 265 | - '终身' | ||
| 266 | - ] | ||
| 267 | - }, | ||
| 268 | - form_schema: savingsFormSchema, | ||
| 269 | - submit_mapping: savingsSubmitMapping | ||
| 270 | - } | ||
| 271 | - }, | ||
| 272 | - | ||
| 273 | - // FA - 宏浚传承保障计划 | ||
| 274 | - 'savings-fa': { | ||
| 275 | - name: '宏浚传承保障计划', | ||
| 276 | - component: 'SavingsTemplate', | ||
| 277 | - category: 'savings', | ||
| 278 | - config: { | ||
| 279 | - currency: 'USD', | ||
| 280 | - payment_periods: [ | ||
| 281 | - '整付', | ||
| 282 | - '2 年', | ||
| 283 | - '5 年', | ||
| 284 | - ], | ||
| 285 | - age_range: { min: 0, max: 100 }, | ||
| 286 | - insurance_period: '终身', | ||
| 287 | - withdrawal_plan: { | ||
| 288 | - enabled: true, | ||
| 289 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 290 | - default_currency: 'USD', // 统一为美元 | ||
| 291 | - withdrawal_modes: ['指定提取金额', '最高固定提取金额'], | ||
| 292 | - withdrawal_periods: [ | ||
| 293 | - '1年', | ||
| 294 | - '2年', | ||
| 295 | - '3年', | ||
| 296 | - '5年', | ||
| 297 | - '10年', | ||
| 298 | - '15年', | ||
| 299 | - '20年', | ||
| 300 | - '终身' | ||
| 301 | - ] | ||
| 302 | - }, | ||
| 303 | - form_schema: savingsFormSchema, | ||
| 304 | - submit_mapping: savingsSubmitMapping | ||
| 305 | - } | ||
| 306 | - }, | ||
| 307 | - | ||
| 308 | - // LV2 - 赤霞珠终身寿险计划2(储蓄型终身寿险) | ||
| 309 | - 'savings-lv2': { | ||
| 310 | - name: '赤霞珠终身寿险计划2', | ||
| 311 | - component: 'SavingsTemplate', | ||
| 312 | - category: 'savings', | ||
| 313 | - config: { | ||
| 314 | - currency: 'USD', | ||
| 315 | - payment_periods: [ | ||
| 316 | - '5 年', | ||
| 317 | - '8 年', | ||
| 318 | - '12 年', | ||
| 319 | - '15 年', | ||
| 320 | - ], | ||
| 321 | - age_range: { min: 0, max: 100 }, | ||
| 322 | - insurance_period: '终身', | ||
| 323 | - withdrawal_plan: { | ||
| 324 | - enabled: true, | ||
| 325 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 326 | - default_currency: 'USD', // 统一为美元 | ||
| 327 | - withdrawal_modes: ['指定提取金额', '最高固定提取金额'], | ||
| 328 | - withdrawal_periods: [ | ||
| 329 | - '1年', | ||
| 330 | - '2年', | ||
| 331 | - '3年', | ||
| 332 | - '5年', | ||
| 333 | - '10年', | ||
| 334 | - '15年', | ||
| 335 | - '20年', | ||
| 336 | - '终身' | ||
| 337 | - ] | ||
| 338 | - }, | ||
| 339 | - form_schema: savingsFormSchema, | ||
| 340 | - submit_mapping: savingsSubmitMapping | ||
| 341 | - } | ||
| 342 | - }, | ||
| 343 | - | ||
| 344 | - /** | ||
| 345 | - * 测试计划书-智享未来2 | ||
| 346 | - * @added 2026-02-14T14:12:31.658Z | ||
| 347 | - * @source docs/to-parse/测试计划书-智享未来2.md | ||
| 348 | - */ | ||
| 349 | - 'savings-2-148b3acd': { | ||
| 350 | - name: '测试计划书-智享未来2', | ||
| 351 | - component: 'SavingsTemplate', | ||
| 352 | - category: 'savings', | ||
| 353 | - config: { | ||
| 354 | - currency: 'USD', | ||
| 355 | - payment_periods: ["整付","3年","5年"], | ||
| 356 | - age_range: { min: 0, max: 75 }, | ||
| 357 | - insurance_period: '终身', | ||
| 358 | - withdrawal_plan: { | ||
| 359 | - enabled: true, | ||
| 360 | - currencies: ['HKD', 'USD', 'CNY'], | ||
| 361 | - default_currency: 'USD', | ||
| 362 | - withdrawal_modes: ["年龄指定金额","最高固定金额"], | ||
| 363 | - withdrawal_periods: ["1年","3年","5年","10年"] | ||
| 364 | - }, | ||
| 365 | - form_schema: savingsFormSchema, | ||
| 366 | - submit_mapping: savingsSubmitMapping | ||
| 367 | - } | ||
| 368 | - }} | ||
| 369 | - | ||
| 370 | -/** | ||
| 371 | - * 全局功能开关 | ||
| 372 | - * @description 用于控制实验性功能或未来扩展功能的开关 | ||
| 373 | - * | ||
| 374 | - * @example 开启多币种功能:设置 MULTI_CURRENCY_ENABLED = true | ||
| 375 | - */ | ||
| 376 | -export const FEATURE_FLAGS = { | ||
| 377 | - /** | ||
| 378 | - * 多币种切换功能 | ||
| 379 | - * @description false: 方案 1 - 固定币种(当前实现) | ||
| 380 | - * true: 方案 2 - 支持多币种切换(未来扩展) | ||
| 381 | - * @type {boolean} | ||
| 382 | - */ | ||
| 383 | - MULTI_CURRENCY_ENABLED: false | ||
| 384 | -} | ||
| 385 | - | ||
| 386 | -/** | ||
| 387 | - * 币种符号映射 | ||
| 388 | - * @description 币种代码到符号的映射关系 | ||
| 389 | - */ | ||
| 390 | -export const CURRENCY_SYMBOLS = { | ||
| 391 | - CNY: '¥', // 人民币 | ||
| 392 | - USD: '$', // 美元 | ||
| 393 | - HKD: 'HK$', // 港币 | ||
| 394 | - EUR: '€' // 欧元 | ||
| 395 | -} | ||
| 396 | - | ||
| 397 | -/** | ||
| 398 | - * 币种完整信息映射 | ||
| 399 | - * @description 币种代码到完整信息的映射(用于多币种模式) | ||
| 400 | - */ | ||
| 401 | -export const CURRENCY_MAP = { | ||
| 402 | - CNY: { label: '人民币', symbol: '¥', value: 'CNY' }, | ||
| 403 | - USD: { label: '美元', symbol: '$', value: 'USD' }, | ||
| 404 | - HKD: { label: '港币', symbol: 'HK$', value: 'HKD' }, | ||
| 405 | - EUR: { label: '欧元', symbol: '€', value: 'EUR' } | ||
| 406 | -} | ||
| 407 | - | ||
| 408 | -/** | ||
| 409 | - * 根据 form_sn 获取模版配置 | ||
| 410 | - * @param {string} formSn - 产品 API 返回的 form_sn 字段 | ||
| 411 | - * @returns {Object|null} 模版配置对象,未找到返回 null | ||
| 412 | - * | ||
| 413 | - * @example | ||
| 414 | - * const config = getTemplateConfig('life-insurance-wiop3e') | ||
| 415 | - * // 返回: { name: 'WIOP3E...', component: 'LifeInsuranceTemplate', config: {...} } | ||
| 416 | - */ | ||
| 417 | -export function getTemplateConfig(formSn) { | ||
| 418 | - if (!formSn) { | ||
| 419 | - console.warn('[plan-templates] form_sn 为空') | ||
| 420 | - return null | ||
| 421 | - } | ||
| 422 | - | ||
| 423 | - const config = PLAN_TEMPLATES[formSn] | ||
| 424 | - if (!config) { | ||
| 425 | - console.error(`[plan-templates] 未找到模版配置: ${formSn}`) | ||
| 426 | - return null | ||
| 427 | - } | ||
| 428 | - | ||
| 429 | - return config | ||
| 430 | -} | ||
| 431 | - | ||
| 432 | -/** | ||
| 433 | - * 获取币种符号 | ||
| 434 | - * @param {string} currencyCode - 币种代码(CNY/USD/HKD/EUR) | ||
| 435 | - * @returns {string} 币种符号 | ||
| 436 | - * | ||
| 437 | - * @example | ||
| 438 | - * const symbol = getCurrencySymbol('USD') // 返回: '$' | ||
| 439 | - */ | ||
| 440 | -export function getCurrencySymbol(currencyCode) { | ||
| 441 | - return CURRENCY_SYMBOLS[currencyCode] || '¥' | ||
| 442 | -} |
-
Please register or login to post a comment