|
|
|
@ -49,9 +49,9 @@ |
|
|
|
|
|
|
|
</el-row> |
|
|
|
</section> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import util from '../../../../common/js/util' |
|
|
|
import { listTreeDept } from '../../../../api/mdp/sys/dept'; |
|
|
|
import BranchSelect from '../branch/BranchSelect';//机构选择 |
|
|
|
@ -118,6 +118,8 @@ |
|
|
|
branchVisible: false, |
|
|
|
branch:null, |
|
|
|
expandRowKeys:[], |
|
|
|
root:null, |
|
|
|
resolve:null, |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
@ -212,64 +214,8 @@ |
|
|
|
}, |
|
|
|
//获取分类树列表 |
|
|
|
getDeptTreeData(refresh) { |
|
|
|
|
|
|
|
let params = { |
|
|
|
|
|
|
|
}; |
|
|
|
params.branchId=this.branchId |
|
|
|
if(this.userInfo.isSuperAdmin==true || this.userInfo.isPlatformAdmin==true){ |
|
|
|
if(this.branch!=null){ |
|
|
|
params.branchId=this.branch.id |
|
|
|
}else if(params.branchId==null || params.branchId==''){ |
|
|
|
params.branchId=this.userInfo.branchId |
|
|
|
} |
|
|
|
}else{ |
|
|
|
if(params.branchId==null || params.branchId==''){ |
|
|
|
params.branchId=this.userInfo.branchId |
|
|
|
} |
|
|
|
// params.autoDetectParentDeptid="1" |
|
|
|
} |
|
|
|
this.listLoading = true; |
|
|
|
listTreeDept(params).then((res) => { |
|
|
|
var tips=res.data.tips; |
|
|
|
var data=res.data.data; |
|
|
|
if(tips.isOk==true){ |
|
|
|
if( this.showRoot===undefined || this.showRoot===false||this.showRoot==='false'){ |
|
|
|
if(data==null){ |
|
|
|
this.depts=[]; |
|
|
|
}else{ |
|
|
|
if(this.branch!=null){ |
|
|
|
res.data.data.branchId=this.branch.id |
|
|
|
res.data.data.deptName=this.branch.branchName+'(机构)' |
|
|
|
res.data.data.isBranch=true |
|
|
|
}else { |
|
|
|
res.data.data.branchId=this.userInfo.branchId |
|
|
|
res.data.data.deptName=this.userInfo.branchName+'(机构)' |
|
|
|
res.data.data.isBranch=true |
|
|
|
} |
|
|
|
this.depts=data |
|
|
|
} |
|
|
|
|
|
|
|
}else{ |
|
|
|
if(this.branch!=null){ |
|
|
|
res.data.data.branchId=this.branch.id |
|
|
|
res.data.data.deptName=this.branch.branchName+'(机构)' |
|
|
|
res.data.data.isBranch=true |
|
|
|
}else { |
|
|
|
res.data.data.branchId=this.userInfo.branchId |
|
|
|
res.data.data.deptName=this.userInfo.branchName+'(机构)' |
|
|
|
res.data.data.isBranch=true |
|
|
|
} |
|
|
|
this.depts=data; |
|
|
|
} |
|
|
|
|
|
|
|
}else{ |
|
|
|
this.$notify({ message: tips.msg, type: 'error'}); |
|
|
|
} |
|
|
|
this.listLoading = false; |
|
|
|
}).catch(() => { |
|
|
|
this.listLoading = false; |
|
|
|
}); |
|
|
|
this.root.childNodes=[] |
|
|
|
this.loadNode(this.root,this.resolve) |
|
|
|
}, |
|
|
|
filterDeptNode(value, data) { |
|
|
|
if (!value) return true; |
|
|
|
@ -305,6 +251,8 @@ |
|
|
|
}, |
|
|
|
loadNode(node, resolve) { |
|
|
|
if (node.level === 0) { |
|
|
|
this.root=node |
|
|
|
this.resolve=resolve |
|
|
|
let params = { |
|
|
|
levelTypes:['L1'] |
|
|
|
}; |
|
|
|
@ -378,17 +326,18 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
<style scoped> |
|
|
|
.filter-tree{ |
|
|
|
<style scoped> |
|
|
|
.filter-tree{ |
|
|
|
margin-top: 14px; |
|
|
|
} |
|
|
|
.filter-input-admin{ |
|
|
|
} |
|
|
|
.filter-input-admin{ |
|
|
|
width:60%; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.filter-input-common{ |
|
|
|
.filter-input-common{ |
|
|
|
width:100%; |
|
|
|
} |
|
|
|
</style> |
|
|
|
} |
|
|
|
</style> |
|
|
|
|