村民议事

This commit is contained in:
yanran200730
2022-01-05 09:28:32 +08:00
parent 4cbe34c08c
commit 89cad98a82

View File

@@ -69,8 +69,8 @@
@close="onClose" @close="onClose"
@onConfirm="onConfirm"> @onConfirm="onConfirm">
<el-form ref="form" class="ai-form" :model="form" label-width="110px" label-position="right"> <el-form ref="form" class="ai-form" :model="form" label-width="110px" label-position="right">
<el-form-item label="发表意见" prop="name" style="width: 100%;" :rules="[{ required: true, message: '请发表你的观点和意见', trigger: 'blur' }]"> <el-form-item label="发表意见" prop="content" style="width: 100%;" :rules="[{ required: true, message: '请发表你的观点和意见', trigger: 'blur' }]">
<el-input size="small" type="textarea" :rows="5" placeholder="请发表你的观点和意见" v-model="form.name"></el-input> <el-input size="small" type="textarea" :rows="5" placeholder="请发表你的观点和意见" v-model="form.content"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
</ai-dialog> </ai-dialog>
@@ -80,6 +80,7 @@
<script> <script>
import * as echarts from 'echarts' import * as echarts from 'echarts'
import { mapState } from 'vuex'
export default { export default {
name: 'Detail', name: 'Detail',
@@ -99,7 +100,7 @@
}, },
isShowAdd: false, isShowAdd: false,
form: { form: {
name: '' content: ''
}, },
total: 0, total: 0,
currIndex: 0, currIndex: 0,
@@ -116,11 +117,16 @@
{prop: 'userName', label: '投票人', align: 'center'}, {prop: 'userName', label: '投票人', align: 'center'},
{prop: 'item', label: '投票选项', align: 'center'} {prop: 'item', label: '投票选项', align: 'center'}
], ],
type: '',
statistic: {}, statistic: {},
tabList: ['议题信息', '意见征集'] tabList: ['议题信息', '意见征集']
} }
}, },
computed: {
...mapState(['user'])
},
created () { created () {
this.getInfo(this.params.id) this.getInfo(this.params.id)
}, },
@@ -140,7 +146,8 @@
if (res.code === 0) { if (res.code === 0) {
this.info = res.data this.info = res.data
this.info.images = res.data.images ? JSON.parse(res.data.images) : [] this.info.images = res.data.images ? JSON.parse(res.data.images) : []
this.getList(this.params.id, res.data.type) this.type = res.data.type
this.getList()
if (res.data.type === '1') { if (res.data.type === '1') {
this.statistic = res.data.statistic this.statistic = res.data.statistic
@@ -150,10 +157,10 @@
}) })
}, },
getList(id, type) { getList() {
this.instance.post(`${type === '0' ? '/app/appvillagediscussmessage/list' : '/app/appvillagediscussvote/list'}`, null, { this.instance.post(`${this.type === '0' ? '/app/appvillagediscussmessage/list' : '/app/appvillagediscussvote/list'}`, null, {
params: { params: {
discussId: id, discussId: this.params.id,
...this.search ...this.search
} }
}).then(res => { }).then(res => {
@@ -201,12 +208,17 @@
onConfirm () { onConfirm () {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
this.instance.post(`/app/appminihomeconfig/addOrUpdate`, { this.instance.post(`/app/appvillagediscussmessage/addOrUpdate`, {
...this.form ...this.form,
discussId: this.params.id,
createUserId: this.user.info.name,
createUserName: this.user.info.id,
avatar: this.user.info.avatar
}).then(res => { }).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.$message.success('添加成功') this.$message.success('添加成功')
this.isShowAdd = false this.isShowAdd = false
this.search.current = 1
this.getList() this.getList()
} }
@@ -216,7 +228,7 @@
}, },
onClose () { onClose () {
this.form.content = ''
}, },
cancel (isRefresh) { cancel (isRefresh) {