diff --git a/src/main/resources/views/platform/activity/school/ActivityApply.html b/src/main/resources/views/platform/activity/school/ActivityApply.html index d9089cc..2e1d2ce 100644 --- a/src/main/resources/views/platform/activity/school/ActivityApply.html +++ b/src/main/resources/views/platform/activity/school/ActivityApply.html @@ -331,18 +331,18 @@ layout("/layouts/platform.html"){ - - - 领队兼教练:{{LeaderData.username | str}}   - - - - - 设置领队/教练 - - + + + + + + + + + + + + @@ -501,6 +501,13 @@ layout("/layouts/platform.html"){ + + + - + @@ -1351,6 +1361,10 @@ layout("/layouts/platform.html"){ formRules: { name: [{required: true, message: "必填", trigger: ["blur", "change"]}], teamId: [{required: true, message: "必填", trigger: ["blur", "change"]}], + mobile: [ + {required: true, message: "请填写手机号", trigger: ["blur", "change"]}, + {pattern: /^1[3-9]\d{9}$/, message: "手机号填写不正确", trigger: ["blur", "change"]} + ], // position: [{required: true, message: "必填", trigger: ["blur", "change"]}] // userId: [{required: true, message: '必填', trigger: ['blur', 'change']}], }, @@ -1389,6 +1403,25 @@ layout("/layouts/platform.html"){ "delete_info": httpVueLoader("/components/activity/school/DeleteInfo.vue") }, methods: { + // 列表输入框统一通过 this.$set 更新手机号,保证编辑后的值参与提交校验。 + setAppliedMobile(row, mobile) { + this.$set(row, "mobile", mobile) + }, + // 提交前统一校验报名人员手机号,覆盖设置运动员后在下方列表修改的号码。 + validateApplyMobiles(appliedData) { + const phoneRegex = /^1[3-9]\d{9}$/ + for (let i = 0; i < appliedData.length; i++) { + if (!appliedData[i].mobile) { + this.$message.warning("请填写手机号!") + return false + } + if (!phoneRegex.test(appliedData[i].mobile)) { + this.$message.warning("手机号填写不正确!") + return false + } + } + return true + }, checkNum(row, num){ if (num < 1) { row.num = 1 @@ -2141,21 +2174,12 @@ layout("/layouts/platform.html"){ return v.teamId }) //判断每一个选手填写的是否正确 - for (let i = 0; i < appliedData.length; i++) { - /*if (!appliedData[i].position) { - this.$message.warning("请填写完整职称职务!") - return - }*/ - if (!appliedData[i].mobile) { - this.$message.warning("请填写手机号!") - return - } else { - const phoneRegex = /^1[3-9]\d{9}$/; - if (!phoneRegex.test(appliedData[i].mobile)) { - this.$message.warning("手机号填写不正确!") - return - } - } + /*if (!appliedData[i].position) { + this.$message.warning("请填写完整职称职务!") + return + }*/ + if (!this.validateApplyMobiles(appliedData)) { + return } if (this.appliedData3.length == 0 && this.appliedData.length == 0) {