<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
	<div>
		<el-form :model="inputForm" ref="inputForm" v-loading="loading" :class="method === 'view' ? 'readonly' : ''"
			:disabled="status === 'audit' || status === 'taskFormDetail' || method === 'view'" label-width="100px"
			@submit.native.prevent>
			<el-divider content-position="left"><i class="el-icon-document"></i> <span
					style="font-weight: 900; font-size: 16px; color: #606266;">基础信息</span></el-divider>

			<el-row :gutter="26">
				<el-col :span="12">
					<el-form-item label="姓名" prop="name"
						:rules="[{ required: true, message: '姓名不能为空', trigger: 'blur' }]">
						<el-input v-model="inputForm.name"></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-col :span="12">
					<el-form-item label="性别" prop="sex" :rules="[
						{ required: true, message: '性别不能为空', trigger: 'change' }
					]">
						<el-radio-group :disabled="true" v-model="inputForm.sex">
							<el-radio v-for="item in $dictUtils.getDictList('sex')" :label="item.value"
								:key="item.value">{{ item.label
								}}</el-radio>
						</el-radio-group>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="年龄" prop="age"
						:rules="[{ required: true, message: '年龄不能为空', trigger: 'change' }]">
						<el-input :disabled="true" v-model="inputForm.age" type="number"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="出生日期" prop="birthday" :rules="[
						{ required: true, message: '请填写出生日期', trigger: 'blur' }
					]">
						<el-date-picker :disabled="true" style="width: 100%" v-model="inputForm.birthday"
							value-format="YYYY-MM-DD" placeholder="选择日期">
						</el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="政治面貌" prop="politicalOutlook" :rules="[]">
						<!--						<el-input v-model="inputForm.politicalOutlook"></el-input>-->
						<el-select v-model="inputForm.politicalOutlook" placeholder="请选择政治面貌" style="width:100%;">
							<el-option v-for="item in $dictUtils.getDictList('political_outlook')" :key="item.value"
								:label="item.label" :value="item.value">
							</el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<!--								<el-col :span="12">
									<el-form-item label="籍贯" prop="nativePlace" :rules="[]">
										<el-input v-model="inputForm.nativePlace"></el-input>
									</el-form-item>
								</el-col>-->

				<el-col :span="12">
					<el-form-item label="籍贯" prop="nativePlace" :rules="[
						{ required: true, message: '籍贯不能为空', trigger: 'change' }
					]">
						<SelectTree ref="areaTree" :props="{
							value: 'id',             // ID字段名
							label: 'name',         // 显示名称
							children: 'children'    // 子级字段名
						}" url="/system-server/sys/area/treeData" :value="inputForm.nativePlace" :clearable="true" size="large"
							:accordion="true" @getValue="(value) => { inputForm.nativePlace = value }" />
					</el-form-item>
				</el-col>




				<!--								<el-col :span="12">
									<el-form-item label="民族" prop="nation" :rules="[]">
										<el-input v-model="inputForm.nation"></el-input>
									</el-form-item>
								</el-col>-->

				<el-col :span="12">
					<el-form-item label="民族" prop="nation" :rules="[]">
						<el-select v-model="inputForm.nation" placeholder="请选择民族" clearable style="width: 100%;">
							<el-option v-for="item in $dictUtils.getDictList('sys_nation')" :key="item.value"
								:label="item.label" :value="item.value">
							</el-option>
						</el-select>
					</el-form-item>
				</el-col>

				<el-col :span="12">
					<el-form-item label="婚姻状况" prop="maritalStatus" :rules="[]">
						<el-select v-model="inputForm.maritalStatus" placeholder="请选择婚姻状况" clearable
							style="width: 100%;">
							<el-option v-for="item in $dictUtils.getDictList('marital_status')" :key="item.value"
								:label="item.label" :value="item.value">
							</el-option>
						</el-select>
					</el-form-item>

				</el-col>
				<el-col :span="12">
					<el-form-item label="邮箱" :rules="[
						{
							type: 'email',
							message: '请输入正确的邮箱地址',
							trigger: 'blur',
						},
					]" prop="email">
						<el-input @blur="checkEmail(inputForm.email)" v-model="inputForm.email"></el-input>
					</el-form-item>
				</el-col>

				<el-col :span="12">
					<el-form-item label="联系电话" prop="mobilePhone"
						:rules="[{ required: true, message: '联系电话不能为空', trigger: 'change' }]">
						<el-input v-model="inputForm.mobilePhone"
							@blur="mobilePhoneOnly(inputForm.mobilePhone)"></el-input>
					</el-form-item>
				</el-col>
				<!-- <el-col :span="12">
					<el-form-item label="家庭住址" prop="homeAddress" :rules="[]">
						<el-input v-model="inputForm.homeAddress"></el-input>
					</el-form-item>
				</el-col> -->
				<el-col :span="12">
					<el-form-item label="常住住址" prop="permanentAddress" :rules="[]">
						<el-input v-model="inputForm.permanentAddress"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="参加工作日期" prop="joinWorkDate" :rules="[

					]">
						<el-date-picker style="width: 100%" v-model="inputForm.joinWorkDate" value-format="x"
							placeholder="">
						</el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="从事行业日期" prop="joinIndustryDate" :rules="[

					]">
						<el-date-picker style="width: 100%" v-model="inputForm.joinIndustryDate" value-format="x"
							placeholder="">
						</el-date-picker>
					</el-form-item>
				</el-col>
				<!-- 
								<el-col :span="24">
									<el-form-item label="个人简介" prop="remarks" :rules="[]">
										<el-input type="textarea" maxlength="200" show-word-limit
											v-model="inputForm.remarks"></el-input>
									</el-form-item>
								</el-col> -->
			</el-row>


			<el-row :gutter="26">
				<el-col :span="12">
					<el-form-item label="身份证人像面" prop="idCardFront" :rules="[]">
						<UpLoadComponent ref="idCardFront"></UpLoadComponent>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="身份证国徽面" prop="idCardBack" :rules="[]">
						<UpLoadComponent ref="idCardBack"></UpLoadComponent>
					</el-form-item>
				</el-col>
			</el-row>
			<!-- 教育经历 -->
			<el-card style="width: 100%;transition: all 0.3s ease;" shadow="hover" class="card-info">
				<template #header>
					<el-divider content-position="left"><i class="el-icon-document"></i> <span
							style="font-weight: 900; font-size: 16px; color: #606266;">教育经历</span>
						<el-divider direction="vertical" />
						<el-button type="primary" @click="addEdu()">新增</el-button>
						<el-divider direction="vertical" />
						<el-button :type="changeFlag[0] ? 'warning' : 'success'" @click="changeInfoList(0)">{{
							changeFlag[0] ? "收起" : "展开"
						}}</el-button>
					</el-divider>
				</template>
				<el-collapse-transition>
					<el-row :gutter="26" v-if="changeFlag[0]">
						<el-col :span="24">
							<el-collapse v-model="activeNames[0]"
								v-if="inputForm.eduInfoList && inputForm.eduInfoList.length > 0">
								<div style="padding: 0 30px;" v-for="(item, index) in inputForm.eduInfoList">
									<el-collapse-item :name="item.id">
										<template #title="{ isActive }">
											<div class="collapseTitle">
												<span style="font-size: 16px;"> {{
													$dictUtils.getDictLabel("education",
														item.education, '-') + ' - ' +
													item.graduatedFrom +
													' - ' + item.cultureMethod }}</span>
												<span style="color: #b0b0b0;font-size: 12px;">&nbsp;|&nbsp;</span>
												<span style="font-size: 14px;"> {{
													handleDateFormatter(item.startDate) }}</span>
												<span style="color: #b0b0b0;font-size: 12px;">&nbsp;至&nbsp;</span>
												<span style="font-size: 14px;"> {{
													handleDateFormatter(item.endDate) }}</span>
												<el-tag v-if="item.isHighestEducation == 1" size="small"
													style="margin-left: 10px;">最高学历</el-tag>

												<div style="margin-left: auto;">
													<el-button type="text" @click.stop="editEdu(item.id)">修改</el-button>
													<el-button type="text" @click.stop="delEdu(item.id)"
														style="color: red;">删除</el-button>
												</div>
											</div>
										</template>
										<el-descriptions title="" border :column="2">
											<el-descriptions-item label="开始日期：">{{
												handleDateFormatter(item.startDate)
											}}</el-descriptions-item>
											<el-descriptions-item label="结束日期：">{{ handleDateFormatter(item.endDate)
											}}</el-descriptions-item>
											<el-descriptions-item label="毕业院校：">{{ item.graduatedFrom
											}}</el-descriptions-item>
											<!-- <el-descriptions-item label="其他毕业院校：">{{ item.otherGraduatedFrom
											}}</el-descriptions-item> -->
											<el-descriptions-item label="专业：">{{ item.speciality
											}}</el-descriptions-item>
											<el-descriptions-item label="学历：">{{
												$dictUtils.getDictLabel("education",
													item.education, '-')
											}}</el-descriptions-item>
											<el-descriptions-item label="学位：">{{
												$dictUtils.getDictLabel("degree", item.degree, '-')
											}}</el-descriptions-item>
											<el-descriptions-item label="是否最高学历：">
												<el-tag v-if="item.isHighestEducation == 1">是</el-tag>
												<el-tag type="warning" v-else>否</el-tag>
											</el-descriptions-item>
											<el-descriptions-item label="是否最高学位：">
												<el-tag v-if="item.isHighestDegree == 1">是</el-tag>
												<el-tag type="warning" v-else>否</el-tag>
											</el-descriptions-item>
											<el-descriptions-item label="学习形式：">{{
												$dictUtils.getDictLabel("learn_form", item.learnForms, '-')
											}}</el-descriptions-item>
											<el-descriptions-item label="毕业类型：">{{
												$dictUtils.getDictLabel("graduation_type", item.graduationType, '-')
											}}</el-descriptions-item>
											<!-- <el-descriptions-item label="培养方式：">{{ item.cultureMethod
												}}</el-descriptions-item> -->
											<!-- <el-descriptions-item label="专业描述：">{{ item.specialityDesc
											}}</el-descriptions-item> -->
											<el-descriptions-item label="学历证明：">
												<AttachmentView :fileList="item.educationFile">
												</AttachmentView>
											</el-descriptions-item>
											<el-descriptions-item label="学位证明：">
												<AttachmentView :fileList="item.degreeFile">
												</AttachmentView>
											</el-descriptions-item>

										</el-descriptions>
									</el-collapse-item>
								</div>
							</el-collapse>
							<el-empty image-size="80px" style="margin-top: 0 !important;padding: 0 !important;" v-else
								description="暂无教育经历"></el-empty>
						</el-col>
					</el-row>
				</el-collapse-transition>
			</el-card>
			<!-- 工作经历 -->
			<el-card style="width: 100%" shadow="hover" class="card-info">
				<template #header>
					<el-divider content-position="left"><i class="el-icon-document"></i> <span
							style="font-weight: 900; font-size: 16px; color: #606266;">工作经历</span>
						<el-divider direction="vertical" />
						<el-button type="primary" @click="addWork()">新增</el-button>
						<el-divider direction="vertical" />
						<el-button :type="changeFlag[1] ? 'warning' : 'success'" @click="changeInfoList(1)">{{
							changeFlag[1] ? "收起" : "展开"
						}}</el-button>
					</el-divider>
				</template>
				<el-collapse-transition>
					<el-row :gutter="26" v-if="changeFlag[1]">
						<el-col :span="24">
							<el-collapse v-model="activeNames[1]"
								v-if="inputForm.workInfoList && inputForm.workInfoList.length > 0">
								<div style="padding: 0 30px;" v-for="(item, index) in inputForm.workInfoList">
									<el-collapse-item :name="item.id">
										<template #title="{ isActive }">
											<div class="collapseTitle">
												<span style="font-size: 16px;"> {{ item.companyName + ' - ' +
													item.position }}</span>
												<span style="color: #b0b0b0;font-size: 12px;">&nbsp;|&nbsp;</span>
												<span style="font-size: 14px;"> {{
													handleDateFormatter(item.startDate) }}</span>
												<span style="color: #b0b0b0;font-size: 12px;">&nbsp;至&nbsp;</span>
												<span style="font-size: 14px;"> {{
													handleDateFormatter(item.endDate) }}</span>

												<div style="margin-left: auto;">
													<el-button type="text"
														@click.stop="editWork(item.id)">修改</el-button>
													<el-button type="text" @click.stop="delWork(item.id)"
														style="color: red;">删除</el-button>
												</div>
											</div>
										</template>
										<el-descriptions title="" border>
											<el-descriptions-item label="单位名称：">{{ item.companyName
											}}</el-descriptions-item>
											<el-descriptions-item label="职务：">{{ item.position
											}}</el-descriptions-item>
											<el-descriptions-item label="证明人：">{{ item.certifier
											}}</el-descriptions-item>
											<el-descriptions-item label="开始日期：">{{
												handleDateFormatter(item.startDate)
											}}</el-descriptions-item>
											<el-descriptions-item label="结束日期：">{{ handleDateFormatter(item.endDate)
											}}</el-descriptions-item>
											<el-descriptions-item label="是否本单位工作经历">
												<el-tag v-if="item.isCurrentCompanyExperience == 1">是</el-tag>
												<el-tag type="warning" v-else>否</el-tag>
											</el-descriptions-item>
										</el-descriptions>
									</el-collapse-item>
								</div>
							</el-collapse>
							<el-empty image-size="80px" style="margin-top: 0 !important;padding: 0 !important;" v-else
								description="暂无工作经历"></el-empty>
						</el-col>
					</el-row>
				</el-collapse-transition>
			</el-card>
			<!-- 培训经历 -->
			<el-card style="width: 100%" shadow="hover" class="card-info">
				<template #header>
					<el-divider content-position="left"><i class="el-icon-document"></i> <span
							style="font-weight: 900; font-size: 16px; color: #606266;">培训经历</span>
						<el-divider direction="vertical" />
						<el-button type="primary" @click="addTraining()">新增</el-button>
						<el-divider direction="vertical" />
						<el-button :type="changeFlag[2] ? 'warning' : 'success'" @click="changeInfoList(2)">{{
							changeFlag[2] ? "收起" : "展开"
						}}</el-button>
					</el-divider>
				</template>
				<el-collapse-transition>
					<el-row :gutter="26" v-if="changeFlag[2]">
						<el-col :span="24">
							<el-collapse v-model="activeNames[2]"
								v-if="inputForm.trainingInfoList && inputForm.trainingInfoList.length > 0">
								<div style="padding: 0 30px;" v-for="(item, index) in inputForm.trainingInfoList">
									<el-collapse-item :name="item.id">
										<template #title="{ isActive }">
											<div class="collapseTitle">
												<span style="font-size: 16px;"> {{ item.name + ' - ' +
													item.trainingInstitution }}</span>
												<div style="margin-left: auto;">
													<el-button type="text"
														@click.stop="editTraining(item.id)">修改</el-button>
													<el-button type="text" @click.stop="delTraining(item.id)"
														style="color: red;">删除</el-button>
												</div>
											</div>
										</template>
										<el-descriptions title="" border>
											<el-descriptions-item label="名称：">{{ item.name
											}}</el-descriptions-item>
											<el-descriptions-item label="培训机构：">{{ item.trainingInstitution
											}}</el-descriptions-item>
											<el-descriptions-item label="培训成绩：">{{ item.trainingResult
											}}</el-descriptions-item>
											<el-descriptions-item label="附件：">
												<AttachmentView :fileList="item.files">
												</AttachmentView>
											</el-descriptions-item>
										</el-descriptions>
									</el-collapse-item>
								</div>
							</el-collapse>
							<el-empty image-size="80px" style="margin-top: 0 !important;padding: 0 !important;" v-else
								description="暂无培训经历"></el-empty>
						</el-col>
					</el-row>
				</el-collapse-transition>
			</el-card>
			<!-- 资质证书 -->
			<el-card style="width: 100%" shadow="hover" class="card-info">
				<template #header>
					<el-divider content-position="left"><i class="el-icon-document"></i> <span
							style="font-weight: 900; font-size: 16px; color: #606266;">执业资格证书</span>
						<el-divider direction="vertical" />
						<el-button type="primary" @click="addCertificate()">新增</el-button>
						<el-divider direction="vertical" />
						<el-button :type="changeFlag[3] ? 'warning' : 'success'" @click="changeInfoList(3)">{{
							changeFlag[3] ? "收起" : "展开"
						}}</el-button>
					</el-divider>
				</template>
				<el-collapse-transition>
					<el-row :gutter="26" v-if="changeFlag[3]">
						<el-col :span="24">
							<el-collapse v-model="activeNames[3]" @change="handleChange"
								v-if="inputForm.certificateInfoList && inputForm.certificateInfoList.length > 0">
								<div style="padding: 0 30px;" v-for="(item, index) in inputForm.certificateInfoList">
									<el-collapse-item :name="item.id">
										<template #title="{ isActive }">
											<div class="collapseTitle">
												<span style="font-size: 16px;"> {{
													$dictUtils.getDictLabel('sys_cert_type', item.type, '-')
												}}</span>
												<div style="margin-left: auto;">
													<el-button type="text"
														@click.stop="editCertificate(item.id)">修改</el-button>
													<el-button type="text" @click.stop="delCertificate(item.id)"
														style="color: red;">删除</el-button>
												</div>
											</div>
										</template>
										<el-descriptions title="" border>
											<el-descriptions-item label="证书类型：">
												{{ $dictUtils.getDictLabel('sys_cert_type', item.type, '-')
												}}
											</el-descriptions-item>
											<el-descriptions-item label="证书编号：">
												{{ item.no }}
											</el-descriptions-item>
											<el-descriptions-item label="发证机关：">
												{{ item.authorities }}
											</el-descriptions-item>
											<el-descriptions-item label="发证日期：">
												{{ handleDateFormatter(item.issuedDate) }}
											</el-descriptions-item>
											<el-descriptions-item label="注册日期：">
												{{ handleDateFormatter(item.enrollDate) }}
											</el-descriptions-item>
											<el-descriptions-item label="到期日期：">
												{{ handleDateFormatter(item.expireDate) }}
											</el-descriptions-item>
											<el-descriptions-item label="注册证书编号：">
												{{ item.enrollCertNo }}
											</el-descriptions-item>
											<el-descriptions-item label="专业：">
												{{ item.profession }}
											</el-descriptions-item>
											<el-descriptions-item label="附件：">
												<AttachmentView :fileList="item.certificateAttachment">
												</AttachmentView>
											</el-descriptions-item>

										</el-descriptions>
									</el-collapse-item>
								</div>
							</el-collapse>
							<el-empty image-size="80px" style="margin-top: 0 !important;padding: 0 !important;" v-else
								description="暂无执业资格证书"></el-empty>
						</el-col>
					</el-row>
				</el-collapse-transition>
			</el-card>
			<!-- 专业技能 -->
			<el-card style="width: 100%" shadow="hover" class="card-info">
				<template #header>
					<el-divider content-position="left"><i class="el-icon-document"></i> <span
							style="font-weight: 900; font-size: 16px; color: #606266;">职称证书</span>
						<el-divider direction="vertical" />
						<el-button type="primary" @click="addSkill()">新增</el-button>
						<el-divider direction="vertical" />
						<el-button :type="changeFlag[4] ? 'warning' : 'success'" @click="changeInfoList(4)">{{
							changeFlag[4] ? "收起" : "展开"
						}}</el-button>
					</el-divider>
				</template>
				<el-collapse-transition>
					<el-row :gutter="26" v-if="changeFlag[4]">
						<el-col :span="24">
							<el-collapse v-model="activeNames[4]"
								v-if="inputForm.skillInfoList && inputForm.skillInfoList.length > 0">
								<div style="padding: 0 30px;" v-for="(item, index) in inputForm.skillInfoList">
									<el-collapse-item :name="item.id">
										<template #title="{ isActive }">
											<div class="collapseTitle">
												<span style="font-size: 16px;"> {{
													$dictUtils.getDictLabel('professional_certificate',
														item.name, '-') }}</span>
												<span style="font-size: 16px;" v-if="item.proficiency"> {{ ' - ' +
													item.proficiency }}</span>
												<div style="margin-left: auto;">
													<el-button type="text"
														@click.stop="editSkill(item.id)">修改</el-button>
													<el-button type="text" @click.stop="delSkill(item.id)"
														style="color: red;">删除</el-button>
												</div>
											</div>
										</template>
										<el-descriptions title="" border>
											<el-descriptions-item label="职称名称：">{{
												$dictUtils.getDictLabel('professional_certificate', item.name, '-')
											}}</el-descriptions-item>

											<el-descriptions-item label="职称等级：">{{ item.proficiency
											}}</el-descriptions-item>
											<el-descriptions-item label="取得日期：">{{ handleDateFormatter(item.obtainDate)
											}}</el-descriptions-item>
											<el-descriptions-item label="取得途径：">{{ item.category
											}}</el-descriptions-item>
											<el-descriptions-item label="审批单位：">{{ item.usageTime
											}}</el-descriptions-item>
											<el-descriptions-item label="附件：">
												<AttachmentView :fileList="item.files">
												</AttachmentView>
											</el-descriptions-item>
										</el-descriptions>
									</el-collapse-item>
								</div>
							</el-collapse>
							<el-empty image-size="80px" style="margin-top: 0 !important;padding: 0 !important;" v-else
								description="暂无专业技能"></el-empty>
						</el-col>
					</el-row>
				</el-collapse-transition>
			</el-card>
			<!-- 语言能力 -->
			<el-card style="width: 100%" shadow="hover" class="card-info">
				<template #header>
					<el-divider content-position="left"><i class="el-icon-document"></i> <span
							style="font-weight: 900; font-size: 16px; color: #606266;">外语语种</span>
						<el-divider direction="vertical" />
						<el-button type="primary" @click="addLanguage()">新增</el-button>
						<el-divider direction="vertical" />
						<el-button :type="changeFlag[5] ? 'warning' : 'success'" @click="changeInfoList(5)">{{
							changeFlag[5] ? "收起" : "展开"
						}}</el-button>
					</el-divider>
				</template>
				<el-collapse-transition>
					<el-row :gutter="26" v-if="changeFlag[5]">
						<el-col :span="24">
							<el-collapse v-model="activeNames[5]"
								v-if="inputForm.languageInfoList && inputForm.languageInfoList.length > 0">
								<div style="padding: 0 30px;" v-for="(item, index) in inputForm.languageInfoList">
									<el-collapse-item :name="item.id">
										<template #title="{ isActive }">
											<div class="collapseTitle">
												<span style="font-size: 16px;"> {{
													$dictUtils.getDictLabel("user_info_language",
														item.language, '-') }}</span>
												<div style="margin-left: auto;">
													<el-button type="text"
														@click.stop="editLanguage(item.id)">修改</el-button>
													<el-button type="text" @click.stop="delLanguage(item.id)"
														style="color: red;">删除</el-button>
												</div>
											</div>
										</template>
										<el-descriptions title="" border>
											<el-descriptions-item label="语种：">{{
												$dictUtils.getDictLabel("user_info_language",
													item.language, '-')
											}}</el-descriptions-item>
											<el-descriptions-item label="是否母语：">
												<el-tag v-if="item.isNative == 1">是</el-tag>
												<el-tag type="warning" v-else>否</el-tag>
											</el-descriptions-item>
											<el-descriptions-item label="掌握程度：">{{ item.proficiency
											}}</el-descriptions-item>
											<el-descriptions-item label="书写能力：">{{ item.writingAbility
											}}</el-descriptions-item>
											<el-descriptions-item label="阅读能力：">{{ item.readingAbility
											}}</el-descriptions-item>
											<el-descriptions-item label="口语能力：">{{ item.speakingAbility
											}}</el-descriptions-item>
											<el-descriptions-item label="附件：">
												<AttachmentView :fileList="item.files">
												</AttachmentView>
											</el-descriptions-item>
										</el-descriptions>
									</el-collapse-item>
								</div>
							</el-collapse>
							<el-empty image-size="80px" style="margin-top: 0 !important;padding: 0 !important;" v-else
								description="暂无语言能力信息"></el-empty>
						</el-col>
					</el-row>
				</el-collapse-transition>
			</el-card>
			<!-- 家庭成员 -->
			<el-card style="width: 100%" shadow="hover" class="card-info">
				<template #header>
					<el-divider content-position="left"><i class="el-icon-document"></i> <span
							style="font-weight: 900; font-size: 16px; color: #606266;">家庭成员</span>
						<el-divider direction="vertical" />
						<el-button type="primary" @click="addFamily()">新增</el-button>
						<el-divider direction="vertical" />
						<el-button :type="changeFlag[6] ? 'warning' : 'success'" @click="changeInfoList(6)">{{
							changeFlag[6] ? "收起" : "展开"
						}}</el-button>
					</el-divider>
				</template>
				<el-collapse-transition>
					<el-row :gutter="26" v-if="changeFlag[6]">
						<el-col :span="24">
							<el-collapse v-model="activeNames[6]"
								v-if="inputForm.familyInfoList && inputForm.familyInfoList.length > 0">
								<div style="padding: 0 30px;" v-for="(item, index) in inputForm.familyInfoList">
									<el-collapse-item :name="item.id">
										<template #title="{ isActive }">
											<div class="collapseTitle">
												<span style="font-size: 16px;"> {{ item.relation + "-" }}</span>
												<span style="font-size: 16px;"> {{ item.name }}</span>
												<div style="margin-left: auto;">
													<el-button type="text"
														@click.stop="editFamily(item.id)">修改</el-button>
													<el-button type="text" @click.stop="delFamily(item.id)"
														style="color: red;">删除</el-button>
												</div>
											</div>
										</template>
										<el-descriptions title="" border>
											<el-descriptions-item label="姓名：">{{ item.name
											}}</el-descriptions-item>
											<el-descriptions-item label="出生日期：">{{
												handleDateFormatter(item.birthDate)
											}}</el-descriptions-item>
											<el-descriptions-item label="与本人关系名称：">{{ item.relation
											}}</el-descriptions-item>
											<el-descriptions-item label="性别：">{{ $dictUtils.getDictLabel("sex",
												item.gender, '-')
											}}</el-descriptions-item>
											<el-descriptions-item label="手机号码：">{{ item.mobile
											}}</el-descriptions-item>
											<!-- <el-descriptions-item label="工作单位：">{{ item.workUnit
											}}</el-descriptions-item>
											<el-descriptions-item label="联系电话：">{{ item.contactNumber
											}}</el-descriptions-item> -->
										</el-descriptions>
									</el-collapse-item>
								</div>
							</el-collapse>
							<el-empty image-size="80px" style="margin-top: 0 !important;padding: 0 !important;" v-else
								description="暂无家庭成员信息"></el-empty>
						</el-col>
					</el-row>
				</el-collapse-transition>
			</el-card>
			<!-- 表彰与奖励 -->
			<el-card style="width: 100%" shadow="hover" class="card-info">
				<template #header>
					<el-divider content-position="left"><i class="el-icon-document"></i> <span
							style="font-weight: 900; font-size: 16px; color: #606266;">表彰与奖励</span>
						<el-divider direction="vertical" />
						<el-button type="primary" @click="addReward()">新增</el-button>
						<el-divider direction="vertical" />
						<el-button :type="changeFlag[7] ? 'warning' : 'success'" @click="changeInfoList(7)">{{
							changeFlag[7] ? "收起" : "展开"
						}}</el-button>
					</el-divider>
				</template>
				<el-collapse-transition>
					<el-row :gutter="26" v-if="changeFlag[7]">
						<el-col :span="24">
							<el-collapse v-model="activeNames[7]"
								v-if="inputForm.rewardInfoList && inputForm.rewardInfoList.length > 0">
								<div style="padding: 0 30px;" v-for="(item, index) in inputForm.rewardInfoList">
									<el-collapse-item :name="item.id">
										<template #title="{ isActive }">
											<div class="collapseTitle">
												<span style="font-size: 16px;"> {{ item.name }}</span>
												<span style="font-size: 16px;"> {{ "-" +
													handleDateFormatter(item.rewardDate)
												}}</span>
												<div style="margin-left: auto;">
													<el-button type="text"
														@click.stop="editReward(item.id)">修改</el-button>
													<el-button type="text" @click.stop="delReward(item.id)"
														style="color: red;">删除</el-button>
												</div>
											</div>
										</template>
										<el-descriptions title="" border :column="2">
											<el-descriptions-item label="奖项：">{{ item.name
											}}</el-descriptions-item>
											<el-descriptions-item label="获奖日期：">{{
												handleDateFormatter(item.rewardDate)
											}}</el-descriptions-item>
											<el-descriptions-item :span="2" label="简述：">{{ item.description
											}}</el-descriptions-item>
											<el-descriptions-item label="附件：">
												<AttachmentView :fileList="item.files">
												</AttachmentView>
											</el-descriptions-item>
										</el-descriptions>
									</el-collapse-item>
								</div>
							</el-collapse>
							<el-empty image-size="80px" style="margin-top: 0 !important;padding: 0 !important;" v-else
								description="暂无表彰与奖励"></el-empty>
						</el-col>
					</el-row>
				</el-collapse-transition>
			</el-card>
			<!-- 社会及行业职务 -->
			<el-card style="width: 100%" shadow="hover" class="card-info">
				<template #header>
					<el-divider content-position="left"><i class="el-icon-document"></i> <span
							style="font-weight: 900; font-size: 16px; color: #606266;">社会及行业职务</span>
						<el-divider direction="vertical" />
						<el-button type="primary" @click="addSociety()">新增</el-button>
						<el-divider direction="vertical" />
						<el-button :type="changeFlag[8] ? 'warning' : 'success'" @click="changeInfoList(8)">{{
							changeFlag[8] ? "收起" : "展开"
						}}</el-button>
					</el-divider>
				</template>
				<el-collapse-transition>
					<el-row :gutter="26" v-if="changeFlag[8]">
						<el-col :span="24">
							<el-collapse v-model="activeNames[8]"
								v-if="inputForm.societyInfoList && inputForm.societyInfoList.length > 0">
								<div style="padding: 0 30px;" v-for="(item, index) in inputForm.societyInfoList">
									<el-collapse-item :name="item.id">
										<template #title="{ isActive }">
											<div class="collapseTitle">
												<span style="font-size: 16px;"> {{ item.name }}</span>
												<div style="margin-left: auto;">
													<el-button type="text"
														@click.stop="editSociety(item.id)">修改</el-button>
													<el-button type="text" @click.stop="delSociety(item.id)"
														style="color: red;">删除</el-button>
												</div>
											</div>
										</template>
										<el-descriptions title="" border>
											<el-descriptions-item label="职务名称：">{{ item.name
											}}</el-descriptions-item>
											<el-descriptions-item label="任职开始日期：">{{
												handleDateFormatter(item.startDate)
											}}</el-descriptions-item>
											<el-descriptions-item label="任职开始日期：">{{
												handleDateFormatter(item.endDate)
											}}</el-descriptions-item>
											<el-descriptions-item label="任职机构：">{{ item.institution
											}}</el-descriptions-item>
										</el-descriptions>
									</el-collapse-item>
								</div>
							</el-collapse>
							<el-empty image-size="80px" style="margin-top: 0 !important;padding: 0 !important;" v-else
								description="暂无社会及行业职务信息"></el-empty>
						</el-col>
					</el-row>
				</el-collapse-transition>
			</el-card>

			<!-- 工作业绩 -->
			<el-card style="width: 100%" shadow="hover" class="card-info">
				<template #header>
					<el-divider content-position="left"><i class="el-icon-document"></i> <span
							style="font-weight: 900; font-size: 16px; color: #606266;">工作业绩</span>
						<el-divider direction="vertical" />
						<el-button type="primary" @click="addPerformance()">新增</el-button>
						<el-divider direction="vertical" />
						<el-button :type="changeFlag[9] ? 'warning' : 'success'" @click="changeInfoList(9)">{{
							changeFlag[9] ? "收起" : "展开"
						}}</el-button>
					</el-divider>
				</template>
				<el-collapse-transition>
					<el-row :gutter="26" v-if="changeFlag[9]">
						<el-col :span="24">
							<el-collapse v-model="activeNames[9]"
								v-if="inputForm.performanceInfoList && inputForm.performanceInfoList.length > 0">
								<div style="padding: 0 30px;" v-for="(item, index) in inputForm.performanceInfoList">
									<el-collapse-item :name="item.id">
										<template #title="{ isActive }">
											<div class="collapseTitle">
												<span style="font-size: 16px;"> {{ item.name }}</span>
												<div style="margin-left: auto;">
													<el-button type="text"
														@click.stop="editPerformance(item.id)">修改</el-button>
													<el-button type="text" @click.stop="delPerformance(item.id)"
														style="color: red;">删除</el-button>
												</div>
											</div>
										</template>
										<el-descriptions title="" border>
											<el-descriptions-item label="项目名称：">{{ item.name
											}}</el-descriptions-item>
											<el-descriptions-item label="委托方：">{{ item.client
											}}</el-descriptions-item>
											<el-descriptions-item label="工程分类：">{{ item.type
											}}</el-descriptions-item>
											<el-descriptions-item label="规模类型/单位/数量：">{{ item.info
											}}</el-descriptions-item>
											<el-descriptions-item label="担任职务：">{{
												$dictUtils.getDictLabel("position_held",
													item.position,
													'-')
											}}</el-descriptions-item>
											<el-descriptions-item label="参与内容：">{{ item.participateContent
											}}</el-descriptions-item>
										</el-descriptions>
									</el-collapse-item>
								</div>
							</el-collapse>
							<el-empty image-size="80px" style="margin-top: 0 !important;padding: 0 !important;" v-else
								description="暂无工作业绩信息"></el-empty>
						</el-col>
					</el-row>
				</el-collapse-transition>
			</el-card>

		</el-form>
		<!-- 教育经历 -->
		<EducationInfo ref="EducationInfo" @addEduInfo="handleAddEduInfo"></EducationInfo>
		<!-- 工作经历 -->
		<WorkInfo ref="WorkInfo" @addWorkInfo="handleAddWorkInfo"></WorkInfo>
		<!-- 培训经历 -->
		<TrainingInfo ref="TrainingInfo" @addTrainingInfo="handleAddTrainingInfo"></TrainingInfo>
		<!-- 资质证书 -->
		<CertificateInfo ref="certificateInfo" @addCertificateInfo="handleAddCertificateInfo"></CertificateInfo>
		<!-- 专业技能 -->
		<SkillInfo ref="skillInfo" @addSkillInfo="handleAddSkillInfo"></SkillInfo>
		<!--语言能力 -->
		<LanguageInfo ref="languageInfo" @addLanguageInfo="handleAddLanguageInfo"></LanguageInfo>
		<!-- 家庭成员 -->
		<FamilyInfo ref="familyInfo" @addFamilyInfo="handleAddFamilyInfo"></FamilyInfo>
		<!-- 表彰与奖励 -->
		<RewardInfo ref="rewardInfo" @addRewardInfo="handleAddRewardInfo"></RewardInfo>
	</div>
