97 lines
3.1 KiB
Vue
97 lines
3.1 KiB
Vue
<template>
|
|
<section class="mmList">
|
|
<ai-list>
|
|
<ai-title slot="title" title="群众留言" isShowBottomBorder/>
|
|
<template #content>
|
|
<ai-search-bar>
|
|
<template #left>
|
|
<ai-select v-model="search.type" placeholder="留言状态"/>
|
|
<ai-select v-model="search.type" placeholder="留言类型"/>
|
|
</template>
|
|
<template #right>
|
|
<el-input size="small" placeholder="搜索企业名称、法人姓名、登录账号" v-model="search.enterpriseName" clearable
|
|
@change="page.current=1,getTableData()"/>
|
|
</template>
|
|
</ai-search-bar>
|
|
<ai-table :tableData="tableData" :total="page.total" :current.sync="page.current" :size.sync="page.size"
|
|
@getList="getTableData" :col-configs="colConfigs" :dict="dict">
|
|
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
|
<template slot-scope="{row}">
|
|
<el-button v-if="row.status==0" type="text" @click="handleEnable(row)">公示</el-button>
|
|
<el-button v-else-if="row.status==1" type="text" @click="handleEnable(row)">取消公示</el-button>
|
|
<el-button type="text" @click="showDetail(row.id)">详情</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</ai-table>
|
|
</template>
|
|
</ai-list>
|
|
</section>
|
|
</template>
|
|
|
|
<script>
|
|
import {mapState} from "vuex";
|
|
|
|
export default {
|
|
name: "mmList",
|
|
props: {
|
|
instance: Function,
|
|
dict: Object,
|
|
permissions: Function
|
|
},
|
|
computed: {
|
|
...mapState(['user'])
|
|
},
|
|
data() {
|
|
return {
|
|
search: {name: ""},
|
|
page: {current: 1, size: 10, total: 0},
|
|
tableData: [],
|
|
colConfigs: [
|
|
{label: "标题", prop: "enterpriseName"},
|
|
{label: "类型", prop: "enterpriseType", dict: "enterpriseType"},
|
|
{label: "内容", prop: "content"},
|
|
{label: "留言人", prop: "createUserName"},
|
|
{label: "留言提交时间", prop: "createTime"},
|
|
{label: "最后回复时间", prop: "loginAccount"},
|
|
{slot: "options"}
|
|
]
|
|
}
|
|
},
|
|
methods: {
|
|
getTableData() {
|
|
this.instance.post("/appportaluserenterprise/list", null, {
|
|
params: {...this.page, ...this.search, status: 1}
|
|
}).then(res => {
|
|
if (res?.data) {
|
|
this.tableData = res.data?.records
|
|
this.page.total = res.data.total
|
|
}
|
|
})
|
|
},
|
|
showDetail(id) {
|
|
this.$router.push({query: {id}})
|
|
},
|
|
handleEnable(row) {
|
|
let status = (Number(row.status) + 1) % 2
|
|
this.$confirm(`是否要${this.dict.getLabel('portalUserStatus', status)}留言?`).then(() => {
|
|
this.instance.post("/appportaluser/addOrUpdate", {...row, status}).then(res => {
|
|
if (res?.code == 0) {
|
|
this.$message.success(this.dict.getLabel('portalUserStatus', status) + "成功!")
|
|
this.getTableData()
|
|
}
|
|
})
|
|
}).catch(() => 0)
|
|
},
|
|
},
|
|
created() {
|
|
this.getTableData()
|
|
this.search.areaId = this.user.info.areaId
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.mmList {
|
|
}
|
|
</style>
|