Browse Source

党员相关 数据结构

master
qushutong 6 years ago
parent
commit
aaf6ce22ed
  1. 129
      src/views/modules/group/group.vue
  2. 147
      src/views/modules/user/partymembers-add-or-update.vue
  3. 102
      src/views/modules/user/partymembers.vue

129
src/views/modules/group/group.vue

@ -1,13 +1,20 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<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 :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 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
<el-select v-model="dataForm.state"
clearable
placeholder="请选择">
<el-option v-for="item in stateOptions"
:key="item.id"
@ -20,35 +27,80 @@
<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="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">
<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" type="text" size="small" @click="disband(scope.row.id)">{{ $t('disband') }}</el-button>
<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"
type="text"
size="small"
@click="disband(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 :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>
<group-detail v-if="groupDetailVisible"
ref="groupDetail"
@refreshDataList="getDataList"></group-detail>
<group-approve v-if="groupApproveVisible"
ref="groupApprove"
@refreshDataList="getDataList"></group-approve>
</div>
</el-card>
</template>
@ -107,14 +159,14 @@ export default {
},
watch: {
'ids': function (val) {
if (val.length === 1){
if (val.length === 1) {
this.dataForm.streetId = this.ids[0]
}
if (val.length === 2){
if (val.length === 2) {
this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1]
}
if (val.length === 3){
if (val.length === 3) {
this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1]
this.dataForm.gridId = this.ids[2]
@ -145,8 +197,7 @@ export default {
ban (id) {
this.postForm.state = 15
this.postForm.id = id
this.$http['post'](
'/group/group/operate', this.postForm).then(({ data: res }) => {
this.$http['post']('/group/group/operate', this.postForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
@ -156,13 +207,12 @@ export default {
type: 'success',
duration: 500
})
}).catch(() => {})
}).catch(() => { })
},
liftTheBan (id) {
this.postForm.state = 10
this.postForm.id = id
this.$http['post'](
'/group/group/operate', this.postForm).then(({ data: res }) => {
this.$http['post']('/group/group/operate', this.postForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
@ -172,13 +222,12 @@ export default {
type: 'success',
duration: 500
})
}).catch(() => {})
}).catch(() => { })
},
disband (id) {
this.postForm.state = 20
this.postForm.id = id
this.$http['post'](
'/group/group/operate', this.postForm).then(({ data: res }) => {
this.$http['post']('/group/group/operate', this.postForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
@ -188,7 +237,7 @@ export default {
type: 'success',
duration: 500
})
}).catch(() => {})
}).catch(() => { })
},
look (id) {
this.groupDetailVisible = true
@ -210,7 +259,7 @@ export default {
return this.$message.error(res.msg)
}
this.options = res.data.options
}).catch(() => {})
}).catch(() => { })
}
}
}

147
src/views/modules/user/partymembers-add-or-update.vue

