Parcourir la source

用户管理修改页添加工号和身份证字段

huangguoce il y a 1 mois
Parent
commit
b9e7acb72b

+ 3 - 3
src/views/dd/UserAddForm.vue

@@ -138,9 +138,9 @@ export default {
 				orgEmail: [
 					{ type: "email", message: "请输入正确的邮箱格式", trigger: "blur" }
 				],
-				jobNumber: [
-					{ required: true, message: "请填写工号", trigger: "blur" }
-				],
+				// jobNumber: [
+				// 	{ required: true, message: "请填写工号", trigger: "blur" }
+				// ],
 				title: [
 					{ required: true, message: "请填写职位", trigger: "blur" }
 				],

+ 16 - 1
src/views/human/enrollment/registration/EnrollmentRegistrationEditForm.vue

@@ -279,6 +279,13 @@
 									</el-select>
 								</el-form-item>
 							</el-col>
+
+							<el-col :span="12">
+								<el-form-item label="工号" prop="no" :rules="[
+								]">
+									<el-input v-model="inputForm.no" maxlength="50" placeholder=""></el-input>
+								</el-form-item>
+							</el-col>
 							<el-col :span="12">
 								<el-form-item label="角色" prop="roleIdList"
 									:rules="[{ required: true, message: '角色不能为空', trigger: 'change' }]">
@@ -378,6 +385,12 @@
 								</el-form-item>
 							</el-col>
 							<el-col :span="12">
+								<el-form-item label="工号" prop="no" :rules="[
+								]">
+									<el-input v-model="inputForm.no" maxlength="50" placeholder=""></el-input>
+								</el-form-item>
+							</el-col>
+							<el-col :span="12">
 								<el-form-item label="角色" prop="roleIdList"
 									:rules="[{ required: true, message: '角色不能为空', trigger: 'change' }]">
 									<el-select v-model="inputForm.roleIdList" style="width: 100%" multiple
@@ -1115,7 +1128,7 @@
 												<div class="collapseTitle">
 													<span style="font-size: 16px;"> {{
 														$dictUtils.getDictLabel('professional_certificate',
-															item.name, '-')}}</span>
+															item.name, '-') }}</span>
 													<span style="font-size: 16px;" v-if="item.proficiency"> {{ ' - ' +
 														item.proficiency }}</span>
 													<div style="margin-left: auto;">
@@ -1674,6 +1687,7 @@ export default {
 				remarks: '',
 				type: '',
 				onJobStatus: '',
+				no: "",
 				trialDuration: "",
 				trialEndDate: "",
 				socialSecurityNumber: '',
@@ -1892,6 +1906,7 @@ export default {
 				contractEndDate: '',
 				remarks: '',
 				type: '',
+				no: "",
 				onJobStatus: '',
 				trialDuration: "",
 				trialEndDate: "",

+ 259 - 380
src/views/sys/user/UserForm.vue

@@ -1,291 +1,191 @@
 <template>
 	<v-dialog :title="title" v-model="visible">
-		<el-form
-			:model="inputForm"
-			ref="inputForm"
-			@keyup.enter="doSubmit()"
-			label-width="120px"
-			v-loading="loading"
-			:class="method === 'view' ? 'readonly' : ''"
-			:disabled="method === 'view'"
-			@submit.prevent
-		>
-			<el-divider content-position="left"
-				><el-icon> <lock /></el-icon> 登录信息</el-divider
-			>
+		<el-form :model="inputForm" ref="inputForm" @keyup.enter="doSubmit()" label-width="120px" v-loading="loading"
+			:class="method === 'view' ? 'readonly' : ''" :disabled="method === 'view'" @submit.prevent>
+			<el-divider content-position="left"><el-icon>
+					<lock />
+				</el-icon> 登录信息</el-divider>
 			<el-row :gutter="15">
 				<el-col :span="12" v-if="$TOOL.data.get('IS_PRIMARY_TENANT')">
-					<el-form-item
-						label="所属租户"
-						prop="tenantDTO.id"
-						:rules="[
-							{
-								required: true,
-								message: '租户不能为空',
-								trigger: 'blur',
-							},
-						]"
-					>
-						<el-select
-							v-model="inputForm.tenantDTO.id"
-							@change="handleChangeTenant"
-							style="width: 100%"
-							placeholder="请选择"
-						>
-							<el-option
-								v-for="item in $TOOL.data.get('TENANT_LIST')"
-								:key="item.id"
-								:label="item.name"
-								:value="item.id"
-							>
+					<el-form-item label="所属租户" prop="tenantDTO.id" :rules="[
+						{
+							required: true,
+							message: '租户不能为空',
+							trigger: 'blur',
+						},
+					]">
+						<el-select v-model="inputForm.tenantDTO.id" @change="handleChangeTenant" style="width: 100%"
+							placeholder="请选择">
+							<el-option v-for="item in $TOOL.data.get('TENANT_LIST')" :key="item.id" :label="item.name"
+								:value="item.id">
 							</el-option>
 						</el-select>
 					</el-form-item>
 				</el-col>
 				<el-col :span="12">
