From dfb4b2fe117cf5ec4334b78feca6fc67924e48f2 Mon Sep 17 00:00:00 2001 From: lyt Date: Fri, 28 Apr 2023 18:47:09 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=BB=BA=E8=AE=AE=E4=B9=A6=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E9=9C=80=E6=B1=82=E3=80=91=E5=B9=B4=E9=BE=84=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E4=B8=BA=E7=A9=BA=E5=90=8E=E6=8F=90=E7=A4=BA7?= =?UTF-8?q?=E5=B2=81=E6=9C=AA=E6=88=90=E5=B9=B4=E4=BA=BA=E9=A1=BB=E7=94=B1?= =?UTF-8?q?=E5=85=B6=E7=88=B6=E6=AF=8D=E6=8A=95=E4=BF=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ebiz/proposal/InsuredPerson.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/views/ebiz/proposal/InsuredPerson.vue b/src/views/ebiz/proposal/InsuredPerson.vue index 55eae45c9..b5bfac3bf 100644 --- a/src/views/ebiz/proposal/InsuredPerson.vue +++ b/src/views/ebiz/proposal/InsuredPerson.vue @@ -334,7 +334,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个字符之内,只能输入汉字或者英文') @@ -342,9 +341,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() @@ -363,6 +359,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){