diff --git a/src/views/system/dept/authDept.vue b/src/views/system/dept/authDept.vue index cf735d9..56b7155 100644 --- a/src/views/system/dept/authDept.vue +++ b/src/views/system/dept/authDept.vue @@ -57,6 +57,7 @@ style="width: 100%" highlight-current-row border + ref="deptTableRef" v-if="refreshTable" row-key="id" @current-change="handleDeptChange" @@ -358,6 +359,7 @@ import { filterSubAll } from "@/api/system/invSubWarehouse"; export default { data() { return { + checkdefault: null, filterQuery: { status: 1, companyName: "", @@ -577,15 +579,27 @@ export default { let depList = response.data.list || []; this.deptOptions = this.handleTree(depList, "code", "pcode"); }); + console.log(JSON.parse(JSON.stringify(row))); + this.checkdefault = JSON.parse(JSON.stringify(row)); }, /* 获取列表 */ getList() { + let qwe = this.checkdefault; this.loading = true; filterList(this.filterQuery) .then((response) => { this.loading = false; let depList = response.data.list || []; this.list = this.handleTree(depList, "code", "pcode"); + console.log(qwe); + this.$nextTick(() => { + console.log(qwe); + if (qwe === null) { + this.$refs.deptTableRef.setCurrentRow(depList[0]); + } else { + this.$refs.deptTableRef.setCurrentRow(qwe); + } + }); }) .catch(() => { this.loading = false;