Ver código fonte

注册bug修复

szw 1 ano atrás
pai
commit
c83dd276b5

+ 1 - 0
src/views/components/register/accountInfo.vue

@@ -281,6 +281,7 @@ export default {
           this.next();
           this.changeComponents("entry-information");
         } else {
+          this.$message.error("数据填写不完整,请检查数据");
           return false;
         }
       });

+ 1 - 1
src/views/components/register/entryInformation.vue

@@ -212,7 +212,6 @@ export default {
         ],
         validityDeadline: [
           {
-            type: "date",
             required: true,
             message: "请选择营业执照有效期",
             trigger: "blur",
@@ -264,6 +263,7 @@ export default {
           this.next();
           this.changeComponents("registration-package");
         } else {
+          this.$message.error("数据填写不完整,请检查数据");
           return false;
         }
       });

+ 24 - 10
src/views/components/register/registrationPackage.vue

@@ -213,6 +213,9 @@ export default {
     form: {
       type: Object,
     },
+    changeMask: {
+      type: Function,
+    },
     next: {
       type: Function,
     },
@@ -345,16 +348,27 @@ export default {
       this.previous();
     },
     submitAll() {
-      this.$refs["form"].validate((valid) => {
-        if (valid) {
-          console.log("======================", this.form);
-          tenantRegister(this.form).then((res) => {
-            this.$modal.msgSuccess("新增成功");
-          });
-        } else {
-          return false;
-        }
-      });
+      if (!this.form.packageId) {
+        this.$message.error("请先选择选购的套餐");
+
+        return false;
+      } else {
+        this.changeMask();
+        this.$refs["form"].validate((valid) => {
+          if (valid) {
+            console.log("======================", this.form);
+            tenantRegister(this.form).then((res) => {
+              this.$modal.msgSuccess("新增成功");
+              this.changeMask();
+              this.$router.push("/login").catch(() => {});
+            });
+          } else {
+            this.$message.error("数据填写不完整,请检查数据");
+            this.changeMask();
+            return false;
+          }
+        });
+      }
       // console.log("======================", this.form);
       // tenantRegister(this.form).then((res) => {
       //   this.$modal.msgSuccess("新增成功");

+ 26 - 1
src/views/register.vue

@@ -1,5 +1,8 @@
 <template>
   <div>
+    <div class="mask" v-if="showMask">
+      <span class="maskFont">正在保存数据,请稍后...</span>
+    </div>
     <top-menu :methodType="2"></top-menu>
     <div style="height: 92vh">
       <div class="stepsSty">
@@ -18,6 +21,7 @@
           :next="next"
           :previous="previous"
           :changeComponents="changeComponents"
+          :changeMask="changeMask"
         ></component>
       </div>
     </div>
@@ -44,6 +48,8 @@ export default {
       title3: "入驻信息",
       isShow: false,
       currentComponent: "registration-terms", // 初始组件
+      showMask: false,
+      // showMask: false,
       // currentComponent: "account-info", // 初始组件
       // currentComponent: "entry-information", // 初始组件
       // currentComponent: "registration-package", // 初始组件
@@ -85,7 +91,7 @@ export default {
         //===============================================
         purchaseDuration: 1, //购买时长
         accountNum: 5, //账号数量
-        totalPrice: 0.00, //总价
+        totalPrice: 0.0, //总价
         invoiceType: "1", //发票类型
         invoiceHeader: "1", //发票抬头:默认单位不可修改
         USICForInvoice: "", //统一社会识别码(发票)
@@ -103,6 +109,9 @@ export default {
   created() {},
   mounted() {},
   methods: {
+    changeMask() {
+      this.showMask = !this.showMask;
+    },
     next() {
       this.activeStep++;
       //重置滚动条
@@ -120,6 +129,22 @@ export default {
 };
 </script>
 <style lang="scss" scoped>
+.maskFont {
+  color: white;
+  font-size: 40px;
+}
+.mask {
+  position: fixed;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  left: 0;
+  right: 0;
+  top: 0;
+  bottom: 0;
+  background: rgba(0, 0, 0, 0.5);
+  z-index: 9999;
+}
 .contentSty {
   height: 76vh;
   width: 80%;