| | |
| | | <template> |
| | | <basic-container |
| | | :class="[$store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '']" |
| | | :class="[ |
| | | $store.state.control.screenSize == 1366 ? 'smallSize' : 'normalSize', |
| | | $store.state.control.windowWidth >= 1024 ? 'tooRowSearch1' : '' |
| | | ]" |
| | | > |
| | | <avue-crud |
| | | class="tablesss" |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | ...this.$store.state.control.changePageSize, |
| | | ...this.$store.state.control.changePageSize |
| | | }, |
| | | selectionList: [], |
| | | option: { |
| | |
| | | searchLabelWidth: 55, |
| | | search: true, |
| | | disabled: true, |
| | | prop: "username", |
| | | prop: "username" |
| | | }, |
| | | { |
| | | label: "密码", |
| | | hide: true, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | prop: "password", |
| | | prop: "password" |
| | | }, |
| | | { |
| | | label: "姓名", |
| | |
| | | searchSpan: 4, |
| | | searchLabelWidth: 55, |
| | | disabled: true, |
| | | prop: "sname", |
| | | prop: "sname" |
| | | }, |
| | | { |
| | | label: "身份证号", |
| | | disabled: true, |
| | | search: true, |
| | | display: false, |
| | | prop: "cardid", |
| | | prop: "cardid" |
| | | }, |
| | | { |
| | | label: "部门", |
| | | editDisplay: false, |
| | | prop: "deptName", |
| | | prop: "deptName" |
| | | }, |
| | | { |
| | | label: "角色", |
| | |
| | | dicData: [], |
| | | type: "tree", |
| | | props: { |
| | | label: "title", |
| | | }, |
| | | label: "title" |
| | | } |
| | | }, |
| | | { |
| | | label: "审核状态", |
| | |
| | | dicData: [ |
| | | { |
| | | label: "未审核", |
| | | value: "0", |
| | | value: "0" |
| | | }, |
| | | { |
| | | label: "审核通过", |
| | | value: "1", |
| | | value: "1" |
| | | }, |
| | | { |
| | | label: "审核不通过", |
| | | value: "2", |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | value: "2" |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | }, |
| | | data: [], |
| | | data: [] |
| | | }; |
| | | }, |
| | | created(){ |
| | | if(this.userInfo.role_name=="保安公司管理员"){ |
| | | this.search['type'] = "0"; |
| | | created() { |
| | | if (this.userInfo.role_name == "保安公司管理员") { |
| | | this.search["type"] = "0"; |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | addBtn: this.vaildData(this.permission.zc_add, false), |
| | | viewBtn: this.vaildData(this.permission.zc_view, true), |
| | | delBtn: this.vaildData(this.permission.zc_delete, false), |
| | | editBtn: this.vaildData(this.permission.zc_edit, false), |
| | | editBtn: this.vaildData(this.permission.zc_edit, false) |
| | | }; |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach((ele) => { |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.$store.commit("setWindowSizeHeightAdd"); |
| | | }, |
| | | methods: { |
| | | initData(d) { |
| | | getRoleTree().then((res) => { |
| | | getRoleTree().then(res => { |
| | | const column = this.findObject(this.option.column, "parentId"); |
| | | var k = res.data.data; |
| | | var b = []; |
| | |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, |
| | | (error) => { |
| | | error => { |
| | | loading(); |
| | | window.console.log(error); |
| | | } |
| | |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, |
| | | (error) => { |
| | | error => { |
| | | loading(); |
| | | console.log(error); |
| | | } |
| | |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }, |
| | |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then((res) => { |
| | | getDetail(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.query) |
| | | ).then((res) => { |
| | | ).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.$store.commit("setWindowSizeHeightAdd"); |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style> |
| | | </style> |
| | | <style></style> |