【fix】 修复建议书中, 姓名校验添加与电投流程一致,修复在选择数据不完整个的客户时,出现的异常情况。

This commit is contained in:
tian.guangyuan
2020-04-16 14:06:10 +08:00
parent b2b6500fbc
commit b80adf37e3
2 changed files with 14 additions and 9 deletions

View File

@@ -5,7 +5,7 @@
class="border-bottom"
@nameChange="nameChange"
@on-choose="chooseCustomer"
v-validate="'required'"
v-validate="'required|name'"
:required="true"
name="投保人"
label="姓名"

View File

@@ -8,7 +8,7 @@
class="border-bottom"
@nameChange="nameChange"
@on-choose="chooseCustomer"
v-validate="'required'"
v-validate="'required|name'"
name="被保险人"
required
:readonly="disabled"
@@ -338,17 +338,22 @@ export default {
})
console.log('data == ', data)
let { customerName, customerSex, birthday, customerPhone, occupationName, occupationCode, lifeGrade, healthGrade, socialSecurity } = data
let age = getAge.getAge(data['birthday'], new Date())
let age = ''
try {
age = getAge.getAge(data['birthday'], new Date())
} catch (e) {
console.error(e)
}
let insured = {
mobile: customerPhone,
birthday,
sex: String(customerSex),
birthday: birthday,
sex: customerSex ? customerSex.toString() : '0',
name: customerName,
occupationName,
occupationName: occupationName,
age: age,
occupationCode,
lifeGrade,
healthGrade,
occupationCode: occupationCode,
lifeGrade: lifeGrade,
healthGrade: healthGrade,
medical: socialSecurity ? socialSecurity : '0'
}
console.log('insured.age', insured.age)