Selaa lähdekoodia

新增考生复制功能

WANG 5 vuotta sitten
vanhempi
commit
551bfef251
1 muutettua tiedostoa jossa 9 lisäystä ja 5 poistoa
  1. 9 5
      src/modules/examwork/view/examInfo.vue

+ 9 - 5
src/modules/examwork/view/examInfo.vue

@@ -231,13 +231,14 @@
           :title="examCopyTitle"
           :title="examCopyTitle"
           width="500px"
           width="500px"
           :visible.sync="copyExamDialog"
           :visible.sync="copyExamDialog"
+          @close="doBeforedialogClose"
         >
         >
           <el-form
           <el-form
+            :inline="true"
+            inline-message
             :model="examCopyForm"
             :model="examCopyForm"
             :rules="examCopyFormRules"
             :rules="examCopyFormRules"
             ref="examCopyForm"
             ref="examCopyForm"
-            class="editForm"
-            :inline="true"
             label-width="120px"
             label-width="120px"
           >
           >
             <el-row>
             <el-row>
@@ -282,7 +283,7 @@ let _this = null;
 
 
 let validateDestExamName = (rule, value, callback) => {
 let validateDestExamName = (rule, value, callback) => {
   let name = _this.examCopyForm.destExamName;
   let name = _this.examCopyForm.destExamName;
-  if (name == "") {
+  if (null == name || name.trim() == "") {
     callback(new Error("请输入考试名称"));
     callback(new Error("请输入考试名称"));
   } else {
   } else {
     callback();
     callback();
@@ -322,8 +323,8 @@ export default {
       examCopyTitle: null,
       examCopyTitle: null,
       examCopyForm: {
       examCopyForm: {
         srcExamId: null,
         srcExamId: null,
-        destExamCode: null,
-        destExamName: null,
+        destExamCode: "",
+        destExamName: "",
         copyOrgSettings: false
         copyOrgSettings: false
       },
       },
       examCopyFormRules: {
       examCopyFormRules: {
@@ -356,6 +357,9 @@ export default {
       this.examCopyForm.destExamName = null;
       this.examCopyForm.destExamName = null;
       this.copyExamDialog = true;
       this.copyExamDialog = true;
     },
     },
+    doBeforedialogClose() {
+      this.$refs.examCopyForm.clearValidate();
+    },
     copyExam() {
     copyExam() {
       this.examCopyForm.destExamCode = this.examCopyForm.destExamName;
       this.examCopyForm.destExamCode = this.examCopyForm.destExamName;
       var url = EXAM_WORK_API + "/exam/copyExam";
       var url = EXAM_WORK_API + "/exam/copyExam";