实验报告修改评语及分数

master
yujialong 4 years ago
parent a4df06e56a
commit d205921f97
  1. 60
      src/components/page/ShowExperiment.vue
  2. 8
      src/utils/api.js

@ -7,10 +7,10 @@
<div class="per_title" v-preventReClick @click="goback()">
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
<span class="per_school">查看报告</span>
<span class="per_school">{{edit ? '批阅' : '查看报告'}}</span>
</div>
<div>
<el-button type="primary" size="small" round v-preventReClick @click="saveAdd('form')">保存</el-button>
<div v-if="edit">
<el-button type="primary" size="small" round v-preventReClick @click="saveAdd('form')">发布成绩</el-button>
</div>
</div>
</el-card>
@ -175,20 +175,19 @@
<div class="meta-title-wrap">
<p class="meta-title"><i class="el-icon-discount"></i> 老师评语</p>
</div>
<el-input type="textarea" rows="5" v-model="form.comment" disabled></el-input>
<el-input type="textarea" rows="5" v-model="form.comment" :disabled="!edit"></el-input>
</div>
<el-card shadow="hover" class="mgb20">
<el-card shadow="hover" class="mgb20" v-if="edit">
<p class="mgb20">教师签名</p>
<template v-if="edit">
<div class="mgb20">
<el-radio v-model="autograph" label="1">不使用</el-radio>
<el-radio v-model="autograph" label="2">已有签名</el-radio>
<el-radio v-model="autograph" label="3">重新上传</el-radio>
<el-radio v-model="isSignature" label="0">不使用</el-radio>
<el-radio v-model="isSignature" label="1">已有签名</el-radio>
<el-radio v-model="isSignature" label="2">重新上传</el-radio>
</div>
<el-row>
<el-col :span="6">
<template v-if="autograph == 2">
<template v-if="isSignature == 1">
<el-select v-model="signId" placeholder="请选择签名" size="mini" @change="signChange">
<el-option
v-for="item in signList"
@ -203,7 +202,7 @@
<el-button size="mini" type="danger" @click="delSign">删除</el-button>
</div>
</template>
<template v-else-if="autograph == 3">
<template v-else-if="isSignature == 2">
<el-upload
:data="{userId: userId,reportId: id}"
:limit="1"
@ -217,10 +216,10 @@
</template>
</el-col>
</el-row>
</template>
<template v-else>
</el-card>
<el-card shadow="hover" class="mgb20" v-else-if="!edit && form.isSignature">
<p class="mgb20">教师签名</p>
<img :src="signSrc" alt="" style="max-width: 400px;">
</template>
</el-card>
</div>
</el-col>
@ -266,7 +265,7 @@
},
signId: '',
signSrc: '',
autograph: '1',
isSignature: '0',
signList: [],
sjData: [],
infoData: [],
@ -278,7 +277,6 @@
},
mounted(){
this.getData()
this.getSgin()
},
methods: {
getData(){
@ -293,6 +291,7 @@
if(i.includes('steps') && report[i]) steps.push(JSON.parse(report[i]))
}
this.form = report
this.isSignature = '' + report.isSignature
if(report.steps9){
let steps9 = JSON.parse(report.steps9)
this.goodsData = steps9.goodsData ? steps9.goodsData: []
@ -339,6 +338,7 @@
score: report.score,
userName: this.userName
}]
this.getSgin()
}).catch(res => {})
},
//
@ -374,6 +374,16 @@
}
},
getSgin(){
if(this.form.isSignature){
let data = {
reportId: this.id
}
this.$get(this.api.reportSignature,data).then(res => {
this.signId = res.data.id
this.signSrc = res.data.signatureUrl
}).catch(res => {})
}
if(this.edit){
let data = {
reportId: this.id
@ -381,24 +391,16 @@
this.$get(this.api.querySignature,data).then(res => {
this.signList = res.data
if(res.data.length){
if(!this.signId){
this.signId = res.data[0].id
this.signSrc = this.signList.find(n => n.id == this.signId).signatureUrl
}
}).catch(res => {})
}else{
let data = {
reportId: this.id
}
this.$get(this.api.reportSignature,data).then(res => {
this.signSrc = res.data.signatureUrl
}).catch(res => {})
}
},
signChange(){
this.signSrc = this.signList.find(n => n.id == this.signId).signatureUrl
this.$post(`${this.api.selectSignature}?reportId=${this.id}&id=${this.signId}`).then(res => {
}).catch(res => {})
},
delSign(){
this.$confirm('确定要删除吗?', '提示', {
@ -445,12 +447,14 @@
}
},
saveAdd(){
this.$post(`${this.api.selectSignature}?reportId=${this.id}&id=${this.signId}`).then(res => {}).catch(res => {})
let data = {
comment: this.configId,
id: this.id,
level: this.form.systemType,
comment: this.form.comment,
reportId: Number(this.id),
isSignature: Number(this.isSignature)
}
this.$post(this.api.updateComment,data).then((res) => {
this.$message.success('保存成功')
this.$router.back()
}).catch((res) => {})
},

@ -1,7 +1,7 @@
// let host = 'http://192.168.31.152:8090'
// let host = 'http://192.168.31.152:1010'
// let host = 'http://192.168.31.125:9090'//林
// let host = 'http://192.168.31.152:1010'//榕
// let host = 'http://192.168.31.152:9090'//榕
// let host = 'http://192.168.31.137:9090'//陈
// let host = 'http://192.168.31.140:9090'//7
@ -137,9 +137,9 @@ export default {
editScore: `${host}/evaluation/Achievement/editScore`,
// 教师评语
addComment: `${host}/evaluation/comment/addComment`,
queryComment: `${host}/evaluation/comment/queryComment`,
updateComment:`${host}/evaluation/comment/updateComment`,
addComment: `${host}/evaluation/Achievement/addComment`,
queryComment: `${host}/evaluation/Achievement/queryComment`,
updateComment:`${host}/evaluation/Achievement/updateComment`,
// 老师签名照
daleteSignature: `${host}/evaluation/signature/deleteSignature`,

Loading…
Cancel
Save