zhangjie 2 rokov pred
rodič
commit
66708f0f9b

+ 3 - 0
src/modules/exam/api.js

@@ -194,6 +194,9 @@ export const taskPaperListPage = (datas) => {
 export const ableTaskPaper = ({ id, enable }) => {
   return $post("/api/admin/exam/task/paper_enable", { id, enable });
 };
+export const cancelTaskPaper = (id) => {
+  return $postParam("/api/admin/exam/task/cancel", { id });
+};
 export const taskPaperApplyEdit = (datas) => {
   return $post("/api/admin/exam/task/paper_update", datas);
 };

+ 3 - 12
src/modules/exam/components/createExamAndPrintTask/InfoPrintTask.vue

@@ -515,22 +515,13 @@ export default {
       }
 
       const types = {
-        TEACH_CLAZZ_STUDENT: this.checkPrivilege(
-          "button",
-          "ExamTaskStudentObjectImport"
-        ),
-        BASIC_CLAZZ_STUDENT: this.checkPrivilege(
-          "button",
-          "ExamTaskStudentObjectImport"
-        ),
+        TEACH_CLAZZ_STUDENT: this.checkPrivilege("button", "MyTeachCourse"),
+        BASIC_CLAZZ_STUDENT: this.checkPrivilege("button", "StudentLibrary"),
       };
 
       this.disabledStudentIds = this.getTabelStudentIds();
       this.objectTypes = Object.keys(types).filter((k) => types[k]);
-      this.showStudent = this.checkPrivilege(
-        "button",
-        "ExamTaskStudentObjectImport"
-      );
+      this.showStudent = this.checkPrivilege("button", "SelectStudent");
       this.$refs.ModifyExamStudent.open();
     },
     getTabelStudentIds() {

+ 22 - 0
src/modules/exam/views/TaskPaperManage.vue

@@ -185,6 +185,13 @@
               @click="toPublishPrintTask(scope.row)"
               >发布印刷任务</el-button
             >
+            <el-button
+              v-if="checkPrivilege('link', 'cancel')"
+              class="btn-danger"
+              type="text"
+              @click="toCancel(scope.row)"
+              >作废</el-button
+            >
           </template>
         </el-table-column>
       </el-table>
@@ -233,6 +240,7 @@ import {
   ableTaskPaper,
   downloadPaper,
   paperAndCardBatchExport,
+  cancelTaskPaper,
 } from "../api";
 import pickerOptions from "@/constants/datePickerOptions";
 import { downloadByApi } from "@/plugins/download";
@@ -345,6 +353,20 @@ export default {
         })
         .catch(() => {});
     },
+    async toCancel(row) {
+      const confirm = await this.$confirm(
+        `确定要作废选中的命题任务吗?`,
+        "提示",
+        {
+          type: "warning",
+        }
+      ).catch(() => {});
+      if (confirm !== "confirm") return;
+
+      await cancelTaskPaper(row.id);
+      this.$message.success("操作成功!");
+      this.getList();
+    },
     toEdit(row) {
       this.curPaper = row;
       this.editType = "EDIT";