| | |
| | | <el-tag>{{ row.roleName }}</el-tag> |
| | | </template> |
| | | <template slot-scope="{ row }" slot="deptName"> |
| | | <el-tag>{{ row.deptName }}</el-tag> |
| | | <el-tag>{{ row.deptName.split(",").join(" ,") }}</el-tag> |
| | | </template> |
| | | <template slot-scope="{ row }" slot="userTypeName"> |
| | | <el-tag>{{ row.userTypeName }}</el-tag> |
| | |
| | | callback(); |
| | | } |
| | | }; |
| | | |
| | | return { |
| | | isguanli: true, |
| | | |
| | |
| | | treeOption: { |
| | | nodeKey: "id", |
| | | lazy: true, |
| | | treeLoad: function (node, resolve) { |
| | | const parentId = node.level === 0 ? 0 : node.data.id; |
| | | getDeptLazyTree(parentId).then((res) => { |
| | | resolve( |
| | | res.data.data.map((item) => { |
| | | return { |
| | | ...item, |
| | | leaf: !item.hasChildren, |
| | | }; |
| | | }) |
| | | ); |
| | | }); |
| | | }, |
| | | treeLoad: "", //处理权限 在created中 |
| | | // function (node, resolve) { |
| | | // const parentId = node.level === 0 ? 0 : node.data.id; |
| | | // //公安局进入 |
| | | |
| | | // getDeptLazyTree(parentId, jurisdiction).then((res) => { |
| | | // resolve( |
| | | // res.data.data.map((item) => { |
| | | // return { |
| | | // ...item, |
| | | // leaf: !item.hasChildren, |
| | | // }; |
| | | // }) |
| | | // ); |
| | | // }); |
| | | // }, |
| | | addBtn: false, |
| | | menu: false, |
| | | size: "small", |
| | |
| | | label: "登录账号", |
| | | prop: "account", |
| | | search: true, |
| | | width: 190, |
| | | display: false, |
| | | }, |
| | | { |
| | |
| | | watch: { |
| | | "form.tenantId"() { |
| | | if (this.form.tenantId !== "" && this.initFlag) { |
| | | this.initData(this.form.tenantId); |
| | | this.initData(this.form.tenantId, this.userInfo.role_name); |
| | | } |
| | | }, |
| | | "form.deptId"() { |
| | | this.initData(this.form.tenantId); |
| | | this.initData(this.form.tenantId, this.userInfo.role_name); |
| | | }, |
| | | "excelForm.isCovered"() { |
| | | if (this.excelForm.isCovered !== "") { |
| | |
| | | this.deptids = this.userInfo.dept_id; |
| | | this.sizes = [0, 24]; |
| | | this.isguanli = false; |
| | | // this.option.group[2].value = this.userInfo.Id; |
| | | this.option.group[0].column[0]["value"] = this.userInfo.dept_id; |
| | | this.option.group[0].column[0]["disabled"] = true; |
| | | // this.option.group[2].column[1]["disabled"] = true; |
| | | } else { |
| | | this.deptids = null; |
| | | this.sizes = [5, 19]; |
| | | } |
| | | |
| | | //公安局进入 |
| | | var jurisdiction = ""; |
| | | if (this.userInfo.role_name == "公安管理员") { |
| | | jurisdiction = this.userInfo.jurisdiction; |
| | | this.treeOption.treeLoad = function (node, resolve) { |
| | | const parentId = node.level === 0 ? 0 : node.data.id; |
| | | getDeptLazyTree(parentId, jurisdiction).then((res) => { |
| | | resolve( |
| | | res.data.data.map((item) => { |
| | | return { |
| | | ...item, |
| | | leaf: !item.hasChildren, |
| | | }; |
| | | }) |
| | | ); |
| | | }); |
| | | }; |
| | | } else { |
| | | this.treeOption.treeLoad = function (node, resolve) { |
| | | const parentId = node.level === 0 ? 0 : node.data.id; |
| | | getDeptLazyTree(parentId).then((res) => { |
| | | resolve( |
| | | res.data.data.map((item) => { |
| | | return { |
| | | ...item, |
| | | leaf: !item.hasChildren, |
| | | }; |
| | | }) |
| | | ); |
| | | }); |
| | | }; |
| | | } |
| | | }, |
| | | mounted() { |
| | | // 非保安单位模式默认加载管理组数据 |
| | | if (!website.tenantMode) { |
| | | this.initData(website.tenantId); |
| | | this.initData(website.tenantId, this.userInfo.role_name); |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page); |
| | | }, |
| | | initData(tenantId) { |
| | | initData(tenantId, d) { |
| | | getRoleTree(tenantId).then((res) => { |
| | | const column = this.findObject(this.option.group, "roleId"); |
| | | column.dicData = res.data.data; |
| | | var k = res.data.data; |
| | | var b = []; |
| | | if (d == "保安公司管理员") { |
| | | console.log(k); |
| | | for (var n in k) { |
| | | if (k[n].title == "保安" || k[n].title == "保安公司管理员") { |
| | | b.push(k[n]); |
| | | } |
| | | } |
| | | column.dicData = b; |
| | | } else { |
| | | column.dicData = k; |
| | | } |
| | | }); |
| | | getDeptTree(tenantId).then((res) => { |
| | | const column = this.findObject(this.option.group, "deptId"); |
| | |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | var deptid = this.deptids == null ? this.treeDeptId : this.deptids; |
| | | //公安局进入 |
| | | if (this.userInfo.role_name == "公安管理员") { |
| | | params["jurisdiction"] = this.userInfo.jurisdiction; |
| | | } |
| | | params['status'] = 1; |
| | | getList( |
| | | page.currentPage, |
| | | page.pageSize, |