diff --git a/src/views/modules/base/organization/organization.vue b/src/views/modules/base/organization/organization.vue
index 09970092..a581f2d4 100644
--- a/src/views/modules/base/organization/organization.vue
+++ b/src/views/modules/base/organization/organization.vue
@@ -4,9 +4,9 @@
- {{ breadcrumb.name }}
+ {{ breadcrumb.name }}
{{ breadcrumb.name }}
- 编辑
+ 修改
@@ -153,37 +153,13 @@
- 新增
+ 新增
- 修改
- 查看
- 调动
- 禁用
+ 修改
+ 查看
+ 调动
+ 禁用
@@ -201,37 +177,13 @@
- 新增
+ 新增
-
- 修改
- 查看
- 调动
- 禁用
+
+ 修改
+ 查看
+ 调动
+ 禁用
@@ -350,9 +302,9 @@
@@ -379,7 +331,6 @@
- 性别下拉框
- 专兼职下拉框
- 职责下拉框
@@ -735,18 +684,21 @@ export default {
// 网格工作人员列表数据
gridStaffTableListData:[],
- agencyId: localStorage.getItem("agencyId"),
- gridOrgId:'',
- departmentOrgId:'',
-
- anId:localStorage.getItem("agencyId"),
+ // 用户所属组织ID
+ userAgencyId: localStorage.getItem("agencyId"),
+ // 当前被操作的组织的ID
+ currentAgencyId: localStorage.getItem("agencyId"),
+ // 当前被操作的部门的ID
+ currentDepartmentId:'',
+ // 当前被操作的网格的ID
+ currentGridOrgId:'',
- // 经纬度坐标
- lat:'11',
- lng:'11',
- latitude:'39.984104',
- longitude:'116.307503',
- Navigation:'',
+ // 经纬度坐标
+ lat:'11',
+ lng:'11',
+ latitude:'11',
+ longitude:'11',
+ Navigation:'',
// 查询参数
queryParams: {
deptName: undefined,
@@ -766,12 +718,12 @@ export default {
deptList: [],
// 弹窗开关
- dialogVisible:false,
- dialogVisibleGrid:false,
- dialogVisiblePeo:false,
- Disable:false,
- details:false,
- transferPeo:false,
+ dialogVisible: false,
+ dialogVisibleGrid: false,
+ dialogVisiblePeo: false,
+ Disable: false,
+ details: false,
+ transferPeo: false,
// 社区添加表单项
insertForm:{
departmentName:'',
@@ -888,53 +840,38 @@ export default {
{value: 'parttime' , label: '兼职'}
],
// 职责字典
- dutyList:[
- {value: 'agency_leader' , label: '单位领导'},
- {value: 'dept_leader' , label: '部门领导'},
- {value: 'party_principals' , label: '党建负责人'},
- {value: 'manager' , label: '管理员'},
- {value: 'staff' , label: '工作人员'},
- {value: 'grid_manager' , label: '网格长'},
- {value: 'grid_party_director' , label: '党建宣传员'},
- {value: 'root_manager' , label: '超级管理员'},
- {value: 'grid_member' , label: '网格员'},
+ dutyList:[],
+ // 修改操作是否展示
+ modifyPeo:false,
+ submitOrgid:'',
+ // 级联数据
+ options:[
+ {
+ value:'',
+ label:'',
+ children:[
+ {
+ value:'',
+ label:'',
+ children:[]
+ },
+ {
+ value:'',
+ label:'',
+ children:[]
+ }
+ ],
+ }
],
- // angencuId
-
- // 新增操作是否展示
- entry:false,
- // 修改操作是否展示
- modifyPeo:false,
- submitOrgid:'',
- // 级联数据
- options:[
- {
- value:'',
- label:'',
- children:[
- {
- value:'',
- label:'',
- children:[]
- },
- {
- value:'',
- label:'',
- children:[]
- }
- ],
- }
- ],
- selectValue: [],
-
+ selectValue: [],
// 顶部 面包屑
breadcrumbArr: [],
// 面包屑 当前所属机构ID
- currentBreadCrumbKey: '',
+ currentBreadcrumbKey: '',
// 组织区划数据
zonings:[],
// 校验
- rules: {
+ rules: {
departmentName:[
{ required: true, message: '社区名称必填', trigger: 'blur' }
],
@@ -948,7 +885,8 @@ export default {
this.getAgencyList()
this.getDepartmentList()
this.getGridList()
- this.agencyPeo()
+ this.getAgencyStaffListData()
+ this.getRoleList()
// this.getNavigation()
// 更新顶部面包屑
this.assembleBreadcrumbArr(localStorage.getItem('agencyId'), 'agency')
@@ -1002,7 +940,6 @@ export default {
methods:{
// 点击后获取id
handleChange (e) {
- console.log(e)
this.transferForm.orgId = e[1]
if(this.transferForm.orgId != null || ''){
if(this.transferForm.orgId === 0){
@@ -1016,14 +953,25 @@ export default {
this.transferForm.orgId = e[0]
this.transferForm.orgType = 'agency'
}
-
-
+ },
+ /** 查询系统工作人员角色(职责) */
+ async getRoleList () {
+ const url = "/gov/org/staff/rolelist"
+ let params = {
+ agencyId: this.currentAgencyId
+ }
+ const { data, code, msg } = await requestPost(url,params)
+ if(code === 0){
+ this.dutyList = data
+ }else{
+ this.$message.error(msg)
+ }
},
/** 查询组织列表 */
async getAgencyList(){
const url = "/gov/org/agency/agencylist"
let params = {
- agencyId: this.agencyId
+ agencyId: this.currentAgencyId
}
const { data, code, msg } = await requestPost(url,params)
@@ -1039,7 +987,7 @@ export default {
const url = "/gov/org/department/departmentlist"
let params = {
- agencyId:this.agencyId
+ agencyId: this.currentAgencyId
}
const { data, code, msg } = await requestPost(url,params)
@@ -1056,7 +1004,7 @@ export default {
const url = "/gov/org/grid/allgrids"
let params = {
- agencyId:this.agencyId
+ agencyId: this.currentAgencyId
}
const { data, code, msg } = await requestPost(url,params)
@@ -1069,11 +1017,11 @@ export default {
},
// 查询网格人员列表
- async GridPeo(){
+ async getGridStaffListData(){
const url = "/data/aggregator/org/stafflist"
let params = {
- orgId:this.gridOrgId,
+ orgId:this.currentGridOrgId,
orgType:'grid',
pageNo:1,
pageSize:100
@@ -1088,11 +1036,11 @@ export default {
}
},
// 查询组织工作人员
- async agencyPeo(){
+ async getAgencyStaffListData(){
const url = "/data/aggregator/org/stafflist"
let params = {
- orgId:this.anId,
+ orgId: this.currentAgencyId,
orgType:'agency',
pageNo:1,
pageSize:100
@@ -1108,11 +1056,11 @@ export default {
},
// 查询部门人员
- async communityPeo(){
+ async getDepartmentStaffListData(){
const url = "/data/aggregator/org/stafflist"
let params = {
- orgId:this.departmentOrgId,
+ orgId:this.currentDepartmentId,
orgType:'dept',
pageNo:1,
pageSize:100
@@ -1149,7 +1097,7 @@ export default {
this.getAgencyList()
this.getDepartmentList()
this.getGridList()
- this.agencyPeo()
+ this.getAgencyStaffListData()
}else{
this.$message.error(msg)
}
@@ -1179,7 +1127,7 @@ export default {
this.getAgencyList()
this.getDepartmentList()
this.getGridList()
- this.agencyPeo()
+ this.getAgencyStaffListData()
} else {
this.$message.error(msg)
}
@@ -1209,7 +1157,7 @@ export default {
this.getAgencyList()
this.getDepartmentList()
this.getGridList()
- this.agencyPeo()
+ this.getAgencyStaffListData()
} else {
this.$message.error(msg)
}
@@ -1238,7 +1186,7 @@ export default {
this.getAgencyList()
this.getDepartmentList()
this.getGridList()
- this.agencyPeo()
+ this.getAgencyStaffListData()
} else {
this.$message.error(msg)
}
@@ -1434,95 +1382,90 @@ export default {
this.gridStaffTableListData = []
this.departmentStaffTableListData =[]
this.agencyStaffTableListData = []
- this.gridOrgId = gridId
+ this.currentGridOrgId = gridId
this.gridStaffTableFlag = true
this.departmentStaffTableFlag = false
this.currentAgencyStaffTableFlag = false
this.agencyTableFlag = false
this.departmentTableFlag = false
this.gridTableFlag = false
- this.GridPeo()
+ this.getGridStaffListData()
this.assembleBreadcrumbArr(gridId, 'grid')
},
- // 进入社区,查询社区所属人员
+ // 进入部门,查询部门所属人员
entryDepartment(departmentId){
this.gridStaffTableListData = []
this.departmentStaffTableListData = []
this.agencyStaffTableListData = []
- this.departmentOrgId = departmentId
+ this.currentDepartmentId = departmentId
this.departmentStaffTableFlag = true
this.currentAgencyStaffTableFlag = false
this.gridStaffTableFlag = false
this.gridTableFlag = false
this.agencyTableFlag = false
this.departmentTableFlag = false
- this.communityPeo()
+ this.getDepartmentStaffListData()
this.assembleBreadcrumbArr(departmentId, 'department')
},
// 进入组织,重新渲染
entryAgency(agencyId){
+
+ this.currentAgencyId = agencyId
+
this.agencyTableListData = []
this.departmentTableListData = []
this.gridTableListData = []
this.gridStaffTableListData = []
this.agencyStaffTableListData = []
this.departmentStaffTableListData = []
- this.agencyId = agencyId
+
this.getDepartmentList()
this.getGridList()
- this.anId = agencyId
- this.agencyPeo()
- this.entry = true
- this.agencyId = agencyId
+ this.getAgencyStaffListData()
this.getAgencyList()
this.assembleBreadcrumbArr(agencyId, 'agency')
},
// 新增组织
addCommunity(row){
-
- this.insertForm.agencyId = this.anId
+ this.insertForm.agencyId = this.currentAgencyId
this.dialogVisible = true
},
// 新增网格
addGrid(row){
- this.GridForm.agencyId = this.anId
+ this.GridForm.agencyId = this.currentAgencyId
this.getDictionaries()
this.dialogVisibleGrid = true
- // this.initMap()
-
},
// 新增人员
addPeo(row){
-
this.dialogVisiblePeo = true
this.peoForm.orgType = 'agency'
- this.submitOrgid = this.anId
+ this.submitOrgid = this.currentAgencyId
},
// 修改人员
xiuPeo(row){
this.modifyPeo = true
this.peoForm.orgType = 'agency'
- this.submitOrgid = this.anId
+ this.submitOrgid = this.currentAgencyId
this.peoForm.name = row.name
this.peoForm.mobile = row.mobile
this.peoForm.gender = row.gender
this.peoForm.post = row.post
this.peoForm.duty = row.roles
- console.log(row)
},
// 新增社区人员
addCommunityPeo(){
this.dialogVisiblePeo = true
this.peoForm.orgType = 'dept'
- this.submitOrgid = this.departmentOrgId
+ this.submitOrgid = this.currentDepartmentId
},
// 修改社区人员
xiuCommunityPeo(row){
this.modifyPeo = true
this.peoForm.orgType = 'dept'
- this.submitOrgid = this.departmentOrgId
+ this.submitOrgid = this.currentDepartmentId
this.peoForm.name = row.name
this.peoForm.mobile = row.mobile
this.peoForm.gender = row.gender
@@ -1533,18 +1476,37 @@ export default {
addGridPeo(){
this.dialogVisiblePeo = true
this.peoForm.orgType = 'grid'
- this.submitOrgid = this.gridOrgId
+ this.submitOrgid = this.currentGridOrgId
},
// 修改网格人员
- xiuGridPeo(row){
+ async xiuGridPeo(row){
this.modifyPeo = true
this.peoForm.orgType = 'grid'
- this.submitOrgid = this.gridOrgId
- this.peoForm.name = row.name
- this.peoForm.mobile = row.mobile
- this.peoForm.gender = row.gender
- this.peoForm.post = row.post
- this.peoForm.duty = row.roles
+ this.submitOrgid = this.currentGridOrgId
+
+ const url = "/gov/org/staff/editstaffinit"
+ let params = {
+ staffId: row.staffId,
+ agencyId: this.currentAgencyId
+ }
+ const { data, code, msg } = await requestPost(url,params)
+ if(code === 0){
+
+ this.peoForm.name = data.name
+ this.peoForm.mobile = data.mobile
+ this.peoForm.gender = data.gender
+ this.peoForm.post = data.workType
+ // 已有的权限(职责)
+ let existedRoleArr = []
+ data.roleList.forEach(function (sysRole) {
+ if (sysRole.selected === true) {
+ existedRoleArr.push(sysRole.roleId)
+ }
+ })
+ this.peoForm.duty = existedRoleArr
+ } else {
+ this.$message.error(msg)
+ }
},
// 取消禁用按钮
cancelDisable(){
@@ -1552,7 +1514,6 @@ export default {
},
// 人员禁用
DisablePeo(row){
- console.log(row)
this.DisableForm.staffId = row.staffId
this.Disable = true
},
@@ -1574,7 +1535,7 @@ export default {
this.getAgencyList()
this.getDepartmentList()
this.getGridList()
- this.agencyPeo()
+ this.getAgencyStaffListData()
} else {
this.$message.error(msg)
}
@@ -1595,10 +1556,7 @@ export default {
this.peoForm.activeTime = data.activeTime
this.peoForm.duty = data.roles
this.peoForm.zuzhi = data.orgName
- console.log(row)
}
-
-
this.details = true
},
@@ -1618,7 +1576,6 @@ export default {
const { data, code, msg } = await requestPost(url,params)
if(code === 0){
- console.log(data)
this.options[0].label = data.agencyName
this.options[0].value = data.agencyId
@@ -1647,7 +1604,6 @@ export default {
}else{
this.$message.error("树查询失败",msg)
}
-
},
// 人员调动确定
@@ -1670,7 +1626,7 @@ export default {
this.getAgencyList()
this.getDepartmentList()
this.getGridList()
- this.agencyPeo()
+ this.getAgencyStaffListData()
} else {
this.$message.error(msg)
@@ -1691,9 +1647,9 @@ export default {
// if(code === 0){
// this.Navigation = data.agencyName
// }
-
+ // 组装顶部面包屑数组
async assembleBreadcrumbArr (id, orgType) {
- this.currentBreadCrumbKey = id
+ this.currentBreadcrumbKey = id
if (orgType === 'agency') {
const url = '/gov/org/agency/agencydetail'
let params = {
@@ -1701,6 +1657,7 @@ export default {
}
const { data, code, msg } = await requestPost(url, params)
if(code === 0){
+ // 社区级为最低级组织,不展示下级组织列表
if (data.level === 'community') {
this.agencyTableFlag = false
} else {
@@ -1794,8 +1751,8 @@ export default {
this.departmentStaffTableListData = []
this.gridTableListData = []
this.gridStaffTableListData = []
- this.agencyId = orgId
- this.anId = orgId
+ this.userAgencyId = orgId
+ this.currentAgencyId = orgId
this.agencyTableFlag = true
this.currentAgencyStaffTableFlag = true
@@ -1804,12 +1761,11 @@ export default {
this.gridTableFlag = true
this.gridStaffTableFlag = false
+ this.assembleBreadcrumbArr(orgId, 'agency')
+ this.getAgencyList()
this.getDepartmentList()
this.getGridList()
- this.agencyPeo()
- this.entry = true
- this.getAgencyList()
- this.assembleBreadcrumbArr(orgId, 'agency')
+ this.getAgencyStaffListData()
}
// 当点击最后一级不触发响应
// 其父级及以上,只可能属于组织,而非部门或网格,注释以下代码即可
@@ -1819,7 +1775,7 @@ export default {
this.departmentStaffTableListData = []
this.gridStaffTableListData = []
- this.departmentOrgId = orgId
+ this.currentDepartmentId = orgId
this.agencyTableFlag = false
this.currentAgencyStaffTableFlag = false
@@ -1828,14 +1784,14 @@ export default {
this.gridTableFlag = false
this.gridStaffTableFlag = false
- this.communityPeo()
+ this.getDepartmentStaffListData()
this.assembleBreadcrumbArr(orgId, 'department')
} else if (orgType === 'grid') {
this.agencyStaffTableListData = []
this.departmentStaffTableListData =[]
this.gridStaffTableListData = []
- this.gridOrgId = orgId
+ this.currentGridOrgId = orgId
this.agencyTableFlag = false
this.currentAgencyStaffTableFlag = false
@@ -1843,22 +1799,21 @@ export default {
this.departmentStaffTableFlag = false
this.gridTableFlag = false
this.gridStaffTableFlag = true
- this.GridPeo()
+ this.getGridStaffListData()
this.assembleBreadcrumbArr(orgId, 'grid')
} */
},
// 获取当前用户信息
async getUser(){
- const url = '/data/report/screen/agency/agencydetail-multic'
+ const url = '/gov/org/agency/agencydetail'
let params = {
- agencyId:localStorage.getItem('agencyId')
+ agencyId: localStorage.getItem('agencyId')
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0){
- console.log(data)
this.userForm.areaCode = data.areaCode
this.userForm.level = data.level
this.userForm.parentAgencyId = data.agencyId
@@ -1923,7 +1878,7 @@ export default {
this.getAgencyList()
this.getDepartmentList()
this.getGridList()
- this.agencyPeo()
+ this.getAgencyStaffListData()
}else {
this.$message.error(msg)
}