diff --git a/src/api/modules/report.js b/src/api/modules/report.js index caa2cad..76cce40 100644 --- a/src/api/modules/report.js +++ b/src/api/modules/report.js @@ -49,13 +49,13 @@ export default { params: id }) }, -labelUpdate(data){ - return request({ - url: 'api/tree-label/update', - method: 'POST', - data - }) -}, + labelUpdate(data){ + return request({ + url: 'api/tree-label/update', + method: 'POST', + data + }) + }, // 新增或编辑报告 reportAdd (data) { @@ -151,6 +151,52 @@ labelUpdate(data){ method: 'POST', params: data }) - } - // + }, + // 点赞 + goodLuck (data) { + return request({ + url: '/api/report/praise/'+data, + method: 'get', + }) + }, +// 取消点赞 + NogoodLuck (data) { + return request({ + url: '/api/report/delPraise/'+data, + method: 'get', + }) + }, + //删除评论 {id} + delJuggle (data) { + return request({ + url: '/api/report-comment/'+data, + method: 'delete', + }) + }, + // 添加评论 + addJuggle (data) { + return request({ + url: '/api/report-comment/add', + method: 'post', + data + }) + }, + // 获取评论 + getJuggle (data) { + return request({ + url: '/api/report-comment/page', + method: 'get', + params:data + }) + }, + //评分 + addScore(data) { + return request({ + url: '/api/report-rating/rating', + method: 'put', + params:data + }) + }, + + } diff --git a/src/api/modules/reportProcess.js b/src/api/modules/reportProcess.js new file mode 100644 index 0000000..f015f68 --- /dev/null +++ b/src/api/modules/reportProcess.js @@ -0,0 +1,9 @@ +import { instance as request } from '@/utils/request' +export default { + downFile (data) { + return request({ + url: '/api/sys/file/'+data, + method: 'GET', + }) + }, +} diff --git a/src/views/Report/ReportDetail.vue b/src/views/Report/ReportDetail.vue index fd4c33e..b1f0e0e 100644 --- a/src/views/Report/ReportDetail.vue +++ b/src/views/Report/ReportDetail.vue @@ -42,11 +42,11 @@
- 报告满意度: + 报告满意度:
- - + +
@@ -56,19 +56,23 @@ 评论 - + - 发表评论 + 发表评论 -
-
sss
+
+
+
+ {{item.userName.slice(0,1)}} +
+
-
ssss
+
{{ item.comment }}
-
time
- 删除 +
{{ item.createTime }}
+ 删除
@@ -89,13 +93,85 @@ export default { data () { return { isShow: false, - value1:'', + userRating:'', watermarkText: '', // 水印 content: '', - row: {} + row: {}, + comment:'', + reportId:'', + commonList:[], + q:{ + pageNo:1, + pageSize:5, + + }, + userId:this.$store.getters.userInfo.USID, + userName:this.$store.getters.userInfo.USNAME, } }, methods: { + //点赞 + pointZan(type){ + if(type== 'n'){ + this.$api.report.NogoodLuck(this.reportId).then(res=>{ + this.isShow=!this.isShow + this.$message.success("取消成功") + }).catch(()=>{ + this.$message.warning("操作失败") + }) + }else{ + this.$api.report.goodLuck(this.reportId).then(res=>{ + this.isShow=!this.isShow + this.$message.success("点赞成功") + }).catch(()=>{ + this.$message.warning("操作失败") + }) + } + }, + //评分 + saveScore(){ + this.$api.report.addScore({userRating:+this.userRating,reportId:this.reportId}).then(res=>{ + + }) + }, + addJuggle(){ + if(this.comment!=''){ + this.$api.report.addJuggle({ + comment:this.comment, + reportId:this.reportId, + userId: this.userId, + userName:this.userName + }).then(res=>{ + this.$message.success("评论成功") + this.comment='' + this.getComment() + }) + }else { + this.$message.warning("请填写评论") + } + }, + // 删除评论 + delJugg(id) { + this.$confirm('确认删除该条评论?', '删除', { + confirmButtonText: '确定', + cancelButtonText: '取消', + confirmButtonClass: 'common-button-primary', + + type: 'warning' + }).then(() => { + this.$api.report.delJuggle(id).then(res=>{ + this.$message.success("删除成功") + this.getComment() + }) + }) + }, + // 获取评论 + getComment(){ + this.$api.report.getJuggle({...this.q,reportId:this.reportId}).then(res=>{ + this.commonList=res.data.records + this.total=res.data.total + }) + }, getKeyContent(list) { if (list) { let keyContent = [] @@ -114,17 +190,17 @@ export default { } }, // 预览 - previewRow () { - if (!this.$route.query.row) { - this.$router.push({ path: '/report/list', query: { id: this.$route.query.id } }) - return - } - this.watermarkText = `${this.$store.state.userInfo.usname} ${formatDate(+new Date(), 'yyyy年MM月dd日 hh:mm:ss')}` - this.row = JSON.parse(this.$route.query.row) - this.$api.report.reportGetReportHtmlId({ id: this.row.id }).then(({ data }) => { - this.content = data.content - }) - }, + // previewRow () { + // if (!this.$route.query.row) { + // this.$router.push({ path: '/report/list', query: { id: this.$route.query.id } }) + // return + // } + // this.watermarkText = `${this.$store.state.userInfo.usname} ${formatDate(+new Date(), 'yyyy年MM月dd日 hh:mm:ss')}` + // this.row = JSON.parse(this.$route.query.row) + // this.$api.report.reportGetReportHtmlId({ id: this.row.id }).then(({ data }) => { + // this.content = data.content + // }) + // }, // 下载 downloadRow (row) { // this.$confirm('此操作将下载所选数据文件, 是否继续?', '提示', { @@ -137,12 +213,11 @@ export default { }) // }) }, - saveScore(){ - - } }, created () { - this.previewRow() + this.reportId=this.$route.query.reportId + // this.previewRow() + this.getComment() } } @@ -255,6 +330,12 @@ export default { text-align: center; border-right: 1px solid #e6f6fe; margin: 0 auto; + .nameCir{ + background-color: pink; + width: 50px; + height: 50px; + border-radius: 50%; + } } .juggle_right{ position: relative; diff --git a/src/views/Report/ReportList.vue b/src/views/Report/ReportList.vue index acdc500..becbab3 100644 --- a/src/views/Report/ReportList.vue +++ b/src/views/Report/ReportList.vue @@ -490,7 +490,7 @@ export default { }, // 跳转到详情 goReportDetail(row) { - this.$router.push({path: '/report/detail', query: {id: this.$route.query.id, row: JSON.stringify(row)}}) + this.$router.push({path: '/report/detail', query: {id: this.$route.query.id, reportId: row.id}}) } }, created() { diff --git a/src/views/reportProcess/components/reportForm.vue b/src/views/reportProcess/components/reportForm.vue index 6b08142..247a5fc 100644 --- a/src/views/reportProcess/components/reportForm.vue +++ b/src/views/reportProcess/components/reportForm.vue @@ -111,7 +111,7 @@ {{form.fileName}} - + @@ -239,6 +239,11 @@ export default { } }, methods: { + downFile(id){ + this.$api.reportProcess.downFile(id).then(res=>{ + + }) + }, handleClick(){ this.orgTableVal=this.form.department this.orgTableValName=this.form.departmentName