Browse Source

调整机构管理

luojun 2 years ago
parent
commit
1c809b6606
2 changed files with 9 additions and 7 deletions
  1. 3 2
      src/api/system/public.js
  2. 6 5
      src/views/system/dept/index.vue

+ 3 - 2
src/api/system/public.js

@@ -1,10 +1,11 @@
 import request from '@/utils/request'
 
 // 查询部门下拉树结构
-export function deptTreeSelect() {
+export function deptTreeSelect(removeId) {
   return request({
     url: '/system/dept/deptTree',
-    method: 'get'
+    method: 'get',
+    params:removeId
   })
 }
 

+ 6 - 5
src/views/system/dept/index.vue

@@ -596,17 +596,18 @@ export default {
       });
     },
     /** 修改按钮操作 */
-    handleUpdate(row) {
+    async handleUpdate(row) {
       this.reset();
       getDept(row.id).then((response) => {
         this.form = response.data;
         this.pId = response.data.parentId;
-        this.open = true;
-        this.title = "编辑";
       });
       if (this.pId != -1) {
-        listDeptExcludeChild(row.id).then((response) => {
-          this.deptOptions2 = this.handleTree(response.data, "id");
+        await deptTreeSelect({removeId:row.parentId,id:row.id}).then((response) => {
+          this.deptOptions2 = response.data;
+          // this.defaultKeys.push(response.data[0].id);
+          this.open = true;
+          this.title = "编辑";
         });
       }
     },