From 127f95fdf2d2560c5874a79a4013c89a0ce25e56 Mon Sep 17 00:00:00 2001 From: dwq <15731277156@163.com> Date: Wed, 25 Aug 2021 11:37:28 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=85=A5=E5=8F=B8=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=91---=E6=80=A7=E5=88=AB=E4=B8=8E=E5=AE=B6=E5=BA=AD?= =?UTF-8?q?=E5=85=B3=E7=B3=BB=20=E8=BA=AB=E4=BB=BD=E8=AF=81=E5=8F=B7?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agentEenter/AgentEenterBasicFamily.vue | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/views/ebiz/agentEenter/AgentEenterBasicFamily.vue b/src/views/ebiz/agentEenter/AgentEenterBasicFamily.vue index 86ced6483..345da87c1 100644 --- a/src/views/ebiz/agentEenter/AgentEenterBasicFamily.vue +++ b/src/views/ebiz/agentEenter/AgentEenterBasicFamily.vue @@ -375,6 +375,10 @@ export default { this.$validator.validate().then(valid => { if (true === valid) { this.userInfo.map(item => { + //0 男 1 女 relationType:0 配偶 1 父亲 2 母亲 + if ((item.sex != 1 && item.relationType == 2) || (item.sex != 0 && item.relationType != 1)) { + return this.$toast('性别录入与家庭关系不符') + } if (item.idType == '1') { //身份证 console.log('证件类型是身份证'); @@ -384,6 +388,22 @@ export default { } else { this.idCardFlag = true; } + if (this.userInfo.idNo.length == '18') { + //18位身份证第17位是性别位, 奇男偶女 + let sexSign = item.idNo.substr(16, 1) + if ((parseInt(sexSign) % 2 == 0 && item.sex != 1) || (parseInt(sexSign) % 2 != 0 && item.sex != 0)) { + return this.$toast('性别录入与身份证不符') + } + //18位身份证第7-14位是生日位, 年月日 + let birthSign = item.idNo.substr(6, 8) + if ( + item.birthday.substr(0, 4) != birthSign.substr(0, 4) || + item.birthday.substr(5, 2) != birthSign.substr(4, 2) || + item.birthday.substr(8, 2) != birthSign.substr(6, 2) + ) { + return this.$toast('生日录入与身份证不符') + } + } } }); // 循环存储勾选了‘无此亲属关系’选项的数组,给‘userInfo’的集合所对应的对象中添加一个新的字段,用于回显勾选了‘无此亲属关系’的选项 @@ -500,7 +520,7 @@ export default { } //如果证件校验不通过,恢复默认值 if (idToData(val.idNo).text) { - //;[val.idNo, val.birthday] = ['', ''] + ;[val.idNo, val.birthday] = ['', ''] return this.$toast(idToData(val.idNo).text) } val.birthday = idToData(val.idNo).birthday