mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-11 16:46:43 +08:00
如果家属角色为配偶,选择性别出现一致时,提示配偶与本人性别不可一致。
This commit is contained in:
@@ -154,19 +154,20 @@ export default {
|
|||||||
{
|
{
|
||||||
relationType: '', // 关系
|
relationType: '', // 关系
|
||||||
name: '', // 姓名
|
name: '', // 姓名
|
||||||
sex: '0', // 性别(枚举值)
|
sex: '', // 性别(枚举值)
|
||||||
idType: '', // 证件类型(枚举值)
|
idType: '', // 证件类型(枚举值)
|
||||||
idNo: '', // 证件号码
|
idNo: '', // 证件号码
|
||||||
birthday: '', // 出生日期
|
birthday: '', // 出生日期
|
||||||
mobile: '' // 联系方式
|
mobile: '' // 联系方式
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
//默认值,父亲性别默认男,母亲性别默认值女,配偶、子女性别默认不选中
|
||||||
// 定义当用户基本信息中婚姻状态选择的是已婚的情况时的数据格式
|
// 定义当用户基本信息中婚姻状态选择的是已婚的情况时的数据格式
|
||||||
userInfoMarried: [
|
userInfoMarried: [
|
||||||
{
|
{
|
||||||
relationType: '0',
|
relationType: '0',
|
||||||
name: '',
|
name: '',
|
||||||
sex: '0',
|
sex: '',
|
||||||
idType: '',
|
idType: '',
|
||||||
idNo: '',
|
idNo: '',
|
||||||
birthday: '',
|
birthday: '',
|
||||||
@@ -186,7 +187,7 @@ export default {
|
|||||||
{
|
{
|
||||||
relationType: '2',
|
relationType: '2',
|
||||||
name: '',
|
name: '',
|
||||||
sex: '0',
|
sex: '1',
|
||||||
idType: '',
|
idType: '',
|
||||||
idNo: '',
|
idNo: '',
|
||||||
birthday: '',
|
birthday: '',
|
||||||
@@ -196,7 +197,7 @@ export default {
|
|||||||
{
|
{
|
||||||
relationType: '3',
|
relationType: '3',
|
||||||
name: '',
|
name: '',
|
||||||
sex: '0',
|
sex: '',
|
||||||
idType: '',
|
idType: '',
|
||||||
idNo: '',
|
idNo: '',
|
||||||
birthday: '',
|
birthday: '',
|
||||||
@@ -219,7 +220,7 @@ export default {
|
|||||||
{
|
{
|
||||||
relationType: '2',
|
relationType: '2',
|
||||||
name: '',
|
name: '',
|
||||||
sex: '0',
|
sex: '1',
|
||||||
idType: '',
|
idType: '',
|
||||||
idNo: '',
|
idNo: '',
|
||||||
birthday: '',
|
birthday: '',
|
||||||
@@ -229,7 +230,7 @@ export default {
|
|||||||
{
|
{
|
||||||
relationType: '3',
|
relationType: '3',
|
||||||
name: '',
|
name: '',
|
||||||
sex: '0',
|
sex: '',
|
||||||
idType: '',
|
idType: '',
|
||||||
idNo: '',
|
idNo: '',
|
||||||
birthday: '',
|
birthday: '',
|
||||||
@@ -257,7 +258,8 @@ export default {
|
|||||||
gtFlag2: true,
|
gtFlag2: true,
|
||||||
currentTime: beforeDate.getBeforeDays(1),
|
currentTime: beforeDate.getBeforeDays(1),
|
||||||
checkedRelationshipList: [], // 定义一个数组集合,储存当前是哪个对象勾选了‘无此亲属关系’选项
|
checkedRelationshipList: [], // 定义一个数组集合,储存当前是哪个对象勾选了‘无此亲属关系’选项
|
||||||
sexDisabled:false
|
sexDisabled:false,
|
||||||
|
ebizEnterCustomerDto:{} //本人信息
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@@ -302,7 +304,7 @@ export default {
|
|||||||
if (res.result == '0') {
|
if (res.result == '0') {
|
||||||
localStorage.removeItem('marriageEnumInfo');
|
localStorage.removeItem('marriageEnumInfo');
|
||||||
localStorage.setItem('marriageEnumInfo', res.content.ebizEnterCustomerDto.marriage);
|
localStorage.setItem('marriageEnumInfo', res.content.ebizEnterCustomerDto.marriage);
|
||||||
|
this.ebizEnterCustomerDto = res.content.ebizEnterCustomerDto
|
||||||
if (res.content.ebizRelationDtoLst.length != 0) {
|
if (res.content.ebizRelationDtoLst.length != 0) {
|
||||||
let result = res.content.ebizRelationDtoLst;
|
let result = res.content.ebizRelationDtoLst;
|
||||||
if (result) {
|
if (result) {
|
||||||
@@ -374,10 +376,21 @@ export default {
|
|||||||
//表单校验, 成功跳转
|
//表单校验, 成功跳转
|
||||||
this.$validator.validate().then(valid => {
|
this.$validator.validate().then(valid => {
|
||||||
if (true === valid) {
|
if (true === valid) {
|
||||||
this.userInfo.map(item => {
|
for(let i = 0; i < this.userInfo.length; i ++) {
|
||||||
|
let item = this.userInfo[i]
|
||||||
|
//在家属信息页面录入后,点击【下一步】做提示,如果家属角色为父亲,选择性别为女,则提示“父亲性别不可为女”,母亲同此规则
|
||||||
//0 男 1 女 relationType:0 配偶 1 父亲 2 母亲
|
//0 男 1 女 relationType:0 配偶 1 父亲 2 母亲
|
||||||
if ((item.sex != 1 && item.relationType == 2) || (item.sex != 0 && item.relationType == 1)) {
|
if (item.sex == 1 && item.relationType == 1) {
|
||||||
return this.$toast(item.name+'性别录入与家庭关系不符')
|
return this.$toast('父亲性别不可为女')
|
||||||
|
}
|
||||||
|
if (item.sex == 0 && item.relationType == 2) {
|
||||||
|
return this.$toast('母亲性别不可为男')
|
||||||
|
}
|
||||||
|
//如果家属角色为配偶,选择性别出现一致时,提示“配偶与本人性别不可一致。”
|
||||||
|
if (item.relationType == 0) {
|
||||||
|
if(item.sex == this.ebizEnterCustomerDto.sex){
|
||||||
|
return this.$toast('配偶与本人性别不可一致。')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (item.idType == '1') {
|
if (item.idType == '1') {
|
||||||
//身份证
|
//身份证
|
||||||
@@ -390,9 +403,10 @@ export default {
|
|||||||
}
|
}
|
||||||
if (item.idNo.length == '18') {
|
if (item.idNo.length == '18') {
|
||||||
//18位身份证第17位是性别位, 奇男偶女
|
//18位身份证第17位是性别位, 奇男偶女
|
||||||
|
//×××性别与证件性别不一致,请修改。
|
||||||
let sexSign = item.idNo.substr(16, 1)
|
let sexSign = item.idNo.substr(16, 1)
|
||||||
if ((parseInt(sexSign) % 2 == 0 && item.sex != 1) || (parseInt(sexSign) % 2 != 0 && item.sex != 0)) {
|
if ((parseInt(sexSign) % 2 == 0 && item.sex != 1) || (parseInt(sexSign) % 2 != 0 && item.sex != 0)) {
|
||||||
return this.$toast(item.name+'性别录入与身份证不符')
|
return this.$toast(item.name+'性别与证件性别不一致,请修改。')
|
||||||
}
|
}
|
||||||
//18位身份证第7-14位是生日位, 年月日
|
//18位身份证第7-14位是生日位, 年月日
|
||||||
let birthSign = item.idNo.substr(6, 8)
|
let birthSign = item.idNo.substr(6, 8)
|
||||||
@@ -405,7 +419,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
// 循环存储勾选了‘无此亲属关系’选项的数组,给‘userInfo’的集合所对应的对象中添加一个新的字段,用于回显勾选了‘无此亲属关系’的选项
|
// 循环存储勾选了‘无此亲属关系’选项的数组,给‘userInfo’的集合所对应的对象中添加一个新的字段,用于回显勾选了‘无此亲属关系’的选项
|
||||||
this.checkedRelationshipList.forEach(item => {
|
this.checkedRelationshipList.forEach(item => {
|
||||||
this.userInfo[item].checkedIndex = item;
|
this.userInfo[item].checkedIndex = item;
|
||||||
|
|||||||
Reference in New Issue
Block a user