-					<el-form-item
-						label="账号"
-						prop="loginName"
-						:rules="[
+					<el-form-item label="账号" prop="loginName" :rules="[
+						{
+							required: true,
+							message: '登录名不能为空',
+							trigger: 'blur',
+						},
+					]">
+						<el-input v-model="inputForm.loginName" maxlength="50" placeholder=""></el-input>
+					</el-form-item>
+				</el-col>
+				<el-col :span="12">
+					<el-form-item label="密码:" prop="newPassword" :rules="inputForm.id
+						? []
+						: [
 							{
 								required: true,
-								message: '登录名不能为空',
+								message: '密码不能为空',
 								trigger: 'blur',
 							},
-						]"
-					>
-						<el-input
-							v-model="inputForm.loginName"
-							maxlength="50"
-							placeholder=""
-						></el-input>
+						]
+						">
+						<el-input v-model="inputForm.newPassword" maxlength="50" placeholder="若不修改,请留空"
+							show-password></el-input>
 					</el-form-item>
 				</el-col>
 				<el-col :span="12">
-					<el-form-item
-						label="密码:"
-						prop="newPassword"
-						:rules="
-							inputForm.id
-								? []
-								: [
-										{
-											required: true,
-											message: '密码不能为空',
-											trigger: 'blur',
-										},
-								  ]
-						"
-					>
-						<el-input
-							v-model="inputForm.newPassword"
-							maxlength="50"
-							placeholder="若不修改,请留空"
-							show-password
-						></el-input>
-					</el-form-item>
-				</el-col>
-				<el-col :span="12">
-					<el-form-item
-						label="确认密码"
-						prop="confirmNewPassword"
-						:rules="
-							inputForm.id
-								? [
-										{
-											validator: validatePass2,
-											trigger: 'blur',
-										},
-								  ]
-								: [
-										{
-											required: true,
-											message: '确认密码不能为空',
-											trigger: 'blur',
-										},
-										{
-											validator: validatePass2,
-											trigger: 'blur',
-										},
-								  ]
-						"
-					>
-						<el-input
-							v-model="inputForm.confirmNewPassword"
-							maxlength="50"
-							placeholder=""
-							show-password
-						></el-input>
-					</el-form-item>
-				</el-col>
-				<el-col :span="12">
-					<el-form-item
-						label="是否允许登录"
-						prop="loginFlag"
-						:rules="[
+					<el-form-item label="确认密码" prop="confirmNewPassword" :rules="inputForm.id
+						? [
+							{
+								validator: validatePass2,
+								trigger: 'blur',
+							},
+						]
+						: [
 							{
 								required: true,
-								message: '必须选择',
+								message: '确认密码不能为空',
+								trigger: 'blur',
+							},
+							{
+								validator: validatePass2,
 								trigger: 'blur',
 							},
-						]"
-					>
+						]
+						">
+						<el-input v-model="inputForm.confirmNewPassword" maxlength="50" placeholder=""
+							show-password></el-input>
+					</el-form-item>
+				</el-col>
+				<el-col :span="12">
+					<el-form-item label="是否允许登录" prop="loginFlag" :rules="[
+						{
+							required: true,
+							message: '必须选择',
+							trigger: 'blur',
+						},
+					]">
 						<el-radio-group v-model="inputForm.loginFlag">
