zengh
2022-05-24 1f581d7a13ff147c035fcf984466ff64f4f28996
批量审核
2 files modified
48 ■■■■■ changed files
src/api/zc/zc.js 11 ●●●●● patch | view | raw | blame | history
src/views/zc/zc.vue 37 ●●●●● patch | view | raw | blame | history
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',
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("请选择至少一条数据");