Jelajahi Sumber

印品相关

zhangjie 2 tahun lalu
induk
melakukan
91f7ecbfda

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

@@ -1227,3 +1227,20 @@
     }
   }
 }
+
+// .modify-exam-config-detail
+.modify-exam-config-detail {
+  .config-title {
+    margin-bottom: 15px;
+
+    > h4 {
+      display: inline-block;
+      vertical-align: middle;
+      width: 140px;
+      font-size: 16px;
+      line-height: 25px;
+      color: $--color-text-dark-1;
+      text-align: right;
+    }
+  }
+}

+ 29 - 10
src/modules/base/components/ModifyExamConfigDetail.vue

@@ -13,10 +13,24 @@
   >
     <el-form
       ref="modalFormComp"
-      label-width="130px"
+      label-width="140px"
       :rules="rules"
       :model="modalForm"
     >
+      <el-form-item label="是否启用入库审核:" required>
+        <el-switch v-model="modalForm.review" inactive-color="#dcdfe6">
+        </el-switch>
+      </el-form-item>
+      <el-form-item label="提交印刷方式:" required>
+        <el-radio-group v-model="modalForm.printMethod">
+          <el-radio
+            v-for="(val, key) in CONFIRM_PRINT_TYPE"
+            :key="key"
+            :label="key"
+            >{{ val }}</el-radio
+          >
+        </el-radio-group>
+      </el-form-item>
       <el-form-item prop="cardRuleId" label="题卡规则:">
         <card-rule-select
           ref="CardRuleSelect"
@@ -36,15 +50,17 @@
       </el-form-item>
 
       <div class="part-box">
-        <h4 class="part-box-tips">
-          试卷&题卡印品:
+        <div class="config-title">
+          <h4>
+            试卷&题卡印品:
+          </h4>
           <el-checkbox
             v-show="infoShow"
             v-model="allSelected"
             label="全选"
             @change="selectAll"
           ></el-checkbox>
-        </h4>
+        </div>
         <el-form-item prop="printContent" label="试卷、题卡:">
           <el-checkbox-group
             v-model="modalForm.printContent"
@@ -116,7 +132,9 @@
       </div>
 
       <div class="part-box" v-show="infoShow">
-        <h4 class="part-box-tips">变量印品:</h4>
+        <div class="config-title">
+          <h4>其他印品:</h4>
+        </div>
         <el-form-item
           v-for="(item, index) in modalForm.variableContent"
           :key="item.type"
@@ -168,10 +186,7 @@
             <span>份</span>
           </div>
         </el-form-item>
-      </div>
-
-      <div class="part-box" v-show="infoShow">
-        <h4 class="part-box-tips">普通印品:</h4>
+        <!-- <h4 class="part-box-tips">普通印品:</h4> -->
         <el-form-item
           v-for="(item, index) in modalForm.ordinaryContent"
           :key="item.type"
@@ -264,7 +279,8 @@ import {
   DRAW_RULE_TYPE,
   PRINT_BACKUP_TYPE,
   PAPER_BACKUP_TYPE,
-  TEMPLATE_CLASSIFY
+  TEMPLATE_CLASSIFY,
+  CONFIRM_PRINT_TYPE
 } from "@/constants/enumerate";
 import { deepCopy } from "@/plugins/utils";
 import { updateExamConfig, listOrgsByExamId, organizationList } from "../api";
