Эх сурвалжийг харах

fix: 修改工作经历中切换岗位,标签未重置问题,修改技能不显示和不能删除等bug

yezhihao 6 сар өмнө
parent
commit
1797e71852

+ 20 - 4
package/jobIntention/jobSkills.vue

@@ -84,7 +84,8 @@
 				customTags: [],
 				operationOptions: [],
 				tagParam: '' ,// 新增:保存传入的tag参数
-				ruleClassifyId:''
+				ruleClassifyId:'',
+				fromPage: '', // 判断从哪个页面进入
 			}
 		},
 		onLoad(options) {
@@ -111,6 +112,10 @@
 			}
 			this.getData()
 			set = options && options.set ? options.set : 0
+			// 判断从哪个页面进入 onlineResume:在线简历
+			if (options.from) {
+				this.fromPage = options.from
+			}
 		},
 		methods: {
 			goBack() {
@@ -128,14 +133,25 @@
 				this.$Request.getT(action, data).then(res => {
 					if (res.code == 0) {
 						this.operationOptions = res.data
-						// 数据加载完成后处理标签回显
-						if (this.tagParam) {
+						
+						if (this.fromPage === 'onlineResume') {
+							const tags = res.data.map(tag => tag.skillName)
+							this.setCustomTags(tags)							
+						} else if (this.tagParam) {
+							// 数据加载完成后处理标签回显
 							this.handleTagDisplay(this.tagParam)
 						}
 					}
 				})
 			},
 			
+			// 设置自定义回显
+			setCustomTags(tags) {
+				tags.forEach(tag => {
+					this.customTags.push(tag)
+				})
+			},
+			
 			handleTagDisplay(tagString) {
 				const tagArray = tagString
 					.split(',')
@@ -223,7 +239,7 @@
 			},
 			confirmSelection() {
 				// 合并选择的标签和自定义标签并回传
-				const allSelectedTags = [...this.selectedOperation, ...this.customTags]
+				const allSelectedTags = this.fromPage === 'onlineResume' ? this.customTags : [...this.selectedOperation, ...this.customTags]
 				// 触发事件通知上一页面
 				uni.$emit('skillsUpdated', {
 					jobTitle: this.jobTitle,

+ 18 - 8
pages/my/educationExperience.vue

@@ -314,14 +314,24 @@ export default {
 
 		saveWorkExperience() {
 			console.log(this.formData.resumes)
-		  if (!this.formData.companyName) {
-		    uni.showToast({ title: "请输入学校名称", icon: "none" });
-		    return;
-		  }
-		  if (this.formData.employmentTime.length<=0) {
-		    uni.showToast({ title: "请选择在校时间", icon: "none" });
-		    return;
-		  }
+			if (!this.formData.companyName) {
+				uni.showToast({ title: "请输入学校名称", icon: "none" });
+				return;
+			}
+			
+			const times = this.formData.employmentTime.filter(time => {
+				if (time) {
+					return time
+				}
+			})
+			if (times.length <= 0) {
+				uni.showToast({ title: "请选择在校时间", icon: "none" });
+				return;
+			}
+			if (times.length < 2) {
+				uni.showToast({ title: "请完善在校时间", icon: "none" });
+				return
+			}
 		  
 			let data={
 				eduId:id,

+ 2 - 2
pages/my/onlineResume.vue

@@ -404,7 +404,7 @@ export default {
 		},
 		goToJobSkills() {
 			uni.navigateTo({
-				url: '/package/jobIntention/jobSkills?set=1&jobTitle=我的&skill=' + encodeURIComponent(JSON
+				url: '/package/jobIntention/jobSkills?from=onlineResume&set=1&jobTitle=我的&skill=' + encodeURIComponent(JSON
 					.stringify(this.detail.skills == null ? [] : this.$queue.array_column(this.detail
 						.skills, 'skillName')))
 			})
@@ -1102,7 +1102,7 @@ export default {
 						line-height: 24rpx;
 						letter-spacing: 0%;
 						text-align: left;
-						white-space: pre-wrap;
+						word-break: break-all;
 					}
 
 					.skill-tags {

+ 1 - 0
pages/my/workExperience.vue

@@ -321,6 +321,7 @@ export default {
 			this.$Request.getT('/app/userFirst/getPostSkill', data).then(res => {
 				if (res.code == 0) {
 					if (res.data.length > 0 && res.data[0]?.childrenList[0]?.postSkillName)
+						this.formData.resumes[this.operateKey].skills = []
 						this.formData.resumes[this.operateKey].skills.push(res.data[0]?.childrenList[0]?.postSkillName)
 				}
 			})