清理$calcAge
This commit is contained in:
		| @@ -765,9 +765,10 @@ | ||||
|  | ||||
| <script> | ||||
| import {mapState} from "vuex"; | ||||
| import {ID} from "dvcp-ui/lib/js/utils"; | ||||
|  | ||||
| export default { | ||||
|   name: "Add", | ||||
|  | ||||
|   props: { | ||||
|     instance: Function, | ||||
|     dict: Object, | ||||
| @@ -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 | ||||
|       } | ||||
|     } | ||||
|   }, | ||||
|   | ||||
| @@ -328,6 +328,7 @@ | ||||
| <script> | ||||
|  | ||||
| import {mapState} from "vuex"; | ||||
| import {ID} from "dvcp-ui/lib/js/utils"; | ||||
|  | ||||
| export default { | ||||
|   name: "hrAdd", | ||||
| @@ -453,8 +454,8 @@ export default { | ||||
|       if (v.length == 20) { | ||||
|         idNumber = v.substring(0, 18) | ||||
|       } | ||||
|       let {birthday: birthDate, sex} = this.idCardNoUtil.getIdCardInfo(idNumber) | ||||
|       this.form = {...this.form, birthDate, sex, age: this.$calcAge(idNumber)} | ||||
|       let {birthday: birthDate, sex, age} = new ID(idNumber) | ||||
|       this.form = {...this.form, birthDate, sex, age} | ||||
|     }, | ||||
|     submit() { | ||||
|       if (this.form.houseType == 1) { | ||||
|   | ||||
| @@ -497,6 +497,7 @@ | ||||
| import {mapState} from "vuex"; | ||||
| import HrMeasure from "./detail/hrMeasure"; | ||||
| import HrLog from "./detail/hrLog"; | ||||
| import {ID} from "dvcp-ui/lib/js/utils"; | ||||
|  | ||||
| export default { | ||||
|   name: "hrDetail", | ||||
| @@ -677,8 +678,8 @@ export default { | ||||
|       }) | ||||
|     }, | ||||
|     handleIdNumberAutocomplete(v) { | ||||
|       let {birthday: birthDate, sex} = this.idCardNoUtil.getIdCardInfo(v); | ||||
|       this.form = {...this.form, birthDate, sex, age: this.$calcAge(v)}; | ||||
|       let {birthday: birthDate, sex, age} = new ID(v); | ||||
|       this.form = {...this.form, birthDate, sex, age}; | ||||
|     }, | ||||
|     onConfirm() { | ||||
|       this.$refs.ruleForm.validate((v) => { | ||||
|   | ||||
| @@ -667,6 +667,8 @@ | ||||
|  | ||||
| <script> | ||||
| import {mapState} from "vuex"; | ||||
| import {ID} from "dvcp-ui/lib/js/utils"; | ||||
|  | ||||
| export default { | ||||
|   name: "Add", | ||||
|  | ||||
| @@ -845,10 +847,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) { | ||||
| @@ -997,9 +999,11 @@ export default { | ||||
|   .audit-1 { | ||||
|     color: #2ea222 !important; | ||||
|   } | ||||
|  | ||||
|   ::v-deep .ai-form .el-form-item .el-form-item__content { | ||||
|     margin-left: 174px !important; | ||||
|   } | ||||
|  | ||||
|   ::v-deep .ai-form .el-form-item, | ||||
|   ::v-deep .el-form-item { | ||||
|     margin-bottom: 8px !important; | ||||
|   | ||||
| @@ -46,6 +46,8 @@ | ||||
|  | ||||
| <script> | ||||
| import {mapState} from 'vuex' | ||||
| import {ID} from "dvcp-ui/lib/js/utils"; | ||||
|  | ||||
| export default { | ||||
|   name: 'List', | ||||
|  | ||||
| @@ -77,12 +79,6 @@ | ||||
|  | ||||
|   computed: { | ||||
|     ...mapState(['user']), | ||||
|  | ||||
|       param () { | ||||
|         return { | ||||
|  | ||||
|         } | ||||
|       } | ||||
|   }, | ||||
|  | ||||
|   created() { | ||||
| @@ -100,11 +96,10 @@ | ||||
|       }).then(res => { | ||||
|         if (res.code == 0) { | ||||
|           this.tableData = res.data.records.map(v => { | ||||
|               let info = this.idCardNoUtil.getIdCardInfo(v.idNumber) | ||||
|             let info = new ID(v.idNumber) | ||||
|             v.birthday = info.birthday | ||||
|               v.age = this.$calcAge(v.idNumber) | ||||
|             v.age = info.age | ||||
|             v.gender = info.gender | ||||
|  | ||||
|             return v | ||||
|           }) | ||||
|           this.total = res.data.total | ||||
|   | ||||
| @@ -46,6 +46,8 @@ | ||||
|  | ||||
| <script> | ||||
| import {mapState} from 'vuex' | ||||
| import {ID} from "dvcp-ui/lib/js/utils"; | ||||
|  | ||||
| export default { | ||||
|   name: 'List', | ||||
|  | ||||
| @@ -77,12 +79,6 @@ | ||||
|  | ||||
|   computed: { | ||||
|     ...mapState(['user']), | ||||
|  | ||||
|       param () { | ||||
|         return { | ||||
|  | ||||
|         } | ||||
|       } | ||||
|   }, | ||||
|  | ||||
|   created() { | ||||
| @@ -100,9 +96,9 @@ | ||||
|       }).then(res => { | ||||
|         if (res.code == 0) { | ||||
|           this.tableData = res.data.records.map(v => { | ||||
|               let info = this.idCardNoUtil.getIdCardInfo(v.idNumber) | ||||
|             let info = new ID(v.idNumber) | ||||
|             v.birthday = info.birthday | ||||
|               v.age = this.$calcAge(v.idNumber) | ||||
|             v.age = info.age | ||||
|             v.gender = info.gender | ||||
|  | ||||
|             return v | ||||
|   | ||||
| @@ -46,6 +46,8 @@ | ||||
|  | ||||
| <script> | ||||
| import {mapState} from 'vuex' | ||||
| import {ID} from "dvcp-ui/lib/js/utils"; | ||||
|  | ||||
| export default { | ||||
|   name: 'List', | ||||
|  | ||||
| @@ -77,12 +79,6 @@ | ||||
|  | ||||
|   computed: { | ||||
|     ...mapState(['user']), | ||||
|  | ||||
|       param () { | ||||
|         return { | ||||
|  | ||||
|         } | ||||
|       } | ||||
|   }, | ||||
|  | ||||
|   created() { | ||||
| @@ -100,11 +96,10 @@ | ||||
|       }).then(res => { | ||||
|         if (res.code == 0) { | ||||
|           this.tableData = res.data.records.map(v => { | ||||
|               let info = this.idCardNoUtil.getIdCardInfo(v.idNumber) | ||||
|             let info = new ID(v.idNumber) | ||||
|             v.birthday = info.birthday | ||||
|               v.age = this.$calcAge(v.idNumber) | ||||
|             v.age = info.age | ||||
|             v.gender = info.gender | ||||
|  | ||||
|             return v | ||||
|           }) | ||||
|           this.total = res.data.total | ||||
|   | ||||
| @@ -46,6 +46,8 @@ | ||||
|  | ||||
| <script> | ||||
| import {mapState} from 'vuex' | ||||
| import {ID} from "dvcp-ui/lib/js/utils" | ||||
|  | ||||
| export default { | ||||
|   name: 'List', | ||||
|  | ||||
| @@ -77,12 +79,6 @@ | ||||
|  | ||||
|   computed: { | ||||
|     ...mapState(['user']), | ||||
|  | ||||
|       param () { | ||||
|         return { | ||||
|  | ||||
|         } | ||||
|       } | ||||
|   }, | ||||
|  | ||||
|   created() { | ||||
| @@ -100,11 +96,10 @@ | ||||
|       }).then(res => { | ||||
|         if (res.code == 0) { | ||||
|           this.tableData = res.data.records.map(v => { | ||||
|               let info = this.idCardNoUtil.getIdCardInfo(v.idNumber) | ||||
|             let info = new ID(v.idNumber) | ||||
|             v.birthday = info.birthday | ||||
|               v.age = this.$calcAge(v.idNumber) | ||||
|             v.age = info.age | ||||
|             v.gender = info.gender | ||||
|  | ||||
|             return v | ||||
|           }) | ||||
|           this.total = res.data.total | ||||
|   | ||||
| @@ -46,6 +46,8 @@ | ||||
|  | ||||
| <script> | ||||
| import {mapState} from 'vuex' | ||||
| import {ID} from "dvcp-ui/lib/js/utils"; | ||||
|  | ||||
| export default { | ||||
|   name: 'List', | ||||
|  | ||||
| @@ -74,17 +76,9 @@ | ||||
|       loading: false | ||||
|     } | ||||
|   }, | ||||
|  | ||||
|   computed: { | ||||
|     ...mapState(['user']), | ||||
|  | ||||
|       param () { | ||||
|         return { | ||||
|  | ||||
|         } | ||||
|       } | ||||
|   }, | ||||
|  | ||||
|   created() { | ||||
|     this.dict.load('sex').then(() => { | ||||
|       this.getList() | ||||
| @@ -100,11 +94,10 @@ | ||||
|       }).then(res => { | ||||
|         if (res.code == 0) { | ||||
|           this.tableData = res.data.records.map(v => { | ||||
|               let info = this.idCardNoUtil.getIdCardInfo(v.idNumber) | ||||
|             let info = new ID(v.idNumber) | ||||
|             v.birthday = info.birthday | ||||
|               v.age = this.$calcAge(v.idNumber) | ||||
|             v.age = info.age | ||||
|             v.gender = info.gender | ||||
|  | ||||
|             return v | ||||
|           }) | ||||
|           this.total = res.data.total | ||||
|   | ||||
		Reference in New Issue
	
	Block a user