Pārlūkot izejas kodu

印刷计划管理修改

zhangjie 2 gadi atpakaļ
vecāks
revīzija
a08ab93c14

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

@@ -242,7 +242,6 @@ export const taskResetPdf = id => {
   return $postParam("/api/admin/data/task/reset_create_pdf", { id });
   return $postParam("/api/admin/data/task/reset_create_pdf", { id });
 };
 };
 export const removeDataTask = ({ ids, type }) => {
 export const removeDataTask = ({ ids, type }) => {
-  // TODO:可能不会用了,保留到下一个版本
   return $post("/api/admin/data/task/query11", { ids, type });
   return $post("/api/admin/data/task/query11", { ids, type });
 };
 };
 
 

+ 1 - 1
src/modules/exam/views/ActionLogManage.vue

@@ -111,7 +111,7 @@ export default {
   },
   },
   methods: {
   methods: {
     async getLogTypes() {
     async getLogTypes() {
-      const res = await enumsByType("OPERATION_TYPE_ENUM");
+      const res = await enumsByType("CUSTOMIZED_OPERATION_TYPE_ENUM");
       const data = res || [];
       const data = res || [];
       this.OPERATION_TYPE = {};
       this.OPERATION_TYPE = {};
       data.forEach(item => {
       data.forEach(item => {

+ 6 - 1
src/modules/print/api.js

@@ -44,7 +44,12 @@ export const businessTemplateDownload = () => {
     { responseType: "blob" }
     { responseType: "blob" }
   );
   );
 };
 };
-
+export const planBatchLinkPaper = datas => {
+  return $post("/api/admin/exam/print/todo", datas);
+};
+export const planAllRelatePaperTypes = printPlanId => {
+  return $post("/api/admin/exam/print/todo", { printPlanId });
+};
 // business-data-detail
 // business-data-detail
 export const businessDataDetailListPage = datas => {
 export const businessDataDetailListPage = datas => {
   return $postParam("/api/admin/exam/print/data_detail", datas);
   return $postParam("/api/admin/exam/print/data_detail", datas);

+ 110 - 0
src/modules/print/components/PrintPlanBatchLinkPaper.vue

@@ -0,0 +1,110 @@
+<template>
+  <el-dialog
+    :visible.sync="modalIsShow"
+    title="批量关联"
+    top="15vh"
+    width="500px"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    @open="visibleChange"
+  >
+    <el-form
+      ref="modalFormComp"
+      :model="modalForm"
+      :rules="rules"
+      label-width="85px"
+    >
+      <el-form-item prop="relatePaperType" label="关联类型:">
+        <el-select
+          v-model="modalForm.relatePaperType"
+          placeholder="请选择"
+          multiple
+          style="width:100%"
+        >
+          <el-option
+            v-for="item in paperTypes"
+            :key="item"
+            :value="item"
+            :label="item"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+    </el-form>
+    <div slot="footer">
+      <el-button type="primary" :disabled="isSubmit" @click="submit"
+        >确认</el-button
+      >
+      <el-button @click="cancel">取消</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { planBatchLinkPaper, planAllRelatePaperTypes } from "../api";
+
+export default {
+  name: "print-plan-batch-link-paper",
+  props: {
+    plan: {
+      type: Object,
+      default() {
+        return {};
+      }
+    }
+  },
+  data() {
+    return {
+      modalIsShow: false,
+      isSubmit: false,
+      modalForm: {},
+      paperTypes: [],
+      rules: {
+        relatePaperType: [
+          {
+            required: true,
+            validator: (rule, value, callback) => {
+              if (!value || !value.length) {
+                return callback(new Error("请选择关联类型"));
+              }
+              callback();
+            }
+          }
+        ]
+      }
+    };
+  },
+  methods: {
+    visibleChange() {
+      this.modalForm.relatePaperType = [];
+      this.getPaperTypes();
+    },
+    cancel() {
+      this.modalIsShow = false;
+    },
+    open() {
+      this.modalIsShow = true;
+    },
+    async getPaperTypes() {
+      const data = planAllRelatePaperTypes(this.plan.id);
+      this.paperTypes = data || [];
+    },
+    async submit() {
+      const valid = await this.$refs.modalFormComp.validate().catch(() => {});
+      if (!valid) return;
+
+      if (this.isSubmit) return;
+      this.isSubmit = true;
+      let datas = { printPlanId: this.plan.id, ...this.modalForm };
+      const data = await planBatchLinkPaper(datas).catch(() => {});
+      this.isSubmit = false;
+
+      if (!data) return;
+
+      this.$message.success("操作成功!");
+      this.$emit("modified");
+      this.cancel();
+    }
+  }
+};
+</script>

+ 275 - 0
src/modules/print/components/PrintPlanDetail.vue

@@ -0,0 +1,275 @@
+<template>
+  <div>
+    <el-dialog
+      class="print-plan-detail page-dialog"
+      :visible.sync="modalIsShow"
+      :title="title"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+      append-to-body
+      fullscreen
+      @open="visibleChange"
+    >
+      <div class="part-box part-box-filter part-box-flex">
+        <el-form
+          ref="FilterForm"
+          label-position="left"
+          label-width="85px"
+          inline
+        >
+          <el-form-item label="学期:">
+            <semester-select
+              v-model.trim="filter.semesterId"
+              placeholder="学期"
+              clearable
+            ></semester-select>
+          </el-form-item>
+          <el-form-item label="考试:">
+            <exam-select
+              v-model="filter.examId"
+              :semester-id="filter.semesterId"
+            ></exam-select>
+          </el-form-item>
+          <el-form-item label="课程(代码):" label-width="110px">
+            <course-select
+              v-model.trim="filter.courseCode"
+              :print-plan-id="filter.printPlanIdList"
+              placeholder="课程(代码)"
+              clearable
+            ></course-select>
+          </el-form-item>
+          <el-form-item label="试卷编号:">
+            <paper-number-select
+              ref="PaperNumberSelect"
+              v-model="filter.paperNumber"
+              :print-plan-id="filter.printPlanIdList"
+              placeholder="试卷编号"
+              clearable
+            ></paper-number-select>
+          </el-form-item>
+          <el-form-item label="命题老师:">
+            <el-input
+              v-model="filter.userName"
+              placeholder="命题老师"
+              clearable
+            ></el-input>
+          </el-form-item>
+          <el-form-item label-width="0px">
+            <el-button type="primary" @click="search">查询</el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+
+      <div class="part-box part-box-pad box-justify">
+        <p>
+          <span class="mr-4">
+            该印刷计划共计:
+            <i class="color-primary">{{ totalInfo.totalSubjects }}</i>
+            科次
+          </span>
+          <span class="mr-4">
+            <i class="color-primary">{{ totalInfo.taskCount }}</i> 个命题任务
+          </span>
+          <span class="mr-4">
+            <i class="color-primary">{{ totalInfo.paperCount }}</i>
+            科次(考生人数)
+          </span>
+        </p>
+        <p>
+          <el-button type="primary" @click="toBatchLink">批量关联</el-button>
+        </p>
+      </div>
+
+      <div class="part-box part-box-pad">
+        <el-table ref="TableList" :data="dataList">
+          <el-table-column
+            type="index"
+            label="序号"
+            width="70"
+            :index="indexMethod"
+          ></el-table-column>
+          <el-table-column
+            prop="semesterName"
+            label="学期"
+            min-width="160"
+          ></el-table-column>
+          <el-table-column
+            prop="examName"
+            label="考试"
+            min-width="160"
+          ></el-table-column>
+          <el-table-column
+            prop="courseName"
+            label="课程(代码)"
+            min-width="200"
+          >
+            <span slot-scope="scope"
+              >{{ scope.row.courseName }}({{ scope.row.courseCode }})</span
+            >
+          </el-table-column>
+          <el-table-column
+            prop="paperNumber"
+            label="试卷编号"
+            min-width="160"
+          ></el-table-column>
+          <el-table-column prop="userName" label="命题老师" min-width="100">
+          </el-table-column>
+          <el-table-column
+            prop="exposedPaperType"
+            label="已曝光类型"
+            width="100"
+          >
+            <span slot-scope="scope">{{
+              scope.row.exposedPaperType | defaultFieldFilter
+            }}</span>
+          </el-table-column>
+          <el-table-column
+            prop="unexposedPaperType"
+            label="未曝光类型"
+            width="100"
+          >
+            <span slot-scope="scope">{{
+              scope.row.unexposedPaperType | defaultFieldFilter
+            }}</span>
+          </el-table-column>
+          <el-table-column prop="relatePaperType" label="关联卷型" width="100">
+            <span slot-scope="scope">{{
+              scope.row.relatePaperType | defaultFieldFilter
+            }}</span>
+          </el-table-column>
+          <el-table-column prop="totalSubjects" label="科次" width="80">
+          </el-table-column>
+          <el-table-column
+            class-name="action-column"
+            label="操作"
+            width="100"
+            fixed="right"
+          >
+            <template slot-scope="scope">
+              <el-button
+                class="btn-primary"
+                type="text"
+                @click="toEdit(scope.row)"
+                >关联试卷</el-button
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+        <div class="part-page">
+          <el-pagination
+            background
+            layout="total,prev, pager, next"
+            :current-page="current"
+            :total="total"
+            :page-size="size"
+            @current-change="toPage"
+          >
+          </el-pagination>
+        </div>
+      </div>
+      <div class="tips-info">
+        <p>说明:批量关联操作,只能关联所有命题任务共有的卷型</p>
+      </div>
+    </el-dialog>
+
+    <!-- ModifyPlanPaper -->
+    <modify-plan-paper
+      :instance="curRow"
+      @modified="getList"
+      ref="ModifyPlanPaper"
+    ></modify-plan-paper>
+    <!-- PrintPlanBatchLinkPaper -->
+    <print-plan-batch-link-paper
+      ref="PrintPlanBatchLinkPaper"
+      :plan="plan"
+    ></print-plan-batch-link-paper>
+  </div>
+</template>
+
+<script>
+import { planLinkPaperListPage } from "../api";
+import ModifyPlanPaper from "./ModifyPlanPaper";
+import PrintPlanBatchLinkPaper from "./PrintPlanBatchLinkPaper.vue";
+
+export default {
+  name: "print-plan-detail",
+  components: { ModifyPlanPaper, PrintPlanBatchLinkPaper },
+  props: {
+    plan: {
+      type: Object,
+      default() {
+        return {};
+      }
+    }
+  },
+  computed: {
+    title() {
+      return `印刷计划详情-${this.plan.name}`;
+    }
+  },
+  data() {
+    return {
+      modalIsShow: false,
+      filter: {
+        semesterId: "",
+        examId: "",
+        printPlanIdList: [],
+        courseCode: "",
+        paperNumber: "",
+        userName: ""
+      },
+      current: 1,
+      size: this.GLOBAL.pageSize,
+      total: 0,
+      dataList: [],
+      curRow: {},
+      totalInfo: {}
+    };
+  },
+  methods: {
+    visibleChange() {
+      this.filter = {
+        semesterId: "",
+        examId: "",
+        printPlanIdList: [this.plan.id],
+        courseCode: "",
+        paperNumber: "",
+        userName: ""
+      };
+      this.dataList = [];
+      this.totalInfo = {};
+      this.toPage(1);
+    },
+    cancel() {
+      this.modalIsShow = false;
+    },
+    open() {
+      this.modalIsShow = true;
+    },
+    async getList() {
+      const datas = {
+        ...this.filter,
+        pageNumber: this.current,
+        pageSize: this.size
+      };
+      const data = await planLinkPaperListPage(datas);
+      this.dataList = data.records;
+      this.total = data.total;
+    },
+    toPage(page) {
+      this.current = page;
+      this.getList();
+    },
+    search() {
+      this.toPage(1);
+    },
+    toEdit(row) {
+      this.curRow = row;
+      this.$refs.ModifyPlanPaper.open();
+    },
+    toBatchLink() {
+      this.$refs.PrintPlanBatchLinkPaper.open();
+    }
+  }
+};
+</script>

+ 10 - 3
src/modules/print/views/PrintPlanManage.vue

@@ -9,6 +9,7 @@
               placeholder="印刷计划"
               placeholder="印刷计划"
               multiple
               multiple
               clearable
               clearable
+              style="width:300px"
             ></print-plan-select>
             ></print-plan-select>
           </el-form-item>
           </el-form-item>
           <el-form-item label="计划状态:">
           <el-form-item label="计划状态:">
@@ -159,6 +160,12 @@
       :edit-type="editType"
       :edit-type="editType"
       @modified="getList"
       @modified="getList"
     ></modify-print-plan>
     ></modify-print-plan>
+    <!-- PrintPlanDetail -->
+    <print-plan-detail
+      v-if="checkPrivilege('link', 'preview')"
+      ref="PrintPlanDetail"
+      :plan="curPrintPlan"
+    ></print-plan-detail>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -167,10 +174,11 @@ import { printPlanListPage, removePrintPlan } from "../api";
 import { PRINT_PLAN_STATUS } from "@/constants/enumerate";
 import { PRINT_PLAN_STATUS } from "@/constants/enumerate";
 import pickerOptions from "@/constants/datePickerOptions";
 import pickerOptions from "@/constants/datePickerOptions";
 import ModifyPrintPlan from "../components/ModifyPrintPlan";
 import ModifyPrintPlan from "../components/ModifyPrintPlan";
+import PrintPlanDetail from "../components/PrintPlanDetail.vue";
 
 
 export default {
 export default {
   name: "print-plan-manage",
   name: "print-plan-manage",
-  components: { ModifyPrintPlan },
+  components: { ModifyPrintPlan, PrintPlanDetail },
   data() {
   data() {
     return {
     return {
       filter: {
       filter: {
@@ -233,8 +241,7 @@ export default {
     },
     },
     toPreview(row) {
     toPreview(row) {
       this.curPrintPlan = row;
       this.curPrintPlan = row;
-      this.editType = "PREVIEW";
-      this.$refs.ModifyPrintPlan.open();
+      this.$refs.PrintPlanDetail.open();
     },
     },
     toDelete(row) {
     toDelete(row) {
       this.$confirm(`确定要删除印刷计划【${row.name}】吗?`, "提示", {
       this.$confirm(`确定要删除印刷计划【${row.name}】吗?`, "提示", {