소스 검색

bug修改

zhangjie 3 년 전
부모
커밋
8915b56d6d

+ 29 - 0
src/assets/styles/pages.scss

@@ -193,6 +193,10 @@
     padding: 0 10px;
   }
 
+  .el-timeline-item__node--success {
+    background-color: $--color-success;
+  }
+
   .flow-item {
     &-time {
       color: #909399;
@@ -213,6 +217,31 @@
         margin-left: 10px;
       }
     }
+
+    &-attachment {
+      .btn-primary {
+        &:hover {
+          font-weight: normal;
+        }
+
+        & + .btn-primary {
+          position: relative;
+          margin-left: 20px;
+
+          &::before {
+            content: "";
+            display: block;
+            position: absolute;
+            width: 0;
+            height: 14px;
+            border-left: 1px solid $--color-text-gray-4;
+            left: -10px;
+            top: 50%;
+            margin-top: -7px;
+          }
+        }
+      }
+    }
   }
 }
 

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

@@ -175,9 +175,6 @@ export const flowEnd = flowId => {
 export const flowDelete = ({ id, enable }) => {
   return $post("/api/admin/custom/flow/enable", { id, enable });
 };
-export const flowRegister = (datas, headers) => {
-  return $post("/api/admin/custom/flow/register", datas, { headers });
-};
 export const updateFlowName = datas => {
   return $post("/api/admin/custom/flow/rename", datas);
 };

+ 12 - 7
src/modules/base/components/ModifyFlowDetail.vue

@@ -369,7 +369,8 @@ export default {
         this.toSelectNode(this.nodes[1]);
       } else {
         this.nodes = deepCopy(this.initNodes);
-        this.toSelectNode(this.nodes[1]);
+        // this.toSelectNode(this.nodes[1]);
+        this.toAddNode(this.nodes[0].id);
       }
     },
     visibleChange() {
@@ -399,7 +400,7 @@ export default {
     toDeleteNode() {
       const pos = this.nodes.findIndex(node => node.id === this.curNode.id);
       this.nodes.splice(pos, 1);
-      if (this.nodes[pos]) {
+      if (this.nodes[pos] && this.nodes[pos].type === "PROCESS") {
         this.toSelectNode(this.nodes[pos]);
       } else {
         let prevPos = pos - 1;
@@ -408,7 +409,10 @@ export default {
       }
     },
     toSelectNode(node) {
-      if (node.type === "START" || node.type === "END") return;
+      if (node.type === "START" || node.type === "END") {
+        this.curNode = {};
+        return;
+      }
       this.curNode = node ? deepCopy(node) : {};
     },
     curNodeChange() {
@@ -476,10 +480,11 @@ export default {
         .filter(node => node.type === "PROCESS")
         .some(node => {
           if (node.property.approveUserType === "USER") {
-            return !(
-              node.property.approveUsers.length &&
-              node.property.copyForUsers.length
-            );
+            return !node.property.approveUsers.length;
+            // return !(
+            //   node.property.approveUsers.length &&
+            //   node.property.copyForUsers.length
+            // );
           } else {
             return !node.property.approveRoles.length;
           }

+ 8 - 4
src/modules/base/components/SelectUserDialog.vue

@@ -103,9 +103,6 @@ export default {
     this.getOrgUser();
   },
   methods: {
-    nodec(q, w) {
-      console.log(q, w);
-    },
     async getOrgUser() {
       const data = await organizationList();
       const parseUser = list => {
@@ -125,6 +122,7 @@ export default {
               return {
                 id: user.id,
                 name: user.realName,
+                orgName: item.name,
                 isUser: true
               };
             });
@@ -160,7 +158,13 @@ export default {
           String(value).replace(/[|\\{}()[\]^$+*?.]/g, "\\$&");
         const reg = new RegExp(escapeRegexpString(this.filterLabel), "i");
 
-        this.userTree = this.userList.filter(item => reg.test(item.name));
+        this.userTree = this.userList
+          .filter(item => reg.test(item.name))
+          .map(item => {
+            let nitme = { ...item };
+            nitme.name = `${nitme.name}(${nitme.orgName})`;
+            return nitme;
+          });
       }
     },
     visibleChange() {

+ 13 - 1
src/modules/base/views/ApproveRecordManage.vue

@@ -185,7 +185,19 @@ export default {
       this.getList();
     },
     async toPreview(row) {
-      this.curExamTask = await examTaskGetOne(row.taskId);
+      const types = {
+        exam_task: this.previewExmaTask
+      };
+
+      const func = types[row.objectTable];
+      if (!func) {
+        this.$message.error("操作错误!");
+        return;
+      }
+      func(row);
+    },
+    async previewExmaTask(data) {
+      this.curExamTask = await examTaskGetOne(data.objectId);
       this.$refs.ModifyTaskApply.open();
     },
     toDelete(row) {

+ 1 - 8
src/modules/base/views/FlowManage.vue

@@ -88,26 +88,19 @@
     <modify-flow-detail
       ref="ModifyFlowDetail"
       :instance="curFlow"
-      :modified="getList"
-    ></modify-flow-detail>
-    <!-- RegistFlowDialog -->
-    <regist-flow-dialog
-      ref="RegistFlowDialog"
       @modified="getList"
-    ></regist-flow-dialog>
+    ></modify-flow-detail>
   </div>
 </template>
 
 <script>
 import { flowListPage, flowDelete } from "../api";
-import RegistFlowDialog from "../components/RegistFlowDialog";
 import ModifyFlow from "../components/ModifyFlow";
 import ModifyFlowDetail from "../components/ModifyFlowDetail";
 
 export default {
   name: "flow-manage",
   components: {
-    RegistFlowDialog,
     ModifyFlow,
     ModifyFlowDetail
   },

+ 21 - 3
src/modules/exam/components/ApplyContent.vue

@@ -199,6 +199,7 @@
               <h4 class="flow-item-title">{{ flow.approveUserName }}</h4>
               <p class="flow-item-desc">
                 <span
+                  v-if="flow.approveOperation"
                   :class="{
                     'color-danger': flow.approveOperation === 'REJECT'
                   }"
@@ -208,6 +209,17 @@
                 >
                 <span>{{ flow.approveRemark }}</span>
               </p>
+              <div v-if="flow.attachments.length" class="flow-item-attachment">
+                <span>附件:</span>
+                <el-button
+                  v-for="item in flow.attachments"
+                  :key="item.name"
+                  type="text"
+                  class="btn-primary"
+                  @click="downloadPaper(item)"
+                  >{{ item.name }}卷:{{ item.filename }}</el-button
+                >
+              </div>
             </div>
           </el-timeline-item>
         </el-timeline>
@@ -387,6 +399,7 @@ import {
 } from "../../base/api";
 
 const initTaskApply = {
+  examId: "",
   examTaskId: "",
   paperType: "A",
   paperAttachmentIds: "",
@@ -565,7 +578,8 @@ export default {
         this.examTask.source
       );
       this.curTaskApply = this.$objAssign(initTaskApply, data || {});
-      this.curTaskApply.examId = this.examTask.examId;
+      this.curTaskApply.examId =
+        this.curTaskApply.examId || this.examTask.examId;
       this.curTaskApply.examTaskId = this.examTask.id;
       this.curTaskApply.courseCode = this.examTask.courseCode;
       this.curTaskApply.courseName = this.examTask.courseName;
@@ -617,17 +631,21 @@ export default {
 
       this.flowHistoryList = data.tfFlowViewLogResultList.map(item => {
         item.type = FLOW_STATUS[item.approveOperation];
+        item.attachments = item.paperAttachmentId
+          ? JSON.parse(item.paperAttachmentId)
+          : [];
         return item;
       });
       const flowIsEnd = data.currFlowTaskResult.taskKey === "end";
       this.flowHistoryList.push({
-        type: flowIsEnd ? "success" : null,
+        type: flowIsEnd ? "success" : "current",
         stepKey: this.$randomCode(),
         approveSetup: data.currFlowTaskResult.setup, //审批人节点
         approveRemark: data.currFlowTaskResult.taskName, //审批信息
         approveOperation: flowIsEnd ? "END" : "",
         approveUserName: data.currFlowTaskResult.approveUserNames, //审批人
-        createTime: null
+        createTime: null,
+        attachments: []
       });
     },
     async getRejectSetupList() {

+ 1 - 1
src/modules/exam/components/ApplySubmitHistory.vue

@@ -29,7 +29,7 @@
           class-name="action-column"
           align="left"
         >
-          <div iv slot-scope="scope">
+          <div slot-scope="scope">
             <el-button
               v-for="item in scope.row.paperUrls"
               :key="item.name"

+ 4 - 9
src/modules/exam/components/createExamAndPrintTask/CreateExamAndPrintTask.vue

@@ -19,17 +19,12 @@
         <info-exam-task
           ref="InfoExamTask"
           :datas="infos"
-          @data-change="dataChange"
-          @course-change="examTaskCourseChange"
+          @relate-info-change="printTaskRelateInfoChange"
         ></info-exam-task>
       </div>
       <div class="apply-part">
         <h3 class="apply-part-title">考务信息</h3>
-        <info-print-task
-          ref="InfoPrintTask"
-          :datas="infos"
-          @data-change="dataChange"
-        ></info-print-task>
+        <info-print-task ref="InfoPrintTask" :datas="infos"></info-print-task>
       </div>
       <div class="apply-part">
         <h3 class="apply-part-title">流程</h3>
@@ -199,7 +194,7 @@ export default {
         this.infos[key] = Object.assign(this.infos[key], val);
       });
     },
-    examTaskCourseChange(data) {
+    printTaskRelateInfoChange(data) {
       this.dataChange(data);
 
       this.$nextTick(() => {
@@ -248,7 +243,7 @@ export default {
       });
       // 更新printPlan
       const printPlan = await examConfigByExamIdOrgId({
-        examId,
+        examId: this.infos.examTask.examId,
         orgId: this.$ls.get("orgId")
       }).catch(() => {});
       if (!printPlan) {

+ 27 - 26
src/modules/exam/components/createExamAndPrintTask/InfoExamTask.vue

@@ -30,7 +30,9 @@
               <exam-select
                 v-model="examTask.examId"
                 :semester-id="examTask.semesterId"
+                :clearable="false"
                 class="width-full"
+                @change="emitRelateInfo"
               ></exam-select>
             </el-form-item>
           </el-col>
@@ -341,15 +343,14 @@ export default {
       this.$nextTick(() => {
         this.$refs.examTaskComp.clearValidate();
       });
-
-      this.$emit("on-ready");
     },
     async getCardList() {
       if (!this.examTask.courseCode) return;
       const data = await cardForSelectList({
         courseCode: this.examTask.courseCode,
         paperType: this.paperAttachments.map(item => item.name).join(","),
-        cardRuleId: this.examTask.cardRuleId
+        cardRuleId: this.examTask.cardRuleId,
+        examId: this.examTask.examId
       });
       this.cards = data || [];
       if (this.cards.length) {
@@ -375,6 +376,27 @@ export default {
       );
       this.examTask.paperName = curSemester.name;
     },
+    teachingRoomChange() {
+      this.examTask.courseCode = "";
+      this.examTask.courseName = "";
+      this.courses = [];
+      this.examTaskDetail.cardId = "";
+      this.cards = [];
+      this.getCourses();
+    },
+    courseChange(val) {
+      if (val) {
+        const course = this.courses.find(item => item.code === val);
+        this.examTask.courseName = course.name;
+      } else {
+        this.examTask.courseName = "";
+      }
+
+      this.examTaskDetail.cardId = "";
+      this.cards = [];
+      this.getCardList();
+      this.emitRelateInfo();
+    },
     async checkData() {
       const valid = await this.$refs.examTaskComp.validate().catch(() => {});
       if (!valid) return Promise.reject();
@@ -406,8 +428,8 @@ export default {
       };
       return data;
     },
-    updateData() {
-      this.$emit("data-change", this.getData());
+    emitRelateInfo() {
+      this.$emit("relate-info-change", this.getData());
     },
     // exam-task-detail edit
     addAtachment() {
@@ -479,27 +501,6 @@ export default {
     cardConfirm(data) {
       this.examTaskDetail = this.$objAssign(this.examTaskDetail, data);
     },
-    teachingRoomChange() {
-      this.examTask.courseCode = "";
-      this.examTask.courseName = "";
-      this.courses = [];
-      this.examTaskDetail.cardId = "";
-      this.cards = [];
-      this.getCourses();
-    },
-    courseChange(val) {
-      if (val) {
-        const course = this.courses.find(item => item.code === val);
-        this.examTask.courseName = course.name;
-      } else {
-        this.examTask.courseName = "";
-      }
-
-      this.examTaskDetail.cardId = "";
-      this.cards = [];
-      this.getCardList();
-      this.$emit("course-change", this.getData());
-    },
     getTaskDetailData() {
       let data = { ...this.examTaskDetail };
       data.paperType = this.paperAttachments.map(item => item.name).join(",");

+ 2 - 2
src/modules/exam/components/createExamAndPrintTask/InfoPrintTask.vue

@@ -189,8 +189,6 @@ export default {
         this.buildTableData();
       }
       this.updatePackageInfos();
-
-      this.$emit("on-ready");
     },
     checkData() {
       if (!this.modalForm.examStartTime || !this.modalForm.examEndTime) {
@@ -302,6 +300,8 @@ export default {
     },
     async getClassList() {
       this.classList = [];
+      if (!this.datas.examTask.courseCode) return;
+
       const data = await listTaskApplyClass({
         courseCode: this.datas.examTask.courseCode
       });