Browse Source

用户信息审批出现重复数据问题处理

huangguoce 1 month ago
parent
commit
bb3e7aecab

+ 27 - 10
src/views/sys/user/UserInfo.vue

@@ -2138,25 +2138,31 @@
 			</el-card>
 		</el-main>
 		<!-- 教育经历 -->
-		<EducationInfo ref="EducationInfo" @addEduInfo="handleAddEduInfo"></EducationInfo>
+		<EducationInfo ref="EducationInfo" @addEduInfo="handleAddEduInfo" :list="eduInfoList"></EducationInfo>
 		<!-- 工作经历 -->
-		<WorkInfo ref="WorkInfo" @addWorkInfo="handleAddWorkInfo"></WorkInfo>
+		<WorkInfo ref="WorkInfo" @addWorkInfo="handleAddWorkInfo" :list="workInfoList"></WorkInfo>
 		<!-- 培训经历 -->
-		<TrainingInfo ref="TrainingInfo" @addTrainingInfo="handleAddTrainingInfo"></TrainingInfo>
+		<TrainingInfo ref="TrainingInfo" @addTrainingInfo="handleAddTrainingInfo" :list="trainingInfoList">
+		</TrainingInfo>
 		<!-- 执业资格证书 -->
-		<CertificateInfo ref="certificateInfo" @addCertificateInfo="handleAddCertificateInfo"></CertificateInfo>
+		<CertificateInfo ref="certificateInfo" @addCertificateInfo="handleAddCertificateInfo"
+			:list="certificateInfoList">
+		</CertificateInfo>
 		<!-- 职称证书 -->
-		<SkillInfo ref="skillInfo" @addSkillInfo="handleAddSkillInfo"></SkillInfo>
+		<SkillInfo ref="skillInfo" @addSkillInfo="handleAddSkillInfo" :list="skillInfoList"></SkillInfo>
 		<!--外语语种 -->
-		<LanguageInfo ref="languageInfo" @addLanguageInfo="handleAddLanguageInfo"></LanguageInfo>
+		<LanguageInfo ref="languageInfo" @addLanguageInfo="handleAddLanguageInfo" :list="languageInfoList">
+		</LanguageInfo>
 		<!-- 家庭情况 -->
-		<FamilyInfo ref="familyInfo" @addFamilyInfo="handleAddFamilyInfo"></FamilyInfo>
+		<FamilyInfo ref="familyInfo" @addFamilyInfo="handleAddFamilyInfo" :list="familyInfoList"></FamilyInfo>
 		<!-- 表彰与奖励 -->
-		<RewardInfo ref="rewardInfo" @addRewardInfo="handleAddRewardInfo"></RewardInfo>
+		<RewardInfo ref="rewardInfo" @addRewardInfo="handleAddRewardInfo" :list="rewardInfoList"></RewardInfo>
 		<!-- 社会及行业职务 -->
-		<SocietyInfo ref="societyInfo" @addSocietyInfo="handleAddSocietyInfo"></SocietyInfo>
+		<SocietyInfo ref="societyInfo" @addSocietyInfo="handleAddSocietyInfo" :list="societyInfoList"></SocietyInfo>
 		<!-- 工作业绩 -->
-		<PerformanceInfo ref="performanceInfo" @addPerformanceInfo="handleAddPerformanceInfo"></PerformanceInfo>
+		<PerformanceInfo ref="performanceInfo" @addPerformanceInfo="handleAddPerformanceInfo"
+			:list="performanceInfoList">
+		</PerformanceInfo>
 
 	</el-container>
 </template>
