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()
})
})
}