@ -23,7 +23,7 @@
<el-input v-model="dataForm.identityNo"
placeholder="身份证号"></el-input>
</el-form-item>
<el-form-item label="街道党工委"
<!-- <el-form-item label="街道党工委"
label-width='auto'
prop="streetId">
<el-select v-model="dataForm.streetId"
@ -35,9 +35,13 @@
:value="item.id">
</el-option>
</el-select>
</el-form-item> -->
<el-form-item label="所属网格">
<el-cascader v-model="dataForm.allDeptIds"
:options="options"
clearable></el-cascader>
</el-form-item>
<el-form-item label="社区党委"
prop="communityId">
<!-- <el-form-item label="社区党委">
<el-select v-model="dataForm.communityId"
placeholder="请选择"
@change="getGridList">
@ -49,8 +53,7 @@
</el-select>
</el-form-item>
<el-form-item label="网格党支部"
label-width='auto'
prop="gridId">
label-width='auto'>
<el-select v-model="dataForm.gridId"
placeholder="请选择"
@change="evaluation">
@ -60,9 +63,8 @@
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="干部下沉"
prop="cadreFlag">
</el-form-item> -->
<el-form-item label="干部下沉">
<el-select v-model="dataForm.cadreFlag"
placeholder="请选择">
<el-option v-for="item in cadreOptions"
@ -72,8 +74,7 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="用户标签"
prop="tagIds">
<el-form-item label="用户标签">
<el-checkbox-group v-model="dataForm.tagIds">
<el-checkbox v-for="item in tagOptions"
:key="item.tagName"
@ -107,13 +108,20 @@ export default {
communityName: '',
gridId: '',
gridName: '',
tagIds: []
tagIds: [],
allDeptIds: []
},
streetOptions: [],
communityOptions: [],
gridOptions: [],
cadreOptions: [{ cadreFlag: '1', cadreTitle: '是' }, { cadreFlag: '0', cadreTitle: '否' }],
tagOptions: []
tagOptions: [],
options: []
}
},
watch: {
'dataForm.allDeptIds': function (val) {
console.log(this.dataForm.allDeptIds)
}
},
computed: {
@ -130,34 +138,37 @@ export default {
],
streetId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
communityId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
gridId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
cadreFlag: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
tagIds: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
},
methods: {
init () {
this.getStreetList()
// this.getStreetList()
this.getTagOptions()
this.getByLoginUser()
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
} else {
this.dataForm.allDeptIds = []
this.dataForm.cadreFlag = []
}
})
},
getByLoginUser () {
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(() => { })
},
getTagOptions () {
this.$http.get(`/app-user/usertag/list`).then(({ data: res }) => {
if (res.code !== 0) {
@ -166,37 +177,37 @@ export default {
this.tagOptions = res.data
}).catch(() => { })
},
getStreetList () {
this.$http.get(`/sys/dept/sublist/` + (localStorage.getItem('street') === null ? '1169154711480528897' : localStorage.getItem('street'))).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.streetOptions = res.data
}).catch(() => { })
},
getCommunityList () {
let choosenItem = this.streetOptions.filter(item => item.id === this.dataForm.streetId)[0]
this.dataForm.streetName = choosenItem.name
this.dataForm.communityId = ''
this.dataForm.gridId = ''
this.$http.get(`/sys/dept/sublist/` + this.dataForm.streetId).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.communityOptions = res.data
}).catch(() => { })
},
getGridList () {
let choosenItem = this.communityOptions.filter(item => item.id === this.dataForm.communityId)[0]
this.dataForm.communityName = choosenItem.name
this.dataForm.gridId = ''
this.$http.get(`/sys/dept/sublist/` + this.dataForm.communityId).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.gridOptions = res.data
}).catch(() => { })
},
// getStreetList () {
// this.$http.get(`/sys/dept/sublist/` + (localStorage.getItem('street') === null ? '1169154711480528897' : localStorage.getItem('street'))).then(({ data: res }) => {
// if (res.code !== 0) {
// return this.$message.error(res.msg)
// }
// this.streetOptions = res.data
// }).catch(() => { })
// },
// getCommunityList () {
// let choosenItem = this.streetOptions.filter(item => item.id === this.dataForm.streetId)[0]
// this.dataForm.streetName = choosenItem.name
// this.dataForm.communityId = ''
// this.dataForm.gridId = ''
// this.$http.get(`/sys/dept/sublist/` + this.dataForm.streetId).then(({ data: res }) => {
// if (res.code !== 0) {
// return this.$message.error(res.msg)
// }
// this.communityOptions = res.data
// }).catch(() => { })
// },
// getGridList () {
// let choosenItem = this.communityOptions.filter(item => item.id === this.dataForm.communityId)[0]
// this.dataForm.communityName = choosenItem.name
// this.dataForm.gridId = ''
// this.$http.get(`/sys/dept/sublist/` + this.dataForm.communityId).then(({ data: res }) => {
// if (res.code !== 0) {
// return this.$message.error(res.msg)
// }
// this.gridOptions = res.data
// }).catch(() => { })
// },
evaluation () {
let choosenItem = this.gridOptions.filter(item => item.id === this.dataForm.gridId)[0]
this.dataForm.gridName = choosenItem.name
@ -212,18 +223,18 @@ export default {
...res.data
}
this.dataForm.tagIds = res.data.tagIdsNew
this.$http.get(`/sys/dept/sublist/` + this.dataForm.streetId).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.communityOptions = res.data
}).catch(() => { })
this.$http.get(`/sys/dept/sublist/` + this.dataForm.communityId).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.gridOptions = res.data
}).catch(() => { })
// this.$http.get(`/sys/dept/sublist/` + this.dataForm.streetId).then(({ data: res }) => {
// if (res.code !== 0) {
// return this.$message.error(res.msg)
// }
// this.communityOptions = res.data
// }).catch(() => { })
// this.$http.get(`/sys/dept/sublist/` + this.dataForm.communityId).then(({ data: res }) => {
// if (res.code !== 0) {
// return this.$message.error(res.msg)
// }
// this.gridOptions = res.data
// }).catch(() => { })
}).catch(() => { })
},
//

