7 changed files with 1140 additions and 24 deletions
@ -0,0 +1,131 @@ |
|||||
|
<template> |
||||
|
<el-card shadow="never" |
||||
|
class="aui-card--fill"> |
||||
|
<div class="mod-news__group}"> |
||||
|
<el-form :inline="true" |
||||
|
:model="dataForm" |
||||
|
@keyup.enter.native="getDataList()"> |
||||
|
<el-form-item label="网格"> |
||||
|
<el-input v-model="dataForm.grid" |
||||
|
placeholder="请输入网格名称" |
||||
|
clearable></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button @click="getDataList()">{{ $t('query') }}</el-button> |
||||
|
<el-button @click="createPartys()" |
||||
|
type="primary">批量生成党员群</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<el-table v-loading="dataListLoading" |
||||
|
:data="dataList" |
||||
|
border |
||||
|
@selection-change="dataListSelectionChangeHandle" |
||||
|
style="width: 100%;"> |
||||
|
<el-table-column type="index" |
||||
|
width="50" |
||||
|
label="序号"></el-table-column> |
||||
|
<el-table-column prop="district" |
||||
|
label="市区" |
||||
|
header-align="center" |
||||
|
align="center"></el-table-column> |
||||
|
<el-table-column prop="street" |
||||
|
label="街道" |
||||
|
header-align="center" |
||||
|
align="center"></el-table-column> |
||||
|
<el-table-column prop="community" |
||||
|
label="社区" |
||||
|
header-align="center" |
||||
|
align="center"></el-table-column> |
||||
|
<el-table-column prop="grid" |
||||
|
label="网格" |
||||
|
header-align="center" |
||||
|
align="center"></el-table-column> |
||||
|
<el-table-column :label="$t('handle')" |
||||
|
fixed="right" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
width="150"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button type="text" |
||||
|
size="small" |
||||
|
@click="createParty(scope.row)">生成党员群</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<el-pagination :current-page="page" |
||||
|
:page-sizes="[10, 20, 50, 100]" |
||||
|
:page-size="limit" |
||||
|
:total="total" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
@size-change="pageSizeChangeHandle" |
||||
|
@current-change="pageCurrentChangeHandle"> |
||||
|
</el-pagination> |
||||
|
</div> |
||||
|
</el-card> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import mixinViewModule from '@/mixins/view-module' |
||||
|
export default { |
||||
|
mixins: [mixinViewModule], |
||||
|
data () { |
||||
|
return { |
||||
|
mixinViewModuleOptions: { |
||||
|
getDataListURL: '/sys/dept/queryCompleteDept', |
||||
|
getDataListIsPage: true |
||||
|
}, |
||||
|
dataForm: { |
||||
|
district: '', |
||||
|
districtId: '', |
||||
|
street: '', |
||||
|
streetId: '', |
||||
|
community: '', |
||||
|
communityId: '', |
||||
|
grid: '', |
||||
|
gridId: '' |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
createParty (row) { |
||||
|
var postForm = [{ |
||||
|
district: row.district, |
||||
|
districtId: row.districtId, |
||||
|
street: row.street, |
||||
|
streetId: row.streetId, |
||||
|
community: row.community, |
||||
|
communityId: row.communityId, |
||||
|
grid: row.grid, |
||||
|
gridId: row.gridId |
||||
|
}] |
||||
|
this.$http['post']('/property/epdc-app/group/createPartys', postForm).then(({ data: res }) => { |
||||
|
if (res.code !== 0) { |
||||
|
return this.$message.error(res.msg) |
||||
|
} |
||||
|
this.processingOpinionsVisible = false |
||||
|
this.getDataList() |
||||
|
this.$message({ |
||||
|
message: this.$t('prompt.success'), |
||||
|
type: 'success', |
||||
|
duration: 500 |
||||
|
}) |
||||
|
}).catch(() => { }) |
||||
|
}, |
||||
|
createPartys () { |
||||
|
var postForm = this.dataList |
||||
|
this.$http['post']('/property/epdc-app/group/createPartys', postForm).then(({ data: res }) => { |
||||
|
if (res.code !== 0) { |
||||
|
return this.$message.error(res.msg) |
||||
|
} |
||||
|
this.processingOpinionsVisible = false |
||||
|
this.getDataList() |
||||
|
this.$message({ |
||||
|
message: this.$t('prompt.success'), |
||||
|
type: 'success', |
||||
|
duration: 500 |
||||
|
}) |
||||
|
}).catch(() => { }) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
@ -0,0 +1,236 @@ |
|||||
|
<template> |
||||
|
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false"> |
||||
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'"> |
||||
|
<el-form-item label="社群名称" prop="groupName"> |
||||
|
<el-input v-model="dataForm.groupName" placeholder="社群名称"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="社群头像" prop="groupAvatar"> |
||||
|
<el-input v-model="dataForm.groupAvatar" placeholder="社群头像"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="社群介绍" prop="groupIntroduction"> |
||||
|
<el-input v-model="dataForm.groupIntroduction" placeholder="社群介绍"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="社群类别 0:党员群,1:自建群" prop="groupCategory"> |
||||
|
<el-input v-model="dataForm.groupCategory" placeholder="社群类别 0:党员群,1:自建群"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="物业项目ID" prop="propertyProjectId"> |
||||
|
<el-input v-model="dataForm.propertyProjectId" placeholder="物业项目ID"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="网格" prop="deptName"> |
||||
|
<el-input v-model="dataForm.deptName" placeholder="网格"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="网格ID" prop="deptId"> |
||||
|
<el-input v-model="dataForm.deptId" placeholder="网格ID"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="状态 0:待审核,5:审核不通过,10:审核通过,15:禁言,20:已解散" prop="state"> |
||||
|
<el-input v-model="dataForm.state" placeholder="状态 0:待审核,5:审核不通过,10:审核通过,15:禁言,20:已解散"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="处理意见" prop="processingOpinions"> |
||||
|
<el-input v-model="dataForm.processingOpinions" placeholder="处理意见"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="删除标记 0:未删除,1:已删除" prop="delFlag"> |
||||
|
<el-input v-model="dataForm.delFlag" placeholder="删除标记 0:未删除,1:已删除"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="乐观锁" prop="revision"> |
||||
|
<el-input v-model="dataForm.revision" placeholder="乐观锁"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="创建人" prop="createdBy"> |
||||
|
<el-input v-model="dataForm.createdBy" placeholder="创建人"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="创建时间" prop="createdTime"> |
||||
|
<el-input v-model="dataForm.createdTime" placeholder="创建时间"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="更新人" prop="updatedBy"> |
||||
|
<el-input v-model="dataForm.updatedBy" placeholder="更新人"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="更新时间" prop="updatedTime"> |
||||
|
<el-input v-model="dataForm.updatedTime" placeholder="更新时间"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="所有部门ID" prop="allDeptIds"> |
||||
|
<el-input v-model="dataForm.allDeptIds" placeholder="所有部门ID"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="所有部门名称" prop="allDeptNames"> |
||||
|
<el-input v-model="dataForm.allDeptNames" placeholder="所有部门名称"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="父所有部门" prop="parentDeptIds"> |
||||
|
<el-input v-model="dataForm.parentDeptIds" placeholder="父所有部门"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="父所有部门" prop="parentDeptNames"> |
||||
|
<el-input v-model="dataForm.parentDeptNames" placeholder="父所有部门"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="关联业务id 如:物业项目ID" prop="referenceBusinessId"> |
||||
|
<el-input v-model="dataForm.referenceBusinessId" placeholder="关联业务id 如:物业项目ID"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="所属版块编码" prop="sectionCode"> |
||||
|
<el-input v-model="dataForm.sectionCode" placeholder="所属版块编码"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="社群类别编码" prop="categoryCode"> |
||||
|
<el-input v-model="dataForm.categoryCode" placeholder="社群类别编码"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="社区部门类别" prop="typeKey"> |
||||
|
<el-input v-model="dataForm.typeKey" placeholder="社区部门类别"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template slot="footer"> |
||||
|
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> |
||||
|
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import debounce from 'lodash/debounce' |
||||
|
export default { |
||||
|
data () { |
||||
|
return { |
||||
|
visible: false, |
||||
|
dataForm: { |
||||
|
id: '', |
||||
|
groupName: '', |
||||
|
groupAvatar: '', |
||||
|
groupIntroduction: '', |
||||
|
groupCategory: '', |
||||
|
propertyProjectId: '', |
||||
|
deptName: '', |
||||
|
deptId: '', |
||||
|
state: '', |
||||
|
processingOpinions: '', |
||||
|
delFlag: '', |
||||
|
revision: '', |
||||
|
createdBy: '', |
||||
|
createdTime: '', |
||||
|
updatedBy: '', |
||||
|
updatedTime: '', |
||||
|
allDeptIds: '', |
||||
|
allDeptNames: '', |
||||
|
parentDeptIds: '', |
||||
|
parentDeptNames: '', |
||||
|
referenceBusinessId: '', |
||||
|
sectionCode: '', |
||||
|
categoryCode: '', |
||||
|
typeKey: '' |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
computed: { |
||||
|
dataRule () { |
||||
|
return { |
||||
|
groupName: [ |
||||
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
||||
|
], |
||||
|
groupAvatar: [ |
||||
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
||||
|
], |
||||
|
groupIntroduction: [ |
||||
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
||||
|
], |
||||
|
groupCategory: [ |
||||
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
||||
|
], |
||||
|
propertyProjectId: [ |
||||
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
||||
|
], |
||||
|
deptName: [ |
||||
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
||||
|
], |
||||
|
deptId: [ |
||||
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
||||
|
], |
||||
|
state: [ |
||||
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
||||
|
], |
||||
|
processingOpinions: [ |
||||
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
||||
|
], |
||||
|
delFlag: [ |
||||
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
||||
|
], |
||||
|
revision: [ |
||||
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
||||
|
], |
||||
|
createdBy: [ |
||||
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
||||
|
], |
||||
|
createdTime: [ |
||||
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
||||
|
], |
||||
|
updatedBy: [ |
||||
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
||||
|
], |
||||
|
updatedTime: [ |
||||
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
||||
|
], |
||||
|
allDeptIds: [ |
||||
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
||||
|
], |
||||
|
allDeptNames: [ |
||||
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
||||
|
], |
||||
|
parentDeptIds: [ |
||||
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
||||
|
], |
||||
|
parentDeptNames: [ |
||||
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
||||
|
], |
||||
|
referenceBusinessId: [ |
||||
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
||||
|
], |
||||
|
sectionCode: [ |
||||
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
||||
|
], |
||||
|
categoryCode: [ |
||||
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
||||
|
], |
||||
|
typeKey: [ |
||||
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
||||
|
] |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
init () { |
||||
|
this.visible = true |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs['dataForm'].resetFields() |
||||
|
if (this.dataForm.id) { |
||||
|
this.getInfo() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 获取信息 |
||||
|
getInfo () { |
||||
|
this.$http.get(`//group/${this.dataForm.id}`).then(({ data: res }) => { |
||||
|
if (res.code !== 0) { |
||||
|
return this.$message.error(res.msg) |
||||
|
} |
||||
|
this.dataForm = { |
||||
|
...this.dataForm, |
||||
|
...res.data |
||||
|
} |
||||
|
}).catch(() => {}) |
||||
|
}, |
||||
|
// 表单提交 |
||||
|
dataFormSubmitHandle: debounce(function () { |
||||
|
this.$refs['dataForm'].validate((valid) => { |
||||
|
if (!valid) { |
||||
|
return false |
||||
|
} |
||||
|
this.$http[!this.dataForm.id ? 'post' : 'put']('//group/', this.dataForm).then(({ data: res }) => { |
||||
|
if (res.code !== 0) { |
||||
|
return this.$message.error(res.msg) |
||||
|
} |
||||
|
this.$message({ |
||||
|
message: this.$t('prompt.success'), |
||||
|
type: 'success', |
||||
|
duration: 500, |
||||
|
onClose: () => { |
||||
|
this.visible = false |
||||
|
this.$emit('refreshDataList') |
||||
|
} |
||||
|
}) |
||||
|
}).catch(() => {}) |
||||
|
}) |
||||
|
}, 1000, { 'leading': true, 'trailing': false }) |
||||
|
} |
||||
|
} |
||||
|
</script> |
@ -0,0 +1,129 @@ |
|||||
|
<template> |
||||
|
<el-dialog :visible.sync="visible" |
||||
|
:title="$t('verify')" |
||||
|
:close-on-click-modal="false" |
||||
|
:close-on-press-escape="false"> |
||||
|
<el-form :label-width="$i18n.locale === 'en-US' ? '100px' : '80px'"> |
||||
|
<el-form-item label="群名称:"> |
||||
|
<div>{{dataForm.groupName}}</div> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="群主:"> |
||||
|
<div>{{dataForm.nickname}}</div> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="创建时间:"> |
||||
|
<div>{{dataForm.createdTime}}</div> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="群介绍:"> |
||||
|
<div>{{dataForm.groupIntroduction}}</div> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="处理:" |
||||
|
prop="state"> |
||||
|
<el-select v-model="dataForm.state" |
||||
|
placeholder="请选择"> |
||||
|
<el-option v-for="option in options" |
||||
|
:key="option.value" |
||||
|
:label="option.label" |
||||
|
:value="option.value"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="处理意见:" |
||||
|
prop="processingOpinions" |
||||
|
v-if="adviceVisible"> |
||||
|
<el-input v-model="dataForm.processingOpinions" |
||||
|
type="textarea" |
||||
|
placeholder="不超过500字"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template slot="footer"> |
||||
|
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> |
||||
|
<el-button type="primary" |
||||
|
@click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import debounce from 'lodash/debounce' |
||||
|
export default { |
||||
|
data () { |
||||
|
return { |
||||
|
visible: false, |
||||
|
adviceVisible: false, |
||||
|
dataForm: { |
||||
|
id: '', |
||||
|
groupName: '', |
||||
|
createdTime: '', |
||||
|
groupIntroduction: '', |
||||
|
nickname: '', |
||||
|
state: '10', |
||||
|
processingOpinions: '' |
||||
|
}, |
||||
|
options: [{ |
||||
|
value: '10', |
||||
|
label: '通过' |
||||
|
}, { |
||||
|
value: '5', |
||||
|
label: '拒绝' |
||||
|
}] |
||||
|
} |
||||
|
}, |
||||
|
watch: { |
||||
|
'dataForm.state': function (val) { |
||||
|
if (val === '10') { |
||||
|
this.adviceVisible = false |
||||
|
} else { |
||||
|
this.adviceVisible = true |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
init () { |
||||
|
this.visible = true |
||||
|
this.$nextTick(() => { |
||||
|
if (this.dataForm.id) { |
||||
|
this.getInfo() |
||||
|
this.dataForm.state = '10' |
||||
|
this.dataForm.processingOpinions = '' |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
getInfo () { |
||||
|
this.$http.get(`/property/group/detail/${this.dataForm.id}`).then(({ data: res }) => { |
||||
|
if (res.code !== 0) { |
||||
|
return this.$message.error(res.msg) |
||||
|
} |
||||
|
this.dataForm = { |
||||
|
...this.dataForm, |
||||
|
...res.data |
||||
|
} |
||||
|
}).catch(() => { }) |
||||
|
}, |
||||
|
dataFormSubmitHandle: debounce(function () { |
||||
|
if (this.adviceVisible) { |
||||
|
if (this.dataForm.processingOpinions === '') { |
||||
|
return this.$message.error('处理意见不能为空') |
||||
|
} |
||||
|
if (this.dataForm.processingOpinions > 500) { |
||||
|
return this.$message.error('处理意见不能超过500字') |
||||
|
} |
||||
|
} |
||||
|
this.$http['post']( |
||||
|
'/property/group/operate', this.dataForm).then(({ data: res }) => { |
||||
|
if (res.code !== 0) { |
||||
|
return this.$message.error(res.msg) |
||||
|
} |
||||
|
this.$message({ |
||||
|
message: this.$t('prompt.success'), |
||||
|
type: 'success', |
||||
|
duration: 500, |
||||
|
onClose: () => { |
||||
|
this.visible = false |
||||
|
this.$emit('refreshDataList') |
||||
|
} |
||||
|
}) |
||||
|
}).catch(() => { }) |
||||
|
}, 1000, { 'leading': true, 'trailing': false }) |
||||
|
} |
||||
|
} |
||||
|
</script> |
@ -0,0 +1,217 @@ |
|||||
|
<template> |
||||
|
<el-dialog :visible.sync="visible" |
||||
|
:title="$t('look')" |
||||
|
:close-on-click-modal="false" |
||||
|
:close-on-press-escape="false"> |
||||
|
<el-form :label-width="$i18n.locale === 'en-US' ? '100px' : '80px'"> |
||||
|
<el-form-item label="群介绍:"> |
||||
|
<div>{{responseForm.groupIntroduction}}</div> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="状态:"> |
||||
|
<div v-if="responseForm.state === 0">待审核</div> |
||||
|
<div v-if="responseForm.state === 5">审核不通过</div> |
||||
|
<div v-if="responseForm.state === 10">审核通过</div> |
||||
|
<div v-if="responseForm.state === 15">禁言</div> |
||||
|
<div v-if="responseForm.state === 20">已解散</div> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="备注:" |
||||
|
v-if="responseForm.state === 5 || responseForm.state === 20"> |
||||
|
<div>{{responseForm.processingOpinions}}</div> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<el-form :inline="true" |
||||
|
:model="dataForm" |
||||
|
ref="dataForm"> |
||||
|
<el-form-item> |
||||
|
<el-input v-model="dataForm.nickname" |
||||
|
placeholder="姓名" |
||||
|
clearable></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-input v-model="dataForm.mobile" |
||||
|
placeholder="电话" |
||||
|
clearable></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="状态"> |
||||
|
<el-select v-model="dataForm.state" |
||||
|
clearable |
||||
|
placeholder="请选择"> |
||||
|
<el-option v-for="item in stateOptions" |
||||
|
:key="item.id" |
||||
|
:label="item.name" |
||||
|
:value="item.id"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button @click="getDataList()">{{ $t('query') }}</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<el-table v-loading="dataListLoading" |
||||
|
:data="dataList" |
||||
|
border |
||||
|
@selection-change="dataListSelectionChangeHandle" |
||||
|
style="width: 100%;"> |
||||
|
<el-table-column type="index" |
||||
|
width="50" |
||||
|
label="序号"></el-table-column> |
||||
|
<el-table-column prop="nickname" |
||||
|
label="成员名称" |
||||
|
header-align="center" |
||||
|
align="center"></el-table-column> |
||||
|
<el-table-column prop="lordFlag" |
||||
|
label="群主标识" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
:formatter="formatterLoadFlag"></el-table-column> |
||||
|
<el-table-column prop="mobile" |
||||
|
label="联系电话" |
||||
|
header-align="center" |
||||
|
align="center"></el-table-column> |
||||
|
<el-table-column :label="$t('handle')" |
||||
|
fixed="right" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
width="150"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button v-if="(scope.row.state == 10||scope.row.state == 0)&&scope.row.lordFlag==0" |
||||
|
type="text" |
||||
|
size="small" |
||||
|
@click="toBecomeAdmin(scope.row)">指定群主</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<el-pagination :current-page="page" |
||||
|
:page-sizes="[10, 20, 50, 100]" |
||||
|
:page-size="limit" |
||||
|
:total="total" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
@size-change="pageSizeChangeHandle" |
||||
|
@current-change="pageCurrentChangeHandle"> |
||||
|
</el-pagination> |
||||
|
<template slot="footer"> |
||||
|
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import mixinViewModule from '@/mixins/view-module' |
||||
|
export default { |
||||
|
mixins: [mixinViewModule], |
||||
|
data () { |
||||
|
return { |
||||
|
mixinViewModuleOptions: { |
||||
|
getDataListURL: '/property/usergroup/page', |
||||
|
getDataListIsPage: true |
||||
|
}, |
||||
|
visible: false, |
||||
|
dataForm: { |
||||
|
groupId: '', |
||||
|
nickname: '', |
||||
|
state: '10' |
||||
|
}, |
||||
|
responseForm: { |
||||
|
id: '', |
||||
|
groupIntroduction: '', |
||||
|
state: '', |
||||
|
processingOpinions: '' |
||||
|
}, |
||||
|
stateOptions: [{ |
||||
|
id: '0', |
||||
|
name: '待审核' |
||||
|
}, { |
||||
|
id: '5', |
||||
|
name: '审核不通过' |
||||
|
}, { |
||||
|
id: '10', |
||||
|
name: '审核通过' |
||||
|
}, { |
||||
|
id: '15', |
||||
|
name: '已退群' |
||||
|
}, { |
||||
|
id: '20', |
||||
|
name: '已移除' |
||||
|
}], |
||||
|
checkDto: { |
||||
|
id: '', |
||||
|
groupId: '' |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
init () { |
||||
|
this.visible = true |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs['dataForm'].resetFields() |
||||
|
if (this.dataForm.groupId) { |
||||
|
this.getInfo() |
||||
|
this.getDataList() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 获取信息 |
||||
|
getInfo () { |
||||
|
this.$http.get(`/property/group/${this.dataForm.groupId}`).then(({ data: res }) => { |
||||
|
if (res.code !== 0) { |
||||
|
return this.$message.error(res.msg) |
||||
|
} |
||||
|
this.responseForm = { |
||||
|
...this.responseForm, |
||||
|
...res.data |
||||
|
} |
||||
|
}).catch(() => { }) |
||||
|
}, |
||||
|
// 群主标识 0:否,1:是 |
||||
|
formatterLoadFlag: function (row, column) { |
||||
|
let lordFlag = row.lordFlag |
||||
|
if (lordFlag === '0') { |
||||
|
return '否' |
||||
|
} else if (lordFlag === '1') { |
||||
|
return '是' |
||||
|
} |
||||
|
}, |
||||
|
toBecomeAdmin (row) { |
||||
|
this.checkDto.id = row.id |
||||
|
this.checkDto.groupId = row.groupId |
||||
|
this.$http.post(`/property/usergroup/checkGroupOwner`, this.checkDto).then(({ data: res }) => { |
||||
|
if (res.code !== 0) { |
||||
|
return this.$message.error(res.msg) |
||||
|
} |
||||
|
if (res.data.resultCode === 1) { |
||||
|
this.$confirm(res.data.resultMessage, '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
this.$http.post(`/property/usergroup/toBecomeGroupOwner`, this.checkDto).then(({ data: res }) => { |
||||
|
if (res.code !== 0) { |
||||
|
return this.$message.error(res.msg) |
||||
|
} |
||||
|
this.getDataList() |
||||
|
this.$message({ |
||||
|
message: this.$t('prompt.success'), |
||||
|
type: 'success', |
||||
|
duration: 500 |
||||
|
}) |
||||
|
}).catch(() => { }) |
||||
|
}).catch(() => { }) |
||||
|
} else { |
||||
|
this.$http.post(`/property/usergroup/toBecomeGroupOwner`, this.checkDto).then(({ data: res }) => { |
||||
|
if (res.code !== 0) { |
||||
|
return this.$message.error(res.msg) |
||||
|
} |
||||
|
this.getDataList() |
||||
|
this.$message({ |
||||
|
message: this.$t('prompt.success'), |
||||
|
type: 'success', |
||||
|
duration: 500 |
||||
|
}) |
||||
|
}).catch(() => { }) |
||||
|
} |
||||
|
}).catch(() => { }) |
||||
|
this.getDataList() |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
@ -0,0 +1,363 @@ |
|||||
|
<template> |
||||
|
<el-card shadow="never" |
||||
|
class="aui-card--fill"> |
||||
|
<div class="mod-news__group}"> |
||||
|
<el-form :inline="true" |
||||
|
:model="dataForm" |
||||
|
@keyup.enter.native="getDataList()"> |
||||
|
<el-form-item label="所属机构"> |
||||
|
<el-cascader v-model="ids" |
||||
|
:options="options" |
||||
|
:props="{ checkStrictly: true }" |
||||
|
clearable> |
||||
|
</el-cascader> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="状态"> |
||||
|
<el-select v-model="dataForm.state" |
||||
|
clearable |
||||
|
placeholder="请选择"> |
||||
|
<el-option v-for="item in stateOptions" |
||||
|
:key="item.id" |
||||
|
:label="item.name" |
||||
|
:value="item.id"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button @click="getDataList()">{{ $t('query') }}</el-button> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button v-if="$hasPermission('activity:group:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<el-table v-loading="dataListLoading" |
||||
|
:data="dataList" |
||||
|
border |
||||
|
@selection-change="dataListSelectionChangeHandle" |
||||
|
style="width: 100%;"> |
||||
|
<el-table-column type="index" |
||||
|
width="50" |
||||
|
label="序号"></el-table-column> |
||||
|
<el-table-column prop="groupName" |
||||
|
label="群名称" |
||||
|
header-align="center" |
||||
|
align="center"></el-table-column> |
||||
|
<el-table-column prop="groupCategory" |
||||
|
label="性质" |
||||
|
header-align="center" |
||||
|
:formatter="formatGroupCategory" |
||||
|
align="center"></el-table-column> |
||||
|
<el-table-column prop="createdTime" |
||||
|
label="创建时间" |
||||
|
header-align="center" |
||||
|
align="center"></el-table-column> |
||||
|
<el-table-column prop="nickname" |
||||
|
label="群主" |
||||
|
header-align="center" |
||||
|
align="center"></el-table-column> |
||||
|
<el-table-column prop="state" |
||||
|
label="状态" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
:formatter="formatState"></el-table-column> |
||||
|
<el-table-column :label="$t('handle')" |
||||
|
fixed="right" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
width="150"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button v-if="scope.row.state === 0" |
||||
|
type="text" |
||||
|
size="small" |
||||
|
@click="verify(scope.row.id)">{{ $t('verify') }}</el-button> |
||||
|
<el-button v-if="scope.row.state != 0" |
||||
|
type="text" |
||||
|
size="small" |
||||
|
@click="look(scope.row.id)">{{ $t('look') }}</el-button> |
||||
|
<el-button v-if="scope.row.state === 10" |
||||
|
type="text" |
||||
|
size="small" |
||||
|
@click="ban(scope.row.id)">{{ $t('ban') }}</el-button> |
||||
|
<el-button v-if="scope.row.state === 15" |
||||
|
type="text" |
||||
|
size="small" |
||||
|
@click="liftTheBan(scope.row.id)">{{ $t('liftTheBan') }}</el-button> |
||||
|
<el-button v-if="(scope.row.state === 10 || scope.row.state === 15) && scope.row.groupCategory !=='0'" |
||||
|
type="text" |
||||
|
size="small" |
||||
|
@click="handDisband(scope.row.id)">{{ $t('disband') }}</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<el-pagination :current-page="page" |
||||
|
:page-sizes="[10, 20, 50, 100]" |
||||
|
:page-size="limit" |
||||
|
:total="total" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
@size-change="pageSizeChangeHandle" |
||||
|
@current-change="pageCurrentChangeHandle"> |
||||
|
</el-pagination> |
||||
|
<!-- 弹窗, 新增 / 修改 --> |
||||
|
<group-detail v-if="groupDetailVisible" |
||||
|
ref="groupDetail" |
||||
|
@refreshDataList="getDataList"></group-detail> |
||||
|
<group-approve v-if="groupApproveVisible" |
||||
|
ref="groupApprove" |
||||
|
@refreshDataList="getDataList"></group-approve> |
||||
|
|
||||
|
<!-- 解散原因弹框 --> |
||||
|
<el-dialog :visible.sync="processingOpinionsVisible" |
||||
|
v-if="processingOpinionsVisible" |
||||
|
title="解散社群"> |
||||
|
<el-form :model="postForm" |
||||
|
:rules="dataRule" |
||||
|
ref="postForm" |
||||
|
:label-width="$i18n.locale === 'en-US' ? '150px' : '100px'"> |
||||
|
<el-form-item label="社群ID:" |
||||
|
v-if="false"> |
||||
|
<el-input v-model="postForm.id" |
||||
|
type="textarea" |
||||
|
placeholder="不超过500字"> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="社群状态:" |
||||
|
v-if="false"> |
||||
|
<el-input v-model="postForm.state" |
||||
|
type="textarea" |
||||
|
placeholder="不超过500字"> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="解散原因:" |
||||
|
prop="processingOpinions"> |
||||
|
<el-input v-model="postForm.processingOpinions" |
||||
|
type="textarea" |
||||
|
placeholder="不超过500字"> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template slot="footer"> |
||||
|
<el-button @click="cancelDisBand">{{ $t('cancel') }}</el-button> |
||||
|
<el-button type="primary" |
||||
|
@click="confirmDisBand">确定</el-button> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
<!-- 弹窗, 新增 / 修改 --> |
||||
|
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> |
||||
|
</div> |
||||
|
</el-card> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import mixinViewModule from '@/mixins/view-module' |
||||
|
import GroupDetail from './group-detail' |
||||
|
import GroupApprove from './group-approve' |
||||
|
import AddOrUpdate from './group-add-or-update' |
||||
|
export default { |
||||
|
mixins: [mixinViewModule], |
||||
|
data () { |
||||
|
return { |
||||
|
mixinViewModuleOptions: { |
||||
|
getDataListURL: '/property/group/interestpage', |
||||
|
getDataListIsPage: true |
||||
|
}, |
||||
|
groupDetailVisible: false, |
||||
|
groupApproveVisible: false, |
||||
|
processingOpinionsVisible: false, // 解散原因弹框显示标识 |
||||
|
dataForm: { |
||||
|
id: '', |
||||
|
streetId: '', |
||||
|
communityId: '', |
||||
|
gridId: '', |
||||
|
state: '10' |
||||
|
}, |
||||
|
postForm: { |
||||
|
id: '', |
||||
|
state: 0, |
||||
|
processingOpinions: ''// 解散原因 |
||||
|
}, |
||||
|
ids: [], |
||||
|
options: [], |
||||
|
stateOptions: [{ |
||||
|
id: '10', |
||||
|
name: '正常' |
||||
|
}, { |
||||
|
id: '15', |
||||
|
name: '禁言' |
||||
|
}, { |
||||
|
id: '20', |
||||
|
name: '已解散' |
||||
|
}] |
||||
|
} |
||||
|
}, |
||||
|
computed: { |
||||
|
dataRule () { |
||||
|
return { |
||||
|
processingOpinions: [ |
||||
|
{ required: true, message: '解散原因不能为空', trigger: 'blur' } |
||||
|
] |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
components: { |
||||
|
GroupDetail, |
||||
|
GroupApprove, |
||||
|
AddOrUpdate |
||||
|
}, |
||||
|
created: function () { |
||||
|
this.getOptions() |
||||
|
}, |
||||
|
watch: { |
||||
|
'ids': function (val) { |
||||
|
if (val.length === 0) { |
||||
|
this.dataForm.streetId = '' |
||||
|
this.dataForm.communityId = '' |
||||
|
this.dataForm.gridId = '' |
||||
|
} |
||||
|
if (val.length === 1) { |
||||
|
this.dataForm.streetId = this.ids[0] |
||||
|
} |
||||
|
if (val.length === 2) { |
||||
|
this.dataForm.streetId = this.ids[0] |
||||
|
this.dataForm.communityId = this.ids[1] |
||||
|
} |
||||
|
if (val.length === 3) { |
||||
|
this.dataForm.streetId = this.ids[0] |
||||
|
this.dataForm.communityId = this.ids[1] |
||||
|
this.dataForm.gridId = this.ids[2] |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
formatState: function (row, column) { |
||||
|
if (row.state === 10) { |
||||
|
return '正常' |
||||
|
} |
||||
|
if (row.state === 15) { |
||||
|
return '禁言' |
||||
|
} |
||||
|
if (row.state === 20) { |
||||
|
return '已解散' |
||||
|
} |
||||
|
}, |
||||
|
formatGroupCategory: function (row, column) { |
||||
|
return row.groupCategory === '0' ? '党员群' : row.groupCategory === '1' ? '自建群' : row.groupCategory === '2' ? '物业群' : row.groupCategory === '3' ? '警民群' : '未知' |
||||
|
}, |
||||
|
ban (id) { |
||||
|
this.$confirm('确定禁言社群?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
this.postForm.state = 15 |
||||
|
this.postForm.id = id |
||||
|
this.$http['post']('/property/group/operate', this.postForm).then(({ data: res }) => { |
||||
|
if (res.code !== 0) { |
||||
|
return this.$message.error(res.msg) |
||||
|
} |
||||
|
this.getDataList() |
||||
|
this.$message({ |
||||
|
message: this.$t('prompt.success'), |
||||
|
type: 'success', |
||||
|
duration: 500 |
||||
|
}) |
||||
|
}).catch(() => { }) |
||||
|
}).catch(() => { }) |
||||
|
}, |
||||
|
liftTheBan (id) { |
||||
|
this.$confirm('确定解禁社群?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
this.postForm.state = 10 |
||||
|
this.postForm.id = id |
||||
|
this.$http['post']('/property/group/operate', this.postForm).then(({ data: res }) => { |
||||
|
if (res.code !== 0) { |
||||
|
return this.$message.error(res.msg) |
||||
|
} |
||||
|
this.getDataList() |
||||
|
this.$message({ |
||||
|
message: this.$t('prompt.success'), |
||||
|
type: 'success', |
||||
|
duration: 500 |
||||
|
}) |
||||
|
}).catch(() => { }) |
||||
|
}).catch(() => { }) |
||||
|
}, |
||||
|
disband (id) { |
||||
|
this.$confirm('确定解散社群?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
this.postForm.state = 20 |
||||
|
this.postForm.id = id |
||||
|
this.$http['post']('/property/group/operate', this.postForm).then(({ data: res }) => { |
||||
|
if (res.code !== 0) { |
||||
|
return this.$message.error(res.msg) |
||||
|
} |
||||
|
this.getDataList() |
||||
|
this.$message({ |
||||
|
message: this.$t('prompt.success'), |
||||
|
type: 'success', |
||||
|
duration: 500 |
||||
|
}) |
||||
|
}).catch(() => { }) |
||||
|
}).catch(() => { }) |
||||
|
}, |
||||
|
look (id) { |
||||
|
this.groupDetailVisible = true |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.groupDetail.dataForm.groupId = id |
||||
|
this.$refs.groupDetail.init() |
||||
|
}) |
||||
|
}, |
||||
|
verify (id) { |
||||
|
this.groupApproveVisible = true |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.groupApprove.dataForm.id = id |
||||
|
this.$refs.groupApprove.init() |
||||
|
}) |
||||
|
}, |
||||
|
getOptions () { |
||||
|
this.$http.get(`/sys/user/deptOptions/getByLoginUser`).then(({ data: res }) => { |
||||
|
if (res.code !== 0) { |
||||
|
return this.$message.error(res.msg) |
||||
|
} |
||||
|
this.options = res.data.options |
||||
|
}).catch(() => { }) |
||||
|
}, |
||||
|
handDisband (id) { |
||||
|
this.postForm.state = 20 |
||||
|
this.postForm.id = id |
||||
|
this.postForm.processingOpinions = '' |
||||
|
this.processingOpinionsVisible = true |
||||
|
}, |
||||
|
confirmDisBand () { |
||||
|
if (this.postForm.processingOpinions == null || this.postForm.processingOpinions === '') { |
||||
|
return this.$message.error('请填写解散原因') |
||||
|
} |
||||
|
if (this.postForm.processingOpinions.length > 500) { |
||||
|
return this.$message.error('解散原因不能超过500字') |
||||
|
} |
||||
|
this.$http['post']('/property/group/operate', this.postForm).then(({ data: res }) => { |
||||
|
if (res.code !== 0) { |
||||
|
return this.$message.error(res.msg) |
||||
|
} |
||||
|
this.processingOpinionsVisible = false |
||||
|
this.getDataList() |
||||
|
this.$message({ |
||||
|
message: this.$t('prompt.success'), |
||||
|
type: 'success', |
||||
|
duration: 500 |
||||
|
}) |
||||
|
}).catch(() => { }) |
||||
|
}, |
||||
|
cancelDisBand () { |
||||
|
console.log(this.$refs['postForm']) |
||||
|
this.$refs['postForm'].resetFields() |
||||
|
this.processingOpinionsVisible = false |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
Loading…
Reference in new issue