deason 1 سال پیش
والد
کامیت
f97216ceda
1فایلهای تغییر یافته به همراه26 افزوده شده و 14 حذف شده
  1. 26 14
      src/modules/oe/views/scoreStatistic.vue

+ 26 - 14
src/modules/oe/views/scoreStatistic.vue

@@ -21,15 +21,18 @@
         </el-select>
       </el-form-item>
 
-      <!-- <el-button type="primary" :disabled="paramsMiss()" @click="searchHandler">查询</el-button>-->
+      <!-- <el-button type="primary" :disabled="disableParam()" @click="searchHandler">查询</el-button>-->
 
-      <el-button type="primary" :disabled="paramsMiss()" @click="countHandler"
+      <el-button
+        type="primary"
+        :disabled="disableParam()"
+        @click="refreshHandler"
         >刷新计算</el-button
       >
       <el-button
         type="primary"
         style="float: right"
-        :disabled="paramsMiss()"
+        :disabled="disableParam()"
         @click="openDialog"
         >及格线设置</el-button
       >
@@ -99,8 +102,8 @@
 
           <el-button
             type="primary"
-            :disabled="paramsMiss()"
-            @click="orgExportExcel"
+            :disabled="disableParam()"
+            @click="exportOrgStatisticExcel"
             >导出</el-button
           >
         </el-form>
@@ -139,8 +142,8 @@
 
           <el-button
             type="primary"
-            :disabled="paramsMiss()"
-            @click="courseExportExcel"
+            :disabled="disableParam()"
+            @click="exportCourseStatisticExcel"
             >导出</el-button
           >
         </el-form>
@@ -237,7 +240,7 @@ import { mapState } from "vuex";
 export default {
   data() {
     return {
-      counting: false,
+      refreshing: false,
       setLineLoading: false,
       visible: false,
       dialogLoading: false,
@@ -310,7 +313,7 @@ export default {
   },
 
   methods: {
-    paramsMiss() {
+    disableParam() {
       return !this.searchParams.examId;
     },
     getExamList(examName) {
@@ -409,22 +412,22 @@ export default {
           this.courseTableData = res.data || [];
         });
     },
-    orgExportExcel() {
+    exportOrgStatisticExcel() {
       const { examId, orgId } = this.searchParams;
       let key = this.user.key;
       let token = this.user.token;
       let url = `/api/ecs_oe_admin/exam/statistic/overview/for/org/export?examId=${examId}&orgId=${orgId}&$key=${key}&$token=${token}`;
       location.href = url;
     },
-    courseExportExcel() {
+    exportCourseStatisticExcel() {
       const { examId, courseId } = this.searchParams;
       let key = this.user.key;
       let token = this.user.token;
       let url = `/api/ecs_oe_admin/exam/statistic/overview/for/course/export?examId=${examId}&courseId=${courseId}&$key=${key}&$token=${token}`;
       location.href = url;
     },
-    countHandler() {
-      this.counting = true;
+    refreshHandler() {
+      this.refreshing = true;
       this.$http
         .post(
           "/api/ecs_oe_admin/exam/statistic/overview/refresh",
@@ -436,8 +439,17 @@ export default {
           }
         )
         .then(() => {
-          this.counting = false;
+          this.refreshing = false;
           this.searchHandler();
+        })
+        .catch((e) => {
+          if (e.response.status === 500) {
+            this.$notify({
+              showClose: true,
+              message: e.response.data.desc,
+              type: "error",
+            });
+          }
         });
     },