部门信息初版优化

ywj_dev
曹晨晨 2 years ago
parent 550778d417
commit f25276f639

@ -57,6 +57,7 @@
style="width: 100%" style="width: 100%"
highlight-current-row highlight-current-row
border border
ref="deptTableRef"
v-if="refreshTable" v-if="refreshTable"
row-key="id" row-key="id"
@current-change="handleDeptChange" @current-change="handleDeptChange"
@ -358,6 +359,7 @@ import { filterSubAll } from "@/api/system/invSubWarehouse";
export default { export default {
data() { data() {
return { return {
checkdefault: null,
filterQuery: { filterQuery: {
status: 1, status: 1,
companyName: "", companyName: "",
@ -577,15 +579,27 @@ export default {
let depList = response.data.list || []; let depList = response.data.list || [];
this.deptOptions = this.handleTree(depList, "code", "pcode"); this.deptOptions = this.handleTree(depList, "code", "pcode");
}); });
console.log(JSON.parse(JSON.stringify(row)));
this.checkdefault = JSON.parse(JSON.stringify(row));
}, },
/* 获取列表 */ /* 获取列表 */
getList() { getList() {
let qwe = this.checkdefault;
this.loading = true; this.loading = true;
filterList(this.filterQuery) filterList(this.filterQuery)
.then((response) => { .then((response) => {
this.loading = false; this.loading = false;
let depList = response.data.list || []; let depList = response.data.list || [];
this.list = this.handleTree(depList, "code", "pcode"); 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(() => { .catch(() => {
this.loading = false; this.loading = false;

Loading…
Cancel
Save