|
@@ -6,7 +6,7 @@
|
|
|
<NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="main">
|
|
|
- <mainData :teacherinfo="teacherinfo" :xsscore="xsscore" :form="form" @onsave="onsave" :disabled="disabled"></mainData>
|
|
|
+ <mainData :teacherinfo="teacherinfo" :form="form" @onsave="onsave" :disabled="disabled"></mainData>
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="foot">
|
|
|
<footInfo></footInfo>
|
|
@@ -33,13 +33,12 @@ export default {
|
|
|
mainData, //课程安排主体
|
|
|
},
|
|
|
data: () => ({
|
|
|
- teacherinfo: {},
|
|
|
- xsscore: '',
|
|
|
- form: {},
|
|
|
title: '',
|
|
|
isleftarrow: '',
|
|
|
navShow: true,
|
|
|
disabled: false,
|
|
|
+ teacherinfo: {},
|
|
|
+ form: {},
|
|
|
}),
|
|
|
created() {
|
|
|
this.searchInfo();
|
|
@@ -73,15 +72,17 @@ export default {
|
|
|
this.$set(this, `teacherinfo`, res.data);
|
|
|
res = await this.modelFetch({ model: 'score', stuid: this.user.id, lessonid: this.lessonid, teacherid: this.teaid });
|
|
|
if (res.errcode == 0) {
|
|
|
- this.$set(this, `xsscore`, res.data.score);
|
|
|
- this.$set(this.form, `score`, res.data.score);
|
|
|
+ console.log(res.data);
|
|
|
+ let data = res.data;
|
|
|
+ data.score = Number(res.data.score);
|
|
|
+ console.log(data);
|
|
|
+ this.$set(this, `form`, data);
|
|
|
}
|
|
|
},
|
|
|
// 为教师打分
|
|
|
- async onsave(form) {
|
|
|
- if (form.id) {
|
|
|
- let data = this.form;
|
|
|
- const res = await this.update(data);
|
|
|
+ async onsave({ data }) {
|
|
|
+ if (data) {
|
|
|
+ let res = await this.update(data);
|
|
|
this.$notify({
|
|
|
message: '修改评分成功',
|
|
|
type: 'success',
|
|
@@ -91,10 +92,9 @@ export default {
|
|
|
this.searchInfo();
|
|
|
} else {
|
|
|
this.disabled = true;
|
|
|
- this.form.stuid = this.user.id;
|
|
|
- this.form.lessonid = this.lessonid;
|
|
|
- this.form.teacherid = this.teaid;
|
|
|
- let data = this.form;
|
|
|
+ data.stuid = this.user.id;
|
|
|
+ data.lessonid = this.lessonid;
|
|
|
+ data.teacherid = this.teaid;
|
|
|
const res = await this.create(data);
|
|
|
this.$notify({
|
|
|
message: '评分成功',
|