From 428419ea60a84117e4e4827c0aeb80446ccf8d99 Mon Sep 17 00:00:00 2001
From: ZZJ <zzjdsg2300@163.com>
Date: 星期六, 07 五月 2022 15:01:34 +0800
Subject: [PATCH] 设备列表控制按钮

---
 src/views/personalCenter/components/SubAccount.vue |   47 +++++++++++++++++++++++++++++++----------------
 1 files changed, 31 insertions(+), 16 deletions(-)

diff --git a/src/views/personalCenter/components/SubAccount.vue b/src/views/personalCenter/components/SubAccount.vue
index 46f5518..bba3c6c 100644
--- a/src/views/personalCenter/components/SubAccount.vue
+++ b/src/views/personalCenter/components/SubAccount.vue
@@ -29,7 +29,7 @@
     </div>
 
     <div class="btns">
-      <div class="button add" @click="isShowAdd = true">
+      <div class="button add" @click="addSubCount">
         <span class="iconfont">&#xe614;</span>
         <span>娣诲姞瀛愯处鍙�</span>
       </div>
@@ -82,14 +82,9 @@
 
         <el-table-column label="鎿嶄綔">
           <template slot-scope="scope">
-            <!-- 缂栬緫 -->
             <span class="iconfont option" @click="editUser(scope.row)"
               >缂栬緫</span
             >
-            <!-- 瑙g粦 -->
-            <!-- <span class="iconfont option" @click="Untying(scope.row)"
-              >瑙g粦</span
-            > -->
           </template>
         </el-table-column>
       </el-table>
@@ -359,6 +354,10 @@
         }
       });
     },
+    addSubCount(){
+      this.isShowAdd = true
+      this.resetUser()
+    },
     editUser(row) {
       this.isShowAdd = true;
       this.isEditing = true;
@@ -371,7 +370,6 @@
       this.ruleForm.isChangePwd = row.isChangePwd;
       this.ruleForm.industryId = row.industryId;
       this.ruleForm.areaId = row.areaId;
-      debugger;
       this.ruleForm.address = [row.provinceId, row.areaId];
       this.ruleForm.provinceId = row.provinceId;
       this.ruleForm.authDuration = row.authDuration;
@@ -420,21 +418,38 @@
         menuIds: this.ruleForm.menuIds,
         dataIds: this.ruleForm.dataIds,
       };
-      debugger;
-      saveSubUser(json).then((res) => {
-        debugger;
-      });
+      saveSubUser(json)
+        .then((res) => {
+          if (res.success) {
+            this.$notify.success(res.data)
+            this.isShowAdd = false;
+            this.isEditing = false;
+            this.findUserList();
+          } else {
+            this.$notify.error(res.msg);
+          }
+        })
+        .catch((err) => {
+          this.$notify.error(err.message);
+        });
     },
     findUserList() {
       findUserList({
         inputText: this.inputText,
         page: this.page,
         size: this.size,
-      }).then((res) => {
-        if (res.success) {
-          this.dataList = res.data.dataList;
-        }
-      });
+      })
+        .then((res) => {
+          if (res.success) {
+            this.dataList = res.data.dataList;
+            this.total = res.data.total;
+          } else {
+            this.$notify.error("鍔犺浇瀛愯处鎴峰垪琛ㄥけ璐�");
+          }
+        })
+        .catch((e) => {
+          this.$notify.error(e.msg);
+        });
     },
     goback() {
       this.isShowAdd = false;

--
Gitblit v1.8.0