From dfef5ca4b17c8996ac84b9a8e530f894db4b82d3 Mon Sep 17 00:00:00 2001 From: "jialong.yu" Date: Wed, 26 Jan 2022 18:18:24 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E3=80=81=E5=91=98=E5=B7=A5?= =?UTF-8?q?=E3=80=81=E5=AD=A6=E7=94=9F=E6=96=B0=E5=A2=9E=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=98=B2=E6=8A=96=EF=BC=8C=E4=BB=A5=E5=8F=8A?= =?UTF-8?q?=E6=88=90=E7=BB=A9=E5=88=97=E8=A1=A8=E7=8F=AD=E7=BA=A7=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E6=B7=BB=E5=8A=A0=E5=89=8D=E7=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.js | 1 + src/pages/achievement/teach/index.vue | 28 +++++++++++++++------------ src/pages/project/add/index.vue | 7 +++++-- src/pages/student/list/index.vue | 22 ++++++++++++++++++--- src/pages/system/list/staff.vue | 13 +++++++++++-- 5 files changed, 52 insertions(+), 19 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 55b10aa..8aef1db 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -71,6 +71,7 @@ export default { deleteReportById: `${host}occupationlab/achievement/deleteReportById`, // 批量删除成绩管理中的项目/批量删除成绩管理中的考核 experimentOverview: `${host}occupationlab/achievement/reportDetail`, // 查看实验报告 schoolCourseByAchievement: `${host}nakadai/nakadai/curriculum/schoolCourseByAchievement`, // 获取学校购买订单后的课程 + spliceClass: `${host}occupationlab/achievement/spliceClass`, // 项目管理 getSystemIdBySchool: `${host}occupationlab/projectManage/getSystemIdBySchool`, // 获取学校下拥有的系统 diff --git a/src/pages/achievement/teach/index.vue b/src/pages/achievement/teach/index.vue index 6b45802..ed0e5bc 100644 --- a/src/pages/achievement/teach/index.vue +++ b/src/pages/achievement/teach/index.vue @@ -9,7 +9,7 @@ - +
@@ -112,18 +112,8 @@ export default { }, 500); } }, - created() { - this.classList = JSON.parse(this.$route.query.classList); - const activeName = sessionStorage.getItem('activeName') - if(activeName && this.classList.some(item => item.id === activeName)) { - this.classId = activeName - this.activeName = activeName - }else { - this.classId = this.classList[0].id; - this.activeName = this.classList[0].id; - } - }, mounted() { + this.getSpliceClass() this.getData(); }, methods: { @@ -133,6 +123,20 @@ export default { sessionStorage.setItem('activeName', tab.name) this.getData(); }, + // 获取拼接班级 + getSpliceClass() { + this.$post(`${this.api.spliceClass}?assessmentId=${this.assessmentId}`).then(res => { + this.classList = res.list + const activeName = sessionStorage.getItem('activeName') + if(activeName && this.classList.some(item => item.id === activeName)) { + this.classId = activeName + this.activeName = activeName + }else { + this.classId = this.classList[0].id; + this.activeName = this.classList[0].id; + } + }).catch(err => {}) + }, getData() { // 获取表格数据 this.$post(`${this.api.getAssessmentDetail}?pageNum=${this.page}&pageSize=${this.pageSize}&assessmentId=${this.assessmentId}&classId=${this.classId}&keyword=${this.keyword}`).then(res => { this.listData = res.page.records; diff --git a/src/pages/project/add/index.vue b/src/pages/project/add/index.vue index d9e8074..bd1f15c 100644 --- a/src/pages/project/add/index.vue +++ b/src/pages/project/add/index.vue @@ -229,6 +229,7 @@ export default { isToPoint: false, // 判断是否是跳转到判分点系统 visibleLoading: false, // 加载弹框 listLoading:false,// 列表加载 + submiting: false // 新增编辑员工防抖标识 }; }, computed: { @@ -394,9 +395,11 @@ export default { return true; }, handleSubmit(state) { //处理提交 + if (this.submiting) return false if (!this.judgmentRelease()) { //判断页面是否有没有输入的内容 return; } + this.submiting = true this.setSystemId(this.projectManage.systemId); this.projectManage.state = state; let { systemId } = this.projectManage; @@ -435,7 +438,7 @@ export default { util.successMsg("更新实验项目成功"); this.$router.back(); }).catch(err => { - console.log(err); + this.submiting = false }); }, addProject(params) { // 添加项目 @@ -443,7 +446,7 @@ export default { util.successMsg("添加实验项目成功"); this.$router.back(); }).catch(err => { - console.log(err); + this.submiting = false }); }, manualDistributionScore() { //点击手动分配分值 diff --git a/src/pages/student/list/index.vue b/src/pages/student/list/index.vue index 2d4352c..623651b 100644 --- a/src/pages/student/list/index.vue +++ b/src/pages/student/list/index.vue @@ -406,7 +406,8 @@ export default { headers: { token: util.local.get(Setting.tokenKey) }, - disableds:false + disableds:false, + submiting: false // 新增编辑员工防抖标识 }; }, mounted() { @@ -886,6 +887,7 @@ export default { saveData(type) { // 提交新增/编辑学生 this.$refs.form.validate((valid) => { if (valid) { + if (this.submiting) return false let nodes = this.$refs.classTree.getCheckedNodes(); if (nodes.length) { let tempArr = []; @@ -897,6 +899,7 @@ export default { this.form.classId = tempArr.toString(); } if (this.form.accountId) { + this.submiting = true this.$post(this.api.modifyStudent, this.form).then(res => { util.successMsg("编辑成功!"); if (type) { @@ -909,13 +912,20 @@ export default { this.getOrgStudentData(); } } + setTimeout(() => { + this.submiting = false + }, 2000) }).catch(res => { - }); + setTimeout(() => { + this.submiting = false + }, 2000) + }) } else { if (this.accountReapeat) return util.warningMsg("该账号已存在"); if (this.workNumberReapeat) return util.warningMsg("该学生学号已存在"); if (this.phoneRepeat) return util.warningMsg("该手机号已存在"); if (this.emailRepeat) return util.warningMsg("该邮箱已存在"); + this.submiting = true this.form.uniqueIdentification = new Date().getTime(); this.$post(this.api.addStudent, this.form).then(res => { util.successMsg("新增成功!"); @@ -929,8 +939,14 @@ export default { this.getOrgStudentData(); } } + setTimeout(() => { + this.submiting = false + }, 2000) }).catch(res => { - }); + setTimeout(() => { + this.submiting = false + }, 2000) + }) } } else { return false; diff --git a/src/pages/system/list/staff.vue b/src/pages/system/list/staff.vue index 59c35ee..9edb76e 100644 --- a/src/pages/system/list/staff.vue +++ b/src/pages/system/list/staff.vue @@ -224,6 +224,7 @@ export default { gradeId: "", // 员工年级ID staffArchitectureId: "", // 员工部门ID + submiting: false // 新增编辑员工防抖标识 }; }, components: { @@ -487,6 +488,7 @@ export default { async saveSure(teacherForm) { this.$refs[teacherForm].validate((valid) => { if (valid) { + if (this.submiting) return false if (this.accountReapeat) return util.warningMsg("该账号已存在"); if (this.workNumberReapeat) return util.warningMsg("该员工工号已存在"); if (this.phoneRepeat) return util.warningMsg("该手机号已存在"); @@ -516,18 +518,25 @@ export default { } } } + this.submiting = true if (this.teacherForm.accountId) { this.$post(this.api.modifyStaff, data).then(res => { util.successMsg("编辑成功"); this.closeTeacher(); this.getData(); - }).catch(res => {}); + this.submiting = false + }).catch(res => { + this.submiting = false + }); } else { this.$post(this.api.saveStaff, data).then(res => { util.successMsg("添加成功"); this.closeTeacher(); this.getData(); - }).catch(res => {}); + this.submiting = false + }).catch(res => { + this.submiting = false + }); } } else { return false;