liuyg
2021-10-25 fc4cb07f771951f293987ab9964a39bbfc14d4bb
+保安员检查导出
2 files modified
54 ■■■■■ changed files
src/lang/zh.js 2 ●●● patch | view | raw | blame | history
src/views/onSiteInspection/securityStaff.vue 52 ●●●●● patch | view | raw | blame | history
src/lang/zh.js
@@ -91,7 +91,7 @@
  navbar: {
    logOut: '退出登录',
    userinfo: '个人信息',
    dashboard: '保安人员管理',
    dashboard: '首页',
    lock: '锁屏',
    bug: '没有错误日志',
    bugs: '条错误日志',
src/views/onSiteInspection/securityStaff.vue
@@ -2,7 +2,7 @@
 * @Author: Morpheus
 * @Date: 2021-07-07 17:30:05
 * @Last Modified by: liu
 * @Last Modified time: 2021-10-22 17:27:32
 * @Last Modified time: 2021-10-25 15:46:52
 * menu-name 保安员检查
 */
<template>
@@ -18,6 +18,7 @@
      @row-update="rowUpdates"
      @row-save="rowSave"
      @row-del="rowDel"
      :search.sync="query"
      @search-change="searchChange"
      @search-reset="searchReset"
      @selection-change="selectionChange"
@@ -26,6 +27,17 @@
      @refresh-change="refreshChange"
      @on-load="onLoad"
    >
      <!-- 自定义按钮 -->
      <template slot="menuLeft">
        <el-button
          type="warning"
          size="small"
          plain
          icon="el-icon-download"
          @click="handleExport"
          >导出
        </el-button>
      </template>
    </avue-crud>
  </basic-container>
</template>
@@ -39,6 +51,7 @@
} from "@/api/onSiteInspection/securityStaff";
import { mapGetters } from "vuex";
import { datasing } from "./securityStaffdata";
import Qs from "qs";
export default {
  data() {
@@ -286,7 +299,7 @@
    };
  },
  computed: {
    ...mapGetters(["permission"]),
    ...mapGetters(["permission", "userInfo"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.post_add, false),
@@ -304,6 +317,41 @@
    },
  },
  methods: {
    //导出
    handleExport() {
      this.$confirm("是否导出成绩数据?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        //获取查询条件
        // console.log(this.userInfo, 456);
        // return;
        var data = {
          startTime: this.query.startTime,
          endTime: this.query.endTime,
          realName: this.query.realName,
          securityName: this.query.securityName,
          jurisdiction: this.userInfo.jurisdiction,
        };
        //导出
        // if (
        //   this.userInfo.role_name == "保安公司管理员" ||
        //   this.userInfo.role_name == "保安"
        // ) {
        //   //如果是保安公司管理员
        //   data["deptId"] = this.userInfo.dept_id;
        // }
        // if (this.userInfo.role_name == "培训公司管理员") {
        //   //如果是培训公司管理员
        //   data["trainUnitId"] = this.userInfo.dept_id;
        // }
        // data["examType"] = 2;
        //序列号url形式,用&拼接
        data = Qs.stringify(data);
        window.open(`/api/seinspect/export-seinspect?` + data);
      });
    },
    getStartTime() {
      if (
        this.$route.query.startTime != undefined &&