소스 검색

luowei修改bug

luowei 2 년 전
부모
커밋
d6dc61e842
2개의 변경된 파일32개의 추가작업 그리고 24개의 파일을 삭제
  1. 31 23
      src/views/information/configuration/index.vue
  2. 1 1
      src/views/system/bind/index.vue

+ 31 - 23
src/views/information/configuration/index.vue

@@ -132,7 +132,7 @@
     </el-form>
     <div style="margin-top: 50px; margin-left: 42%">
       <el-button type="primary" @click="saveExtend" size="small">提交</el-button>
-      <el-button type="primary" @click="nosaveExtend" size="small">取消</el-button>
+  <!--    <el-button type="primary" @click="nosaveExtend" size="small">取消</el-button> -->
     </div>
   </div>
 </template>
@@ -144,7 +144,7 @@ export default {
   components: {},
   data() {
     return {
-      
+    
       num: 1,
       day: {
         resumptionCycle: 1,
@@ -252,29 +252,37 @@ export default {
     //   });
 
     // },
-    
-    saveExtend() {
-      debugger
-      this.$refs["day"].validate(valid => {
-        if (valid) {
-          if (this.day.id != null) {
-            updateArea(this.day).then(response => {
-              this.$modal.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
-          } else {
-            debugger
-            insertConfiguration(this.day).then(response=>{
-                  this.$modal.msgSuccess("新增成功");
-               this.open = false;
-              
-            })
-          }
-        }
+    checkForm(form){
+      let val
+      this.$refs[form].validate(valid => {
+        console.log(valid,'valid')
+        val = valid
       });
+      return val;
     },
-
+    saveExtend() {
+    
+      let arr = ['day','week','month','season','halfYear','year'];
+      let flags = [];
+      arr.forEach(v=>{
+        flags.push(this.checkForm(v));
+      });
+      console.log(flags,'flags')
+      let flag = flags.every(v=>{
+        console.log(v,'valid')
+        return v == true;
+      })
+      console.log(flag,'flag')
+      if(!flag) return;
+      let data = {
+        coreResumptionConfiguration:[this.day,this.week,this.month,]
+      };
+      insertConfiguration(data).then(response=>{
+            this.$modal.msgSuccess("新增成功");
+          this.open = false;
+        
+      })
+    }
   },
   fillter: {},
 }

+ 1 - 1
src/views/system/bind/index.vue

@@ -135,7 +135,7 @@
 
 
         <el-form-item label="标签编号" prop="code">
-          <el-input v-model="form.code" placeholder="请输入标签" />
+          <el-input maxlength="50" v-model="form.code" placeholder="请输入标签" />
         </el-form-item>
 
         <el-form-item label="状态" prop="enable">