From 1f581d7a13ff147c035fcf984466ff64f4f28996 Mon Sep 17 00:00:00 2001
From: zengh <123456>
Date: Tue, 24 May 2022 12:02:08 +0800
Subject: [PATCH] 批量审核

---
 src/api/zc/zc.js    |   11 +++++++++++
 src/views/zc/zc.vue |   37 ++++++++++++++++++++++++++++++++++++-
 2 files changed, 47 insertions(+), 1 deletions(-)

diff --git a/src/api/zc/zc.js b/src/api/zc/zc.js
index a4fe5f8..9dd2db2 100644
--- a/src/api/zc/zc.js
+++ b/src/api/zc/zc.js
@@ -32,6 +32,17 @@
   })
 }
 
+export const examineList = (ids,names) => {
+  return request({
+    url: '/api/zc/examineList',
+    method: 'post',
+    params: {
+      ids,
+      names
+    }
+  })
+}
+
 export const add = (row) => {
   return request({
     url: '/api/zc/submit',
diff --git a/src/views/zc/zc.vue b/src/views/zc/zc.vue
index 4f594b3..210d7a0 100644
--- a/src/views/zc/zc.vue
+++ b/src/views/zc/zc.vue
@@ -26,6 +26,12 @@
                    v-if="permission.zc_delete"
                    @click="handleDelete">删 除
         </el-button>
+        <el-button
+          size="small"
+          icon="el-icon-s-fold"
+          plain
+          @click="examine">批量审核
+        </el-button>
       </template>
       <template slot-scope="{row}" slot="type">
         <el-tag>{{row.type==='0'?'未审核':row.type==='1'?'审核通过':'审核未通过'}}</el-tag>
@@ -52,7 +58,7 @@
 </template>
 
 <script>
-  import {getList, getDetail, add, update, remove} from "@/api/zc/zc";
+  import {getList, getDetail, add, update, remove,examineList} from "@/api/zc/zc";
   import {getRoleTree} from "@/api/system/role";
   import {mapGetters} from "vuex";
 
@@ -235,6 +241,13 @@
           ids.push(ele.id);
         });
         return ids.join(",");
+      },
+      names() {
+        let names = [];
+        this.selectionList.forEach(ele => {
+          names.push(ele.username);
+        });
+        return names.join(",");
       }
     },
     methods: {
@@ -291,6 +304,28 @@
             });
           });
       },
+      examine() {
+        if (this.selectionList.length === 0) {
+          this.$message.warning("请选择至少一条数据");
+          return;
+        }
+        this.$confirm("确定将选择用户审核通过?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+              return examineList(this.ids,this.names);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            this.$refs.crud.toggleSelection();
+          });
+      },
       handleDelete() {
         if (this.selectionList.length === 0) {
           this.$message.warning("请选择至少一条数据");

--
Gitblit v1.9.3