|
|
@@ -187,35 +187,28 @@ export default {
|
|
|
const type = this.partyTypeId !== '' ? this.partyTypeId : '1'
|
|
|
findAllPosition().then(res => {
|
|
|
const { data = [] } = res || {}
|
|
|
- const setTreeDatas = []
|
|
|
if (data.length) {
|
|
|
for (const i of data) {
|
|
|
- const setTreeData = {
|
|
|
- id: i.id,
|
|
|
- parentId: i.parentId,
|
|
|
- name: i.name,
|
|
|
- path: i.path
|
|
|
- }
|
|
|
if (!isSuper) {
|
|
|
switch (type) {
|
|
|
case '2':
|
|
|
- setTreeData.disabled = true
|
|
|
+ i.disabled = true
|
|
|
// 展示所在部门及其上级部门,但是上级部门无法被选择到,但是下属部门要能选择
|
|
|
for (const item of position.split(',')) {
|
|
|
if ((this.$utils.getIndexOf(i.path.split('.'), item) > -1) &&
|
|
|
(this.$utils.getIndexOf(i.path.split('.'), item) <= this.$utils.getIndexOf(i.path.split('.'), i.id))) {
|
|
|
- setTreeData.disabled = false
|
|
|
+ i.disabled = false
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
break
|
|
|
case '3':
|
|
|
- setTreeData.disabled = true
|
|
|
+ i.disabled = true
|
|
|
// 展示指定范围的部门
|
|
|
for (const item of this.currentOrgId.split(',')) {
|
|
|
if ((this.$utils.getIndexOf(i.path.split('.'), item) > -1) &&
|
|
|
(this.$utils.getIndexOf(i.path.split('.'), item) <= this.$utils.getIndexOf(i.path.split('.'), i.id))) {
|
|
|
- setTreeData.disabled = false
|
|
|
+ i.disabled = false
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
@@ -225,10 +218,9 @@ export default {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
- setTreeDatas.push(setTreeData)
|
|
|
}
|
|
|
}
|
|
|
- this.treeData = this.toTree(setTreeDatas)
|
|
|
+ this.treeData = this.toTree(data)
|
|
|
}).catch(res => {
|
|
|
})
|
|
|
} else {
|