From 6628ece12fb19a5aed7e5731c830cf0400d811d2 Mon Sep 17 00:00:00 2001 From: daihh Date: Thu, 8 Sep 2022 15:05:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=9B=B4=E6=8E=A5=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E7=9A=84=E8=AF=BE=E7=A8=8B=E7=9A=84=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/modules/course.js | 4 +- src/views/course/TeacherList.vue | 65 +++++++++++++++++++++++--------- 2 files changed, 50 insertions(+), 19 deletions(-) diff --git a/src/api/modules/course.js b/src/api/modules/course.js index 965ac4d7..e9399927 100644 --- a/src/api/modules/course.js +++ b/src/api/modules/course.js @@ -384,8 +384,8 @@ const detailFew=function(id){ /* 直接审核 */ -const sumbits=function(id){ - return ajax.get('/xboe/m/course/manage/sumbits?id='+id); +const sumbits=function(data){ + return ajax.post('/xboe/m/course/manage/sumbits',data); } /* 教师授课记录 diff --git a/src/views/course/TeacherList.vue b/src/views/course/TeacherList.vue index 2c83cff0..e7675624 100644 --- a/src/views/course/TeacherList.vue +++ b/src/views/course/TeacherList.vue @@ -84,7 +84,7 @@
暂无数据
- +
@@ -113,6 +113,8 @@ import courseForm from '@/components/Course/courseForm.vue'; import apiCourse from '@/api/modules/course.js'; import { courseType } from '@/utils/tools.js'; import apiAudit from '@/api/system/audit.js'; +import apiHRBP from '@/api/boe/HRBP.js'; +import apiOrg from '@/api/system/organiza.js'; export default { name: 'ucStudyIndex', components: { studyItem, courseForm, courseImage }, @@ -194,21 +196,50 @@ export default { }); }, examine(row) { - this.$confirm('您确定要直接提交审核所选课程吗?', '友情提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(()=>{ - apiCourse.sumbits(row.id).then(res=>{ - if(res.status==200){ - this.$message.success('提交成功'); - row.status=2 - } - if(res.status==400){ - this.$message.error('课程信息不完整,提交失败') - } - }) - }) + if(!row.orgId){ + this.$message.error("课程还未设置资源归属,请先设置资源归属"); + return; + } + let $this=this; + this.$confirm('您确定要直接提交审核所选课程吗?', '友情提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(()=>{ + apiOrg.getSimple(row.orgId).then(rrs=>{ + if(rrs.status==200){ + apiHRBP.getHRBP(rrs.result.kid).then(rs=>{ + if(rs.status==200 && rs.result.length>0){ + let hrbpUser=rs.result[0]; + let req={ + courseId:row.id, + email:hrbpUser.email, + courseUser:row.sysCreateBy, + courseName:row.name, + ucode:hrbpUser.user_no, + auditUser:hrbpUser.real_name, + ukid:hrbpUser.user_id, + orgId:row.orgId, + orgName:rrs.result.name + } + apiCourse.sumbits(req).then(res=>{ + if(res.status==200){ + $this.$message.success('提交成功'); + row.status=2 + } + if(res.status==400){ + $this.$message.error('提交失败:'+res.message); + } + }) + }else{ + $this.$message.error("获取HRBP审核人员失败:"+rs.message); + } + }) + }else{ + $this.$message.error("处理资源归属失败,请重新设置资源归属"); + } + }) + }) }, delItem(row) { this.$confirm('您确定要删除所选课程吗?', '删除提示', { @@ -280,7 +311,7 @@ export default { this.params.pageSize = val; // this.params.pageIndex = 1; - + this.getList(); }, handleCurrentChange(val) {