Przeglądaj źródła

监考已审导出

qinchao 4 lat temu
rodzic
commit
c5956d6755
1 zmienionych plików z 59 dodań i 1 usunięć
  1. 59 1
      src/modules/oe/views/alreadyAudited.vue

+ 59 - 1
src/modules/oe/views/alreadyAudited.vue

@@ -158,6 +158,19 @@
           >重置</el-button
         >
       </el-col>
+      <el-row>
+        <el-col>
+          <div class="block-seperator"></div>
+          <span>操作:</span>
+          <el-button
+            type="primary"
+            size="small"
+            icon="el-icon-download"
+            @click="exportData"
+            >导出</el-button
+          >
+        </el-col>
+      </el-row>
       <el-row class="margin-top-10">
         <el-col :span="24">
           <el-table
@@ -342,7 +355,7 @@ export default {
         auditEndTime: null, //审核时间止
         ip: null, //Ip
       },
-
+      exportUrl: "/api/ecs_oe_admin/exam/audit/export/async",
       getExamCondition: {
         params: {
           name: "",
@@ -522,6 +535,51 @@ export default {
           }
         });
     },
+    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.form.creator = this.user.userId;
+        this.$http
+          .get(
+            this.exportUrl +
+              "?$key=" +
+              this.user.key +
+              "&$token=" +
+              this.user.token,
+            {
+              params: {
+                query: this.form,
+              },
+            }
+          )
+          .then(() => {
+            this.$notify({
+              type: "success",
+              message: "正在后台导出中,请稍后到“导出任务列表”中下载!",
+            });
+          })
+          .catch((error) => {
+            this.$notify({
+              type: "error",
+              message: error.response.data.desc,
+            });
+          });
+      });
+    },
     changeStartExamDatetimeRange(e) {
       if (e && e.length > 0) {
         this.form.startTime = e[0];