Browse Source

心理咨询问题回复

feature/yujt_analysis_pc
zhangyuan 5 years ago
parent
commit
2b75f94a98
  1. 135
      src/views/modules/psychology/psychologyquestion.vue

135
src/views/modules/psychology/psychologyquestion.vue

@ -5,6 +5,30 @@
<el-form-item label="提问者名称">
<el-input v-model="dataForm.userName" clearable></el-input>
</el-form-item>
<el-form-item label="问题内容">
<el-input v-model="dataForm.questionContent" clearable></el-input>
</el-form-item>
<el-form-item label="提问时间"
prop="actStartTime">
<el-date-picker v-model="dataForm.startDate"
type="date"
:picker-options="pickerBeginDateBefore"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期时间">
</el-date-picker>
</el-form-item>
<el-form-item label="至"
label-width="25px"
prop="actEndTime">
<el-date-picker v-model="dataForm.endDate"
type="date"
:picker-options="pickerBeginDateAfter"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期时间">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
@ -31,7 +55,7 @@
<el-button v-if="$hasPermission('psychology:question:hidden') && scope.row.displayFlag !== '0'" type="text" size="small" @click="hiddenQuestion(scope.row.id)">隐藏</el-button>
<el-button v-if="$hasPermission('psychology:question:hidden') && scope.row.displayFlag === '0'" type="text" size="small" @click="showQuestion(scope.row.id)">展示</el-button>
<el-button v-if="$hasPermission('psychology:question:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
<el-button v-if="$hasPermission('psychology:question:view')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">查看回复</el-button>
<el-button v-if="$hasPermission('psychology:question:view') && scope.row.answerNum !== 0" type="text" size="small" @click="viewAnswer(scope.row.id)">查看回复</el-button>
</template>
</el-table-column>
</el-table>
@ -45,7 +69,37 @@
@current-change="pageCurrentChangeHandle">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<el-dialog width="90%"
title="回复详情"
:visible.sync="innerVisible"
append-to-body>
<el-table :data="commentsDTOs"
border
style="width: 100%;">
<el-table-column prop="psychologistName"
label="回复者姓名"
width="150px"
header-align="center"
align="center"></el-table-column>
<el-table-column prop="createdTime"
label="回复时间"
width="200px"
header-align="center"
align="center"></el-table-column>
<el-table-column prop="answerContent"
label="回复内容"
header-align="center"
align="center"></el-table-column>
</el-table>
<el-pagination :current-page="pageIndexNew"
:page-sizes="[10, 20, 50, 100]"
:page-size="limitValNew"
:total="totalNew"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandleNew"
@current-change="pageCurrentChangeHandleNew">
</el-pagination>
</el-dialog>
</div>
</el-card>
</template>
@ -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()
})
})
}

Loading…
Cancel
Save