guhongwei hace 4 años
padre
commit
506e13b92b
Se han modificado 1 ficheros con 27 adiciones y 34 borrados
  1. 27 34
      src/views/superAdminCenter/user/index.vue

+ 27 - 34
src/views/superAdminCenter/user/index.vue

@@ -2,12 +2,6 @@
   <div id="index">
     <el-row>
       <el-col :span="24">
-        <!-- <el-col :span="24" class="add" style="text-align:right;padding: 10px 20px;">
-          <el-button size="mini" type="primary" @click="toAdd" icon="el-icon-plus">添加{{ theme }}</el-button>
-        </el-col> -->
-        <!-- <el-col :span="24" class="main">
-          <data-table :fields="fields" :opera="opera" @edit="toEdit" :data="list" :total="total" @delete="toDelete" @query="search"></data-table>
-        </el-col> -->
         <el-col :span="24" class="main">
           <el-tabs v-model="activeName" type="card">
             <el-tab-pane label="待审核" name="first">
@@ -233,12 +227,17 @@ export default {
       theme: '用戶',
       activeName: 'first',
       dialog: false,
+      // 个人,机构,专家信息
       form: {},
+      // 提交时,需要的uid
       editData: {},
+      // 待审核
       oneList: [],
       onetotal: 0,
+      // 审核成功
       twoList: [],
       twototal: 0,
+      // 审核失败
       threeList: [],
       threetotal: 0,
     };
@@ -271,7 +270,7 @@ export default {
           }
         }
       } else {
-        const res = await this.userquery({ skip, limit, pid, code: this.user.code, ...info });
+        const res = await this.userquery({ skip, pid, code: this.user.code, ...info });
         if (this.$checkRes(res)) {
           let one = res.data.filter(i => i.status == '0');
           if (one) {
@@ -280,6 +279,7 @@ export default {
           }
           let two = res.data.filter(i => i.status == '1');
           if (two) {
+            console.log(two);
             this.$set(this, `twototal`, two.length);
             this.$set(this, `twoList`, two);
           }
@@ -291,35 +291,28 @@ export default {
         }
       }
     },
-    // 审核
+    // 审核打开
     async handleEdit1(data) {
+      if (data.role == '4' || data.role == '5') {
+        let res = await this.fetch(data.uid);
+        if (this.$checkRes(res)) {
+          this.$set(this, `form`, res.data);
+        }
+      } else {
+        let res = await this.exportuserFetch(data.uid);
+        if (this.$checkRes(res)) {
+          this.$set(this, `form`, res.data);
+        }
+      }
+      this.$set(this, `editData`, data);
       this.dialog = true;
-      console.log(data);
-      // if (data.role == '6') {
-      //   // console.log();
-      //   const res = await this.exportuserFetch(data.uid);
-      //   // console.log(res);
-      //   if (this.$checkRes(res)) {
-      //     this.$set(this, `form`, res.data);
-      //   }
-      // } else {
-      //   const res = await this.fetch(data.uid);
-      //   // console.log(res);
-      //   if (this.$checkRes(res)) {
-      //     this.$set(this, `form`, res.data);
-      //   }
-      // }
-      // this.$set(this, `editData`, data);
-      // this.dialog = true;
     },
     // 提交
     async handleSave() {
       let data = this.form;
-      console.log(data);
       if (data.role == '4' || data.role == '5') {
-        // data.id = data.uid;
-        let res = await this.update(data.id);
-        console.log(res);
+        data.id = this.editData.uid;
+        let res = await this.update(data);
         if (this.$checkRes(res)) {
           this.$message({
             message: '审核信息成功',
@@ -328,11 +321,11 @@ export default {
           this.handleClose();
         }
       } else if (data.role == '6') {
-        // data.id = data.uid;
-        let res = await this.exportuserUpdate(data.id);
+        data.id = this.editData.uid;
+        let res = await this.exportuserUpdate(data);
         if (this.$checkRes(res)) {
           this.$message({
-            message: '修改信息成功',
+            message: '审核信息成功',
             type: 'success',
           });
           this.handleClose();
@@ -349,7 +342,7 @@ export default {
         .then(async () => {
           console.log(data);
           if (data.role == '4' || data.role == '5') {
-            let res = await this.delete(data.id);
+            let res = await this.delete(data.uid);
             if (this.$checkRes(res)) {
               res = await this.authdelete(data.id);
               if (this.$checkRes(res)) {
@@ -361,7 +354,7 @@ export default {
               }
             }
           } else {
-            let res = await this.exportuserDelete(data.id);
+            let res = await this.exportuserDelete(data.uid);
             if (this.$checkRes(res)) {
               res = await this.authdelete(data.id);
               if (this.$checkRes(res)) {