Browse Source

完善添加盲票组

hwb0 3 năm trước cách đây
mục cha
commit
789fe21261
1 tập tin đã thay đổi với 17 bổ sung5 xóa
  1. 17 5
      src/views/business/ticket/create.vue

+ 17 - 5
src/views/business/ticket/create.vue

@@ -616,14 +616,26 @@ export default {
             spinner: "el-icon-loading",
             background: "rgba(0, 0, 0, 0.4)",
           });
-          ticketBoxCreate(data).then((res) => {
-            if (res.code == 0) {
-              this.msgSuccess("保存成功");
+          ticketBoxCreate(data)
+            .then((res) => {
+              if (res.code == 0) {
+                this.msgSuccess("保存成功");
+                this.$store.dispatch("tagsView/delView", this.$route);
+                this.$router.go(-1);
+                loading.close();
+              } else {
+                this.$message.error("保存失败,请重新添加!");
+                this.$store.dispatch("tagsView/delView", this.$route);
+                this.$router.go(-1);
+                loading.close();
+              }
+            })
+            .catch(() => {
+              this.$message.error("保存失败,请重新添加!");
               this.$store.dispatch("tagsView/delView", this.$route);
               this.$router.go(-1);
               loading.close();
-            }
-          });
+            });
         } else {
           return false;
         }