myInfo.vue
2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<template>
<div>
<el-card :body-style="{'padding':'0'}">
<div class="indexTitle"><h3 class="leftboderTT">机构基础信息</h3></div>
<!-- uType字段 1 是个人 2是团体-->
<!-- {{user}}-->
<team-info :form="myform" v-if="user.utype=='2'"/>
</el-card>
</div>
</template>
<script setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import { getCurrentInstance, onMounted } from '@vue/runtime-core'
import * as match from '@/apiPc/match'
import { ElMessage, ElMessageBox } from 'element-plus'
import { nationList } from '@/assets/js/data'
import {getGroupInfo} from "@/apiPc/match";
import TeamInfo from "@/viewsPc/center/teamInfo";
const router = useRouter()
const { proxy } = getCurrentInstance()
const props = defineProps({
user:{
type:Object,
required:true
}
})
const activeName = ref('first')
const myform = ref({
idcType: 0,
countryId: 240,
nation: '汉族'
})
const labelArr = ref([])
const groupList = ref([])
const certificates = ref([
{
value: '0',
label: '居民身份证'
},
{
value: '1',
label: '护照'
},
{
value: '2',
label: '其他'
}
])
onMounted(() => {
getData()
})
function getData() {
match.getGroupInfo().then(res => {
myform.value = res.data
})
}
function checkCode() {
if (myform.value.idcType == 0 && myform.value.idcCode) {
if (!(/(^\d{15}$)|(^\d{17}([0-9]|X)$)/.test(myform.value.idcCode))) {
ElMessage.error('请输入正确的身份证号码')
} else {
let tmpStr = ''
if (myform.value.idcCode.length == 15) {
tmpStr = myform.value.idcCode.substring(6, 12)
tmpStr = '19' + tmpStr
tmpStr = tmpStr.substring(0, 4) + '-' + tmpStr.substring(4, 6) + '-' + tmpStr.substring(6)
} else {
tmpStr = myform.value.idcCode.substring(6, 14)
tmpStr = tmpStr.substring(0, 4) + '-' + tmpStr.substring(4, 6) + '-' + tmpStr.substring(6)
}
myform.value.birth = tmpStr
const res = /^(\d{6})(\d{4})(\d{2})(\d{2})(\d{3})([0-9]|X)$/
if (myform.value.idcCode && res.test(myform.value.idcCode)) {
const genderCode = myform.value.idcCode.charAt(16)
if (parseInt(genderCode) % 2 == 0) {
myform.value.sex = '0'
} else {
myform.value.sex = '1'
}
}
}
}
}
</script>
<style scoped lang="scss">
.indexTitle{margin: 20px 0 12px;padding: 0 20px 15px;border-bottom: 1px solid #e5e5e5;
h3{
font-size: 16px;
color:var(--el-color-primary);
}
}
</style>