lrf402788946 6 년 전
부모
커밋
d91069f0e2
2개의 변경된 파일11개의 추가작업 그리고 5개의 파일을 삭제
  1. 9 3
      src/views/UserMes/userMes.vue
  2. 2 2
      src/views/certificate/index.vue

+ 9 - 3
src/views/UserMes/userMes.vue

@@ -224,13 +224,15 @@ export default {
         })
         })
         .catch(_ => {});
         .catch(_ => {});
     },
     },
-    open1() {
-      this.$confirm('此操作将注销该账号, 是否继续?', '提示', {
+    open1(num) {
+      console.log(num);
+      this.$confirm('确认注销此用户吗?', '提示', {
         confirmButtonText: '确定',
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         cancelButtonText: '取消',
         type: 'warning',
         type: 'warning',
       })
       })
         .then(() => {
         .then(() => {
+          this.$set(this.tableData[num], `state`, '0');
           this.$message({
           this.$message({
             type: 'success',
             type: 'success',
             message: '注销成功!',
             message: '注销成功!',
@@ -239,7 +241,7 @@ export default {
         .catch(() => {
         .catch(() => {
           this.$message({
           this.$message({
             type: 'info',
             type: 'info',
-            message: '已取消注销',
+            message: '已取消',
           });
           });
         });
         });
     },
     },
@@ -309,4 +311,8 @@ h6 {
 .sizeA {
 .sizeA {
   padding: 30px;
   padding: 30px;
 }
 }
+.paging {
+  text-align: right;
+  margin: 10px 0;
+}
 </style>
 </style>

+ 2 - 2
src/views/certificate/index.vue

@@ -27,8 +27,8 @@
           <el-table-column align="center" label="操作" width="300">
           <el-table-column align="center" label="操作" width="300">
             <template v-slot="scoped">
             <template v-slot="scoped">
               <el-button icon="el-icon-edit" @click="dialogFormVisible = true">修改</el-button>
               <el-button icon="el-icon-edit" @click="dialogFormVisible = true">修改</el-button>
-              <el-button v-if="scoped.row.state == 1" type="danger" icon="el-icon-delete" @click="open1(scoped.$index)">注销</el-button>
-              <el-button v-if="scoped.row.state == 0" type="danger" icon="el-icon-delete" @click="open2(scoped.$index)">恢复</el-button>
+              <el-button v-if="scope.row.state == 1" type="danger" icon="el-icon-delete" @click="open1(scope.$index)">注销</el-button>
+              <el-button v-if="scope.row.state == 0" type="success" icon="el-icon-setting" @click="open2(scope.$index)">恢复</el-button>
             </template>
             </template>
           </el-table-column>
           </el-table-column>
         </el-table>
         </el-table>