| | |
| | | this.$refs.loginForm.validate((valid) => { |
| | | if (valid) { |
| | | this.refreshCode(this.loginForm); |
| | | this.message("dahsiofhiusa"); |
| | | // this.message("dahsiofhiusa"); |
| | | return Promise.reject(new Error("注册成功,待审核")); |
| | | } |
| | | }); |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | |
| | | useifid: 266, |
| | | }; |
| | | }, |
| | | created() { |
| | |
| | | deptColumn.editDisplay = false; |
| | | deptColumn.viewDisplay = false; |
| | | deptColumn.hide = true; |
| | | this.useifid = this.userInfo.dept_id; |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | }); |
| | | return ids1.join(","); |
| | | }, |
| | | ...mapState({ |
| | | ...mapState({ |
| | | userInfo: (state) => state.user.userInfo, |
| | | }) |
| | | }), |
| | | }, |
| | | methods: { |
| | | handleChangeTABS(column) { |
| | |
| | | // this.$message.success("页码" + val); |
| | | }, |
| | | rowSave(form, done, loading) { |
| | | form["deptId"] = this.userInfo.dept_id; |
| | | // form["deptId"] = this.userInfo.dept_id; |
| | | if (this.useifid != 266) { |
| | | form["deptId"] = this.useifid; |
| | | } |
| | | adddata(form).then( |
| | | (res) => { |
| | | this.onLoad(this.page); |
| | |
| | | this.onLoad(this.page); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | if (this.useifid != 266) { |
| | | row["deptId"] = this.useifid; |
| | | } |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | |
| | | ...this.query, |
| | | }; |
| | | } |
| | | |
| | | console.log(values); |
| | | if (this.useifid != 266) { |
| | | values["deptId"] = this.useifid; |
| | | } |
| | | // console.log(values); |
| | | |
| | | getdata( |
| | | page.currentPage, |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | useifid: 266, |
| | | }; |
| | | }, |
| | | created() { |
| | |
| | | console.log("保安公司管理员登入"); |
| | | const deptColumn = this.findObject(this.option1.column, "deptId"); |
| | | deptColumn.search = false; |
| | | deptColumn.hide = true; |
| | | this.useifid = this.userInfo.dept_id; |
| | | } else { |
| | | const deptColumn = this.findObject( |
| | | this.option1.column, |
| | |
| | | // const userColumn = this.findObject(this.option1.column, "userIds"); |
| | | // userColumn.dicUrl = "/api/blade-user/page-security-units?deptId="+this.userInfo.dept_id; |
| | | // } |
| | | |
| | | if (this.useifid != 266) { |
| | | form["deptId"] = this.useifid; |
| | | } |
| | | adddata1(form).then( |
| | | (res) => { |
| | | this.onLoad1(this.page1); |
| | |
| | | // const userColumn = this.findObject(this.option1.column, "userIds"); |
| | | // userColumn.dicUrl = "/api/blade-user/page-security-units?deptId="+this.userInfo.dept_id; |
| | | // } |
| | | if (this.useifid != 266) { |
| | | row["deptId"] = this.useifid; |
| | | } |
| | | update1(row).then( |
| | | () => { |
| | | this.onLoad1(this.page1); |
| | |
| | | } else { |
| | | this.initData(1); |
| | | } |
| | | if (this.useifid != 266) { |
| | | values["deptId"] = this.useifid; |
| | | } |
| | | |
| | | getdata1( |
| | | page.currentPage, |
| | |
| | | value: "id" |
| | | }, |
| | | hide: true, |
| | | // search: true, |
| | | type: "select", |
| | | search: true, |
| | | type: "tree", |
| | | }, |
| | | { |
| | | label: "招聘岗位", |
| | |
| | | remove, |
| | | } from "@/api/recruitmentManagement/recruitmentManagement"; |
| | | |
| | | import { mapGetters } from "vuex"; |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | selection: true, |
| | | column: column, |
| | | }, |
| | | useifid: 266, |
| | | }; |
| | | }, |
| | | created() { |
| | | if (this.userInfo.role_name == "保安公司管理员") { |
| | | this.useifid = this.userInfo.dept_id; |
| | | const deptColumn = this.findObject(this.option.column, "deptId"); |
| | | deptColumn.search = false; |
| | | deptColumn.hide = true; |
| | | deptColumn.disabled = true; |
| | | deptColumn.value = this.useifid; |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo"]), |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach((ele) => { |
| | |
| | | // var form = this.data[0]; |
| | | // delete form.id; |
| | | // for (var k = 0; k < 13; k++) { |
| | | if (this.useifid != 266) { |
| | | form["deptId"] = this.useifid; |
| | | } |
| | | adddata(form).then( |
| | | (res) => { |
| | | this.onLoad(this.page); |
| | |
| | | this.onLoad(this.page); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | console.log(row); |
| | | if (this.useifid != 266) { |
| | | row["deptId"] = this.useifid; |
| | | } |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | if (this.useifid != 266) { |
| | | params["deptId"] = this.useifid; |
| | | } |
| | | getdata( |
| | | page.currentPage, |
| | | page.pageSize, |
| | |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | console.log(this.data); |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | |
| | | { |
| | | label: "所属保安公司", |
| | | prop: "deptId", |
| | | searchSpan: 6, |
| | | searchLabelWidth: 110, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入保安公司", |
| | | message: "请输入所属保安公司", |
| | | trigger: "blur" |
| | | }], |
| | | search: true, |
| | | // addDisplay: true, |
| | | // editDisplay: true, |
| | | // viewDisplay: true, |
| | | searchSpan: 4, |
| | | searchLabelWidth: 110, |
| | | hide: true, |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | search: false, |
| | | overHidden: true, |
| | | // searchSpan: 4, |
| | | dicUrl: "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697", |
| | | props: { |
| | | label: "title", |
| | | value: "id" |
| | | }, |
| | | type: "tree", |
| | | width: 250, |
| | | }, |
| | | { |
| | | label: "责任人", |
| | |
| | | >删 除 |
| | | </el-button> |
| | | <el-button |
| | | style="display:none" |
| | | style="display: none" |
| | | type="success" |
| | | size="small" |
| | | plain |
| | |
| | | <script> |
| | | import { data, column } from "./car"; |
| | | import { getdata, adddata, update, remove } from "@/api/car/car"; |
| | | |
| | | import { mapGetters } from "vuex"; |
| | | export default { |
| | | props: ["fromDeptId"], |
| | | data() { |
| | |
| | | menuWidth: 160, |
| | | align: "center", |
| | | selection: true, |
| | | labelWidth:110, |
| | | labelWidth: 110, |
| | | column: column, |
| | | }, |
| | | useifid: 266, |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo"]), |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach((ele) => { |
| | |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | }, |
| | | created() { |
| | | if ( |
| | | this.userInfo.role_name == "装备管理员" || |
| | | this.userInfo.role_name == "保安公司管理员" |
| | | ) { |
| | | this.useifid = this.userInfo.dept_id; |
| | | } |
| | | }, |
| | | methods: { |
| | | handleImport() { |
| | |
| | | if (this.fromDeptId != undefined) { |
| | | form["deptId"] = this.fromDeptId; |
| | | } |
| | | if (this.useifid != 266) { |
| | | form["deptId"] = this.useifid; |
| | | } |
| | | adddata(form).then( |
| | | (res) => { |
| | | this.onLoad(this.page); |
| | |
| | | // delete row.tenantName; |
| | | if (this.fromDeptId != undefined) { |
| | | row["deptId"] = this.fromDeptId; |
| | | } |
| | | if (this.useifid != 266) { |
| | | row["deptId"] = this.useifid; |
| | | } |
| | | update(row).then( |
| | | () => { |
| | |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | closeDep(name) { |
| | | for (let k in this.option.column) { |
| | | if (this.option.column[k].prop == name) { |
| | | this.option.column[k].search = false; |
| | | this.option.column[k].hide = true; |
| | | this.option.column[k].addDisplay = false; |
| | | this.option.column[k].editDisplay = false; |
| | | } |
| | | } |
| | | }, |
| | | openDep(name) { |
| | | for (let k in this.option.column) { |
| | | if (this.option.column[k].prop == name) { |
| | | this.option.column[k].search = true; |
| | | this.option.column[k].hide = false; |
| | | this.option.column[k].addDisplay = true; |
| | | this.option.column[k].editDisplay = true; |
| | | } |
| | | } |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | // console.log(params.deptId); |
| | | if (this.fromDeptId != undefined) { |
| | | params["deptId"] = this.fromDeptId; |
| | | this.option.column[4].search = false; |
| | | this.option.column[4].hide = true; |
| | | this.option.column[4].addDisplay = false; |
| | | this.option.column[4].editDisplay = false; |
| | | // this.closeDep("deptId"); |
| | | } else if (this.useifid != 266) { |
| | | console.log(123); |
| | | params["deptId"] = this.useifid; |
| | | // this.closeDep("deptId"); |
| | | // for (let k in this.option.column) { |
| | | // if (this.option.column[k].prop == "deptId") { |
| | | // this.option.column[4].search = false; |
| | | // this.option.column[k].hide = true; |
| | | // this.option.column[k].addDisplay = false; |
| | | // this.option.column[k].editDisplay = false; |
| | | // } |
| | | // } |
| | | } else { |
| | | this.option.column[4].search = true; |
| | | this.option.column[4].hide = false; |
| | | this.option.column[4].addDisplay = true; |
| | | this.option.column[4].editDisplay = true; |
| | | this.openDep("deptId"); |
| | | } |
| | | getdata( |
| | | page.currentPage, |
| | |
| | | message: "请输入所属保安公司", |
| | | trigger: "blur" |
| | | }], |
| | | hide: false, |
| | | search: true, |
| | | hide: true, |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | search: false, |
| | | overHidden: true, |
| | | dicUrl: "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697", |
| | | props: { |
| | |
| | | <script> |
| | | import { data, column } from "./equipments"; |
| | | import { getdata, adddata, update, remove } from "@/api/equipments/equipments"; |
| | | |
| | | import { mapGetters } from "vuex"; |
| | | export default { |
| | | props: ["fromDeptId"], |
| | | data() { |
| | |
| | | column: column, |
| | | labelWidth: 110, |
| | | }, |
| | | |
| | | useifid: 266, |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo"]), |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach((ele) => { |
| | |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | }, |
| | | created() { |
| | | if ( |
| | | this.userInfo.role_name == "装备管理员" || |
| | | this.userInfo.role_name == "保安公司管理员" |
| | | ) { |
| | | this.useifid = this.userInfo.dept_id; |
| | | } |
| | | }, |
| | | methods: { |
| | | handleImport() { |
| | |
| | | if (this.fromDeptId != undefined) { |
| | | form["deptId"] = this.fromDeptId; |
| | | } |
| | | if (this.useifid != 266) { |
| | | form["deptId"] = this.useifid; |
| | | } |
| | | adddata(form).then( |
| | | (res) => { |
| | | this.onLoad(this.page); |
| | |
| | | // console.log(row.deptId); |
| | | if (this.fromDeptId != undefined) { |
| | | row["deptId"] = this.fromDeptId; |
| | | } |
| | | if (this.useifid != 266) { |
| | | row["deptId"] = this.useifid; |
| | | } |
| | | update(row).then( |
| | | () => { |
| | |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | closeDep(name) { |
| | | for (let k in this.option.column) { |
| | | if (this.option.column[k].prop == name) { |
| | | this.option.column[k].search = false; |
| | | this.option.column[k].hide = true; |
| | | this.option.column[k].addDisplay = false; |
| | | this.option.column[k].editDisplay = false; |
| | | } |
| | | } |
| | | }, |
| | | openDep(name) { |
| | | for (let k in this.option.column) { |
| | | if (this.option.column[k].prop == name) { |
| | | this.option.column[k].search = true; |
| | | this.option.column[k].hide = false; |
| | | this.option.column[k].addDisplay = true; |
| | | this.option.column[k].editDisplay = true; |
| | | } |
| | | } |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | // console.log(params.deptId); |
| | | if (this.fromDeptId != undefined) { |
| | | params["deptId"] = this.fromDeptId; |
| | | for (let k in this.option.column) { |
| | | if (this.option.column[k].prop == "deptId") { |
| | | this.option.column[k].search = false; |
| | | this.option.column[k].hide = true; |
| | | this.option.column[k].addDisplay = false; |
| | | this.option.column[k].editDisplay = false; |
| | | } |
| | | } |
| | | // this.option.column[4]. = false; |
| | | // this.option.column[6].search = false; |
| | | // this.option.column[6].hide = true; |
| | | // this.option.column[6].addDisplay = false; |
| | | // this.option.column[6].editDisplay = false; |
| | | // this.closeDep("deptId"); |
| | | } else if (this.useifid != 266) { |
| | | console.log(123); |
| | | params["deptId"] = this.useifid; |
| | | // this.closeDep("deptId"); |
| | | // for (let k in this.option.column) { |
| | | // if (this.option.column[k].prop == "deptId") { |
| | | // this.option.column[4].search = false; |
| | | // this.option.column[k].hide = true; |
| | | // this.option.column[k].addDisplay = false; |
| | | // this.option.column[k].editDisplay = false; |
| | | // } |
| | | // } |
| | | } else { |
| | | for (let k in this.option.column) { |
| | | if (this.option.column[k].prop == "deptId") { |
| | | this.option.column[k].search = true; |
| | | this.option.column[k].hide = false; |
| | | this.option.column[k].addDisplay = true; |
| | | this.option.column[k].editDisplay = true; |
| | | } |
| | | } |
| | | // this.option.column[4].search = true; |
| | | // this.option.column[6].search = true; |
| | | // this.option.column[6].hide = false; |
| | | // this.option.column[6].addDisplay = true; |
| | | // this.option.column[6].editDisplay = true; |
| | | this.openDep("deptId"); |
| | | } |
| | | |
| | | getdata( |
| | | page.currentPage, |
| | | page.pageSize, |
| | |
| | | { |
| | | label: "所属保安公司", |
| | | prop: "deptId", |
| | | search: true, |
| | | searchSpan: 4, |
| | | searchSpan: 6, |
| | | searchLabelWidth: 110, |
| | | labelWidth: 160, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入组织机构", |
| | | message: "请输入所属保安公司", |
| | | trigger: "blur" |
| | | }], |
| | | hide: true, |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | search: false, |
| | | overHidden: true, |
| | | // searchSpan: 4, |
| | | dicUrl: "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697", |
| | | props: { |
| | | label: "title", |
| | | value: "id" |
| | | }, |
| | | type: "tree", |
| | | width: 250, |
| | | }, |
| | | { |
| | | label: "责任人", |
| | |
| | | import { data, column } from "./gun"; |
| | | import { getdata, adddata, update, remove } from "@/api/gun/gun"; |
| | | |
| | | import { mapGetters } from "vuex"; |
| | | export default { |
| | | props: ["fromDeptId"], |
| | | data() { |
| | |
| | | align: "center", |
| | | border: true, |
| | | selection: true, |
| | | labelWidth:110, |
| | | labelWidth: 110, |
| | | column: column, |
| | | }, |
| | | useifid: 266, |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo"]), |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach((ele) => { |
| | |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | }, |
| | | created() { |
| | | if ( |
| | | this.userInfo.role_name == "装备管理员" || |
| | | this.userInfo.role_name == "保安公司管理员" |
| | | ) { |
| | | this.useifid = this.userInfo.dept_id; |
| | | } |
| | | }, |
| | | methods: { |
| | | sizeChange(val) { |
| | |
| | | // delete form.tenantName; |
| | | if (this.fromDeptId != undefined) { |
| | | form["deptId"] = this.fromDeptId; |
| | | } |
| | | if (this.useifid != 266) { |
| | | form["deptId"] = this.useifid; |
| | | } |
| | | adddata(form).then( |
| | | (res) => { |
| | |
| | | // delete row.tenantName; |
| | | if (this.fromDeptId != undefined) { |
| | | row["deptId"] = this.fromDeptId; |
| | | } |
| | | if (this.useifid != 266) { |
| | | row["deptId"] = this.useifid; |
| | | } |
| | | update(row).then( |
| | | () => { |
| | |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | closeDep(name) { |
| | | for (let k in this.option.column) { |
| | | if (this.option.column[k].prop == name) { |
| | | this.option.column[k].search = false; |
| | | this.option.column[k].hide = true; |
| | | this.option.column[k].addDisplay = false; |
| | | this.option.column[k].editDisplay = false; |
| | | } |
| | | } |
| | | }, |
| | | openDep(name) { |
| | | for (let k in this.option.column) { |
| | | if (this.option.column[k].prop == name) { |
| | | this.option.column[k].search = true; |
| | | this.option.column[k].hide = false; |
| | | this.option.column[k].addDisplay = true; |
| | | this.option.column[k].editDisplay = true; |
| | | } |
| | | } |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | // console.log(params.deptId); |
| | | if (this.fromDeptId != undefined) { |
| | | params["deptId"] = this.fromDeptId; |
| | | this.option.column[5].search = false; |
| | | this.option.column[5].hide = true; |
| | | this.option.column[5].addDisplay = false; |
| | | this.option.column[5].editDisplay = false; |
| | | // this.closeDep("deptId"); |
| | | } else if (this.useifid != 266) { |
| | | console.log(123); |
| | | params["deptId"] = this.useifid; |
| | | // this.closeDep("deptId"); |
| | | // for (let k in this.option.column) { |
| | | // if (this.option.column[k].prop == "deptId") { |
| | | // this.option.column[4].search = false; |
| | | // this.option.column[k].hide = true; |
| | | // this.option.column[k].addDisplay = false; |
| | | // this.option.column[k].editDisplay = false; |
| | | // } |
| | | // } |
| | | } else { |
| | | this.option.column[5].search = true; |
| | | this.option.column[5].hide = false; |
| | | this.option.column[5].addDisplay = true; |
| | | this.option.column[5].editDisplay = true; |
| | | this.openDep("deptId"); |
| | | } |
| | | getdata( |
| | | page.currentPage, |
| | |
| | | }, |
| | | action: "/api/blade-resource/oss/endpoint/put-files", |
| | | tip: "只能上传jpg/png个人头像,且不超过500kb", |
| | | span: 10, |
| | | span: 12, |
| | | // row: true, |
| | | prop: "avatar", |
| | | }, |
| | |
| | | }, |
| | | action: "/api/blade-resource/oss/endpoint/put-files", |
| | | tip: "只能上传jpg/png指纹信息,且不超过500kb", |
| | | span: 10, |
| | | span: 12, |
| | | // row: true, |
| | | prop: "fingerprint", |
| | | }, |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | | :permission="permissionList" |
| | | :before-open="beforeOpen" |
| | | v-model="form" |
| | | ref="crud" |
| | | @row-update="rowUpdate" |
| | | @row-save="rowSave" |
| | | @row-del="rowDel" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | | :permission="permissionList" |
| | | :before-open="beforeOpen" |
| | | v-model="form" |
| | | ref="crud" |
| | | @row-update="rowUpdate" |
| | | @row-save="rowSave" |
| | | @row-del="rowDel" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad" |
| | | > |
| | | <template slot="menuLeft"> |
| | | <el-button type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | v-if="permission.zc_delete" |
| | | @click="handleDelete">删 除 |
| | | <el-button |
| | | type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | v-if="permission.zc_delete" |
| | | @click="handleDelete" |
| | | >删 除 |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="{row}" slot="type"> |
| | | <el-tag>{{row.type==='0'?'未审核':row.type==='1'?'审核通过':'审核未通过'}}</el-tag> |
| | | <template slot-scope="{ row }" slot="type"> |
| | | <el-tag>{{ |
| | | row.type === "0" |
| | | ? "未审核" |
| | | : row.type === "1" |
| | | ? "审核通过" |
| | | : "审核未通过" |
| | | }}</el-tag> |
| | | </template> |
| | | |
| | | <template slot-scope="{row}" |
| | | slot="roleName"> |
| | | <el-tag>{{row.roleName}}</el-tag> |
| | | <template slot-scope="{ row }" slot="roleName"> |
| | | <el-tag>{{ row.roleName }}</el-tag> |
| | | </template> |
| | | <template slot-scope="scope" slot="menu"> |
| | | <el-button icon="el-icon-check" size="small" @click.stop="handleEdit(scope.row,scope.index)">审核</el-button> |
| | | <el-button |
| | | icon="el-icon-check" |
| | | size="small" |
| | | @click.stop="handleEdit(scope.row, scope.index)" |
| | | >审核</el-button |
| | | > |
| | | </template> |
| | | </avue-crud> |
| | | |
| | | |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getList, getDetail, add, update, remove} from "@/api/zc/zc"; |
| | | import {getRoleTree} from "@/api/system/role"; |
| | | import {mapGetters} from "vuex"; |
| | | import { getList, getDetail, add, update, remove } from "@/api/zc/zc"; |
| | | import { getRoleTree } from "@/api/system/role"; |
| | | import { mapGetters } from "vuex"; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | form: {}, |
| | | query: {}, |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | selectionList: [], |
| | | option: { |
| | | height:'auto', |
| | | calcHeight: 54, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 4, |
| | | border: true, |
| | | index: true, |
| | | viewBtn: true, |
| | | selection: true, |
| | | headerAlign: 'center', |
| | | align: 'center', |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: "账号", |
| | | searchSpan:4, |
| | | display: false, |
| | | search: true, |
| | | disabled:true, |
| | | prop: "username", |
| | | export default { |
| | | data() { |
| | | return { |
| | | form: {}, |
| | | query: {}, |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | }, |
| | | selectionList: [], |
| | | option: { |
| | | height: "auto", |
| | | calcHeight: 54, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 4, |
| | | border: true, |
| | | index: true, |
| | | viewBtn: true, |
| | | selection: true, |
| | | headerAlign: "center", |
| | | align: "center", |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: "账号", |
| | | searchSpan: 4, |
| | | display: false, |
| | | search: true, |
| | | disabled: true, |
| | | prop: "username", |
| | | }, |
| | | { |
| | | label: "密码", |
| | | hide: true, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | prop: "password", |
| | | }, |
| | | { |
| | | label: "姓名", |
| | | display: false, |
| | | search: true, |
| | | searchSpan: 4, |
| | | disabled: true, |
| | | prop: "sname", |
| | | }, |
| | | { |
| | | label: "身份证号", |
| | | disabled: true, |
| | | search: true, |
| | | display: false, |
| | | prop: "cardid", |
| | | }, |
| | | { |
| | | label: "部门", |
| | | editDisplay: false, |
| | | prop: "deptName", |
| | | }, |
| | | { |
| | | label: "角色", |
| | | prop: "parentId", |
| | | hide: true, |
| | | dicData: [], |
| | | type: "tree", |
| | | props: { |
| | | label: "title", |
| | | }, |
| | | { |
| | | label: "密码", |
| | | hide: true, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | prop: "password", |
| | | }, |
| | | { |
| | | label: "姓名", |
| | | display: false, |
| | | search: true, |
| | | searchSpan:4, |
| | | disabled:true, |
| | | prop: "sname", |
| | | }, |
| | | { |
| | | label: "身份证号", |
| | | disabled:true, |
| | | search: true, |
| | | display: false, |
| | | prop: "cardid", |
| | | }, |
| | | { |
| | | label: "部门", |
| | | editDisplay: false, |
| | | prop: "deptName", |
| | | }, |
| | | { |
| | | label: "角色", |
| | | prop: "parentId", |
| | | hide: true, |
| | | dicData: [], |
| | | type: "tree", |
| | | props: { |
| | | label: "title" |
| | | }, |
| | | { |
| | | label: "审核状态", |
| | | prop: "type", |
| | | search: true, |
| | | slot: true, |
| | | searchSpan: 4, |
| | | type: "select", |
| | | dicData: [ |
| | | { |
| | | label: "未审核", |
| | | value: "0", |
| | | }, |
| | | }, |
| | | { |
| | | label: "审核状态", |
| | | prop: "type", |
| | | search: true, |
| | | slot: true, |
| | | searchSpan:4, |
| | | type: "select", |
| | | dicData: [ |
| | | { |
| | | label: "未审核", |
| | | value: "0" |
| | | }, |
| | | { |
| | | label: "审核通过", |
| | | value: "1" |
| | | }, |
| | | { |
| | | label: "审核不通过", |
| | | value: "2" |
| | | } |
| | | |
| | | ], |
| | | } |
| | | ] |
| | | }, |
| | | data: [] |
| | | { |
| | | label: "审核通过", |
| | | value: "1", |
| | | }, |
| | | { |
| | | label: "审核不通过", |
| | | value: "2", |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | }, |
| | | data: [], |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo", "permission"]), |
| | | permissionList() { |
| | | return { |
| | | 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), |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | permissionList() { |
| | | return { |
| | | 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) |
| | | }; |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | } |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach((ele) => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | methods: { |
| | | initData(){ |
| | | getRoleTree().then(res => { |
| | | const column = this.findObject(this.option.column, "parentId"); |
| | | column.dicData = res.data.data; |
| | | }); |
| | | }, |
| | | handleEdit (row, index) { |
| | | this.initData(); |
| | | this.$refs.crud.rowEdit(row, index); |
| | | }, |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | }, |
| | | methods: { |
| | | initData(d) { |
| | | getRoleTree().then((res) => { |
| | | const column = this.findObject(this.option.column, "parentId"); |
| | | 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; |
| | | } |
| | | }); |
| | | }, |
| | | handleEdit(row, index) { |
| | | this.initData(this.userInfo.role_name); |
| | | this.$refs.crud.rowEdit(row, index); |
| | | }, |
| | | rowSave(row, done, loading) { |
| | | add(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | }, |
| | | (error) => { |
| | | loading(); |
| | | window.console.log(error); |
| | | }); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | } |
| | | ); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | }, |
| | | (error) => { |
| | | loading(); |
| | | console.log(error); |
| | | } |
| | | ); |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | }); |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | | done(); |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | }, |
| | | currentChange(currentPage){ |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange(pageSize){ |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then((res) => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | done(); |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | getList( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.query) |
| | | ).then((res) => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style> |
| | | |
| | | </style> |