报名校验
Showing
4 changed files
with
254 additions
and
28 deletions
| ... | @@ -815,4 +815,21 @@ export function preCheckForPerson(params) { | ... | @@ -815,4 +815,21 @@ export function preCheckForPerson(params) { |
| 815 | }) | 815 | }) |
| 816 | } | 816 | } |
| 817 | 817 | ||
| 818 | // 人员OCR校验 | ||
| 819 | export function checkOcr(data) { | ||
| 820 | return request({ | ||
| 821 | url: `/systemj/personInfo/checkOcr`, | ||
| 822 | method: 'post', | ||
| 823 | data | ||
| 824 | }) | ||
| 825 | } | ||
| 826 | |||
| 827 | // 修改人员 | ||
| 828 | export function editOcr(data) { | ||
| 829 | return request({ | ||
| 830 | url: `/systemj/personInfo/editOcr`, | ||
| 831 | method: 'post', | ||
| 832 | data | ||
| 833 | }) | ||
| 834 | } | ||
| 818 | 835 | ... | ... |
| 1 | <template> | ||
| 2 | <el-dialog v-model="show" :title="title" append-to-body width="1000px"> | ||
| 3 | |||
| 4 | <div class="from-Card"> | ||
| 5 | <el-form :inline="true" :model="query" class="mt20" label-width="60" size="small"> | ||
| 6 | <el-form-item :label="language==0?'姓名':'Name'"> | ||
| 7 | <el-input v-model="query.realName" clearable style="width: 120px;" /> | ||
| 8 | </el-form-item> | ||
| 9 | <el-form-item v-if="!isNational" :label="language==0?'证件类型':'ID Type'"> | ||
| 10 | <el-select v-model="query.idcType" clearable style="width: 100px;" @change="getList"> | ||
| 11 | <el-option | ||
| 12 | v-for="item in certificates" | ||
| 13 | :key="item.value" | ||
| 14 | :label="item.label" | ||
| 15 | :value="item.value" | ||
| 16 | /> | ||
| 17 | </el-select> | ||
| 18 | </el-form-item> | ||
| 19 | <el-form-item v-if="!isNational" :label="language==0?'证件号码':'ID NO.'"> | ||
| 20 | <el-input v-model="query.idcCode" clearable style="width: 120px;" /> | ||
| 21 | </el-form-item> | ||
| 22 | <el-form-item> | ||
| 23 | <el-button type="primary" @click="getList">{{ language == 0 ? '查询' : 'Search' }}</el-button> | ||
| 24 | </el-form-item> | ||
| 25 | </el-form> | ||
| 26 | </div> | ||
| 27 | <p v-if="noPhotoCanSign == 0" class="text-danger"> | ||
| 28 | {{ | ||
| 29 | language == 0 ? '*完善信息才可报名' : '*Please complete the information before signing up' | ||
| 30 | }} | ||
| 31 | </p> | ||
| 32 | |||
| 33 | <el-table | ||
| 34 | ref="allSportmenTable" v-loading="loading" :data="tableData" height="60vh" | ||
| 35 | > | ||
| 36 | <el-table-column | ||
| 37 | :label="language==0?'序号':'Index'" align="center" type="index" | ||
| 38 | width="70" | ||
| 39 | /> | ||
| 40 | <el-table-column v-if="isNational" :label="language==0?'WDSF 会员号':'WDSF MIN'" prop="wdsfMin" width="100" /> | ||
| 41 | <el-table-column | ||
| 42 | v-if="!isNational" :label="language==0?'姓名':'Real Name'" align="center" min-width="100" | ||
| 43 | prop="realName" | ||
| 44 | /> | ||
| 45 | <el-table-column | ||
| 46 | v-if="isNational" :label="language==0?'姓氏':'Surname'" align="center" min-width="100" | ||
| 47 | prop="xing" | ||
| 48 | /> | ||
| 49 | <el-table-column v-if="isNational" :label="language==0?'名':'Name'" align="center" min-width="100" prop="ming" /> | ||
| 50 | <el-table-column | ||
| 51 | v-if="isNational" :label="language==0?'代表':'Representing'" align="center" min-width="120" | ||
| 52 | prop="representing" | ||
| 53 | /> | ||
| 54 | <el-table-column | ||
| 55 | v-if="!isNational" :label="language==0?'所属国家/地区':'Nationality'" align="center" | ||
| 56 | min-width="110" prop="countryName" | ||
| 57 | /> | ||
| 58 | <el-table-column :label="language==0?'性别':'Gender'" prop="sexStr" /> | ||
| 59 | <el-table-column | ||
| 60 | v-if="isNational" :label="language==0?'年龄组':'Age group'" align="center" min-width="100" | ||
| 61 | prop="ageGroup" | ||
| 62 | /> | ||
| 63 | <el-table-column | ||
| 64 | v-if="isNational" :label="language==0?'舞种':'Division'" align="center" min-width="100" | ||
| 65 | prop="division" | ||
| 66 | /> | ||
| 67 | <el-table-column v-if="!isNational" :label="language==0?'年龄':'Age'" prop="age" /> | ||
| 68 | <el-table-column v-if="!isNational" :label="language==0?'出生日期':'Date of Birth'" prop="birth" width="130" /> | ||
| 69 | <el-table-column v-if="!isNational" :label="language==0?'证件类型':'ID Type'" prop="idcTypeStr" width="120" /> | ||
| 70 | <el-table-column v-if="!isNational" :label="language==0?'证件号码':'ID NO.'" prop="idcCode" width="200" /> | ||
| 71 | <el-table-column :label="language==0?'操作':'Actions'" align="center" fixed="right" width="100"> | ||
| 72 | <template #default="scope"> | ||
| 73 | <el-button v-if="scope.row.ocrFlag=='0'" link type="danger" @click="editPerson(scope.row)"> | ||
| 74 | {{ language == 0 ? '完善信息' : 'Complete' }} | ||
| 75 | </el-button> | ||
| 76 | <el-button v-else disabled link type="danger"> | ||
| 77 | {{ language == 0 ? '完善信息' : 'Complete' }} | ||
| 78 | </el-button> | ||
| 79 | </template> | ||
| 80 | </el-table-column> | ||
| 81 | </el-table> | ||
| 82 | |||
| 83 | <paginationPc | ||
| 84 | v-show="total>0" | ||
| 85 | v-model:limit="query.pageSize" | ||
| 86 | v-model:page="query.pageNum" | ||
| 87 | :total="total" | ||
| 88 | @pagination="getList" | ||
| 89 | /> | ||
| 90 | </el-dialog> | ||
| 91 | |||
| 92 | <!-- 国内赛运动员--> | ||
| 93 | <!-- <add-coach ref="dialogAddCoach" @submitForm="getList" />--> | ||
| 94 | <!-- 国际赛运动员--> | ||
| 95 | <checkOcr ref="checkOcrRef" @submitForm="getList" /> | ||
| 96 | <Import ref="dialogImportProps" @submitForm="getList" /> | ||
| 97 | </template> | ||
| 98 | |||
| 99 | <script setup> | ||
| 100 | import { reactive, ref, toRefs } from 'vue' | ||
| 101 | import { getCurrentInstance } from 'vue' | ||
| 102 | import * as match from '@/apiPc/match' | ||
| 103 | import checkOcr from '../components/checkOcr' | ||
| 104 | import Import from '../components/import' | ||
| 105 | import { useStorage } from '@vueuse/core/index' | ||
| 106 | import { getPerPersonList } from '@/apiPc/match' | ||
| 107 | |||
| 108 | const language = useStorage('language', 0) | ||
| 109 | const { proxy } = getCurrentInstance() | ||
| 110 | const data = reactive({ | ||
| 111 | query: { | ||
| 112 | label: '0', | ||
| 113 | pageSize: 10, | ||
| 114 | pageNum: 1 | ||
| 115 | }, | ||
| 116 | tableData: [], | ||
| 117 | show: false, | ||
| 118 | loading: false, | ||
| 119 | title: '运动员', | ||
| 120 | noPhotoCanSign: 0, | ||
| 121 | total: 0, | ||
| 122 | isNational: false | ||
| 123 | }) | ||
| 124 | const { query, tableData, show, title, loading, noPhotoCanSign, total, isNational } = toRefs(data) | ||
| 125 | |||
| 126 | const certificates = ref([ | ||
| 127 | { | ||
| 128 | value: '0', | ||
| 129 | label: language.value == 0 ? '居民身份证' : 'Resident ID card' | ||
| 130 | }, | ||
| 131 | { | ||
| 132 | value: '1', | ||
| 133 | label: language.value == 0 ? '护照' : 'Passport' | ||
| 134 | }, | ||
| 135 | { | ||
| 136 | value: '2', | ||
| 137 | label: language.value == 0 ? '其他' : 'Other' | ||
| 138 | } | ||
| 139 | ]) | ||
| 140 | let groupId | ||
| 141 | const type = ref('1') | ||
| 142 | |||
| 143 | |||
| 144 | const open = (id, val) => { | ||
| 145 | show.value = true | ||
| 146 | query.value.id = id | ||
| 147 | type.value = val | ||
| 148 | getList() | ||
| 149 | } | ||
| 150 | |||
| 151 | const getList = async() => { | ||
| 152 | loading.value = true | ||
| 153 | let res | ||
| 154 | if (type.value == 1) { | ||
| 155 | res = await match.getPerPersonList(query.value, query.value.id) | ||
| 156 | } else { | ||
| 157 | res = await match.getGroupPersonList(query.value, query.value.id) | ||
| 158 | } | ||
| 159 | |||
| 160 | tableData.value = res.rows | ||
| 161 | total.value = res.total | ||
| 162 | loading.value = false | ||
| 163 | } | ||
| 164 | |||
| 165 | function editPerson(row) { | ||
| 166 | console.log(isNational.value) | ||
| 167 | const params = { | ||
| 168 | id: row.id, | ||
| 169 | title: language.value == 0 ? '编辑人员' : 'Edit Person', | ||
| 170 | groupId: groupId, | ||
| 171 | label: '0' | ||
| 172 | } | ||
| 173 | proxy.$refs['checkOcrRef'].open(params) | ||
| 174 | } | ||
| 175 | |||
| 176 | defineExpose({ | ||
| 177 | open | ||
| 178 | }) | ||
| 179 | </script> | ||
| 180 | <style lang="scss" scoped> | ||
| 181 | .el-form--inline .el-form-item { | ||
| 182 | width: auto; | ||
| 183 | } | ||
| 184 | </style> |
src/viewsPc/match/components/checkOcr.vue
0 → 100644
This diff is collapsed.
Click to expand it.
| ... | @@ -392,6 +392,8 @@ | ... | @@ -392,6 +392,8 @@ |
| 392 | @click="openPickup" | 392 | @click="openPickup" |
| 393 | >{{ language == 0 ? '接 / 送机服务' : 'Pick-up/drop-off service' }}</a> | 393 | >{{ language == 0 ? '接 / 送机服务' : 'Pick-up/drop-off service' }}</a> |
| 394 | <pickup ref="pickupRef" /> | 394 | <pickup ref="pickupRef" /> |
| 395 | |||
| 396 | <checkAllSportsman ref="checkAllSportsmanRef" /> | ||
| 395 | </div> | 397 | </div> |
| 396 | </template> | 398 | </template> |
| 397 | 399 | ||
| ... | @@ -407,6 +409,8 @@ import { getCurrentInstance, ref } from 'vue' | ... | @@ -407,6 +409,8 @@ import { getCurrentInstance, ref } from 'vue' |
| 407 | import { reactive, onMounted } from '@vue/runtime-core' | 409 | import { reactive, onMounted } from '@vue/runtime-core' |
| 408 | import { useRoute, useRouter } from 'vue-router' | 410 | import { useRoute, useRouter } from 'vue-router' |
| 409 | import AffixInvitation from '@/viewsPc/match/components/affix-invitation' | 411 | import AffixInvitation from '@/viewsPc/match/components/affix-invitation' |
| 412 | import checkAllSportsman from '@/viewsPc/match/components/checkAllSportsman' | ||
| 413 | |||
| 410 | 414 | ||
| 411 | const language = useStorage('language', 0) | 415 | const language = useStorage('language', 0) |
| 412 | const route = useRoute() | 416 | const route = useRoute() |
| ... | @@ -589,18 +593,7 @@ function goTeamSign() { | ... | @@ -589,18 +593,7 @@ function goTeamSign() { |
| 589 | return | 593 | return |
| 590 | } | 594 | } |
| 591 | 595 | ||
| 592 | handelPreCheckForGroup( | 596 | handelPreCheckForGroup(goTeamSignCn) |
| 593 | router.push({ | ||
| 594 | path: `${route.params.id}/teamSignCn`, | ||
| 595 | query: { | ||
| 596 | matchId: matchId.value, | ||
| 597 | groupId: groupId.value, | ||
| 598 | signType: matchData.value.signType, | ||
| 599 | languageSource: matchData.value.languageSource, | ||
| 600 | isNational: false | ||
| 601 | } | ||
| 602 | }) | ||
| 603 | ) | ||
| 604 | } else { | 597 | } else { |
| 605 | // 国际赛 | 598 | // 国际赛 |
| 606 | if (group?.type != '4' && matchData.value.countryLimit == '1') { | 599 | if (group?.type != '4' && matchData.value.countryLimit == '1') { |
| ... | @@ -615,21 +608,36 @@ function goTeamSign() { | ... | @@ -615,21 +608,36 @@ function goTeamSign() { |
| 615 | ) | 608 | ) |
| 616 | return | 609 | return |
| 617 | } | 610 | } |
| 618 | handelPreCheckForGroup( | 611 | handelPreCheckForGroup(goTamSign) |
| 619 | router.push({ | ||
| 620 | path: `${route.params.id}/teamSign`, | ||
| 621 | query: { | ||
| 622 | matchId: matchId.value, | ||
| 623 | groupId: groupId.value, | ||
| 624 | signType: matchData.value.signType, | ||
| 625 | isNational: true, | ||
| 626 | languageSource: matchData.value.languageSource | ||
| 627 | } | ||
| 628 | }) | ||
| 629 | ) | ||
| 630 | } | 612 | } |
| 631 | } | 613 | } |
| 632 | 614 | ||
| 615 | function goTamSign() { | ||
| 616 | router.push({ | ||
| 617 | path: `${route.params.id}/teamSign`, | ||
| 618 | query: { | ||
| 619 | matchId: matchId.value, | ||
| 620 | groupId: groupId.value, | ||
| 621 | signType: matchData.value.signType, | ||
| 622 | isNational: true, | ||
| 623 | languageSource: matchData.value.languageSource | ||
| 624 | } | ||
| 625 | }) | ||
| 626 | } | ||
| 627 | |||
| 628 | function goTeamSignCn() { | ||
| 629 | router.push({ | ||
| 630 | path: `${route.params.id}/teamSignCn`, | ||
| 631 | query: { | ||
| 632 | matchId: matchId.value, | ||
| 633 | groupId: groupId.value, | ||
| 634 | signType: matchData.value.signType, | ||
| 635 | languageSource: matchData.value.languageSource, | ||
| 636 | isNational: false | ||
| 637 | } | ||
| 638 | }) | ||
| 639 | } | ||
| 640 | |||
| 633 | function goPersonalSign() { | 641 | function goPersonalSign() { |
| 634 | // 选项目 | 642 | // 选项目 |
| 635 | router.push({ | 643 | router.push({ |
| ... | @@ -833,7 +841,8 @@ async function handelGeRenNext() { | ... | @@ -833,7 +841,8 @@ async function handelGeRenNext() { |
| 833 | } | 841 | } |
| 834 | // 正常报名 | 842 | // 正常报名 |
| 835 | if (res.data == 1) { | 843 | if (res.data == 1) { |
| 836 | goPersonalSign() | 844 | const flag = await getCheckOcr({ type: '1' }) |
| 845 | if (flag) await goPersonalSign() | ||
| 837 | } | 846 | } |
| 838 | // 提示 | 847 | // 提示 |
| 839 | if (res.data == 2) { | 848 | if (res.data == 2) { |
| ... | @@ -843,7 +852,8 @@ async function handelGeRenNext() { | ... | @@ -843,7 +852,8 @@ async function handelGeRenNext() { |
| 843 | : 'The athlete`s WDSF membership number has been changed. Should it be updated?' | 852 | : 'The athlete`s WDSF membership number has been changed. Should it be updated?' |
| 844 | ) | 853 | ) |
| 845 | await match.preCheckForPerson({ type: '2' }) | 854 | await match.preCheckForPerson({ type: '2' }) |
| 846 | await goPersonalSign() | 855 | const flag = await getCheckOcr({ type: '1' }) |
| 856 | if (flag) await goPersonalSign() | ||
| 847 | } | 857 | } |
| 848 | } | 858 | } |
| 849 | 859 | ||
| ... | @@ -867,7 +877,8 @@ const openPickup = () => { | ... | @@ -867,7 +877,8 @@ const openPickup = () => { |
| 867 | async function handelPreCheckForGroup(fn) { | 877 | async function handelPreCheckForGroup(fn) { |
| 868 | const res = await match.preCheckForGroup(groupId.value, '1') | 878 | const res = await match.preCheckForGroup(groupId.value, '1') |
| 869 | if (res.data == 1 || res.data == 0) { | 879 | if (res.data == 1 || res.data == 0) { |
| 870 | await fn() | 880 | const flag = await getCheckOcr({ type: '2', groupId: groupId.value }) |
| 881 | if (flag) await fn() | ||
| 871 | } | 882 | } |
| 872 | if (res.data == 2) { | 883 | if (res.data == 2) { |
| 873 | await proxy.$modal.confirm( | 884 | await proxy.$modal.confirm( |
| ... | @@ -875,9 +886,23 @@ async function handelPreCheckForGroup(fn) { | ... | @@ -875,9 +886,23 @@ async function handelPreCheckForGroup(fn) { |
| 875 | ? '运动员的WDSF会员号已变更,是否更新?' | 886 | ? '运动员的WDSF会员号已变更,是否更新?' |
| 876 | : 'The athlete`s WDSF membership number has been changed. Should it be updated?') | 887 | : 'The athlete`s WDSF membership number has been changed. Should it be updated?') |
| 877 | await match.preCheckForGroup(groupId.value, '2') | 888 | await match.preCheckForGroup(groupId.value, '2') |
| 878 | await fn() | 889 | const flag = await getCheckOcr({ type: '2', groupId: groupId.value }) |
| 890 | if (flag) await fn() | ||
| 879 | } | 891 | } |
| 880 | } | 892 | } |
| 893 | |||
| 894 | async function getCheckOcr(obj) { | ||
| 895 | const { data } = await match.checkOcr(obj) | ||
| 896 | if (!data) { | ||
| 897 | // 人员ocr未通过 | ||
| 898 | await proxy.$modal.confirm(language.value == 0 ? '请完善人员信息' : 'Please complete the personnel information') | ||
| 899 | await proxy.$refs['checkAllSportsmanRef'].open(obj.type == 1 ? user.userId : groupId.value, obj.type) | ||
| 900 | return false | ||
| 901 | } else { | ||
| 902 | return true | ||
| 903 | } | ||
| 904 | } | ||
| 905 | |||
| 881 | </script> | 906 | </script> |
| 882 | 907 | ||
| 883 | <style lang="scss" scoped> | 908 | <style lang="scss" scoped> | ... | ... |
-
Please register or sign in to post a comment