Browse Source

取消认证、解绑

(cherry picked from commit f8842a8801e4db6735ac6691c9ef07c0176f75b1)
xiongzhu 4 years ago
parent
commit
2135140ae9
1 changed files with 93 additions and 2 deletions
  1. 93 2
      src/main/vue/src/views/UserList.vue

+ 93 - 2
src/main/vue/src/views/UserList.vue

@@ -47,6 +47,17 @@
             <el-table-column label="操作" align="center" fixed="right">
             <el-table-column label="操作" align="center" fixed="right">
                 <template slot-scope="{ row }">
                 <template slot-scope="{ row }">
                     <el-button @click="editRow(row)" type="primary" size="mini" plain>编辑</el-button>
                     <el-button @click="editRow(row)" type="primary" size="mini" plain>编辑</el-button>
+                    <el-button @click="removeCard(row)" size="mini" type="text" :disabled="!row.settleAccountId">
+                        解绑卡
+                    </el-button>
+                    <el-button
+                        @click="removeAuth(row)"
+                        size="mini"
+                        type="text"
+                        :disabled="row.authStatus !== 'SUCCESS'"
+                    >
+                        取消认证
+                    </el-button>
                 </template>
                 </template>
             </el-table-column>
             </el-table-column>
         </el-table>
         </el-table>
@@ -89,7 +100,7 @@ export default {
     },
     },
     methods: {
     methods: {
         beforeGetData() {
         beforeGetData() {
-            return { search: this.search, query: {createdAt: this.createdAt} };
+            return { search: this.search, query: { createdAt: this.createdAt } };
         },
         },
         afterGetData(res) {
         afterGetData(res) {
             // let i = this.tableData.findIndex(i => i.username === 'root');
             // let i = this.tableData.findIndex(i => i.username === 'root');
@@ -167,7 +178,7 @@ export default {
                     .then(res => {
                     .then(res => {
                         let el = document.createElement('div');
                         let el = document.createElement('div');
                         new ClipboardJS(el, {
                         new ClipboardJS(el, {
-                            text: function (trigger) {
+                            text: function(trigger) {
                                 return res;
                                 return res;
                             }
                             }
                         });
                         });
@@ -179,6 +190,86 @@ export default {
                         this.$message.error(e.error);
                         this.$message.error(e.error);
                     });
                     });
             }
             }
+        },
+        removeCard(row) {
+            this.$msgbox({
+                title: '确认解绑吗?',
+                message: '该操作无法撤回,请谨慎操作',
+                showCancelButton: true,
+                confirmButtonText: '确认',
+                cancelButtonText: '取消',
+                type: 'warning',
+                beforeClose: (action, instance, done) => {
+                    if (action === 'confirm') {
+                        instance.confirmButtonLoading = true;
+                        instance.showCancelButton = false;
+                        instance.closeOnClickModal = false;
+                        instance.showClose = false;
+                        this.$http
+                            .post('/user/removeBankCardAdmin', { userId: row.id })
+                            .then(res => {
+                                done();
+                                this.getData();
+                                this.$message.success('解绑成功');
+                                instance.confirmButtonLoading = false;
+                                instance.showCancelButton = true;
+                                instance.closeOnClickModal = true;
+                                instance.showClose = true;
+                            })
+                            .catch(e => {
+                                done();
+                                this.getData();
+                                this.$message.error(e.error || '解绑失败');
+                                instance.confirmButtonLoading = false;
+                                instance.showCancelButton = true;
+                                instance.closeOnClickModal = true;
+                                instance.showClose = true;
+                            });
+                    } else {
+                        done();
+                    }
+                }
+            }).then(_ => {});
+        },
+        removeAuth(row) {
+            this.$msgbox({
+                title: '确认取消认证吗?',
+                message: '该操作无法撤回,请谨慎操作',
+                showCancelButton: true,
+                confirmButtonText: '确认',
+                cancelButtonText: '取消',
+                type: 'warning',
+                beforeClose: (action, instance, done) => {
+                    if (action === 'confirm') {
+                        instance.confirmButtonLoading = true;
+                        instance.showCancelButton = false;
+                        instance.closeOnClickModal = false;
+                        instance.showClose = false;
+                        this.$http
+                            .post('/user/removeAuthAdmin', { userId: row.id })
+                            .then(res => {
+                                done();
+                                this.getData();
+                                this.$message.success('取消认证成功');
+                                instance.confirmButtonLoading = false;
+                                instance.showCancelButton = true;
+                                instance.closeOnClickModal = true;
+                                instance.showClose = true;
+                            })
+                            .catch(e => {
+                                done();
+                                this.getData();
+                                this.$message.error(e.error || '取消认证失败');
+                                instance.confirmButtonLoading = false;
+                                instance.showCancelButton = true;
+                                instance.closeOnClickModal = true;
+                                instance.showClose = true;
+                            });
+                    } else {
+                        done();
+                    }
+                }
+            }).then(_ => {});
         }
         }
     }
     }
 };
 };