Parcourir la source

Merge branch 'feature-sell' of http://47.104.88.16:10880/shuhi/shuhi-ui into feature-sell

ylong il y a 1 semaine
Parent
commit
bc0b424880
1 fichiers modifiés avec 31 ajouts et 0 suppressions
  1. 31 0
      src/views/customer/list/index.vue

+ 31 - 0
src/views/customer/list/index.vue

@@ -89,6 +89,15 @@
                     >
                         [移除黑名单]
                     </el-button>
+                    <el-button
+                        v-if="row.status != 3"
+                        type="danger"
+                        link
+                        v-permission="'customer:list:cancel'"
+                        @click="handleCancel(row)"
+                    >
+                        [注销]
+                    </el-button>
                 </div>
             </template>
         </common-table>
@@ -256,4 +265,26 @@
         row.userId = row.id;
         tagRef.value?.handleOpen(row);
     }
+
+    //注销用户
+    function handleCancel(row) {
+        ElMessageBox.confirm(
+            `确认注销用户"${row.nickName}"?注销后不可恢复!`,
+            '提示',
+            {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }
+        ).then(() => {
+            request.post(`/user/userInfo/cancel/${row.id}`).then((res) => {
+                if (res.data.code == 200) {
+                    EleMessage.success('操作成功');
+                    reload();
+                } else {
+                    EleMessage.error(res.data.msg);
+                }
+            });
+        });
+    }
 </script>