-							<el-radio
-								v-for="item in this.$dictUtils.getDictList(
-									'yes_no'
-								)"
-								:label="item.value"
-								:key="item.id"
-								>{{ item.label }}</el-radio
-							>
+							<el-radio v-for="item in this.$dictUtils.getDictList(
+								'yes_no'
+							)" :label="item.value" :key="item.id">{{ item.label }}</el-radio>
 						</el-radio-group>
 					</el-form-item>
 				</el-col>
 				<el-col :span="12">
-					<el-form-item label="是否获取其他服务待办" prop="otherServiceFlag" :rules="[{required: true, message: '必须选择', trigger: 'blur'}]">
+					<el-form-item label="是否获取其他服务待办" prop="otherServiceFlag"
+						:rules="[{ required: true, message: '必须选择', trigger: 'blur' }]">
 						<el-radio-group v-model="inputForm.otherServiceFlag">
-							<el-radio v-for="item in this.$dictUtils.getDictList('yes_no')" :label="item.value" :key="item.id">{{item.label}}</el-radio>
+							<el-radio v-for="item in this.$dictUtils.getDictList('yes_no')" :label="item.value"
+								:key="item.id">{{ item.label }}</el-radio>
 						</el-radio-group>
 					</el-form-item>
 				</el-col>
 			</el-row>
-			<el-divider content-position="left"
-				><el-icon> <user /></el-icon> 身份信息</el-divider
-			>
+			<el-divider content-position="left"><el-icon>
+					<user />
+				</el-icon> 身份信息</el-divider>
 			<el-row :gutter="15">
 				<el-col :span="12">
-					<el-form-item
-						label="姓名"
-						:rules="[
-							{
-								required: true,
-								message: '姓名不能为空',
-								trigger: 'blur',
-							},
-						]"
-						prop="name"
-					>
-						<el-input
-							v-model="inputForm.name"
-							maxlength="50"
-							placeholder=""
-						></el-input>
+					<el-form-item label="姓名" :rules="[
+						{
+							required: true,
+							message: '姓名不能为空',
+							trigger: 'blur',
+						},
+					]" prop="name">
+						<el-input v-model="inputForm.name" maxlength="50" placeholder=""></el-input>
 					</el-form-item>
 				</el-col>
 				<el-col :span="12">
-					<el-form-item
-						label="手机"
-						prop="mobile"
-						:rules="[
-							{ validator: validator.isMobile, trigger: 'blur' },
-						]"
-					>
-						<el-input
-							v-model="inputForm.mobile"
-							maxlength="50"
-							placeholder=""
-						></el-input>
+					<el-form-item label="手机" prop="mobile" :rules="[
+						{ validator: validator.isMobile, trigger: 'blur' },
+					]">
+						<el-input v-model="inputForm.mobile" maxlength="50" placeholder=""></el-input>
 					</el-form-item>
 				</el-col>
 				<el-col :span="12">
-					<el-form-item
-						label="电话"
-						prop="phone"
-						:rules="[
-							{ validator: validator.isPhone, trigger: 'blur' },
-						]"
-					>
-						<el-input
-							v-model="inputForm.phone"
-							maxlength="50"
-							placeholder=""
-						></el-input>
+					<el-form-item label="电话" prop="phone" :rules="[
+						{ validator: validator.isPhone, trigger: 'blur' },
+					]">
+						<el-input v-model="inputForm.phone" maxlength="50" placeholder=""></el-input>
 					</el-form-item>
 				</el-col>
 				<el-col :span="12">
