From 98941acd2aadf435058412b4abe61fb6437433e8 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期三, 20 五月 2020 09:15:19 +0800
Subject: [PATCH] Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue

---
 ruoyi-ui/src/views/system/dept/index.vue |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/ruoyi-ui/src/views/system/dept/index.vue b/ruoyi-ui/src/views/system/dept/index.vue
index 15e38b1..b503d85 100644
--- a/ruoyi-ui/src/views/system/dept/index.vue
+++ b/ruoyi-ui/src/views/system/dept/index.vue
@@ -138,7 +138,7 @@
 </template>
 
 <script>
-import { listDept, getDept, delDept, addDept, updateDept } from "@/api/system/dept";
+import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from "@/api/system/dept";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 
@@ -220,12 +220,6 @@
         children: node.children
       };
     },
-    /** 鏌ヨ閮ㄩ棬涓嬫媺鏍戠粨鏋� */
-    getTreeselect() {
-      listDept().then(response => {
-        this.deptOptions = this.handleTree(response.data, "deptId");
-      });
-    },
     // 瀛楀吀鐘舵�佸瓧鍏哥炕璇�
     statusFormat(row, column) {
       return this.selectDictLabel(this.statusOptions, row.status);
@@ -256,22 +250,26 @@
     /** 鏂板鎸夐挳鎿嶄綔 */
     handleAdd(row) {
       this.reset();
-      this.getTreeselect();
       if (row != undefined) {
         this.form.parentId = row.deptId;
       }
       this.open = true;
       this.title = "娣诲姞閮ㄩ棬";
+      listDept().then(response => {
+	        this.deptOptions = this.handleTree(response.data, "deptId");
+      });
     },
     /** 淇敼鎸夐挳鎿嶄綔 */
     handleUpdate(row) {
       this.reset();
-      this.getTreeselect();
       getDept(row.deptId).then(response => {
         this.form = response.data;
         this.open = true;
         this.title = "淇敼閮ㄩ棬";
       });
+      listDeptExcludeChild(row.deptId).then(response => {
+	        this.deptOptions = this.handleTree(response.data, "deptId");
+      });
     },
     /** 鎻愪氦鎸夐挳 */
     submitForm: function() {

--
Gitblit v1.9.3