zhangjie 2 ヶ月 前
コミット
00e93a2681

+ 2 - 2
src/modules/print/api.js

@@ -2,8 +2,8 @@ import { $postParam, $post } from "@/plugins/axios";
 
 // other
 // 印刷计划模糊查询
-export const printPlanQuery = (param) => {
-  return $postParam("/api/admin/exam/print/query", { param });
+export const printPlanQuery = (datas = {}) => {
+  return $postParam("/api/admin/exam/print/query", datas);
 };
 // 考点模糊查询
 export const placeQuery = (datas) => {

+ 0 - 36
src/modules/print/components/ModifyPrintPlan.vue

@@ -26,21 +26,6 @@
             :disabled="!editable"
           ></el-input>
         </el-form-item>
-        <el-form-item prop="examStartTime" label="考试时间:">
-          <el-date-picker
-            v-model="createTime"
-            type="datetimerange"
-            range-separator="至"
-            start-placeholder="开始时间"
-            end-placeholder="结束时间"
-            value-format="timestamp"
-            align="right"
-            unlink-panels
-            :disabled="!editable"
-            @change="dateChange"
-          >
-          </el-date-picker>
-        </el-form-item>
         <el-form-item prop="semesterId" label="使用学期:">
           <semester-select
             v-model="modalForm.semesterId"
@@ -278,8 +263,6 @@ import ExamBackupEdit from "../../base/components/ExamBackupEdit.vue";
 const initModalForm = {
   id: null,
   name: "",
-  examStartTime: "",
-  examEndTime: "",
   semesterId: "",
   examId: "",
   category: "FORMAL",
@@ -388,7 +371,6 @@ export default {
       modalIsShow: false,
       isSubmit: false,
       modalForm: deepCopy(initModalForm),
-      createTime: [],
       PRINT_CONTENT_TYPE,
       DRAW_RULE_TYPE,
       PRINT_BACKUP_TYPE,
@@ -408,13 +390,6 @@ export default {
             trigger: "change",
           },
         ],
-        examStartTime: [
-          {
-            required: true,
-            message: "请设置考试时间",
-            trigger: "change",
-          },
-        ],
         semesterId: [
           {
             required: true,
@@ -550,7 +525,6 @@ export default {
     },
     initData(val) {
       if (val.id) {
-        this.createTime = [val.examStartTime, val.examEndTime];
         this.modalForm = this.$objAssign(deepCopy(initModalForm), val);
         const transformInfo = (item) => {
           const templateIds = item.templateId ? [item.templateId] : [];
@@ -611,7 +585,6 @@ export default {
           (item) => this.templateSources[item.type]
         );
         this.modalForm = modalForm;
-        this.createTime = [];
       }
     },
     visibleChange() {
@@ -692,15 +665,6 @@ export default {
       this.modalForm.printContent = JSON.parse(val.printContent);
       this.checkSelectAll();
     },
-    dateChange() {
-      if (this.createTime) {
-        this.modalForm.examStartTime = this.createTime[0];
-        this.modalForm.examEndTime = this.createTime[1];
-      } else {
-        this.modalForm.examStartTime = "";
-        this.modalForm.examEndTime = "";
-      }
-    },
     async submit() {
       const valid = await this.$refs.modalFormComp.validate().catch(() => {});
       if (!valid) return;

+ 14 - 4
src/modules/print/views/BusinessDataExport.vue

@@ -358,9 +358,15 @@ export default {
       uploadData: {},
     };
   },
-  mounted() {
-    // this.search();
-    this.getPlans();
+  watch: {
+    "filter.examId": {
+      handler(val) {
+        if (val) {
+          this.getPlans();
+        }
+      },
+      immediate: true,
+    },
   },
   methods: {
     async getList() {
@@ -460,7 +466,11 @@ export default {
     },
     // import
     async getPlans() {
-      const res = await printPlanQuery();
+      if (!this.filter.examId || !this.filter.semesterId) return;
+      const res = await printPlanQuery({
+        examId: this.filter.examId,
+        semesterId: this.filter.semesterId,
+      });
       this.plans = res.filter((item) => ["NEW", "READY"].includes(item.status));
     },
     toImport() {

+ 1 - 5
src/modules/print/views/PrintPlanManage.vue

@@ -147,11 +147,7 @@
               class="btn-danger"
               type="text"
               @click="toDelete(scope.row)"
-              v-if="
-                (isSchoolAdmin || scope.row.createId === curUserId) &&
-                scope.row.status === 'NEW' &&
-                checkPrivilege('link', 'delete')
-              "
+              v-if="checkPrivilege('link', 'delete')"
               >删除</el-button
             >
             <el-button