Selaa lähdekoodia

更新 分享权限开关

wzh 3 vuotta sitten
vanhempi
commit
7a60e84144
1 muutettua tiedostoa jossa 32 lisäystä ja 2 poistoa
  1. 32 2
      src/views/accountManage/clientList.vue

+ 32 - 2
src/views/accountManage/clientList.vue

@@ -89,7 +89,7 @@
           min-width="100"
           align="center"
         ></el-table-column>
-        <el-table-column
+        <!-- <el-table-column
           prop="accountStatus"
           label="状态"
           min-width="80"
@@ -105,7 +105,7 @@
               :active-value="1"
               :inactive-value="0"
             /> </template
-        ></el-table-column>
+        ></el-table-column> -->
         <el-table-column
           prop="sharePermission"
           label="分享权限"
@@ -121,6 +121,7 @@
               inactive-text="禁用"
               :active-value="1"
               :inactive-value="0"
+              @change="changeSharePermission($event, scope.row)"
             /> </template
         ></el-table-column>
 
@@ -298,6 +299,35 @@ function showUpdateModal(item, type) {
   };
 }
 
+async function changeSharePermission(sharePermission, item) {
+  let postData = {
+    accountId: item.id,
+    name: item.userName,
+    phone: item.phone,
+    sharePermission,
+    loginAccountId: loginAccountId.value,
+  };
+
+  let res = await api["updateClient"](postData);
+  if (res.data.status == 0) {
+    ElNotification({
+      title: "成功",
+      duration: 1500,
+      message: res.data.msg,
+      type: "success",
+    });
+    resetForm();
+    getClientList();
+  } else {
+    ElNotification({
+      title: "失败",
+      duration: 1500,
+      message: res.data.msg,
+      type: "error",
+    });
+  }
+}
+
 onMounted(() => {
   loginAccountId.value = localStorage.loginAccountId;
   getClientList();