清理idCardNoUtils,改使用ID对象

This commit is contained in:
aixianling
2022-10-14 13:58:35 +08:00
parent 12b3a48baa
commit cfb0177a45
27 changed files with 193 additions and 162 deletions

View File

@@ -113,6 +113,7 @@
<script>
import { mapState } from 'vuex'
import {ID} from "dvcp-ui/lib/js/utils";
export default {
name: 'Add',
@@ -137,7 +138,7 @@ export default {
let IdNumberPass = (rule, value, callback) => {
if (value) {
if (this.idCardNoUtil.checkIdCardNo(value)) {
if (ID.check(value)) {
callback();
} else {
callback(new Error('身份证号格式错误'))

View File

@@ -51,6 +51,8 @@
</template>
<script>
import {ID} from "dvcp-ui/lib/js/utils";
export default {
name: 'Detail',
@@ -66,14 +68,13 @@
tabTitle: ['人员信息', '走访记录'],
info: {},
list: [],
idNumberInfo: {}
}
},
created () {
if (this.params && this.params.id) {
this.id = this.params.id
this.dict.load('appSpecialSituation', 'appSpecialPlacement', 'appSpecialDenger', 'appSpecialCrime',
'appSpecialControl', 'appSpecialDebug', 'appSpecialDrug', 'appSpecialChangeType', 'appSpecialCure', 'appSpecialDengerLevel',
'appSpecialDisableLevel', 'appSpecialDisableType', 'appSpecialHealth', 'appSpecialMarriage', 'appSpecialTypeFive','isReflection','yesOrNo').then(() => {
@@ -84,13 +85,14 @@
})
}
},
computed:{
idNumberInfo:v=>new ID(v.info.idNumber)
},
methods: {
getInfo (id) {
this.instance.post(`/app/appspecialdisabled/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.info = res.data
this.idNumberInfo = this.idCardNoUtil.getIdCardInfo(res.data.idNumber)
}
})
},