村民议事
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
<template slot="content">
|
||||
<ai-search-bar class="search-bar">
|
||||
<template #left>
|
||||
<ai-select v-model="search.type" clearable @change="search.current = 1, getList()" :selectList="dict.getDict('discussType')"></ai-select>
|
||||
<ai-select v-model="search.status" clearable @change="search.current = 1, getList()" :selectList="dict.getDict('discussStatus')"></ai-select>
|
||||
<el-button size="small" type="primary" icon="iconfont iconAdd" @click="toAdd('')">发布议事</el-button>
|
||||
</template>
|
||||
<template #right>
|
||||
@@ -36,12 +38,12 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column slot="options" width="240px" fixed="right" label="操作" align="center">
|
||||
<el-table-column slot="options" width="160px" fixed="right" label="操作" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<div class="table-options">
|
||||
<el-button type="text" title="详情" @click="toDetail(row.id)">详情</el-button>
|
||||
<el-button type="text" :title="row.status == 1 ? '取消发布' : '发布'" @click="changeStatus(row)">{{ row.status == 1 ? '取消发布' : '发布' }}</el-button>
|
||||
<el-button type="text" @click="toAdd(row.id)">编辑</el-button>
|
||||
<el-button type="text" title="取消公示" @click="changeStatus(row)" :disabled="row.status !== '1'">取消公示</el-button>
|
||||
<!-- <el-button type="text" @click="toAdd(row.id)">编辑</el-button> -->
|
||||
<el-button type="text" @click="remove(row.id)">删除</el-button>
|
||||
</div>
|
||||
</template>
|
||||
@@ -66,19 +68,22 @@
|
||||
search: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
title: ''
|
||||
status: '',
|
||||
type: '',
|
||||
title: '',
|
||||
areaId: ''
|
||||
},
|
||||
currIndex: -1,
|
||||
areaList: [],
|
||||
total: 10,
|
||||
colConfigs: [
|
||||
{ prop: 'title', label: '议事主题', align: 'left', width: '200px' },
|
||||
{ prop: 'areaName', label: '议事类型', align: 'center' },
|
||||
{ prop: 'createUnitName', label: '话事人', align: 'center' },
|
||||
{ prop: 'createUserName', label: '观点数量', align: 'center' },
|
||||
{ prop: 'createUserName', label: '投票数量', align: 'center' },
|
||||
{ prop: 'status', label: '发布状态', align: 'center', formart: v => v === '1' ? '已发布' : '未发布' },
|
||||
{ prop: 'createDate', label: '发布时间', align: 'center' },
|
||||
{ prop: 'type', label: '议事类型', align: 'center', formart: v => this.dict.getLabel('discussType', v) },
|
||||
{ prop: 'createUserName', label: '话事人', align: 'center' },
|
||||
{ prop: 'msgCount', label: '观点数量', align: 'center' },
|
||||
{ prop: 'voteCount', label: '投票数量', align: 'center' },
|
||||
{ prop: 'status', label: '发布状态', align: 'center', formart: v => this.dict.getLabel('discussStatus', v) },
|
||||
{ prop: 'createTime', label: '发布时间', align: 'center' },
|
||||
{ slot: 'options', label: '操作', align: 'center' }
|
||||
],
|
||||
areaName: '',
|
||||
@@ -91,14 +96,16 @@
|
||||
...mapState(['user'])
|
||||
},
|
||||
|
||||
mounted() {
|
||||
created () {
|
||||
this.search.areaId = this.user.info.areaId
|
||||
this.getList()
|
||||
this.dict.load(['discussType', 'discussStatus']).then(() => {
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList() {
|
||||
this.instance.post(`/app/appcountrysidetourism/list`, null, {
|
||||
this.instance.post(`/app/appvillagediscuss/list`, null, {
|
||||
params: {
|
||||
type: 0,
|
||||
...this.search
|
||||
@@ -112,12 +119,13 @@
|
||||
},
|
||||
|
||||
changeStatus (item) {
|
||||
let title = item.status == '1' ? '是否要取消发布?' : '是否要发布?';
|
||||
this.$confirm(title, {type: 'warning'}).then(() => {
|
||||
item.status = item.status == '1' ? '0' : '1'
|
||||
this.instance.post('/app/appcountrysidetourism/addOrUpdate', item).then(res => {
|
||||
this.$confirm('是否要结束公示', {type: 'warning'}).then(() => {
|
||||
this.instance.post('/app/appvillagediscuss/finishPublic', {
|
||||
stauts: '2',
|
||||
id: item.id
|
||||
}).then(res => {
|
||||
if (res && res.code == 0) {
|
||||
title == '是否要发布?' ? this.$message.success('发布成功') : this.$message.success('取消发布成功')
|
||||
this.$message.success('结束公示')
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
@@ -126,7 +134,7 @@
|
||||
|
||||
remove(id) {
|
||||
this.$confirm('确定删除该数据?').then(() => {
|
||||
this.instance.post(`/app/appcountrysidetourism/delete?ids=${id}`).then(res => {
|
||||
this.instance.post(`/app/appvillagediscuss/delete?ids=${id}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success('删除成功!')
|
||||
this.getList()
|
||||
|
||||
Reference in New Issue
Block a user