Selaa lähdekoodia

打回命题任务

zhangjie 1 vuosi sitten
vanhempi
commit
9737362972
2 muutettua tiedostoa jossa 23 lisäystä ja 0 poistoa
  1. 3 0
      src/modules/exam/api.js
  2. 20 0
      src/modules/exam/views/TaskPaperManage.vue

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

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

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

@@ -162,6 +162,13 @@
               @click="toCancel(scope.row)"
               >作废</el-button
             >
+            <el-button
+              v-if="checkPrivilege('link', 'restart')"
+              class="btn-danger"
+              type="text"
+              @click="toRestart(scope.row)"
+              >打回</el-button
+            >
           </template>
         </el-table-column>
       </el-table>
@@ -211,6 +218,7 @@ import {
   downloadPaper,
   paperAndCardBatchExport,
   cancelTaskPaper,
+  restartTaskPaper,
 } from "../api";
 import pickerOptions from "@/constants/datePickerOptions";
 import { downloadByApi } from "@/plugins/download";
@@ -350,6 +358,18 @@ export default {
       this.$message.success("操作成功!");
       this.getList();
     },
+    async toRestart(row) {
+      const res = await this.$confirm("确定要打回当前命题任务吗", "提示", {
+        type: "warning",
+      }).catch(() => {});
+      if (res !== "confirm") return;
+
+      const result = await restartTaskPaper(row.id).catch(() => {});
+
+      if (!result) return;
+      this.$message.success("操作成功!");
+      this.getList();
+    },
     toEdit(row) {
       this.curPaper = row;
       this.editType = "EDIT";