lisy il y a 4 mois
Parent
commit
c8a56b3a61
1 fichiers modifiés avec 23 ajouts et 4 suppressions
  1. 23 4
      src/views/training/models/meeting-detail-attend.vue

+ 23 - 4
src/views/training/models/meeting-detail-attend.vue

@@ -168,9 +168,9 @@
                 <template #default="{ row }">
                     <div v-if="row.payType === '1'" class="f-w-5">微信支付</div>
                     <div v-if="row.payType === '2'" class="f-w-5">对公转账</div>
-                      <div v-if="row.payType === '3'" class="f-w-5">对公转账收款</div>
-                        <div v-if="row.payType === '4'" class="f-w-5">现场收款</div>
-                    <div v-if="row?.payType !=='1'&& row?.payType !=='2' && row?.payType !=='3' && row?.payType !=='4'" >-</div>
+                    <div v-if="row.payType === '3'" class="f-w-5">对公转账收款</div>
+                    <div v-if="row.payType === '4'" class="f-w-5">现场收款</div>
+                    <div v-if="row?.payType !=='1'&& row?.payType !=='2' && row?.payType !=='3' && row?.payType !=='4'">-</div>
                 </template>
             </vxe-column>
             <vxe-column title="开票信息" field="remark" min-width="100" :formatter="colNoData" v-if="form?.meetingCharge?.hasFee =='1'">
@@ -361,7 +361,7 @@
                     <el-input v-model="contactPersonData.contactName" style="width: 300px;"></el-input>
                 </div>
             </el-form-item>
-            <el-form-item prop="contactTel" :rules="[{ required: true, message: '请填写指定联系人电话' }]">
+            <el-form-item prop="contactTel" :rules="phoneRules">
                 <div class="d-flex pt-20 a-c">
                     <div class="pr-20">指定联系人电话</div>
                     <el-input v-model.number="contactPersonData.contactTel" style="width: 300px;"></el-input>
@@ -396,6 +396,25 @@ const props = defineProps({
         default: () => ({})
     }
 });
+const phoneRules = [
+  {
+    required: true,
+    message: '请填写指定联系人电话'
+  },
+  {
+    validator: (rule, value, callback) => {
+      // 去除所有点号
+      const cleanValue = value ? value.toString().replace(/\./g, '') : '';
+
+      // 验证是否为11位数字
+      if (cleanValue && /^\d{11}$/.test(cleanValue)) {
+        callback();
+      } else {
+        callback(new Error('请输入11位数字的电话号码'));
+      }
+    }
+  }
+];
 const baseUrl = import.meta.env.VITE_APP_BASE_API;
 const uploadFileUrl = ref(baseUrl + '/resource/oss/upload'); // 上传文件服务器地址
 const rules = reactive({