zhangjie %!s(int64=4) %!d(string=hai) anos
pai
achega
2ac3e189b1

+ 7 - 2
src/api.js

@@ -344,11 +344,16 @@ export const changeLevelPaperList = datas => {
 // to see grading progress
 
 // mark-task-manage
+export const checkMarkTaskSubmitType = subjectId => {
+  return $get(`/api/marksubjects/${subjectId}/canScoreAll`);
+};
 export const checkMarkTaskCanSubmit = (subjectId, questionId) => {
-  return $get(`/api/marksubjects/${subjectId}/canScore`, { questionId });
+  let datas = questionId ? { questionId } : null;
+  return $get(`/api/marksubjects/${subjectId}/canScore`, datas);
 };
 export const markTaskInfo = (subjectId, questionId) => {
-  return $get(`/api/marksubjects/${subjectId}/scoreProgress`, { questionId });
+  let datas = questionId ? { questionId } : null;
+  return $get(`/api/marksubjects/${subjectId}/scoreProgress`, datas);
 };
 // mark-detail
 export const markerScoreStatData = (userId, questionId) => {

+ 9 - 1
src/modules/inspection/InspectionActionLogs.vue

@@ -217,7 +217,15 @@ export default {
       this.filter.startTime = val[0] || null;
       this.filter.endTime = val[1] || null;
     },
-    exportLogs() {}
+    exportLogs() {
+      if (!this.filter.workId || !this.filter.subject) {
+        this.$Message.error("请选择工作和科目!");
+        return;
+      }
+      window.open(
+        `${this.GLOBAL.domain}/api/export/log/oper?workId=${this.filter.workId}&subject=${this.filter.subject}`
+      );
+    }
   }
 };
 </script>

+ 9 - 1
src/modules/inspection/InspectionCollectLogs.vue

@@ -219,7 +219,15 @@ export default {
       this.filter.startTime = val[0] || null;
       this.filter.endTime = val[1] || null;
     },
-    exportLogs() {}
+    exportLogs() {
+      if (!this.filter.workId || !this.filter.subject) {
+        this.$Message.error("请选择工作和科目!");
+        return;
+      }
+      window.open(
+        `${this.GLOBAL.domain}/api/export/log/collect?workId=${this.filter.workId}&subject=${this.filter.subject}`
+      );
+    }
   }
 };
 </script>

+ 16 - 3
src/modules/mark/MarkTaskManage.vue

@@ -125,7 +125,8 @@ import {
   areaList,
   markTaskInfo,
   checkMarkTaskCanSubmit,
-  publishScoreTask
+  publishScoreTask,
+  checkMarkTaskSubmitType
 } from "@/api";
 import { calcSum } from "@/plugins/utils";
 import { SORT_ORDER_TYPE, BOOLEAN_TYPE } from "@/constants/enumerate";
@@ -140,6 +141,7 @@ export default {
       questionId: "",
       SORT_ORDER_TYPE,
       BOOLEAN_TYPE,
+      taskHasSubmitAll: false,
       canSubmitTask: true,
       isSubmit: false,
       taskList: [],
@@ -203,10 +205,14 @@ export default {
   },
   methods: {
     async initData() {
+      await this.checkSubmitType();
       await this.getAreaList();
       this.questionId = this.areas[0].id;
       this.areaChange();
     },
+    async checkSubmitType() {
+      this.taskCanSubmitAll = await checkMarkTaskSubmitType(this.subjectId);
+    },
     async getAreaList() {
       const data = await areaList({
         workId: this.workId,
@@ -219,6 +225,13 @@ export default {
           areaCode: item.areaCode
         };
       });
+      if (this.areas.length > 1 && this.taskCanSubmitAll) {
+        this.areas.push({
+          id: 0,
+          areaName: "全部",
+          areaCode: "all"
+        });
+      }
     },
     async checkCanSubmitTask() {
       this.canSubmitTask = await checkMarkTaskCanSubmit(
@@ -267,7 +280,7 @@ export default {
       let result = true;
       await publishScoreTask({
         subjectId: this.subjectId,
-        questionId: this.questionId,
+        questionId: this.questionId || null,
         taskList: this.taskList
       }).catch(() => {
         result = false;
@@ -276,7 +289,7 @@ export default {
       if (!result) return;
       this.$Message.success("任务创建成功!");
       this.cancel();
-      this.areaChange();
+      this.initData();
     }
   }
 };