部门管理修改

master
wanglei 7 months ago
parent 866bf374e3
commit 278d58f3c6

@ -118,7 +118,7 @@
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row> <el-row>
<el-col :span="24" v-if="form.parentId !== 0"> <el-col :span="24">
<el-form-item label="上级部门" prop="parentId"> <el-form-item label="上级部门" prop="parentId">
<treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="选择上级部门" /> <treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="选择上级部门" />
</el-form-item> </el-form-item>
@ -329,7 +329,12 @@ export default {
this.open = true; this.open = true;
this.title = "添加部门"; this.title = "添加部门";
listDept(this.queryParams).then(response => { listDept(this.queryParams).then(response => {
this.deptOptions = this.handleTree(response.data, "deptId"); this.deptOptions = [];
this.deptOptions.push({
deptId: 0,
deptName:"顶级部门",
children: this.handleTree(response.data, "deptId")
});
}); });
}, },
/** 展开/折叠操作 */ /** 展开/折叠操作 */

Loading…
Cancel
Save