mengy 1 rok temu
rodzic
commit
00ed74e0fc
1 zmienionych plików z 11 dodań i 11 usunięć
  1. 11 11
      src/views/equipConfig/barnBasicInfo/add.vue

+ 11 - 11
src/views/equipConfig/barnBasicInfo/add.vue

@@ -170,13 +170,10 @@
170 170
             </div>
171 171
           </el-col>
172 172
         </el-row>
173
-
174
-        <el-row>
175
-                  <div class="btns" style="text-align:center;">
176
-                    <el-button type="primary" @click="save()">保 存</el-button>
177
-                    <el-button @click="resetForm('form')">重 置</el-button>
178
-                  </div>
179
-                </el-row>
173
+        <el-footer style="height: 41px;">
174
+          <el-button type="primary" class="footerBtn" @click="save">保存</el-button>
175
+          <el-button class="footerBtn" @click="resetForm('form')">重 置</el-button>
176
+        </el-footer>
180 177
       </div>
181 178
     </el-form>
182 179
 
@@ -314,10 +311,15 @@ export default {
314 311
         if(res.code == 200) {
315 312
           this.$router.push({ name: "BarnBasicInfo" })
316 313
         }
317
-      }).catch(err =>{
314
+      }
315
+      this.getform.resetFields()//getform是创建的form实例
316
+      ).catch(err =>{
318 317
         console.log(err)
319 318
       })
320 319
     },
320
+    resetForm(formName) {
321
+          this.$refs[formName].resetFields();
322
+        },
321 323
     addCorrelation () {
322 324
 
323 325
     },
@@ -333,9 +335,7 @@ export default {
333 335
     handleAvatarSuccess (res, file) {
334 336
       this.imageUrl = URL.createObjectURL(file.raw);
335 337
     },
336
-    resetForm(formName) {
337
-      this.$refs[formName].resetFields();
338
-    },
338
+
339 339
     beforeAvatarUpload (file) {
340 340
       const isJPG = file.type === 'image/jpeg';
341 341
       const isLt2M = file.size / 1024 / 1024 < 2;