Browse Source

党员相关 数据结构

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

117
src/views/modules/group/group.vue

@ -1,13 +1,20 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never"
class="aui-card--fill">
<div class="mod-news__group}"> <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-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-cascader>
</el-form-item> </el-form-item>
<el-form-item label="状态"> <el-form-item label="状态">
<el-select v-model="dataForm.state" clearable <el-select v-model="dataForm.state"
clearable
placeholder="请选择"> placeholder="请选择">
<el-option v-for="item in stateOptions" <el-option v-for="item in stateOptions"
:key="item.id" :key="item.id"
@ -20,25 +27,66 @@
<el-button @click="getDataList()">{{ $t('query') }}</el-button> <el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;"> <el-table v-loading="dataListLoading"
<el-table-column type="index" width="50" label="序号"></el-table-column> :data="dataList"
<el-table-column prop="groupName" label="社群名称" header-align="center" align="center"></el-table-column> border
<el-table-column prop="groupCategory" label="性质" header-align="center" :formatter="formatGroupCategory" align="center"></el-table-column> @selection-change="dataListSelectionChangeHandle"
<el-table-column prop="createdTime" label="创建时间" header-align="center" align="center"></el-table-column> style="width: 100%;">
<el-table-column prop="nickname" label="群主" header-align="center" align="center"></el-table-column> <el-table-column type="index"
<el-table-column prop="state" label="状态" header-align="center" align="center" :formatter="formatState"></el-table-column> width="50"
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> 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"> <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"
<el-button v-if="scope.row.state != 0" type="text" size="small" @click="look(scope.row.id)">{{ $t('look') }}</el-button> type="text"
<el-button v-if="scope.row.state === 10" type="text" size="small" @click="ban(scope.row.id)">{{ $t('ban') }}</el-button> size="small"
<el-button v-if="scope.row.state === 15" type="text" size="small" @click="liftTheBan(scope.row.id)">{{ $t('liftTheBan') }}</el-button> @click="verify(scope.row.id)">{{ $t('verify') }}</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="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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination <el-pagination :current-page="page"
:current-page="page"
:page-sizes="[10, 20, 50, 100]" :page-sizes="[10, 20, 50, 100]"
:page-size="limit" :page-size="limit"
:total="total" :total="total"
@ -47,8 +95,12 @@
@current-change="pageCurrentChangeHandle"> @current-change="pageCurrentChangeHandle">
</el-pagination> </el-pagination>
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
<group-detail v-if="groupDetailVisible" ref="groupDetail" @refreshDataList="getDataList"></group-detail> <group-detail v-if="groupDetailVisible"
<group-approve v-if="groupApproveVisible" ref="groupApprove" @refreshDataList="getDataList"></group-approve> ref="groupDetail"
@refreshDataList="getDataList"></group-detail>
<group-approve v-if="groupApproveVisible"
ref="groupApprove"
@refreshDataList="getDataList"></group-approve>
</div> </div>
</el-card> </el-card>
</template> </template>
@ -107,14 +159,14 @@ export default {
}, },
watch: { watch: {
'ids': function (val) { 'ids': function (val) {
if (val.length === 1){ if (val.length === 1) {
this.dataForm.streetId = this.ids[0] this.dataForm.streetId = this.ids[0]
} }
if (val.length === 2){ if (val.length === 2) {
this.dataForm.streetId = this.ids[0] this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1] this.dataForm.communityId = this.ids[1]
} }
if (val.length === 3){ if (val.length === 3) {
this.dataForm.streetId = this.ids[0] this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1] this.dataForm.communityId = this.ids[1]
this.dataForm.gridId = this.ids[2] this.dataForm.gridId = this.ids[2]
@ -145,8 +197,7 @@ export default {
ban (id) { ban (id) {
this.postForm.state = 15 this.postForm.state = 15
this.postForm.id = id this.postForm.id = id
this.$http['post']( this.$http['post']('/group/group/operate', this.postForm).then(({ data: res }) => {
'/group/group/operate', this.postForm).then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
@ -156,13 +207,12 @@ export default {
type: 'success', type: 'success',
duration: 500 duration: 500
}) })
}).catch(() => {}) }).catch(() => { })
}, },
liftTheBan (id) { liftTheBan (id) {
this.postForm.state = 10 this.postForm.state = 10
this.postForm.id = id this.postForm.id = id
this.$http['post']( this.$http['post']('/group/group/operate', this.postForm).then(({ data: res }) => {
'/group/group/operate', this.postForm).then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
@ -172,13 +222,12 @@ export default {
type: 'success', type: 'success',
duration: 500 duration: 500
}) })
}).catch(() => {}) }).catch(() => { })
}, },
disband (id) { disband (id) {
this.postForm.state = 20 this.postForm.state = 20
this.postForm.id = id this.postForm.id = id
this.$http['post']( this.$http['post']('/group/group/operate', this.postForm).then(({ data: res }) => {
'/group/group/operate', this.postForm).then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
@ -188,7 +237,7 @@ export default {
type: 'success', type: 'success',
duration: 500 duration: 500
}) })
}).catch(() => {}) }).catch(() => { })
}, },
look (id) { look (id) {
this.groupDetailVisible = true this.groupDetailVisible = true
@ -210,7 +259,7 @@ export default {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
this.options = res.data.options this.options = res.data.options
}).catch(() => {}) }).catch(() => { })
} }
} }
} }

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

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

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

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

Loading…
Cancel
Save