mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-08 11:46:44 +08:00
【建议书优化需求】年龄不能为空后提示7岁未成年人须由其父母投保
This commit is contained in:
committed by
liu.xiaofeng@ebiz-digits.com
parent
eaca6f0840
commit
318441289d
@@ -333,7 +333,6 @@ export default {
|
||||
let localSex = this.insured.sex
|
||||
let relation = this.localInfo.relationToAppnt
|
||||
let resultSex = checkSex(cacheSex, localSex, relation)
|
||||
let resultRelation = checkRelation(relation, this.insured.insuredAge)
|
||||
let ageRule = /^[a-zA-Z\.\s\u4e00-\u9fa5]{2,120}$/
|
||||
if (this.insured.name && !ageRule.test(this.insured.name)) {
|
||||
return Toast.fail('姓名长度为2-120个字符之内,只能输入汉字或者英文')
|
||||
@@ -341,9 +340,6 @@ export default {
|
||||
if (!resultSex) {
|
||||
return Toast.fail('被保险人性别有误')
|
||||
}
|
||||
if (!resultRelation) {
|
||||
return Toast.fail('0-7岁未成年人须由其父母投保')
|
||||
}
|
||||
this.$validator.validate().then(valid => {
|
||||
if (true === valid) {
|
||||
this.fromPath()
|
||||
@@ -362,6 +358,11 @@ export default {
|
||||
}
|
||||
if (fromSelect) {
|
||||
//被保人年龄校验
|
||||
let relation = this.localInfo.relationToAppnt
|
||||
let resultRelation = checkRelation(relation, this.insured.insuredAge)
|
||||
if (!resultRelation) {
|
||||
return Toast.fail('0-7岁未成年人须由其父母投保')
|
||||
}
|
||||
let minAge = getAge.getAge(utils.formatDate(new Date(this.maxDate),'yyyy-MM-dd'), new Date())
|
||||
let maxAge = getAge.getAge('1900-01-01', new Date())
|
||||
if(this.insured.insuredAge < minAge || this.insured.insuredAge > maxAge){
|
||||
|
||||
Reference in New Issue
Block a user