diff --git a/src/components/Course/homework.vue b/src/components/Course/homework.vue
index 978d45b0..584a446f 100644
--- a/src/components/Course/homework.vue
+++ b/src/components/Course/homework.vue
@@ -37,7 +37,7 @@
- {{records.length>0?'重新提交':'提交'}}
+ {{records.length>0?'重新提交':'提交'}}
@@ -87,10 +87,12 @@ export default {
has:true,
info:{},
studyItemId:'',
+ studyItemIdOnce: '',
filePath:'',
answer:'',
close:false,
records:[],//作业记录
+ isSubmit:false,
};
},
mounted() {
@@ -135,6 +137,9 @@ export default {
apiCourseStudy.myHomeworkList(params).then(rs=>{
if(rs.status==200){
this.records=rs.result;
+ if(rs.result.length>0){
+ this.studyItemIdOnce = rs.result[rs.result.length - 1].id;
+ }
}
})
},
@@ -171,9 +176,9 @@ export default {
return;
}
}
-
+ this.isSubmit = true
let pamars = {
- studyItemId: this.studyItemId,//学习内容记录id,
+ studyItemId: this.studyItemId || this.studyItemIdOnce,//学习内容记录id,
studyId: this.studyId,//学习id,
courseId: this.content.courseId,//课程id,
contentId: this.content.id,//内容id,
@@ -185,6 +190,7 @@ export default {
score: 0
}
apiCourseStudy.saveHomework(pamars).then(res=>{
+ this.isSubmit = false
if(res.status==200){
this.$message.success("作业已提交");
this.filePath='';
diff --git a/src/components/Course/weikeContent.vue b/src/components/Course/weikeContent.vue
index 69bfa1bd..f8310736 100644
--- a/src/components/Course/weikeContent.vue
+++ b/src/components/Course/weikeContent.vue
@@ -1049,7 +1049,7 @@
this.cwareChange.curriculumData = deepClone(this.cware.curriculumData)
}
}else if(index==2){
- this.homework.content.contentName = this.homework.info.name
+ this.homework.content.contentName = this.homework.info.name || '作业'
postData.content=this.homework.content;
postData.homework=this.homework.info;
this.homeworkChange = deepClone(this.homework)