From 3d99ae3e0487b72010eb1a31b234320286f689b8 Mon Sep 17 00:00:00 2001 From: lijingyu007 <904564792@qq.com> Date: Fri, 31 May 2024 19:13:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=9A=E6=9D=A1=E7=BB=8F=E9=AA=8C=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=20=E6=88=91=E7=9A=84=E5=B7=A5=E5=85=B7=E5=9B=BE?= =?UTF-8?q?=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 4 +- src/api/tester/TesterApply.js | 17 + .../personability/abilityApply copy.vue | 1231 +++++++++++++++++ .../homepage/personability/abilityApply.vue | 426 +++--- .../personability/abilityUserDetail.vue | 18 +- .../personalpage/testmanagement/mytool.vue | 6 + 6 files changed, 1476 insertions(+), 226 deletions(-) create mode 100644 src/page/homepage/personability/abilityApply copy.vue diff --git a/.env.development b/.env.development index 51ba03e..933ce6e 100644 --- a/.env.development +++ b/.env.development @@ -6,11 +6,11 @@ VUE_APP_BASE_API = '/prod-api' # VUE_APP_BASE_TARGET = 'http://192.168.0.229:9999' -# VUE_APP_BASE_TARGET = 'http://192.168.0.129:9999' +VUE_APP_BASE_TARGET = 'http://192.168.0.129:9999' # VUE_APP_BASE_TARGET = 'http://172.16.36.180:9999' # VUE_APP_BASE_TARGET = 'http://172.16.36.176:9998' -VUE_APP_BASE_TARGET = 'https://www.keyitest.cn/test-api' +# VUE_APP_BASE_TARGET = 'https://www.keyitest.cn/test-api' # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true \ No newline at end of file diff --git a/src/api/tester/TesterApply.js b/src/api/tester/TesterApply.js index c817293..1703308 100644 --- a/src/api/tester/TesterApply.js +++ b/src/api/tester/TesterApply.js @@ -187,4 +187,21 @@ export function delBook(id) { url: '/tester/cert/credentials/' + id, method: 'delete', }) +} + + +// 多条记录添加 +export function addLists(data) { + return request({ + url: '/personal/case/addBatch', + method: 'post', + data + }) +} +export function updateLists(data) { + return request({ + url: '/personal/case/updateBatch', + method: 'post', + data + }) } \ No newline at end of file diff --git a/src/page/homepage/personability/abilityApply copy.vue b/src/page/homepage/personability/abilityApply copy.vue new file mode 100644 index 0000000..09be30f --- /dev/null +++ b/src/page/homepage/personability/abilityApply copy.vue @@ -0,0 +1,1231 @@ + + + + \ No newline at end of file diff --git a/src/page/homepage/personability/abilityApply.vue b/src/page/homepage/personability/abilityApply.vue index 09be30f..029ac7e 100644 --- a/src/page/homepage/personability/abilityApply.vue +++ b/src/page/homepage/personability/abilityApply.vue @@ -88,7 +88,7 @@
上一步
提交审核
-
下一步
+
保存,下一步
@@ -192,8 +192,6 @@
-
保存
-
修改
-
保存
-
修改
-
-
保存
-
@@ -354,8 +347,6 @@
-
保存
-
修改
-
保存
-
修改
审核不通过
-
去修改
+
去修改
@@ -472,13 +461,14 @@ import { couldBookUpdate, couldApply, delBook, + addLists, + updateLists, } from '@/api/tester/TesterApply' export default { components: { imageUpload }, data() { return { - flag: false, active: 0, // 实名认证 certifform: {}, @@ -514,7 +504,7 @@ export default { intro: [{ required: true, message: '请输入工作内容', trigger: 'blur' }], }, // 项目经历 - projectList: [{}], + projectList: [{ type: 0 }], projectRules: { name: [{ required: true, message: '请输入公司名称', trigger: 'blur' }], startTime: [{ required: true, message: '请输入开始时间', trigger: 'blur' }], @@ -545,7 +535,7 @@ export default { url: [{ required: true, message: '请上传证书', trigger: 'blur' }], }, // 教育经历 - educationList: [{}], + educationList: [{ type: 2 }], educationRules: { name: [{ required: true, message: '请输入学校名称', trigger: 'blur' }], startTime: [{ required: true, message: '请输入开始时间', trigger: 'blur' }], @@ -553,6 +543,7 @@ export default { education: [{ required: true, message: '请输入学历', trigger: 'change' }], major: [{ required: true, message: '请输入专业名称', trigger: 'blur' }], }, + base: process.env.VUE_APP_BASE_API, } }, watch: { @@ -575,7 +566,7 @@ export default { // 去修改 goedit() { this.userForm.status = null - this.active =1 + this.active = 1 }, // 提交审核 saveInfo() { @@ -592,7 +583,7 @@ export default { // 经历 this.projectList = res.experience.filter((it) => it.type == 0) if (!this.projectList.length) { - this.projectList = [{}] + this.projectList = [{ type: 0 }] } this.workList = res.experience.filter((it) => it.type == 1) if (!this.workList.length) { @@ -600,34 +591,41 @@ export default { } this.educationList = res.experience.filter((it) => it.type == 2) if (!this.educationList.length) { - this.educationList = [{}] + this.educationList = [{ type: 2 }] } // 个人简介 if (res.personalInfo) { this.userForm = res.personalInfo - if (!this.userForm.city || !this.userForm.testSkills || !this.userForm.personalAdvantage) { - this.userForm.flag = false + if (this.city) { + this.province = this.userForm.city.split('-')[0] + this.city = this.userForm.city.split('-')[1] } else { - this.userForm.flag = true + this.province = '北京市' + this.city = '北京市' + this.userForm.city = '北京市-北京市' } - this.province = this.userForm.city.split('-')[0] - this.city = this.userForm.city.split('-')[1] - // 审核状态 1审核通过 2不通过 没有或者0待审核 + // 审核状态 状态,0未审核,1审核中,2审核通过,3审核不通过 if (res.personalInfo.status === 0) { } else if (res.personalInfo.status === 1) { this.active = 6 } else if (res.personalInfo.status === 2) { this.active = 6 - } else { - this.active = 6 + } else if (res.personalInfo.status === 3) { + this.active = 6 + } + + if (res.personalInfo.status == 2 && this.userinform.testerStatus != 2) { + const data = JSON.parse(JSON.stringify(this.userinform)) + data.testerStatus = 2 + this.$store.commit('SET_USERINFORM', data) } } // 证书 this.certificateList = res.credentials.map((it) => { return { - url: it.fileUrl, + url: this.base + it.filePath, credentialsName: it.fileName, fileId: it.fileId, } @@ -694,59 +692,175 @@ export default { if (this.active == 0) { if (this.certifform.status != 1) { return this.$message.warning('请先通过实名认证') + } else { + this.active++ + return + } + } + if (this.active == 1 && this.workList.length) { + const flagArr = [] + this.workList.forEach((it, index) => { + this.$refs[`workRef${index}`][0].validate((valid) => { + if (valid) { + flagArr.push(true) + } else { + flagArr.push(false) + } + }) + }) + if (flagArr.some((it) => !it)) { + this.$message.warning('请填写完整') + } else { + // 全填了 + if (this.workList[0].caseId) { + // 修改 + updateLists(this.workList).then((res) => { + this.getCloudAllList() + this.active++ + this.$message.success('保存成功') + }) + } else { + addLists(this.workList).then((res) => { + this.getCloudAllList() + this.active++ + this.$message.success('保存成功') + }) + } } + return } - if (this.active == 2) { + if (this.active == 1 && !this.workList.length) { + this.active++ + return + } + if (this.active == 2 && this.projectList.length) { // 项目经历 - if (this.projectList.length && this.projectList[0].caseId) { + const flagArr2 = [] + this.projectList.forEach((it, index) => { + this.$refs[`projectRef${index}`][0].validate((valid) => { + if (valid) { + flagArr2.push(true) + } else { + flagArr2.push(false) + } + }) + }) + if (flagArr2.some((it) => !it)) { + this.$message.warning('请填写完整') } else { - return this.$message.warning('至少保存一条项目经历') + // 全填了 + if (this.projectList[0].caseId) { + // 修改 + updateLists(this.projectList).then((res) => { + this.getCloudAllList() + this.active++ + this.$message.success('保存成功') + }) + } else { + addLists(this.projectList).then((res) => { + this.getCloudAllList() + this.active++ + this.$message.success('保存成功') + }) + } } + return } if (this.active == 3) { // 个人简介 - if (!this.userForm.flag) { - return this.$message.warning('请先保存个人简介') - } + this.$refs[`userRef`].validate((valid) => { + if (valid) { + if (this.userForm.city.indexOf('--- 市 ---') != -1) { + return this.$message.warning('请选择市') + } + couldUserInfoAdd(this.userForm).then((res) => { + this.$message.success('保存个人简介成功') + this.getCloudAllList() + this.active++ + return + }) + } + }) } - if (this.active == 5) { + if (this.active == 5 && this.educationList.length) { // 教育经历 - if (this.educationList.length && this.educationList[0].caseId) { + const flagArr3 = [] + this.educationList.forEach((it, index) => { + this.$refs[`educationRef${index}`][0].validate((valid) => { + if (valid) { + flagArr3.push(true) + } else { + flagArr3.push(false) + } + }) + }) + if (flagArr3.some((it) => !it)) { + this.$message.warning('请填写完整') } else { - return this.$message.warning('至少保存一条教育经历') + // 全填了 + if (this.educationList[0].caseId) { + // 修改 + updateLists(this.educationList).then((res) => { + this.getCloudAllList() + this.active++ + this.$message.success('保存成功') + }) + } else { + addLists(this.educationList).then((res) => { + this.getCloudAllList() + this.active++ + this.$message.success('保存成功') + }) + } } + return + } + if (this.active == 4 && this.certificateList.length) { + const flagArr4 = [] + this.certificateList.forEach((it, index) => { + this.$refs[`certificateRef${index}`][0].validate((valid) => { + if (valid) { + flagArr4.push(true) + } else { + flagArr4.push(false) + } + }) + }) + if (flagArr4.some((it) => !it)) { + this.$message.warning('请填写完整') + } else { + // 全填了 + this.certificateList.forEach((it) => { + if (it.url) { + it.url = it.url.replace(/.*\/profile/, '/profile') + } + }) + if (this.certificateList[0].fileId) { + // 修改 + couldBookUpdate({ credentialsList: this.certificateList }).then((res) => { + this.getCloudAllList() + this.active++ + this.$message.success('保存成功') + }) + } else { + couldBookAdd({ credentialsList: this.certificateList }).then((res) => { + this.getCloudAllList() + this.active++ + this.$message.success('保存成功') + }) + } + } + return + } + if (this.active == 4 && !this.certificateList.length) { + this.active++ + return } - this.active++ }, // 工作经历添加 addWork() { if (this.workList.length >= 10) return this.$message.warning('工作经历最多添加10条') - this.workList.push({}) - }, - // 工作经历保存 - saveWork(i) { - this.$refs[`workRef${i}`][0].validate((valid) => { - if (valid) { - const data = this.workList[i] - data.type = 1 - couldInfoAdd(data).then((res) => { - this.$message.success('工作经历保存成功') - this.getCloudAllList() - }) - } - }) - }, - // 工作经历修改 - updateWork(i) { - this.$refs[`workRef${i}`][0].validate((valid) => { - if (valid) { - const data = this.workList[i] - couldInfoUpdate(data).then((res) => { - this.$message.success('工作经历修改成功') - this.getCloudAllList() - }) - } - }) + this.workList.push({ type: 1 }) }, // 工作经历删除 delWork(i) { @@ -755,52 +869,17 @@ export default { cancelButtonText: '取消', type: 'warning', }).then(() => { - if (this.workList[i].caseId) { - couldInfoDelete(this.workList[i].caseId).then(() => { - this.$message({ - type: 'success', - message: '删除成功!', - }) - this.getCloudAllList() - }) - } else { - this.workList.splice(i, 1) - this.$message({ - type: 'success', - message: '删除成功!', - }) - } + this.workList.splice(i, 1) + this.$message({ + type: 'success', + message: '删除成功!', + }) }) }, // 项目经历添加 addProject() { if (this.projectList.length >= 20) return this.$message.warning('项目经历最多添加20条') - this.projectList.push({}) - }, - // 项目经历保存 - saveProject(i) { - this.$refs[`projectRef${i}`][0].validate((valid) => { - if (valid) { - const data = this.projectList[i] - data.type = 0 - couldInfoAdd(data).then((res) => { - this.$message.success('项目经历保存成功') - this.getCloudAllList() - }) - } - }) - }, - // 项目经历修改 - updateProject(i) { - this.$refs[`projectRef${i}`][0].validate((valid) => { - if (valid) { - const data = this.projectList[i] - couldInfoUpdate(data).then((res) => { - this.$message.success('项目经历修改成功') - this.getCloudAllList() - }) - } - }) + this.projectList.push({ type: 0 }) }, // 项目经历删除 delProject(i) { @@ -809,74 +888,19 @@ export default { cancelButtonText: '取消', type: 'warning', }).then(() => { - if (this.projectList[i].caseId) { - couldInfoDelete(this.projectList[i].caseId).then(() => { - this.$message({ - type: 'success', - message: '删除成功!', - }) - this.getCloudAllList() - }) - } else { - if (this.projectList.length == 1) return this.$message.warning('最少有一项') - this.projectList.splice(i, 1) - this.$message({ - type: 'success', - message: '删除成功!', - }) - } - }) - }, - // 个人简介保存 - saveUser() { - this.$refs[`userRef`].validate((valid) => { - if (valid) { - if (this.userForm.city.indexOf('--- 市 ---') != -1) { - return this.$message.warning('请选择市') - } - couldUserInfoAdd(this.userForm).then((res) => { - this.$message.success('保存个人简介成功') - this.userForm.flag = true - }) - } + if (this.projectList.length == 1) return this.$message.warning('最少有一项') + this.projectList.splice(i, 1) + this.$message({ + type: 'success', + message: '删除成功!', + }) }) }, // 资格证书添加 addCertificate() { this.certificateList.push({}) }, - // 保存证书 - saveCertificate(i) { - this.$refs[`certificateRef${i}`][0].validate((valid) => { - if (valid) { - const data = { - credentialsList: [JSON.parse(JSON.stringify(this.certificateList[i]))], - } - data.credentialsList[0].url = data.credentialsList[0].url.replace(/.*\/profile/, '/profile') - couldBookAdd(data).then((res) => { - this.$message.success('资格证书保存成功') - this.getCloudAllList() - }) - } - }) - }, - // 更新证书 - updateCertificate(i) { - this.$refs[`certificateRef${i}`][0].validate((valid) => { - if (valid) { - const data = { - credentialsList: JSON.parse(JSON.stringify(this.certificateList)), - } - data.credentialsList.forEach((it) => { - it.url = it.url.replace(/.*\/profile/, '/profile') - }) - couldBookUpdate(data).then((res) => { - this.$message.success('资格证书修改成功') - this.getCloudAllList() - }) - } - }) - }, + // 资格证书删除 delCertificate(i) { this.$confirm('此操作将永久删除, 是否继续?', '提示', { @@ -884,49 +908,17 @@ export default { cancelButtonText: '取消', type: 'warning', }).then(() => { - if (this.certificateList[i].fileId) { - delBook(this.certificateList[i].fileId).then((res) => { - this.$message.success('资格证书删除成功') - this.getCloudAllList() - }) - } else { - this.certificateList.splice(i, 1) - this.$message({ - type: 'success', - message: '删除成功!', - }) - } + this.certificateList.splice(i, 1) + this.$message({ + type: 'success', + message: '删除成功!', + }) }) }, // 教育经历添加 addEducation() { this.educationList.push({}) }, - // 教育经历保存 - saveEducation(i) { - this.$refs[`educationRef${i}`][0].validate((valid) => { - if (valid) { - const data = this.educationList[i] - data.type = 2 - couldInfoAdd(data).then((res) => { - this.$message.success('教育经历保存成功') - this.getCloudAllList() - }) - } - }) - }, - // 教育经历修改 - updateEducation(i) { - this.$refs[`educationRef${i}`][0].validate((valid) => { - if (valid) { - const data = this.educationList[i] - couldInfoUpdate(data).then((res) => { - this.$message.success('教育经历修改成功') - this.getCloudAllList() - }) - } - }) - }, // 教育经历删除 delEducation(i) { this.$confirm('此操作将永久删除, 是否继续?', '提示', { @@ -934,22 +926,12 @@ export default { cancelButtonText: '取消', type: 'warning', }).then(() => { - if (this.educationList[i].caseId) { - couldInfoDelete(this.educationList[i].caseId).then(() => { - this.$message({ - type: 'success', - message: '删除成功!', - }) - this.getCloudAllList() - }) - } else { - if (this.educationList.length == 1) return this.$message.warning('最少有一项') - this.educationList.splice(i, 1) - this.$message({ - type: 'success', - message: '删除成功!', - }) - } + if (this.educationList.length == 1) return this.$message.warning('最少有一项') + this.educationList.splice(i, 1) + this.$message({ + type: 'success', + message: '删除成功!', + }) }) }, // 省 @@ -977,8 +959,8 @@ export default {