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