| | |
| | | <template> |
| | | <div class="equipments"> |
| | | <avue-crud |
| | | :option="option" |
| | | :data="data" |
| | | :page.sync="page" |
| | | ref="crudrec" |
| | | @on-load="onLoad" |
| | | :table-loading="loading" |
| | | @row-save="rowSave" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @row-update="rowUpdate" |
| | | @row-del="rowDel" |
| | | @selection-change="selectionChange" |
| | | @refresh-change="refreshChange" |
| | | > |
| | | <template slot="menuLeft"> |
| | | <el-button |
| | | type="danger" |
| | | size="small" |
| | | plain |
| | | icon="el-icon-delete" |
| | | @click="handleDelete" |
| | | >删 除 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </div> |
| | | <basic-container> |
| | | <div class="equipments"> |
| | | <avue-crud |
| | | :option="option" |
| | | :data="data" |
| | | :page.sync="page" |
| | | ref="crudrec" |
| | | @on-load="onLoad" |
| | | :table-loading="loading" |
| | | @row-save="rowSave" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @row-update="rowUpdate" |
| | | @row-del="rowDel" |
| | | @selection-change="selectionChange" |
| | | @refresh-change="refreshChange" |
| | | > |
| | | <template slot="menuLeft"> |
| | | <el-button |
| | | type="danger" |
| | | size="small" |
| | | plain |
| | | icon="el-icon-delete" |
| | | @click="handleDelete" |
| | | >删 除 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </div> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | import { getdata, adddata, update, remove } from "@/api/gun/gun"; |
| | | |
| | | export default { |
| | | props: ["fromDeptId"], |
| | | data() { |
| | | return { |
| | | loading: true, |
| | |
| | | tip: false, |
| | | searchSize: "mini", |
| | | searchMenuSpan: 6, |
| | | height: 627, |
| | | height: 583, |
| | | index: true, |
| | | menuWidth: 160, |
| | | align: "center", |
| | | border: true, |
| | | selection: true, |
| | | labelWidth:110, |
| | | column: column, |
| | | }, |
| | | }; |
| | |
| | | // var form = this.data[0]; |
| | | // delete form.id; |
| | | // for (var k = 0; k < 13; k++) { |
| | | form["deptId"] = form.tenantName; |
| | | delete form.tenantName; |
| | | // form["deptId"] = form.tenantName; |
| | | // delete form.tenantName; |
| | | if (this.fromDeptId != undefined) { |
| | | form["deptId"] = this.fromDeptId; |
| | | } |
| | | adddata(form).then( |
| | | (res) => { |
| | | this.onLoad(this.page); |
| | |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | // console.log(row); |
| | | row["deptId"] = row.tenantName; |
| | | delete row.tenantName; |
| | | // row["deptId"] = row.tenantName; |
| | | // delete row.tenantName; |
| | | if (this.fromDeptId != undefined) { |
| | | row["deptId"] = this.fromDeptId; |
| | | } |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | |
| | | }, |
| | | 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; |
| | | } 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; |
| | | } |
| | | getdata( |
| | | page.currentPage, |
| | | page.pageSize, |