102
src/views/modules/user/partymembers.vue

@ -5,7 +5,14 @@
<el-form :inline="true"
:model="dataForm"
@keyup.enter.native="getDataList()">
<el-form-item label="街道">
<el-form-item label="所属机构">
<el-cascader v-model="deptIdList"
:options="options"
:props="{ checkStrictly: true }"
clearable>
</el-cascader>
</el-form-item>
<!-- <el-form-item label="街道">
<el-select v-model="dataForm.streetId"
clearable
placeholder="请选择"
@ -39,7 +46,7 @@
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-form-item> -->
<el-form-item label="注册状态">
<el-select v-model="dataForm.registFlag"
clearable
@ -167,18 +174,8 @@
label="注册时间"
header-align="center"
align="center"></el-table-column>
<el-table-column prop="streetName"
label="街道党工委"
header-align="center"
align="center"></el-table-column>
<el-table-column prop="communityName"
label="社区党委"
header-align="center"
align="center"></el-table-column>
<el-table-column prop="gridName"
label="网格党支部"
header-align="center"
align="center"></el-table-column>
<el-table-column prop="allDeptNames"
label="街道-社区-网格"> </el-table-column>
<el-table-column :label="$t('handle')"
fixed="right"
header-align="center"
@ -261,24 +258,59 @@ export default {
startTime: '',
endTime: ''
},
streetOptions: [],
// streetOptions: [],
communityOptions: [],
gridOptions: [],
registOptions: [],
postOptions: [],
// postOptions: [],
timeRange: [],
upLoadUrl: '',
faultDataVisible: false,
errordataList: []
errordataList: [],
options: [],
deptIdList: []
}
},
components: {
AddOrUpdate
},
watch: {
'deptIdList': function (val) {
if (val.length === 0) {
this.dataForm.streetId = ''
this.dataForm.communityId = ''
this.dataForm.gridId = ''
}
if (val.length === 1) {
this.dataForm.streetId = this.deptIdList[0]
this.dataForm.communityId = ''
this.dataForm.gridId = ''
}
if (val.length === 2) {
this.dataForm.streetId = this.deptIdList[0]
this.dataForm.communityId = this.deptIdList[1]
this.dataForm.gridId = ''
}
if (val.length === 3) {
this.dataForm.streetId = this.deptIdList[0]
this.dataForm.communityId = this.deptIdList[1]
this.dataForm.gridId = this.deptIdList[2]
}
}
},
created: function () {
this.getStreetList()
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(() => { })
// this.getStreetList()
this.getRegistOptions()
this.getPostOptions()
// this.getPostOptions()
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/app-user/partymembers/importExcel?token=${Cookies.get('token')}`
},
methods: {
@ -286,14 +318,14 @@ export default {
this.dataForm.startTime = this.timeRange[0]
this.dataForm.endTime = this.timeRange[1]
},
getStreetList () {
this.$http.get(`/sys/dept/sublist/` + (localStorage.getItem('street') === null ? '1169154711480528897' : localStorage.getItem('street'))).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.streetOptions = res.data
}).catch(() => { })
},
// getStreetList () {
// this.$http.get(`/sys/dept/sublist/` + (localStorage.getItem('street') === null ? '1169154711480528897' : localStorage.getItem('street'))).then(({ data: res }) => {
// if (res.code !== 0) {
// return this.$message.error(res.msg)
// }
// this.streetOptions = res.data
// }).catch(() => { })
// },
getCommunityList () {
if (this.dataForm.streetId === '') {
this.communityOptions = []
@ -333,14 +365,14 @@ export default {
this.registOptions = res.data
}).catch(() => { })
},
getPostOptions () {
this.$http.get(`/sys/dict/sublist/1168770417290366977`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.postOptions = res.data
}).catch(() => { })
},
// getPostOptions () {
// this.$http.get(`/sys/dict/sublist/1168770417290366977`).then(({ data: res }) => {
// if (res.code !== 0) {
// return this.$message.error(res.msg)
// }
// this.postOptions = res.data
// }).catch(() => { })
// },
formatCadre: function (row, column) {
return row.cadreFlag === '1' ? '是' : row.cadreFlag === '0' ? '否' : '未知'
},

Loading…
Cancel
Save