diff --git a/yanzhu-ui/src/views/base/assetsType/index.vue b/yanzhu-ui/src/views/base/assetsType/index.vue index 3a7e32d..1382b1b 100644 --- a/yanzhu-ui/src/views/base/assetsType/index.vue +++ b/yanzhu-ui/src/views/base/assetsType/index.vue @@ -91,8 +91,8 @@ @pagination="getList" /> - + @@ -117,9 +117,15 @@ +<<<<<<< HEAD
+======= +
+ +>>>>>>> c55cd0599b359c435db26a66f3232d599b2d2048 {{ it.text }} @@ -291,7 +297,7 @@ export default { deptId: this.nonAdmin?this.queryParams.defaultDeptId:null, type: null, name: null, - sunit: null, + sunit: "", unit: null, isDel: null, createBy: null, @@ -342,6 +348,7 @@ export default { handleUpdate(row) { this.reset(); const id = row.id || this.ids +<<<<<<< HEAD if(row.unit){ let tmps=row.unit.split(",").filter(d=>d); let uns=this.units.map(d=>d.text).join(",") @@ -358,8 +365,24 @@ export default { it.sel=(","+row.unit+",").indexOf(","+it.text+",")>=0; }); } +======= + let tmps = row.unit.split(",").filter(d => d); + let uns = this.units.map(d => d.text).join(",") + tmps.forEach(it => { + if (("," + uns + ",").indexOf("," + it + ",") == -1) { + this.units.push({ + text: it, + del: false, + sys: false + }) + } + }); + this.units.forEach(it => { + it.sel = ("," + row.unit + ",").indexOf("," + it.text + ",") >= 0; + }); +>>>>>>> c55cd0599b359c435db26a66f3232d599b2d2048 getAssetsType(id).then(response => { - this.form = {...response.data,sunit:''}; + this.form = { ...response.data, sunit: '' }; this.open = true; this.title = "修改物资类型"; }); @@ -483,4 +506,5 @@ export default { } } } -} \ No newline at end of file +} + \ No newline at end of file diff --git a/yanzhu-ui/src/views/system/role/authUser.vue b/yanzhu-ui/src/views/system/role/authUser.vue index 147aa33..6129aa1 100644 --- a/yanzhu-ui/src/views/system/role/authUser.vue +++ b/yanzhu-ui/src/views/system/role/authUser.vue @@ -1,23 +1,13 @@ @@ -143,10 +104,10 @@ export default { getList() { this.loading = true; allocatedUserList(this.queryParams).then(response => { - this.userList = response.rows; - this.total = response.total; - this.loading = false; - } + this.userList = response.rows; + this.total = response.total; + this.loading = false; + } ); }, // 返回按钮 @@ -176,23 +137,23 @@ export default { /** 取消授权按钮操作 */ cancelAuthUser(row) { const roleId = this.queryParams.roleId; - this.$modal.confirm('确认要取消该用户"' + row.userName + '"角色吗?').then(function() { + this.$modal.confirm('确认要取消该用户"' + row.userName + '"角色吗?').then(function () { return authUserCancel({ userId: row.userId, roleId: roleId }); }).then(() => { this.getList(); this.$modal.msgSuccess("取消授权成功"); - }).catch(() => {}); + }).catch(() => { }); }, /** 批量取消授权按钮操作 */ cancelAuthUserAll(row) { const roleId = this.queryParams.roleId; const userIds = this.userIds.join(","); - this.$modal.confirm('是否取消选中用户授权数据项?').then(function() { + this.$modal.confirm('是否取消选中用户授权数据项?').then(function () { return authUserCancelAll({ roleId: roleId, userIds: userIds }); }).then(() => { this.getList(); this.$modal.msgSuccess("取消授权成功"); - }).catch(() => {}); + }).catch(() => { }); } } }; diff --git a/yanzhu-ui/src/views/system/user/index.vue b/yanzhu-ui/src/views/system/user/index.vue index 1e7336c..a96b48f 100644 --- a/yanzhu-ui/src/views/system/user/index.vue +++ b/yanzhu-ui/src/views/system/user/index.vue @@ -128,7 +128,7 @@ - + @@ -346,6 +346,7 @@ export default { this.form.deptId=undefined; },400); }else{ + debugger if(a.data.level==1){//公司 this.roleOptions=this.oldRoleOptions.filter(d=>{ return d.roleName=="公司管理员"||d.roleName=="普通角色"; @@ -354,13 +355,16 @@ export default { this.roleOptions=this.oldRoleOptions.filter(d=>{ return d.roleName=="段队管理员"||d.roleName=="普通角色"; }); - }else if(a.data.level==300){//项目 + }else if(a.data.level==300){//项目 this.roleOptions=this.oldRoleOptions.filter(d=>{ - return d.roleName=="项目管理员"||d.roleName=="普通角色"; + return [2,3,4,5,8].indexOf(d.roleId)>=0; }); }else{ + let node=this.$refs.treeSel.selectedNodes[0]; + let plevel=node.parentNode?.raw?.data?.level||0; + let roles=[2,3,4,5]; this.roleOptions=this.oldRoleOptions.filter(d=>{ - return d.roleName=="公司管理员"||d.roleName=="普通角色"; + return roles.indexOf(d.roleId)>=0; }); } @@ -477,7 +481,7 @@ export default { handleUpdate(row) { this.reset(); const userId = row.userId || this.ids; - getUser(userId).then(response => { + getUser(userId).then(response => { this.form = response.data; this.postOptions = response.posts; this.roleOptions = response.roles; @@ -491,6 +495,10 @@ export default { let node=this.$refs.treeSel.getNode(this.form.deptId); this.$refs.treeSel.select(node); this.doInputDept(node.raw); + let roles=response.data.roles; + if(roles.length>0){ + this.form.roleId=roles[0].roleId; + } const func=p=>{ p.isExpanded=true; if(p.parentNode){