Browse Source

export examDetail

deason 4 years ago
parent
commit
c201be8be2
2 changed files with 43 additions and 15 deletions
  1. 41 10
      src/modules/oe/views/examDetail.vue
  2. 2 5
      src/modules/oe/views/scoreStatistics.vue

+ 41 - 10
src/modules/oe/views/examDetail.vue

@@ -80,11 +80,13 @@
         <el-col v-show="currentPagePrivileges.EXAM_DETAIL_EXPORT">
           <div class="block-seperator"></div>
           <span>操作:</span>
-          <commonExportVue
-            :form="form"
-            :exportUrl="exportUrl"
-            :exportFileName="exportFileName"
-          ></commonExportVue>
+          <el-button
+            type="primary"
+            size="small"
+            icon="el-icon-download"
+            @click="exportData"
+            >导出</el-button
+          >
         </el-col>
       </el-row>
       <el-row class="margin-top-10">
@@ -435,11 +437,10 @@
 <script>
 import { mapState } from "vuex";
 import commonFormVue from "../component/commonForm.vue";
-import commonExportVue from "../component/commonExport.vue";
 import pagePrivilege from "../mixin/pagePrivilege.js";
 import _ from "lodash";
 export default {
-  components: { commonFormVue, commonExportVue },
+  components: { commonFormVue },
   mixins: [pagePrivilege],
   data() {
     return {
@@ -454,6 +455,7 @@ export default {
       dialogVisible: false,
       // uploadDisabled: true,
       form: {
+        rootOrgId: null,
         examRecordDataId: null,
         hasStranger: null,
         courseId: null,
@@ -468,14 +470,12 @@ export default {
         isWarn: null,
         pageNo: 1,
         pageSize: 10,
-        rootOrgId: null,
         startTime: null,
         endTime: null,
         infoCollector: null,
         hasVirtual: null,
         ORG_FIND_ALL: false //查询所有机构
       },
-
       getExamCondition: {
         params: {
           name: "",
@@ -484,7 +484,7 @@ export default {
         filterCondition: ""
       },
       tableData: [],
-      exportUrl: "/api/ecs_oe_admin/exam/record/detail/list/export",
+      exportUrl: "/api/ecs_oe_admin/exam/record/detail/list/export/async",
       exportFileName: "考试明细",
       currentPagePrivileges: {
         EXAM_DETAIL_EXPORT: false, //导出
@@ -628,6 +628,37 @@ export default {
         path: "/oe/captureDetail/" + examRecordDataId + "/examDetail"
       });
     },
+    exportData() {
+      if (!this.form.examId) {
+        this.$notify({
+          title: "警告",
+          message: "请选择考试批次",
+          type: "warning",
+          duration: 1000
+        });
+        return false;
+      }
+
+      this.$confirm("确定执行导出?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.form.rootOrgId = this.user.rootOrgId;
+        this.$http
+          .get(this.exportUrl, {
+            params: {
+              query: this.form
+            }
+          })
+          .then(() => {
+            this.$notify({
+              type: "success",
+              message: "正在后台导出中,请稍后到“导出任务列表”中下载!"
+            });
+          });
+      });
+    },
     downloadOfflineFile(files) {
       if (files && files.length > 0) {
         if (files[0].fileType != "image") {

+ 2 - 5
src/modules/oe/views/scoreStatistics.vue

@@ -222,7 +222,6 @@
 <script>
 import { mapState } from "vuex";
 import commonFormVue from "../component/commonForm.vue";
-//import commonExportVue from "../component/commonExport.vue";
 import pagePrivilege from "../mixin/pagePrivilege.js";
 export default {
   components: { commonFormVue },
@@ -256,7 +255,6 @@ export default {
         endLimit: "",
         ORG_FIND_ALL: false //查询所有机构
       },
-
       getExamCondition: {
         params: {
           name: "",
@@ -265,7 +263,7 @@ export default {
         filterCondition: ""
       },
       tableData: [],
-      exportUrl: "/api/ecs_oe_admin/exam/score/statistic/list/export",
+      exportUrl: "/api/ecs_oe_admin/exam/score/statistic/list/export/async",
       exportFileName: "成绩统计",
       currentPagePrivileges: {
         SCORE_STATICS_EXPORT: false //导出
@@ -381,9 +379,8 @@ export default {
     },
     asyncExportData() {
       this.form.rootOrgId = this.user.rootOrgId;
-      let url = "/api/ecs_oe_admin/exam/score/statistic/list/export/async";
       this.$http
-        .get(url, {
+        .get(this.exportUrl, {
           params: {
             query: this.form
           }