diff --git a/src/api/boe/HRBP.js b/src/api/boe/HRBP.js new file mode 100644 index 00000000..6b38359a --- /dev/null +++ b/src/api/boe/HRBP.js @@ -0,0 +1,15 @@ +import ajax from '@/api/boe/boeApiAjax.js' + +/** + * 获取课程审核的 HRBP 审核 人信息 + * 机构的id + * organization_id + */ +const getHRBP = function(orgId) { + return ajax.get('/b1/system/user/org-hrbp?organization_id='+orgId); +} + + +export default { + getHRBP +} diff --git a/src/api/modules/course.js b/src/api/modules/course.js index a647c86d..e9399927 100644 --- a/src/api/modules/course.js +++ b/src/api/modules/course.js @@ -274,13 +274,18 @@ const countWaitAudit = function() { } /** - * 当前用户需要审核的课程列表 + * 管理员需要审核的课程列表 * @param {Object} query 同pageList */ const auditList = function(query) { return ajax.post('/xboe/m/course/manage/audit-pagelist', query); } +/**教师需要审核的课程列表*/ +const teacherAuditList = function(query) { + return ajax.post('/xboe/m/course/audit/teacher-course', query); +} + /** * 指定审核人,转审核人 * 点击“转审” 弹出教师查询窗口,查询教师,填写备注,提交,调用此接口 @@ -317,6 +322,22 @@ const audit = function(data) { return ajax.post('/xboe/m/course/manage/audit', data); } + +/** + * 审核记录列表,分页查询 + */ +const auditPageRecords = function(data) { + return ajax.post('/xboe/m/course/audit/page-records', data); +} + +/** + * 审核记录列表,要卖课程id,查询出审核列记录信息 + * { courseId:必须} + */ +const auditCourseRecords = function(data) { + return ajax.post('/xboe/m/course/audit/course-records', data); +} + /** * 管理员的课程发布 * @param {Object} query {ids:课程id,多个使用逗号分隔,title:课程的名称, Boolean pass 是否发布} @@ -363,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); } /* 教师授课记录 @@ -430,10 +451,13 @@ export default { getHomework, countWaitAudit, auditList, + teacherAuditList, auditAppoint, getAuditInfo, getAuditLogs, audit, + auditPageRecords, + auditCourseRecords, auditAndPublish, getAssess, setTop, diff --git a/src/api/system/organiza.js b/src/api/system/organiza.js index 67bf0541..eb1f8c2b 100644 --- a/src/api/system/organiza.js +++ b/src/api/system/organiza.js @@ -21,8 +21,14 @@ const treeList = function (query) { const listByParent = function (parentId) { return ajax.get('/xboe/org/list-by-parent?parentId='+parentId); } + +const getSimple = function (id) { + return ajax.get('/xboe/org/simple?id='+id); +} + export default { treeList, + getSimple, listByParent } diff --git a/src/api/system/user.js b/src/api/system/user.js index b2e9173c..2262956b 100644 --- a/src/api/system/user.js +++ b/src/api/system/user.js @@ -8,8 +8,8 @@ import ajax from '@/utils/xajax.js' * name 姓名 * userNo 工号 * departId 部门ID - * } query - * @returns + * } query + * @returns */ const list=function(query) { return ajax.get('/xboe/sys/user/page',{params:query}); @@ -19,8 +19,8 @@ const list=function(query) { * 通过用户名查询用户信息(该接口限定使用场景为先查本地库后查旧系统) * @param { * 用户名 - * } name - * @returns + * } name + * @returns */ const searchLoginName = function(name) { return ajax.get('/xboe/sys/user/search-loginname?loginName='+name); @@ -28,8 +28,8 @@ const searchLoginName = function(name) { /** * 根据多个人员的id,得到用户的信息(简要信息) - * @param {账号ID数组} ids - * @returns + * @param {账号ID数组} ids + * @returns */ const getByIds = function(ids) { return ajax.postJson('/xboe/sys/user/ids',ids); @@ -37,8 +37,8 @@ const getByIds = function(ids) { /** * 根据loginName,得到用户的信息(简要信息) - * @param {用户名} loginName - * @returns + * @param {用户名} loginName + * @returns */ const getByLoginName = function(loginName) { return ajax.get('/xboe/sys/user/loginname?loginName='+loginName); @@ -46,7 +46,7 @@ const getByLoginName = function(loginName) { /** * 根据name,得到用户的信息(简要信息) - * @param {用户姓名} name + * @param {用户姓名} name * @returns 返回列表 */ const findByName = function(name) { @@ -55,18 +55,23 @@ const getByLoginName = function(loginName) { /** * 得到用户详情(详细信息) - * @param {*} id - * @returns + * @param {*} id + * @returns */ const detail = function(id) { return ajax.get('/xboe/sys/user/detail?id='+id); } +const getOrgSimpleByUserId = function(id) { + return ajax.get('/xboe/sys/user/org/org-byuserid?userId='+id); +} + export default{ list, searchLoginName, getByIds, getByLoginName, findByName, - detail + detail, + getOrgSimpleByUserId } diff --git a/src/components/Course/auditCourse1.vue b/src/components/Course/auditCourse1.vue index 277518ef..a04003ba 100644 --- a/src/components/Course/auditCourse1.vue +++ b/src/components/Course/auditCourse1.vue @@ -34,6 +34,7 @@ {{teacher && teacher.join(',')}} {{courseInfo.source == 2?'外部':'内部'}} + {{orgName}} {{courseInfo.forUsers}} {{courseInfo.device == 3? '多端可见': courseInfo.device == 2?'移动端可见':'PC端可见'}} @@ -60,7 +61,7 @@
- +
上传为16:9(如:800*450)的png或jpg图片
@@ -93,6 +94,11 @@
+ + + 选择 + + @@ -216,7 +222,7 @@ - + @@ -233,6 +239,7 @@ import pdfPreview from "@/components/PdfPreview/index.vue"; import weikeContent from "@/components/Course/weikeContent.vue"; import catalogCourseware from "@/components/Course/catalogCourseware.vue"; import apiCourse from "@/api/modules/course.js"; +import apiOrg from '../../api/system/organiza.js'; import scene from "../../api/modules/scene.js"; import exam from "@/components/Course/exam"; import homework from "@/components/Course/homework"; @@ -244,6 +251,7 @@ import audioPlayer from "@/components/AudioPlayer/index.vue"; import apiCourseFile from '@/api/modules/courseFile.js'; import filecloud from '@/components/FileCloud/index.vue'; import { mapGetters, mapActions } from "vuex"; +import chooseOrg from '@/components/System/chooseOrg.vue'; // import hyperLink from '@/components/Course/hyperLink.vue'; export default { name: "auditCourse1", @@ -258,11 +266,12 @@ export default { WxEditor, pdfPreview, videoPlayer, - audioPlayer + audioPlayer, + chooseOrg // hyperLink }, computed: { - ...mapGetters(["resOwnerMap", "sysTypeMap"]) + ...mapGetters(["resOwnerMap", "sysTypeMap","identity"]) }, props: { id: { @@ -326,6 +335,8 @@ export default { label: "name" }, courseCoverurl: "", + orgName:'', + orgKid:'', courseInfo: {}, //基本信息 dataList: [], activeName: "info", @@ -360,7 +371,16 @@ export default { }); }, methods: { - + showChooseOrg(){ + this.$refs.refChooseOrg.dlgShow = true; + }, + confirmChooseOrg(orgInfo){ + //console.log(orgInfo,'orgInfo'); + this.orgName=orgInfo.name; + this.orgKid=orgInfo.kid; + this.courseInfo.orgId=orgInfo.id; + this.$refs.refChooseOrg.dlgShow = false; + }, chooseFile(){ this.dlgFileChoose.show=true; }, @@ -570,6 +590,16 @@ export default { apiCoursePortal.detail(this.id,true).then(rs => { if (rs.status == 200) { this.courseInfo = rs.result.course; + //加载所属机构名称 + this.orgKid=''; + if(this.courseInfo.orgId){ + apiOrg.getSimple(this.courseInfo.orgId).then(rrs=>{ + if(rrs.status==200){ + this.orgName=rrs.result.name; + this.orgKid=rrs.result.kid; + } + }) + } this.teacherList = rs.result.teachers; this.teacherName = rs.result.teachers; this.teacher = rs.result.teachers.map(res => res.teacherName); diff --git a/src/components/Course/auditCourse2.vue b/src/components/Course/auditCourse2.vue index ca0adb87..2106abf2 100644 --- a/src/components/Course/auditCourse2.vue +++ b/src/components/Course/auditCourse2.vue @@ -41,6 +41,7 @@ + {{orgName}} {{courseInfo.forUsers}} @@ -75,7 +76,7 @@
- +
上传为16:9(如:800*450)的png或jpg图片
@@ -108,6 +109,11 @@ + + + 选择 + + @@ -254,17 +260,19 @@ - + + + diff --git a/src/components/UcHeader/Index.vue b/src/components/UcHeader/Index.vue index 427234b6..ac17d698 100644 --- a/src/components/UcHeader/Index.vue +++ b/src/components/UcHeader/Index.vue @@ -79,11 +79,17 @@ import {userAvatarText,cutFullName} from "@/utils/tools.js"; } }, mounted() { - this.sex = this.userInfo.sex; - // 判断路由是进入的学员默认页面就重置setCurIdentity - if(this.$route.path == '/uc/study/task' || this.$route.path == '/study/index'){ - this.setCurIdentity(1); + this.sex = this.userInfo.sex; + let iden=this.$route.query.identity; + if(iden){ + this.setCurIdentity(parseInt(iden)); + }else{ + // 判断路由是进入的学员默认页面就重置setCurIdentity + if(this.$route.path == '/uc/study/task' || this.$route.path == '/study/index'){ + this.setCurIdentity(1); + } } + //let testName='京东方科技集团股份有限公司/北京中祥英科技有限公司/技术中心'; //this.orgInfo=cutFullName(testName,1); this.orgInfo=cutFullName(this.userInfo.departFullName,1); diff --git a/src/utils/xajax.js b/src/utils/xajax.js index 1d195a9c..1958aa65 100644 --- a/src/utils/xajax.js +++ b/src/utils/xajax.js @@ -29,7 +29,7 @@ const jsonRequest=axios.create({ // axios中请求配置有baseURL选项,表示请求URL公共部分 baseURL: process.env.VUE_APP_BASE_API, //超时 - timeout: 10000, + timeout: 20000, }); //发送json对象的拦截器 jsonRequest.interceptors.request.use(config => { diff --git a/src/views/course/TeacherList.vue b/src/views/course/TeacherList.vue index 2c83cff0..819ec0f3 100644 --- a/src/views/course/TeacherList.vue +++ b/src/views/course/TeacherList.vue @@ -84,7 +84,6 @@
暂无数据
-
@@ -113,13 +112,14 @@ 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 }, computed: { ...mapGetters(['userInfo']) }, - data() { return { inviteTeacher: [], @@ -194,21 +194,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 +309,7 @@ export default { this.params.pageSize = val; // this.params.pageIndex = 1; - + this.getList(); }, handleCurrentChange(val) { diff --git a/src/views/course/WaitAudit.vue b/src/views/course/WaitAudit.vue index c27bff49..dedd1555 100644 --- a/src/views/course/WaitAudit.vue +++ b/src/views/course/WaitAudit.vue @@ -5,7 +5,7 @@ - + @@ -14,6 +14,7 @@ + 搜索 重置 - +
- -
-
-
搜索
-
-
- - - - - - - - - -
- -
@@ -184,7 +154,7 @@
取 消 - 提交 + 提交
@@ -221,6 +191,7 @@ export default { data() { return { loading: true, + btnLoading:false, sysTypeList: [], sysTypeListMap:[], resOwnerListMap:[], @@ -229,6 +200,7 @@ export default { examin:{ detailType: '', examineId: '', + auditId:'', examineName: '', }, paperJson:{items:[]}, @@ -304,15 +276,7 @@ export default { this.loadSysTypes(); }, methods: { - remarksInterception(info){ - let name = ''; - if(info == '' || info == null || info == undefined) { - name = '--'; - } else { - name = info.split('请')[0]; - } - return name; - }, + getseatch(){ this.params.pageIndex= 1; this.searchData(); @@ -348,7 +312,7 @@ export default { //预览跳转页面 toPreview(row) { if(row.type == 10) { - + window.open(`${this.webBaseUrl}/course/microPreview?id=${row.id}`); } else{ window.open(`${this.webBaseUrl}/course/rePreview?id=${row.id}`); @@ -359,11 +323,14 @@ export default { examineData(flag) { if(this.isExamine == 1) { let params = { - id:this.examin.examineId,//课程id, + auditId:this.examin.auditId, + from:2, + courseId:this.examin.examineId,//课程id, title:this.examin.examineName,//课程的名称, pass: this.auditInfo.pass,//Boolean 是否通过, remark: this.auditInfo.remark// 备注 } + this.btnLoading=true; if(flag){ apiCourse.auditAndPublish(params).then(res=>{ if(res.status === 200) { @@ -374,6 +341,7 @@ export default { }else{ this.$message.error(res.message); } + this.btnLoading=false; }) }else{ apiCourse.audit(params).then(res=>{ @@ -385,6 +353,7 @@ export default { }else{ this.$message.error(res.message); } + this.btnLoading=false; }) } @@ -395,7 +364,7 @@ export default { }, // 课程查询 async searchData() { - + this.params.resOwner1 = this.resOwner[0]; this.params.resOwner2 = this.resOwner[1]; this.params.resOwner3 = this.resOwner[2]; @@ -407,7 +376,7 @@ export default { this.params.sysType3 = this.sysTypeList[2]; try { this.loading = true; - const {result, status,message} = await apiCourse.auditList(this.params); + const {result, status,message} = await apiCourse.teacherAuditList(this.params); if(status === 200) { this.pageData = result.list; @@ -437,6 +406,7 @@ export default { }, toExamine(row) { this.audit = {}; + this.examin.auditId=row.auditId; this.examin.detailType = row.type; this.examin.examineId = row.id; this.examin.examineName = row.name; @@ -469,11 +439,7 @@ export default { this.inviteTeacher.dlgShow = true; }, findTeachers() { - this.inviteTeacher.list = [ - { id: '1', name: '李玉冰', type:'通过',text: '实用',sex: '男', code: '1023123', orgInfo: '教育技术中心', checked: false }, - { id: '2', name: '李玉冰', type:'未通过',text: '内容在调整',sex: '男', code: '1023123', orgInfo: '教育技术中心', checked: false }, - { id: '3', name: '李玉冰', type:'驳回',text: '内容重复',sex: '男', code: '1023123', orgInfo: '教育技术中心', checked: false } - ]; + this.inviteTeacher.list = []; }, showQrimage() { this.qrcodeShow = true; diff --git a/src/views/course/WaitAudited.vue b/src/views/course/WaitAudited.vue index a60abbf7..089cd1e4 100644 --- a/src/views/course/WaitAudited.vue +++ b/src/views/course/WaitAudited.vue @@ -2,38 +2,27 @@ - - - - - - - - + + + + -
+
-
- - + + - @@ -116,9 +92,11 @@