-					<el-form-item
-						label="邮箱"
-						prop="email"
-						:rules="[
-							{
-								type: 'email',
-								message: '请输入正确的邮箱地址',
-								trigger: 'blur',
-							},
-						]"
-					>
-						<el-input
-							v-model="inputForm.email"
-							maxlength="50"
-							placeholder=""
-						></el-input>
+					<el-form-item label="邮箱" prop="email" :rules="[
+						{
+							type: 'email',
+							message: '请输入正确的邮箱地址',
+							trigger: 'blur',
+						},
+					]">
+						<el-input v-model="inputForm.email" maxlength="50" placeholder=""></el-input>
+					</el-form-item>
+				</el-col>
+				<el-col :span="12">
+					<el-form-item label="身份证号码" prop="idCard"
+						:rules="[{ required: true, validator: validator.isCardId, trigger: 'blur' }]">
+						<el-input v-model="inputForm.idCard"
+							@blur="idCardOnly(inputForm.idCard, inputForm.id)"></el-input>
 					</el-form-item>
 				</el-col>
 			</el-row>
-			<el-divider content-position="left"
-				><el-icon> <postcard /></el-icon> 岗位信息</el-divider
-			>
+			<el-divider content-position="left"><el-icon>
+					<postcard />
+				</el-icon> 岗位信息</el-divider>
 			<el-row :gutter="15">
 				<el-col :span="12">
-					<el-form-item
-						prop="companyDTO.id"
-						:rules="[
-							{
-								required: true,
-								message: '公司不能为空',
-								trigger: 'blur',
-							},
-						]"
-						label="公司"
-					>
-						<el-tree-select
-							ref="companyTree"
-							value-key="id"
-							:props="{
-								label: 'name', // 显示名称
-								children: 'children', // 子级字段名
-							}"
-							@change="handleChangeCompany"
-							:data="companyTreeData"
-							v-model="inputForm.companyDTO.id"
-							check-strictly
-							style="width: 100%"
-							:clearable="true"
-							:accordion="true"
-						>
+					<el-form-item prop="companyDTO.id" :rules="[
+						{
+							required: true,
+							message: '公司不能为空',
+							trigger: 'blur',
+						},
+					]" label="公司">
+						<el-tree-select ref="companyTree" value-key="id" :props="{
+							label: 'name', // 显示名称
+							children: 'children', // 子级字段名
+						}" @change="handleChangeCompany" :data="companyTreeData" v-model="inputForm.companyDTO.id" check-strictly
+							style="width: 100%" :clearable="true" :accordion="true">
 							<template #default="{ node, data }">
-								<span
-									class="custom-tree-node el-tree-node__label"
-								>
+								<span class="custom-tree-node el-tree-node__label">
 									<span class="label">
 										<el-icon class="m-r-5">
-											<qiye
-												v-if="data.type === '1'"
-												:style="{
-													color:
-														$TOOL.data.get(
-															'IS_PRIMARY_TENANT'
-														) &&
-														data.tenantDTO &&
-														$utils.getTenantColorById(
-															data.tenantDTO.id
-														),
-												}"
-											></qiye>
-											<bumen
-												v-else
-												:style="{
-													color:
-														$TOOL.data.get(
-															'IS_PRIMARY_TENANT'
-														) &&
-														data.tenantDTO &&
-														$utils.getTenantColorById(
-															data.tenantDTO.id
-														),
-												}"
-											></bumen>
+											<qiye v-if="data.type === '1'" :style="{
+												color:
+													$TOOL.data.get(
+														'IS_PRIMARY_TENANT'
+													) &&
+													data.tenantDTO &&
+													$utils.getTenantColorById(
+														data.tenantDTO.id
+													),
+											}"></qiye>
+											<bumen v-else :style="{
+												color:
+													$TOOL.data.get(
+														'IS_PRIMARY_TENANT'
+													) &&
+													data.tenantDTO &&
+													$utils.getTenantColorById(
+														data.tenantDTO.id
+													),
+											}"></bumen>
 										</el-icon>
 										{{ node.label }}
 									</span>
