|
|
|
@ -50,6 +50,24 @@ |
|
|
|
</a-select> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="div-li" v-if="$route.query.name != '编辑患者'"> |
|
|
|
<div class="red--text-box required">证件类型</div> |
|
|
|
<div class="d-flex"> |
|
|
|
<a-select |
|
|
|
class="w-full" |
|
|
|
v-model="base.idCardType" |
|
|
|
placeholder="请选择" |
|
|
|
:disabled="disabled" |
|
|
|
> |
|
|
|
<a-select-option |
|
|
|
:key="index" |
|
|
|
:value="type.id" |
|
|
|
v-for="(type, index) in idCardTypes" |
|
|
|
>{{ type.name }}</a-select-option |
|
|
|
> |
|
|
|
</a-select> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="div-li" v-if="$route.query.name != '编辑患者'"> |
|
|
|
<div class="red--text-box required">证件号码</div> |
|
|
|
<div class="d-flex" style="position: relative"> |
|
|
|
@ -632,17 +650,28 @@ export default { |
|
|
|
if (!this.base.idcard) { |
|
|
|
return; |
|
|
|
} |
|
|
|
var regExp = |
|
|
|
/^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/; |
|
|
|
if (!regExp.test(this.base.idcard)) { |
|
|
|
this.$message.error("身份证格式错误"); |
|
|
|
return; |
|
|
|
if (this.base.idCardType === "1") { |
|
|
|
var regExp = |
|
|
|
/^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/; |
|
|
|
if (!regExp.test(this.base.idcard)) { |
|
|
|
this.$message.error("身份证格式错误"); |
|
|
|
return; |
|
|
|
} |
|
|
|
// 身份证号获取出生日期 |
|
|
|
let year, month, day; |
|
|
|
if (this.base.idcard.length === 15) { |
|
|
|
// 15位身份证:年份是后两位,需要加上1900 |
|
|
|
year = "19" + this.base.idcard.substring(6, 8); |
|
|
|
month = this.base.idcard.substring(8, 10); |
|
|
|
day = this.base.idcard.substring(10, 12); |
|
|
|
} else { |
|
|
|
// 18位身份证 |
|
|
|
year = this.base.idcard.substring(6, 10); |
|
|
|
month = this.base.idcard.substring(10, 12); |
|
|
|
day = this.base.idcard.substring(12, 14); |
|
|
|
} |
|
|
|
this.base.birthday = `${year}-${month}-${day}`; |
|
|
|
} |
|
|
|
// 身份证号获取出生日期 |
|
|
|
const year = this.base.idcard.substring(6, 10); |
|
|
|
const month = this.base.idcard.substring(10, 12); |
|
|
|
const day = this.base.idcard.substring(12, 14); |
|
|
|
this.base.birthday = `${year}-${month}-${day}`; |
|
|
|
|
|
|
|
const res = await getRoleList({ |
|
|
|
pageNum: 1, |
|
|
|
|