From 2322f2c9fbb7d41f828aef654df1eb578c991821 Mon Sep 17 00:00:00 2001 From: e <2432808546@qq.com> Date: Mon, 15 Nov 2021 17:20:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.js | 2 +- src/pages/account/login/index.vue | 4 ++- src/pages/achievement/ass/index.vue | 50 +++++++++++++++++------------ src/pages/assessment/list/index.vue | 9 +++--- src/pages/student/list/index.vue | 32 +++++++++--------- src/pages/system/list/role.vue | 11 ++++++- src/pages/system/list/staff.vue | 22 +++++++++---- 7 files changed, 79 insertions(+), 51 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index b68a15b..56ea0c0 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -52,10 +52,10 @@ export default { pageByCondition: `${host}occupationlab/assessment/pageByCondition`, // 考核管理列表 saveAssessment: `${host}occupationlab/assessment/saveAssessment`, // 创建考核 modifyAssessment: `${host}occupationlab/assessment/modifyAssessment`, // 编辑考核 + enableAssessment: `${host}occupationlab/assessment/enableAssessment`, // 修改考核状态 getDetailById: `${host}occupationlab/assessment/getDetailById`, // 根据考核Id查询考核详情 deleteAssessment: `${host}occupationlab/assessment/deleteAssessment`, // 单个、批量删除 collectPaper: `${host}occupationlab/assessment/collectPaper`, // 收卷(提前结束) - schoolCourse: `${host}nakadai/nakadai/curriculum/schoolCourse`, // 获取学校购买订单后的课程 projectListByCourseId: `${host}nakadai/nakadai/curriculum/projectListByCourseId`, // 根据课程id获取实训项目列表 diff --git a/src/pages/account/login/index.vue b/src/pages/account/login/index.vue index e3f348c..c4cde2e 100644 --- a/src/pages/account/login/index.vue +++ b/src/pages/account/login/index.vue @@ -36,7 +36,9 @@ - 依据国家政策法规,需绑定手机号进行实网络实名才可登录使用本平台 +
+ 依据国家政策法规,需绑定手机号进行实网络实名才可登录使用本平台 +
diff --git a/src/pages/achievement/ass/index.vue b/src/pages/achievement/ass/index.vue index 958754f..0438a76 100644 --- a/src/pages/achievement/ass/index.vue +++ b/src/pages/achievement/ass/index.vue @@ -15,6 +15,9 @@ + + +
@@ -82,10 +85,10 @@ import echarts from "echarts"; export default { data() { return { - systemId: this.$route.query.systemId, id: this.$route.query.id, + classId: this.$route.query.classId, projectId: this.$route.query.projectId, - projectName: this.$route.query.name, + classInfo: [], experimentalName: this.$route.query.experimentalName, className: this.$route.query.class, keyword: "", @@ -94,32 +97,37 @@ export default { page: 1, pageSize: 10, total: 0, - avg: 0 + avg: 0, + activeName:'', }; }, mounted() { + this.classInfo = JSON.parse(this.$route.query.classInfo) + for(var i=0;i { - let list = res.data.list; - let score = 0; - list.map(n => { - n.class = this.className; - score += n.score; - }); - this.listData = list; - this.total = res.data.totalCount; - this.avg = score ? (score / res.data.totalCount).toFixed(2) : 0; - this.getChart(); + this.$post(`${this.api.getAssessmentDetail}?assessmentId=${+this.id}&pageNum=${this.page}&pageSize=${this.pageSize}&classId=${this.activeName}`).then(res => { + if (res.status == 200){ + this.avg = res.avgScore + this.total = res.peopleNum + let list = res.page.records; + let score = 0; + list.map(n => { + n.class = this.className; + score += n.score; + }); + this.listData = list; + this.getChart(); + } }).catch(res => { }); }, diff --git a/src/pages/assessment/list/index.vue b/src/pages/assessment/list/index.vue index bf3fbb5..828eacd 100644 --- a/src/pages/assessment/list/index.vue +++ b/src/pages/assessment/list/index.vue @@ -4,7 +4,7 @@
  • - + {{ item.name }} @@ -327,15 +327,14 @@ export default { this.$router.push(`add?id=${row.id}`); }, show(row) { - this.$router.push(`/achievement/ass?curriculumId=${this.curriculumId}&id=${row.id}&projectId=${row.projectId}&name=${row.projectName}&experimentalName=${row.experimentalName}&class=${row.experimentalClassName}`); + console.log(row) + this.$router.push(`/achievement/ass?id=${row.id}&classId=${row.classId}&projectId=${row.projectId}&classInfo=${JSON.stringify(row.classInfo)}&experimentalName=${row.experimentalName}&class=${row.experimentalClassName}`); }, start(row) { let data = { id: row.id, - startTime: util.formatDate("yyyy-MM-dd hh:mm:ss", new Date()), - status: 1 }; - this.$post(this.api.modifyAssessment, data).then(res => { + this.$post(this.api.enableAssessment, data).then(res => { util.successMsg("启动成功!"); this.getData(); }).catch(err => { diff --git a/src/pages/student/list/index.vue b/src/pages/student/list/index.vue index fe45c09..1e03afd 100644 --- a/src/pages/student/list/index.vue +++ b/src/pages/student/list/index.vue @@ -760,18 +760,9 @@ export default { } this.accountReapeat = false; }).catch(err => { - this.disableds = true + if (this.isAdd) { this.showTree = false; - this.$post(`${this.api.getDetailByAccount}?workNumber=${this.form.workNumber}&platformId=${Setting.platformId}&type=1`).then(res => { - this.showTree = true; - let classId = res.data.classList.map(e => e.id); - this.form.classId = classId.toString(); - delete this.form.classList; - // this.showTree = true; - this.accountReapeat = false; - this.$refs.form.clearValidate(); - }).catch(res => {}); } else { this.accountReapeat = true; } @@ -791,6 +782,15 @@ export default { this.workNumberReapeat = false; } }).catch(err => { + this.$post(`${this.api.getDetailByAccount}?workNumber=${this.form.workNumber}&platformId=${Setting.platformId}&type=1`).then(res => { + this.showTree = true; + let classId = res.data.classList.map(e => e.id); + this.form.classId = classId.toString(); + delete this.form.classList; + // this.showTree = true; + this.accountReapeat = false; + this.$refs.form.clearValidate(); + }).catch(res => {}); this.workNumberReapeat = true; }); } @@ -884,11 +884,6 @@ export default { saveData(type) { // 提交新增/编辑学生 this.$refs.form.validate((valid) => { if (valid) { - if (this.accountReapeat) return util.warningMsg("该账号已存在"); - if (this.workNumberReapeat) return util.warningMsg("该学生学号已存在"); - if (this.phoneRepeat) return util.warningMsg("该手机号已存在"); - if (this.emailRepeat) return util.warningMsg("该邮箱已存在"); - let nodes = this.$refs.classTree.getCheckedNodes(); if (nodes.length) { let tempArr = []; @@ -915,6 +910,10 @@ export default { }).catch(res => { }); } 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.form.uniqueIdentification = new Date().getTime(); this.$post(this.api.addStudent, this.form).then(res => { util.successMsg("新增成功!"); @@ -988,12 +987,15 @@ export default { }, uploadSuccess(res, file, fileList) { this.uploadFaild = false; + console.log(res) if (res.status === 200) { if (res.data.exportCode) { this.exportCode = res.data.exportCode; this.uploadFaild = true; } util.successMsg(`本次上传有${res.data.failureNum}个失败`); + + this.getClassTreeData('','1','') } else { res.message ? util.errorMsg(res.message) : util.errorMsg("上传失败,请检查数据"); } diff --git a/src/pages/system/list/role.vue b/src/pages/system/list/role.vue index 02f3cac..68267a7 100644 --- a/src/pages/system/list/role.vue +++ b/src/pages/system/list/role.vue @@ -14,7 +14,7 @@
- + @@ -151,6 +151,15 @@ export default { util.errorMsg("请先选择数据!"); } }, + practiceSelectable(row, index){ + let boolean = true; + if(row.roleName == '超级管理员'){ + boolean = false + }else{ + boolean = true + } + return boolean; + }, closeRole() { this.isDetail = false; this.form = { diff --git a/src/pages/system/list/staff.vue b/src/pages/system/list/staff.vue index 1b26d87..bb27480 100644 --- a/src/pages/system/list/staff.vue +++ b/src/pages/system/list/staff.vue @@ -45,7 +45,7 @@ - + @@ -149,7 +149,7 @@ export default { this.workNumberChange(); callback(); }else{ - callback(new Error('职工工号必须为数字')); + callback(new Error('职工工号必须为数字或英文')); } } }; @@ -310,9 +310,16 @@ export default { }).catch(res => {}); }, getRoleData() { // 获取角色数据 - this.$get(`${this.api.roleList}?page=1&size=100&name=''&platformId=1`).then(res => { - console.log(res) - this.roleList = res.rolePage.records; + this.roleList =[]; + this.$get(`${this.api.roleList}?page=1&size=100&name=&platformId=1`).then(res => { + for(var i=0;i {}); }, closeTeacher() { // 关闭新增/编辑员工对话框 @@ -341,7 +348,7 @@ export default { this.$get(`${this.api.staffDetail}?accountId=${accountId}`).then(res => { let { data } = res; this.teacherForm = data; - this.roleList = data.roleAndDeptList + // this.roleList = data.roleAndDeptList this.teacherForm.roleValue = data.roleAndDeptList.map(i => i.roleName); this.teacherForm.roleAndDeptList = data.roleAndDeptList.map(i => { i.cascaderValue = [i.staffArchitectureId, i.gradeId] @@ -443,6 +450,7 @@ export default { } }, roleChange(value) { // 处理切换角色 + console.log(this.teacherForm.roleValue) if (value.length) { let ids = this.teacherForm.roleAndDeptList.map(e => e.roleId); this.roleList.forEach(i => { @@ -453,7 +461,7 @@ export default { }; if (value.includes(i.id) && !ids.includes(i.id)) { console.log(i) - obj.roleId = i.roleId; + obj.roleId = i.id; obj.roleName = i.roleName; this.teacherForm.roleAndDeptList.push(obj); }