邻里互助

This commit is contained in:
liuye
2023-03-16 10:54:06 +08:00
parent ab11967a8e
commit 7dca4813ed
3 changed files with 258 additions and 72 deletions

View File

@@ -8,8 +8,8 @@
<ai-card title="发帖信息">
<template #content>
<el-form class="ai-form" :model="form" label-width="120px" ref="form">
<el-form-item label="单位" prop="departmentName" style="width: 100%;" :rules="[{ required: true, message: '请选择单位', trigger: 'change' }]">
<el-input size="small" placeholder="请选择..." disabled v-model="form.departmentName">
<el-form-item label="单位" prop="publishDepartName" style="width: 100%;" :rules="[{ required: true, message: '请选择单位', trigger: 'change' }]">
<el-input size="small" placeholder="请选择..." disabled v-model="form.publishDepartName">
<ai-wechat-selecter slot="append" isStrictly :instance="instance" @change="onChange" v-model="department" isChooseUnit>
<el-button type="info">选择</el-button>
</ai-wechat-selecter>
@@ -26,8 +26,8 @@
:limit="9">
</ai-uploader>
</el-form-item>
<el-form-item prop="title" style="width: 100%;" label="话题">
<el-input size="small" placeholder="请输入话题" v-model="form.title"></el-input>
<el-form-item prop="themeId" style="width: 100%;" label="话题">
<ai-select v-model="form.themeId" :selectList="talkList" placeholder="请选择话题" />
</el-form-item>
</el-form>
</template>
@@ -54,14 +54,15 @@
return {
info: {},
form: {
title: '',
themeId: '',
content: '',
files: [],
departmentName: '',
departmentIds: [],
publishDepartName: '',
publishDepartIdList: [],
},
id: '',
department: [],
talkList: []
}
},
@@ -74,13 +75,15 @@
this.id = this.params.id
this.getInfo(this.params.id)
}
this.getTalkList()
},
methods: {
getInfo (id) {
this.instance.post(`/app/appactivityinfo/queryDetailById?id=${id}`).then(res => {
this.instance.post(`/app/appneighborhoodassistance/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.form = res.data
this.form.publishDepartIdList = this.form.publishDepartId.split(',')
}
})
},
@@ -88,8 +91,9 @@
confirm () {
this.$refs.form.validate((valid) => {
if (valid) {
this.instance.post(`/app/appactivityinfo/addOrUpdate`, {
...this.form
this.instance.post(`/app/appneighborhoodassistance/addOrUpdate`, {
...this.form,
publishDepartId: this.form.publishDepartIdList.join(',')
}).then(res => {
if (res.code == 0) {
this.$message.success('提交成功')
@@ -111,13 +115,27 @@
onChange (e) {
if (e.length) {
this.form.departmentIds = e.map(v => v.id)
this.form.departmentName = e.map(v => v.name).join(',')
this.form.publishDepartIdList = e.map(v => v.id)
this.form.publishDepartName = e.map(v => v.name).join(',')
} else {
this.form.departmentIds = ''
this.form.departmentName = ''
this.form.publishDepartIdList = ''
this.form.publishDepartName = ''
}
},
getTalkList() {
this.instance.post(`/app/appneighborhoodassistancetheme/list?size=100`).then(res => {
if (res.code == 0) {
this.talkList = []
res.data.records.map((item) => {
this.talkList.push({
dictName: item.title,
dictValue: item.id
})
})
}
})
},
}
}
</script>