From d205921f9775fc8d72e74a93cf65c5a68fcd29fd Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Thu, 22 Apr 2021 17:37:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E9=AA=8C=E6=8A=A5=E5=91=8A=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E8=AF=84=E8=AF=AD=E5=8F=8A=E5=88=86=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/page/ShowExperiment.vue | 130 +++++++++++++------------ src/utils/api.js | 8 +- 2 files changed, 71 insertions(+), 67 deletions(-) diff --git a/src/components/page/ShowExperiment.vue b/src/components/page/ShowExperiment.vue index aafe807..60bf296 100644 --- a/src/components/page/ShowExperiment.vue +++ b/src/components/page/ShowExperiment.vue @@ -7,10 +7,10 @@
返回 - 查看报告 + {{edit ? '批阅' : '查看报告'}}
-
- 保存 +
+ 发布成绩
@@ -175,52 +175,51 @@

老师评语

- + - +

教师签名

- - +
+ 不使用 + 已有签名 + 重新上传 +
+ + + + + + +
+ +

教师签名

+
@@ -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){ - this.signId = res.data[0].id - this.signSrc = this.signList.find(n => n.id == this.signId).signatureUrl + 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) => {}) }, diff --git a/src/utils/api.js b/src/utils/api.js index 620a676..5579d12 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -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`,