hookehuyr

feat(plan): 储蓄类计划书表单调整

- 移除吸烟字段(储蓄类产品不需要)
- 切断年龄与出生日期的自动联动,客户要求独立填写
- 更新 savingsSubmitMapping 移除吸烟字段映射

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
......@@ -149,7 +149,7 @@
* 储蓄型保险计划书模板
*
* @description GS/GC/FA/LV2 等储蓄型保险产品的计划书录入表单
* - 表单字段:性别、出生年月日、是否吸烟、保额、缴费年期
* - 表单字段:性别、出生年月日、年缴保费、缴费年期
* - 提取计划:指定提取金额(按年岁/按保单年度)、最高固定提取金额
* @author Claude Code
* @example
......@@ -592,32 +592,30 @@ watch(
}
)
/**
* 年龄与出生年月日自动计算逻辑
* - 填年龄 → 推算生日(默认当年1月1日)
* - 填生日 → 计算年龄
*/
watch(
() => form.age,
(newAge) => {
if (!isEmptyValue(newAge) && isEmptyValue(form.birthday)) {
const currentYear = new Date().getFullYear()
const birthYear = currentYear - parseInt(newAge)
form.birthday = `${birthYear}-01-01`
}
}
)
watch(
() => form.birthday,
(newBirthday) => {
if (!isEmptyValue(newBirthday)) {
const birthYear = new Date(newBirthday).getFullYear()
const currentYear = new Date().getFullYear()
form.age = currentYear - birthYear
}
}
)
// TODO(human): 年龄与出生年月日已取消联动,客户要求二者独立填写
// 如需恢复联动,可取消以下代码的注释
//
// watch(
// () => form.age,
// (newAge) => {
// if (!isEmptyValue(newAge) && isEmptyValue(form.birthday)) {
// const currentYear = new Date().getFullYear()
// const birthYear = currentYear - parseInt(newAge)
// form.birthday = `${birthYear}-01-01`
// }
// }
// )
//
// watch(
// () => form.birthday,
// (newBirthday) => {
// if (!isEmptyValue(newBirthday)) {
// const birthYear = new Date(newBirthday).getFullYear()
// const currentYear = new Date().getFullYear()
// form.age = currentYear - birthYear
// }
// }
// )
/**
* 提取年期选项(从配置读取)
......
......@@ -61,8 +61,16 @@ const protectionFormSchema = {
}
// 储蓄类提交字段映射(在基础映射上追加提取计划字段)
// @updated 2026-02-28 - 移除吸烟字段映射(储蓄类产品不需要)
const savingsSubmitMapping = {
...baseSubmitMapping,
customer_name: { api_field: 'customer_name' },
gender: { api_field: 'customer_gender' },
age: { api_field: 'customer_age' },
birthday: { api_field: 'customer_birthday' },
// smoker: { api_field: 'smoking_status' }, // 储蓄类产品不需要吸烟字段
coverage: { api_field: 'annual_premium', transform: 'fen_to_yuan' },
payment_period: { api_field: 'payment_years' },
total_amount: { api_field: 'total_premium', transform: 'fen_to_yuan' },
withdrawal_enabled: { api_field: 'allow_reduce_amount' },
withdrawal_mode: { api_field: 'withdrawal_option' },
withdrawal_method: { api_field: 'withdrawal_method' },
......@@ -77,6 +85,7 @@ const savingsSubmitMapping = {
// 储蓄类表单 Schema(渲染 + 校验 + 联动的唯一入口)
// @updated 2026-02-15 - 迁移到新的条件规则格式,使用 clear_when_hidden 替代 reset_map
// @updated 2026-02-25 - 年龄与出生年月日二选一填写
// @updated 2026-02-28 - 移除吸烟字段(储蓄类产品不需要)
const savingsFormSchema = {
// 基础字段:非提取计划部分
base_fields: [
......@@ -85,7 +94,6 @@ const savingsFormSchema = {
// 年龄与出生年月日二选一填写
{ id: 'age', key: 'age', type: 'age', label: '年龄', placeholder: '请输入年龄', input_label: '岁', required: false },
{ id: 'birthday', key: 'birthday', type: 'date', label: '出生年月日', placeholder: '请选择年月日', required: false },
{ id: 'smoker', key: 'smoker', type: 'radio', label: '是否吸烟', options: ['是', '否'], required: true },
{ id: 'coverage', key: 'coverage', type: 'amount', label: '年缴保费', placeholder: '请输入年缴保费', input_label: '请输入年缴保费金额', required: true, currency_from: 'currency' },
{ id: 'payment_period', key: 'payment_period', type: 'payment_period', label: '缴费年期', required: true, options_from: 'payment_periods' }
],
......
......@@ -31,8 +31,8 @@
<!-- 作者和日期 -->
<view class="article-meta">
<text v-if="article.authorName" class="meta-item">{{ article.authorName }}</text>
<text v-if="article.authorName && article.date" class="meta-separator">·</text>
<!-- <text v-if="article.authorName" class="meta-item">{{ article.authorName }}</text>
<text v-if="article.authorName && article.date" class="meta-separator">·</text> -->
<text v-if="article.date" class="meta-item">{{ formattedDate }}</text>
</view>
</view>
......