体育活动报名时保存

This commit is contained in:
2026-10-10 18:07:38 +08:00
parent 4b67eb8b78
commit 76d39865e8
@@ -703,9 +703,12 @@ var ACTIVITY_SPORTS_APPLY_USER = {
const groupData = groupBy(aa, (v) => {
return v.userId
})
const cc = groupData.filter((v) => {
if (v.length >= this.eventData.restrictRegNumber) return v
})
// 未配置限报数时不限制单项报名,避免 null 被 JavaScript 当作 0 比较。
const hasSingleEventLimit = this.activityTableData.eveProjectType === '1' &&
Number.isInteger(this.eventData.restrictRegNumber) && this.eventData.restrictRegNumber >= 0
const cc = hasSingleEventLimit ? groupData.filter((v) => {
return v.length >= this.eventData.restrictRegNumber
}) : []
//从全部人员里找出右边框选择的人
const arr = this.userList.filter((v) => {
@@ -738,7 +741,7 @@ var ACTIVITY_SPORTS_APPLY_USER = {
this.applyUserList.push(data)
//如果是单项判断每个人可以报几项
if (this.eventData.restrictRegNumber >= 0 && this.activityTableData.eveProjectType === '1') {
if (hasSingleEventLimit) {
cc.forEach((z) => {
if (z[0]) {
const index = this.applyUserList.findIndex((x) => x.userId === z[0].userId && x.id === null)
@@ -751,7 +754,7 @@ var ACTIVITY_SPORTS_APPLY_USER = {
})
//如果是单项判断每个人可以报几项
if (this.eventData.restrictRegNumber >= 0 && this.activityTableData.eveProjectType === '1') {
if (hasSingleEventLimit) {
const usernames = cc.map((v) => v[0].username).join(",")
if (usernames) {
this.$notify({