f496bf23 by zhangmeng

报名校验

1 parent 84b1fef0
......@@ -798,10 +798,11 @@ export function getZNList(params) {
}
// 团体报名校验
export function preCheckForGroup(groupId) {
export function preCheckForGroup(groupId, type) {
return request({
url: `/systemj/personInfo/preCheckForGroup/${groupId}`,
method: 'get'
method: 'get',
params: { type }
})
}
......
import { ElMessage, ElMessageBox, ElNotification, ElLoading } from 'element-plus'
import {useStorage} from "@vueuse/core/index";
import { useStorage } from '@vueuse/core/index'
const language= useStorage('language',0)
const language = useStorage('language', 0)
let loadingInstance
export default {
......@@ -23,19 +23,19 @@ export default {
},
// 弹出提示
alert(content) {
return ElMessageBox.alert(content, language.value==0 ? language.value==0 ? '系统提示' :'Tips' :'Tips')
return ElMessageBox.alert(content, language.value == 0 ? language.value == 0 ? '系统提示' : 'Tips' : 'Tips')
},
// 错误提示
alertError(content) {
return ElMessageBox.alert(content, language.value==0 ? language.value==0 ? '系统提示' :'Tips' :'Tips', { type: 'error' })
return ElMessageBox.alert(content, language.value == 0 ? language.value == 0 ? '系统提示' : 'Tips' : 'Tips', { type: 'error' })
},
// 成功提示
alertSuccess(content) {
return ElMessageBox.alert(content, language.value==0 ? '系统提示' :'Tips', { type: 'success' })
return ElMessageBox.alert(content, language.value == 0 ? '系统提示' : 'Tips', { type: 'success' })
},
// 警告提示
alertWarning(content) {
return ElMessageBox.alert(content, language.value==0 ? '系统提示' :'Tips', { type: 'warning' })
return ElMessageBox.alert(content, language.value == 0 ? '系统提示' : 'Tips', { type: 'warning' })
},
// 通知提示
notify(content) {
......@@ -55,17 +55,17 @@ export default {
},
// 确认窗体
confirm(content) {
return ElMessageBox.confirm(content, language.value==0 ? '系统提示' :'Tips', {
confirmButtonText: language.value==0 ? '确定' :'OK',
cancelButtonText: language.value==0 ? '取消' :'Cancel',
return ElMessageBox.confirm(content, language.value == 0 ? '系统提示' : 'Tips', {
confirmButtonText: language.value == 0 ? '确定' : 'OK',
cancelButtonText: language.value == 0 ? '取消' : 'Cancel',
type: 'warning'
})
},
// 提交内容
prompt(content) {
return ElMessageBox.prompt(content, language.value==0 ? '系统提示' :'Tips', {
confirmButtonText: language.value==0 ? '确定' :'OK',
cancelButtonText: language.value==0 ? '取消' :'Cancel',
return ElMessageBox.prompt(content, language.value == 0 ? '系统提示' : 'Tips', {
confirmButtonText: language.value == 0 ? '确定' : 'OK',
cancelButtonText: language.value == 0 ? '取消' : 'Cancel',
type: 'warning'
})
},
......
......@@ -588,6 +588,8 @@ function goTeamSign() {
)
return
}
handelPreCheckForGroup(
router.push({
path: `${route.params.id}/teamSignCn`,
query: {
......@@ -598,6 +600,7 @@ function goTeamSign() {
isNational: false
}
})
)
} else {
// 国际赛
if (group?.type != '4' && matchData.value.countryLimit == '1') {
......@@ -612,6 +615,7 @@ function goTeamSign() {
)
return
}
handelPreCheckForGroup(
router.push({
path: `${route.params.id}/teamSign`,
query: {
......@@ -622,6 +626,7 @@ function goTeamSign() {
languageSource: matchData.value.languageSource
}
})
)
}
}
......@@ -754,17 +759,7 @@ function switchSignType() {
switch (matchData.value.signType) {
case '0':// 个人
if (user.utype == '1') {
match.preCheckForPerson().then(res => {
if (res.data == 1) {
goPersonalSign()
} else {
return proxy.$modal.msgError(
language.value == 0
? '您绑定的WDSF会员号已过期,请先到WDSF官网激活您的会员号。'
: 'Your bound WDSF Number has expired. Please activate your WDSF Number on the WDSF official website first.'
)
}
})
handelGeRenNext()
}
if (user.utype == '2') {
ElMessageBox.confirm(
......@@ -796,7 +791,9 @@ function switchSignType() {
)
}
if (user.utype == '2') {
match.preCheckForGroup(groupId.value).then(goTeamSign)
// match.preCheckForGroup(groupId.value).then(goTeamSign)
// handelPreCheckForGroup(goTeamSign)
goTeamSign()
}
if (user.utype == '3') {
// 团队活动 且 游客
......@@ -805,12 +802,14 @@ function switchSignType() {
break
case '2':// 团体队伍
if (user.utype == '1') {
match.preCheckForGroup(groupId.value).then(goPersonalSign)
// match.preCheckForGroup(groupId.value).then(goPersonalSign)
// goPersonalSign()
handelPreCheckForGroup(goPersonalSign)
}
if (user.utype == '2') {
match.preCheckForGroup(groupId.value).then(goTeamSign)
// goTeamSign()
// handelPreCheckForGroup(goTeamSign)
// match.preCheckForGroup(groupId.value).then(goTeamSign)
goTeamSign()
}
if (user.utype == '3') {
// 游客
......@@ -820,8 +819,35 @@ function switchSignType() {
}
}
async function handelGeRenNext() {
const res = await match.preCheckForPerson({ type: '1' })
// 不给报名
if (res.data == 0) {
await proxy.$modal.confirm(
language.value == 0
? '您绑定的WDSF会员号已过期,请先到WDSF官网激活您的会员号。'
: 'Your bound WDSF Number has expired. Please activate your WDSF Number on the WDSF official website first.'
)
return
}
// 正常报名
if (res.data == 1) {
goPersonalSign()
}
// 提示
if (res.data == 2) {
await proxy.$modal.confirm(
language.value == 0
? '运动员的WDSF会员号已变更,是否更新?'
: 'The athlete`s WDSF membership number has been changed. Should it be updated?'
)
await match.preCheckForPerson({ type: '2' })
await goPersonalSign()
}
}
function applyInvitation() {
var obj = {
const obj = {
title: language.value == 0 ? '邀请函申请' : 'Visa Invitation Letter ',
cptId: matchId.value
}
......@@ -835,6 +861,21 @@ const openPickup = () => {
}
proxy.$refs['pickupRef'].open(obj)
}
async function handelPreCheckForGroup(fn) {
const res = await match.preCheckForGroup(groupId.value, '1')
if (res.data == 1 || res.data == 0) {
await fn()
}
if (res.data == 2) {
await proxy.$modal.confirm(
language.value == 0
? '运动员的WDSF会员号已变更,是否更新?'
: 'The athlete`s WDSF membership number has been changed. Should it be updated?')
await match.preCheckForGroup(groupId.value, '2')
await fn()
}
}
</script>
<style lang="scss" scoped>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!