zhangjie %!s(int64=3) %!d(string=hai) anos
pai
achega
917bf00941

+ 2 - 2
card/enumerate.js

@@ -7,8 +7,8 @@ export const EXAM_NUMBER_STYLE = {
 };
 
 export const PAPER_TYPE = {
-  PRINT: "印刷",
-  FILL: "填涂"
+  PRINT: "印刷"
+  // FILL: "填涂"
 };
 
 export const BOOLEAN_TYPE = ["√,×", "是,否", "对,错"];

+ 2 - 3
card/views/CardDesign.vue

@@ -287,8 +287,7 @@ export default {
         courseCode: "",
         courseName: "",
         makeMethod: "SELF",
-        cardRuleId: "",
-        paperType: ""
+        cardRuleId: ""
       }),
       ELEMENT_LIST,
       TOPIC_LIST,
@@ -419,7 +418,7 @@ export default {
           makeMethod: this.prepareTcPCard.makeMethod
         }
       };
-      config.aOrB = this.prepareTcPCard.drawCount > 1;
+      config.aOrB = true; // 默认开启A/B卷型
       config.requiredFields = JSON.parse(config.requiredFields);
       config.extendFields = JSON.parse(config.extendFields);
       config.cardTitle = this.getCardTitle(config.titleRule);

+ 2 - 2
src/constants/enumerate.js

@@ -90,8 +90,8 @@ export const EXAM_NUMBER_STYLE = {
 };
 // 试卷类型方式
 export const PAPER_TYPE = {
-  PRINT: "印刷",
-  FILL: "填涂"
+  PRINT: "印刷"
+  // FILL: "填涂"
 };
 
 // 命题任务状态

+ 1 - 1
src/modules/base/components/ModifyCardRule.vue

