|
|
@@ -100,7 +100,7 @@
|
|
|
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
<el-row>
|
|
|
- <el-col :span="24" v-if="form.parentId !== 0">
|
|
|
+ <el-col :span="24" v-if="form.parentId > 0">
|
|
|
<el-form-item label="上级部门" prop="parentId">
|
|
|
<treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="选择上级部门" />
|
|
|
</el-form-item>
|
|
|
@@ -138,7 +138,7 @@
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="部门状态">
|
|
|
- <el-radio-group v-model="form.status">
|
|
|
+ <el-radio-group v-model="form.isLock">
|
|
|
<el-radio
|
|
|
v-for="dict in dict.type.sys_normal_disable"
|
|
|
:key="dict.value"
|
|
|
@@ -150,7 +150,8 @@
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
+ <el-button v-if="title == '修改部门'" type="primary" @click="changeSubmitForm">确 定</el-button>
|
|
|
+ <el-button v-if="title == '添加部门'" type="primary" @click="addSubmitForm">确 定</el-button>
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
@@ -237,8 +238,8 @@ export default {
|
|
|
delete node.children;
|
|
|
}
|
|
|
return {
|
|
|
- id: node.deptId,
|
|
|
- label: node.deptName,
|
|
|
+ id: node.id,
|
|
|
+ label: node.name,
|
|
|
children: node.children
|
|
|
};
|
|
|
},
|
|
|
@@ -303,22 +304,25 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
- submitForm: function() {
|
|
|
+ changeSubmitForm() {
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
|
- if (this.form.id != undefined) {
|
|
|
- updateDept(this.form).then(response => {
|
|
|
- this.$modal.msgSuccess("修改成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
- } else {
|
|
|
- addDept(this.form).then(response => {
|
|
|
- this.$modal.msgSuccess("新增成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
- }
|
|
|
+ updateDept(this.form).then(response => {
|
|
|
+ this.$modal.msgSuccess("修改成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ addSubmitForm() {
|
|
|
+ this.$refs["form"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ addDept(this.form).then(response => {
|
|
|
+ this.$modal.msgSuccess("新增成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
},
|