Ver código fonte

fiex:修改BUG

Tang 3 anos atrás
pai
commit
340b41b2e8

+ 26 - 25
src/views/Marketing/goods/commodityManageMent/add/index.vue

@@ -513,13 +513,10 @@
             style="margin-top: 12px"
             prop="studyCount"
           >
-            <el-input-number
+            <el-input
+              class="numInputs"
               v-model="listData.studyCount"
-              :controls="false"
-              controls-position="right"
-              :min="1"
-              :precision="0"
-            ></el-input-number>
+            ></el-input>
           </el-form-item>
           <el-form-item
             label="学习有效期"
@@ -566,13 +563,10 @@
                 </div>
               </el-form-item>
               <el-form-item label="补考次数" prop="studyCount">
-                <el-input-number
-                  :precision="0"
+                <el-input
                   class="numInputs"
                   v-model="listData.studyCount"
-                  :min="1"
-                  :controls="false"
-                ></el-input-number>
+                ></el-input>
               </el-form-item>
               <el-form-item label="使用有效期" prop="openStudentTime">
                 <el-date-picker
@@ -617,13 +611,10 @@
                 </div>
               </el-form-item>
               <el-form-item label="学习次数" prop="studyCount">
-                <el-input-number
-                  :precision="0"
+                <el-input
                   class="numInputs"
                   v-model="listData.studyCount"
-                  :min="1"
-                  :controls="false"
-                ></el-input-number>
+                ></el-input>
               </el-form-item>
               <el-form-item label="使用有效期" prop="openStudentTime">
                 <el-date-picker
@@ -1380,6 +1371,16 @@ export default {
   name: "CommodityManageMentAdd",
   components: { searchBoxNew, Editor, pagination, poppleSet, poppleSetTk },
   data() {
+    var checkPwd = (rule, value, callback) => {
+      var reg = /^[1-9]\d*$/;
+      if (value) {
+        if (!reg.test(value)) {
+          return callback(new Error("密码必须由数字和字母组合成"));
+        } else {
+          callback();
+        }
+      }
+    };
     return {
       disabledBtn: false,
       photoVideoList: {
@@ -1607,6 +1608,7 @@ export default {
             message: "请输入次数",
             trigger: "blur",
           },
+          { validator: checkPwd, message: "请输入非零正整数", trigger: "blur" },
         ],
         openStudentTime: [
           {
@@ -1703,7 +1705,7 @@ export default {
         examType: 1,
         educationTypeId: "",
         businessId: "",
-        subjectId:"",
+        subjectId: "",
         key: "",
       },
       formList3: [
@@ -2802,16 +2804,15 @@ export default {
         this.listData.educationTypeId,
         true
       );
-      var a = ''
+      var a = "";
       if (this.listData.businessId) {
-        this.newCourTypeOptions.forEach(item => {
-          if(item.id == this.listData.businessId){
-            a = item.projectId
+        this.newCourTypeOptions.forEach((item) => {
+          if (item.id == this.listData.businessId) {
+            a = item.projectId;
           }
-        })
-        this.$refs.searchBox.changeSuject(a)
+        });
+        this.$refs.searchBox.changeSuject(a);
       }
-      
     },
     submitTab() {
       if (this.activeLists.length === 0) {
@@ -2968,7 +2969,7 @@ export default {
     },
     editAddBoxs2(int) {
       var self = this;
-      this.formData3.subjectId = ''
+      this.formData3.subjectId = "";
       var data = JSON.parse(JSON.stringify(this.formData3));
       if (this.listData.educationTypeId) {
         data.educationTypeId = this.listData.educationTypeId;

+ 27 - 25
src/views/Marketing/goods/commodityManageMent/edit/index.vue

@@ -519,13 +519,10 @@
             style="margin-top: 12px"
             prop="studyCount"
           >
-            <el-input-number
+            <el-input
+              class="numInputs"
               v-model="listData.studyCount"
-              :controls="false"
-              controls-position="right"
-              :min="copyNums"
-              :precision="0"
-            ></el-input-number>
+            ></el-input>
           </el-form-item>
           <el-form-item
             label="学习有效期"
@@ -573,13 +570,10 @@
                 </div>
               </el-form-item>
               <el-form-item label="补考次数" prop="studyCount">
-                <el-input-number
-                  :precision="0"
+                <el-input
                   class="numInputs"
                   v-model="listData.studyCount"
-                  :min="1"
-                  :controls="false"
-                ></el-input-number>
+                ></el-input>
               </el-form-item>
               <el-form-item label="使用有效期" prop="openStudentTime">
                 <el-date-picker
@@ -624,13 +618,10 @@
                 </div>
               </el-form-item>
               <el-form-item label="学习次数" prop="studyCount">
-                <el-input-number
-                  :precision="0"
+                <el-input
                   class="numInputs"
                   v-model="listData.studyCount"
-                  :min="1"
-                  :controls="false"
-                ></el-input-number>
+                ></el-input>
               </el-form-item>
               <el-form-item label="使用有效期" prop="openStudentTime">
                 <el-date-picker
@@ -1395,6 +1386,16 @@ export default {
   name: "CommodityManageMentEdit",
   components: { searchBoxNew, Editor, pagination, poppleSet, poppleSetTk },
   data() {
+    var checkPwd = (rule, value, callback) => {
+      var reg = /^[1-9]\d*$/;
+      if (value) {
+        if (!reg.test(value)) {
+          return callback(new Error("密码必须由数字和字母组合成"));
+        } else {
+          callback();
+        }
+      }
+    };
     return {
       copyNums: "", //备份学习机会 - 用途在于 如果出现修改学习机会 不能小于当前值
       disabledBtn: false,
@@ -1635,6 +1636,7 @@ export default {
             message: "请输入次数",
             trigger: "blur",
           },
+          { validator: checkPwd, message: "请输入非零正整数", trigger: "blur" },
         ],
         openStudentTime: [
           {
@@ -1830,10 +1832,10 @@ export default {
         pageSize: 10,
         status: 1,
         examType: 1,
-        subjectId:"",
+        subjectId: "",
         educationTypeId: "",
         businessId: "",
-        key:""
+        key: "",
       },
       formList3: [
         {
@@ -3013,14 +3015,14 @@ export default {
         this.listData.educationTypeId,
         true
       );
-      var a = ''
+      var a = "";
       if (this.listData.businessId) {
-        this.newCourTypeOptions.forEach(item => {
-          if(item.id == this.listData.businessId){
-            a = item.projectId
+        this.newCourTypeOptions.forEach((item) => {
+          if (item.id == this.listData.businessId) {
+            a = item.projectId;
           }
-        })
-        this.$refs.searchBox.changeSuject(a)
+        });
+        this.$refs.searchBox.changeSuject(a);
       }
     },
     submitTab() {
@@ -3193,7 +3195,7 @@ export default {
     editAddBoxs2(int) {
       var self = this;
       this.formData3.examType = 1;
-      this.formData3.subjectId = ''
+      this.formData3.subjectId = "";
       var data = JSON.parse(JSON.stringify(this.formData3));
       if (this.listData.educationTypeId) {
         data.educationTypeId = this.listData.educationTypeId;