|
@ -1347,14 +1347,13 @@ export default { |
|
|
orgOptionProps :{ |
|
|
orgOptionProps :{ |
|
|
multiple: true, |
|
|
multiple: true, |
|
|
emitPath: true, |
|
|
emitPath: true, |
|
|
value: 'id', |
|
|
value: 'agencyId', |
|
|
label: 'label', |
|
|
label: 'agencyName', |
|
|
children: 'children', |
|
|
children: 'subAgencyList', |
|
|
checkStrictly: true, |
|
|
checkStrictly: true |
|
|
lazy: true, |
|
|
// lazyLoad: (node, resolve) => { |
|
|
lazyLoad: (node, resolve) => { |
|
|
// this.loadOptions(node, resolve) |
|
|
this.loadOptions(node, resolve) |
|
|
// }, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
dialogVisiblePeoAgency:false,//通过组织添加 |
|
|
dialogVisiblePeoAgency:false,//通过组织添加 |
|
@ -1422,40 +1421,42 @@ export default { |
|
|
methods: { |
|
|
methods: { |
|
|
getOrgTreeList () { |
|
|
getOrgTreeList () { |
|
|
this.$http |
|
|
this.$http |
|
|
.get('/actual/base/communityBuilding/tree/initTree', {}) |
|
|
.post('/gov/org/customeragency/agencygridtree', {}) |
|
|
.then(({ data: res }) => { |
|
|
.then(({ data: res }) => { |
|
|
if (res.code !== 0) { |
|
|
if (res.code !== 0) { |
|
|
return this.$message.error(res.msg) |
|
|
return this.$message.error(res.msg) |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
console.log('获取组织树成功', res.data) |
|
|
this.orgOptions = [] |
|
|
this.orgOptions = [] |
|
|
this.orgOptions.push(res.data) |
|
|
this.orgOptions.push(res.data) |
|
|
|
|
|
console.log(this.orgOptions,"sdkfhkjdfs"); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
.catch(() => { |
|
|
.catch(() => { |
|
|
return this.$message.error('网络错误') |
|
|
return this.$message.error('网络错误') |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
async loadOptions(node, resolve) { |
|
|
// async loadOptions(node, resolve) { |
|
|
let data1 =node.data; |
|
|
// let data1 =node.data; |
|
|
if (data1.level == 'district') { |
|
|
// if (data1.level == 'district') { |
|
|
resolve(this.orgOptions); |
|
|
// resolve(this.orgOptions); |
|
|
|
|
|
|
|
|
} else { |
|
|
// } else { |
|
|
if(data1.level !== "building"){ |
|
|
// if(data1.level !== "building"){ |
|
|
const url = "/actual/base/communityBuilding/tree/nextTreeNode"; |
|
|
// const url = "/actual/base/communityBuilding/tree/nextTreeNode"; |
|
|
let params = { |
|
|
// let params = { |
|
|
level:data1.level, |
|
|
// level:data1.level, |
|
|
id:data1.id |
|
|
// id:data1.id |
|
|
}; |
|
|
// }; |
|
|
const { data, code, msg } =await requestGet(url, params); |
|
|
// const { data, code, msg } =await requestGet(url, params); |
|
|
data1.children=data |
|
|
// data1.children=data |
|
|
resolve(data); |
|
|
// resolve(data); |
|
|
}else{ |
|
|
// }else{ |
|
|
return resolve() |
|
|
// return resolve() |
|
|
} |
|
|
// } |
|
|
|
|
|
|
|
|
} |
|
|
// } |
|
|
}, |
|
|
// }, |
|
|
// 点击后获取id |
|
|
// 点击后获取id |
|
|
handleChangeTransferCascader (e) { |
|
|
handleChangeTransferCascader (e) { |
|
|
function findItem (valueArr, coll) { |
|
|
function findItem (valueArr, coll) { |
|
@ -1756,6 +1757,7 @@ export default { |
|
|
// 调用递归函数提取 level 与 agencyId 组合成的字符串 |
|
|
// 调用递归函数提取 level 与 agencyId 组合成的字符串 |
|
|
this.extractLevelAndAgencyId(this.orgOptions[0], targetAgencyIds, result); |
|
|
this.extractLevelAndAgencyId(this.orgOptions[0], targetAgencyIds, result); |
|
|
// 将 Set 对象转换为数组 |
|
|
// 将 Set 对象转换为数组 |
|
|
|
|
|
|
|
|
const manageScopeArray = Array.from(result); |
|
|
const manageScopeArray = Array.from(result); |
|
|
const url = "/gov/org/staff/editstaff"; |
|
|
const url = "/gov/org/staff/editstaff"; |
|
|
let params = { |
|
|
let params = { |
|
@ -1790,14 +1792,12 @@ export default { |
|
|
|
|
|
|
|
|
// 递归函数,遍历 JSON 对象提取所有的 level 与 agencyId 组合成的字符串 |
|
|
// 递归函数,遍历 JSON 对象提取所有的 level 与 agencyId 组合成的字符串 |
|
|
extractLevelAndAgencyId(obj, agencyIds, result) { |
|
|
extractLevelAndAgencyId(obj, agencyIds, result) { |
|
|
|
|
|
|
|
|
if (obj && typeof obj === 'object') { |
|
|
if (obj && typeof obj === 'object') { |
|
|
console.log(obj,"1111"); |
|
|
if (obj.level && obj.agencyId && agencyIds.includes(obj.agencyId)) { |
|
|
if (obj.level && obj.id && agencyIds.includes(obj.id)) { |
|
|
result.add(`${obj.level}:${obj.agencyId}`); |
|
|
result.add(`${obj.level}:${obj.id}`); |
|
|
|
|
|
} |
|
|
} |
|
|
if (Array.isArray(obj.children)) { |
|
|
if (Array.isArray(obj.subAgencyList)) { |
|
|
obj.children.forEach(subObj => { |
|
|
obj.subAgencyList.forEach(subObj => { |
|
|
this.extractLevelAndAgencyId(subObj, agencyIds, result); |
|
|
this.extractLevelAndAgencyId(subObj, agencyIds, result); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
@ -2138,11 +2138,10 @@ export default { |
|
|
// 修改人员 |
|
|
// 修改人员 |
|
|
async xiuPeo (row) { |
|
|
async xiuPeo (row) { |
|
|
console.log("修改人员"); |
|
|
console.log("修改人员"); |
|
|
|
|
|
console.log(row); |
|
|
this.modifyPeo = true; |
|
|
this.modifyPeo = true; |
|
|
this.peoForm.orgType = "agency"; |
|
|
this.peoForm.orgType = "agency"; |
|
|
|
|
|
|
|
|
this.userStaffId = row.staffId; |
|
|
this.userStaffId = row.staffId; |
|
|
|
|
|
|
|
|
const url = "/gov/org/staff/editstaffinit"; |
|
|
const url = "/gov/org/staff/editstaffinit"; |
|
|
let params = { |
|
|
let params = { |
|
|
staffId: row.staffId, |
|
|
staffId: row.staffId, |
|
@ -2150,12 +2149,14 @@ export default { |
|
|
}; |
|
|
}; |
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
if (code === 0) { |
|
|
if (code === 0) { |
|
|
|
|
|
console.log("修改人员", data); |
|
|
|
|
|
|
|
|
this.peoForm.name = data.name; |
|
|
this.peoForm.name = data.name; |
|
|
this.peoForm.mobile = data.mobile; |
|
|
this.peoForm.mobile = data.mobile; |
|
|
this.peoForm.post = data.workType; |
|
|
this.peoForm.post = data.workType; |
|
|
// this.peoForm.gender = data.gender === 1 ? '男' : '女' |
|
|
|
|
|
this.peoForm.gender = data.gender; |
|
|
this.peoForm.gender = data.gender; |
|
|
this.peoForm.idCard = data.idCard; |
|
|
this.peoForm.idCard = data.idCard; |
|
|
|
|
|
this.peoForm.agencyName=data.agencyName; |
|
|
// 已有的权限(角色) |
|
|
// 已有的权限(角色) |
|
|
let existedRoleArr = []; |
|
|
let existedRoleArr = []; |
|
|
data.newRoleList.forEach(function (sysRole) { |
|
|
data.newRoleList.forEach(function (sysRole) { |
|
@ -2171,15 +2172,14 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
findParentPath(data,agencyIds) { |
|
|
findParentPath(data,agencyIds) { |
|
|
|
|
|
console.log(data,agencyIds,"dskck"); |
|
|
let paths = []; |
|
|
let paths = []; |
|
|
|
|
|
function findPathRecursive(agencyId, node, path) {; |
|
|
function findPathRecursive(agencyId, node, path) { |
|
|
|
|
|
if (node.agencyId === agencyId) { |
|
|
if (node.agencyId === agencyId) { |
|
|
path.push(agencyId); |
|
|
path.push(agencyId); |
|
|
paths.push(path.slice()); // Make a copy of the path array before pushing |
|
|
paths.push(path.slice()); // Make a copy of the path array before pushing |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (node.subAgencyList) { |
|
|
if (node.subAgencyList) { |
|
|
for (let i = 0; i < node.subAgencyList.length; i++) { |
|
|
for (let i = 0; i < node.subAgencyList.length; i++) { |
|
|
if (findPathRecursive(agencyId, node.subAgencyList[i], path.concat(node.agencyId))) { |
|
|
if (findPathRecursive(agencyId, node.subAgencyList[i], path.concat(node.agencyId))) { |
|
@ -2190,11 +2190,10 @@ export default { |
|
|
|
|
|
|
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
agencyIds.forEach(agencyId => { |
|
|
agencyIds.forEach(agencyId => { |
|
|
findPathRecursive(agencyId, data, []); |
|
|
findPathRecursive(agencyId, data, []); |
|
|
}); |
|
|
}); |
|
|
|
|
|
console.log(paths,"paths"); |
|
|
return paths; |
|
|
return paths; |
|
|
}, |
|
|
}, |
|
|
// 修改社区人员 |
|
|
// 修改社区人员 |
|
|