myInfo.vue 2.49 KB
<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>