提交 d3f01b6c authored 作者: lihuihui's avatar lihuihui

fix: 批阅修改

上级 a201ddd6
...@@ -3,17 +3,17 @@ ...@@ -3,17 +3,17 @@
<el-tabs v-model="activeName"> <el-tabs v-model="activeName">
<el-tab-pane :label="`全部(${students.length})`" name="0"> <el-tab-pane :label="`全部(${students.length})`" name="0">
<ul> <ul>
<li v-for="student in students" :key="student.id" @click="$emit('studentReview', student)">{{ student.name }}</li> <li v-for="(student, index) in students" :key="index" @click="$emit('studentReview', student)">{{ student.name }}</li>
</ul> </ul>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="`未批阅(${unreviewedStudents.length})`" name="1"> <el-tab-pane :label="`未批阅(${unreviewedStudents.length})`" name="1">
<ul> <ul>
<li v-for="student in unreviewedStudents" :key="student.id" @click="$emit('studentReview', student)">{{ student.name }}</li> <li v-for="(student, index) in unreviewedStudents" :key="index" @click="$emit('studentReview', student)">{{ student.name }}</li>
</ul> </ul>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="`已批阅(${reviewedStudents.length})`" name="2"> <el-tab-pane :label="`已批阅(${reviewedStudents.length})`" name="2">
<ul> <ul>
<li v-for="student in reviewedStudents" :key="student.id" @click="$emit('studentReview', student)">{{ student.name }}</li> <li v-for="(student, index) in reviewedStudents" :key="index" @click="$emit('studentReview', student)">{{ student.name }}</li>
</ul> </ul>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
</div> </div>
<ul> <ul>
<li <li
:class="item.id === $route.query.stu_id ? 'active' : ''" :class="item.sheet_id === (sheetIds || $route.query.sheet_id) ? 'active' : ''"
v-for="(item, index) in studentList" v-for="(item, index) in studentList"
:key="index" :key="index"
@click="selectStudent(item)" @click="selectStudent(item)"
...@@ -87,6 +87,7 @@ export default { ...@@ -87,6 +87,7 @@ export default {
visible: false, visible: false,
selectValue: 0, selectValue: 0,
studentList: [], studentList: [],
sheetIds: 0,
options: [ options: [
{ {
value: 0, value: 0,
...@@ -123,6 +124,7 @@ export default { ...@@ -123,6 +124,7 @@ export default {
}, },
methods: { methods: {
selectStudent(item) { selectStudent(item) {
this.sheetIds = item.sheet_id
this.getTopic(item.sheet_id) this.getTopic(item.sheet_id)
}, },
change() { change() {
...@@ -143,7 +145,10 @@ export default { ...@@ -143,7 +145,10 @@ export default {
}, },
// 提交批阅 // 提交批阅
submitExam() { submitExam() {
const refReview = this.$refs.reviewCard const refReview = this.$refs.reviewCards
if (!refReview) {
return false
}
if (this.textarea === '' || this.scoreNum === '') { if (this.textarea === '' || this.scoreNum === '') {
this.$message('请填写') this.$message('请填写')
return false return false
...@@ -173,25 +178,27 @@ export default { ...@@ -173,25 +178,27 @@ export default {
.catch(() => {}) .catch(() => {})
}, },
handlePageChange(index, group, groupList) { handlePageChange(index, group, groupList) {
const refReview = this.$refs.reviewCards setTimeout(() => {
if (!refReview) { const refReview = this.$refs.reviewCards
return false if (!refReview) {
} return false
const itemId = refReview.getAttribute('itemid') }
const questionId = refReview.getAttribute('questionid') const itemId = refReview.getAttribute('itemid')
this.visible = false const questionId = refReview.getAttribute('questionid')
const isReview = this.data.score_items[itemId][questionId]
if (isReview.checked_flag) {
this.scoreNum = isReview.score
this.textarea = isReview.comment
this.isReviewFlag = true
this.visible = true
} else {
this.scoreNum = ''
this.textarea = ''
this.isReviewFlag = false
this.visible = false this.visible = false
} const isReview = this.data.score_items[itemId][questionId]
if (isReview.checked_flag) {
this.scoreNum = isReview.score
this.textarea = isReview.comment
this.isReviewFlag = true
this.visible = true
} else {
this.scoreNum = ''
this.textarea = ''
this.isReviewFlag = false
this.visible = false
}
}, 500)
} }
} }
} }
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
</el-select> </el-select>
</div> </div>
<ul> <ul>
<li @click="selectStudent(item)" :class="item.id === $route.query.stu_id ? 'active' : ''" v-for="(item, index) in studentList" :key="index">{{ item.name }}</li> <li @click="selectStudent(item)" :class="item.sheet_id === (sheetIds || $route.query.sheet_id) ? 'active' : ''" v-for="(item, index) in studentList" :key="index">{{ item.name }}</li>
</ul> </ul>
</div> </div>
</template> </template>
...@@ -83,6 +83,7 @@ export default { ...@@ -83,6 +83,7 @@ export default {
isReviewFlag: false, isReviewFlag: false,
visible: false, visible: false,
selectValue: 0, selectValue: 0,
sheetIds: 0,
studentList: [], studentList: [],
options: [ options: [
{ {
...@@ -120,6 +121,7 @@ export default { ...@@ -120,6 +121,7 @@ export default {
}, },
methods: { methods: {
selectStudent(item) { selectStudent(item) {
this.sheetIds = item.sheet_id
this.getTopic(item.sheet_id) this.getTopic(item.sheet_id)
}, },
change() { change() {
...@@ -141,6 +143,9 @@ export default { ...@@ -141,6 +143,9 @@ export default {
// 提交批阅 // 提交批阅
submitExam() { submitExam() {
const refReview = this.$refs.reviewCard const refReview = this.$refs.reviewCard
if (!refReview) {
return false
}
if (this.textarea === '' || this.scoreNum === '') { if (this.textarea === '' || this.scoreNum === '') {
this.$message('请填写') this.$message('请填写')
return false return false
...@@ -169,22 +174,27 @@ export default { ...@@ -169,22 +174,27 @@ export default {
}) })
}, },
handlePageChange() { handlePageChange() {
const refReview = this.$refs.reviewCard setTimeout(() => {
const itemId = refReview.getAttribute('itemid') const refReview = this.$refs.reviewCard
const questionId = refReview.getAttribute('questionid') if (!refReview) {
this.visible = false return false
const isReview = this.data.score_items[itemId][questionId] }
if (isReview.checked_flag) { const itemId = refReview.getAttribute('itemid')
this.scoreNum = isReview.score const questionId = refReview.getAttribute('questionid')
this.textarea = isReview.comment
this.isReviewFlag = true
this.visible = true
} else {
this.scoreNum = ''
this.textarea = ''
this.isReviewFlag = false
this.visible = false this.visible = false
} const isReview = this.data.score_items[itemId][questionId]
if (isReview.checked_flag) {
this.scoreNum = isReview.score
this.textarea = isReview.comment
this.isReviewFlag = true
this.visible = true
} else {
this.scoreNum = ''
this.textarea = ''
this.isReviewFlag = false
this.visible = false
}
}, 500)
} }
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论