852a632e by zhangmeng

赛事报名限制

1 parent df7a4ef6
...@@ -383,7 +383,6 @@ function getMatch(id) { ...@@ -383,7 +383,6 @@ function getMatch(id) {
383 noPhotoCanSign.value = res.data.noPhotoCanSign 383 noPhotoCanSign.value = res.data.noPhotoCanSign
384 coachOrLeaderFlag.value = res.data.coachOrLeaderFlag 384 coachOrLeaderFlag.value = res.data.coachOrLeaderFlag
385 extraform.value = JSON.parse(res.data.participantsInfo) 385 extraform.value = JSON.parse(res.data.participantsInfo)
386 console.log(11111,extraform.value)
387 insuranceAgreement.value = res.data.insuranceAgreement 386 insuranceAgreement.value = res.data.insuranceAgreement
388 insuranceFlag.value = res.data.insuranceFlag 387 insuranceFlag.value = res.data.insuranceFlag
389 if (insuranceFlag.value == 1) checked.value = '1' 388 if (insuranceFlag.value == 1) checked.value = '1'
...@@ -762,6 +761,7 @@ function switchTabletype() { ...@@ -762,6 +761,7 @@ function switchTabletype() {
762 761
763 let hasPproperty = '' 762 let hasPproperty = ''
764 let hasPlevel = '' 763 let hasPlevel = ''
764 let hasMtype = ''
765 let hasAlmighty = {} 765 let hasAlmighty = {}
766 let hasPpropertyLength = 0 766 let hasPpropertyLength = 0
767 let isDanNum = 0 767 let isDanNum = 0
...@@ -781,6 +781,7 @@ watch(projectIds, (newVal, oldVal) => { ...@@ -781,6 +781,7 @@ watch(projectIds, (newVal, oldVal) => {
781 if (newVal.length > 0) { 781 if (newVal.length > 0) {
782 hasPproperty = '' 782 hasPproperty = ''
783 hasPlevel = '' 783 hasPlevel = ''
784 hasMtype = ''
784 hasAlmighty = {} 785 hasAlmighty = {}
785 isDanNum = 0 786 isDanNum = 0
786 isShuangNum = 0 787 isShuangNum = 0
...@@ -789,6 +790,7 @@ watch(projectIds, (newVal, oldVal) => { ...@@ -789,6 +790,7 @@ watch(projectIds, (newVal, oldVal) => {
789 if (projectIds.value.indexOf(hh.id) > -1 && hh.pproperty) { 790 if (projectIds.value.indexOf(hh.id) > -1 && hh.pproperty) {
790 hasPproperty = hh.pproperty 791 hasPproperty = hh.pproperty
791 hasPpropertyLength = hh.danceTypeDetailStr.split(',').length 792 hasPpropertyLength = hh.danceTypeDetailStr.split(',').length
793 hasMtype = hh.mtype
792 } 794 }
793 if (projectIds.value.indexOf(hh.id) > -1 && hh.plevel) { 795 if (projectIds.value.indexOf(hh.id) > -1 && hh.plevel) {
794 hasPlevel = hh.plevel 796 hasPlevel = hh.plevel
...@@ -810,11 +812,44 @@ watch(projectIds, (newVal, oldVal) => { ...@@ -810,11 +812,44 @@ watch(projectIds, (newVal, oldVal) => {
810 } 812 }
811 }) 813 })
812 814
815 function hasDanceCountConflict(pp) {
816 if (!pp.pproperty || !pp.danceTypeDetailStr) {
817 return false
818 }
819 const ppDanceCount = pp.danceTypeDetailStr.split(',').length
820 const selectedProjects = projectList.value.filter(p => projectIds.value.includes(p.id) && p.pproperty)
821 return selectedProjects.some(selected => {
822 if (selected.pproperty !== pp.pproperty) {
823 return false
824 }
825 // 名次赛与等级赛不互斥,仅同类型项目限制三支/四支舞兼报
826 if (selected.mtype !== pp.mtype) {
827 return false
828 }
829 const selectedDanceCount = selected.danceTypeDetailStr.split(',').length
830 return (ppDanceCount >= 4 && selectedDanceCount < 4) || (ppDanceCount < 4 && selectedDanceCount >= 4)
831 })
832 }
833
834 function hasPpropertyConflict(pp) {
835 if (!pp.pproperty) {
836 return false
837 }
838 const selectedProjects = projectList.value.filter(p => projectIds.value.includes(p.id) && p.pproperty)
839 return selectedProjects.some(selected => {
840 // 名次赛与等级赛不互斥,ABC 属性仅在同一赛事类型内互斥
841 if (selected.mtype !== pp.mtype) {
842 return false
843 }
844 return selected.pproperty !== pp.pproperty
845 })
846 }
847
813 function filterProjectList(currProject) { 848 function filterProjectList(currProject) {
814 for (const pp of projectList.value) { 849 for (const pp of projectList.value) {
815 if ( 850 if (
816 (hasPproperty && pp.pproperty == hasPproperty) && ((pp.danceTypeDetailStr.split(',').length >= 4 && hasPpropertyLength < 4) || (pp.danceTypeDetailStr.split(',').length < 4 && hasPpropertyLength >= 4)) || 851 hasDanceCountConflict(pp) ||
817 (hasPproperty && pp.pproperty && pp.pproperty != hasPproperty) || 852 hasPpropertyConflict(pp) ||
818 (hasPlevel && pp.plevel && pp.plevel != hasPlevel) || 853 (hasPlevel && pp.plevel && pp.plevel != hasPlevel) ||
819 (isDanNum == Number(singlePersonEntryLimit.value) && pp.singleFlag == '1' && projectIds.value.indexOf(pp.id) == -1) || 854 (isDanNum == Number(singlePersonEntryLimit.value) && pp.singleFlag == '1' && projectIds.value.indexOf(pp.id) == -1) ||
820 (isShuangNum == Number(doublePersonEntryLimit.value) && pp.doubleSingleProjectFlag == '1' && projectIds.value.indexOf(pp.id) == -1) 855 (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!