Explorar o código

提交人审核编辑命题任务

zhangjie %!s(int64=3) %!d(string=hai) anos
pai
achega
e27c976686
Modificáronse 2 ficheiros con 36 adicións e 10 borrados
  1. 3 0
      src/modules/exam/api.js
  2. 33 10
      src/modules/exam/components/ApplyContent.vue

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

@@ -156,6 +156,9 @@ export const updateTaskReview = datas => {
   // return $post("/api/admin/exam/task/review_save", datas);
   // return $post("/api/admin/exam/task/review_save", datas);
   return $post("/api/admin/flow/task/approve", datas);
   return $post("/api/admin/flow/task/approve", datas);
 };
 };
+export const taskAuditApply = datas => {
+  return $post("/api/admin/exam/task/apply_resave", datas);
+};
 export const batchUpdateTaskReview = datas => {
 export const batchUpdateTaskReview = datas => {
   return $post("/api/admin/exam/task/review_save_batch", datas);
   return $post("/api/admin/exam/task/review_save_batch", datas);
 };
 };

+ 33 - 10
src/modules/exam/components/ApplyContent.vue

@@ -26,7 +26,7 @@
           </td>
           </td>
           <td>
           <td>
             <el-button
             <el-button
-              v-if="!attachment.isExposed && IS_APPLY"
+              v-if="!attachment.isExposed && (IS_APPLY || IS_AUDIT_APPLY)"
               type="text"
               type="text"
               class="btn-primary"
               class="btn-primary"
               @click="toUpload(attachment)"
               @click="toUpload(attachment)"
@@ -322,9 +322,16 @@
         v-if="IS_AUDIT"
         v-if="IS_AUDIT"
         type="primary"
         type="primary"
         :disabled="isSubmit"
         :disabled="isSubmit"
-        @click="toAuditApply"
+        @click="toAuditSubmit"
         >确定</el-button
         >确定</el-button
       >
       >
+      <el-button
+        v-if="IS_AUDIT_APPLY"
+        type="primary"
+        :disabled="isSubmit"
+        @click="toAuditApply"
+        >提交</el-button
+      >
       <el-button @click="cancel">取消</el-button>
       <el-button @click="cancel">取消</el-button>
     </div>
     </div>
 
 
@@ -360,6 +367,7 @@ import {
   taskApplyDetail,
   taskApplyDetail,
   updateTaskApply,
   updateTaskApply,
   updateTaskReview,
   updateTaskReview,
+  taskAuditApply,
   switchCardCreateMethod,
   switchCardCreateMethod,
   taskAllFlowSetups,
   taskAllFlowSetups,
   taskAllApproverPeople,
   taskAllApproverPeople,
@@ -425,6 +433,7 @@ export default {
       abc: "abcdefghijklmnopqrstuvwxyz".toUpperCase(),
       abc: "abcdefghijklmnopqrstuvwxyz".toUpperCase(),
       task: {},
       task: {},
       reason: "",
       reason: "",
+      TASK_AUDIT_RESULT: { ...TASK_AUDIT_RESULT, EXCHANGE: "转他人审批" },
       // audit
       // audit
       flows: [],
       flows: [],
       setups: [],
       setups: [],
@@ -494,18 +503,15 @@ export default {
         : this.curTaskApply.setup !== null && this.curTaskApply.setup <= 0;
         : this.curTaskApply.setup !== null && this.curTaskApply.setup <= 0;
     },
     },
     IS_AUDIT() {
     IS_AUDIT() {
-      return this.editType
+      const IS_COMMON_AUDIT = this.editType
         ? this.editType === "AUDIT"
         ? this.editType === "AUDIT"
         : this.curTaskApply.setup > 1;
         : this.curTaskApply.setup > 1;
+      return IS_COMMON_AUDIT && !this.IS_AUDIT_APPLY;
     },
     },
-    IS_PRELAST_STEP() {
+    IS_AUDIT_APPLY() {
+      // IS_PRELAST_STEP
       return this.curTaskApply.setup === this.flows.length - 1;
       return this.curTaskApply.setup === this.flows.length - 1;
     },
     },
-    TASK_AUDIT_RESULT() {
-      return this.IS_PRELAST_STEP
-        ? { PASS: "通过" }
-        : { ...TASK_AUDIT_RESULT, EXCHANGE: "转他人审批" };
-    },
     cardTodoName() {
     cardTodoName() {
       let name = "创建答题卡";
       let name = "创建答题卡";
       if (this.curTaskApply.cardId) {
       if (this.curTaskApply.cardId) {
@@ -909,7 +915,7 @@ export default {
       this.$message.success("提交成功!");
       this.$message.success("提交成功!");
       this.$emit("modified");
       this.$emit("modified");
     },
     },
-    async toAuditApply() {
+    async toAuditSubmit() {
       const valid = await this.$refs.auditModalComp.validate().catch(() => {});
       const valid = await this.$refs.auditModalComp.validate().catch(() => {});
       if (!valid) return;
       if (!valid) return;
 
 
@@ -951,6 +957,23 @@ export default {
       this.$message.success("审批成功!");
       this.$message.success("审批成功!");
       this.$emit("modified");
       this.$emit("modified");
     },
     },
+    async toAuditApply() {
+      const result = await this.$confirm("确定提交该任务吗?", "提示", {
+        type: "warning"
+      }).catch(() => {});
+      if (result !== "confirm") return;
+
+      const datas = {
+        examTaskDetail: this.getTaskData(),
+        flowTaskId: this.curTaskApply.flowTaskId,
+        approvePass: "PASS"
+      };
+      const data = await taskAuditApply(datas).catch(() => {});
+      if (!data) return;
+
+      this.$message.success("审批成功!");
+      this.$emit("modified");
+    },
     // image-preview
     // image-preview
     toPreview(index) {
     toPreview(index) {
       this.curImageIndex = index;
       this.curImageIndex = index;