Commit 722c45f9 authored by zhengke's avatar zhengke

修改

parent 5c17dcb6
......@@ -344,3 +344,15 @@ export function GetClassLessPlanList(data) {
    data
  });
}
/**
 * 评论显示打分
 */
export function GetNowUserLessonComment(data) {
  return request({
    url: '/Class/GetNowUserLessonComment',
    method: 'post',
    data
  });
}
......@@ -349,6 +349,19 @@
//提交
saveInfo(num) {
this.addMsg.IsTemplate = num;
for(let i=0;i<this.addMsg.LessonPlanList.length;i++){
for(let j=0;j<this.addMsg.LessonPlanList[i].LessonPlanDetailsList.length;j++){
if(this.addMsg.LessonPlanList[i].LessonPlanDetailsList[j].ProjectContent==''){
this.$q.notify({
type: 'negative',
position: 'top',
timeout: 1500,
message: `请检查内容填写是否完整`
})
return;
}
}
}
SetClassLessPlan(this.addMsg).then(res => {
if(res.Code==1){
this.$q.notify({
......
......@@ -170,7 +170,7 @@
filled
clearable
autogrow
:disable="AccountType"
:disable="AccountType||!isCanEdit"
/>
</div>
</div>
......@@ -178,7 +178,7 @@
</div>
</div>
</div>
<q-btn color="accent" size="sm" class="q-mr-md marginl-15 margint-15" label="提交" @click="saveOrderInfo()" :loading="Dloading" v-if="AccountType==false"/>
<q-btn color="accent" size="sm" class="q-mr-md marginl-15 margint-15" label="提交" @click="saveOrderInfo()" :loading="Dloading" v-if="AccountType==false&&data.IsEditSummary<=0"/>
</div>
......@@ -204,6 +204,7 @@
<q-rating
v-model="item.Score"
size="1em"
v-if="Score>-1"
icon="thumb_up"
readonly
/>
......@@ -222,17 +223,18 @@
<div class="pl column">
<div class="row" style="align-items: center">
<span style="margin-right: 5px">备课打分:</span>
<q-rating
v-model="plmsg.Score"
size="1.5em"
icon="thumb_up"
/>
<span class="ratestyle" v-if="plmsg.Score==5">非常满意</span>
<span class="ratestyle" v-if="plmsg.Score==4">满意</span>
<span class="ratestyle" v-if="plmsg.Score==3">感觉一般</span>
<span class="ratestyle" v-if="plmsg.Score==2">不满意</span>
<span class="ratestyle" v-if="plmsg.Score==1">非常不满意</span>
<template v-if="Score>-1">
<q-rating
v-model="plmsg.Score"
size="1.5em"
icon="thumb_up"
/>
<span class="ratestyle" v-if="plmsg.Score==5">非常满意</span>
<span class="ratestyle" v-if="plmsg.Score==4">满意</span>
<span class="ratestyle" v-if="plmsg.Score==3">感觉一般</span>
<span class="ratestyle" v-if="plmsg.Score==2">不满意</span>
<span class="ratestyle" v-if="plmsg.Score==1">非常不满意</span>
</template>
</div>
<div class="row" style="margin-top: 20px;align-items: center">
<q-input filled v-model="plmsg.Comment" label="写下你想评价的内容" style="flex:1"/>
......@@ -251,7 +253,8 @@
getClassLessPlan,
getLessonCommentList,
setLessonComment,
updateClassLessPlan
updateClassLessPlan,
GetNowUserLessonComment
} from '../../api/course/class';
export default {
name: "prepareclassDetails",
......@@ -269,10 +272,18 @@
LessonPlanId:0,
ClassId:0,
ClassPlanId:0,
TeacherId:0
},
data:{},
CommentList:[],
AccountType:true
AccountType:true,
scoreMsg:{
ClassPlanId:0,
ClassId:0
},
Score:0,
nowDate:'', //现在时间
isCanEdit:false
}
},
created(){
......@@ -283,17 +294,44 @@
this.msg.ClassPlanId = this.$route.query.ClassPlanId ? this.$route.query.ClassPlanId:0;
this.plmsg.ClassId = this.$route.query.ClassId ? this.$route.query.ClassId:0;
this.plmsg.ClassPlanId = this.$route.query.ClassPlanId ? this.$route.query.ClassPlanId:0;
this.scoreMsg.ClassPlanId = this.$route.query.ClassPlanId ? this.$route.query.ClassPlanId:0;
this.scoreMsg.ClassId = this.$route.query.ClassId ? this.$route.query.ClassId:0;
let userInfo = this.getLocalStorage();
this.AccountType = userInfo.AccountType==2?false:true; //是否是教师
this.getList()//备课内容
this.getCommentList()//评价
this.getUserComment();
var today=new Date();
var y=today.getFullYear();
var m=today.getMonth()+1;
var d=today.getDate();
var h=today.getHours();
var i=today.getMinutes();
var s=today.getSeconds();// 在小于10的数字钱前加一个‘0’
this.nowDate = y+'-'+m+'-'+d+' '+ h +':'+i+':'+s;
},
methods:{
//获取评论显示分数
getUserComment(){
GetNowUserLessonComment(this.scoreMsg).then(res => {
if (res.Code == 1) {
this.Score = res.Data.Score;
this.plmsg.Score = this.Score;
}
})
},
getList() {
getClassLessPlan(this.msg).then(res => {
if (res.Code == 1) {
this.data = res.Data
this.data = res.Data;
this.plmsg.TeacherId = res.Data.UpdateBy;
var beginTimes =this.nowDate.replace(/-/g,"/");
var endTimes =this.data.ClassEndTime.replace(/-/g,"/");
var a =(Date.parse(endTimes)-Date.parse(beginTimes))/3600/1000;
if(a<0){
this.isCanEdit=true; //可以编辑
}
}
})
},
......@@ -343,8 +381,30 @@
})
},
saveOrderInfo(){
this.Dloading= true;
// this.Dloading= true;
console.log(this.data,'data');
let count=0,LessonNum=0;
this.data.LessonPlanList.forEach(x=>{
x.LessonPlanDetailsList.forEach(y=>{
if(y.Summary==null||y.Summary==''){
count++;
}
})
LessonNum+=x.LessonPlanDetailsList.length;
})
console.log(count,'count');
console.log(LessonNum,'LessonNum');
if(count==LessonNum){
this.$q.notify({
type: 'negative',
position: 'top',
timeout: 1500,
message: `请至少填写一项课后总结`
})
return
}
updateClassLessPlan(this.data).then(res => {
this.Dloading= false;
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment