85bea01c by zhangmeng

报名校验

1 parent 529802ed
......@@ -815,4 +815,21 @@ export function preCheckForPerson(params) {
})
}
// 人员OCR校验
export function checkOcr(data) {
return request({
url: `/systemj/personInfo/checkOcr`,
method: 'post',
data
})
}
// 修改人员
export function editOcr(data) {
return request({
url: `/systemj/personInfo/editOcr`,
method: 'post',
data
})
}
......
<template>
<el-dialog v-model="show" :title="title" append-to-body width="1000px">
<div class="from-Card">
<el-form :inline="true" :model="query" class="mt20" label-width="60" size="small">
<el-form-item :label="language==0?'姓名':'Name'">
<el-input v-model="query.realName" clearable style="width: 120px;" />
</el-form-item>
<el-form-item v-if="!isNational" :label="language==0?'证件类型':'ID Type'">
<el-select v-model="query.idcType" clearable style="width: 100px;" @change="getList">
<el-option
v-for="item in certificates"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item v-if="!isNational" :label="language==0?'证件号码':'ID NO.'">
<el-input v-model="query.idcCode" clearable style="width: 120px;" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="getList">{{ language == 0 ? '查询' : 'Search' }}</el-button>
</el-form-item>
</el-form>
</div>
<p v-if="noPhotoCanSign == 0" class="text-danger">
{{
language == 0 ? '*完善信息才可报名' : '*Please complete the information before signing up'
}}
</p>
<el-table
ref="allSportmenTable" v-loading="loading" :data="tableData" height="60vh"
>
<el-table-column
:label="language==0?'序号':'Index'" align="center" type="index"
width="70"
/>
<el-table-column v-if="isNational" :label="language==0?'WDSF 会员号':'WDSF MIN'" prop="wdsfMin" width="100" />
<el-table-column
v-if="!isNational" :label="language==0?'姓名':'Real Name'" align="center" min-width="100"
prop="realName"
/>
<el-table-column
v-if="isNational" :label="language==0?'姓氏':'Surname'" align="center" min-width="100"
prop="xing"
/>
<el-table-column v-if="isNational" :label="language==0?'名':'Name'" align="center" min-width="100" prop="ming" />
<el-table-column
v-if="isNational" :label="language==0?'代表':'Representing'" align="center" min-width="120"
prop="representing"
/>
<el-table-column
v-if="!isNational" :label="language==0?'所属国家/地区':'Nationality'" align="center"
min-width="110" prop="countryName"
/>
<el-table-column :label="language==0?'性别':'Gender'" prop="sexStr" />
<el-table-column
v-if="isNational" :label="language==0?'年龄组':'Age group'" align="center" min-width="100"
prop="ageGroup"
/>
<el-table-column
v-if="isNational" :label="language==0?'舞种':'Division'" align="center" min-width="100"
prop="division"
/>
<el-table-column v-if="!isNational" :label="language==0?'年龄':'Age'" prop="age" />
<el-table-column v-if="!isNational" :label="language==0?'出生日期':'Date of Birth'" prop="birth" width="130" />
<el-table-column v-if="!isNational" :label="language==0?'证件类型':'ID Type'" prop="idcTypeStr" width="120" />
<el-table-column v-if="!isNational" :label="language==0?'证件号码':'ID NO.'" prop="idcCode" width="200" />
<el-table-column :label="language==0?'操作':'Actions'" align="center" fixed="right" width="100">
<template #default="scope">
<el-button v-if="scope.row.ocrFlag=='0'" link type="danger" @click="editPerson(scope.row)">
{{ language == 0 ? '完善信息' : 'Complete' }}
</el-button>
<el-button v-else disabled link type="danger">
{{ language == 0 ? '完善信息' : 'Complete' }}
</el-button>
</template>
</el-table-column>
</el-table>
<paginationPc
v-show="total>0"
v-model:limit="query.pageSize"
v-model:page="query.pageNum"
:total="total"
@pagination="getList"
/>
</el-dialog>
<!-- 国内赛运动员-->
<!-- <add-coach ref="dialogAddCoach" @submitForm="getList" />-->
<!-- 国际赛运动员-->
<checkOcr ref="checkOcrRef" @submitForm="getList" />
<Import ref="dialogImportProps" @submitForm="getList" />
</template>
<script setup>
import { reactive, ref, toRefs } from 'vue'
import { getCurrentInstance } from 'vue'
import * as match from '@/apiPc/match'
import checkOcr from '../components/checkOcr'
import Import from '../components/import'
import { useStorage } from '@vueuse/core/index'
import { getPerPersonList } from '@/apiPc/match'
const language = useStorage('language', 0)
const { proxy } = getCurrentInstance()
const data = reactive({
query: {
label: '0',
pageSize: 10,
pageNum: 1
},
tableData: [],
show: false,
loading: false,
title: '运动员',
noPhotoCanSign: 0,
total: 0,
isNational: false
})
const { query, tableData, show, title, loading, noPhotoCanSign, total, isNational } = toRefs(data)
const certificates = ref([
{
value: '0',
label: language.value == 0 ? '居民身份证' : 'Resident ID card'
},
{
value: '1',
label: language.value == 0 ? '护照' : 'Passport'
},
{
value: '2',
label: language.value == 0 ? '其他' : 'Other'
}
])
let groupId
const type = ref('1')
const open = (id, val) => {
show.value = true
query.value.id = id
type.value = val
getList()
}
const getList = async() => {
loading.value = true
let res
if (type.value == 1) {
res = await match.getPerPersonList(query.value, query.value.id)
} else {
res = await match.getGroupPersonList(query.value, query.value.id)
}
tableData.value = res.rows
total.value = res.total
loading.value = false
}
function editPerson(row) {
console.log(isNational.value)
const params = {
id: row.id,
title: language.value == 0 ? '编辑人员' : 'Edit Person',
groupId: groupId,
label: '0'
}
proxy.$refs['checkOcrRef'].open(params)
}
defineExpose({
open
})
</script>
<style lang="scss" scoped>
.el-form--inline .el-form-item {
width: auto;
}
</style>
......@@ -392,6 +392,8 @@
@click="openPickup"
>{{ language == 0 ? '接 / 送机服务' : 'Pick-up/drop-off service' }}</a>
<pickup ref="pickupRef" />
<checkAllSportsman ref="checkAllSportsmanRef" />
</div>
</template>
......@@ -407,6 +409,8 @@ import { getCurrentInstance, ref } from 'vue'
import { reactive, onMounted } from '@vue/runtime-core'
import { useRoute, useRouter } from 'vue-router'
import AffixInvitation from '@/viewsPc/match/components/affix-invitation'
import checkAllSportsman from '@/viewsPc/match/components/checkAllSportsman'
const language = useStorage('language', 0)
const route = useRoute()
......@@ -589,18 +593,7 @@ function goTeamSign() {
return
}
handelPreCheckForGroup(
router.push({
path: `${route.params.id}/teamSignCn`,
query: {
matchId: matchId.value,
groupId: groupId.value,
signType: matchData.value.signType,
languageSource: matchData.value.languageSource,
isNational: false
}
})
)
handelPreCheckForGroup(goTeamSignCn)
} else {
// 国际赛
if (group?.type != '4' && matchData.value.countryLimit == '1') {
......@@ -615,21 +608,36 @@ function goTeamSign() {
)
return
}
handelPreCheckForGroup(
router.push({
path: `${route.params.id}/teamSign`,
query: {
matchId: matchId.value,
groupId: groupId.value,
signType: matchData.value.signType,
isNational: true,
languageSource: matchData.value.languageSource
}
})
)
handelPreCheckForGroup(goTamSign)
}
}
function goTamSign() {
router.push({
path: `${route.params.id}/teamSign`,
query: {
matchId: matchId.value,
groupId: groupId.value,
signType: matchData.value.signType,
isNational: true,
languageSource: matchData.value.languageSource
}
})
}
function goTeamSignCn() {
router.push({
path: `${route.params.id}/teamSignCn`,
query: {
matchId: matchId.value,
groupId: groupId.value,
signType: matchData.value.signType,
languageSource: matchData.value.languageSource,
isNational: false
}
})
}
function goPersonalSign() {
// 选项目
router.push({
......@@ -833,7 +841,8 @@ async function handelGeRenNext() {
}
// 正常报名
if (res.data == 1) {
goPersonalSign()
const flag = await getCheckOcr({ type: '1' })
if (flag) await goPersonalSign()
}
// 提示
if (res.data == 2) {
......@@ -843,7 +852,8 @@ async function handelGeRenNext() {
: 'The athlete`s WDSF membership number has been changed. Should it be updated?'
)
await match.preCheckForPerson({ type: '2' })
await goPersonalSign()
const flag = await getCheckOcr({ type: '1' })
if (flag) await goPersonalSign()
}
}
......@@ -867,7 +877,8 @@ const openPickup = () => {
async function handelPreCheckForGroup(fn) {
const res = await match.preCheckForGroup(groupId.value, '1')
if (res.data == 1 || res.data == 0) {
await fn()
const flag = await getCheckOcr({ type: '2', groupId: groupId.value })
if (flag) await fn()
}
if (res.data == 2) {
await proxy.$modal.confirm(
......@@ -875,9 +886,23 @@ async function handelPreCheckForGroup(fn) {
? '运动员的WDSF会员号已变更,是否更新?'
: 'The athlete`s WDSF membership number has been changed. Should it be updated?')
await match.preCheckForGroup(groupId.value, '2')
await fn()
const flag = await getCheckOcr({ type: '2', groupId: groupId.value })
if (flag) await fn()
}
}
async function getCheckOcr(obj) {
const { data } = await match.checkOcr(obj)
if (!data) {
// 人员ocr未通过
await proxy.$modal.confirm(language.value == 0 ? '请完善人员信息' : 'Please complete the personnel information')
await proxy.$refs['checkAllSportsmanRef'].open(obj.type == 1 ? user.userId : groupId.value, obj.type)
return false
} else {
return true
}
}
</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!