From 4641a877cd6a94e4d35dca7f7f14bc1443e2d2ad Mon Sep 17 00:00:00 2001
From: luobisheng <727299681@qq.com>
Date: 星期二, 29 十一月 2022 17:59:55 +0800
Subject: [PATCH] 上传处置类型修改

---
 src/views/systemSetting/baseSetting/department/updateUser/index.vue |   71 ++++++++++++++++-------------------
 1 files changed, 32 insertions(+), 39 deletions(-)

diff --git a/src/views/systemSetting/baseSetting/department/updateUser/index.vue b/src/views/systemSetting/baseSetting/department/updateUser/index.vue
index fa05478..b3e2481 100644
--- a/src/views/systemSetting/baseSetting/department/updateUser/index.vue
+++ b/src/views/systemSetting/baseSetting/department/updateUser/index.vue
@@ -87,21 +87,7 @@
         callback();
       }
     };
-    const validateId = (rule, value, callback) => {
-      if (!value) {
-        callback(new Error("璇峰~鍐欓儴闂╥d"));
-      } else {
-        callback();
-      }
-    };
     const validatePass = (rule, value, callback) => {
-      if (!value) {
-        callback();
-      } else {
-        callback();
-      }
-    };
-    const validatePhone = (rule, value, callback) => {
       if (!value) {
         callback();
       } else {
@@ -117,7 +103,6 @@
         departType: "",
       },
       createUserRules: {
-        id: [{ required: true, trigger: "blur", validator: validateId }],
         departName: [
           { required: true, trigger: "blur", validator: validateNickname },
         ],
@@ -140,18 +125,18 @@
     this.user = JSON.parse(JSON.stringify(that.userInfo));
     console.log(this.user);
     this.user.parentId = this.user.parentId === 0 ? '鏆傛棤涓婄骇閮ㄩ棬' : this.user.parentId;
-    console.log(this.user.parentId);
     this.checkedList = this.user.userInfoDTOS;
     this.checkedList.forEach((e) => {
       this.checkedUser.push(e.userId);
     });
+    console.log(this.checkedUser)
     this.$axios({
       method: "get",
       url: "sccg/depart/tree",
     }).then((res) => {
       that.departList = res.data;
     });
-    this.getUserList();
+    this.getUserList(this.user.id);
     // 鑾峰彇閮ㄩ棬绫诲瀷
     this.getDepartType();
   },
@@ -162,25 +147,31 @@
           const { user, checkedList } = this;
           const arr = [];
           checkedList.forEach((item) => {
-            arr.push({ leader: item.leader, userId: item.userId });
+            arr.push({ leader: item.leader, userId: item.id ? item.id : item.userId });
           });
-          console.log(arr);
-          this.$axios
-            .post("sccg/depart/update", {
-              id: user.id,
-              departName: user.departName,
-              parentId: user.parentId,
-              departDes: user.departDes,
-              departManagerList: arr,
+          if (arr.length === 0) {
+            this.$message({
+              type: 'warning',
+              message: '璇烽�夋嫨閮ㄩ棬浜哄憳',
             })
-            .then((res) => {
-              this.$message({
-                message: res.message,
-                type: res.code === 200 ? "success" : "warning",
+          } else {
+            this.$axios
+              .post("sccg/depart/update", {
+                id: user.id,
+                departName: user.departName,
+                parentId: user.parentId === '鏆傛棤涓婄骇閮ㄩ棬' ? 0 : user.parentId,
+                departDes: user.departDes,
+                departManagerList: arr,
+              })
+              .then((res) => {
+                this.$message({
+                  message: res.message,
+                  type: res.code === 200 ? "success" : "warning",
+                });
+                this.$emit("changeDialog", { flag: false });
+                this.getDepartList();
               });
-              this.$emit("changeDialog", { flag: false });
-              this.getDepartList();
-            });
+          }
         } else {
           return false;
         }
@@ -201,11 +192,11 @@
     },
 
     // 鑾峰彇鎵�鏈夌敤鎴蜂俊鎭�
-    getUserList() {
+    getUserList(id) {
       // 鑾峰彇鎵�鏈夌敤鎴蜂俊鎭�佺敤鎴锋煡璇�(鏆傛椂鏀寔鐢佃瘽鍙风爜)
-      this.$axios.get(`sccg/admin/list`).then((res) => {
+      this.$axios.get(`/sccg/depart/query_surplus_exist_user?id=`+id).then((res) => {
         if (res.code === 200) {
-          this.userList = res.data.records;
+          this.userList = res.data;
         }
       });
     },
@@ -223,6 +214,7 @@
         });
       });
       this.checkedList[0].leader = true;
+      console.log(this.checkedList);
       this.openUser = false;
     },
   },
@@ -331,7 +323,8 @@
   right: 0;
 
   .box-card {
-    max-height: 200px;
+    min-height: 240px;
+    max-height: 260px;
     overflow: hidden;
     background-color: #09152f;
     position: relative;
@@ -339,7 +332,7 @@
 
     .scrollWrap {
       overflow: scroll;
-      height: 160px;
+      height: 180px;
       position: relative;
       color: #4b9bb7;
 
@@ -366,7 +359,7 @@
       top: 77px;
       right: 20px;
       width: 20px;
-      height: 160px;
+      height: 180px;
       background-color: #09152f;
     }
 

--
Gitblit v1.8.0