| | |
| | | >删 除 |
| | | </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, |