修复个人只能报两项的限制

This commit is contained in:
2026-10-14 16:38:38 +08:00
parent 3e152181ea
commit e784b5d4a8
@@ -635,7 +635,7 @@ var ACTIVITY_SPORTS_APPLY_USER = {
} }
}, },
//点击添加运动员操作 //点击添加运动员操作
async applyUser() { applyUser() {
const {isManGirlNum, restrictGirlNum, restrictBoyNum} = this.eventData const {isManGirlNum, restrictGirlNum, restrictBoyNum} = this.eventData
if (!this.rightApplyUserList.length) { if (!this.rightApplyUserList.length) {
@@ -696,15 +696,16 @@ var ACTIVITY_SPORTS_APPLY_USER = {
} }
} }
const resp = await this.$axios.post(loc() + "/getActivityData", {activityId: this.activityData.id}) this.$axios.post(loc() + "/getActivityData", {activityId: this.activityData.id}).then((resp) => {
const aa = resp.data.filter((v) => { const aa = resp.data.filter((v) => {
return this.rightApplyUserList.includes(v.userId) return this.rightApplyUserList.includes(v.userId)
}) })
const groupData = groupBy(aa, (v) => { const groupData = groupBy(aa, (v) => {
return v.userId return v.userId
}) })
// 未配置限报数时不限制单项报名,避免 null 被 JavaScript 当作 0 比较。 // 每人限报项目数只在综合赛单项中配置;个人赛不能使用隐藏的历史限报值。
const hasSingleEventLimit = this.activityTableData.eveProjectType === '1' && const hasSingleEventLimit = this.activityTableData.applyType === 2 &&
this.activityTableData.eveProjectType === '1' &&
Number.isInteger(this.eventData.restrictRegNumber) && this.eventData.restrictRegNumber >= 0 Number.isInteger(this.eventData.restrictRegNumber) && this.eventData.restrictRegNumber >= 0
const cc = hasSingleEventLimit ? groupData.filter((v) => { const cc = hasSingleEventLimit ? groupData.filter((v) => {
return v.length >= this.eventData.restrictRegNumber return v.length >= this.eventData.restrictRegNumber
@@ -773,6 +774,7 @@ var ACTIVITY_SPORTS_APPLY_USER = {
}) })
this.rightApplyUserList = [] this.rightApplyUserList = []
this.sortApplyUserTableData() this.sortApplyUserTableData()
})
}, },
//勾选左边的框设置角色 //勾选左边的框设置角色
setUserRole(num) { setUserRole(num) {