diff --git a/src/api/index.js b/src/api/index.js index 40ad05a..6b76a1f 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -18,4 +18,5 @@ export default { competitionUserReport: `/nakadai/evaluation/competitionUserReport`, examPaperDetails: `/exam/exam/paper/examPaperDetails`, getPaperQuestionInfoByReviewSetting: `/nakadai/evaluation/getPaperQuestionInfoByReviewSetting`, + assignReviewers: `/nakadai/evaluationAssignments/assignReviewers`, } \ No newline at end of file diff --git a/src/pages/allocationReview/list/setup.vue b/src/pages/allocationReview/list/setup.vue index dfaac53..8b39b37 100644 --- a/src/pages/allocationReview/list/setup.vue +++ b/src/pages/allocationReview/list/setup.vue @@ -34,7 +34,7 @@ type="datetimerange" start-placeholder="开始日期" end-placeholder="结束日期" clearable :picker-options="pickerOptions"> - +  人(人工判分题和整体评分表的评阅人数) @@ -187,11 +187,13 @@ export default { if (this.submiting) return false const form = _.cloneDeep(this.form) const { row, timed } = this + const { hasManualScoreType } = row if (timed.length) { if (timed[0]) form.startTime = dayjs(timed[0]).format('YYYY-MM-DD HH:mm:ss') if (timed[1]) form.endTime = dayjs(timed[1]).format('YYYY-MM-DD HH:mm:ss') } if (form.isTimed && (!form.startTime || !form.endTime)) return Util.warningMsg(`请选择时间限制`) + if (hasManualScoreType && form.reviewersPerQuestion === '') return Util.warningMsg(`请输入评阅人数`) form.competitionId = row.id form.stageId = row.stageId this.submiting = true @@ -199,7 +201,7 @@ export default { await this.$post(this.api.evaluationSave, form) this.submiting = false - if (this.$route.path === '/allocationReview/list') { + if (this.$route.path === '/allocationReview/list' && (hasManualScoreType || form.allowManualGrading)) { // 当前在分配评阅任务页面,并且有主观题,或者允许评阅客观题,就弹框提示 try { await this.$confirm('保存成功!', '提示', { confirmButtonText: '前往任务分配', diff --git a/src/pages/allocationReview/records/allocation.vue b/src/pages/allocationReview/records/allocation.vue index f6738eb..7411afa 100644 --- a/src/pages/allocationReview/records/allocation.vue +++ b/src/pages/allocationReview/records/allocation.vue @@ -8,22 +8,23 @@
  • - 按整卷分配 + 按整卷分配

    (每份答卷将从以下已选的评阅人员中,按照评阅设置的每题评阅人数随机挑选评阅人员对整卷进行评阅,且以下已选的每位评阅人员分配到的答卷数量基本平均)

    - 按每道人工判分题分配 + 按每道人工判分题分配

    (每份答卷的每道人工判分题将从以下题目已选的评阅人员中,按照评阅设置的每题评阅人数随机挑选评阅人员对该题进行评阅,且以下已选的每位评阅人员分配到的该题答卷数量基本平均)

  • -
    - +
    +
    -
    +
    选择评阅人员
    批量分配 @@ -93,10 +94,11 @@ export default { data () { return { isOverall: false, // 整体评分表(能勾选试题) - radio: 0, + taskType: 'whole_report', allocationVisible: false, searchTimer: null, + setup: {}, userType: '', ques: [], multipleSelection: [], @@ -124,7 +126,7 @@ export default { }, }, mounted () { - + this.getSetup() }, methods: { // 初始化 @@ -183,6 +185,16 @@ export default { handleSelectionChange (val) { this.multipleSelection = val }, + // 获取评阅设置详情 + async getSetup () { + try { + const id = this.row.evaluationId + if (id) { + const { data } = await this.$post(`${this.api.evaluationFind}?id=${id}`) + this.setup = data + } + } catch (e) { } + }, // 批量分配 async batchAlloc () { try { @@ -227,28 +239,25 @@ export default { // 提交 async submit () { if (this.submiting) return false - const { list } = this - // if (!totalCount) return Util.warningMsg(`请填写难度题数`) + const { row, curRecords, taskType } = this + let peopleChecked = [] + // 整卷 + if (taskType === 'whole_report') { + peopleChecked = this.$refs.people.checked + if (!peopleChecked.length) return Util.warningMsg(`请选择评阅人员`) + const num = this.setup.reviewersPerQuestion + if (!isNaN(num) && peopleChecked.length < num) return Util.warningMsg(`所选定的评阅人数(${peopleChecked.length}人)不满足评阅设置的评阅人数(${num}人)`) + } + // debugger this.submiting = true try { - const res = await this.$post(this.api.selectQuestionsByTypeAndDifficulty, list) - - let invalid = 0 - let hasQues = 0 - list.map((e, i) => { - if (+e.count !== res.list[i].questions.length) invalid = 1 - if (e.examQuestions.length) hasQues = 1 - e.score = 0 - }) - - list.map((e, i) => { - res.list[i].questions.map((e, i) => { - e.questionId = e.id - e.serialNumber = i + 1 - e.originSort = i + 1 - this.$parent.handleQuesInfo(e) - }) - this.$parent.form.paperOutline[i].examQuestions = res.list[i].questions + await this.$post(this.api.assignReviewers, { + accountIds: peopleChecked.map(e => e.accountId), + evaluationId: row.evaluationId, + paperId: row.paperId, + questionVersionIds: [], + reportIds: curRecords.map(e => e.reportId), + taskType: this.taskType, }) this.allocationVisible = false this.$parent.calcDifficult() diff --git a/src/pages/allocationReview/records/index.vue b/src/pages/allocationReview/records/index.vue index d4642b5..6826b62 100644 --- a/src/pages/allocationReview/records/index.vue +++ b/src/pages/allocationReview/records/index.vue @@ -57,9 +57,10 @@ @selection-change="handleSelectionChange"> - - - + + + @@ -68,14 +69,22 @@ - - - - - + + + + + + + + + - - + +