</template>

<script>
import dayjs from 'dayjs'
import SelectTree from '@/components/treeSelect/treeSelect.vue'
import enrollmentRegistrationService from '@/api/human/enrollment/EnrollmentRegistrationService'
import OSSSerivce, {
	httpRequest,
	fileName,
	toHref,
} from '@/api/sys/OSSService'
import EducationInfo from "./components/EducationInfo";
import WorkInfo from "./components/WorkInfo";
import TrainingInfo from "./components/TrainingInfo";
import CertificateInfo from "./components/CertificateInfo";
import SkillInfo from "./components/SkillInfo";
import LanguageInfo from "./components/LanguageInfo";
import FamilyInfo from "./components/FamilyInfo";
import RewardInfo from "./components/RewardInfo";
import AttachmentView from './components/AttachmentView'
import UpLoadComponent from '@/views/common/UpLoadComponentCardStyle'

export default {
	props: {
		businessId: {
			type: String,
			default: ''
		},
		formReadOnly: {
			type: Boolean,
			default: false
		},
		status: {
			type: String,
			default: ''
		}
	},
	data() {
		return {
			disabled: false,
			title: '',
			method: '',
			visible: false,
			loading: false,
			inputForm: {
				id: '',
				userId: '',
				name: '', //姓名
				sex: '', // 性别
				age: '',//年龄
				birthday: '',//生日 
				joinIndustryDate: null, // 参加工作日期
				joinWorkDate: null, // 参加行业日期
				politicalOutlook: '',//政治面貌
				nativePlace: '',//籍贯
				nation: '', //民族
				maritalStatus: '',//婚姻
				mobilePhone: '',//联系电话
				idCard: '', //身份证
				idCardFront: [],
				idCardBack: [],
				homeAddress: '',//家庭住址
				permanentAddress: '',//常驻地址
				email: "",
				registrationId: "",
				processDefinitionId: "",
				status: "",
				roleIdList: [],
				postIdList: [],
				//教育经历
				eduInfoList: [

				],
				// 工作经历
				workInfoList: [

				],
				// 培训经历
				trainingInfoList: [

				],
				// 资质证书
				certificateInfoList: [

				],
				// 专业技能
				skillInfoList: [

				],
				languageInfoList: [

				],
				familyInfoList: [

				],
				rewardInfoList: [

				]
			},
			fileType: ['jpg', 'jpeg', 'png', 'webp'],
			keyWatch: '',
			changeFlag: [
				true, true, true, true, true, true, true, true, true, true
			],
			activeNames: []
		}
	},
	created() {
		this.ossService = new OSSSerivce()
	},
	components: {
		SelectTree,
		EducationInfo,
		WorkInfo,
		TrainingInfo,
		CertificateInfo,
		SkillInfo,
		LanguageInfo,
		FamilyInfo,
		RewardInfo,
		AttachmentView,
		UpLoadComponent
	},
	computed: {
		bus: {
			get() {
				return this.businessId
			},
			set(val) {
				this.businessId = val
			}
		},
		name() {
			return this.$store.state.user.name
		},
		userId() {
			return this.$store.state.user.id
		}
	},
	watch: {
		'keyWatch': {
			handler(newVal) {
				if (this.commonJS.isNotEmpty(this.bus)) {
					this.init('', this.bus)
				} else {
					this.$nextTick(() => {
						this.$refs.inputForm.resetFields()
					})
				}
			}
		},
		'loading': {
			handler(newVal) {
				this.$emit('changeLoading', newVal)
			}
		}
	},
	methods: {
		getKeyWatch(keyWatch) {
			this.keyWatch = keyWatch
		},
		getUpload() {
		},
		init(method, id) {

			this.method = method
			this.inputForm = {
				id: '',
				userId: '',
				name: '', //姓名
				sex: '', // 性别
				age: '',//年龄
				birthday: '',//生日 
				joinIndustryDate: null, // 参加工作日期
				joinWorkDate: null, // 参加行业日期
				politicalOutlook: '',//政治面貌
				nativePlace: '',//籍贯
				nation: '', //民族
				maritalStatus: '',//婚姻
				mobilePhone: '',//联系电话
				idCard: '', //身份证
				idCardFront: [],
				idCardBack: [],
				homeAddress: '',//家庭住址
				permanentAddress: '',//常驻地址
				email: "",
				registrationId: "",
				processDefinitionId: "",
				status: "",
				roleIdList: [],
				postIdList: [],
				//教育经历
				eduInfoList: [

				],
				// 工作经历
				workInfoList: [

				],
				// 培训经历
				trainingInfoList: [

				],
				// 资质证书
				certificateInfoList: [

				],
				// 专业技能
				skillInfoList: [

				],
				languageInfoList: [

				],
				familyInfoList: [

				],
				rewardInfoList: [

				],
				societyInfoList: [],
				performanceInfoList: []
			}
			if (method === 'add') {
				this.title = `用户信息完善`
			} else if (method === 'edit') {
				this.title = '用户信息完善'
			} else if (method === 'view') {
				this.title = '用户信息完善'
			}
			this.inputForm.id = id
			this.visible = true
			this.$nextTick(() => {
				this.$refs.idCardFront.clearUpload()
				this.$refs.idCardBack.clearUpload()
				this.loading = true
				let status = 2
				let flag = ""
				// 对查看流程历史数据做判断
				if (this.status == "taskFormDetail") {
					status = 5
					flag = 1
				}
				enrollmentRegistrationService.findAuditInfoById({
					id: this.inputForm.id,
					status: status,
					flag: flag
				}).then(async (data) => {
					if (this.status === 'audit' || this.status === 'taskFormDetail') {
						method = 'view'
					}
					this.inputForm = this.recover(this.inputForm, data)
					this.inputForm = JSON.parse(JSON.stringify(this.inputForm))

					if (this.commonJS.isEmpty(this.inputForm.roleIdList)) {
						this.inputForm.roleIdList = []
					}
					if (this.commonJS.isEmpty(this.inputForm.postIdList)) {
						this.inputForm.postIdList = []
					}
					// 教育经历
					if (this.commonJS.isEmpty(this.inputForm.eduInfoList)) {
						this.inputForm.eduInfoList = []
					}
					// 工作经历
					if (this.commonJS.isEmpty(this.inputForm.workInfoList)) {
						this.inputForm.workInfoList = []
					}
					// 培训经历
					if (this.commonJS.isEmpty(this.inputForm.trainingInfoList)) {
						this.inputForm.trainingInfoList = []
					}
					// 资质证书
					if (this.commonJS.isEmpty(this.inputForm.certificateInfoList)) {
						this.inputForm.certificateInfoList = []
					}
					// 专业技能
					if (this.commonJS.isEmpty(this.inputForm.skillInfoList)) {
						this.inputForm.skillInfoList = []
					}
					// 语言能力
					if (this.commonJS.isEmpty(this.inputForm.languageInfoList)) {
						this.inputForm.languageInfoList = []
					}
					// 家庭成员
					if (this.commonJS.isEmpty(this.inputForm.familyInfoList)) {
						this.inputForm.familyInfoList = []
					}
					// 表彰与奖励
					if (this.commonJS.isEmpty(this.inputForm.rewardInfoList)) {
						this.inputForm.rewardInfoList = []
					}
					if (this.commonJS.isEmpty(this.inputForm.idCardFront)) {
						this.inputForm.idCardFront = []
					}
					if (this.commonJS.isEmpty(this.inputForm.idCardBack)) {
						this.inputForm.idCardBack = []
					}
					// 社会及行业职务
					if (this.commonJS.isEmpty(this.inputForm.societyInfoList)) {
						this.inputForm.societyInfoList = []
					}
					// 工作业绩
					if (this.commonJS.isEmpty(this.inputForm.performanceInfoList)) {
						this.inputForm.performanceInfoList = []
					}


					this.inputForm.certificateInfoList.forEach(temp => {
						this.changeType(temp.type, temp)
					})
					this.activeNames[0] = this.inputForm.eduInfoList.map(item => item.id)
					this.activeNames[1] = this.inputForm.workInfoList.map(item => item.id)
					this.activeNames[2] = this.inputForm.trainingInfoList.map(item => item.id)
					this.activeNames[3] = this.inputForm.certificateInfoList.map(item => item.id)
					this.activeNames[4] = this.inputForm.skillInfoList.map(item => item.id)
					this.activeNames[5] = this.inputForm.languageInfoList.map(item => item.id)
					this.activeNames[6] = this.inputForm.familyInfoList.map(item => item.id)
					this.activeNames[7] = this.inputForm.rewardInfoList.map(item => item.id)
					this.activeNames[8] = this.inputForm.societyInfoList.map(item => item.id)
					this.activeNames[9] = this.inputForm.performanceInfoList.map(item => item.id)
					//后面的fileType是限制上传类型
					this.$refs.idCardFront.newUpload('view', this.inputForm.idCardFront, 'idCard', null, null, null, null, null, [...this.fileType])
					this.$refs.idCardBack.newUpload('view', this.inputForm.idCardBack, 'idCard', null, null, null, null, null, [...this.fileType])
					this.loading = false
				})
			})
		},
		// 表单提交
		// doSubmit() {
		// 	this.$refs['inputForm'].validate((valid) => {
		// 		if (valid) {
		// 			this.loading = true
		// 			this.inputForm.id = this.businessId
		// 			enrollmentRegistrationService.updateInfo(this.inputForm).then((data) => {
		// 				this.close()
		// 				this.$message.success(data.msg)
		// 				this.$emit('refreshDataList')
		// 				this.loading = false
		// 			}).catch(() => {
		// 				this.loading = false
		// 			})
		// 		}
		// 	})
		// },
		close() {
			this.$refs.inputForm.resetFields()
			this.visible = false
		},
		reapplyForm(callback) {
			this.loading = true
			enrollmentRegistrationService.findAuditInfoById({
				id: this.inputForm.id,
				status: 2
			}).then((data) => {
				if (data.type !== '4') { // 审核状态不是“驳回”，就弹出提示
					this.loading = false
					this.$message.error('任务数据已发生改变或不存在，请在待办任务中确认此任务是否存在')
					throw new Error('任务数据已发生改变或不存在，请在待办任务中确认此任务是否存在')
				} else {
					this.startForm(callback)
				}
			})
		},
		// 送审
		async startForm(callback) {
			this.$refs['inputForm'].validate(async (valid) => {
				if (valid) {
					this.loading = true

					if (this.commonJS.isEmpty(this.inputForm.idCard)) {
						this.loading = false
						this.$message.error('身份证号码不能为空')
						throw new Error('身份证号码不能为空')
					}
					if (!this.validateXG.isPhoneOrMobile(this.inputForm.mobilePhone)) {
						this.$message.error('”联系电话“填写不正确，请重新填写')
						this.loading = false
						this.inputForm.mobilePhone = ''
						throw new Error('”联系电话“填写不正确，请重新填写')
					}

					this.inputForm.type = '2'
					// enrollmentRegistrationService.save(this.inputForm).then((data) => {
					// 	this.inputForm.title = `${this.$store.state.user.name} 发起了 [${this.inputForm.name} - 入职登记]`
					// 	this.inputForm.id = data.businessId
					// 	callback(data.businessTable, data.businessId, this.inputForm)
					// 	this.$refs.inputForm.resetFields()
					// 	this.loading = false
					// }).catch(() => {
					// 	this.$refs.inputForm.resetFields()
					// 	this.loading = false
					// })
				} else {
					this.loading = false
				}
			})
		},

		// 通过
		async agreeForm(callback) {
			this.loading = true
			enrollmentRegistrationService.findAuditInfoById({
				id: this.inputForm.id,
				status: 2
			}).then((data) => {

				if (data.status !== '2') { // 审核状态不是“审核中”，就弹出提示
					this.loading = false
					this.$message.error('任务数据已发生改变或不存在，请在待办任务中确认此任务是否存在')
					throw new Error('任务数据已发生改变或不存在，请在待办任务中确认此任务是否存在')
				} else {
					this.$refs['inputForm'].validate(async (valid) => {
						if (valid) {
							this.loading = true
							// this.inputForm.status = '5'
							console.log('this.inputForm', this.inputForm)
							enrollmentRegistrationService.updateInfoAgree(this.inputForm).then((data) => {
								callback(data.businessTable, data.businessId, this.inputForm)
								this.loading = false
							}).catch(() => {
								this.loading = false
							})
						} else {
							this.loading = false
						}
					})
				}
			})
		},
		// 修改状态
		updateStatusById(type, callback) {
			if (type === 'reject') {
				this.loading = true
				enrollmentRegistrationService.findAuditInfoById({
					id: this.inputForm.id,
					status: 2
				}).then((data) => {
					if (data.status !== '2') { // 审核状态不是“审核中”，就弹出提示
						this.loading = false
						this.$message.error('任务数据已发生改变或不存在，请在待办任务中确认此任务是否存在')
						throw new Error('任务数据已发生改变或不存在，请在待办任务中确认此任务是否存在')
					} else {
						this.inputForm.status = '4'
						enrollmentRegistrationService.updateInfoReject(this.inputForm).then((data) => {
							callback(data.businessTable, data.businessId, this.inputForm)
							this.loading = false
						}).catch(() => {
							this.loading = false
						})
					}
				})
			} else if (type === 'hold') {
				this.loading = true
				enrollmentRegistrationService.findAuditInfoById({
					id: this.inputForm.id,
					status: "2"
				}).then((data) => {
					if (data.type !== '4') { // 审核状态不是“驳回”，就弹出提示
						this.loading = false
						this.$message.error('任务数据已发生改变或不存在，请在待办任务中确认此任务是否存在')
						throw new Error('任务数据已发生改变或不存在，请在待办任务中确认此任务是否存在')
					} else {
						this.inputForm.type = '1'
						enrollmentRegistrationService.updateStatusById(this.inputForm).then(() => {
							this.loading = false
							callback()
						})
					}
				})
			}
		},
		//身份证号码唯一性判断
		idCardOnly(idCard, id) {
			if (this.commonJS.isNotEmpty(idCard)) {

				enrollmentRegistrationService.findIdCardOnly(idCard, this.inputForm.userId).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 }
					}
				})
			}
		},
		//联系电话唯一性判断
		mobilePhoneOnly(mobilePhone) {
			if (this.commonJS.isNotEmpty(mobilePhone)) {
				if (!this.validateXG.isPhoneOrMobile(mobilePhone)) {
					this.$message.error('”联系电话“填写不正确，请重新填写')
					this.loading = false
					this.inputForm.mobilePhone = ''
					throw new Error('”联系电话“填写不正确，请重新填写')
				}
				enrollmentRegistrationService.findMobilePhoneOnly(mobilePhone).then((data) => {
					if (data !== 0) {
						this.$message.error('联系电话已存在，请重新确认')
						this.inputForm.mobilePhone = ''
						throw new Error('联系电话已存在，请重新确认')
					}
				})
			}
		},
		handleChange(value) {

		},
		// 教育经历
		addEdu() {
			this.$refs.EducationInfo.init("add", null, this.inputForm.userId)
		},
		editEdu(id) {
			this.$refs.EducationInfo.init("edit", id, this.inputForm.userId)
		},
		delEdu(id) {
			this.$confirm('确定删除此条教育经历信息吗?', '提示', {
				confirmButtonText: '确定',
				cancelButtonText: '取消',
				type: 'warning'
			}).then(() => {
				this.loading = true
				enrollmentRegistrationService.deleteEduInfoById(id).then(res => {
					this.$message.success(res)
					this.loading = false
					this.handleGetEduInfo()
				})

			}).catch(() => {

			});
		},
		handleAddEduInfo(id) {
			this.handleGetEduInfo()
		},
		handleGetEduInfo() {
			enrollmentRegistrationService.findEduInfo({
				userId: this.inputForm.userId
			}).then(res => {
				this.inputForm.eduInfoList = res
			})
		},
		// 工作经历处理
		addWork() {
			this.$refs.WorkInfo.init("add", null, this.inputForm.userId)
		},
		editWork(id) {
			this.$refs.WorkInfo.init("edit", id, this.inputForm.userId)
		},
		delWork(id) {
			this.$confirm('确定删除此条工作经历信息吗?', '提示', {
				confirmButtonText: '确定',
				cancelButtonText: '取消',
				type: 'warning'
			}).then(() => {
				this.loading = true
				enrollmentRegistrationService.deleteWorkInfoById(id).then(res => {
					this.$message.success(res)
					this.loading = false
					this.handleGetWorkInfo()
				})

			}).catch(() => {

			});
		},
		handleAddWorkInfo(id) {
			this.handleGetWorkInfo()
		},
		handleGetWorkInfo() {
			enrollmentRegistrationService.findWorkInfo({
				userId: this.inputForm.userId
			}).then(res => {
				this.inputForm.workInfoList = res
			})
		},
		//培训经历处理
		addTraining() {
			this.$refs.TrainingInfo.init("add", null, this.inputForm.userId)
		},
		editTraining(id) {
			this.$refs.TrainingInfo.init("edit", id, this.inputForm.userId)
		},
		delTraining(id) {
			this.$confirm('确定删除此条培训经历信息吗?', '提示', {
				confirmButtonText: '确定',
				cancelButtonText: '取消',
				type: 'warning'
			}).then(() => {
				this.loading = true
				enrollmentRegistrationService.deleteTrainingInfoById(id).then(res => {
					this.$message.success(res)
					this.loading = false
					this.handleGetTrainingInfo()
				})

			}).catch(() => {

			});
		},
		handleAddTrainingInfo(id) {
			this.handleGetTrainingInfo()
		},
		handleGetTrainingInfo() {
			enrollmentRegistrationService.findTrainingInfo({
				userId: this.inputForm.userId
			}).then(res => {
				this.inputForm.trainingInfoList = res
			})
		},
		//资质证书处理
		addCertificate() {
			this.$refs.certificateInfo.init("add", null, this.inputForm.userId)
		},
		editCertificate(id) {
			this.$refs.certificateInfo.init("edit", id, this.inputForm.userId)
		},
		delCertificate(id) {
			this.$confirm('确定删除此条资质证书信息吗?', '提示', {
				confirmButtonText: '确定',
				cancelButtonText: '取消',
				type: 'warning'
			}).then(() => {
				this.loading = true
				enrollmentRegistrationService.deleteCertificateInfoById(id).then(res => {
					this.$message.success(res)
					this.loading = false
					this.handleGetCertificateInfo()
				})

			}).catch(() => {

			});
		},
		handleAddCertificateInfo(id) {
			this.handleGetCertificateInfo()
		},
		handleGetCertificateInfo() {
			enrollmentRegistrationService.findCertificateInfo({
				userId: this.inputForm.userId
			}).then(res => {
				this.inputForm.certificateInfoList = res
			})
		},
		//专业技能处理
		addSkill() {
			this.$refs.skillInfo.init("add", null, this.inputForm.userId)
		},
		editSkill(id) {
			this.$refs.skillInfo.init("edit", id, this.inputForm.userId)
		},
		delSkill(id) {
			this.$confirm('确定删除此条专业技能信息吗?', '提示', {
				confirmButtonText: '确定',
				cancelButtonText: '取消',
				type: 'warning'
			}).then(() => {
				this.loading = true
				enrollmentRegistrationService.deleteSkillInfoById(id).then(res => {
					this.$message.success(res)
					this.loading = false
					this.handleGetSkillInfo()
				})

			}).catch(() => {

			});
		},
		handleAddSkillInfo(id) {
			this.handleGetSkillInfo()
		},
		handleGetSkillInfo() {
			enrollmentRegistrationService.findSkillInfo({
				userId: this.inputForm.userId
			}).then(res => {
				this.inputForm.skillInfoList = res
			})
		},
		//语言能力处理
		addLanguage() {
			this.$refs.languageInfo.init("add", null, this.inputForm.userId)
		},
		editLanguage(id) {
			this.$refs.languageInfo.init("edit", id, this.inputForm.userId)
		},
		delLanguage(id) {
			this.$confirm('确定删除此条语言能力信息吗?', '提示', {
				confirmButtonText: '确定',
				cancelButtonText: '取消',
				type: 'warning'
			}).then(() => {
				this.loading = true
				enrollmentRegistrationService.deleteLanguageInfoById(id).then(res => {
					this.$message.success(res)
					this.loading = false
					this.handleGetLanguageInfo()
				})

			}).catch(() => {

			});
		},
		handleAddLanguageInfo(id) {
			this.handleGetLanguageInfo()
		},
		handleGetLanguageInfo() {
			enrollmentRegistrationService.findLanguageInfo({
				userId: this.inputForm.userId
			}).then(res => {
				this.inputForm.languageInfoList = res
			})
		},
		//家庭成员处理
		addFamily() {
			this.$refs.familyInfo.init("add", null, this.inputForm.userId)
		},
		editFamily(id) {
			this.$refs.familyInfo.init("edit", id, this.inputForm.userId)
		},
		delFamily(id) {
			this.$confirm('确定删除此条家庭成员信息吗?', '提示', {
				confirmButtonText: '确定',
				cancelButtonText: '取消',
				type: 'warning'
			}).then(() => {
				this.loading = true
				enrollmentRegistrationService.deleteFamilyInfoById(id).then(res => {
					this.$message.success(res)
					this.loading = false
					this.handleGetFamilyInfo()
				})

			}).catch(() => {

			});
		},
		handleAddFamilyInfo(id) {
			this.handleGetFamilyInfo()
		},
		handleGetFamilyInfo() {
			enrollmentRegistrationService.findFamilyInfo({
				userId: this.inputForm.userId
			}).then(res => {
				this.inputForm.familyInfoList = res
			})
		},
		//表彰与奖励处理
		addReward() {
			this.$refs.rewardInfo.init("add", null, this.inputForm.userId)
		},
		editReward(id) {
			this.$refs.rewardInfo.init("edit", id, this.inputForm.userId)
		},
		delReward(id) {
			this.$confirm('确定删除此条奖项信息吗?', '提示', {
				confirmButtonText: '确定',
				cancelButtonText: '取消',
				type: 'warning'
			}).then(() => {
				this.loading = true
				enrollmentRegistrationService.deleteRewardInfoById(id).then(res => {
					this.$message.success(res)
					this.loading = false
					this.handleGetRewardInfo()
				})

			}).catch(() => {

			});
		},
		handleAddRewardInfo(id) {
			this.handleGetRewardInfo()
		},
		handleGetRewardInfo() {
			enrollmentRegistrationService.findRewardInfo({
				userId: this.inputForm.userId
			}).then(res => {
				this.inputForm.rewardInfoList = res
			})
		},
		//社会及行业职务
		addSociety() {
			this.$refs.societyInfo.init("add", null, this.inputForm.userId)
		},
		editSociety(id) {
			this.$refs.societyInfo.init("edit", id, this.inputForm.userId)
		},
		delSociety(id) {
			this.$confirm('确定删除此条社会及行业职务信息吗?', '提示', {
				confirmButtonText: '确定',
				cancelButtonText: '取消',
				type: 'warning'
			}).then(() => {
				this.loading = true
				enrollmentRegistrationService.deleteSocietyInfoById(id).then(res => {
					this.$message.success(res)
					this.loading = false
					this.handleGetSocietyInfo()
				})

			}).catch(() => {

			});
		},
		handleAddSocietyInfo(id) {
			this.handleGetSocietyInfo()
		},
		handleGetSocietyInfo() {
			enrollmentRegistrationService.findSocietyInfo({
				userId: this.inputForm.userId
			}).then(res => {
				this.inputForm.societyInfoList = res
				this.activeNames[9] = this.inputForm.societyInfoList.map(item => item.id)
			})
		},
		//工作业绩
		addPerformance() {
			this.$refs.performanceInfo.init("add", null, this.inputForm.userId)
		},
		editPerformance(id) {
			this.$refs.performanceInfo.init("edit", id, this.inputForm.userId)
		},
		delPerformance(id) {
			this.$confirm('确定删除此条社会及行业职务信息吗?', '提示', {
				confirmButtonText: '确定',
				cancelButtonText: '取消',
				type: 'warning'
			}).then(() => {
				this.loading = true
				enrollmentRegistrationService.deletePerformanceInfoById(id).then(res => {
					this.$message.success(res)
					this.loading = false
					this.handleGetPerformanceInfo()
				})

			}).catch(() => {

			});
		},
		handleAddPerformanceInfo(id) {
			this.handleGetPerformanceInfo()
		},
		handleGetPerformanceInfo() {
			enrollmentRegistrationService.findPerformanceInfo({
				userId: this.inputForm.userId
			}).then(res => {
				this.inputForm.performanceInfoList = res
				this.activeNames[10] = this.inputForm.performanceInfoList.map(item => item.id)
			})
		},
		// 日期格式化
		handleDateFormatter(dateStr) {
			if (!dateStr) return ''; // 如果为空，返回空字符串
			return dayjs(dateStr).format('YYYY年MM月DD日');
		},
		changeInfoList(index) {
			this.changeFlag[index] = !this.changeFlag[index]
		},
		changeType(value, row) {

			if (value === '1' || value === '2') {
				let obj = this.$dictUtils.getDictList('sys_cert_profession_build').find(item => {
					return item.value == row.profession
				})
				if (obj) {
					row.profession = obj.label
				}
			} else if (value === '3' || value === '4') {
				let obj = this.$dictUtils.getDictList('sys_cert_profession_cost').find(item => {
					return item.value == row.profession
				})
				if (obj) {
					row.profession = obj.label
				}
			} else if (value === '5') {
				let obj = this.$dictUtils.getDictList('sys_cert_profession_supervision').find(item => {
					return item.value == row.profession
				})
				if (obj) {
					row.profession = obj.label
				}
			} else if (value === '6') {
				let obj = this.$dictUtils.getDictList('sys_cert_profession_accounting').find(item => {
					return item.value == row.profession
				})
				if (obj) {
					row.profession = obj.label
				}
			}
		},
	}
}
</script>

<style lang="less" scoped>
/deep/ .el-collapse-item__header {
	font-size: 16px !important;
	order: -1;
}

.collapseTitle {
	width: 100%;
	display: flex;
	align-items: center;
	order: 1;
}

.card-info {
	margin-bottom: 20px;
}

/deep/ .el-upload-list {


	.el-upload {
		width: 80px;
		height: 80px;
	}

	.el-upload-list__item {
		width: 80px;
		height: 80px;
	}

}
</style>
