liuyg
2021-10-26 c9d5e8c7f79016bd96a4274adb3d9c0358decd78
+导出
1 files modified
47 ■■■■ changed files
src/views/onSiteInspection/company.vue 47 ●●●● patch | view | raw | blame | history
src/views/onSiteInspection/company.vue
@@ -34,7 +34,7 @@
          plain
          icon="el-icon-download"
          @click="handleExport"
          >成绩导出
          >导出
        </el-button>
      </template>
    </avue-crud>
@@ -189,7 +189,7 @@
    };
  },
  computed: {
    ...mapGetters(["permission"]),
    ...mapGetters(["permission", "userInfo"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.post_add, false),
@@ -209,38 +209,37 @@
  methods: {
    //导出
    handleExport() {
      this.$confirm("是否导出成绩数据?", "提示", {
      this.$confirm("是否导出单位检查信息?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        //获取查询条件
        // console.log(this.questionBankSearch, 456);
        // console.log(this.userInfo, 456);
        // return;
        var data = {
          account: this.questionBankSearch.account,
          companyName: this.questionBankSearch.companyName,
          examDate: this.questionBankSearch.examDate,
          isExam: this.questionBankSearch.isExam,
          qualified: this.questionBankSearch.qualified,
          securityName: this.questionBankSearch.securityName,
          examName: this.questionBankSearch.examName,
          startTime: this.query.startTime,
          endTime: this.query.endTime,
          reviewedDeptName: this.query.reviewedDeptName,
          realName: this.query.realName,
          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;
        // 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/examScore/export-examScore?` + data);
        window.open(`/api/coinspect/export-coinspect?` + data);
      });
    },
    getStartTime() {