852a632e by zhangmeng

赛事报名限制

1 parent df7a4ef6
......@@ -383,7 +383,6 @@ function getMatch(id) {
noPhotoCanSign.value = res.data.noPhotoCanSign
coachOrLeaderFlag.value = res.data.coachOrLeaderFlag
extraform.value = JSON.parse(res.data.participantsInfo)
console.log(11111,extraform.value)
insuranceAgreement.value = res.data.insuranceAgreement
insuranceFlag.value = res.data.insuranceFlag
if (insuranceFlag.value == 1) checked.value = '1'
......@@ -762,6 +761,7 @@ function switchTabletype() {
let hasPproperty = ''
let hasPlevel = ''
let hasMtype = ''
let hasAlmighty = {}
let hasPpropertyLength = 0
let isDanNum = 0
......@@ -781,6 +781,7 @@ watch(projectIds, (newVal, oldVal) => {
if (newVal.length > 0) {
hasPproperty = ''
hasPlevel = ''
hasMtype = ''
hasAlmighty = {}
isDanNum = 0
isShuangNum = 0
......@@ -789,6 +790,7 @@ watch(projectIds, (newVal, oldVal) => {
if (projectIds.value.indexOf(hh.id) > -1 && hh.pproperty) {
hasPproperty = hh.pproperty
hasPpropertyLength = hh.danceTypeDetailStr.split(',').length
hasMtype = hh.mtype
}
if (projectIds.value.indexOf(hh.id) > -1 && hh.plevel) {
hasPlevel = hh.plevel
......@@ -810,11 +812,44 @@ watch(projectIds, (newVal, oldVal) => {
}
})
function hasDanceCountConflict(pp) {
if (!pp.pproperty || !pp.danceTypeDetailStr) {
return false
}
const ppDanceCount = pp.danceTypeDetailStr.split(',').length
const selectedProjects = projectList.value.filter(p => projectIds.value.includes(p.id) && p.pproperty)
return selectedProjects.some(selected => {
if (selected.pproperty !== pp.pproperty) {
return false
}
// 名次赛与等级赛不互斥,仅同类型项目限制三支/四支舞兼报
if (selected.mtype !== pp.mtype) {
return false
}
const selectedDanceCount = selected.danceTypeDetailStr.split(',').length
return (ppDanceCount >= 4 && selectedDanceCount < 4) || (ppDanceCount < 4 && selectedDanceCount >= 4)
})
}
function hasPpropertyConflict(pp) {
if (!pp.pproperty) {
return false
}
const selectedProjects = projectList.value.filter(p => projectIds.value.includes(p.id) && p.pproperty)
return selectedProjects.some(selected => {
// 名次赛与等级赛不互斥,ABC 属性仅在同一赛事类型内互斥
if (selected.mtype !== pp.mtype) {
return false
}
return selected.pproperty !== pp.pproperty
})
}
function filterProjectList(currProject) {
for (const pp of projectList.value) {
if (
(hasPproperty && pp.pproperty == hasPproperty) && ((pp.danceTypeDetailStr.split(',').length >= 4 && hasPpropertyLength < 4) || (pp.danceTypeDetailStr.split(',').length < 4 && hasPpropertyLength >= 4)) ||
(hasPproperty && pp.pproperty && pp.pproperty != hasPproperty) ||
hasDanceCountConflict(pp) ||
hasPpropertyConflict(pp) ||
(hasPlevel && pp.plevel && pp.plevel != hasPlevel) ||
(isDanNum == Number(singlePersonEntryLimit.value) && pp.singleFlag == '1' && projectIds.value.indexOf(pp.id) == -1) ||
(isShuangNum == Number(doublePersonEntryLimit.value) && pp.doubleSingleProjectFlag == '1' && projectIds.value.indexOf(pp.id) == -1)
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!