@@ -2538,6 +2544,17 @@ export default {
 		},
 		init(userId) {
 			this.loading = true;
+			this.eduInfoList = []
+			this.certificateInfoList = []
+			this.skillInfoList = []
+			this.familyInfoList = []
+			this.languageInfoList = []
+			this.trainingInfoList = []
+			this.rewardInfoList = []
+			this.laborContractInfoList = []
+			this.workInfoList = []
+			this.societyInfoList = []
+			this.performanceInfoList = []
 			enrollmentRegistrationService.findInfoByUserId(userId).then(async (data) => {
 				this.fileList = []
 				this.fileList2 = []

+ 17 - 0
src/views/sys/user/components/CertificateInfo.vue

@@ -99,6 +99,11 @@ export default {
 		status: {
 			type: String,
 			default: ''
+		},
+		// 证书列表
+		list: {
+			type: Array,
+			default: () => []
 		}
 	},
 	data() {
@@ -248,6 +253,18 @@ export default {
 
 			this.$refs['inputForm'].validate((valid) => {
 				if (valid) {
+
+
+					let index = this.list.findIndex(temp => {
+						//type和no
+						return temp.type == this.inputForm.type && temp.no == this.inputForm.no && temp.id !== this.inputForm.id
+					})
+					if (index > -1) {
+						this.$message.error('已存在相同的证书,请勿重复添加')
+						return
+					}
+
+
 					this.inputForm.enrollDate = new Date(this.inputForm.enrollDate).getTime(); // 转为时间戳
 					this.inputForm.expireDate = new Date(this.inputForm.expireDate).getTime(); // 转为时间戳
 					this.inputForm.issuedDate = new Date(this.inputForm.issuedDate).getTime(); // 转为时间戳

+ 13 - 0
src/views/sys/user/components/EducationInfo.vue

@@ -173,6 +173,10 @@ export default {
 		status: {
 			type: String,
 			default: ''
+		},
+		list: {
+			type: Array,
+			default: () => []
 		}
 	},
 	data() {
@@ -363,6 +367,15 @@ export default {
 			}
 			this.$refs['inputForm'].validate((valid) => {
 				if (valid) {
+					let index = this.list.findIndex(temp => {
+						return temp.id !== this.inputForm.id && temp.graduatedFrom == this.inputForm.graduatedFrom && temp.speciality == this.inputForm.speciality && temp.education == this.inputForm.education
+					})
+					if (index > -1) {
+						this.$message.error('已存在相同的教育经历,请勿重复添加')
+						return
+					}
+
+
 					let eduFiles = this.$refs.educationUploadComponent.getDataList()
 					if (!eduFiles || eduFiles.length === 0) {
 						this.$message.error('请上传学历附件')

+ 13 - 0
src/views/sys/user/components/FamilyInfo.vue

@@ -82,6 +82,10 @@ export default {
 		status: {
 			type: String,
 			default: ''
+		},
+		list: {
+			type: Array,
+			default: () => []
 		}
 	},
 	data() {
@@ -206,6 +210,15 @@ export default {
 		doSubmit() {
 			this.$refs['inputForm'].validate((valid) => {
 				if (valid) {
+
+					let index = this.list.findIndex(temp => {
+						return temp.id !== this.inputForm.id && temp.name == this.inputForm.name && temp.gender == this.inputForm.gender && temp.relation == this.inputForm.relation
+					})
+					if (index > -1) {
+						this.$message.error('已存在相同的家庭成员,请勿重复添加')
+						return
+					}
+
 					this.inputForm.birthDate = new Date(this.inputForm.birthDate).getTime(); // 转为时间戳
 					// this.$emit("addFamilyInfo", JSON.parse(JSON.stringify(this.inputForm)))
 					// this.close()

+ 14 - 0
src/views/sys/user/components/LanguageInfo.vue

@@ -85,6 +85,10 @@ export default {
 		status: {
 			type: String,
 			default: ''
+		},
+		list: {
+			type: Array,
+			default: () => []
 		}
 	},
 	data() {
@@ -212,6 +216,16 @@ export default {
 			}
 			this.$refs['inputForm'].validate((valid) => {
 				if (valid) {
+
+					let index = this.list.findIndex(temp => {
+						//type和no
+						return temp.id !== this.inputForm.id && temp.language == this.inputForm.language
+					})
+					if (index > -1) {
+						this.$message.error('已存在相同的语种,请勿重复添加')
+						return
+					}
+
 					this.inputForm.files = this.$refs.upLoadComponent.getDataList()
 					// this.$emit("addLanguageInfo", JSON.parse(JSON.stringify(this.inputForm)))
 					// this.close()

+ 11 - 0
src/views/sys/user/components/PerformanceInfo.vue

@@ -76,6 +76,10 @@ export default {
 		status: {
 			type: String,
 			default: ''
+		},
+		list: {
+			type: Array,
+			default: () => []
 		}
 	},
 	data() {
@@ -195,6 +199,13 @@ export default {
 					// this.$emit("addPerformanceInfo", JSON.parse(JSON.stringify(this.inputForm)))
 					// this.close()
 
+					let index = this.list.findIndex(temp => {
+						return temp.id !== this.inputForm.id && temp.name == this.inputForm.name && temp.client == this.inputForm.client && temp.type == this.inputForm.type && temp.info == this.inputForm.info && temp.position == this.inputForm.position
+					})
+					if (index > -1) {
+						this.$message.error('已存在相同的工作业绩,请勿重复添加')
+						return
+					}
 
 					if (this.inputForm.id && this.inputForm.status != "1" && this.inputForm.status != "4") {
 						enrollmentRegistrationService.updateInfoStatus({

+ 17 - 0
src/views/sys/user/components/RewardInfo.vue

@@ -49,6 +49,8 @@
 <script>
 import UpLoadComponent from '@/views/common/UpLoadComponentCardStyle'
 import enrollmentRegistrationService from '@/api/human/enrollment/EnrollmentRegistrationService'
+import dayjs from "dayjs";
+
 export default {
 	props: {
 		businessId: {
@@ -62,6 +64,10 @@ export default {
 		status: {
 			type: String,
 			default: ''
+		},
+		list: {
+			type: Array,
+			default: () => []
 		}
 	},
 	data() {
@@ -190,6 +196,17 @@ export default {
 
 			this.$refs['inputForm'].validate((valid) => {
 				if (valid) {
+
+
+					let tempDate = dayjs(this.inputForm.rewardDate).format('YYYY-MM-DD HH:mm:ss')
+					let index = this.list.findIndex(temp => {
+						return temp.id !== this.inputForm.id && temp.name == this.inputForm.name && temp.rewardDate == tempDate
+					})
+					if (index > -1) {
+						this.$message.error('已存在相同的奖项信息,请勿重复添加')
+						return
+					}
+
 					this.inputForm.rewardDate = new Date(this.inputForm.rewardDate).getTime(); // 转为时间戳
 					this.inputForm.files = this.$refs.upLoadComponent.getDataList()
 					// this.$emit("addRewardInfo", JSON.parse(JSON.stringify(this.inputForm)))

+ 13 - 0
src/views/sys/user/components/SkillInfo.vue

@@ -77,6 +77,10 @@ export default {
 		status: {
 			type: String,
 			default: ''
+		},
+		list: {
+			type: Array,
+			default: () => []
 		}
 	},
 	data() {
@@ -210,6 +214,15 @@ export default {
 			}
 			this.$refs['inputForm'].validate((valid) => {
 				if (valid) {
+
+					let index = this.list.findIndex(temp => {
+						return temp.id !== this.inputForm.id && temp.name == this.inputForm.name && temp.proficiency == this.inputForm.proficiency
+					})
+					if (index > -1) {
+						this.$message.error('已存在相同的职称信息,请勿重复添加')
+						return
+					}
+
 					this.inputForm.obtainDate = new Date(this.inputForm.obtainDate).getTime(); // 转为时间戳
 					this.inputForm.files = this.$refs.upLoadComponent.getDataList()
 					// this.$emit("addSkillInfo", JSON.parse(JSON.stringify(this.inputForm)))

+ 13 - 0
src/views/sys/user/components/SocietyInfo.vue

@@ -60,6 +60,10 @@ export default {
 		status: {
 			type: String,
 			default: ''
+		},
+		list: {
+			type: Array,
+			default: () => []
 		}
 	},
 	data() {
@@ -172,6 +176,15 @@ export default {
 		doSubmit() {
 			this.$refs['inputForm'].validate((valid) => {
 				if (valid) {
+
+					let index = this.list.findIndex(temp => {
+						return temp.id !== this.inputForm.id && temp.name == this.inputForm.name && temp.institution == this.inputForm.institution
+					})
+					if (index > -1) {
+						this.$message.error('已存在相同的职务信息,请勿重复添加')
+						return
+					}
+
 					if (this.commonJS.isNotEmpty(this.inputForm.startDate)) {
 						this.inputForm.startDate = new Date(this.inputForm.startDate).getTime(); // 转为时间戳
 					}

+ 13 - 1
src/views/sys/user/components/TrainingInfo.vue

@@ -9,7 +9,7 @@
 				<el-row :gutter="26">
 					<el-col :span="12">
 						<el-form-item label="名称" prop="name">
-							<el-input v-model="inputForm.name" placeholder="请输入单位名称"></el-input>
+							<el-input v-model="inputForm.name" placeholder="请输入名称"></el-input>
 						</el-form-item>
 					</el-col>
 
@@ -60,6 +60,10 @@ export default {
 		status: {
 			type: String,
 			default: ''
+		},
+		list: {
+			type: Array,
+			default: () => []
 		}
 	},
 	data() {
@@ -181,6 +185,14 @@ export default {
 			}
 			this.$refs['inputForm'].validate((valid) => {
 				if (valid) {
+					let index = this.list.findIndex(temp => {
+						return temp.id !== this.inputForm.id && temp.name == this.inputForm.name && temp.trainingInstitution == this.inputForm.trainingInstitution
+					})
+					if (index > -1) {
+						this.$message.error('已存在相同的培训经历,请勿重复添加')
+						return
+					}
+
 					this.inputForm.files = this.$refs.upLoadComponent.getDataList()
 					// this.$emit("addTrainingInfo", JSON.parse(JSON.stringify(this.inputForm)))
 					// this.close()

+ 14 - 0
src/views/sys/user/components/WorkInfo.vue

@@ -78,6 +78,10 @@ export default {
 		status: {
 			type: String,
 			default: ''
+		},
+		list: {
+			type: Array,
+			default: () => []
 		}
 	},
 	data() {
@@ -207,6 +211,16 @@ export default {
 		doSubmit() {
 			this.$refs['inputForm'].validate((valid) => {
 				if (valid) {
+
+
+					let index = this.list.findIndex(temp => {
+						return temp.id !== this.inputForm.id && temp.companyName == this.inputForm.companyName && temp.position == this.inputForm.position
+					})
+					if (index > -1) {
+						this.$message.error('已存在相同的工作经历,请勿重复添加')
+						return
+					}
+
 					this.inputForm.startDate = new Date(this.inputForm.startDate).getTime(); // 转为时间戳
 					this.inputForm.endDate = new Date(this.inputForm.endDate).getTime(); // 转为时间戳
 					// this.$emit("addWorkInfo", JSON.parse(JSON.stringify(this.inputForm)))