@@ -295,63 +195,42 @@
 					</el-form-item>
 				</el-col>
 				<el-col :span="12">
-					<el-form-item
-						prop="officeDTO.id"
-						:rules="[
-							{
-								required: true,
-								message: '部门不能为空',
-								trigger: 'blur',
-							},
-						]"
-						label="部门"
-					>
-						<el-tree-select
-							ref="officeTree"
-							value-key="id"
-							:props="{
-								label: 'name', // 显示名称
-								children: 'children', // 子级字段名
-							}"
-							:data="officeTreeData"
-							v-model="inputForm.officeDTO.id"
-							check-strictly
-							style="width: 100%"
-							:clearable="true"
-							:accordion="true"
-						>
+					<el-form-item prop="officeDTO.id" :rules="[
+						{
+							required: true,
+							message: '部门不能为空',
+							trigger: 'blur',
+						},
+					]" label="部门">
+						<el-tree-select ref="officeTree" value-key="id" :props="{
+							label: 'name', // 显示名称
+							children: 'children', // 子级字段名
+						}" :data="officeTreeData" v-model="inputForm.officeDTO.id" check-strictly style="width: 100%" :clearable="true"
+							:accordion="true">
 							<template #default="{ node, data }">
-								<span
-									class="custom-tree-node el-tree-node__label"
-								>
+								<span class="custom-tree-node el-tree-node__label">
 									<span class="label">
 										<el-icon class="m-r-5">
-											<qiye
-												v-if="data.type === '1'"
-												:style="{
-													color:
-														$TOOL.data.get(
-															'IS_PRIMARY_TENANT'
-														) &&
-														data.tenantDTO &&
-														$utils.getTenantColorById(
-															data.tenantDTO.id
-														),
-												}"
-											></qiye>
-											<bumen
-												v-else
-												:style="{
-													color:
-														$TOOL.data.get(
-															'IS_PRIMARY_TENANT'
-														) &&
-														data.tenantDTO &&
-														$utils.getTenantColorById(
-															data.tenantDTO.id
-														),
-												}"
-											></bumen>
+											<qiye v-if="data.type === '1'" :style="{
+												color:
+													$TOOL.data.get(
+														'IS_PRIMARY_TENANT'
+													) &&
+													data.tenantDTO &&
+													$utils.getTenantColorById(
+														data.tenantDTO.id
+													),
+											}"></qiye>
+											<bumen v-else :style="{
+												color:
+													$TOOL.data.get(
+														'IS_PRIMARY_TENANT'
+													) &&
+													data.tenantDTO &&
+													$utils.getTenantColorById(
+														data.tenantDTO.id
+													),
+											}"></bumen>
 										</el-icon>
 										{{ node.label }}
 									</span>
@@ -362,102 +241,56 @@
 				</el-col>
 
 				<el-col :span="12">
-					<el-form-item  prop="manageOfficeIds" label="管理部门" >
+					<el-form-item prop="manageOfficeIds" label="管理部门">
 						<!-- 单选 -->
 						<!--<el-select v-model="form.treeData" placeholder="请选择" style="width: 16rem">-->
 						<!-- 多选 -->
