From 2b75f94a9833e606da5e697adc5cbb8408b840b4 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Tue, 7 Jul 2020 10:14:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BF=83=E7=90=86=E5=92=A8=E8=AF=A2=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E5=9B=9E=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/psychology/psychologyquestion.vue | 135 ++++++++++++++++-- 1 file changed, 120 insertions(+), 15 deletions(-) diff --git a/src/views/modules/psychology/psychologyquestion.vue b/src/views/modules/psychology/psychologyquestion.vue index 188218b..f5231c7 100644 --- a/src/views/modules/psychology/psychologyquestion.vue +++ b/src/views/modules/psychology/psychologyquestion.vue @@ -5,6 +5,30 @@ + + + + + + + + + + + {{ $t('query') }} @@ -31,7 +55,7 @@ 隐藏 展示 {{ $t('delete') }} - 查看回复 + 查看回复 @@ -45,7 +69,37 @@ @current-change="pageCurrentChangeHandle"> - + + + + + + + + + @@ -65,7 +119,32 @@ export default { }, dataForm: { id: '', + userName: '', + questionContent: '', + startDate: '', + endDate: '', displayFlag: '' + }, + innerVisible: false, + pageIndexNew: 1, + limitValNew: 10, + totalNew: 0, + commentsDTOs: [], + pickerBeginDateBefore: { + disabledDate: (time) => { + let beginDateVal = this.dataForm.startDate + if (beginDateVal) { + return time.getTime() > new Date(beginDateVal).getTime() + } + } + }, + pickerBeginDateAfter: { + disabledDate: (time) => { + let EndDateVal = this.dataForm.endDate + if (EndDateVal) { + return time.getTime() < new Date(EndDateVal).getTime() + } + } } } }, @@ -73,14 +152,40 @@ export default { AddOrUpdate }, methods: { + viewAnswer (id) { + this.innerVisible = true + this.dataForm.id = id + this.getCommentList() + }, + pageSizeChangeHandleNew (val) { + this.pageIndexNew = 1 + this.limitValNew = val + this.getCommentList() + }, + pageCurrentChangeHandleNew (val) { + this.pageIndexNew = val + this.getCommentList() + }, + getCommentList () { + this.$http.get('/property/psychologyanswer/page', { params: { id: this.dataForm.id, page: this.pageIndexNew, limit: this.limitValNew } + }).then(({ data: res }) => { + if (res.code !== 0) { + this.commentsDTOs = [] + this.totalNew = 0 + return this.$message.error(res.msg) + } + this.commentsDTOs = res.data.list + this.totalNew = res.data.total + }).catch(() => { }) + }, hiddenQuestion (id) { this.$confirm('是否隐藏该问题?', this.$t('prompt.title'), { - confirmButtonText: this.$t('confirm'), - cancelButtonText: this.$t('cancel'), - type: 'warning' + confirmButtonText: this.$t('confirm'), + cancelButtonText: this.$t('cancel'), + type: 'warning' }).then(() => { - this.dataForm.id = id; - this.dataForm.displayFlag= '0'; + this.dataForm.id = id + this.dataForm.displayFlag = '0' this.$http['put']('/property/psychologyquestion/', this.dataForm).then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) @@ -93,10 +198,10 @@ export default { this.visible = false this.$emit('refreshDataList') } - }); - this.getDataList(); + }) + this.getDataList() }).catch(() => { - this.getDataList(); + this.getDataList() }) }) }, @@ -106,8 +211,8 @@ export default { cancelButtonText: this.$t('cancel'), type: 'warning' }).then(() => { - this.dataForm.id = id; - this.dataForm.displayFlag= '1'; + this.dataForm.id = id + this.dataForm.displayFlag = '1' this.$http['put']('/property/psychologyquestion/', this.dataForm).then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) @@ -120,10 +225,10 @@ export default { this.visible = false this.$emit('refreshDataList') } - }); - this.getDataList(); + }) + this.getDataList() }).catch(() => { - this.getDataList(); + this.getDataList() }) }) }