Browse Source

优化用户组件

master
陈裕财 3 years ago
parent
commit
2e90236797
  1. 11
      src/views/mdp/sys/branch/BranchSelect.vue
  2. 65
      src/views/mdp/sys/dept/DeptTree.vue
  3. 4
      src/views/mdp/sys/user/UserMng.vue
  4. 3
      src/views/mdp/sys/user/UsersSelectOnly.vue

11
src/views/mdp/sys/branch/BranchSelect.vue

@ -52,7 +52,8 @@
pageSize:10,//
pageNum:1,//1
orderFields:[],// ['sex','student_id']
orderDirs:[]// asc,desc ['asc','desc']
orderDirs:[],// asc,desc ['asc','desc']
count:false,
},
load:{ list: false, edit: false, del: false, add: false },//...
sels: [],//
@ -109,7 +110,7 @@
let params = {
pageSize: this.pageInfo.pageSize,
pageNum: this.pageInfo.pageNum,
total: this.pageInfo.total,countSql:this.pageInfo.countSql
total: this.pageInfo.total,count:this.pageInfo.count
};
if(this.pageInfo.orderFields!=null && this.pageInfo.orderFields.length>0){
let orderBys=[];
@ -119,9 +120,7 @@
params.orderBy= orderBys.join(",")
}
if(this.filters.key!==""){
//params.xxx=this.filters.key
}else{
//params.xxx=xxxxx
params.key=this.filters.key
}
if( !this.userInfo.isSuperAdmin){
params.id=this.userInfo.branchId;
@ -130,7 +129,7 @@
listBranch(params).then((res) => {
var tips=res.data.tips;
if(tips.isOk){
this.pageInfo.total = res.data.data.total;this.pageInfo.countSql=false;
this.pageInfo.total = res.data.total;this.pageInfo.count=false;
this.branchs = res.data.data;
}else{
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: 'error' });

65
src/views/mdp/sys/dept/DeptTree.vue

@ -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']
};
@ -392,3 +340,4 @@
width:100%;
}
</style>

4
src/views/mdp/sys/user/UserMng.vue

@ -454,6 +454,10 @@ export default {
if (params.deptid == null || params.deptid == "") {
//params.deptid=this.userInfo.deptid;
}
}else{
if(this.branch && this.branch.id){
params.branchId=this.branch.id
}
}
console.log("kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
console.log(params);

3
src/views/mdp/sys/user/UsersSelectOnly.vue

@ -184,6 +184,9 @@
if( deptids && deptids.length>0){
params.deptid=deptids[0]
}
if(this.branch && this.branch.id){
params.branchId=this.branch.id
}
this.load.list = true;
listUser(params).then((res) => {
var tips=res.data.tips;

Loading…
Cancel
Save