@@ -273,6 +289,8 @@ import { printPlanTemplateList } from "../../print/api";
 const initModalForm = {
   id: null,
   examId: null,
+  review: true,
+  printMethod: "AUTO",
   cardRuleId: "",
   orgIds: [],
   printContent: [],
@@ -370,6 +388,7 @@ export default {
       DRAW_RULE_TYPE,
       PRINT_BACKUP_TYPE,
       PAPER_BACKUP_TYPE,
+      CONFIRM_PRINT_TYPE,
       TEMPLATE_CLASSIFY,
       variableContent: [],
       ordinaryContent: [],

+ 33 - 32
src/modules/base/components/ModifyPrintTemplate.vue

@@ -54,7 +54,6 @@
           v-for="field in signDatas.basic"
           :key="field.code"
           v-model="field.enable"
-          :disabled="field.disabled"
           >{{ field.name }}</el-checkbox
         >
         <el-divider></el-divider>
@@ -62,7 +61,6 @@
           v-for="field in signDatas.table"
           :key="field.code"
           v-model="field.enable"
-          :disabled="field.disabled"
           >{{ field.name }}</el-checkbox
         >
       </el-form-item>
@@ -71,26 +69,10 @@
         label="显示字段:"
         prop="fields"
       >
-        <!-- <el-checkbox
-          v-for="field in packageDatas"
-          :key="field.code"
-          v-model="field.enable"
-          :disabled="field.disabled"
-          >{{ field.name }}</el-checkbox
-        > -->
         <el-checkbox
-          v-for="field in packageDatas.title"
-          :key="field.code"
-          v-model="field.enable"
-          :disabled="field.disabled"
-          >{{ field.name }}</el-checkbox
-        >
-        <el-divider></el-divider>
-        <el-checkbox
-          v-for="field in packageDatas.basic"
+          v-for="field in packageDatas"
           :key="field.code"
           v-model="field.enable"
-          :disabled="field.disabled"
           >{{ field.name }}</el-checkbox
         >
       </el-form-item>
@@ -120,10 +102,9 @@
 </template>
 
 <script>
-import { templateDetail, updateTemplate } from "../api";
+import { templateDetail, updateTemplate, examRuleDetail } from "../api";
 import { attachmentDetail } from "../../login/api";
 import UploadFileView from "@/components/UploadFileView";
-import { PACKAGE_DATA, SIGN_DATA } from "@/constants/printTemplateData";
 
 const initModalForm = {
   id: null,
@@ -173,6 +154,8 @@ export default {
     return {
       modalIsShow: false,
       isSubmit: false,
+      PACKAGE_DATA: [],
+      SIGN_DATA: {},
       modalForm: {},
       attachment: {},
       format: ["ftl", "html", "pdf"],
@@ -212,8 +195,8 @@ export default {
           }
         ]
       },
-      packageDatas: { ...PACKAGE_DATA },
-      signDatas: { ...SIGN_DATA },
+      packageDatas: [],
+      signDatas: { basic: [], table: [] },
       // upload
       uploadUrl: "/api/admin/common/file/upload",
       uploadData: {
@@ -221,7 +204,19 @@ export default {
       }
     };
   },
+  created() {
+    this.getScopeField();
+  },
   methods: {
+    async getScopeField() {
+      const examRule = await examRuleDetail();
+      this.PACKAGE_DATA = examRule.packageScope
+        ? JSON.parse(examRule.packageScope)
+        : [];
+      this.SIGN_DATA = examRule.signScope
+        ? JSON.parse(examRule.signScope)
+        : { basic: [], table: [] };
+    },
     async initData(val) {
       if (val.id) {
         const data = await templateDetail(val.id);
@@ -229,26 +224,32 @@ export default {
 
         const unAttachmentTemps = ["SIGN", "PACKAGE"];
         if (unAttachmentTemps.includes(this.modalForm.classify)) {
-          this.initFieldData(data);
+          this.initEditFieldData(data);
         } else {
           this.getAttachment();
         }
       } else {
         this.modalForm = this.$objAssign(initModalForm, val);
-        this.packageDatas = { ...PACKAGE_DATA };
-        this.signDatas = { ...SIGN_DATA };
-        // this.$nextTick(() => {
-        //   this.$refs.UploadFileView.setAttachmentName("");
-        // });
+        this.getDefaultFieldData();
       }
     },
-    initFieldData(data) {
+    getDefaultFieldData() {
+      this.packageDatas = this.PACKAGE_DATA.map(item => {
+        return { ...item, enable: false };
+      });
+      this.signDatas.basic = this.SIGN_DATA.basic.map(item => {
+        return { ...item, enable: false };
+      });
+      this.signDatas.table = this.SIGN_DATA.table.map(item => {
+        return { ...item, enable: false };
+      });
+    },
+    initEditFieldData(data) {
       const displayRange = data.displayRange
         ? JSON.parse(data.displayRange)
         : null;
       if (!displayRange) {
-        this.packageDatas = { ...PACKAGE_DATA };
-        this.signDatas = { ...SIGN_DATA };
+        this.getDefaultFieldData();
         return;
       }
 

+ 25 - 537
src/modules/print/components/ModifyPrintPlan.vue

@@ -3,7 +3,7 @@
     class="modify-print-plan"
     :visible.sync="modalIsShow"
     :title="title"
-    top="10px"
+    top="10vh"
     width="600px"
     :close-on-click-modal="false"
     :close-on-press-escape="false"
@@ -12,257 +12,29 @@
   >
     <el-form
       ref="modalFormComp"
-      label-width="120px"
       :rules="rules"
       :model="modalForm"
-      label-position="left"
+      label-width="120px"
     >
-      <div class="part-box">
-        <h4 class="part-box-tips">基本信息:</h4>
-        <el-form-item prop="name" label="印刷计划名称:">
-          <el-input
-            v-model.trim="modalForm.name"
-            clearable
-            placeholder="请输入"
-            :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"
-            class="width-full"
-            :disabled="!editable"
-          ></semester-select>
-        </el-form-item>
-        <el-form-item prop="examId" label="考试:">
-          <exam-select
-            v-model="modalForm.examId"
-            :semester-id="modalForm.semesterId"
-            class="width-full"
-          ></exam-select>
-        </el-form-item>
-      </div>
-
-      <div class="part-box">
-        <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"
-              :key="key"
-              :label="key"
-              >{{ val }}</el-checkbox
-            >
-          </el-checkbox-group>
-        </el-form-item>
-        <el-form-item
-          v-if="modalForm.printContent.length"
-          prop="backupMethod"
-          label="备用数量:"
-        >
-          <el-select
-            v-model="modalForm.backupMethod"
-            class="mr-2"
-            size="small"
-            placeholder="请选择"
-            :disabled="!editable"
-          >
-            <el-option
-              v-for="(val, key) in PAPER_BACKUP_TYPE"
-              :key="key"
-              :value="key"
-              :label="val"
-            ></el-option>
-          </el-select>
-          <el-input-number
-            class="mr-1"
-            v-model="modalForm.backupCount"
-            size="small"
-            :min="1"
-            :max="200"
-            :step="1"
-            step-strictly
-            :controls="false"
-            :disabled="!editable"
-            style="width: 60px"
-          ></el-input-number>
-          <span>份</span>
-        </el-form-item>
-        <el-form-item
-          v-if="contentIncludesPaper"
-          prop="drawRule"
-          label="抽卷规则:"
-        >
-          <el-radio-group v-model="modalForm.drawRule" :disabled="!editable">
-            <el-radio
-              v-for="(val, key) in DRAW_RULE_TYPE"
-              :label="key"
-              :key="key"
-              >{{ val }}</el-radio
-            >
-          </el-radio-group>
-          <p class="tips-info">
-            1.只抽取一次:不同印刷计划下,同一试卷编号下的卷型只能被抽取一次;
-          </p>
-          <p class="tips-info">
-            2.可反复抽取:不同印刷计划下,同一试卷编号下的卷型可重复抽取,系统默认优先抽取未曝光卷型。
-          </p>
-        </el-form-item>
-      </div>
-
-      <div class="part-box">
-        <h4 class="part-box-tips">变量印品:</h4>
-        <el-form-item
-          v-for="(item, index) in modalForm.variableContent"
-          :key="item.type"
-          :label="`${TEMPLATE_CLASSIFY[item.type]}:`"
-          :prop="`variableContent.${index}.templateId`"
-          :rules="{
-            required: false,
-            validator: templateValidator,
-            trigger: 'change'
-          }"
-          :required="!!item.templateId.length"
-        >
-          <el-checkbox-group
-            v-model="item.templateId"
-            :disabled="!editable"
-            @change="vals => tempChange(vals, `variableContent.${index}`)"
-          >
-            <el-checkbox
-              v-for="temp in templateSources[item.type]"
-              :label="temp.id"
-              :key="temp.id"
-              >{{ temp.name }}</el-checkbox
-            >
-          </el-checkbox-group>
-          <div v-if="item.templateId.length">
-            <el-select
-              v-model="item.backupMethod"
-              class="mr-2"
-              size="small"
-              placeholder="请选择"
-              :disabled="!editable"
-            >
-              <el-option
-                v-for="(val, key) in PRINT_BACKUP_TYPE"
-                :key="key"
-                :value="key"
-                :label="val"
-              ></el-option>
-            </el-select>
-            <el-input-number
-              v-model="item.backupCount"
-              class="mr-1"
-              size="small"
-              :min="1"
-              :max="200"
-              :step="1"
-              step-strictly
-              :controls="false"
-              :disabled="!editable"
-              style="width: 60px"
-            ></el-input-number>
-            <span>份</span>
-          </div>
-        </el-form-item>
-      </div>
-
-      <div class="part-box">
-        <h4 class="part-box-tips">普通印品:</h4>
-        <el-form-item
-          v-for="(item, index) in modalForm.ordinaryContent"
-          :key="item.type"
-          :label="`${TEMPLATE_CLASSIFY[item.type]}:`"
-          label-width="130px"
-          :prop="`ordinaryContent.${index}.templateId`"
-          :rules="{
-            required: false,
-            validator: templateValidator,
-            trigger: 'change'
-          }"
-          :required="!!item.templateId.length"
+      <el-form-item prop="name" label="印刷计划名称:">
+        <el-input
+          v-model.trim="modalForm.name"
+          clearable
+          placeholder="请输入名称"
+        ></el-input>
+      </el-form-item>
+      <el-form-item prop="planEndTime" label="考试时间:">
+        <el-date-picker
+          v-model="modalForm.planEndTime"
+          type="datetime"
+          value-format="timestamp"
         >
-          <el-checkbox-group
-            v-model="item.templateId"
-            :disabled="!editable"
-            @change="vals => tempChange(vals, `ordinaryContent.${index}`)"
-          >
-            <el-checkbox
-              v-for="temp in templateSources[item.type]"
-              :label="temp.id"
-              :key="temp.id"
-              >{{ temp.name }}</el-checkbox
-            >
-          </el-checkbox-group>
-          <div v-if="item.templateId.length">
-            <el-select
-              v-model="item.backupMethod"
-              class="mr-2"
-              size="small"
-              placeholder="请选择"
-              :disabled="!editable"
-            >
-              <el-option
-                v-for="(val, key) in PRINT_BACKUP_TYPE"
-                :key="key"
-                :value="key"
-                :label="val"
-              ></el-option>
-            </el-select>
-            <el-input-number
-              v-model="item.backupCount"
-              class="mr-1"
-              size="small"
-              :min="1"
-              :max="200"
-              :step="1"
-              step-strictly
-              :controls="false"
-              :disabled="!editable"
-              style="width: 60px"
-            ></el-input-number>
-            <span>份</span>
-          </div>
-        </el-form-item>
-      </div>
-
-      <el-form-item prop="selectedPrint"></el-form-item>
+        </el-date-picker>
+      </el-form-item>
     </el-form>
 
     <div slot="footer">
-      <el-button
-        v-if="editable"
-        type="primary"
-        :disabled="isSubmit"
-        @click="submit"
+      <el-button type="primary" :disabled="isSubmit" @click="submit"
         >确认</el-button
       >
       <el-button @click="cancel">取消</el-button>
@@ -271,52 +43,12 @@
 </template>
 
 <script>
-import {
-  PRINT_CONTENT_TYPE,
-  DRAW_RULE_TYPE,
-  PRINT_BACKUP_TYPE,
-  PAPER_BACKUP_TYPE,
-  TEMPLATE_CLASSIFY
-} from "@/constants/enumerate";
-import { deepCopy } from "@/plugins/utils";
-import { updatePrintPlan, printPlanTemplateList } from "../api";
+import { updatePrintPlan } from "../api";
 
 const initModalForm = {
   id: null,
   name: "",
-  examStartTime: "",
-  examEndTime: "",
-  semesterId: "",
-  examId: "",
-  printContent: [],
-  backupMethod: "ROOM",
-  backupCount: 1,
-  drawRule: "ONE",
-  variableContent: [
-    {
-      type: "SIGN",
-      templateId: [],
-      oldTemplateId: [],
-      backupMethod: "ROOM",
-      backupCount: 1
-    },
-    {
-      type: "PACKAGE",
-      templateId: [],
-      oldTemplateId: [],
-      backupMethod: "ROOM",
-      backupCount: 1
-    }
-  ],
-  ordinaryContent: [
-    {
-      type: "CHECK_IN",
-      templateId: [],
-      oldTemplateId: [],
-      backupMethod: "ROOM",
-      backupCount: 1
-    }
-  ]
+  planEndTime: ""
 };
 
 export default {
@@ -327,11 +59,6 @@ export default {
       default() {
         return {};
       }
-    },
-    editType: {
-      type: String,
-      default: "ADD",
-      validator: val => ["ADD", "PREVIEW", "EDIT"].includes(val)
     }
   },
   computed: {
@@ -339,69 +66,14 @@ export default {
       return !!this.instance.id;
     },
     title() {
-      const names = {
-        ADD: "新增印刷计划",
-        PREVIEW: "印刷计划详情",
-        EDIT: "编辑印刷计划"
-      };
-      return names[this.editType];
-    },
-    editable() {
-      return this.editType !== "PREVIEW";
-    },
-    contentIncludesPaper() {
-      return this.modalForm.printContent.includes("PAPER");
+      return (this.isEdit ? "编辑" : "新增") + "印刷计划";
     }
   },
   data() {
-    // const printContentValidator = (rule, value, callback) => {
-    //   if (value.includes("PAPER") && !value.includes("CARD")) {
-    //     callback(new Error("选择了试卷,同时必须选择题卡"));
-    //   } else {
-    //     callback();
-    //   }
-    // };
-    const backupMethodValidator = (rule, value, callback) => {
-      if (!this.modalForm.printContent.length) {
-        return callback();
-      }
-      if (!value) {
-        return callback(new Error("请选择备份方式"));
-      }
-      if (!this.modalForm.backupCount) {
-        return callback(new Error("请输入备份数量"));
-      }
-
-      callback();
-    };
-    const selectedPrintValidator = (rule, value, callback) => {
-      const printInfo = [
-        ...this.modalForm.variableContent,
-        ...this.modalForm.ordinaryContent
-      ];
-      const hasPrintInfo = printInfo.some(item => item.templateId.length);
-
-      if (hasPrintInfo || this.modalForm.printContent.length) {
-        callback();
-      } else {
-        callback(new Error("必须选择一项印品"));
-      }
-    };
     return {
       modalIsShow: false,
       isSubmit: false,
-      modalForm: deepCopy(initModalForm),
-      createTime: [],
-      PRINT_CONTENT_TYPE,
-      DRAW_RULE_TYPE,
-      PRINT_BACKUP_TYPE,
-      PAPER_BACKUP_TYPE,
-      TEMPLATE_CLASSIFY,
-      variableContent: [],
-      ordinaryContent: [],
-      templateSources: {},
-      oldPrintContent: [],
-      allSelected: false,
+      modalForm: { ...initModalForm },
       rules: {
         name: [
           {
@@ -411,177 +83,22 @@ export default {
             trigger: "change"
           }
         ],
-        examStartTime: [
-          {
-            required: true,
-            message: "请设置考试时间",
-            trigger: "change"
-          }
-        ],
-        semesterId: [
-          {
-            required: true,
-            message: "请选择使用学期",
-            trigger: "change"
-          }
-        ],
-        examId: [
-          {
-            required: true,
-            message: "请选择使用考试",
-            trigger: "change"
-          }
-        ],
-        printContent: [
-          {
-            required: false,
-            // validator: printContentValidator,
-            trigger: "change"
-          }
-        ],
-        backupMethod: [
+        planEndTime: [
           {
             required: true,
-            validator: backupMethodValidator,
-            trigger: "change"
-          }
-        ],
-        drawRule: [
-          {
-            required: true,
-            message: "请选择抽卷规则",
-            trigger: "change"
-          }
-        ],
-        selectedPrint: [
-          {
-            required: false,
-            validator: selectedPrintValidator,
+            message: "请设置印刷计划结束时间",
             trigger: "change"
           }
         ]
       }
     };
   },
-  mounted() {
-    this.getTemplates();
-  },
   methods: {
-    async getTemplates() {
-      const data = await printPlanTemplateList();
-      const templateSources = {};
-      const templates = [...data.variable, ...data.ordinary];
-      templates.forEach(item => {
-        templateSources[item.type] = item.template;
-      });
-      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];
-      if (val.templateId.length) {
-        if (!val.backupMethod) {
-          return callback(new Error("请选择备份方式"));
-        }
-        if (!val.backupCount) {
-          return callback(new Error("请输入备份数量"));
-        }
-        callback();
-      } else {
-        callback();
-      }
-    },
-    tempChange(vals, name) {
-      const [field, index] = name.split(".");
-      const info = this.modalForm[field][index];
-      const newVals = vals.filter(item => !info.oldTemplateId.includes(item));
-      info.templateId = newVals;
-      info.oldTemplateId = newVals;
-
-      this.checkSelectAll();
-      this.$refs.modalFormComp.validateField("selectedPrint");
-    },
-    printContentChange(val) {
-      const isSelectPaper =
-        !this.oldPrintContent.includes("PAPER") && val.includes("PAPER");
-      if (isSelectPaper && !val.includes("CARD")) {
-        val.push("CARD");
-      }
-      this.oldPrintContent = val;
-    },
     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] : [];
-          return {
-            type: item.type,
-            templateId: templateIds,
-            oldTemplateId: templateIds,
-            backupMethod: item.backupMethod,
-            backupCount: item.backupCount
-          };
-        };
-        this.modalForm.variableContent = val.variableContent.map(transformInfo);
-        this.modalForm.ordinaryContent = val.ordinaryContent.map(transformInfo);
-        this.modalForm.printContent = val.printContent
-          ? val.printContent.split(",")
-          : [];
-        this.checkSelectAll();
+        this.modalForm = this.$objAssign(initModalForm, val);
       } else {
-        this.allSelected = false;
-        let modalForm = deepCopy(initModalForm);
-        modalForm.variableContent = modalForm.variableContent.filter(
-          item => this.templateSources[item.type]
-        );
-        modalForm.ordinaryContent = modalForm.ordinaryContent.filter(
-          item => this.templateSources[item.type]
-        );
-        this.modalForm = modalForm;
-        this.createTime = [];
+        this.modalForm = { ...initModalForm };
       }
     },
     visibleChange() {
@@ -597,15 +114,6 @@ export default {
     open() {
       this.modalIsShow = true;
     },
-    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;
@@ -613,26 +121,6 @@ export default {
       if (this.isSubmit) return;
       this.isSubmit = true;
       const datas = { ...this.modalForm };
-      const transformInfo = item => {
-        const templateId = item.templateId.join();
-        const template = this.templateSources[item.type].find(
-          temp => temp.id === templateId
-        );
-        return {
-          type: item.type,
-          templateId,
-          attachmentId: template && template.attachmentId,
-          backupMethod: item.backupMethod,
-          backupCount: item.backupCount
-        };
-      };
-      datas.variableContent = JSON.stringify(
-        this.modalForm.variableContent.map(transformInfo)
-      );
-      datas.ordinaryContent = JSON.stringify(
-        this.modalForm.ordinaryContent.map(transformInfo)
-      );
-
       const data = await updatePrintPlan(datas).catch(() => {});
       this.isSubmit = false;
       if (!data) return;

+ 14 - 48
src/modules/print/views/PrintPlanManage.vue

@@ -3,19 +3,6 @@
     <div class="part-box part-box-filter part-box-flex">
       <el-form ref="FilterForm" label-position="left" label-width="85px" inline>
         <template v-if="checkPrivilege('condition', 'condition')">
-          <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="印刷计划:">
             <print-plan-select
               v-model.trim="filter.printPlanIdList"
@@ -83,29 +70,28 @@
           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="name"
           label="印刷计划"
           min-width="200"
         ></el-table-column>
-        <el-table-column prop="examStartTime" label="考试开始时间" width="170">
+        <el-table-column
+          prop="planEndTime"
+          label="印刷计划结束时间"
+          width="170"
+        >
           <span slot-scope="scope">{{
-            scope.row.examStartTime | timestampFilter
+            scope.row.planEndTime | timestampFilter
           }}</span>
         </el-table-column>
-        <el-table-column prop="examEndTime" label="考试结束时间" width="170">
+        <el-table-column
+          prop="createName"
+          label="创建人"
+          min-width="100"
+        ></el-table-column>
+        <el-table-column prop="createTime" label="创建时间" width="170">
           <span slot-scope="scope">{{
-            scope.row.examEndTime | timestampFilter
+            scope.row.createTime | timestampFilter
           }}</span>
         </el-table-column>
         <el-table-column prop="status" label="计划状态" width="100">
@@ -113,22 +99,6 @@
             {{ scope.row.status | printPlanStatusFilter }}
           </span>
         </el-table-column>
-        <el-table-column prop="totalGates" label="总门次" width="80">
-        </el-table-column>
-        <el-table-column prop="totalSubjects" label="总科次" width="80">
-        </el-table-column>
-        <el-table-column prop="totalPackages" label="总卷袋数" width="100">
-        </el-table-column>
-        <el-table-column prop="createTime" label="创建时间" width="170">
-          <span slot-scope="scope">{{
-            scope.row.createTime | timestampFilter
-          }}</span>
-        </el-table-column>
-        <el-table-column
-          prop="createName"
-          label="创建人"
-          min-width="100"
-        ></el-table-column>
         <el-table-column
           class-name="action-column"
           label="操作"
@@ -183,11 +153,7 @@
 
     <!-- ModifyPrintPlan -->
     <modify-print-plan
-      v-if="
-        checkPrivilege('link', 'preview') ||
-          checkPrivilege('link', 'edit') ||
-          checkPrivilege('button', 'add')
-      "
+      v-if="checkPrivilege('link', 'edit') || checkPrivilege('button', 'add')"
       ref="ModifyPrintPlan"
       :instance="curPrintPlan"
       :edit-type="editType"