zhangjie 3 anos atrás
pai
commit
a70f909016

+ 8 - 1
src/modules/base/api.js

@@ -192,7 +192,14 @@ export const flowDetail = id => {
   return $postParam("/api/admin/custom/flow/edit", { id });
 };
 export const flowDetailByType = (type = "ELECTRON_FLOW") => {
-  return $postParam("/api/admin/custom/flow/get_flow_info_by_type", { type });
+  return $postParam("/api/admin/custom/flow/get_flow_info_by_type", {
+    type
+  });
+};
+export const flowDetailByFlowId = flowId => {
+  return $postParam("/api/admin/custom/flow/get_flow_info_by_type", {
+    flowId
+  });
 };
 export const taskFlowDetail = flowId => {
   return $postParam("/api/admin/custom/flow/view", { flowId });

+ 0 - 5
src/modules/base/components/SelectUserDialog.vue

@@ -277,11 +277,6 @@ export default {
       this.checkValid();
     },
     submit() {
-      if (!this.selectedUsers.length) {
-        this.$message.error("请选择用户");
-        return;
-      }
-
       if (!this.selectValid) return;
 
       this.$emit(

+ 0 - 6
src/modules/base/views/CardManage.vue

@@ -246,12 +246,6 @@ export default {
         attachmentId: row.attachmentId,
         orgIds: row.orgs.map(item => item.id)
       });
-      // this.$router.push({
-      //   name: "CardEdit",
-      //   params: {
-      //     cardId: row.id
-      //   }
-      // });
       this.$refs.ModifyCard.open();
     },
     toEditInfo(row) {

+ 73 - 29
src/modules/exam/components/ApplyContent.vue

@@ -26,7 +26,7 @@
           </td>
           <td>
             <el-button
-              v-if="!attachment.isExposed && (IS_APPLY || IS_AUDIT_APPLY)"
+              v-if="!attachment.isExposed && IS_APPLY"
               type="text"
               class="btn-primary"
               @click="toUpload(attachment)"
@@ -179,7 +179,7 @@
 
       <!-- audit history -->
       <div
-        v-if="flowHistoryList.length"
+        v-if="flowHistoryList.length && curTaskApply.flowStatus !== 'START'"
         class="task-audit-history flow-timeline"
       >
         <h4 class="mb-4">审核记录:</h4>
@@ -224,6 +224,24 @@
           </el-timeline-item>
         </el-timeline>
       </div>
+      <div
+        v-if="flowList.length && curTaskApply.flowStatus === 'START'"
+        class="task-audit-history flow-timeline"
+      >
+        <h4 class="mb-4">流程:</h4>
+        <el-timeline>
+          <el-timeline-item
+            v-for="flow in flowList"
+            :key="flow.taskKey"
+            :type="flow.type"
+          >
+            <div class="flow-item">
+              <h4 class="flow-item-title">{{ flow.taskName }}</h4>
+              <p class="flow-item-desc">{{ flow.approveUserNames }}</p>
+            </div>
+          </el-timeline-item>
+        </el-timeline>
+      </div>
 
       <!-- audit -->
       <div v-if="IS_AUDIT" class="task-audit">
@@ -331,13 +349,13 @@
         @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>
     </div>
 
@@ -352,8 +370,6 @@
     <card-option-dialog
       ref="CardOptionDialog"
       :data="task"
-      @upload-sample-over="initData"
-      @draft-task="silentSave"
       @confirm="cardConfirm"
     ></card-option-dialog>
     <!-- image-preview -->
@@ -365,11 +381,14 @@
     ></simple-image-preview>
     <!-- select-user-dialog -->
     <select-user-dialog
+      v-if="IS_AUDIT"
       ref="SelectUserDialog"
       :user-limit-count="1"
       :users="exchangeUsers"
       @modified="exchangeUserSelected"
     ></select-user-dialog>
+    <!-- ModifyCard -->
+    <modify-card ref="ModifyCard" @modified="cardModified"></modify-card>
   </div>
 </template>
 
@@ -390,12 +409,14 @@ import {
 import { attachmentPreview } from "../../login/api";
 import SimpleImagePreview from "@/components/SimpleImagePreview";
 import SelectUserDialog from "../../base/components/SelectUserDialog";
+import ModifyCard from "../../card/components/ModifyCard";
 import { CARD_SOURCE_TYPE, TASK_AUDIT_RESULT } from "@/constants/enumerate";
 import {
   taskFlowDetail,
   taskFlowApproverExchange,
   taskFlowNodeInfo,
-  taskFlowApprover
+  taskFlowApprover,
+  flowDetailByFlowId
 } from "../../base/api";
 
 const initTaskApply = {
@@ -414,6 +435,7 @@ const initTaskApply = {
   exposedPaperType: "",
   // 流程
   flowId: "",
+  flowStatus: "",
   setup: 0,
   // 工作台任务id
   flowTaskId: "",
@@ -433,7 +455,8 @@ export default {
     UploadPaperDialog,
     CardOptionDialog,
     SimpleImagePreview,
-    SelectUserDialog
+    SelectUserDialog,
+    ModifyCard
   },
   props: {
     examTask: {
@@ -462,7 +485,8 @@ export default {
       reason: "",
       TASK_AUDIT_RESULT: { ...TASK_AUDIT_RESULT, EXCHANGE: "转他人审批" },
       // audit
-      flows: [],
+      flowList: [],
+      flowInfo: {},
       auditModal: {
         approvePass: "PASS",
         setup: "",
@@ -532,14 +556,7 @@ export default {
       const IS_COMMON_AUDIT = this.editType
         ? this.editType === "AUDIT"
         : this.curTaskApply.setup > 1;
-      return IS_COMMON_AUDIT && !this.IS_AUDIT_APPLY;
-    },
-    IS_AUDIT_APPLY() {
-      // IS_PRELAST_STEP
-      return (
-        this.curTaskApply.subFlowReject &&
-        this.curTaskApply.setup === this.flows.length - 1
-      );
+      return IS_COMMON_AUDIT;
     },
     cardTodoName() {
       let name = "创建答题卡";
@@ -610,7 +627,11 @@ export default {
         ? JSON.parse(this.curTaskApply.paperConfirmAttachmentIds)
         : [];
 
-      this.getFlowHistory();
+      if (this.curTaskApply.flowStatus === "START") {
+        this.getFlowList();
+      } else {
+        this.getFlowHistory();
+      }
 
       if (this.IS_AUDIT) this.getRejectSetupList();
     },
@@ -649,6 +670,19 @@ export default {
         attachments: []
       });
     },
+    async getFlowList() {
+      if (!this.curTaskApply.flowId) return;
+      const data = await flowDetailByFlowId(this.curTaskApply.flowId);
+      if (!data) return;
+      this.flowInfo = {
+        customFlowId: data.id,
+        version: data.version
+      };
+      this.flowList = data.flowTaskResultList || [];
+      if (this.flowList.length) {
+        this.flowList[0].type = "success";
+      }
+    },
     async getRejectSetupList() {
       const data = await taskFlowNodeInfo(this.curTaskApply.flowTaskId);
       this.rejectSetupList = (data && data.rejectSetupList) || [];
@@ -731,16 +765,8 @@ export default {
       );
     },
     toEditCard() {
-      this.cachePrepareTcpCard();
-      this.$router.push({
-        name: "CardEdit",
-        params: {
-          cardId: this.curTaskApply.cardId
-        }
-      });
-    },
-    cachePrepareTcpCard() {
       this.$ls.set("prepareTcPCard", {
+        cardId: this.task.cardId,
         examTaskId: this.task.examTaskId,
         courseCode: this.task.courseCode,
         courseName: this.task.courseName,
@@ -749,6 +775,7 @@ export default {
         type: "CUSTOM",
         createMethod: "STANDARD"
       });
+      this.$refs.ModifyCard.open();
     },
     async toCreateOrViewCard() {
       await this.silentSave();
@@ -780,7 +807,25 @@ export default {
       window.open(data.url);
     },
     cardConfirm(data) {
-      this.curTaskApply = this.$objAssign(this.curTaskApply, data);
+      const { makeMethod } = data;
+
+      if (makeMethod === "CUST") {
+        this.silentSave();
+        this.curTaskApply = this.$objAssign(this.curTaskApply, data);
+      } else if (makeMethod === "SELECT") {
+        this.curTaskApply = this.$objAssign(this.curTaskApply, data);
+      } else {
+        this.$ls.set("prepareTcPCard", data);
+        this.$refs.ModifyCard.open();
+      }
+    },
+    async cardModified(cardId) {
+      if (!cardId) return;
+      this.curTaskApply = this.$objAssign(this.curTaskApply, {
+        cardId,
+        makeMethod: "SELF"
+      });
+      this.silentSave();
     },
     async changeCreateCardType() {
       const h = this.$createElement;
@@ -795,7 +840,6 @@ export default {
           )
         ]),
         showCancelButton: true,
-
         type: "warning"
       }).catch(() => {});
       if (result !== "confirm") return;

+ 2 - 7
src/modules/exam/components/CardOptionDialog.vue

@@ -240,7 +240,6 @@ export default {
     async confirm() {
       // 客服制卡
       if (this.modalForm.makeMethod === "CUST") {
-        this.$emit("draft-task");
         const valid = await this.$refs.ApplyModalForm.validate().catch(
           () => {}
         );
@@ -271,8 +270,7 @@ export default {
 
       // 自主创建
       if (this.modalForm.makeMethod === "SELF") {
-        this.$emit("draft-task");
-        this.$ls.set("prepareTcPCard", {
+        this.$emit("confirm", {
           examTaskId: this.modalForm.examTaskId,
           courseCode: this.modalForm.courseCode,
           courseName: this.modalForm.courseName,
@@ -283,10 +281,7 @@ export default {
           type: "CUSTOM",
           createMethod: "STANDARD"
         });
-        // 打开题卡编辑页,创建题卡,并预设需要绑定的任务
-        this.$router.push({
-          name: "CardEdit"
-        });
+        this.cancel();
         return;
       }
 

+ 4 - 2
src/modules/exam/components/ModifyTaskApply.vue

@@ -78,12 +78,12 @@
           <col width="100" />
         </colgroup>
         <tr>
-          <th>使用班级</th>
+          <th v-if="hasClassInfo">使用班级</th>
           <th>人数</th>
           <th>总印份数</th>
         </tr>
         <tr v-for="(item, index) in examRoomInfoList" :key="index">
-          <td>{{ item.clazzNames }}</td>
+          <td v-if="hasClassInfo">{{ item.clazzNames }}</td>
           <td>{{ item.studentCount }}</td>
           <td>{{ item.printCount }}</td>
         </tr>
@@ -198,6 +198,7 @@ export default {
       modalIsShow: false,
       modalForm: {},
       examRule: {},
+      hasClassInfo: false,
       examRoomInfoList: [],
       printTotalCount: 0
     };
@@ -239,6 +240,7 @@ export default {
         ];
       } else {
         this.examRoomInfoList = data.examRoomInfoList || [];
+        this.hasClassInfo = this.examRoomInfoList.some(item => item.clazzNames);
       }
       this.printTotalCount = data.printTotalCount;
       this.modalForm.paperName = data.paperName || "";

+ 6 - 10
src/modules/exam/components/ModifyTaskPaper.vue

@@ -186,12 +186,15 @@
       :data="curTaskApply"
       @confirm="cardConfirm"
     ></card-option-dialog>
+    <!-- ModifyCard -->
+    <modify-card ref="ModifyCard"></modify-card>
   </div>
 </template>
 
 <script>
 import UploadPaperDialog from "./UploadPaperDialog";
 import CardOptionDialog from "./CardOptionDialog";
+import ModifyCard from "../../card/components/ModifyCard";
 import { taskApplyDetail, taskPaperApplyEdit } from "../api";
 import { attachmentPreview } from "../../login/api";
 import { examRuleDetail } from "../../base/api";
@@ -217,7 +220,7 @@ const initTaskApply = {
 
 export default {
   name: "modify-task-paper",
-  components: { UploadPaperDialog, CardOptionDialog },
+  components: { UploadPaperDialog, CardOptionDialog, ModifyCard },
   props: {
     instance: {
       type: Object,
@@ -379,16 +382,8 @@ export default {
       );
     },
     toEditCard() {
-      this.cachePrepareTcpCard();
-      this.$router.push({
-        name: "CardEdit",
-        params: {
-          cardId: this.curTaskApply.cardId
-        }
-      });
-    },
-    cachePrepareTcpCard() {
       this.$ls.set("prepareTcPCard", {
+        cardId: this.curTaskApply.cardId,
         examTaskId: this.curTaskApply.examTaskId,
         courseCode: this.curTaskApply.courseCode,
         courseName: this.curTaskApply.courseName,
@@ -398,6 +393,7 @@ export default {
         type: "CUSTOM",
         createMethod: "STANDARD"
       });
+      this.$refs.ModifyCard.open();
     },
     async toCreateOrViewCard() {
       this.task = this.getTaskData();

+ 6 - 8
src/modules/exam/components/PaperApproveTable.vue

@@ -60,15 +60,13 @@
           <table class="paper-table">
             <tr>
               <th style="width: 100px;">卷袋编号</th>
-              <th>使用校区</th>
-              <th>使用班级</th>
+              <th v-if="hasClassInfo">使用班级</th>
               <th style="width: 80px;">人数</th>
               <th style="width: 100px;">总印份数</th>
             </tr>
             <tr v-for="item in examRoomInfoList" :key="item.id" :id="item.id">
               <td style="width: 100px;">{{ item.packageCode }}</td>
-              <td>{{ item.campusNames }}</td>
-              <td>{{ item.clazzNames }}</td>
+              <td v-if="hasClassInfo">{{ item.clazzNames }}</td>
               <td style="width: 80px;">{{ item.studentCount }}</td>
               <td style="width: 100px;">{{ item.printCount }}</td>
             </tr>
@@ -137,15 +135,13 @@
             >
               <tr>
                 <th style="width: 100px;">卷袋编号</th>
-                <th>使用校区</th>
-                <th>使用班级</th>
+                <th v-if="hasClassInfo">使用班级</th>
                 <th style="width: 80px;">人数</th>
                 <th style="width: 100px;">总印份数</th>
               </tr>
               <tr v-for="item in examRoomInfoList" :key="item.id" :id="item.id">
                 <td style="width: 100px;">{{ item.packageCode }}</td>
-                <td>{{ item.campusNames }}</td>
-                <td>{{ item.clazzNames }}</td>
+                <td v-if="hasClassInfo">{{ item.clazzNames }}</td>
                 <td style="width: 80px;">{{ item.studentCount }}</td>
                 <td style="width: 100px;">{{ item.printCount }}</td>
               </tr>
@@ -195,6 +191,7 @@ export default {
       loading: false,
       basicInfo: {},
       examRoomInfoList: [],
+      hasClassInfo: false,
       approvalInfoList: [],
       pages: []
     };
@@ -213,6 +210,7 @@ export default {
         item.height = 0;
         return item;
       });
+      this.hasClassInfo = this.examRoomInfoList.some(item => item.clazzNames);
       const levelNames = {
         2: "教研室审批意见",
         3: "二级学院(部)审批意见"