From 3237d67af2ed1eea216710769fc45eda67c05c06 Mon Sep 17 00:00:00 2001 From: daihh Date: Fri, 6 Jan 2023 12:22:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=AE=A1=E6=A0=B8=E7=9A=84?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/modules/course.js | 6 +- src/api/modules/courseAudit.js | 14 +- src/components/Course/courseForm.vue | 94 ++++++------ src/views/Index.vue | 2 +- src/views/course/OpenCourseAudit.vue | 2 +- src/views/course/WaitAudit.vue | 215 ++------------------------- src/views/course/WaitAudited.vue | 59 +++++--- src/views/examine/NotApproved.vue | 190 +++++------------------ src/views/examine/Reviewed.vue | 56 +++++-- 9 files changed, 194 insertions(+), 444 deletions(-) diff --git a/src/api/modules/course.js b/src/api/modules/course.js index 928ba00c..8403a614 100644 --- a/src/api/modules/course.js +++ b/src/api/modules/course.js @@ -274,6 +274,7 @@ const countWaitAudit = function() { } /** + * [已用courseAudit中的hrbpAuditList替换] * 当前用户需要审核的课程列表 * @param {Object} query 同pageList */ @@ -282,7 +283,10 @@ const auditList = function(query) { } -/**教师需要审核的课程列表*/ +/** + * 【已移到courseAudit中】 + * 教师需要审核的课程列表 + */ const teacherAuditList = function(query) { return ajax.post('/xboe/m/course/audit/teacher-course', query); } diff --git a/src/api/modules/courseAudit.js b/src/api/modules/courseAudit.js index 93456b2d..7856f8f7 100644 --- a/src/api/modules/courseAudit.js +++ b/src/api/modules/courseAudit.js @@ -68,14 +68,21 @@ const lastAuditSubmit = function(data) { return ajax.post('/xboe/m/course/audit/last-audit-submit', data); } - +/** + * 提交并发布,对于默认管理员调用此方法 + * @param {Object} data + * CourseFullDto + */ +const submitAndPublish = function(data) { + return ajax.postJson('/xboe/m/course/audit/submit-publish', data); +} /** * 获取审核信息,上面教师点击审核课程时,用于查询,上面“转审”时,用户填写的备注信息 * @param {courseId:'课程id',teacherId:'可以不填写,系统会查询当前人'} data */ -const getAuditInfo = function(data) { - return ajax.post('/xboe/m/course/audit/infos', data); +const getAuditInfo = function(auditId) { + return ajax.post('/xboe/m/course/audit/hrbp-detail', {auditId}); } /** @@ -102,6 +109,7 @@ export default { teacherAuditSubmit, lastAuditList, lastAuditSubmit, + submitAndPublish, getAuditInfo, auditPageRecords, auditCourseRecords diff --git a/src/components/Course/courseForm.vue b/src/components/Course/courseForm.vue index 519b3713..7876e15d 100644 --- a/src/components/Course/courseForm.vue +++ b/src/components/Course/courseForm.vue @@ -397,6 +397,7 @@ import apiTag from '../../api/modules/tag.js'; import apiHRBP from '../../api/boe/HRBP.js'; import apiUserBasic from '../../api/boe/userbasic.js'; import apiCourse from '../../api/modules/course.js'; +import apiCourseAudit from '../../api/modules/courseAudit.js'; import apiOrg from '../../api/system/organiza.js'; import apiUser from '../../api/system/user.js'; import WxEditor from '@/components/Editor/index.vue'; @@ -1300,7 +1301,6 @@ export default { return true; }, submitCourse() { - if(this.biaoke.dlgShow && !this.unsavedContent()){ this.$message.error('您有未保存的内容,请先保存'); return; @@ -1420,60 +1420,64 @@ export default { }; this.btnLoading = true; let $this = this; - //console.log(this.courseInfo.orgId,'this.courseInfo.orgId') - //先获取HRBP审核 人员信息,姓名,机构路径,工号,用于邮件中的信息 - apiUserBasic.getOrgHrbpInfo(this.courseInfo.orgId).then(rs=>{ - if(rs.status==200 && rs.result){ - postData.auditUser={ - email:rs.result.email, - code:rs.result.userNo, - name:rs.result.name, - aid:rs.result.id, - orgId:rs.result.orgId - } - postData.course.orgName=rs.result.orgNamePath+'/'+rs.result.orgName; - - // apiHRBP.getHRBP(this.orgKid).then(rs=>{ - // if(rs.status==200 && rs.result.length>0){ - // let hrbpUser=rs.result[0]; - // postData.auditUser={ - // email:hrbpUser.email, - // code:hrbpUser.user_no, - // name:hrbpUser.real_name, - // kid:hrbpUser.user_id, - // orgId:hrbpUser.orgnization_id - // } - // postData.course.orgName=hrbpUser.orgnization_name_path+'/'+$this.orgName; - - apiCourse.submitCourse(postData).then(res => { - //this.btnLoading=false; + //2023-1-5 对于默认管理员,不需要提交hrbp。直接提交并发布 + let adminType=this.userInfo.adminType; + if(adminType==1){ //默认管理员,直接审核通过 + apiCourseAudit.submitAndPublish(postData).then(res=>{ setTimeout(function() { $this.btnLoading = false; }, 1000); if (res.status === 200) { //提交成功,直接关闭当前窗口 this.$message.success('提交成功!!!'); - this.biaoke.dlgShow = false; - this.weike.dlgShow = false; - //提交成功回调处理 - this.$emit('submitSuccess'); } else { this.$message.error(res.message); - this.biaoke.dlgShow = false; - this.weike.dlgShow = false; - this.$emit('submitSuccess'); } + this.biaoke.dlgShow = false; + this.weike.dlgShow = false; + this.$emit('submitSuccess'); }); - }else{ - $this.btnLoading = false; - this.$message.error('获取审核HRBP失败:'+rs.message); - } - }).catch(err=>{ - //this.$message.error('获取审核HRBP失败:'+err); - this.$message.error('获取审核HRBP失败,请检查资源归属下是否有HRBP审核人员'); - $this.btnLoading = false; - }) - + }else{ + //先获取HRBP审核 人员信息,姓名,机构路径,工号,用于邮件中的信息 + apiUserBasic.getOrgHrbpInfo(this.courseInfo.orgId).then(rs=>{ + if(rs.status==200 && rs.result){ + postData.auditUser={ + email:rs.result.email, + code:rs.result.userNo, + name:rs.result.name, + aid:rs.result.id, + orgId:rs.result.orgId + } + postData.course.orgName=rs.result.orgNamePath+'/'+rs.result.orgName; + apiCourse.submitCourse(postData).then(res => { + //this.btnLoading=false; + setTimeout(function() { + $this.btnLoading = false; + }, 1000); + if (res.status === 200) { + //提交成功,直接关闭当前窗口 + this.$message.success('提交成功!!!'); + this.biaoke.dlgShow = false; + this.weike.dlgShow = false; + //提交成功回调处理 + this.$emit('submitSuccess'); + } else { + this.$message.error(res.message); + this.biaoke.dlgShow = false; + this.weike.dlgShow = false; + this.$emit('submitSuccess'); + } + }); + }else{ + $this.btnLoading = false; + this.$message.error('获取审核HRBP失败:'+rs.message); + } + }).catch(err=>{ + //this.$message.error('获取审核HRBP失败:'+err); + this.$message.error('获取审核HRBP失败,请检查资源归属下是否有HRBP审核人员'); + $this.btnLoading = false; + }) + } }, // 教师列标,远程查询 async remoteFindTeacher(query) { diff --git a/src/views/Index.vue b/src/views/Index.vue index 11cec6cf..8d76836a 100644 --- a/src/views/Index.vue +++ b/src/views/Index.vue @@ -76,7 +76,7 @@
  • 我的U币 -

    {{userData.uvalue}}

    +

    {{userData.uvalue>0? userData.uvalue:0 }}

  • diff --git a/src/views/course/OpenCourseAudit.vue b/src/views/course/OpenCourseAudit.vue index 293896ab..39382e5b 100644 --- a/src/views/course/OpenCourseAudit.vue +++ b/src/views/course/OpenCourseAudit.vue @@ -118,7 +118,7 @@ export default { return { loading: true, btnLoading:false, - params: {courseName:'',status:''}, + params: {courseName:'',status:1}, sysTypeList: [], sysTypeListMap:[], showDetails:false, diff --git a/src/views/course/WaitAudit.vue b/src/views/course/WaitAudit.vue index 0cc77697..31f704ca 100644 --- a/src/views/course/WaitAudit.vue +++ b/src/views/course/WaitAudit.vue @@ -106,7 +106,7 @@ - + 通过 @@ -116,32 +116,7 @@ -
    -
    -
    -
    搜索
    -
    -
    - - - - - - - - -
    审核记录:
    - - - - - - - -
    -
    +
    @@ -165,7 +140,7 @@ - 取 消 + 关 闭
    @@ -204,25 +179,14 @@ export default { auditId:'', examineName: '', }, - paperJson:{items:[]}, courseType: courseType, - page: { - pageIndex: 1,//第几页 - pageSize: 10, // 每页多少条 - count: 0 - }, + params: {}, + pageData:[], + page: {pageIndex: 1,pageSize: 10,count: 0}, resOwner: [], - defaultProps:{ - value: 'code', - label: 'name', - }, - defaultTypeProps:{ - value: 'id', - label: 'name', - }, - manageStudyData: {}, + defaultProps:{value: 'code',label: 'name'}, + defaultTypeProps:{value: 'id',label: 'name'}, expandDetails: false, - qrcode: '', isExamine: 1, auditInfo: { pass: true, @@ -230,39 +194,6 @@ export default { }, detailType: 1, dialogVisible: false, - qrcodeShow: false, - currentPage4: 4, - inviteTeacher: { - //邀请 - dlgShow: false, - params: { name: '' }, - list: [] - }, - manageStudy: { - dlgShow: false - }, - params: {}, - pageData:[], - courseChooseShow: false, - courseChooseId: '', - weike: { - onlyRequired: false, - dlgShow: false, - fileType: '', - info: { - shebei: '' - } - }, - biaoke: { - dlgShow: false - }, - recommend: { - dlgShow: false, - }, - catalogs: { - addNewZhang: false, - addNewCell: false, - } }; }, mounted() { @@ -359,7 +290,7 @@ export default { this.params.sysType3 = this.sysTypeList[2]; try { this.loading = true; - const {result, status,message} = await apiCourse.teacherAuditList(this.params); + const {result, status,message} = await apiCourseAudit.teacherAuditList(this.params); if(status === 200) { this.pageData = result.list; @@ -379,9 +310,6 @@ export default { this.examin.examineName = row.name; this.showDetails = true; }, - editCurriculum(row) { - this.editData = row; - }, jumpDetails() { // 跳转打开新页面 let routeData = this.$router.resolve({ path: '/course/detail'}); @@ -406,9 +334,6 @@ export default { } }) }, - enSure() { - // 确认事件 - }, handleSizeChange(val) { this.page.pageSize = val; this.page.pageIndex = 1; @@ -417,128 +342,6 @@ export default { handleCurrentChange(val) { this.page.pageIndex = val; this.searchData(); - }, - chooseInvite(row) { - //邀请老师审核 - this.inviteTeacher.dlgShow = true; - }, - findTeachers() { - this.inviteTeacher.list = []; - }, - showQrimage() { - this.qrcodeShow = true; - // 二维码内容,一般是由后台返回的跳转链接,这里是写死的一个链接 - this.qrcode = 'https://yuchengkai.cn/docs/frontend/#typeof'; - // 使用$nextTick确保数据渲染 - this.$nextTick(() => { - this.crateQrcode(); - }); - }, - // creatQrCode() { - - // }, - // 生成二维码 - crateQrcode() { - this.qr = new QRCode('qrcode', { - width: 150, - height: 150, // 高度 - text: this.qrcode // 二维码内容 - // render: 'canvas' // 设置渲染方式(有两种方式 table和canvas,默认是canvas) - // background: '#f0f' - // foreground: '#ff0' - }); - }, - // 关闭弹框,清除已经生成的二维码 - closeCode() { - this.$refs.qrcode.innerHTML = ''; - }, - showManageStudy(row) { - this.manageStudyData = row; - this.manageStudy.dlgShow = true; - }, - releaseData(row) { - this.$confirm('正在发布考试, 是否继续?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }) - .then(() => { - this.pageData.list.forEach((item, index) => { - if (item.id === row.id) { - item.collectNumber = 1; - } - }); - this.$message({ - type: 'success', - message: '发布成功!' - }); - }) - .catch(() => { - this.$message({ - type: 'info', - message: '已取消删除' - }); - }); - }, - showChooseCourse() { - this.courseChooseShow = true; - }, - chooseCourseType(item, idx) { - this.courseChooseId = item.id; - }, - toInputCourse() { - if (this.courseChooseId == '1') { - this.showWeike(); - } else if (this.courseChooseId == '2') { - this.showBiaoke(); - } - this.courseChooseShow = false; - }, - newHandleClick() {}, - showRecords(item) { - this.recommend.dlgShow = true; - }, - showWeike() { - this.weike.dlgShow = true; - }, - showBiaoke() { - this.biaoke.dlgShow = true; - }, - setTop(item, idx) { - let msg = '已设置置顶'; - if (item.isTop) { - item.isTop = false; - msg = '已取消置顶'; - } else { - item.isTop = true; - } - this.$message({ message: msg, type: 'success', offset: 50 }); - }, - delItem(item, idx) { - this.$confirm('您确定要删除所选课程吗?', '删除提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }) - .then(() => { - this.items.splice(idx, 1); - this.$message({ type: 'success', message: '删除成功!', offset: 50 }); - }) - .catch(() => { - this.$message({ type: 'info', message: '已取消删除', offset: 50 }); - }); - }, - showAddCatalogZhang(bal) { - this.catalogs.addNewZhang = bal; - }, - saveNewCatalogZhang() { - this.catalogs.addNewZhang = false; - }, - filterType(value, row) { - return row.type === value; - }, - filterStatus(value, row) { - return row.status === value; } } }; diff --git a/src/views/course/WaitAudited.vue b/src/views/course/WaitAudited.vue index 089cd1e4..864823cc 100644 --- a/src/views/course/WaitAudited.vue +++ b/src/views/course/WaitAudited.vue @@ -34,13 +34,13 @@ - - + +