diff --git a/pages/miniClass/MonitorClassList.vue b/pages/miniClass/MonitorClassList.vue
index 885378d..eed33bd 100644
--- a/pages/miniClass/MonitorClassList.vue
+++ b/pages/miniClass/MonitorClassList.vue
@@ -2,7 +2,7 @@
-
+
+
修改
@@ -262,18 +263,58 @@
deletePic(event) {
this.fileList1.splice(event.index, 1)
},
+ getHomeWorkDetail(id){
+ uni.showLoading({
+ title:"加载中"
+ })
+ $http.request({
+ url: 'common/class/getClassTaskAndQuesReplyInfo',
+ method: "POST",
+ data: {
+ "replyId":id, //0全部作业1我的作业
+ },
+ header: { //默认 无 说明:请求头
+ 'Content-Type': 'application/json'
+ },
+ })
+ .then(res => {
+ if(res.classTaskAndQuesReply){
+ console.log('作业详情res',res);
+ this.form = res.classTaskAndQuesReply
+ this.fileList1 = []
+ if(res.classTaskAndQuesReply.img != ''){
+ var _imgList = res.classTaskAndQuesReply.img.split(',')
+ _imgList.forEach(item => {
+ this.fileList1.push({url:item})
+ })
+ }
+ // this.fileList1 = [...res.classTaskAndQuesReply.fileList]
+ console.log('fileList4545',this.fileList1);
+ this.showEditBlank = true
+ }else{
+ this.form = {}
+ }
+
+ uni.hideLoading()
+ }).catch(e => {
+ uni.hideLoading()
+ uni.showToast({
+ title: '获取作业详情失败',
+ icon:'none'
+ })
+ })
+ },
editOrAdd(item){
console.log('item', item);
if(item){
- this.form = item
- this.fileList1 = [...item.fileList]
- console.log('fileList4545',item.fileList);
+ this.getHomeWorkDetail(item.id)
}
else{
console.log('form', this.form);
+ this.showEditBlank = true
}
- this.showEditBlank = true
+
},
radioChange1(e){
@@ -376,22 +417,31 @@
},
onSubmit() {
this.$refs.form.validate().then(res => {
+
if (this.fileList1.length > 0) {
let _list = this.fileList1
_list = _list.map(item => item.url)
// console.log('this.fileList1',_list);
this.form.img = _list.join(',')
+ }else{
+ this.form.img = ''
}
var _url = ""
this.form.id ? _url =
- 'common/class/editClassTaskReply' : _url = 'common/class/addClassTaskReply'
+ 'common/class/editClassTaskAndQuesReply' : _url = 'common/class/addClassTaskAndQuesReply'
+ // this.form.id ? _url =
+ // 'common/class/editClassTaskReply' : _url = 'common/class/addClassTaskReply'
+
+
var data = {
- "taskId": this.form.id ? undefined : this.form.taskId,
+ "relationId": this.form.id ? undefined : this.form.taskId,
"id": this.form.id,
+ "type": this.thisTask.type == '0' || this.thisTask.type == '1' ? '0' : '1', //类型0任务1课后题
"display": this.form.display, //0不展示1展示
"content": this.form.content,
- "img": this.form.img
+ "img": this.form.img
}
+
console.log('data',data);
$http.request({
url: _url,
diff --git a/pages/miniClass/taskDetailForMan.vue b/pages/miniClass/taskDetailForMan.vue
index 08d816c..131bf3d 100644
--- a/pages/miniClass/taskDetailForMan.vue
+++ b/pages/miniClass/taskDetailForMan.vue
@@ -37,28 +37,28 @@
:src="item.createUser.avatar" mode="aspectFit">
-
+
匿名用户
+ v-if="item.createUser.nickname != '' && item.createUser.nickname != null">{{item.createUser.nickname}}
匿名用户
-
-
+
{{item.content}}
-
+
分数:{{item.score}}
- 未评分
+
+ 等待另一名评分员评分
+ 请您评分
+
+
+ 未开始评分
{{item.createTime}}
@@ -92,7 +92,7 @@
日期:{{curReplay.createTime}}
-
+
学员信息:{{curReplay.createUser.nickname != null && curReplay.createUser.nickname != '' ? curReplay.createUser.nickname : '匿名用户'}}
/ {{curReplay.createUser.tel}}
@@ -102,7 +102,7 @@
未评分
-
+
@@ -110,7 +110,9 @@
-
+
+
+
@@ -189,6 +191,9 @@
}
},
onPullDownRefresh() {
+ this.pPage = 0
+ this.zuoyeList = []
+ this.getReplayList()
// this.getTaskInfo()
uni.stopPullDownRefresh()
},
@@ -206,6 +211,47 @@
...mapState(["userInfo"]),
},
methods: {
+ // 生成成绩
+ getRealScore(id){
+ uni.showLoading({
+ title:'正在处理'
+ })
+ $http.request({
+ url: "common/class/generateScore",
+ method: "POST",
+ data: {
+ "replyId": id
+ },
+ header: { //默认 无 说明:请求头
+ 'Content-Type': 'application/json'
+ },
+ })
+ .then(res => {
+ if (res.code == 0) {
+ uni.showToast({
+ title: '成绩已生成',
+ icon: 'success'
+ })
+
+ }
+ setTimeout(()=>{
+ this.closePup()
+ this.pPage = 0
+ this.zuoyeList = []
+ this.getReplayList()
+ uni.hideLoading()
+ },500)
+
+ }).catch(e => {
+ uni.hideLoading()
+ console.log(e, '数据报错')
+ // this.status = 3
+ uni.showToast({
+ title: '成绩生成失败',
+ icon: 'error'
+ })
+ });
+ },
// 获取医案任务详情
getTaskInfo() {
$http.request({
@@ -258,15 +304,67 @@
deletePic(event) {
this.fileList1.splice(event.index, 1)
},
+ getHomeWorkDetail(id){
+ uni.showLoading({
+ title:"加载中"
+ })
+ $http.request({
+ url: 'common/class/getClassTaskAndQuesReplyInfo',
+ method: "POST",
+ data: {
+ "replyId":id, //0全部作业1我的作业
+ },
+ header: { //默认 无 说明:请求头
+ 'Content-Type': 'application/json'
+ },
+ })
+ .then(res => {
+ if(res.classTaskAndQuesReply){
+ console.log('作业详情res',res);
+ this.curReplay = res.classTaskAndQuesReply
+ this.form.id = res.classTaskAndQuesReply.id
+ this.fileList1 = []
+ if(res.classTaskAndQuesReply.img != ''){
+ var _imgList = res.classTaskAndQuesReply.img.split(',')
+ _imgList.forEach(item => {
+ this.fileList1.push({url:item})
+ })
+ }
+ if(res.classTaskAndQuesReply.scoreInfo != ''){
+ this.curReplay.scoreInfo = JSON.parse(res.classTaskAndQuesReply.scoreInfo)
+ }else{
+ this.curReplay.scoreInfo = {}
+ }
+ if(this.curReplay.scoreInfo != {}){
+ for (let k in this.curReplay.scoreInfo){
+ console.log(k)
+ if(k == this.userInfo.id){
+ this.form.score = this.curReplay.scoreInfo[k]
+ this.form.hasGiveScore = true
+ break
+ }
+ // console.log(this.curReplay.scoreInfo[k])
+ }
+ }
+ console.log('this.curReplay.scoreInfo',this.curReplay.scoreInfo);
+ this.showEditBlank = true
+ }else{
+ this.curReplay = {}
+ this.closePup()
+ }
+ uni.hideLoading()
+ }).catch(e => {
+ this.showEditBlank = false
+ uni.hideLoading()
+ uni.showToast({
+ title: '获取数据失败',
+ icon:'none'
+ })
+ })
+ },
editOrAdd(item) {
- console.log('item', item);
- this.curReplay = item
- this.form = {...item}
- if(this.form.scoreSuccess == 0){
- this.form.score = undefined
- }
- this.fileList1 = [...item.fileList]
- this.showEditBlank = true
+ // console.log('item', item);
+ this.getHomeWorkDetail(item.id)
},
radioChange1(e) {
this.listDisplay = e.detail.value
@@ -317,6 +415,8 @@
if (res.page.records.length > 0) {
var list = res.page.records
list.forEach(item => {
+ item.scoreInfos = 0
+ item.haveGiveScore = false
item.fileList = []
if (item.img != '') {
var _urs = item.img.split(',')
@@ -326,7 +426,22 @@
})
})
}
+
+ console.log('item.scoreInfo',item.scoreInfo);
+ if(item.scoreInfo != ""){
+ var i = 0
+ for(var kk in JSON.parse(item.scoreInfo)){
+ console.log(kk);
+ if(kk == this.userInfo.id){
+ item.haveGiveScore = true
+ }
+ i++
+ }
+ item.scoreInfos = i
+ }
+ console.log('item.scoreInfos',item.scoreInfos, item.haveGiveScore);
})
+
this.zuoyeList = this.zuoyeList.concat(list)
console.log('chulihoude ', this.zuoyeList);
if (res.page.pages > this.pPage) {
@@ -479,6 +594,14 @@