zhangjie 3 gadi atpakaļ
vecāks
revīzija
c9cd54b9b9

+ 5 - 8
card/views/CardDesign.vue

@@ -386,9 +386,10 @@ export default {
       } else {
         await this.getCardConfig();
         // 没有题卡内容时,直接创建新的内容
-        let mod = { aOrB: detData.paperType.split(",").length > 1 };
-        if (detData.makeMethod === "CUST") mod.cardTitle = detData.title;
-        this.setCardConfig(mod);
+        if (detData.makeMethod === "CUST") {
+          this.setCardConfig({ cardTitle: detData.title });
+        }
+
         this.initPageData();
       }
     },
@@ -418,11 +419,7 @@ export default {
           makeMethod: this.prepareTcPCard.makeMethod
         }
       };
-      // 暂时禁用A/B
-      // config.aOrB = this.prepareTcPCard["paperType"]
-      //   ? this.prepareTcPCard.paperType.split(",").length > 1
-      //   : false;
-      config.aOrB = false;
+      config.aOrB = this.prepareTcPCard.drawCount > 1;
       config.requiredFields = JSON.parse(config.requiredFields);
       config.extendFields = JSON.parse(config.extendFields);
       config.cardTitle = this.getCardTitle(config.titleRule);

+ 16 - 1
src/modules/base/components/ModifyCampus.vue

@@ -31,6 +31,13 @@
           disabled
         ></el-input>
       </el-form-item>
+      <el-form-item prop="printHouseId" label="印刷室">
+        <print-room-select
+          v-model.trim="modalForm.printHouseId"
+          style="width:100%;"
+          clearable
+        ></print-room-select>
+      </el-form-item>
     </el-form>
     <div slot="footer">
       <el-button type="primary" :disabled="isSubmit" @click="submit"
@@ -47,7 +54,8 @@ import { updateCampus, getCode } from "../api";
 const initModalForm = {
   id: null,
   campusName: "",
-  campusCode: ""
+  campusCode: "",
+  printHouseId: ""
 };
 
 export default {
@@ -93,6 +101,13 @@ export default {
             max: 30,
             trigger: "change"
           }
+        ],
+        printHouseId: [
+          {
+            required: true,
+            message: "请选择要关联的印刷室",
+            trigger: "change"
+          }
         ]
       }
     };

+ 0 - 19
src/modules/base/components/ModifyOrganization.vue

@@ -41,17 +41,6 @@
           ></el-option>
         </el-select>
       </el-form-item>
-      <el-form-item
-        v-if="modalForm.type === 'PRINTING_HOUSE'"
-        prop="campusId"
-        label="所属校区:"
-      >
-        <campus-select
-          v-model="modalForm.campusId"
-          style="width: 100%;"
-          clearable
-        ></campus-select>
-      </el-form-item>
       <!-- <el-form-item label="启用/禁用:">
           <el-switch
             v-model="modalForm.enable"
@@ -77,7 +66,6 @@ const initModalForm = {
   id: null,
   name: "",
   type: "",
-  campusId: "",
   parentId: null,
   parentName: "",
   enable: true
@@ -127,13 +115,6 @@ export default {
             message: "请选择机构类型",
             trigger: "change"
           }
-        ],
-        campusId: [
-          {
-            required: true,
-            message: "请选择校区",
-            trigger: "change"
-          }
         ]
       }
     };

+ 13 - 2
src/modules/base/components/ModifyStudent.vue

@@ -64,7 +64,6 @@
 
 <script>
 import { updateStudent } from "../api";
-import { phone } from "@/plugins/formRules";
 
 const initModalForm = {
   id: null,
@@ -123,7 +122,14 @@ export default {
             trigger: "change"
           }
         ],
-        phoneNumber: phone,
+        phoneNumber: [
+          {
+            required: false,
+            pattern: /^1\d{10}$/,
+            message: "请输入合适的手机号码",
+            trigger: "change"
+          }
+        ],
         campusId: [
           {
             required: true,
@@ -136,6 +142,11 @@ export default {
             required: true,
             message: "请输入班级信息",
             trigger: "change"
+          },
+          {
+            max: 50,
+            message: "班级信息不能超过50个字符",
+            trigger: "change"
           }
         ]
       }

