852a632e by zhangmeng

赛事报名限制

1 parent df7a4ef6
......@@ -4,7 +4,7 @@
<el-card class="mb20">
<team-sign-step :active-step="activeStep" :language="language" />
</el-card>
<el-card :body-style="{'padding-top': '0'}">
<el-row :gutter="20" class="mt20">
<el-col :lg="12">
......@@ -14,8 +14,8 @@
<h3 v-else class="panel-title">Select list of participating athletes</h3>
<!-- <a class="fr" @click="emptyChoosed">{{ language == 0 ? '清空' : 'Empty' }}</a>-->
<el-button
class="fr" plain size="small" style="top:12px" type="primary"
@click="chooseSportman"
class="fr" plain size="small" style="top:12px" type="primary"
@click="chooseSportman"
>
{{ language == 0 ? '选手管理' : 'Athlete Management' }}
</el-button>
......@@ -27,32 +27,32 @@
<!-- }}-->
*{{
language == 0 ?
'可通过选手管理,增加运动员和完善运动员信息' : `You can add players and complete athletes' details through [Athlete Management]`
'可通过选手管理,增加运动员和完善运动员信息' : `You can add players and complete athletes' details through [Athlete Management]`
}}
</div>
<div style="margin: 0 4px 10px;display: flex">
<el-select
v-model="choosedchoosed" collapse-tags-tooltip filterable multiple
@change="changechoosed"
v-model="choosedchoosed" collapse-tags-tooltip filterable multiple
@change="changechoosed"
>
<el-option
v-for="c in athletesList" :key="c.id" :label="c.realName"
:value="c.id" @click="handelOption(c.id)"
v-for="c in athletesList" :key="c.id" :label="c.realName"
:value="c.id" @click="handelOption(c.id)"
>
<div class="flexOption" style="width: 100%">
{{ c.realName }}
<img v-if="c.sex=='0'" src="@/assets/img/female.png">
<img v-if="c.sex=='1'" src="@/assets/img/male.png">
{{ c.representing }}
{{ c.ageGroup }}
{{ c.division }}<span v-if="c.age"> -{{ c.age }}{{ language == 0 ? '岁' : 'years' }}</span>
<!-- @click="editPerson(c.id)"-->
<span
v-if="c.disabled||c.ocrFlag==0"
class="text-danger po-right"
v-if="c.disabled||c.ocrFlag==0"
class="text-danger po-right"
>{{ language == 0 ? '完善信息' : 'complete details' }}</span>
</div>
</el-option>
<!-- <template #tag>-->
......@@ -65,8 +65,8 @@
{{ language == 0 ? '重选' : 'Re-select' }}
</el-button>
</div>
<!-- -->
<div v-if="athletesList.length==0" class="pd20 text-center">
<span>{{ language == 0 ? '暂无参赛选手' : 'No athlete yet,' }}
......@@ -82,7 +82,7 @@
根据选择的人员自动匹配项目,选择单人匹配单人项
目,选择双人匹配双人项目(注意男女),选择多人匹配多人项目。
</div>
<!-- <div class="noPicChooseForm" id="chooseArr">-->
<!-- <el-checkbox-group v-model="choosedchoosed" @change="changechoosed">-->
<!-- <el-checkbox v-for="c in choosedListBak" :value="c.id" border>-->
......@@ -108,17 +108,17 @@
</h3>
<div class="fr">
<el-input
v-model="projectQuery.name" :prefix-icon="Search" clearable
size="small"
@change="getProjectList"
v-model="projectQuery.name" :prefix-icon="Search" clearable
size="small"
@change="getProjectList"
/>
</div>
</div>
<div id="projectbox" v-loading="loadingProject" style="height: 50vh;overflow: auto;">
<el-checkbox-group v-model="projectIds" @change="changeProject">
<el-checkbox
v-for="c in projectList" v-show="!c.disabled" :key="c.id" :disabled="c.disabled"
:value="c.id" class="flexBetweenBox"
v-for="c in projectList" v-show="!c.disabled" :key="c.id" :disabled="c.disabled"
:value="c.id" class="flexBetweenBox"
>
<div class="flexBetween w100">
<div class="l">
......@@ -131,9 +131,9 @@
</el-checkbox>
</el-checkbox-group>
<el-empty
v-if="projectList.length==0" :description="language==0?'无可选项目':''"
:image="`/img/order_no.png`"
:image-size="228"
v-if="projectList.length==0" :description="language==0?'无可选项目':''"
:image="`/img/order_no.png`"
:image-size="228"
/>
</div>
</div>
......@@ -143,9 +143,9 @@
<el-col :span="24">
<div class="text-center">
<el-button
id="signUpBtn" :disabled="projectIds.length==0||choosedchoosed.length==0"
class="btn-lineG w200px"
round type="primary" @click="signUp"
id="signUpBtn" :disabled="projectIds.length==0||choosedchoosed.length==0"
class="btn-lineG w200px"
round type="primary" @click="signUp"
>
{{ language == 0 ? '确定' : 'Confirm' }}
</el-button>
......@@ -155,7 +155,7 @@
</el-card>
<!-- <el-button type="success" @click="importSportman">批量导入人员</el-button>-->
<!-- <el-button type="success" @click="addCoach">新增运动员</el-button>-->
<el-card :body-style="{'padding': '0'}" class="mt20">
<coach-info-row :group-id="groupId" :language="language" :match-id="matchId" />
<div class="m20">
......@@ -176,44 +176,44 @@
<!-- </el-button>-->
<!-- </div>-->
<sign-info-table
v-if="tableType==0" :extraform="extraform"
:is-national="isNational" :list="signInfoList"
:match-id="matchId" @editExtra="goPersonInfo"
v-if="tableType==0" :extraform="extraform"
:is-national="isNational" :list="signInfoList"
:match-id="matchId" @editExtra="goPersonInfo"
/>
<zu-table v-else :list="zuTableList" @delete="removeThis" />
<div class="text-center mt20 father">
<el-button
class="w200px" plain round style="position: relative ;z-index: 99" type="primary"
@click="goPrev()"
class="w200px" plain round style="position: relative ;z-index: 99" type="primary"
@click="goPrev()"
>
{{ language == 0 ? "上一步" : 'Go back' }}
</el-button>
<el-button
class="btn-lineG w200px" round style="position: relative ;z-index: 99" type="primary"
@click="submitForm()"
class="btn-lineG w200px" round style="position: relative ;z-index: 99" type="primary"
@click="submitForm()"
>
{{ language == 0 ? '预览报名信息' : 'Preview registration information' }}
</el-button>
<span v-if="language==0&& insuranceFlag!=0||language==1&&insuranceFlag==1" class="checkbox">
<br v-if="language == 1">
<br v-if="language == 1">
<el-checkbox
v-model="checked"
:label="language==0?'我同意授权赛事方帮忙购买保险':'I agree to authorize the event organizer to purchase insurance on my behalf'"
false-value="0"
size="large" true-value="1"
v-model="checked"
:label="language==0?'我同意授权赛事方帮忙购买保险':'I agree to authorize the event organizer to purchase insurance on my behalf'"
false-value="0"
size="large" true-value="1"
/>
<br v-if="language == 1">
<span
@click="handelInsurance"
@click="handelInsurance"
>《{{ language == 0 ? '赛事购买协议' : 'Event Insurance Procurement Agreement' }} 》</span>
</span>
</div>
</div>
</el-card>
</div>
<dialogAddCoach ref="dialogAddCoachRef" />
<!-- <dialogAllSportsmanList ref="dialogAllSportsmanListRef" @transfer="getChoosed" @submitForm="getSignInfoList"/>-->
<dialogAllSportsmanList ref="dialogAllSportsmanListRef" @submitForm="getAthletesList" />
......@@ -225,7 +225,7 @@
<el-button type="primary" @click="goMySign">{{ language == 0 ? '查看报项' : 'View Entries' }}</el-button>
</template>
</el-result>
</el-dialog>
<dialogExtraForm ref="popExtraForm" @submitForm="getSignInfoList" />
<dialogWdsf ref="popWdsf" @cancel="removeCurproject" @submitForm="getAthletesList" />
......@@ -235,7 +235,7 @@
<!-- <el-tour-step v-if="projectList.length>0" target="#projectbox" title="第三步" description="选择报名项目"/>-->
<!-- <el-tour-step v-if="projectIds.length>0" target="#signUpBtn" title="第四步" description="点击报项"/>-->
<!-- </el-tour>-->
<insuranceView ref="insuranceViewRef" @checkedChange="checkedChange" @scuess="handelSuccess" />
</div>
</template>
......@@ -359,7 +359,7 @@ function getAthletesList() {
// athletesList.value
match.getGroupPersonList({ label: '0' }, groupId.value).then(res => {
athletesList.value = res.rows
for (const ath of athletesList.value) {
if (!isNational.value) {
ath.disabled = false
......@@ -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'
......@@ -419,11 +418,11 @@ function getSignInfoList() {
function submitForm() {
if (signInfoType == '1') {
ElMessageBox.confirm(language.value == 0 ? '已报项,前往我的报项' : 'Reported items, go to my submission',
language.value == 0 ? '提示' : 'Tips', {
confirmButtonText: language.value == 0 ? '确定' : 'OK',
cancelButtonText: language.value == 0 ? '取消' : 'Cancel',
type: 'warning'
}).then(() => {
language.value == 0 ? '提示' : 'Tips', {
confirmButtonText: language.value == 0 ? '确定' : 'OK',
cancelButtonText: language.value == 0 ? '取消' : 'Cancel',
type: 'warning'
}).then(() => {
router.push({ name: 'myMatch' })
})
return
......@@ -463,7 +462,7 @@ function submitForm() {
}
return
}
if (language.value == 0 && insuranceFlag.value == 2 && checked.value == 0) {
handelInsurance() // 非购买保险
} else {
......@@ -477,7 +476,7 @@ function submitForm() {
}
})
}
// if (insuranceFlag.value == '1' && checked.value == 0) {
// ElMessageBox.confirm(language.value == 0 ? '请阅读并勾选同意赛事保险购买协议' : 'Please read and tick to agree to the event insurance purchase agreement',
// language.value == 0 ? '提示' : 'Tip', {
......@@ -571,9 +570,9 @@ function handelOption(id) {
if (ocr.disabled || ocr.ocrFlag == 0) {
choosedchoosed.value = choosedchoosed.value.filter(v => v != id)
return proxy.$modal.confirm(
language.value == 0
? '请到选手管理完善信息'
: 'You can complete athletes details through [Athlete Manage')
language.value == 0
? '请到选手管理完善信息'
: 'You can complete athletes details through [Athlete Manage')
}
}
}
......@@ -676,11 +675,11 @@ function signUp() {
function removeThis(id) {
ElMessageBox.confirm(language.value == 0 ? '确定移除这条报项吗?' : 'Are you sure to remove this report item',
language.value == 0 ? '提示' : 'Tips', {
confirmButtonText: language.value == 0 ? '确定' : 'Confirm',
cancelButtonText: language.value == 0 ? '取消' : 'Cancel',
type: 'warning'
}).then(() => {
language.value == 0 ? '提示' : 'Tips', {
confirmButtonText: language.value == 0 ? '确定' : 'Confirm',
cancelButtonText: language.value == 0 ? '取消' : 'Cancel',
type: 'warning'
}).then(() => {
match.deleteSign(id).then(res => {
// 重新获取已报名信息
ElMessage.success(language.value == 0 ? '已移除该报项' : 'success')
......@@ -740,7 +739,7 @@ const goPersonInfo = (row) => {
function downloadVoucher() {
// 下载凭证
proxy.download(
`/pdf/getPayedOrderPdf/${matchId.value}/${groupId.value || 0}`, {}, '报项凭证.pdf', {}, 'application/pdf'
`/pdf/getPayedOrderPdf/${matchId.value}/${groupId.value || 0}`, {}, '报项凭证.pdf', {}, 'application/pdf'
)
}
......@@ -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,19 +812,52 @@ 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) ||
(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)
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)
) {
console.log(pp.name)
pp.disabled = true
} else if ((hasAlmighty.almightyFlag == '1' && pp.almightyFlag == '1') &&
(hasAlmighty.danceTypeDetailStr.split(',').length != pp.danceTypeDetailStr.split(',').length)
(hasAlmighty.danceTypeDetailStr.split(',').length != pp.danceTypeDetailStr.split(',').length)
) {
console.log(pp.name)
pp.disabled = true
......@@ -885,11 +920,11 @@ function checkTwo(a, b) {
ElMessage.warning(language.value == 0 ? '他们不是固定组合' : 'They\'re not a couple')
} else {
ElMessageBox.confirm(language.value == 0 ? `${a.realName}/${b.realName} 已经和其他人组成舞伴,无法报名,请重新选择` : `${a.realName}/${b.realName} has already formed a dancer with another person, cannot sign up: please select again`,
language.value == 0 ? '提示' : 'Tips', {
confirmButtonText: language.value == 0 ? '确定' : 'Confirm',
showCancelButton: false,
type: 'warning'
}).then(() => {
language.value == 0 ? '提示' : 'Tips', {
confirmButtonText: language.value == 0 ? '确定' : 'Confirm',
showCancelButton: false,
type: 'warning'
}).then(() => {
console.log('Confirm')
})
}
......@@ -916,7 +951,7 @@ watch(choosedchoosed, (newVal, oldVal) => {
if (!res.data) {
ElMessage.warning(language.value == 0 ? '该人员已在其他团队中报名,请重新选择' : 'This person has already registered in another team, please select again')
choosedchoosed.value = _.without(choosedchoosed.value, _.last(newVal))
for (var c of choosed2List.value) {
if (c.id == _.last(newVal)) {
choosed2List.value = _.without(choosed2List.value, c)
......@@ -945,11 +980,11 @@ function handelSuccess(v) {
checked.value = v
if (signInfoType == '1') {
ElMessageBox.confirm(language.value == 0 ? '已报项,前往我的报项' : 'Reported items, go to my submission',
language.value == 0 ? '提示' : 'Tips', {
confirmButtonText: language.value == 0 ? '确定' : 'OK',
cancelButtonText: language.value == 0 ? '取消' : 'Cancel',
type: 'warning'
}).then(() => {
language.value == 0 ? '提示' : 'Tips', {
confirmButtonText: language.value == 0 ? '确定' : 'OK',
cancelButtonText: language.value == 0 ? '取消' : 'Cancel',
type: 'warning'
}).then(() => {
router.push({ name: 'myMatch' })
})
return
......@@ -977,7 +1012,7 @@ function handelSuccess(v) {
}
return
}
router.push({
name: 'signPreview',
query: {
......@@ -1015,7 +1050,7 @@ function checkedChange(v) {
.flexBetween {
padding: 10px;
border-left: 1px solid #eee;
.l {
div {
margin: 4px 0 0;
......@@ -1046,16 +1081,16 @@ function checkedChange(v) {
margin: 0 0 20px;
display: flex;
justify-content: space-between;
button {
position: relative;
margin: 10px;
}
.choseItem {
margin: 10px;
position: relative;
.poClose {
position: absolute;
right: -6px;
......@@ -1070,18 +1105,18 @@ function checkedChange(v) {
background: rgba(245, 247, 249, 0.38);
padding: 20px 40px 10px;
}
.el-checkbox {
height: auto;
margin-right: 20px;
}
:deep(.el-checkbox__input) {
position: absolute;
right: 0;
top: 0;
}
.name {
text-align: center;
}
......@@ -1100,7 +1135,7 @@ function checkedChange(v) {
margin: 5px 0;
color: #4C5359;
font-size: 14px;
label {
font-size: 14px;
margin-right: 14px
......@@ -1113,13 +1148,13 @@ function checkedChange(v) {
color: #4C5359;
display: flex;
justify-content: center;
div {
padding: 20px;
position: relative;
cursor: pointer;
}
div:first-child::after {
content: '';
position: absolute;
......@@ -1131,10 +1166,10 @@ function checkedChange(v) {
bottom: 0;
margin: auto;
}
.active {
color: var(--el-color-primary);
&::before {
width: 33px;
content: '';
......@@ -1153,23 +1188,23 @@ function checkedChange(v) {
.noPicChooseForm {
overflow: auto;
//height: 70vh;
.el-checkbox-group {
display: flex;
flex-wrap: wrap;
text-align: justify;
.el-button {
width: 31%;
margin: 1%;
}
.el-checkbox {
margin: 1%;
width: 31%;
overflow: hidden;
}
.name {
justify-content: left;
}
......@@ -1180,7 +1215,7 @@ function checkedChange(v) {
display: flex;
align-items: center;
justify-content: center;
img {
height: 20px;
margin-left: 4px;
......@@ -1190,7 +1225,7 @@ function checkedChange(v) {
.flexOption {
display: flex;
align-items: center;
img {
height: 18px;
}
......@@ -1220,7 +1255,7 @@ function checkedChange(v) {
@media (max-width: 767px) {
.father {
position: relative;
height: 110px;
......@@ -1233,7 +1268,7 @@ function checkedChange(v) {
top: 0;
text-align: left;
font-size: 14px;
span {
color: #453DEA;
position: relative;
......@@ -1250,13 +1285,13 @@ function checkedChange(v) {
height: 85px;
line-height: 85px;
}
.checkbox {
position: absolute;
right: 0%;
text-align: left;
font-size: 12px;
span {
color: #453DEA;
position: relative;
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!