Răsfoiți Sursa

feat: 邮箱字段移至表单最上方,校验顺序同步调整

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
skyline 4 zile în urmă
părinte
comite
1e4a49d00c
1 a modificat fișierele cu 14 adăugiri și 13 ștergeri
  1. 14 13
      charge-front/src/pages-common/invoice/invoice-form.vue

+ 14 - 13
charge-front/src/pages-common/invoice/invoice-form.vue

@@ -29,6 +29,12 @@
     <view class="block mt-20">
       <view class="fs-30 fw-600 color-333 mb-28">填写发票信息</view>
 
+      <!-- 接收邮箱 -->
+      <view class="form-item">
+        <view class="fs-28 color-333 mb-12">接收邮箱<text class="color-primary">*</text></view>
+        <input class="input br-8 fs-28 p-20" v-model="form.email" placeholder="电子发票将发送至此邮箱" />
+      </view>
+
       <!-- 发票类型 -->
       <view class="form-item">
         <view class="fs-28 color-333 mb-12">发票类型</view>
@@ -83,11 +89,6 @@
         </view>
       </template>
 
-      <!-- 公共字段 -->
-      <view class="form-item">
-        <view class="fs-28 color-333 mb-12">接收邮箱<text class="color-primary">*</text></view>
-        <input class="input br-8 fs-28 p-20" v-model="form.email" placeholder="电子发票将发送至此邮箱" />
-      </view>
       <view class="form-item">
         <view class="fs-28 color-333 mb-12">备注</view>
         <input class="input br-8 fs-28 p-20" v-model="form.remark" placeholder="可选备注信息" />
@@ -167,14 +168,6 @@ const selectTitle = (item: any) => {
 const emailRegex = /^[\w.%+-]+@[\w.-]+\.[a-zA-Z]{2,}$/;
 
 const submit = () => {
-  if (!form.invoiceTitle.trim()) {
-    uni.showToast({ title: "请填写抬头名称", icon: "none" });
-    return;
-  }
-  if (form.invoiceType === "ORGANIZATION" && !form.taxId.trim()) {
-    uni.showToast({ title: "请填写公司税号", icon: "none" });
-    return;
-  }
   if (!form.email.trim()) {
     uni.showToast({ title: "请填写接收发票的邮箱地址", icon: "none" });
     return;
@@ -183,6 +176,14 @@ const submit = () => {
     uni.showToast({ title: "邮箱格式不正确", icon: "none" });
     return;
   }
+  if (!form.invoiceTitle.trim()) {
+    uni.showToast({ title: "请填写抬头名称", icon: "none" });
+    return;
+  }
+  if (form.invoiceType === "ORGANIZATION" && !form.taxId.trim()) {
+    uni.showToast({ title: "请填写公司税号", icon: "none" });
+    return;
+  }
 
   uni.showLoading({ title: "提交中" });