Browse Source

重命名变量,完善面包屑功能

shibei_master
YUJT 3 years ago
parent
commit
81c8b6bf81
  1. 269
      src/views/modules/base/organization/organization.vue

269
src/views/modules/base/organization/organization.vue

@ -49,9 +49,9 @@
</el-col> </el-col>
</el-row> </el-row>
<!-- 组织列表 --> <!-- 组织列表 -->
<el-table v-show="OrganizationList" <el-table v-show="agencyTableFlag"
height="250" height="250"
:data="tableData" :data="agencyTableListData"
style="width: 100%"> style="width: 100%">
<el-table-column prop="agencyName" label="组织名字" width="260"></el-table-column> <el-table-column prop="agencyName" label="组织名字" width="260"></el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@ -73,9 +73,9 @@
</el-table> </el-table>
<!-- 下级机关单位/基层科室列表 --> <!-- 下级机关单位/基层科室列表 -->
<el-table v-show="officeList" <el-table v-show="departmentTableFlag"
height="250" height="250"
:data="communityData" :data="departmentTableListData"
style="width: 100%"> style="width: 100%">
<el-table-column prop="departmentName" label="下级机关单位/基层科室" width="260"></el-table-column> <el-table-column prop="departmentName" label="下级机关单位/基层科室" width="260"></el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@ -98,9 +98,9 @@
</el-table> </el-table>
<!-- 网格列表 --> <!-- 网格列表 -->
<el-table v-show="GridList" <el-table v-show="gridTableFlag"
height="250" height="250"
:data="gridData" :data="gridTableListData"
style="width: 100%"> style="width: 100%">
<el-table-column prop="gridName" label="网格名字" width="260"></el-table-column> <el-table-column prop="gridName" label="网格名字" width="260"></el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@ -123,16 +123,15 @@
</el-table> </el-table>
<!-- 本级工作人员 --> <!-- 本级工作人员 -->
<el-table v-show="levelWorkPeoList" <el-table v-show="currentAgencyStaffTableFlag"
:data="agencyDataPeo" :data="agencyStaffTableListData"
style="width: 100%" style="width: 100%"
height="250"> height="250">
<el-table-column prop="name" label="本级工作人员名字" width="260"></el-table-column> <el-table-column prop="name" label="本级工作人员名字" width="260"></el-table-column>
<el-table-column prop="roles" label="本级工作人员职责" width="260"></el-table-column> <el-table-column prop="roles" label="本级工作人员职责" width="260"></el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" > <el-table-column label="操作" align="center" class-name="small-padding fixed-width" >
<template slot="header" slot-scope="scope"> <template slot="header" slot-scope="scope">
<el-button v-if="levelPeo" <el-button size="mini"
size="mini"
type="primary" type="primary"
icon="el-icon-plus" icon="el-icon-plus"
@click="addPeo(scope.row)" @click="addPeo(scope.row)"
@ -168,15 +167,14 @@
</el-table> </el-table>
<!-- 下级机关单位/基层科室工作人员 --> <!-- 下级机关单位/基层科室工作人员 -->
<el-table height="250" v-show="ListOfOrganPersonnel" <el-table height="250" v-show="departmentStaffTableFlag"
:data="communityDataPeo" :data="departmentStaffTableListData"
style="width: 100%"> style="width: 100%">
<el-table-column prop="name" label="下级机关单位/基层科室工作人员" width="260"></el-table-column> <el-table-column prop="name" label="下级机关单位/基层科室工作人员" width="260"></el-table-column>
<el-table-column prop="roles" label="下级机关单位/基层科室工作人员职责" width="260"></el-table-column> <el-table-column prop="roles" label="下级机关单位/基层科室工作人员职责" width="260"></el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot="header" slot-scope="scope"> <template slot="header" slot-scope="scope">
<el-button v-if="deptPeo" <el-button size="mini"
size="mini"
type="primary" type="primary"
icon="el-icon-plus" icon="el-icon-plus"
@click="addCommunityPeo(scope.row)" @click="addCommunityPeo(scope.row)"
@ -212,16 +210,15 @@
</el-table> </el-table>
<!-- 网格工作人员 --> <!-- 网格工作人员 -->
<el-table v-show="GridWorkPeoList" <el-table v-show="gridStaffTableFlag"
:data="gridDataPeo" :data="gridStaffTableListData"
style="width: 100%" style="width: 100%"
height="250"> height="250">
<el-table-column prop="name" label="网格工作人员名字" width="260"></el-table-column> <el-table-column prop="name" label="网格工作人员名字" width="260"></el-table-column>
<el-table-column prop="roles" label="网格工作人员职责" width="260"></el-table-column> <el-table-column prop="roles" label="网格工作人员职责" width="260"></el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot="header" slot-scope="scope"> <template slot="header" slot-scope="scope">
<el-button v-if="GridWorkPeo" <el-button size="mini"
size="mini"
type="primary" type="primary"
icon="el-icon-plus" icon="el-icon-plus"
@click="addGridPeo(scope.row)" @click="addGridPeo(scope.row)"
@ -521,7 +518,7 @@
<!-- 新增组织 --> <!-- 新增组织 -->
<el-dialog <el-dialog
title="新增组织" title="新增组织"
:visible.sync="addNewAgency" :visible.sync="createAgencyDialogFlag"
width="60%" width="60%"
:before-close="handleClose"> :before-close="handleClose">
<el-form> <el-form>
@ -571,25 +568,41 @@ export default {
data(){ data(){
return{ return{
// //
addNewAgency:false, createAgencyDialogFlag: false,
//
levelPeo:true, //
// agencyTableFlag: true,
deptPeo:false, //
// currentAgencyStaffTableFlag: true,
GridWorkPeo:false, //
// agencyTableListData: [],
ListOfOrganPersonnel:false, //
// agencyStaffTableListData:[],
GridWorkPeoList:false,
// //
OrganizationList:true, departmentTableFlag: true,
// //
levelWorkPeoList:true, departmentStaffTableFlag: false,
// //
GridList:true, departmentTableListData: [],
// //
officeList:true, departmentStaffTableListData:[],
//
gridTableFlag:true,
//
gridStaffTableFlag: false,
//
gridTableListData: [],
//
gridStaffTableListData:[],
agencyId: localStorage.getItem("agencyId"),
gridOrgId:'',
departmentOrgId:'',
anId:localStorage.getItem("agencyId"),
// //
lat:'11', lat:'11',
lng:'11', lng:'11',
@ -614,12 +627,6 @@ export default {
// //
deptList: [], deptList: [],
//
tableData:[],
//
communityData:[],
//
gridData:[],
// //
dialogVisible:false, dialogVisible:false,
dialogVisibleGrid:false, dialogVisibleGrid:false,
@ -721,20 +728,7 @@ export default {
{value: 'grid_member' , label: '网格员'}, {value: 'grid_member' , label: '网格员'},
], ],
// angencuId // angencuId
agencyId: localStorage.getItem("agencyId"),
gridOpen: false,
communityOpen:false,
gridOrgId:'',
communityOrgId:'',
//
gridDataPeo:[],
//
communityDataPeo:[],
//
agencyDataPeo:[],
anId:localStorage.getItem("agencyId"),
// //
entry:false, entry:false,
// //
@ -780,7 +774,7 @@ export default {
}, },
created(){ created(){
this.getAgencyList() this.getAgencyList()
this.getCommunityList() this.getDepartmentList()
this.getGridList() this.getGridList()
this.agencyPeo() this.agencyPeo()
// this.getNavigation() // this.getNavigation()
@ -797,7 +791,7 @@ export default {
}, 1000); }, 1000);
} }
}, },
addNewAgency(val) { createAgencyDialogFlag(val) {
if (val) { if (val) {
setTimeout(() => { setTimeout(() => {
let _t = this let _t = this
@ -839,13 +833,13 @@ export default {
const { data, code, msg } = await requestPost(url,params) const { data, code, msg } = await requestPost(url,params)
if(code === 0){ if(code === 0){
this.tableData = data this.agencyTableListData = data
}else{ }else{
this.$message.error(msg) this.$message.error(msg)
} }
}, },
/** 查询社区列表 */ /** 查询社区列表 */
async getCommunityList(){ async getDepartmentList(){
const url = "/gov/org/department/departmentlist" const url = "/gov/org/department/departmentlist"
let params = { let params = {
@ -855,7 +849,7 @@ export default {
const { data, code, msg } = await requestPost(url,params) const { data, code, msg } = await requestPost(url,params)
if(code === 0){ if(code === 0){
this.communityData = data this.departmentTableListData = data
}else{ }else{
this.$message.error(msg) this.$message.error(msg)
@ -872,7 +866,7 @@ export default {
const { data, code, msg } = await requestPost(url,params) const { data, code, msg } = await requestPost(url,params)
if(code === 0){ if(code === 0){
this.gridData = data this.gridTableListData = data
}else{ }else{
this.$message.error(msg) this.$message.error(msg)
} }
@ -892,7 +886,7 @@ export default {
const { data, code, msg } = await requestPost(url,params) const { data, code, msg } = await requestPost(url,params)
if(code === 0){ if(code === 0){
this.gridDataPeo = data.staffList this.gridStaffTableListData = data.staffList
} else { } else {
this.$message.error(msg) this.$message.error(msg)
} }
@ -911,7 +905,7 @@ export default {
const { data, code, msg } = await requestPost(url,params) const { data, code, msg } = await requestPost(url,params)
if(code === 0) { if(code === 0) {
this.agencyDataPeo = data.staffList this.agencyStaffTableListData = data.staffList
} else { } else {
this.$message.error(msg) this.$message.error(msg)
} }
@ -922,7 +916,7 @@ export default {
const url = "/data/aggregator/org/stafflist" const url = "/data/aggregator/org/stafflist"
let params = { let params = {
orgId:this.communityOrgId, orgId:this.departmentOrgId,
orgType:'dept', orgType:'dept',
pageNo:1, pageNo:1,
pageSize:100 pageSize:100
@ -931,7 +925,7 @@ export default {
const { data, code, msg } = await requestPost(url,params) const { data, code, msg } = await requestPost(url,params)
if(code === 0){ if(code === 0){
this.communityDataPeo = data.staffList this.departmentStaffTableListData = data.staffList
} else { } else {
this.$message.error(msg) this.$message.error(msg)
} }
@ -957,7 +951,7 @@ export default {
this.dialogVisible = false this.dialogVisible = false
this.insertForm = [] this.insertForm = []
this.getAgencyList() this.getAgencyList()
this.getCommunityList() this.getDepartmentList()
this.getGridList() this.getGridList()
this.agencyPeo() this.agencyPeo()
}else{ }else{
@ -987,7 +981,7 @@ export default {
this.dialogVisibleGrid = false this.dialogVisibleGrid = false
this.GridForm = [] this.GridForm = []
this.getAgencyList() this.getAgencyList()
this.getCommunityList() this.getDepartmentList()
this.getGridList() this.getGridList()
this.agencyPeo() this.agencyPeo()
} else { } else {
@ -1017,7 +1011,7 @@ export default {
this.dialogVisiblePeo = false this.dialogVisiblePeo = false
this.peoForm = [] this.peoForm = []
this.getAgencyList() this.getAgencyList()
this.getCommunityList() this.getDepartmentList()
this.getGridList() this.getGridList()
this.agencyPeo() this.agencyPeo()
} else { } else {
@ -1046,7 +1040,7 @@ export default {
this.dialogVisiblePeo = false this.dialogVisiblePeo = false
this.peoForm = [] this.peoForm = []
this.getAgencyList() this.getAgencyList()
this.getCommunityList() this.getDepartmentList()
this.getGridList() this.getGridList()
this.agencyPeo() this.agencyPeo()
} else { } else {
@ -1182,62 +1176,53 @@ export default {
// //
canceladdNewAgency(){ canceladdNewAgency(){
this.addNewAgencyRest() this.addNewAgencyRest()
this.addNewAgency = false this.createAgencyDialogFlag = false
}, },
// //
entryGrid(gridId){ entryGrid(gridId){
this.gridDataPeo = [] this.gridStaffTableListData = []
this.communityDataPeo =[] this.departmentStaffTableListData =[]
this.agencyDataPeo = [] this.agencyStaffTableListData = []
this.gridOrgId = gridId this.gridOrgId = gridId
this.deptPeo = false this.gridStaffTableFlag = true
this.GridWorkPeo = true this.departmentStaffTableFlag = false
this.levelPeo = false this.currentAgencyStaffTableFlag = false
this.GridWorkPeoList = true this.agencyTableFlag = false
this.ListOfOrganPersonnel = false this.departmentTableFlag = false
this.levelWorkPeoList = false this.gridTableFlag = false
this.OrganizationList = false
this.officeList = false
this.GridList = false
this.GridPeo() this.GridPeo()
this.assembleBreadcrumbArr(gridId, 'grid') this.assembleBreadcrumbArr(gridId, 'grid')
}, },
// //
entryDepartment(departmentId){ entryDepartment(departmentId){
this.gridDataPeo = [] this.gridStaffTableListData = []
this.communityDataPeo = [] this.departmentStaffTableListData = []
this.agencyDataPeo = [] this.agencyStaffTableListData = []
this.communityOrgId = departmentId this.departmentOrgId = departmentId
this.levelPeo = false this.departmentStaffTableFlag = true
this.deptPeo = true this.currentAgencyStaffTableFlag = false
this.GridWorkPeo = false this.gridStaffTableFlag = false
this.ListOfOrganPersonnel = true this.gridTableFlag = false
this.levelWorkPeoList = false this.agencyTableFlag = false
this.GridWorkPeoList = false this.departmentTableFlag = false
this.GridList = false
this.OrganizationList = false
this.officeList = false
this.communityPeo() this.communityPeo()
this.assembleBreadcrumbArr(departmentId, 'department') this.assembleBreadcrumbArr(departmentId, 'department')
}, },
// //
entryAgency(agencyId){ entryAgency(agencyId){
this.tableData = [] this.agencyTableListData = []
this.communityData = [] this.departmentTableListData = []
this.gridData = [] this.gridTableListData = []
this.gridDataPeo = [] this.gridStaffTableListData = []
this.agencyDataPeo = [] this.agencyStaffTableListData = []
this.communityDataPeo = [] this.departmentStaffTableListData = []
this.agencyId = agencyId this.agencyId = agencyId
this.getCommunityList() this.getDepartmentList()
this.getGridList() this.getGridList()
this.communityOpen = true
this.gridOpen = true
this.anId = agencyId this.anId = agencyId
this.agencyPeo() this.agencyPeo()
this.entry = true this.entry = true
this.levelPeo = true
this.agencyId = agencyId this.agencyId = agencyId
this.getAgencyList() this.getAgencyList()
this.assembleBreadcrumbArr(agencyId, 'agency') this.assembleBreadcrumbArr(agencyId, 'agency')
@ -1280,13 +1265,13 @@ export default {
addCommunityPeo(){ addCommunityPeo(){
this.dialogVisiblePeo = true this.dialogVisiblePeo = true
this.peoForm.orgType = 'dept' this.peoForm.orgType = 'dept'
this.submitOrgid = this.communityOrgId this.submitOrgid = this.departmentOrgId
}, },
// //
xiuCommunityPeo(row){ xiuCommunityPeo(row){
this.modifyPeo = true this.modifyPeo = true
this.peoForm.orgType = 'dept' this.peoForm.orgType = 'dept'
this.submitOrgid = this.communityOrgId this.submitOrgid = this.departmentOrgId
this.peoForm.name = row.name this.peoForm.name = row.name
this.peoForm.mobile = row.mobile this.peoForm.mobile = row.mobile
this.peoForm.gender = row.gender this.peoForm.gender = row.gender
@ -1336,7 +1321,7 @@ export default {
this.$message.success("禁用成功") this.$message.success("禁用成功")
this.Disable = false this.Disable = false
this.getAgencyList() this.getAgencyList()
this.getCommunityList() this.getDepartmentList()
this.getGridList() this.getGridList()
this.agencyPeo() this.agencyPeo()
} else { } else {
@ -1387,7 +1372,7 @@ export default {
this.options[0].value = data.agencyId this.options[0].value = data.agencyId
let depart = Array.from(data.departmentList) let depart = Array.from(data.departmentList)
let gr = Array.from(data.gridList) let gr = Array.from(data.gridTableFlag)
depart.forEach(item => { depart.forEach(item => {
const ob = { const ob = {
@ -1431,7 +1416,7 @@ export default {
this.transferRest() this.transferRest()
this.transferPeo = false this.transferPeo = false
this.getAgencyList() this.getAgencyList()
this.getCommunityList() this.getDepartmentList()
this.getGridList() this.getGridList()
this.agencyPeo() this.agencyPeo()
@ -1465,9 +1450,9 @@ export default {
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params)
if(code === 0){ if(code === 0){
if (data.level === 'community') { if (data.level === 'community') {
this.OrganizationList = false this.agencyTableFlag = false
} else { } else {
this.OrganizationList = true this.agencyTableFlag = true
} }
if (this.breadcrumbArr.length === 0) { if (this.breadcrumbArr.length === 0) {
this.breadcrumbArr = [{id: data.agencyId, name: data.agencyName, type: orgType}] this.breadcrumbArr = [{id: data.agencyId, name: data.agencyName, type: orgType}]
@ -1545,11 +1530,59 @@ export default {
const orgType = selectOrg.type const orgType = selectOrg.type
if (orgType === 'agency') { if (orgType === 'agency') {
this.entryAgency(orgId) this.agencyTableListData = []
this.agencyStaffTableListData = []
this.departmentTableListData = []
this.departmentStaffTableListData = []
this.gridTableListData = []
this.gridStaffTableListData = []
this.agencyId = orgId
this.anId = orgId
this.agencyTableFlag = true
this.currentAgencyStaffTableFlag = true
this.departmentTableFlag = true
this.departmentStaffTableFlag = false
this.gridTableFlag = true
this.gridStaffTableFlag = false
this.getDepartmentList()
this.getGridList()
this.agencyPeo()
this.entry = true
this.getAgencyList()
this.assembleBreadcrumbArr(orgId, 'agency')
} else if (orgType === 'department') { } else if (orgType === 'department') {
this.entryDepartment(orgId) this.agencyStaffTableListData = []
this.departmentStaffTableListData = []
this.gridStaffTableListData = []
this.departmentOrgId = orgId
this.agencyTableFlag = false
this.currentAgencyStaffTableFlag = false
this.departmentTableFlag = false
this.departmentStaffTableFlag = true
this.gridTableFlag = false
this.gridStaffTableFlag = false
this.communityPeo()
this.assembleBreadcrumbArr(orgId, 'department')
} else if (orgType === 'grid') { } else if (orgType === 'grid') {
this.entryGrid(orgId) this.agencyStaffTableListData = []
this.departmentStaffTableListData =[]
this.gridStaffTableListData = []
this.gridOrgId = orgId
this.agencyTableFlag = false
this.currentAgencyStaffTableFlag = false
this.departmentTableFlag = false
this.departmentStaffTableFlag = false
this.gridTableFlag = false
this.gridStaffTableFlag = true
this.GridPeo()
this.assembleBreadcrumbArr(orgId, 'grid')
} }
}, },
// //
@ -1597,7 +1630,7 @@ export default {
}, },
addAgency(row){ addAgency(row){
this.addNewAgency = true this.createAgencyDialogFlag = true
this.getUser() this.getUser()
}, },
// //

Loading…
Cancel
Save