-						<SelectTree
-							ref="officeTree"
-							:props="{
-                  value: 'id',             // ID字段名
-                  label: 'name',         // 显示名称
-                  children: 'children'    // 子级字段名
-                }"
-							size="middle"
-							:url="`/jeeplus-system/sys/office/treeData3?type=2`"
-							:value="inputForm.manageOfficeIds"
-							:clearable="false"
-							:accordion="true"
-							:showCheckbox="true"
-							:checkStrictly="true"
-							:checkOnClickNode="true"
-							@getValue="(value) => {inputForm.manageOfficeIds=value}"/>
+						<SelectTree ref="officeTree" :props="{
+							value: 'id',             // ID字段名
+							label: 'name',         // 显示名称
+							children: 'children'    // 子级字段名
+						}" size="middle" :url="`/jeeplus-system/sys/office/treeData3?type=2`" :value="inputForm.manageOfficeIds"
+							:clearable="false" :accordion="true" :showCheckbox="true" :checkStrictly="true"
+							:checkOnClickNode="true" @getValue="(value) => { inputForm.manageOfficeIds = value }" />
 					</el-form-item>
 				</el-col>
 
 				<el-col :span="12">
-					<el-form-item
-						label="工号"
-						prop="no"
-						:rules="[
-							{
-								required: true,
-								message: '工号不能为空',
-								trigger: 'blur',
-							},
-						]"
-					>
-						<el-input
-							v-model="inputForm.no"
-							maxlength="50"
-							placeholder=""
-						></el-input>
+					<el-form-item label="工号" prop="no" :rules="[
+						// {
+						// 	required: true,
+						// 	message: '工号不能为空',
+						// 	trigger: 'blur',
+						// },
+					]">
+						<el-input v-model="inputForm.no" maxlength="50" placeholder=""></el-input>
 					</el-form-item>
 				</el-col>
 				<el-col :span="12">
 					<el-form-item label="岗位" prop="postIdList">
-						<el-select
-							v-model="inputForm.postIdList"
-							style="width: 100%"
-							multiple
-							placeholder="请选择"
-						>
-							<el-option
-								v-for="item in postList"
-								:key="item.id"
-								:label="item.name"
-								:value="item.id"
-							>
+						<el-select v-model="inputForm.postIdList" style="width: 100%" multiple placeholder="请选择">
+							<el-option v-for="item in postList" :key="item.id" :label="item.name" :value="item.id">
 							</el-option>
 						</el-select>
 					</el-form-item>
 				</el-col>
 				<el-col :span="12">
-					<el-form-item
-						label="角色"
-						prop="roleIdList"
-						:rules="[
-							{
-								required: true,
-								message: '角色不能为空',
-								trigger: 'blur',
-							},
-						]"
-					>
-						<el-select
-							v-model="inputForm.roleIdList"
-							style="width: 100%"
-							multiple
-							placeholder="请选择"
-						>
-							<el-option
-								v-for="role in roleList"
-								:key="role.id"
-								:label="role.name"
-								:value="role.id"
-							>
+					<el-form-item label="角色" prop="roleIdList" :rules="[
+						{
+							required: true,
+							message: '角色不能为空',
+							trigger: 'blur',
+						},
+					]">
+						<el-select v-model="inputForm.roleIdList" style="width: 100%" multiple placeholder="请选择">
+							<el-option v-for="role in roleList" :key="role.id" :label="role.name" :value="role.id">
 							</el-option>
 						</el-select>
 					</el-form-item>
 				</el-col>
 				<el-col :span="12">
 					<el-form-item label="备注" prop="remarks">
-						<el-input
-							type="textarea"
-							v-model="inputForm.remarks"
-							maxlength="200"
-							placeholder=""
-						></el-input>
+						<el-input type="textarea" v-model="inputForm.remarks" maxlength="200" placeholder=""></el-input>
 					</el-form-item>
 				</el-col>
 			</el-row>
@@ -471,16 +304,9 @@
      </template> -->
 		<template #footer>
 			<span class="dialog-footer">
