From b80adf37e3f69e300afcd013aa3ed7ac7ea38b38 Mon Sep 17 00:00:00 2001 From: "tian.guangyuan" Date: Thu, 16 Apr 2020 14:06:10 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90fix=E3=80=91=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=BB=BA=E8=AE=AE=E4=B9=A6=E4=B8=AD=EF=BC=8C=20=E5=A7=93?= =?UTF-8?q?=E5=90=8D=E6=A0=A1=E9=AA=8C=E6=B7=BB=E5=8A=A0=E4=B8=8E=E7=94=B5?= =?UTF-8?q?=E6=8A=95=E6=B5=81=E7=A8=8B=E4=B8=80=E8=87=B4=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=9C=A8=E9=80=89=E6=8B=A9=E6=95=B0=E6=8D=AE=E4=B8=8D?= =?UTF-8?q?=E5=AE=8C=E6=95=B4=E4=B8=AA=E7=9A=84=E5=AE=A2=E6=88=B7=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=87=BA=E7=8E=B0=E7=9A=84=E5=BC=82=E5=B8=B8=E6=83=85?= =?UTF-8?q?=E5=86=B5=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ebiz/proposal/Appnt.vue | 2 +- src/views/ebiz/proposal/InsuredPerson.vue | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/views/ebiz/proposal/Appnt.vue b/src/views/ebiz/proposal/Appnt.vue index 2a3d0ed6a..8183008ba 100644 --- a/src/views/ebiz/proposal/Appnt.vue +++ b/src/views/ebiz/proposal/Appnt.vue @@ -5,7 +5,7 @@ class="border-bottom" @nameChange="nameChange" @on-choose="chooseCustomer" - v-validate="'required'" + v-validate="'required|name'" :required="true" name="投保人" label="姓名" diff --git a/src/views/ebiz/proposal/InsuredPerson.vue b/src/views/ebiz/proposal/InsuredPerson.vue index d7042aef6..5b6c91915 100644 --- a/src/views/ebiz/proposal/InsuredPerson.vue +++ b/src/views/ebiz/proposal/InsuredPerson.vue @@ -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)