清理$calcAge
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
:maxLength="15"
|
||||
placeholder="请输入姓名"
|
||||
v-model="form.name"
|
||||
|
||||
|
||||
>
|
||||
<template slot="append" v-if="!isEdit">
|
||||
<ai-person-select
|
||||
@@ -765,16 +765,17 @@
|
||||
|
||||
<script>
|
||||
import {mapState} from "vuex";
|
||||
import {ID} from "dvcp-ui/lib/js/utils";
|
||||
|
||||
export default {
|
||||
name: "Add",
|
||||
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
selected: Object
|
||||
},
|
||||
computed: {
|
||||
...mapState(["user"]),
|
||||
...mapState(["user"]),
|
||||
isEdit() {
|
||||
return !!this.$route.query.id;
|
||||
},
|
||||
@@ -938,10 +939,10 @@ export default {
|
||||
this.isShowDisciplinaryForm = true;
|
||||
},
|
||||
idChange(val) {
|
||||
let info = this.idCardNoUtil.getIdCardInfo(val)
|
||||
let info = new ID(val)
|
||||
this.form.sex = info.sex || "";
|
||||
this.form.birthday = info.birthday || "";
|
||||
this.form.age = this.$calcAge(val) || "";
|
||||
this.form.age = info.age
|
||||
},
|
||||
checkName(val) {
|
||||
for (let i in this.form) {
|
||||
|
||||
@@ -434,6 +434,7 @@ import {mapState} from "vuex";
|
||||
import AiEditCard from "./components/AiEditCard";
|
||||
import PersonalAssets from "./components/personalAssets";
|
||||
import TagsManage from "./components/tagsManage";
|
||||
import {ID} from "dvcp-ui/lib/js/utils";
|
||||
|
||||
export default {
|
||||
name: "residentDetail",
|
||||
@@ -685,10 +686,10 @@ export default {
|
||||
},
|
||||
IdCard(UUserCard) {
|
||||
if (UUserCard) {
|
||||
this.baseInfo.age = this.$calcAge(UUserCard)
|
||||
let {birthday, sex} = this.idCardNoUtil.getIdCardInfo(UUserCard)
|
||||
this.baseInfo.sex = sex
|
||||
this.baseInfo.birthday = birthday
|
||||
const idCard = new ID(UUserCard)
|
||||
this.baseInfo.age = idCard.age
|
||||
this.baseInfo.sex = idCard.sex
|
||||
this.baseInfo.birthday = idCard.birthday
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user