173 lines
6.2 KiB
HTML
173 lines
6.2 KiB
HTML
<!--#
|
||
layout("/layouts/platform.html"){
|
||
#-->
|
||
|
||
<style>
|
||
<!--
|
||
#include
|
||
|
||
(
|
||
"/platform/psychology/onlinePost/include/postInfoCss.html"
|
||
)
|
||
{
|
||
}
|
||
#-- >
|
||
</style>
|
||
|
||
<div id="app" v-cloak>
|
||
<guava>
|
||
<el-card shadow="never">
|
||
<div class="btn-group tool-button mt5">
|
||
<el-date-picker
|
||
v-model="pageForm.year"
|
||
value-format="yyyy"
|
||
type="year"
|
||
placeholder="选择年">
|
||
</el-date-picker>
|
||
</div>
|
||
<div class="btn-group tool-button mt5">
|
||
<el-select v-model="pageForm.isReply">
|
||
<el-option :value="null" label="全部"></el-option>
|
||
<el-option :value="true" label="已回复"></el-option>
|
||
<el-option :value="false" label="未回复"></el-option>
|
||
</el-select>
|
||
</div>
|
||
<div class="btn-group tool-button mt5">
|
||
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
|
||
</div>
|
||
|
||
</el-card>
|
||
|
||
<el-card shadow="never" class="mt10">
|
||
<table-tool label="咨询列表" :app="this">
|
||
<template #func>
|
||
|
||
</template>
|
||
</table-tool>
|
||
<el-table :data="tableData" stripe border :size="tableSize" style="width: 100%">
|
||
<el-table-column type="index" label="序号" width="80px"></el-table-column>
|
||
<el-table-column
|
||
align="center"
|
||
header-align="center"
|
||
v-for="column in tableColumns"
|
||
show-overflow-tooltip
|
||
:label="column.label"
|
||
:prop="column.prop"
|
||
:sortable="column.sortable"
|
||
>
|
||
<template v-if="column.prop==='replyCount'" scope="{row}">
|
||
<el-tag type="success" v-if="row.replyCount>0">已回复</el-tag>
|
||
<el-tag type="info" v-else>未回复</el-tag>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column align="center" header-align="center" label="操作" width="250">
|
||
<template scope="{row}">
|
||
<el-button size="mini" type="primary" @click="openView(row)">查看</el-button>
|
||
<el-button size="mini" type="primary" @click="openReply(row)">回复</el-button>
|
||
</template>
|
||
</el-table-column>
|
||
</el-table>
|
||
<!--#include("/layouts/pagination.html"){}#-->
|
||
</el-card>
|
||
</guava>
|
||
|
||
<el-dialog title="回复咨询" :visible.sync="replyDialogVisible" width="55%" top="100px"
|
||
:close-on-click-modal="false">
|
||
<el-form :model="formData" ref="ruleForm" :rules="rules" label-width="100px" label-suffix=":">
|
||
<vi-title title="咨询信息"></vi-title>
|
||
<el-form-item label="咨询人">
|
||
<span>{{formData.posterUserName}}</span>
|
||
</el-form-item>
|
||
<el-form-item label="咨询主题" prop="postTitle">
|
||
<span>{{formData.postTitle}}</span>
|
||
</el-form-item>
|
||
<el-form-item label="主要内容" prop="postContent">
|
||
<span>{{formData.postContent}}</span>
|
||
</el-form-item>
|
||
|
||
<vi-title title="我来回复"></vi-title>
|
||
<el-form-item label="回复内容" prop="replyContent">
|
||
<el-input type="textarea" rows="3" v-model="formData.replyContent"></el-input>
|
||
</el-form-item>
|
||
</el-form>
|
||
|
||
<el-row type="flex" justify="center">
|
||
<el-button @click="replyDialogVisible=false">取消</el-button>
|
||
<el-button type="primary" @click="doReply">提交</el-button>
|
||
</el-row>
|
||
</el-dialog>
|
||
|
||
<!--#include("/platform/psychology/onlinePost/include/postInfo.html"){}#-->
|
||
|
||
</div>
|
||
<script>
|
||
const vue = new Vue({
|
||
el: '#app',
|
||
mixins: [initTableMixins],
|
||
data() {
|
||
return {
|
||
tableColumns: [
|
||
{prop: 'posterUserName', label: '姓名'},
|
||
{prop: 'postTitle', label: '标题'},
|
||
{prop: 'postingTime', label: '咨询时间'},
|
||
{prop: 'replyCount', label: '回复情况'}
|
||
],
|
||
replyDialogVisible: false,
|
||
viewDialogVisible: false,
|
||
rules: {
|
||
replyContent: [{required: true, message: '请输入回复内容', trigger: ['change', 'blur']}],
|
||
|
||
},
|
||
formData: {
|
||
postTitle: null,
|
||
postContent: null,
|
||
replyContent: null
|
||
},
|
||
pageForm: {
|
||
isReply: null,
|
||
year: null
|
||
},
|
||
viewData: {}
|
||
}
|
||
},
|
||
methods: {
|
||
openReply(row) {
|
||
const {id, posterUserName, postTitle, postContent} = row
|
||
this.formData = {
|
||
id, posterUserName, postTitle, postContent,
|
||
replyContent: null
|
||
}
|
||
this.replyDialogVisible = true
|
||
},
|
||
async doReply() {
|
||
const valid = await this.$refs['ruleForm'].validate()
|
||
if (valid) {
|
||
const params = {
|
||
replyContent: this.formData.replyContent,
|
||
postId: this.formData.id
|
||
}
|
||
const resp = await $.post(loc() + '/doReply', params)
|
||
if (resp.code === 0) {
|
||
this.notifySuccess(resp.msg)
|
||
this.replyDialogVisible = false
|
||
this.doSearch()
|
||
}
|
||
}
|
||
},
|
||
openView(row) {
|
||
this.viewDialogVisible = true
|
||
this.viewData = row
|
||
}
|
||
},
|
||
created() {
|
||
this.pageForm.year = new Date().getFullYear().toString()
|
||
this.pageForm.isReply = null
|
||
this.pageData()
|
||
}
|
||
})
|
||
</script>
|
||
|
||
|
||
<!--#
|
||
}
|
||
#--> |