| | |
| | | <template> |
| | | <el-row class="user"> |
| | | <el-col :span="5"> |
| | | <el-col :span="sizes[0]"> |
| | | <div class="box"> |
| | | <el-scrollbar> |
| | | <basic-container> |
| | |
| | | </el-scrollbar> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="19"> |
| | | <el-col :span="sizes[1]"> |
| | | <basic-container> |
| | | <avue-crud |
| | | :option="option" |
| | |
| | | type="info" |
| | | size="small" |
| | | plain |
| | | v-if="permission.user_role" |
| | | v-if="permission.user_role && isguanli" |
| | | icon="el-icon-user" |
| | | @click="handleGrant" |
| | | >角色配置 |
| | |
| | | add, |
| | | grant, |
| | | resetPassword, |
| | | getJurisdiction, |
| | | } from "@/api/system/user"; |
| | | import { getDeptTree, getDeptLazyTree } from "@/api/system/dept"; |
| | | import { getRoleTree } from "@/api/system/role"; |
| | |
| | | } |
| | | }; |
| | | return { |
| | | form: { |
| | | }, |
| | | isguanli: true, |
| | | |
| | | sizes: [5, 19], |
| | | deptids: null, |
| | | |
| | | form: {}, |
| | | search: {}, |
| | | roleBox: false, |
| | | excelBox: false, |
| | |
| | | label: "所属组织机构", |
| | | prop: "deptName", |
| | | slot: true, |
| | | overHidden: true, |
| | | display: false, |
| | | }, |
| | | { |
| | | label: "用户姓名", |
| | | prop: "realName", |
| | | search: true, |
| | | width: 90, |
| | | display: false, |
| | | }, |
| | | { |
| | | label: "所属角色", |
| | | prop: "roleName", |
| | | slot: true, |
| | | width: 130, |
| | | display: false, |
| | | }, |
| | | // { |
| | |
| | | { |
| | | label: "密码", |
| | | prop: "password", |
| | | type:'password', |
| | | type: "password", |
| | | hide: true, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | |
| | | { |
| | | label: "确认密码", |
| | | prop: "password2", |
| | | type:'password', |
| | | type: "password", |
| | | hide: true, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | |
| | | label: "女", |
| | | value: 2, |
| | | }, |
| | | { |
| | | label: "未知", |
| | | value: 3, |
| | | }, |
| | | // { |
| | | // label: "未知", |
| | | // value: 3, |
| | | // }, |
| | | ], |
| | | hide: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择性别", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "用户生日", |
| | |
| | | return ids.join(","); |
| | | }, |
| | | }, |
| | | created() { |
| | | console.log(this.userInfo.role_name); |
| | | if (this.userInfo.role_name == "保安公司管理员") { |
| | | this.deptids = this.userInfo.dept_id; |
| | | this.sizes = [0, 24]; |
| | | this.isguanli = false; |
| | | // this.option.group[2].value = this.userInfo.Id; |
| | | } else { |
| | | this.deptids = null; |
| | | this.sizes = [5, 19]; |
| | | } |
| | | }, |
| | | mounted() { |
| | | // 非保安单位模式默认加载管理组数据 |
| | | if (!website.tenantMode) { |
| | |
| | | row.deptId = row.deptId; |
| | | row.roleId = row.roleId.join(","); |
| | | row.postId = row.postId.join(","); |
| | | add(row).then( |
| | | () => { |
| | | this.initFlag = false; |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | loading(); |
| | | console.log(row, "row"); |
| | | var params = { |
| | | deptname: row.$deptId, |
| | | }; |
| | | getJurisdiction(params).then((res) => { |
| | | // console.log(res.data.data); |
| | | // return; |
| | | if (res.data.msg != "暂无承载数据") { |
| | | row.jurisdiction = res.data.data; |
| | | } else { |
| | | row.jurisdiction = ""; |
| | | } |
| | | ); |
| | | add(row).then( |
| | | () => { |
| | | this.initFlag = false; |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | | ); |
| | | }); |
| | | // return; |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | row.deptId = row.deptId; |
| | |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | params['status'] = 1; |
| | | var deptid = this.deptids == null ? this.treeDeptId : this.deptids; |
| | | getList( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.query), |
| | | this.treeDeptId |
| | | deptid |
| | | ).then((res) => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | |
| | | }, |
| | | platformOnLoad(page, params = {}) { |
| | | this.platformLoading = true; |
| | | var deptid = this.deptids == null ? this.treeDeptId : this.deptids; |
| | | getList( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.query), |
| | | this.treeDeptId |
| | | deptid |
| | | ).then((res) => { |
| | | const data = res.data.data; |
| | | this.platformPage.total = data.total; |