zhangjie 4 vuotta sitten
vanhempi
commit
cbab067fb7

+ 1 - 1
src/components/UploadFileDialog.vue

@@ -95,7 +95,7 @@ export default {
         return;
       }
       const data = await attachmentPreview(this.attachment.attachmentId);
-      window.open(data.path);
+      window.open(data.url);
     }
   }
 };

+ 2 - 2
src/modules/base/components/ModifyTemplate.vue

@@ -95,7 +95,7 @@
 
 <script>
 import { updateTemplate } from "../api";
-import { attachmentPreview } from "../../login/api";
+import { attachmentDetail } from "../../login/api";
 import UploadFileView from "@/components/UploadFileView";
 import SelectOrgs from "./SelectOrgs";
 
@@ -217,7 +217,7 @@ export default {
       }
     },
     async getAttachment() {
-      const data = await attachmentPreview(this.instance.attachmentId);
+      const data = await attachmentDetail(this.instance.attachmentId);
       this.attachment = data;
 
       this.$nextTick(() => {

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

@@ -179,6 +179,7 @@
 import UploadPaperDialog from "./UploadPaperDialog";
 import CardOptionDialog from "./CardOptionDialog";
 import { taskApplyDetail, updateTaskApply, updateTaskReview } from "../api";
+import { attachmentPreview } from "../../login/api";
 
 const initTaskApply = {
   examTaskId: "",
@@ -372,8 +373,9 @@ export default {
     cancel() {
       this.$emit("cancel");
     },
-    downloadPaper(attachment) {
-      window.open(attachment.url);
+    async downloadPaper(attachment) {
+      const data = await attachmentPreview(attachment.attachmentId);
+      window.open(data.url);
     },
     cardConfirm(data) {
       this.curTaskApply = this.$objAssign(this.curTaskApply, data);

+ 1 - 8
src/modules/exam/components/ModifyExamTask.vue

@@ -85,7 +85,7 @@
             说明:若选择全部通卡,则命题老师只能选择通卡,若选择题卡规则,则专卡和通卡均可选择
           </p>
         </el-form-item>
-        <el-form-item prop="userId" label="命题老师:">
+        <el-form-item label="命题老师:">
           <question-teacher-user-select
             v-if="editType !== 'PREVIEW' && modalIsShow"
             ref="QuestionTeacherSelect"
@@ -196,13 +196,6 @@ export default {
             message: "请选择题卡规则",
             trigger: "change"
           }
-        ],
-        userId: [
-          {
-            required: true,
-            message: "请选择命题老师",
-            trigger: "change"
-          }
         ]
       }
     };

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

@@ -45,6 +45,7 @@
 
 <script>
 import { taskApplyDetail } from "../api";
+import { attachmentPreview } from "../../login/api";
 
 export default {
   name: "preview-task-paper",
@@ -75,8 +76,12 @@ export default {
     open() {
       this.modalIsShow = true;
     },
-    downloadPaper(attachment) {
-      window.open(attachment.url);
+    // downloadPaper(attachment) {
+    //   window.open(attachment.url);
+    // },
+    async downloadPaper(attachment) {
+      const data = await attachmentPreview(attachment.attachmentId);
+      window.open(data.url);
     },
     toViewCard() {
       window.open(

+ 2 - 2
src/modules/exam/components/WaitTaskAudit.vue

@@ -32,8 +32,8 @@
           <span>{{ task.createTime | timestampFilter }}</span>
         </p>
         <div class="part-box-flex">
-          <el-tag type="success" effect="dark">
-            {{ task.specialty }}
+          <el-tag :type="task.residueTips.status" effect="dark">
+            {{ task.residueTips.title }}
           </el-tag>
           <span class="task-action" @click="toDo(task)"
             >立即处理 <i class="el-icon-arrow-right"></i

+ 2 - 2
src/modules/exam/components/WaitTaskExam.vue

@@ -24,8 +24,8 @@
           <span>{{ task.endTime | timestampFilter }}</span>
         </p>
         <div class="part-box-flex">
-          <el-tag type="success" effect="dark">
-            {{ task.specialty }}
+          <el-tag :type="task.residueTips.status" effect="dark">
+            {{ task.residueTips.title }}
           </el-tag>
           <span class="task-action" @click="toDo(task)"
             >立即处理 <i class="el-icon-arrow-right"></i

+ 3 - 4
src/modules/exam/views/DataTaskManage.vue

@@ -61,11 +61,10 @@
         stripe
         @selection-change="handleSelectionChange"
       >
-        <el-table-column type="selection" width="55"></el-table-column>
         <el-table-column
           type="index"
           label="序号"
-          width="70"
+          width="50"
           align="center"
           :index="indexMethod"
         ></el-table-column>
@@ -90,7 +89,7 @@
               v-if="scope.row.hasReportFile"
               class="btn-table-icon"
               type="text"
-              icon="icon icon-edit"
+              icon="el-icon-download"
               :disabled="loading"
               @click="toDonwloadLog(scope.row)"
               title="导出日志"
@@ -98,7 +97,7 @@
             <el-button
               class="btn-table-icon"
               type="text"
-              icon="icon icon-circle-right"
+              icon="icon icon-download-act"
               :disabled="loading"
               @click="toDonwloadFile(scope.row)"
               title="下载文件"

+ 17 - 5
src/modules/exam/views/ExamTaskManage.vue

@@ -137,6 +137,7 @@
             {{ scope.row.enable | enableFilter }}
           </template>
         </el-table-column>
+        <el-table-column prop="createName" label="创建人"></el-table-column>
         <el-table-column
           class-name="action-column"
           label="操作"
@@ -145,7 +146,10 @@
         >
           <template slot-scope="scope">
             <el-button
-              v-if="scope.row.status !== 'FINISH'"
+              v-if="
+                scope.row.status !== 'FINISH' &&
+                  scope.row.createId === curUserId
+              "
               class="btn-table-icon"
               type="text"
               :icon="
@@ -158,8 +162,9 @@
             ></el-button>
             <el-button
               v-if="
-                (scope.row.status === 'READY' && !scope.row.enable) ||
-                  scope.row.status === 'NEW'
+                ((scope.row.status === 'READY' && !scope.row.enable) ||
+                  scope.row.status === 'NEW') &&
+                  scope.row.createId === curUserId
               "
               class="btn-table-icon"
               type="text"
@@ -195,12 +200,12 @@
       ref="ModifyExamTask"
       :instance="curExamTask"
       :edit-type="editType"
-      @modified="getList"
+      @modified="taskModified"
     ></modify-exam-task>
     <!-- BatchAddExamTask -->
     <batch-add-exam-task
       ref="BatchAddExamTask"
-      @modified="getList"
+      @modified="taskModified"
     ></batch-add-exam-task>
   </div>
 </template>
@@ -211,6 +216,7 @@ import BatchAddExamTask from "../components/BatchAddExamTask";
 import { ABLE_TYPE, EXAM_TASK_STATUS } from "@/constants/enumerate";
 import pickerOptions from "@/constants/datePickerOptions";
 import { examTaskListPage, ableExamTask } from "../api";
+import { mapActions } from "vuex";
 
 export default {
   name: "exam-task-manage",
@@ -237,6 +243,7 @@ export default {
       EXAM_TASK_STATUS,
       examTasks: [],
       curExamTask: {},
+      curUserId: this.$ls.get("user", { id: "" }).id,
       // date-picker
       createTime: [],
       pickerOptions
@@ -246,6 +253,7 @@ export default {
     this.getList();
   },
   methods: {
+    ...mapActions("exam", ["updateWaitTaskCount"]),
     async getList() {
       const datas = {
         ...this.filter,
@@ -324,6 +332,10 @@ export default {
       this.curExamTask = row;
       this.editType = "PREVIEW";
       this.$refs.ModifyExamTask.open();
+    },
+    taskModified() {
+      this.getList();
+      this.updateWaitTaskCount();
     }
   }
 };

+ 18 - 4
src/modules/exam/views/TaskApplyManage.vue

@@ -127,6 +127,7 @@
             {{ scope.row.reviewStatus | reviewStatusFilter }}
           </template>
         </el-table-column>
+        <el-table-column prop="createName" label="创建人"></el-table-column>
         <el-table-column
           class-name="action-column"
           label="操作"
@@ -135,7 +136,11 @@
         >
           <template slot-scope="scope">
             <el-button
-              v-if="!scope.row.auditStatus && !scope.row.reviewStatus"
+              v-if="
+                !scope.row.auditStatus &&
+                  !scope.row.reviewStatus &&
+                  scope.row.createId === curUserId
+              "
               class="btn-table-icon"
               type="text"
               icon="icon icon-edit"
@@ -145,7 +150,8 @@
             <el-button
               v-if="
                 scope.row.auditStatus === 'AUDITED' &&
-                  scope.row.reviewStatus === 'NOT_PASS'
+                  scope.row.reviewStatus === 'NOT_PASS' &&
+                  scope.row.createId === curUserId
               "
               class="btn-table-icon"
               type="text"
@@ -156,7 +162,8 @@
             <el-button
               v-if="
                 scope.row.auditStatus === 'NOT_AUDITED' &&
-                  scope.row.status === 'SUBMIT'
+                  scope.row.status === 'SUBMIT' &&
+                  scope.row.createId === curUserId
               "
               class="btn-table-icon"
               type="text"
@@ -193,7 +200,7 @@
       ref="ModifyTaskApply"
       :edit-type="editType"
       :instance="curExamTask"
-      @modified="getList"
+      @modified="taskModified"
     ></modify-task-apply>
   </div>
 </template>
@@ -203,6 +210,7 @@ import ModifyTaskApply from "../components/ModifyTaskApply";
 import { AUDITING_STATUS, AUDITING_RESULT } from "@/constants/enumerate";
 import pickerOptions from "@/constants/datePickerOptions";
 import { taskApplyListPage, cancelOrRestartTaskApply } from "../api";
+import { mapActions } from "vuex";
 
 export default {
   name: "task-apply-manage",
@@ -228,6 +236,7 @@ export default {
       AUDITING_RESULT,
       examTasks: [],
       curExamTask: {},
+      curUserId: this.$ls.get("user", { id: "" }).id,
       // date-picker
       createTime: [],
       pickerOptions
@@ -237,6 +246,7 @@ export default {
     this.getList();
   },
   methods: {
+    ...mapActions("exam", ["updateWaitTaskCount"]),
     async getList() {
       const datas = {
         ...this.filter,
@@ -281,6 +291,10 @@ export default {
       this.curExamTask = row;
       this.editType = "PREVIEW";
       this.$refs.ModifyTaskApply.open();
+    },
+    taskModified() {
+      this.getList();
+      this.updateWaitTaskCount();
     }
   }
 };

+ 9 - 3
src/modules/exam/views/TaskReviewManage.vue

@@ -204,7 +204,7 @@
       ref="ModifyTaskApply"
       :edit-type="editType"
       :instance="curExamTask"
-      @modified="getList"
+      @modified="taskModified"
     ></modify-task-apply>
     <!-- audit-dialog-->
     <el-dialog
@@ -251,6 +251,7 @@ import {
   batchUpdateTaskReview
 } from "../api";
 import { download, randomCode } from "@/plugins/utils";
+import { mapActions } from "vuex";
 
 export default {
   name: "task-review-manage",
@@ -301,6 +302,7 @@ export default {
     this.toPage(1);
   },
   methods: {
+    ...mapActions("exam", ["updateWaitTaskCount"]),
     async getList() {
       const datas = {
         ...this.filter,
@@ -364,12 +366,12 @@ export default {
     async auditApply(type, ids) {
       const data = await batchUpdateTaskReview({
         reviewStatus: type,
-        examTaskId: ids,
+        examTaskIds: ids,
         reason: this.auditModal.reason
       }).catch(() => {});
       if (!data) return;
       this.$message.success("审核成功!");
-      this.getList();
+      this.taskModified();
     },
     async toExport() {
       if (this.loading) return;
@@ -404,6 +406,10 @@ export default {
       this.curExamTask = row;
       this.editType = "PREVIEW";
       this.$refs.ModifyTaskApply.open();
+    },
+    taskModified() {
+      this.getList();
+      this.updateWaitTaskCount();
     }
   }
 };

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

@@ -13,6 +13,9 @@ export const sysMenu = () => {
   return $postParam("/api/admin/common/get_menu", {});
 };
 export const attachmentPreview = id => {
+  return $postParam("/api/admin/common/file/preview", { id });
+};
+export const attachmentDetail = id => {
   return $postParam("/api/admin/common/file/get_one", { id });
 };
 export const attachmentDownload = ({ id, type }) => {

+ 4 - 2
src/modules/print/components/ModifyPlanPaper.vue

@@ -136,6 +136,7 @@
 <script>
 import { updatePlanLinkPaper, linkPaperNumberList } from "../api";
 import { taskApplyDetail } from "../../exam/api";
+import { attachmentPreview } from "../../login/api";
 
 const initModalForm = {
   id: null,
@@ -221,8 +222,9 @@ export default {
       );
       if (paper) this.paperTypes = paper.paperTypes;
     },
-    downloadPaper(attachment) {
-      window.open(attachment.path);
+    async downloadPaper(attachment) {
+      const data = await attachmentPreview(attachment.attachmentId);
+      window.open(data.url);
     },
     toViewCard() {
       window.open(

+ 5 - 3
src/modules/print/components/PreviewBusinessDetail.vue

@@ -27,12 +27,12 @@
         <el-row>
           <el-col :span="12">
             <el-form-item label="考试日期:">
-              <span>{{ modalForm.examStartTime }}</span>
+              <span>{{ modalForm.examDate }}</span>
             </el-form-item>
           </el-col>
           <el-col :span="12">
             <el-form-item label="考试时间:">
-              <span>{{ modalForm.examEndTime }}</span>
+              <span>{{ modalForm.examTime }}</span>
             </el-form-item>
           </el-col>
         </el-row>
@@ -108,9 +108,11 @@ const initModalForm = {
   courseNameCode: "",
   examDetailCourseIds: "",
   examEndTime: "",
+  examStartTime: "",
+  examDate: "",
+  examTime: "",
   examPlace: "",
   examRoom: "",
-  examStartTime: "",
   packageCode: null,
   paperNumber: "",
   printPlanId: "",

+ 4 - 0
src/modules/print/views/PrintPlanManage.vue

@@ -87,6 +87,7 @@
             scope.row.createTime | timestampFilter
           }}</span>
         </el-table-column>
+        <el-table-column prop="createName" label="创建人"></el-table-column>
         <el-table-column
           class-name="action-column"
           label="操作"
@@ -100,6 +101,7 @@
               icon="icon icon-edit"
               @click="toEdit(scope.row)"
               title="修改"
+              v-if="scope.row.createId === curUserId"
             ></el-button>
             <el-button
               class="btn-table-icon"
@@ -114,6 +116,7 @@
               icon="icon icon-delete"
               @click="toDelete(scope.row)"
               title="删除"
+              v-if="scope.row.createId === curUserId"
             ></el-button>
           </template>
         </el-table-column>
@@ -165,6 +168,7 @@ export default {
       curPrintPlan: {},
       editType: "ADD",
       PRINT_PLAN_STATUS,
+      curUserId: this.$ls.get("user", { id: "" }).id,
       // date-picker
       createTime: [],
       pickerOptions

+ 1 - 2
src/views/Home.vue

@@ -227,7 +227,6 @@ export default {
         });
       } else {
         this.actCurNav();
-        this.updateWaitTaskCount(this.userRoles);
       }
     },
     async getMenus() {
@@ -336,7 +335,7 @@ export default {
         this.validRoutes.includes("WaitTask") &&
         this.curMenu.name === "exam"
       ) {
-        this.updateWaitTaskCount();
+        this.updateWaitTaskCount(this.userRoles);
       }
     },
     toLogout() {