@@ -175,7 +175,7 @@ const initModalForm = {
   name: "",
   remark: "",
   examNumberStyle: "",
-  paperType: "",
+  paperType: "PRINT",
   examAbsent: true,
   writeSign: true,
   requiredFields: [],

+ 19 - 5
src/modules/base/views/CardRuleManage.vue

@@ -13,10 +13,15 @@
           </el-form-item>
           <el-form-item label="创建时间:">
             <el-date-picker
-              v-model="filter.createTime"
-              type="date"
+              v-model="createTime"
+              type="datetimerange"
+              :picker-options="pickerOptions"
+              range-separator="至"
+              start-placeholder="创建开始时间"
+              end-placeholder="创建结束时间"
               value-format="timestamp"
-              placeholder="选择创建时间"
+              align="right"
+              unlink-panels
             >
             </el-date-picker>
           </el-form-item>
@@ -132,6 +137,7 @@
 import { ABLE_TYPE } from "@/constants/enumerate";
 import { examRuleDetail, cardRuleListPage, ableCardRule } from "../api";
 import { getEnums } from "../../login/api";
+import pickerOptions from "@/constants/datePickerOptions";
 
 import ModifyCardRule from "../components/ModifyCardRule";
 
@@ -145,7 +151,8 @@ export default {
       filter: {
         enable: null,
         name: "",
-        createTime: null
+        createStartTime: null,
+        createEndTime: null
       },
       current: 1,
       size: this.GLOBAL.pageSize,
@@ -155,7 +162,10 @@ export default {
       editType: "ADD",
       cardRequiredFields: [],
       cardExtendFields: [],
-      ABLE_TYPE
+      ABLE_TYPE,
+      // date-picker
+      createTime: [],
+      pickerOptions
     };
   },
   mounted() {
@@ -201,6 +211,10 @@ export default {
         pageNumber: this.current,
         pageSize: this.size
       };
+      if (this.createTime) {
+        datas.createStartTime = this.createTime[0];
+        datas.createEndTime = this.createTime[1];
+      }
       if (datas.enable !== null && datas.enable !== "")
         datas.enable = !!datas.enable;
       const data = await cardRuleListPage(datas);

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

@@ -141,6 +141,12 @@ export const removeTaskPrint = examTaskPrintId => {
 export const listTaskPrintStudent = datas => {
   return $postParam("/api/admin/exam/task/list_task_print_student", datas);
 };
+export const submitTaskPrint = datas => {
+  return $post("/api/admin/exam/task/submit_task_print", datas);
+};
+export const cancelTaskPrint = datas => {
+  return $post("/api/admin/exam/task/cancel_task_print", datas);
+};
 // 班级查询
 export const listTaskPrintClass = datas => {
   return $postParam("/api/admin/exam/task/list_task_print_class", datas);

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

@@ -590,9 +590,7 @@ export default {
         courseCode: this.task.courseCode,
         courseName: this.task.courseName,
         makeMethod: this.task.makeMethod,
-        cardRuleId: this.task.cardRuleId,
-        paperType: this.task.paperType,
-        drawCount: this.task.drawCount
+        cardRuleId: this.task.cardRuleId
       });
     },
     async toCreateOrViewCard() {

+ 1 - 2
src/modules/exam/components/CreateTaskApply.vue

@@ -539,8 +539,7 @@ export default {
         courseCode: this.examTask.courseCode,
         courseName: this.examTask.courseName,
         makeMethod: this.examTaskDetail.makeMethod,
-        cardRuleId: this.examTask.cardRuleId,
-        paperType: this.paperAttachments.map(item => item.name).join(",")
+        cardRuleId: this.examTask.cardRuleId
       });
     },
     async toCreateOrViewCard() {

+ 78 - 23
src/modules/exam/components/PublishPrintTask.vue

@@ -47,9 +47,19 @@
         </el-form-item>
       </el-form>
     </div>
-    <el-button class="mb-2" type="primary" @click="toAdd"
-      >增加考试对象</el-button
-    >
+    <div class="mb-2">
+      <el-button type="primary" @click="toAdd">增加考试对象</el-button>
+      <el-button
+        v-if="curPlanSubmit"
+        type="danger"
+        :loading="loading"
+        @click="toCancel"
+        >撤回提交</el-button
+      >
+      <el-button v-else type="success" :loading="loading" @click="toSubmit"
+        >提交</el-button
+      >
+    </div>
     <el-table ref="TableList" :data="tableData">
       <el-table-column type="index" width="80" label="卷袋序号">
       </el-table-column>
@@ -77,26 +87,23 @@
             @click="toPreview(scope.row)"
             >考生明细</el-button
           >
-          <el-button class="btn-primary" type="text" @click="toEdit(scope.row)"
+          <el-button
+            v-if="!curPlanSubmit"
+            class="btn-primary"
+            type="text"
+            @click="toEdit(scope.row)"
             >编辑</el-button
           >
-          <el-button class="btn-danger" type="text" @click="toDelete(scope.row)"
+          <el-button
+            v-if="!curPlanSubmit"
+            class="btn-danger"
+            type="text"
+            @click="toDelete(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 slot="footer"></div>
 
@@ -117,7 +124,12 @@
 </template>
 
 <script>
-import { listTaskPrint, removeTaskPrint } from "../api";
+import {
+  listTaskPrint,
+  removeTaskPrint,
+  submitTaskPrint,
+  cancelTaskPrint
+} from "../api";
 import { examRuleDetail } from "../../base/api";
 import CreatePrintTask from "./CreatePrintTask";
 import PrintTaskStudents from "./PrintTaskStudents";
@@ -137,7 +149,6 @@ export default {
   data() {
     return {
       modalIsShow: false,
-      isSubmit: false,
       filter: {
         printPlanName: "",
         printPlanId: "",
@@ -147,9 +158,8 @@ export default {
         courseName: "",
         courseCode: ""
       },
-      current: 1,
-      size: this.GLOBAL.pageSize,
-      total: 0,
+      loading: false,
+      curPlanSubmit: false,
       timeDisabled: false,
       tableData: [],
       curRow: {},
@@ -193,8 +203,8 @@ export default {
         pageSize: this.size
       };
       const data = await listTaskPrint(datas);
-      if (data.iPage) {
-        this.tableData = data.iPage.records.map(item => {
+      if (data.list) {
+        this.tableData = data.list.map(item => {
           item.extends = {};
           const extendFields = item.extendFields
             ? JSON.parse(item.extendFields)
@@ -208,6 +218,7 @@ export default {
       } else {
         this.tableData = [];
       }
+      this.curPlanSubmit = data.isSubmit;
       if (data.examStartTime && data.examEndTime) {
         this.createTime = [data.examStartTime, data.examEndTime];
         this.createDate = getTimeDatestamp(data.examStartTime);
@@ -286,6 +297,50 @@ export default {
       this.curClassId = row.classId;
       this.$refs.PrintTaskStudents.open();
     },
+    async toSubmit() {
+      const result = await this.$confirm(
+        `确定要发布当前计划所有印刷任务吗?`,
+        "提示",
+        {
+          type: "warning"
+        }
+      ).catch(() => {});
+      if (result !== "confirm") return;
+
+      const datas = {
+        printPlanId: this.filter.printPlanId,
+        list: this.tableData.map(item => item.examDetailId)
+      };
+      this.loading = true;
+      const res = await submitTaskPrint(datas).catch(() => {});
+      this.loading = false;
+      if (!res) return;
+
+      this.curPlanSubmit = true;
+      this.$message.success("印刷任务发布成功!");
+    },
+    async toCancel() {
+      const result = await this.$confirm(
+        `确定要撤回当前计划所有印刷任务吗?`,
+        "提示",
+        {
+          type: "warning"
+        }
+      ).catch(() => {});
+      if (result !== "confirm") return;
+
+      const datas = {
+        printPlanId: this.filter.printPlanId,
+        list: this.tableData.map(item => item.examDetailId)
+      };
+      this.loading = true;
+      const res = await cancelTaskPrint(datas).catch(() => {});
+      this.loading = false;
+      if (!res) return;
+
+      this.curPlanSubmit = false;
+      this.$message.success("印刷任务撤销成功!");
+    },
     async toDelete(row) {
       const result = await this.$confirm(`确定要删除当前卷袋吗?`, "提示", {
         type: "warning"

+ 56 - 1
src/modules/print/components/ModifyPrintPlan.vue

@@ -45,11 +45,20 @@
       </div>
 
       <div class="part-box">
-        <h4 class="part-box-tips">试卷&题卡印品:</h4>
+        <h4 class="part-box-tips">
+          试卷&题卡印品:
+          <el-checkbox
+            v-model="allSelected"
+            label="全选"
+            :disabled="!editable"
+            @change="selectAll"
+          ></el-checkbox>
+        </h4>
         <el-form-item prop="printContent" label="试卷、题卡:">
           <el-checkbox-group
             v-model="modalForm.printContent"
             :disabled="!editable"
+            @change="() => checkSelectAll()"
           >
             <el-checkbox
               v-for="(val, key) in PRINT_CONTENT_TYPE"
@@ -376,6 +385,7 @@ export default {
       ordinaryContent: [],
       templateSources: {},
       oldPrintContent: [],
+      allSelected: false,
       rules: {
         name: [
           {
@@ -436,6 +446,48 @@ export default {
       });
       this.templateSources = templateSources;
     },
+    selectAll(selected) {
+      if (selected) {
+        this.modalForm.printContent = ["PAPER", "CARD"];
+        this.modalForm.variableContent.forEach(item => {
+          if (item.templateId && item.templateId.length) return;
+
+          const source = this.templateSources[item.type][0];
+          item.templateId = source && [source.id];
+          item.oldTemplateId = source && [source.id];
+        });
+        this.modalForm.ordinaryContent.forEach(item => {
+          if (item.templateId && item.templateId.length) return;
+
+          const source = this.templateSources[item.type][0];
+          item.templateId = source && [source.id];
+          item.oldTemplateId = source && [source.id];
+        });
+      } else {
+        this.modalForm.printContent = [];
+        this.modalForm.variableContent.forEach(item => {
+          item.templateId = [];
+          item.oldTemplateId = [];
+        });
+        this.modalForm.ordinaryContent.forEach(item => {
+          item.templateId = [];
+          item.oldTemplateId = [];
+        });
+      }
+    },
+    checkSelectAll() {
+      const vNotSelected = this.modalForm.variableContent.some(
+        item => !item.templateId.length
+      );
+      const oNotSelected = this.modalForm.ordinaryContent.some(
+        item => !item.templateId.length
+      );
+      const pNotSelected = this.modalForm.printContent.length < 2;
+
+      const selecteds = [vNotSelected, oNotSelected, pNotSelected];
+
+      this.allSelected = !selecteds.some(item => item);
+    },
     templateValidator(rule, value, callback) {
       const [field, index] = rule.field.split(".");
       const val = this.modalForm[field][index];
@@ -458,6 +510,7 @@ export default {
       info.templateId = newVals;
       info.oldTemplateId = newVals;
 
+      this.checkSelectAll();
       this.$refs.modalFormComp.validateField("selectedPrint");
     },
     printContentChange(val) {
@@ -487,7 +540,9 @@ export default {
         this.modalForm.printContent = val.printContent
           ? val.printContent.split(",")
           : [];
+        this.checkSelectAll();
       } else {
+        this.allSelected = false;
         let modalForm = deepCopy(initModalForm);
         modalForm.variableContent = modalForm.variableContent.filter(
           item => this.templateSources[item.type]