清理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

@@ -52,6 +52,8 @@
</template>
<script>
import {ID} from "dvcp-ui/lib/js/utils";
export default {
name: 'Detail',
@@ -60,21 +62,22 @@
dict: Object,
params: Object
},
computed:{
idNumberInfo:v=>new ID(v.info.idNumber)
},
data () {
return {
currIndex: 0,
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(() => {
@@ -91,7 +94,6 @@
this.instance.post(`/app/appspecialadjustment/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.info = res.data
this.idNumberInfo = this.idCardNoUtil.getIdCardInfo(res.data.idNumber)
}
})
},

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)
}
})
},

View File

@@ -113,6 +113,7 @@
<script>
import { mapState } from 'vuex'
import {ID} from "dvcp-ui/lib/js/utils";
export default {
name: 'Add',
@@ -150,7 +151,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

@@ -53,6 +53,8 @@
</template>
<script>
import {ID} from "dvcp-ui/lib/js/utils";
export default {
name: 'Detail',
@@ -68,14 +70,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(() => {
@@ -86,13 +87,14 @@
})
}
},
computed:{
idNumberInfo:v=>new ID(v.info.idNumber)
},
methods: {
getInfo (id) {
this.instance.post(`/app/appspecialdrug/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.info = res.data
this.idNumberInfo = this.idCardNoUtil.getIdCardInfo(res.data.idNumber)
}
})
},

View File

@@ -113,6 +113,7 @@
<script>
import { mapState } from 'vuex'
import {ID} from "dvcp-ui/lib/js/utils";
export default {
name: 'Add',
@@ -150,7 +151,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

@@ -52,6 +52,8 @@
</template>
<script>
import {ID} from "dvcp-ui/lib/js/utils";
export default {
name: 'Detail',
@@ -67,14 +69,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(() => {
@@ -85,13 +86,14 @@
})
}
},
computed:{
idNumberInfo:v=>new ID(v.info.idNumber)
},
methods: {
getInfo (id) {
this.instance.post(`/app/appspecialmental/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.info = res.data
this.idNumberInfo = this.idCardNoUtil.getIdCardInfo(res.data.idNumber)
}
})
},

View File

@@ -113,6 +113,7 @@
<script>
import { mapState } from 'vuex'
import {ID} from "dvcp-ui/lib/js/utils";
export default {
name: 'Add',
@@ -134,10 +135,10 @@ 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

@@ -1,4 +1,4 @@
<template>
<template>
<ai-detail class="AppSpecial" isHasSidebar>
<template slot="title">
<ai-title title="详情" isShowBack isShowBottomBorder @onBackClick="cancel(true)">
@@ -55,145 +55,147 @@
</template>
<script>
export default {
name: 'Detail',
import {ID} from "dvcp-ui/lib/js/utils";
props: {
instance: Function,
dict: Object,
params: Object
export default {
name: 'Detail',
props: {
instance: Function,
dict: Object,
params: Object
},
computed: {
idNumberInfo: v => new ID(v.info.idNumber)
},
data() {
return {
currIndex: 0,
tabTitle: ['人员信息', '走访记录'],
info: {},
list: [],
}
},
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(() => {
this.getInfo(this.params.id)
})
this.dict.load('visitCondolenceReality').then(() => {
this.getList()
})
}
},
methods: {
getInfo(id) {
this.instance.post(`/app/appspecialprison/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.info = res.data
}
})
},
data () {
return {
currIndex: 0,
tabTitle: ['人员信息', '走访记录'],
info: {},
list: [],
idNumberInfo: {}
}
getList() {
this.instance.post(`/app/appvisitvondolence/list`, null, {
params: {
applicationId: 4,
size: 1000
}
}).then(res => {
if (res.code == 0) {
this.list = res.data.records
}
})
},
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(() => {
this.getInfo(this.params.id)
})
this.dict.load('visitCondolenceReality').then(() => {
this.getList()
})
}
},
methods: {
getInfo (id) {
this.instance.post(`/app/appspecialprison/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.info = res.data
this.idNumberInfo = this.idCardNoUtil.getIdCardInfo(res.data.idNumber)
}
})
},
getList () {
this.instance.post(`/app/appvisitvondolence/list`, null, {
params: {
applicationId: 4,
size: 1000
}
}).then(res => {
if (res.code == 0) {
this.list = res.data.records
}
})
},
cancel (isRefresh) {
this.$emit('change', {
type: 'List',
isRefresh: !!isRefresh
})
}
cancel(isRefresh) {
this.$emit('change', {
type: 'List',
isRefresh: !!isRefresh
})
}
}
}
</script>
<style scoped lang="scss">
.AppSpecial {
.visit-list {
.visit-item {
padding: 10px 0;
border-bottom: 1px solid #eee;
.AppSpecial {
.visit-list {
.visit-item {
padding: 10px 0;
border-bottom: 1px solid #eee;
&:first-child {
padding-top: 0;
&:first-child {
padding-top: 0;
}
&:last-child {
border-bottom: none;
}
.visit-status {
display: flex;
align-items: center;
font-size: 14px;
span {
color: #333;
}
&:last-child {
border-bottom: none;
i {
color: #999;
font-style: normal;
}
}
.visit-status {
display: flex;
align-items: center;
& > p {
line-height: 1.4;
margin-bottom: 4px;
text-align: justify;
color: #666;
font-size: 16px;
}
.visit-item__top {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
span {
font-size: 14px;
span {
color: #333;
}
i {
color: #999;
font-style: normal;
}
color: #999;
}
& > p {
line-height: 1.4;
margin-bottom: 4px;
text-align: justify;
color: #666;
font-size: 16px;
}
.visit-item__top {
.left {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
span {
img, .avatar {
width: 40px;
height: 40px;
line-height: 40px;
text-align: center;
margin-right: 10px;
border-radius: 50%;
font-size: 14px;
color: #999;
color: #fff;
background: #26f;
}
.left {
display: flex;
align-items: center;
img, .avatar {
width: 40px;
height: 40px;
line-height: 40px;
text-align: center;
margin-right: 10px;
border-radius: 50%;
font-size: 14px;
color: #fff;
background: #26f;
}
h2 {
font-size: 16px;
font-weight: 500;
}
h2 {
font-size: 16px;
font-weight: 500;
}
}
}
}
}
}
</style>