+ 1 - 0
src/modules/base/components/ModifyUser.vue

@@ -65,6 +65,7 @@
           ref="SelectOrgs"
           v-model="modalForm.orgId"
           :multiple="false"
+          check-strictly
           @change="orgChange"
         ></select-orgs>
       </el-form-item>

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

@@ -88,8 +88,8 @@ export default {
       if (this.multiple) return;
 
       const checkedIds = this.$refs.MenuTree.getCheckedKeys();
-      console.log(checkedIds);
-      console.log(data.id);
+      // console.log(checkedIds);
+      // console.log(data.id);
       if (!checkedIds.includes(data.id)) {
         this.emitChange([]);
         return;

+ 1 - 0
src/modules/base/views/CampusManage.vue

@@ -16,6 +16,7 @@
       <el-table ref="TableList" :data="dataList">
         <el-table-column prop="campusName" label="校区名称"></el-table-column>
         <el-table-column prop="campusCode" label="校区编码"></el-table-column>
+        <el-table-column prop="printHouseName" label="教研室"></el-table-column>
         <el-table-column label="操作" width="120px">
           <template slot-scope="scope">
             <el-button

+ 0 - 7
src/modules/base/views/CourseManage.vue

@@ -25,13 +25,6 @@
             >
             </el-date-picker>
           </el-form-item>
-          <!-- <el-form-item label="所属教研室:">
-          <teaching-room-select
-            style="width: 142px;"
-            v-model.trim="filter.staffRoomId"
-            clearable
-          ></teaching-room-select>
-        </el-form-item> -->
         </template>
         <el-form-item>
           <el-button

+ 0 - 5
src/modules/base/views/StudentManage.vue

@@ -53,11 +53,6 @@
         <el-table-column prop="phoneNumber" label="手机号"></el-table-column>
         <el-table-column prop="campusName" label="校区"></el-table-column>
         <el-table-column prop="clazz" label="班级"></el-table-column>
-        <el-table-column prop="enable" label="状态">
-          <template slot-scope="scope">
-            {{ scope.row.enable | enableFilter }}
-          </template>
-        </el-table-column>
         <el-table-column label="操作" width="120px">
           <template slot-scope="scope">
             <el-button

+ 20 - 7
src/modules/exam/components/ApplyContent.vue

@@ -71,7 +71,11 @@
               查看题卡
             </el-button>
             <el-button
-              v-if="curTaskApply.makeMethod && IS_APPLY"
+              v-if="
+                curTaskApply.makeMethod &&
+                  curTaskApply.makeMethod !== 'CUST' &&
+                  IS_APPLY
+              "
               type="text"
               class="btn-danger"
               @click="changeCreateCardType"
@@ -128,7 +132,7 @@
 
       <h4 class="mb-2" v-if="IS_APPLY">上传入库审核表(最多4张)</h4>
       <h4 class="mb-2" v-else>入库审核表</h4>
-      <div class="image-list">
+      <div class="image-list mb-4">
         <div
           class="image-item"
           v-for="(img, index) in paperConfirmAttachments"
@@ -166,7 +170,10 @@
         label-width="90px"
       >
         <el-form-item prop="approvePass" label="审批操作:">
-          <el-radio-group v-model="auditModal.approvePass">
+          <el-radio-group
+            v-model="auditModal.approvePass"
+            @change="approvePassChange"
+          >
             <el-radio
               v-for="(val, key) in TASK_AUDIT_RESULT"
               :key="key"
@@ -191,7 +198,7 @@
           </el-select>
         </el-form-item>
         <el-form-item
-          v-if="auditModal.approvePass === 'REJECT'"
+          :key="auditModal.approvePass"
           prop="remark"
           label="审批意见:"
         >
@@ -358,7 +365,7 @@ export default {
         ],
         remark: [
           {
-            required: true,
+            required: false,
             validator: (rule, value, callback) => {
               if (this.auditModal.approvePass === "REJECT" && !value) {
                 callback(new Error(`请输入审批意见`));
@@ -497,6 +504,10 @@ export default {
       }
       this.$emit("step-change", this.flows);
     },
+    approvePassChange() {
+      this.auditRules.remark[0].required =
+        this.auditModal.approvePass === "REJECT";
+    },
     addAtachment() {
       if (this.paperAttachments.length >= this.attachmentLimitCount) return;
 
@@ -580,7 +591,8 @@ export default {
         courseName: this.task.courseName,
         makeMethod: this.task.makeMethod,
         cardRuleId: this.task.cardRuleId,
-        paperType: this.task.paperType
+        paperType: this.task.paperType,
+        drawCount: this.task.drawCount
       });
     },
     async toCreateOrViewCard() {
@@ -637,8 +649,9 @@ export default {
     },
     async clearMakeMethod() {
       // 清除后台记录的题卡
-      if (this.curTaskApply.cardId)
+      if (this.curTaskApply.cardId && this.curTaskApply.makeMethod !== "CUST") {
         await switchCardCreateMethod(this.examTask.id);
+      }
 
       this.curTaskApply.makeMethod = "";
       this.curTaskApply.cardId = "";

+ 5 - 0
src/modules/exam/components/CardOptionDialog.vue

@@ -155,6 +155,11 @@ export default {
             required: true,
             message: "请输入文件标题",
             trigger: "change"
+          },
+          {
+            message: "文件标题不能超过100个字",
+            max: 100,
+            trigger: "change"
           }
         ],
         custAttachmentId: [

+ 15 - 7
src/modules/exam/components/CreatePrintTask.vue

@@ -37,13 +37,6 @@
           clearable
         ></el-input>
       </el-form-item>
-      <el-form-item label="监考老师:">
-        <el-input
-          v-model="modalForm.invigilatorTeacher"
-          placeholder="请填写监考老师"
-          clearable
-        ></el-input>
-      </el-form-item>
       <el-form-item prop="classId" label="考试对象:">
         <el-select
           v-model="classIds"
@@ -164,6 +157,11 @@ export default {
             required: true,
             message: "请输入考场名称",
             trigger: "change"
+          },
+          {
+            max: 100,
+            message: "考场名称不能超过100个字符",
+            trigger: "change"
           }
         ],
         examPlace: [
@@ -171,6 +169,11 @@ export default {
             required: true,
             message: "请输入考点名称",
             trigger: "change"
+          },
+          {
+            max: 100,
+            message: "考点名称不能超过100个字符",
+            trigger: "change"
           }
         ],
         invigilatorTeacher: [
@@ -215,6 +218,11 @@ export default {
           required: true,
           message: `请输入${field.name}`,
           trigger: "change"
+        },
+        {
+          max: 100,
+          message: `${field.name}不能超过100个字符`,
+          trigger: "change"
         }
       ];
     });

+ 3 - 0
src/modules/exam/components/CreateTaskApply.vue

@@ -55,6 +55,7 @@
               <el-input
                 v-model.trim="examTask.paperNumber"
                 placeholder="请输入试卷编号"
+                :maxlength="50"
                 clearable
               ></el-input>
             </el-form-item>
@@ -66,6 +67,7 @@
               <el-input
                 v-model.trim="examTask.teacherName"
                 placeholder="请输入拟卷教师"
+                :maxlength="50"
                 clearable
               ></el-input>
             </el-form-item>
@@ -75,6 +77,7 @@
               <el-input
                 v-model.trim="examTask.lecturerName"
                 placeholder="请输入主讲教师"
+                :maxlength="50"
                 clearable
               ></el-input>
             </el-form-item>

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

@@ -50,7 +50,7 @@
           </el-col>
           <el-col :span="14">
             <el-form-item label="命题老师:">
-              <span>{{ modalForm.userName }}</span>
+              <span>{{ modalForm.propositionName || modalForm.userName }}</span>
             </el-form-item>
           </el-col>
         </el-row>
@@ -153,6 +153,7 @@ const initModalForm = {
   setup: 0,
   userId: "",
   userName: "",
+  propositionName: "",
   auditStatus: "",
   reviewStatus: "",
   source: "",

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

@@ -123,7 +123,7 @@
         <el-table-column class-name="action-column" label="操作" width="160px">
           <template slot-scope="scope">
             <el-button
-              v-if="scope.row.setup === 0 && checkPrivilege('link', 'preview')"
+              v-if="checkPrivilege('link', 'preview')"
               class="btn-primary"
               type="text"
               @click="toPreview(scope.row)"

+ 2 - 2
src/modules/exam/views/WaitTask.vue

@@ -98,8 +98,8 @@ export default {
   beforeRouteLeave(to, from, next) {
     if (to.name === "CardDesign") {
       this.$ls.set("cachePageInfo", {
-        page: this.$refs.WaitTaskExamTask.current,
-        curRowId: this.$refs.WaitTaskExamTask.curTask.id
+        page: this.current,
+        curRowId: this.curTask.id
       });
     } else {
       this.$ls.remove("cachePageInfo");

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

@@ -96,3 +96,6 @@ export const downloadPrintTaskPdf = ids => {
 export const printTaskTemplateView = printPlanId => {
   return $post("/api/admin/exam/print/template_view", { printPlanId });
 };
+export const printTaskNormal = ({ id, normal }) => {
+  return $post("/api/admin/exam/print/task_normal", { id, normal });
+};

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

@@ -98,7 +98,7 @@
           }}</span>
         </el-table-column>
         <el-table-column prop="createName" label="创建人"></el-table-column>
-        <el-table-column class-name="action-column" label="操作" width="120">
+        <el-table-column class-name="action-column" label="操作" width="140">
           <template slot-scope="scope">
             <el-button
               v-if="checkPrivilege('link', 'preview')"

+ 36 - 7
src/modules/print/views/PrintTaskManage.vue

@@ -220,6 +220,11 @@
             scope.row.printEndTime | timestampFilter
           }}</span>
         </el-table-column>
+        <el-table-column prop="normal" label="任务状态">
+          <span slot-scope="scope">{{
+            scope.row.normal ? "正常" : "作废"
+          }}</span>
+        </el-table-column>
         <el-table-column
           class-name="action-column"
           label="操作"
@@ -248,10 +253,8 @@
               v-if="scope.row.status === 'PRINTING'"
               class="btn-primary"
               type="text"
-              icon="icon icon-circle-share"
               @click="toResubmit(scope.row)"
-              title="重新提交"
-            ></el-button> -->
+            >重新提交</el-button> -->
             <el-button
               v-if="
                 scope.row.status === 'WAITING' && checkPrivilege('link', 'end')
@@ -261,13 +264,18 @@
               @click="toCancel(scope.row)"
               >撤回提交</el-button
             >
+            <el-button
+              v-if="checkPrivilege('link', 'end')"
+              :class="scope.row.normal ? 'btn-danger' : 'btn-primary'"
+              type="text"
+              @click="toNormal(scope.row)"
+              >{{ scope.row.normal ? "作废" : "恢复" }}</el-button
+            >
             <!-- <el-button
               class="btn-primary"
               type="text"
-              icon="icon icon-circle-right"
               @click="toPreview(scope.row)"
-              title="查看印品模板"
-            ></el-button> -->
+            >查看印品模板</el-button> -->
           </template>
         </el-table-column>
       </el-table>
@@ -300,7 +308,8 @@ import {
   cancelPrintTask,
   printTaskTotalInfo,
   getPrintTaskPdf,
-  downloadPrintTaskPdf
+  downloadPrintTaskPdf,
+  printTaskNormal
 } from "../api";
 import { PRINT_TASK_STATUS } from "@/constants/enumerate";
 import pickerOptions from "@/constants/datePickerOptions";
@@ -476,6 +485,26 @@ export default {
       if (!data) return;
 
       this.$message.success("文件下载任务提交成功!");
+    },
+    async toNormal(row) {
+      const typeName = row.normal ? "作废" : "恢复";
+      const action = await this.$confirm(
+        `确定${typeName}该印刷任务吗?`,
+        "提示",
+        {
+          type: "warning"
+        }
+      ).catch(() => {});
+      if (action !== "confirm") return;
+
+      const data = await printTaskNormal({
+        id: row.examDetailId,
+        normal: !row.normal
+      });
+      if (!data) return;
+
+      row.normal = !row.normal;
+      this.$message.success("撤回成功!");
     }
   }
 };