Explorar el Código

我的项目会员新增一键解绑

luolinsong hace 2 días
padre
commit
ae63d5d4aa
Se han modificado 2 ficheros con 44 adiciones y 3 borrados
  1. 7 1
      src/api/user/fsUser.js
  2. 37 2
      src/views/member/mylist.vue

+ 7 - 1
src/api/user/fsUser.js

@@ -44,7 +44,13 @@ export function updateUser(data) {
     data: data
   })
 }
-
+// 会员解绑
+export function delCompanyUser(ids) {
+  return request({
+    url: '/user/fsUser/'+ ids,
+    method: 'delete',
+  })
+}
 // 删除用户
 export function delUser(userId) {
   return request({

+ 37 - 2
src/views/member/mylist.vue

@@ -196,6 +196,16 @@
               @click="batchSend"
               >批量IM发送</el-button>
             </el-col>
+        <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="multiple"
+          @click="batchUpdate"
+        >解绑会员</el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -375,7 +385,16 @@
 </template>
 
 <script>
-import { myListUser, getUser, addUser, updateUser, delUser, exportUser, auditUser } from "@/api/user/fsUser";
+import {
+  myListUser,
+  getUser,
+  addUser,
+  updateUser,
+  delUser,
+  exportUser,
+  auditUser,
+  delCompanyUser
+} from '@/api/user/fsUser'
 import {transferUser} from "@/api/users/user";
 import {getUserList} from "@/api/company/companyUser";
 import userDetails from '@/views/store/components/userDetails.vue';
@@ -407,6 +426,7 @@ export default {
       loading: true,
       // 选中数组
       ids: [],
+      fsUserCompanyUserId: [],
       companyUserId:null,
       companyId:null,
       // 非单个禁用
@@ -655,6 +675,7 @@ export default {
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.userId);
+      this.fsUserCompanyUserId = selection.map(item => item.fsUserCompanyUserId);
       this.single = selection.length !== 1;
       this.multiple = !selection.length;
       this.companyId = selection[0].companyId;
@@ -729,7 +750,21 @@ export default {
         this.$message.success("删除成功");
       }).catch(() => {});
     },
-
+    batchUpdate() {
+      const ids =this.fsUserCompanyUserId;
+      console.log("选择ID",ids)
+      this.$confirm('是否确认解绑会员?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        return delCompanyUser(ids);
+      }).then(() => {
+          this.getList()
+          this.msgSuccess('解绑会员成功')
+        }).catch(() => {
+        })
+    },
     /** 导出按钮操作 */
     handleExport() {
       const queryParams = this.queryParams;