-				<el-button @click="visible = false" icon="circle-close"
-					>关闭</el-button
-				>
-				<el-button
-					type="primary"
-					v-show="method != 'view'"
-					@click="doSubmit()"
-					icon="circle-check"
-					>确定</el-button
-				>
+				<el-button @click="visible = false" icon="circle-close">关闭</el-button>
+				<el-button type="primary" v-show="method != 'view'" @click="doSubmit()"
+					icon="circle-check">确定</el-button>
 			</span>
 		</template>
 	</v-dialog>
@@ -529,6 +355,7 @@ export default {
 				email: "", // 邮箱
 				phone: "", // 电话
 				mobile: "", // 手机
+				idCard: "", // 身份证号码
 				loginFlag: "1", // 是否允许登陆
 				otherServiceFlag: '0', // 是否获取其他服务待办
 				photo: "", // 头像
@@ -684,15 +511,15 @@ export default {
 					userService
 						.save(this.inputForm)
 						.then((data) => {
-							console.log(data)
 							this.loading = false;
 							this.visible = false;
 							this.$message.success(data.msg);
 							this.$emit("refreshDataList");
 							let param = {
-								name:this.inputForm.name,
+								name: this.inputForm.name,
 								mobilePhone: this.inputForm.mobile,
-								department:this.inputForm.officeDTO.id,
+								department: this.inputForm.officeDTO.id,
+								idCard: this.inputForm.idCard,
 								userId: data.userId,
 							}
 							enrollmentRegistrationService.saveInfo(param)
@@ -717,6 +544,57 @@ export default {
 				callback();
 			}
 		},
+		// 身份证号码校验
+		idCardOnly(idCard, id) {
+			if (this.commonJS.isNotEmpty(idCard)) {
+
+				enrollmentRegistrationService.findIdCardOnly(idCard, this.inputForm.id).then((data) => {
+					if (data !== 0) {
+						this.$message.error('身份证号码已存在,请重新确认')
+						this.inputForm.idCard = ''
+						throw new Error('身份证号码已存在,请重新确认')
+					} else {
+						let sex = null
+						let birth = null
+						let myDate = new Date()
+						let month = myDate.getMonth() + 1
+						let day = myDate.getDate()
+						let age = 0
+
+						if (idCard.length === 18) {
+							age = myDate.getFullYear() - idCard.substring(6, 10) - 1
+							sex = idCard.substring(16, 17)
+							birth = idCard.substring(6, 10) + '-' + idCard.substring(10, 12) + '-' + idCard.substring(12, 14)
+							// eslint-disable-next-line no-mixed-operators
+							if (idCard.substring(10, 12) < month || idCard.substring(10, 12) === month && idCard.substring(12, 14) <= day) age++
+
+						}
+						if (idCard.length === 15) {
+							age = myDate.getFullYear() - idCard.substring(6, 8) - 1901
+							sex = idCard.substring(13, 14)
+							birth = '19' + idCard.substring(6, 8) + '-' + idCard.substring(8, 10) + '-' + idCard.substring(10, 12)
+							// eslint-disable-next-line no-mixed-operators
+							if (idCard.substring(8, 10) < month || idCard.substring(8, 10) === month && idCard.substring(10, 12) <= day) age++
+						}
+
+						if (sex % 2 === 0) {
+							sex = '2'  // 性别代码 1代表男,2代表女,暂时不涉及其他类型性别
+						} else {
+							sex = '1'
+						}
+						//获取户籍所在地
+						const regionCode = idCard.substring(0, 6);
+						this.inputForm.nativePlace = regionCode
+						this.inputForm.age = age
+						this.inputForm.sex = sex
+						this.inputForm.birthday = birth
+						console.log(regionCode, age, sex, birth);
+
+						return { age, sex, birth }
+					}
+				})
+			}
+		},
 	},
 };
 </script>
@@ -724,6 +602,7 @@ export default {
 .avatar {
 	height: 100px;
 }
+
 .el-divider__text {
 	font-weight: bold;
 	font-size: 16px;