Files
UNION_NSI/target/classes/views/platform/legalAid/onlinePost/post.html
T
2026-09-08 19:49:21 +08:00

216 lines
8.4 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!--#
layout("/layouts/platform.html"){
#-->
<style>
<!--
#include
(
"/platform/legalAid/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>
<div class="pull-right offscreen-right mt5">
<el-button type="primary" @click="openAdd">
我要咨询
</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==='isReply'" scope="{row}">
<el-tag type="success" v-if="row.isReply">已回复</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="openEdit(row)">编辑</el-button>
<el-button v-if="!row.isReply" size="mini" type="danger" @click="doDelete(row.id)">删除咨询
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</guava>
<el-dialog :title="formData.id ? '编辑咨询内容' : '发布咨询内容'" :visible.sync="addDialogVisible" width="55%" top="100px"
:close-on-click-modal="false">
<el-form :model="formData" ref="ruleForm" :rules="rules" label-width="100px" label-suffix="">
<el-row type="flex" :gutter="20">
<el-col :span="12">
<el-form-item label="咨询人姓名">
<el-input v-model="formData.posterUserName" readonly></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="咨询人工号">
<el-input v-model="formData.posterLoginName" readonly></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="咨询主题" prop="postTitle">
<el-input v-model="formData.postTitle" maxlength="20" placeholder="请简约填写咨询主题,不超过20个字"></el-input>
</el-form-item>
<el-form-item label="主要内容" prop="postContent">
<el-input type="textarea" rows="5" v-model="formData.postContent" maxlength="500"
placeholder="请输入内容"></el-input>
</el-form-item>
<el-form-item>
<div class="text-primary">
<i class="el-icon-warning"></i>
提示:不会发布您的个人隐私信息,您咨询的内容只有心理咨询师可查看并回复。
</div>
</el-form-item>
</el-form>
<el-row type="flex" justify="center">
<el-button @click="addDialogVisible=false">取消</el-button>
<el-button type="primary" @click="doAdd">提交</el-button>
</el-row>
</el-dialog>
<!--#include("/platform/legalAid/onlinePost/include/postInfo.html"){}#-->
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
tableColumns: [
{prop: 'posterLoginName', label: '工号'},
{prop: 'posterUserName', label: '姓名'},
{prop: 'postTitle', label: '标题'},
{prop: 'postingTime', label: '咨询时间'},
{prop: 'isReply', label: '回复情况'}
],
addDialogVisible: false,
viewDialogVisible: false,
rules: {
postTitle: [{required: true, message: '请输入咨询主题', trigger: ['change', 'blur']}],
postContent: [{required: true, message: '请输入咨询内容', trigger: ['change', 'blur']}],
},
formData: {
postTitle: null,
postContent: null
},
pageForm: {
isReply: null,
year: null
},
viewData: {}
}
},
methods: {
openAdd() {
this.addDialogVisible = true
if (this.$refs['ruleForm']) {
this.$refs['ruleForm'].resetFields()
}
this.$set(this.formData, 'posterLoginName', "${@shiro.getPrincipalProperty('loginname')}")
this.$set(this.formData, 'posterUserName', "${@shiro.getPrincipalProperty('username')}")
this.$set(this.formData, 'postTitle', null)
this.$set(this.formData, 'postContent', null)
delete this.formData.id
},
async doAdd() {
const valid = await this.$refs['ruleForm'].validate()
if (valid) {
const method = this.formData.id ? '/doEdit' : '/doAdd'
const resp = await $.post(loc() + method, this.formData)
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.addDialogVisible = false
this.doSearch()
}
}
},
async doDelete(id) {
const confirm = await this.$confirm('确定删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === 'confirm') {
const resp = await $.post(loc() + '/doDelete', {id})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.doSearch()
}
}
},
openEdit(row) {
const {id, posterUserName, posterLoginName, postTitle, postContent} = row
this.formData = {
id, posterUserName, posterLoginName, postTitle, postContent
}
this.addDialogVisible = true
},
openView(row) {
this.viewDialogVisible = true
this.viewData = row
}
},
created() {
this.pageForm.year = new Date().getFullYear().toString()
this.pageForm.isReply = null
this.pageData()
}
})
</script>
<!--#
}
#-->