CTP 2 years ago
commit 2e8c0618e6

@ -52,11 +52,11 @@
</el-form> </el-form>
<el-table <el-table
v-loading="loading" v-loading="loading"
ref="list"
:data="list" :data="list"
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"
@ -356,6 +356,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: "",
@ -575,15 +576,26 @@ 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");
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;

@ -186,6 +186,8 @@ export default {
} else { } else {
callback(); callback();
} }
}else{
callback();
} }
}; };
return { return {

Loading…
Cancel
Save