abf5e3a4 by 杨炀

no message

1 parent 12a5d160
1 <template>
2 <!-- <el-config-provider :locale="locale">-->
3 <router-view />
4 <!-- </el-config-provider>-->
5
6 <reset-pwd ref="resetPwdRef" />
7 </template>
8
9 <script setup>
10 import useSettingsStore from '@/store/modules/settings'
11 import { handleThemeStyle } from '@/utils/theme'
12 import { nextTick, onMounted, watch } from 'vue'
13 import useUserStore from '@/store/modules/user'
14 import ResetPwd from '@/views/system/user/profile/components/resetPwd'
15 import { getCurrentInstance } from '@vue/runtime-core'
16 // import { ElConfigProvider } from 'element-plus'
17 // import locale from 'element-plus/lib/locale/lang/zh-cn'
18
19 const userStore = useUserStore()
20 const { proxy } = getCurrentInstance()
21
22 onMounted(() => {
23 document.body.style.setProperty('--el-color-primary', '#453DEA')
24 // 鼠标移动到按钮上方时显示的颜色,默认蓝色,可以和primary设置的颜色不一样
25 document.body.style.setProperty('--el-color-primary-light-3', '#8623FC')
26
27 document.body.style.setProperty('--el-color-success', '#29c490')
28 document.body.style.setProperty('--el-color-success-light-3', '#54d0a6')
29 // danger
30 document.body.style.setProperty('--el-color-danger', '#d51515')
31 document.body.style.setProperty('--el-color-danger-light-3', '#d44')
32 // warning
33 document.body.style.setProperty('--el-color-warning', '#e6a23c')
34 document.body.style.setProperty('--el-color-warning-light-3', '#ebb563')
35
36 nextTick(() => {
37 // 初始化主题样式
38 handleThemeStyle(useSettingsStore().theme)
39 })
40 })
41
42 watch(() => userStore.user?.changePassFlag, (val) => {
43 if (val === '1') {
44 proxy.$modal.confirm('密码长期未更新,请及时更新').then(() => {
45 proxy.$refs['resetPwdRef'].open()
46 })
47 }
48 })
49
50 </script>
51 <style lang="scss">
52 .app-container{
53 background-color: #F5F7F9;
54 padding:20px;
55 min-height: calc(100vh - 85px);
56 }
57
58 /* 搜索栏 */
59 .from-Card{
60 background-color: #fff;
61 padding: 20px;
62 }
63 .btn-card{
64 padding: 20px;
65 background: #fff;
66 border-radius: 10px;
67
68 }
69 /* 表格 */
70 .table{
71 background-color: #fff;
72 padding:0 20px 10px;
73 position: relative;
74
75 }
76
77 .box{
78 background: #fff;
79 border-radius: 5px;
80 padding: 10px;
81 }
82
83 /* 分页 */
84 .foot{
85 background-color: #fff;
86 height: 50px;
87 }
88
89
90 .btn-top{
91 margin-top: 10px;
92 }
93 .el-table{
94 background: url("@/assets/admin/tableBg.png") #F5FBFE no-repeat top;
95 background-color:#F5FBFE!important;
96 background-size: 750px;
97 --el-bg-color:#F5FBFE;
98 --el-table-border-color:#e1e4ec;
99 --el-fill-color-blank:transparent;
100 --el-fill-color-light:#fff;
101 }
102
103 // 审核通过添加背景色
104 .success-row{
105 --el-table-tr-bg-color: rgba(41, 196, 144,.15);
106 }
107
108 .totalCost{
109 font-weight: 700;
110 font-size: 16px;
111 margin-top: 10px;
112 position: absolute;
113 bottom: 30px;
114 left: 20px;
115 z-index: 999;
116
117 span{
118 color: orange;
119 margin-right: 20px;
120 }
121
122 }
123
124 // 禁选背景色
125 .disabled-row{
126 --el-table-tr-bg-color: rgba(36, 37, 37,0.1);
127 }
128 </style>
1 import { createApp } from 'vue'
2
3 import Cookies from 'js-cookie'
4
5 import ElementPlus from 'element-plus'
6 import locale from 'element-plus/lib/locale/lang/zh-cn' // 中文语言
7
8 import '@/assets/styles/index.scss' // global css
9 import App from './App'
10 import store from './store'
11 import router from './router'
12 import directive from './directive' // directive
13
14 // 注册指令
15 import plugins from './plugins' // plugins
16 import { download } from '@/utils/request'
17
18 // svg图标
19 import 'virtual:svg-icons-register'
20 import SvgIcon from '@/components/SvgIcon'
21 import elementIcons from '@/components/SvgIcon/svgicon'
22
23 import './permission' // permission control
24
25 import { useDict } from '@/utils/dict'
26 import { getConfigKey, updateConfigByKey } from '@/api/system/config'
27 import {
28 parseTime,
29 resetForm,
30 addDateRange,
31 handleTree,
32 selectDictLabel,
33 selectDictLabels,
34 fillImgUrl
35 } from '@/utils/ruoyi'
36
37 import VueUeditorWrap from 'vue-ueditor-wrap'
38
39 // 分页组件
40 import Pagination from '@/components/Pagination'
41 // 自定义表格工具组件
42 import RightToolbar from '@/components/RightToolbar'
43 // 富文本组件
44 import Editor from '@/components/Editor'
45 import UEditor from '@/components/UEditor'
46 // 文件上传组件
47 import FileUpload from '@/components/FileUpload'
48 // 图片上传组件
49 import ImageUpload from '@/components/ImageUpload'
50 import ImageUpload2 from '@/components/ImageUpload/index2'
51 // 图片预览组件
52 import ImagePreview from '@/components/ImagePreview'
53 // 自定义树选择组件
54 import TreeSelect from '@/components/TreeSelect'
55 // 字典标签组件
56 import DictTag from '@/components/DictTag'
57
58 import draggable from 'vuedraggable'
59
60 const app = createApp(App)
61
62 // 全局方法挂载
63 app.config.globalProperties.useDict = useDict
64 app.config.globalProperties.getConfigKey = getConfigKey
65 app.config.globalProperties.updateConfigByKey = updateConfigByKey
66 app.config.globalProperties.download = download
67 app.config.globalProperties.parseTime = parseTime
68 app.config.globalProperties.resetForm = resetForm
69 app.config.globalProperties.handleTree = handleTree
70 app.config.globalProperties.addDateRange = addDateRange
71 app.config.globalProperties.selectDictLabel = selectDictLabel
72 app.config.globalProperties.selectDictLabels = selectDictLabels
73 app.config.globalProperties.fillImgUrl = fillImgUrl
74
75 // 全局组件挂载
76 app.component('DictTag', DictTag)
77 app.component('Pagination', Pagination)
78 app.component('TreeSelect', TreeSelect)
79 app.component('FileUpload', FileUpload)
80 app.component('ImageUpload', ImageUpload)
81 app.component('ImageUpload2', ImageUpload2)
82 app.component('ImagePreview', ImagePreview)
83 app.component('RightToolbar', RightToolbar)
84 app.component('Editor', Editor)
85 app.component('UEditor', UEditor)
86 app.component('Draggable', draggable)
87
88 app.use(router)
89 app.use(store)
90 app.use(VueUeditorWrap)
91 app.use(plugins)
92 app.use(elementIcons)
93 app.component('SvgIcon', SvgIcon)
94
95 directive(app)
96
97 // 使用element-plus 并且设置全局的大小
98 app.use(ElementPlus, {
99 locale: locale,
100 // 支持 large、default、small
101 size: Cookies.get('size') || 'default'
102 })
103
104 // 修改 el-dialog 默认点击遮照为不关闭
105 app._context.components.ElDialog.props.closeOnClickModal.default = false
106
107 app.mount('#app')
108
109 if (process.env.NODE_ENV !== 'development') {
110 // disorderCopy()
111 }
...@@ -518,12 +518,6 @@ export const constantRoutes = [ ...@@ -518,12 +518,6 @@ export const constantRoutes = [
518 meta: { title: '缴费清单' } 518 meta: { title: '缴费清单' }
519 }, 519 },
520 { 520 {
521 path: 'list/:id/singleSign',
522 component: () => import('@/viewsPc/match/singleSign'),
523 name: 'singleSign',
524 meta: { title: '个人报名' }
525 },
526 {
527 path: 'list/:id/teamSign', 521 path: 'list/:id/teamSign',
528 component: () => import('@/viewsPc/match/teamSign'), 522 component: () => import('@/viewsPc/match/teamSign'),
529 name: 'teamSign', 523 name: 'teamSign',
......
...@@ -423,12 +423,6 @@ export const constantRoutes = [ ...@@ -423,12 +423,6 @@ export const constantRoutes = [
423 meta: { title: '缴费清单' } 423 meta: { title: '缴费清单' }
424 }, 424 },
425 { 425 {
426 path: 'list/:id/singleSign',
427 component: () => import('@/viewsPc/match/singleSign'),
428 name: 'singleSign',
429 meta: { title: '个人报名' }
430 },
431 {
432 path: 'list/:id/teamSign', 426 path: 'list/:id/teamSign',
433 component: () => import('@/viewsPc/match/teamSign'), 427 component: () => import('@/viewsPc/match/teamSign'),
434 name: 'teamSign', 428 name: 'teamSign',
......
...@@ -410,12 +410,6 @@ export const constantRoutes = [ ...@@ -410,12 +410,6 @@ export const constantRoutes = [
410 meta: { title: '赛事详情' } 410 meta: { title: '赛事详情' }
411 }, 411 },
412 { 412 {
413 path: 'list/:id/singleSign',
414 component: () => import('@/viewsPc/match/singleSign'),
415 name: 'singleSign',
416 meta: { title: '个人报名' }
417 },
418 {
419 path: 'list/:id/teamSign', 413 path: 'list/:id/teamSign',
420 component: () => import('@/viewsPc/match/teamSign'), 414 component: () => import('@/viewsPc/match/teamSign'),
421 name: 'teamSign', 415 name: 'teamSign',
......
...@@ -181,7 +181,6 @@ ...@@ -181,7 +181,6 @@
181 181
182 <dialogEditWdsf ref="dialogEditWdsfRef" @submitForm="changeMeDone"/> 182 <dialogEditWdsf ref="dialogEditWdsfRef" @submitForm="changeMeDone"/>
183 <dialogEditAccompany ref="dialogEditAccompanyRef" @submitForm="getMyMemberTable"/> 183 <dialogEditAccompany ref="dialogEditAccompanyRef" @submitForm="getMyMemberTable"/>
184 <!-- <dialogChangeCoach ref="popChangeCoach" @submitForm="getMySignInfo"/>-->
185 <dialogExtraForm ref="popExtraForm" @submitForm="getSignInfoList"/> 184 <dialogExtraForm ref="popExtraForm" @submitForm="getSignInfoList"/>
186 </div> 185 </div>
187 </template> 186 </template>
...@@ -192,9 +191,7 @@ import * as match from '@/apiPc/match' ...@@ -192,9 +191,7 @@ import * as match from '@/apiPc/match'
192 import {getCurrentInstance, onMounted} from '@vue/runtime-core' 191 import {getCurrentInstance, onMounted} from '@vue/runtime-core'
193 import dialogEditWdsf from './components/addWdsf' 192 import dialogEditWdsf from './components/addWdsf'
194 import dialogEditAccompany from './components/addAccompany' 193 import dialogEditAccompany from './components/addAccompany'
195 import dialogSportsmanList from './components/sportsmanList'
196 import dialogAllSportsmanList from './components/allSportsmanList' 194 import dialogAllSportsmanList from './components/allSportsmanList'
197 import dialogChangeCoach from './components/changeCoach'
198 import dialogExtraForm from './components/extraForm' 195 import dialogExtraForm from './components/extraForm'
199 import dialogMates from './components/dialogMates' 196 import dialogMates from './components/dialogMates'
200 import {Search, Switch} from "@element-plus/icons-vue"; 197 import {Search, Switch} from "@element-plus/icons-vue";
......
...@@ -137,7 +137,6 @@ ...@@ -137,7 +137,6 @@
137 </div> 137 </div>
138 138
139 <dialogAddCoach ref="dialogAddCoachRef"/> 139 <dialogAddCoach ref="dialogAddCoachRef"/>
140 <dialogSportsmanList ref="dialogSportsmanListRef" @submitForm="getSignInfoList"/>
141 <dialogAllSportsmanList ref="dialogAllSportsmanListRef" @transfer="getChoosed" @submitForm="getSignInfoList"/> 140 <dialogAllSportsmanList ref="dialogAllSportsmanListRef" @transfer="getChoosed" @submitForm="getSignInfoList"/>
142 141
143 <dialogMates ref="dialogMatesRef" @submitForm="getSignInfoList"/> 142 <dialogMates ref="dialogMatesRef" @submitForm="getSignInfoList"/>
...@@ -153,9 +152,6 @@ ...@@ -153,9 +152,6 @@
153 </el-result> 152 </el-result>
154 153
155 </el-dialog> 154 </el-dialog>
156
157 <!-- <dialogChangeCoach ref="popChangeCoach" @submitForm="getMySignInfo"/>-->
158
159 <dialogExtraForm ref="popExtraForm" @submitForm="getSignInfoList"/> 155 <dialogExtraForm ref="popExtraForm" @submitForm="getSignInfoList"/>
160 </div> 156 </div>
161 </template> 157 </template>
...@@ -165,10 +161,8 @@ import {ref, reactive, toRefs} from 'vue' ...@@ -165,10 +161,8 @@ import {ref, reactive, toRefs} from 'vue'
165 import * as match from '@/apiPc/match' 161 import * as match from '@/apiPc/match'
166 import {getCurrentInstance, onMounted} from '@vue/runtime-core' 162 import {getCurrentInstance, onMounted} from '@vue/runtime-core'
167 import dialogAddCoach from './components/addCoach' 163 import dialogAddCoach from './components/addCoach'
168 import dialogSportsmanList from './components/sportsmanList'
169 import dialogAllSportsmanList from './components/allSportsmanList' 164 import dialogAllSportsmanList from './components/allSportsmanList'
170 import dialogImport from './components/import' 165 import dialogImport from './components/import'
171 import dialogChangeCoach from './components/changeCoach'
172 import dialogExtraForm from './components/extraForm' 166 import dialogExtraForm from './components/extraForm'
173 import dialogMates from './components/dialogMates' 167 import dialogMates from './components/dialogMates'
174 import {Search, Switch} from "@element-plus/icons-vue"; 168 import {Search, Switch} from "@element-plus/icons-vue";
...@@ -472,19 +466,6 @@ function delchoosedchoosed() { ...@@ -472,19 +466,6 @@ function delchoosedchoosed() {
472 choosedchoosed.value = [] 466 choosedchoosed.value = []
473 } 467 }
474 468
475 function editThis(row) {
476 const params = {
477 title: '修改报项',
478 personal: row.cptPersonInfo,
479 matchId: matchId.value,
480 groupId: groupId.value,
481 rankId: activeTeam.value,
482 signType: signType.value,
483 noPhotoCanSign: noPhotoCanSign.value,
484 coachOrLeaderFlag: coachOrLeaderFlag.value
485 }
486 proxy.$refs['dialogSportsmanListRef'].open(params)
487 }
488 469
489 function editMates(row) { 470 function editMates(row) {
490 const params = { 471 const params = {
......
1 <template>
2 <div class="app-container">
3 <div class="box ph-30">
4 <div class="panel">
5 <div class="panel-header">
6 <h3 class="panel-title">选择运动员</h3>
7 </div>
8 <div class="panel-body">
9 <div class="text-right mb20">
10 <el-button type="success" @click="chooseSportman">选择参赛运动员</el-button>
11 <el-button type="success" @click="importSportman">批量导入人员</el-button>
12 <el-button type="success" @click="addCoach">新增运动员</el-button>
13 </div>
14
15 <el-tabs
16 v-if="signType=='2'"
17 v-model="activeTeam"
18 type="card"
19 class="demo-tabs"
20 @tab-click="teamClick"
21 >
22 <el-tab-pane v-for="t in teamList" :key="t.id" :label="t.name" :name="t.id" />
23 </el-tabs>
24 <!-- 已选运动员列表-->
25 <div class="hasChoose">
26 <el-button v-for="p in choosedList" plain type="primary" @click="signForThisMan(p)">
27 {{ p.realName }}
28 <span v-if="p.sex=='1'">(男)</span>
29 <span v-if="p.sex=='0'">(女)</span>
30 </el-button>
31 </div>
32 <el-table :data="signInfoTable" style="width: 100%">
33 <el-table-column type="expand" align="center">
34 <template #default="props">
35 <el-table :data="props.row.signInfo" border>
36 <el-table-column label="序号" width="80px" type="index" align="center" />
37 <el-table-column label="报项">
38 <template #default="scope">
39 {{ scope.row.cptProjectName }}
40 {{ scope.row.cptGroupName }}{{ scope.row.cptLevelName }}{{ scope.row.cptSonLevelName }}
41 {{ scope.row.zu }}
42 </template>
43 </el-table-column>
44
45 <el-table-column v-if="coachOrLeaderFlag=='1'" label="教练" prop="coachNames" />
46 <el-table-column v-if="coachOrLeaderFlag=='1'" label="领队" prop="leaderNames" />
47 <el-table-column label="操作" fixed="right" width="100" align="center">
48 <template #default="scope">
49 <el-button type="primary" link @click="editThis(scope.row)">编辑</el-button>
50 <el-button type="primary" link @click="removeThis(scope.row.id)">删除</el-button>
51 </template>
52 </el-table-column>
53 </el-table>
54 </template>
55 </el-table-column>
56 <el-table-column label="运动员" min-width="120px">
57 <template #default="scope">
58 <div style="display: flex;align-items: center;">
59 <el-image v-if="scope.row.personInfo.picUrl" style="width: 50px; height: 50px" fit="contain" :src="scope.row.personInfo.picUrl" />
60 <p class="ml10">{{ scope.row.personInfo.realName }}({{ scope.row.personInfo.sexStr }})</p>
61 </div>
62 </template>
63 </el-table-column>
64 <el-table-column label="参赛队">
65 <template #default="scope">
66 {{ scope.row.signInfo[0]?.groupName }}
67 </template>
68 </el-table-column>
69 <el-table-column v-if="signType=='2'" label="队伍">
70 <template #default="scope">
71 {{ scope.row.signInfo[0]?.teamName }}
72 </template>
73 </el-table-column>
74 <el-table-column label="证件号" min-width="140px">
75 <template #default="scope">
76 {{ scope.row.personInfo?.idcTypeStr }}
77 <div>{{ scope.row.personInfo?.idcCode }}</div>
78 </template>
79 </el-table-column>
80 <el-table-column label="出生日期" min-width="100px" prop="personInfo.birth" />
81 <el-table-column label="国籍">
82 <template #default="scope">
83 {{ scope.row.personInfo?.countryName }}
84 </template>
85 </el-table-column>
86 <el-table-column label="民族" prop="personInfo.nation" />
87
88 <el-table-column label="联系方式" min-width="100px">
89 <template #default="scope">
90 {{ scope.row.personInfo?.phone }}
91 </template>
92 </el-table-column>
93
94 <!-- 补充信息-->
95 <el-table-column v-for="(e,index) in extraTableHead" :key="index" :label="e">
96 <template #default="scope">
97 <el-link v-if="scope.row.signInfo[0].extraPersonInfoMapList[index]?.type=='2'" :herf="scope.row.signInfo[0].extraPersonInfoMapList[index].value.url">
98 {{ scope.row.signInfo[0].extraPersonInfoMapList[index].value.name }}
99 </el-link>
100 <img v-else-if="scope.row.signInfo[0].extraPersonInfoMapList[index]?.type=='3'" style="width: 50px;" :src="scope.row.signInfo[0].extraPersonInfoMapList[index].value.url||scope.row.signInfo[0].extraPersonInfoMapList[index].value">
101 <span v-else>{{ scope.row.signInfo[0].extraPersonInfoMapList[index]?.value }}</span>
102 </template>
103 </el-table-column>
104 <el-table-column label="操作" fixed="right" width="150" align="center">
105 <template #default="scope">
106 <el-button v-if="extraform&&extraform.length>0" type="text" @click="goPersonInfo(scope.row)">
107 <span v-if="scope.row.extraPersonInfo">修改</span>
108 <span v-else class="red">完善补充信息</span>
109 </el-button>
110 </template>
111 </el-table-column>
112 </el-table>
113
114 </div>
115 <div class="panel-footer text-center">
116 <el-button type="success" plain round @click="goPrev()">上一步</el-button>
117 <el-button type="success" round @click="submitForm()">下一步</el-button>
118 </div>
119 </div>
120 </div>
121
122 <dialogAddCoach ref="dialogAddCoachRef" />
123 <dialogSportsmanList ref="dialogSportsmanListRef" @submitForm="getSignInfoList" />
124 <dialogAllSportsmanList ref="dialogAllSportsmanListRef" @transfer="getChoosed" @submitForm="getSignInfoList" />
125
126 <dialogImport ref="dialogImportProps" @submitForm="getMySignInfo" />
127
128 <el-dialog v-model="showResult" :close-on-click-modal="false" :show-close="false">
129 <el-result icon="success" title="报名成功">
130 <template #extra>
131 <el-button type="primary" @click="downloadVoucher">下载凭证</el-button>
132 <el-button type="primary" @click="goMySign">查看报项</el-button>
133 </template>
134 </el-result>
135
136 </el-dialog>
137
138 <dialogChangeCoach ref="popChangeCoach" @submitForm="getMySignInfo" />
139
140 <dialogExtraForm ref="popExtraForm" @submitForm="getSignInfoList" />
141 </div>
142 </template>
143
144 <script setup>
145 import { ref, reactive } from 'vue'
146 import * as match from '@/apiPc/match'
147 import { getCurrentInstance, onMounted } from '@vue/runtime-core'
148 import dialogAddCoach from './components/addCoach'
149 import dialogSportsmanList from './components/sportsmanList'
150 import dialogAllSportsmanList from './components/allSportsmanList'
151 import dialogImport from './components/import'
152 import dialogChangeCoach from './components/changeCoach'
153 import dialogExtraForm from './components/extraForm'
154 const { proxy } = getCurrentInstance()
155 const router = useRouter()
156 const route = useRoute()
157 import _ from 'lodash'
158 import { ElMessage, ElMessageBox } from 'element-plus'
159 const data = reactive({
160 coachForm: {},
161 tableData: [], signInfoTable: [], choosedList: [],
162 extraPersonInfoMapList: [],
163 teamList: [],
164 extraform: [],
165 groupId: '0',
166 signType: '',
167 coachOrLeaderFlag: null,
168 noPhotoCanSign: null,
169 showResult: false,
170 showExtraForm: false,
171 extraTableHead: [],
172 activeTeam: ''
173 })
174 const { activeTeam, tableData, signInfoTable, choosedList, showExtraForm, extraPersonInfoMapList, teamList, extraform, groupId, signType, coachOrLeaderFlag, showResult, noPhotoCanSign, extraTableHead, coachForm } = toRefs(data)
175 let matchId = ''
176 let signInfoType = null
177 onMounted(() => {
178 groupId.value = route.query.groupId
179 signType.value = route.query.signType
180 matchId = route.query.matchId
181 if (signType.value == '2') {
182 // 团队-队伍报名-获取队伍
183 getTeamList(matchId, groupId.value)
184 } else {
185 getSignInfoList()
186 }
187 getMatch(matchId)
188 getTableHead()
189 getMySignInfo()
190 })
191 let chargeFlag
192 function getMatch(id) {
193 match.getMatchById({
194 id: id
195 }).then(res => {
196 chargeFlag = res.data.chargeFlag
197 noPhotoCanSign.value = res.data.noPhotoCanSign
198 coachOrLeaderFlag.value = res.data.coachOrLeaderFlag
199 extraform.value = JSON.parse(res.data.participantsInfo)
200 })
201 }
202 function getMySignInfo() {
203 // 获取已报
204 match.getMySignInfo({
205 cptId: matchId,
206 groupId: groupId.value
207 }).then(res => {
208 tableData.value = res.data.signInfo
209 signInfoType = res.data.type
210 })
211 }
212 function getSignInfoList() {
213 // console.log(activeTeam.value)
214 match.getMySignInfoList({
215 cptId: matchId,
216 groupId: groupId.value,
217 teamId: activeTeam.value || ''
218 }).then(res => {
219 signInfoTable.value = res.data
220 if (signInfoTable.value.length > 0) {
221 const choosedIds = []
222 for (const p of choosedList.value) {
223 choosedIds.push(p.id)
224 }
225 for (var pp of signInfoTable.value) {
226 if (choosedIds.indexOf(pp.personInfo.id) == -1) {
227 // 判断是否已存在
228 choosedList.value.push(pp.personInfo)
229 }
230 }
231 }
232 })
233 }
234 function getTableHead() {
235 match.getCptExtraInfo(matchId).then(res => {
236 // console.log(res.data)
237 extraTableHead.value = res.data
238 })
239 }
240 function getTeamList(a, b) {
241 match.getMyTeamList(a, b).then(res => {
242 teamList.value = res.data
243 activeTeam.value = teamList.value[0].id
244 getSignInfoList()
245 })
246 }
247 function teamClick(tab, event) {
248 activeTeam.value = tab.props.name
249 getSignInfoList()
250 }
251 function submitForm() {
252 if (signInfoType == '1') {
253 ElMessageBox.confirm('已报项,前往我的报项', '提示', {
254 confirmButtonText: '确定',
255 cancelButtonText: '取消',
256 type: 'warning'
257 }).then(() => {
258 router.push({ name: 'myMatch' })
259 })
260 return
261 }
262 if (extraform.value && extraform.value.length > 0) {
263 let needBuchong = false
264 for (const e of extraform.value) {
265 if (e.status == '0') {
266 needBuchong = true
267 }
268 }
269 for (const s of signInfoTable.value) {
270 if (s.extraPersonInfo == null && needBuchong) {
271 ElMessage.error('请完善运动员补充信息')
272 return
273 }
274 }
275 }
276 if (signInfoType == '2') {
277 match.recoverMySign({ cptId: matchId, groupId: groupId.value }).then(res => {
278 if (res.msg.indexOf('Exception:') > -1) {
279 const msg = res.msg.slice(10)
280 ElMessageBox.confirm(msg, '提示', {
281 confirmButtonText: '确定',
282 cancelButtonText: '取消',
283 type: 'warning'
284 }).then(() => {
285 console.log('用户点击确定')
286 })
287 return
288 } else {
289 afterRecover()
290 }
291 })
292 } else {
293 afterRecover()
294 }
295 }
296 function afterRecover() {
297 if (signInfoTable.value.length == 0) {
298 ElMessage.error('请至少选择一个项目')
299 return
300 }
301 // 判断是否收费
302 if (chargeFlag == '0') {
303 var obj = {
304 cptId: matchId,
305 groupId: groupId.value
306 }
307 match.commitSign(obj).then(res => {
308 console.log(res.data)
309 showResult.value = true
310 })
311 } else {
312 // 生成账单
313 router.push({
314 name: 'expenseDetails',
315 query: {
316 matchId: matchId,
317 groupId: groupId.value
318 }
319 })
320 }
321 }
322
323 function goPrev() {
324 router.go(-1)
325 }
326 function chooseSportman() {
327 if (signInfoType == '2') {
328 match.recoverMySign({
329 cptId: matchId,
330 groupId: groupId.value
331 }).then(res => {
332 if (res.msg.indexOf('Exception:') > -1) {
333 const msg = res.msg.slice(10)
334 ElMessageBox.confirm(msg, '提示', {
335 confirmButtonText: '确定',
336 cancelButtonText: '取消',
337 type: 'warning'
338 }).then(() => {
339 console.log('用户点击确定')
340 })
341 return
342 }
343 getMySignInfo()
344 })
345 }
346
347 const params = {
348 title: '选择运动员',
349 matchId: matchId,
350 groupId: groupId.value,
351 rankId: activeTeam.value,
352 signType: signType.value,
353 noPhotoCanSign: noPhotoCanSign.value,
354 coachOrLeaderFlag: coachOrLeaderFlag.value,
355 choosedList: choosedList.value
356 }
357 proxy.$refs['dialogAllSportsmanListRef'].open(params)
358 }
359 function getChoosed(list) {
360 choosedList.value = list
361 }
362
363 function addCoach() {
364 if (signInfoType == '2') {
365 match.recoverMySign({
366 cptId: matchId,
367 groupId: groupId.value
368 }).then(res => {
369 if (res.msg.indexOf('Exception:') > -1) {
370 const msg = res.msg.slice(10)
371 ElMessageBox.confirm(msg, '提示', {
372 confirmButtonText: '确定',
373 cancelButtonText: '取消',
374 type: 'warning'
375 }).then(() => {
376 console.log('用户点击确定')
377 })
378 return
379 }
380 getMySignInfo()
381 })
382 }
383 const params = {
384 title: '新增运动员',
385 id: 0,
386 groupId: groupId.value
387 }
388 proxy.$refs['dialogAddCoachRef'].open(params)
389 }
390 function signForThisMan(p) {
391 const params = {
392 title: '选择报项',
393 matchId: matchId,
394 groupId: groupId.value,
395 rankId: activeTeam.value,
396 signType: signType.value,
397 noPhotoCanSign: noPhotoCanSign.value,
398 coachOrLeaderFlag: coachOrLeaderFlag.value,
399 personal: p,
400 choosedList: choosedList.value
401 }
402 proxy.$refs['dialogSportsmanListRef'].open(params)
403 }
404 function editThis(row) {
405 const params = {
406 title: '修改报项',
407 personal: row.cptPersonInfo,
408 matchId: matchId,
409 groupId: groupId.value,
410 rankId: activeTeam.value,
411 signType: signType.value,
412 noPhotoCanSign: noPhotoCanSign.value,
413 coachOrLeaderFlag: coachOrLeaderFlag.value
414 }
415 proxy.$refs['dialogSportsmanListRef'].open(params)
416 }
417 function removeThis(id) {
418 ElMessageBox.confirm('确定移除这条报项吗?', '提示', {
419 confirmButtonText: '确定',
420 cancelButtonText: '取消',
421 type: 'warning'
422 }).then(() => {
423 match.deleteSign(id).then(res => {
424 // 重新获取已报名信息
425 ElMessage.success('已移除该报项')
426 getSignInfoList()
427 })
428 })
429 }
430 function changeCoach(cptId, groupId) {
431 // 更换教练
432 const params = {
433 title: '修改教练',
434 groupId: groupId,
435 cptId: cptId
436 }
437 proxy.$refs['popChangeCoach'].open(params)
438 }
439 function importSportman() {
440 const params = {
441 title: '批量导入人员',
442 groupId: groupId.value
443 }
444 proxy.$refs['dialogImportProps'].open(params)
445 }
446 function goMySign() {
447 router.push({
448 name: 'myMatch'
449 })
450 }
451
452 const goPersonInfo = (row) => {
453 if (signInfoType == '1') {
454 ElMessageBox.alert('已报项,前往我的报项', '提示', {
455 confirmButtonText: 'OK',
456 callback: (Action) => {
457 router.push({ name: 'myMatch' })
458 }
459 })
460 return
461 }
462 // 完善补充信息
463 console.log(row)
464 const params = {
465 title: '完善补充信息',
466 participantsInfoArr: extraform.value,
467 personId: row.personInfo.id,
468 extraId: row.extraPersonInfo?.id || 0
469 }
470 proxy.$refs['popExtraForm'].open(params)
471 }
472 function downloadVoucher() {
473 // 下载凭证
474 proxy.download(
475 `/pdf/getPayedOrderPdf/${matchId}/${groupId.value || 0}`, {}, '报项凭证.pdf'
476 )
477 }
478 </script>
479
480 <style scoped lang="scss">
481 .app-container{ padding: 0;background: #F5F7F9;}
482 .panel-footer .el-button--success{background: linear-gradient(270deg, #39DBA7, #38EF7D);border: none;
483 padding: 0 40px;
484 font-size: 16px;
485 }
486 .panel-footer .el-button--success.is-plain{background: #fff;border:1px solid #2ED981;color: #2ED981;}
487 .hasChoose{margin: 0 0 20px;}
488 .chooseForm{
489 :deep(.el-form-item__content){background: rgba(245, 247, 249, 0.38);padding: 20px 40px 10px;}
490 .el-checkbox{height: auto;}
491 :deep(.el-checkbox__input){position: absolute;right: 0;top: 0;}
492 .name{text-align: center;}
493 }
494 </style>
1 <template>
2 <el-dialog :title="title">
3 <el-form v-model="coachForm">
4 <el-form-item label="教练">
5 <el-select v-model="coachForm.coachs" multiple>
6 <el-option v-for="c in myCoachList" :key="c.id" :label="c.realName" :value="c.id">
7 <div class="optionFlex">
8 <el-avatar :size="60" :src="c.picUrl" />
9 <p class="name">{{ c.realName }}
10 <span v-if="c.sex=='0'">(女)</span>
11 <span v-else>(男)</span>
12 </p>
13 </div>
14 </el-option>
15 </el-select>
16 </el-form-item>
17 <el-form-item label="领队">
18 <el-select v-model="coachForm.leaders" multiple>
19 <el-option v-for="c in myCoachList" :key="c.id" :label="c.realName" :value="c.id">
20 <div class="optionFlex">
21 <el-avatar :size="60" :src="c.picUrl" />
22 <p class="name">{{ c.realName }}
23 <span v-if="c.sex=='0'">(女)</span>
24 <span v-else>(男)</span>
25 </p>
26 </div>
27 </el-option>
28 </el-select>
29 </el-form-item>
30 <el-form-item label="其他">
31 <el-select v-model="coachForm.others" multiple>
32 <el-option v-for="c in myCoachList" :key="c.id" :label="c.realName" :value="c.id">
33 <div class="optionFlex">
34 <el-avatar :size="60" :src="c.picUrl" />
35 <p class="name">{{ c.realName }}
36 <span v-if="c.sex=='0'">(女)</span>
37 <span v-else>(男)</span>
38 </p>
39 </div>
40 </el-option>
41 </el-select>
42 </el-form-item>
43 <el-form-item>
44 <el-button type="success">确定</el-button>
45 </el-form-item>
46 </el-form>
47 </el-dialog>
48 </template>
49
50 <script setup>
51
52 </script>
53
54 <style scoped lang="scss">
55
56 </style>
1 <template>
2 <el-row>
3 <el-col :span="20" :offset="2"><h3>队伍信息</h3></el-col>
4 <el-col :span="20" :offset="2" class="rankArea">
5 <el-form :inline="true" label-width="120px">
6 <!-- 已有队伍-->
7 <div v-for="(r,index) in rankList" class="rankBox">
8 <el-icon class="del" @click="delRank(r)">
9 <Close />
10 </el-icon>
11 <el-row>
12 <el-col :span="6">
13 <el-form-item label="队伍logo:">
14 <el-avatar :size="120" :src="r.imgUrl" />
15 </el-form-item>
16 </el-col>
17 <el-col :span="8">
18 <el-form-item label="队伍名称:">
19 <span>{{ r.name }}</span>
20 </el-form-item>
21 <el-form-item v-if="props.coachOrLeaderFlag=='1'" label="领队:">
22 <div v-if="r.leaderNames" class="goChooseBox">
23 <el-tag v-for="(tag,index) in r.leaderNames.split(',')" :key="index" class="mx-1" :disable-transitions="false">
24 {{ tag }}
25 </el-tag>
26 </div>
27 </el-form-item>
28 <el-form-item v-if="props.coachOrLeaderFlag=='1'" label="翻译:">
29 <div v-if="r.translatorNames" class="goChooseBox">
30 <el-tag v-for="(tag,index) in r.translatorNames.split(',')" :key="index" class="mx-1" :disable-transitions="false">
31 {{ tag }}
32 </el-tag>
33 </div>
34 <span v-else>暂无</span>
35 </el-form-item>
36 <el-form-item v-if="props.coachOrLeaderFlag=='1'" label="其他:">
37 <div v-if="r.otherNames" class="goChooseBox">
38 <el-tag v-for="(tag,index) in r.otherNames.split(',')" :key="index" class="mx-1" :disable-transitions="false">
39 {{ tag }}
40 </el-tag>
41 </div>
42 <span v-else>暂无</span>
43 </el-form-item>
44 </el-col>
45 <el-col v-if="props.coachOrLeaderFlag=='1'" :span="8">
46 <el-form-item label="教练:">
47 <div v-if="r.coachNames" class="goChooseBox">
48 <el-tag
49 v-for="(tag,index) in r.coachNames.split(',')"
50 :key="index" class="mx-1"
51 :disable-transitions="false"
52 >
53 {{ tag }}
54 </el-tag>
55 </div>
56 </el-form-item>
57 <el-form-item label="队医:">
58 <div v-if="r.teamDoctorNames" class="goChooseBox">
59 <el-tag v-for="(tag,index) in r.teamDoctorNames.split(',')" :key="index" class="mx-1" :disable-transitions="false">
60 {{ tag }}
61 </el-tag>
62 </div>
63 <span v-else>暂无</span>
64 </el-form-item>
65 <el-form-item label="官员:">
66 <div v-if="r.officialNames" class="goChooseBox">
67 <el-tag
68 v-for="(tag,index) in r.officialNames.split(',')"
69 :key="index" class="mx-1"
70 :disable-transitions="false"
71 >
72 {{ tag }}
73 </el-tag>
74 </div>
75 <span v-else>暂无</span>
76 </el-form-item>
77 </el-col>
78 </el-row>
79 <el-row>
80 <el-col :span="2" :offset="22">
81 <el-button type="primary" link class="fr" @click="editRank(r)">编辑</el-button>
82 </el-col>
83 </el-row>
84 </div>
85 <el-button type="success" plain @click="addRank">+添加队伍</el-button>
86 <el-button v-if="rankList.length>0||showAdd" type="success" plain @click="addCoach">+添加教练/领队</el-button>
87 </el-form>
88 </el-col>
89 </el-row>
90
91 <!-- 添加人员-->
92 <addCoachdialog ref="dialogAddCoach" @submitForm="getGroupInfo" />
93 <!-- 队伍信息-->
94 <editRankdialog ref="dialogEditRank" @submitForm="getList" />
95 </template>
96
97 <script setup>
98 import { computed, reactive } from 'vue'
99 import * as match from '@/apiPc/match'
100 import { getCurrentInstance, onMounted } from '@vue/runtime-core'
101 import { ElMessage, ElMessageBox } from 'element-plus'
102 import addCoachdialog from './addCoach'
103 import editRankdialog from './editRank'
104
105 const router = useRouter()
106 const route = useRoute()
107 const { proxy } = getCurrentInstance()
108 const data = reactive({
109 form: {},
110 rankList: [],
111 group: {},
112 groupId: '',
113 teamType: [{ label: '学校', value: '0' }, { label: '俱乐部', value: '1' }],
114 rules: {
115 imgUrl: { required: true, message: '请上传图标', trigger: 'blur' },
116 name: { required: true, message: '请填写名称', trigger: 'blur' }
117 }
118 })
119 const { teamType, rules, rankList, form, group, groupId } = toRefs(data)
120 const backRankId = ''
121 let cptId = ''
122 const props = defineProps({
123 coachOrLeaderFlag: {
124 type: String
125 }
126 })
127 onMounted(() => {
128 cptId = route.query.matchId
129 groupId.value = route.query.groupId
130 getList()
131 getGroupInfo()
132 })
133 // 弹窗加人
134 const addCoach = () => {
135 const params = {
136 id: 0,
137 groupId: groupId.value
138 }
139 proxy.$refs['dialogAddCoach'].open(params)
140 }
141
142 function getGroupInfo() {
143 match.getGroupById(groupId.value).then(res => {
144 group.value = res.data
145 })
146 }
147
148 function getList() {
149 // 获取队伍列表
150 match.getMyTeamList(cptId, groupId.value).then(response => {
151 rankList.value = response.data
152 })
153 }
154
155 function delRank(r) {
156 ElMessageBox.confirm(
157 '确定删除该队伍吗?',
158 '提示',
159 {
160 confirmButtonText: '确定',
161 cancelButtonText: '取消',
162 type: 'warning'
163 }
164 )
165 .then(() => {
166 match.delRank(r.id).then(response => {
167 getList()
168 ElMessage({
169 type: 'success',
170 message: '已删除'
171 })
172 })
173 })
174 }
175 function addRank() {
176 const params = {
177 form: {},
178 cptId: cptId,
179 title: '新建队伍',
180 coachOrLeaderFlag: props.coachOrLeaderFlag,
181 group: group.value
182 }
183 proxy.$refs['dialogEditRank'].open(params)
184 }
185 function editRank(rank) {
186 const params = {
187 form: rank,
188 cptId: cptId,
189 title: '编辑队伍',
190 coachOrLeaderFlag: props.coachOrLeaderFlag,
191 group: group.value
192 }
193 proxy.$refs['dialogEditRank'].open(params)
194 }
195 </script>
196
197 <style lang="scss" scoped>
198 .rankArea {
199 background: #FBFCFD;
200 border-radius: 10px;
201 padding: 25px 30px;
202 }
203
204 .rankBox {
205 background: #FFFFFF;
206 padding: 20px;
207 position: relative;
208 border-radius: 10px;
209 margin: 0 0 20px;
210 }
211
212 :deep(.el-upload--picture-card) {
213 width: 80px;
214 height: 80px;
215 border-radius: 50%;
216 }
217
218 :deep(.el-upload-list__item.is-success .el-upload-list__item-status-label) {
219 display: none;
220 }
221
222 :deep(.el-upload-list--picture-card .el-upload-list__item) {
223 width: 80px;
224 height: 80px;
225 border-radius: 50%;
226 }
227
228 .del {
229 position: absolute;
230 right: 15px;
231 top: 15px;
232 font-size: 20px;
233 z-index: 1;
234 }
235
236 .mx-1 {
237 margin: 5px
238 }
239 </style>
1 <template>
2 <el-dialog v-model="show" :title="title" width="1000px" append-to-body :close-on-click-modal="false">
3
4 <el-form label-width="120px" label-position="top" class="chooseForm" :model="form">
5 <el-row :gutter="20">
6 <el-col :span="24" />
7
8 <el-col :span="8">
9 <el-form-item>
10 <p class="title">可选项目</p>
11 <el-radio-group v-model="form.project" @change="chooseThisProject">
12 <div v-for="c in projectList" :key="c" class="athleteBox">
13 <el-radio :label="c">
14 <p class="name">{{ c.name }}
15 </p>
16 </el-radio>
17 </div>
18 </el-radio-group>
19 <el-empty v-if="projectList.length==0" :image="`/img/order_no.png`" :image-size="228" description="无可选项目" />
20 </el-form-item>
21 </el-col>
22 <el-col :span="8">
23 <el-form-item>
24 <p class="title">可选组别</p>
25 <el-radio-group v-model="form.groupId" @change="chooseThisGroup">
26 <div v-for="c in signGroupList" :key="c" class="athleteBox">
27 <el-radio :label="c.id">
28 <p class="name">{{ c.name }}
29 </p>
30 </el-radio>
31 </div>
32 </el-radio-group>
33 <el-empty v-if="signGroupList.length==0" style="width: 100%;" description="无可选组别" />
34 </el-form-item>
35 </el-col>
36 <el-col :span="8">
37 <el-form-item>
38 <el-radio-group v-model="form.levelId" @change="chooseThisLevel">
39 <div v-if="signlevelListBoy.length>0">
40 <p class="title">男子组</p>
41 <div v-for="c in signlevelListBoy" :key="c" class="athleteBox">
42 <el-radio :label="c.id">{{ c.name }}</el-radio>
43 </div>
44 </div>
45 <div v-if="signlevelListGirl.length>0">
46 <p class="title">女子组</p>
47 <div v-for="c in signlevelListGirl" :key="c" class="athleteBox">
48 <el-radio :label="c.id">{{ c.name }}</el-radio>
49 </div>
50 </div>
51 </el-radio-group>
52 <div v-if="signLevelList.length>0">
53 <p class="title">可选级别</p>
54 <el-radio-group :key="c" v-model="form.levelId" @change="chooseThisLevel">
55 <div v-for="c in signLevelList" :key="c" class="athleteBox">
56 <el-radio :label="c.id">{{ c.name }}</el-radio>
57 </div>
58 </el-radio-group>
59 </div>
60 <div v-if="signLevelList.length==0&&signlevelListGirl.length==0&&signlevelListBoy.length==0" style="width: 100%">
61 <p class="title">可选级别</p>
62 <el-empty style="width: 100%;" description="无可选级别" />
63 </div>
64
65 </el-form-item>
66
67 </el-col>
68 </el-row>
69 </el-form>
70
71 <template #footer>
72 <div class="dialog-footer text-center">
73 <el-button type="primary" @click="levelDone">保 存</el-button>
74 <el-button @click="cancel">取 消</el-button>
75 </div>
76 </template>
77 </el-dialog>
78 </template>
79
80 <script setup>
81 import { getCurrentInstance, nextTick, onMounted } from '@vue/runtime-core'
82 import { reactive, toRefs, watch } from 'vue'
83 import * as match from '@/apiPc/match'
84 import { ElMessage, ElMessageBox } from 'element-plus'
85
86 const { proxy } = getCurrentInstance()
87 const emit = defineEmits(['submitForm'])
88
89 const data = reactive({
90 projectList: [],
91 signGroupList: [],
92 signLevelList: [],
93 signlevelListBoy: [],
94 signlevelListGirl: [],
95 show: false,
96 title: '',
97 matchId: '',
98 form: {}
99 })
100 const { show, projectList, title, form, matchId, signGroupList, signLevelList, signlevelListBoy, signlevelListGirl } = toRefs(data)
101 let personId = ''
102 onMounted(() => {
103 getMyself()
104 })
105 const getMyself = () => {
106 match.getMyPersonInfo().then(res => {
107 personId = res.data.id
108 })
109 }
110
111 const getProjectList = (id) => {
112 projectList.value = []
113 match.getCanSignProjectList(id).then(res => {
114 for (const p of res.data) {
115 if (p.canSign == '1') {
116 projectList.value.push(p)
117 }
118 }
119 })
120 }
121 const chooseThisProject = (e) => {
122 console.log(e)
123 getSignGroupList(e.id, personId)
124 form.value.levelId = ''
125 form.value.groupId = ''
126 signLevelList.value = []
127 signlevelListBoy.value = []
128 signlevelListGirl.value = []
129 }
130 // 获取组别
131 const getSignGroupList = (projectId, personId) => {
132 signGroupList.value = []
133 match.getCanSignGroupListFromSelectPerson(projectId, personId).then(res => {
134 for (var g of res.data) {
135 if (g.canSign == '1') {
136 signGroupList.value.push(g)
137 }
138 }
139 })
140 }
141 const chooseThisGroup = (e) => {
142 console.log(e)
143 getLevels(form.value.groupId, personId)
144 }
145 // 获取级别
146 const getLevels = (groupId, personId) => {
147 signLevelList.value = []
148 signlevelListBoy.value = []
149 signlevelListGirl.value = []
150 match.getCanSignlevelListFromSelectPerson(groupId, personId).then(res => {
151 for (const l of res.data) {
152 l.text = l.name
153 l.value = l.id
154 if (l.levelType == '1') {
155 signlevelListBoy.value.push(l)
156 } else if (l.levelType == '2') {
157 signlevelListGirl.value.push(l)
158 } else {
159 signLevelList.value.push(l)
160 }
161 }
162 })
163 }
164 const levelDone = () => {
165 if (!form.value.levelId) {
166 ElMessage.error('请选择级别')
167 return
168 }
169 const obj = {
170 levelId: form.value.levelId,
171 athleteIds: personId,
172 groupId: '',
173 teamId: ''
174 }
175 saveOne(obj)
176 }
177 const saveOne = (obj) => {
178 match.sportsmanDone(obj).then(res => {
179 if (res.msg.indexOf('Exception:') > -1) {
180 const msg = res.msg.slice(10)
181 ElMessageBox.confirm(msg).then(() => {
182
183 })
184 return
185 }
186 show.value = false
187 emit('submitForm')
188 })
189 }
190 watch(show, (val) => {
191 if (!val) {
192 form.value = {}
193 }
194 })
195
196 function cancel() {
197 show.value = false
198 }
199 const open = (params) => {
200 show.value = true
201 title.value = params.title || '项目列表'
202 matchId.value = params.matchId
203 getProjectList(matchId.value)
204 }
205 defineExpose({
206 open
207 })
208 </script>
209
210 <style lang="scss" scoped>
211 .el-radio-group{ width: 100%;display: block;}
212 .athleteBox{height: 40px; display: flex;align-items: center;
213 .el-radio__label{display: flex;align-items: center;margin: 0 20px;}
214 .el-radio__inner{ scale: 1.5;}
215 .name{margin: 0 20px;font-size: 16px;}
216 }
217 .athleteBox:hover{background: #efefef;}
218 p.title{font-size: 16px;margin: 0 0 15px;}
219 .el-form-item{min-height: 400px;border: 1px solid #eee;padding:10px 20px}
220 </style>
221
1 <template>
2 <el-dialog
3 v-model="show" destroy-on-close :title="title" width="1000px" append-to-body
4 :close-on-click-modal="false" @close="delWatch"
5 >
6 <el-form
7 ref="ruleFormRef"
8 label-position="top" label-width="120px" class="chooseForm" :model="form"
9 :rules="rules"
10 >
11 <el-row class="athletesform">
12 <el-col v-show="signType!=0" :span="8" style="max-height: 70vh;overflow: auto;">
13 <el-form-item label="可报运动员" class="athletes">
14 <el-radio-group v-model="form.manId" class="ml-4">
15 <div v-for="item in athletesList" :key="item.id" :ref="item.id" class="mb20">
16 <el-radio-button :label="item.id" size="large" @change="changePersonal(item)">
17 <div class="optionFlex">
18 <el-avatar v-show="item.picUrl" :size="40" :src="item.picUrl" />
19 <p class="name">{{ item.realName }}
20 <span v-show="item.sex=='0'">(女)</span>
21 <span v-show="item.sex=='1'">(男)</span>
22 </p>
23 </div>
24 </el-radio-button>
25 <el-button
26 v-if="noPhotoCanSign=='0'&&(!item.picUrl)" class="ml20" type="text"
27 @click="editPersonInfo(item.id,nowMan.groupId)"
28 >上传照片
29 </el-button>
30 </div>
31 </el-radio-group>
32 </el-form-item>
33 </el-col>
34 <el-col v-loading="loading" :span="16" style="max-height: 70vh;overflow: auto;">
35 <el-empty v-show="treeData.length<1" description="请选择运动员" />
36 <el-collapse v-for="(project,index) in treeData" :key="project.id" v-model="activeNames">
37 <div v-show="project.hasNext==0&&project.canSign=='1'" class="fake-collapse-item">
38 <el-checkbox-group v-model="form.levelId" size="large">
39 <el-checkbox :label="project.levelId">{{ project.name }}</el-checkbox>
40 </el-checkbox-group>
41 </div>
42 <el-collapse-item v-show="project.hasNext==1&&project.canSign=='1'" :title="project.name" :name="index">
43 <div v-for="group in project.groupList" :key="group.id">
44 <div v-show="group.hasNext==0">
45 <el-checkbox-group v-model="form.levelId" size="large">
46 <el-checkbox v-show="group.canSign=='1'" :label="group.levelId">{{ group.name }}</el-checkbox>
47 <!-- <el-checkbox v-show="group.hasNext!=0" disabled :label="group.id">{{ group.name }}</el-checkbox>-->
48 </el-checkbox-group>
49 </div>
50
51 <div v-show="group.hasNext==1">
52 <el-checkbox-group
53 v-for="level in group.levelList" :key="level.id" v-model="form.levelId"
54 size="large"
55 >
56 <!-- project.type判断选队友 signId删除报项 :disabled="level.canSign==0||level.belongToThisTeam==0"-->
57 <el-checkbox v-show="level.canSign==1" :label="level.id" :checked="level.checked">
58 {{ group.name }}{{ level.name }}
59 <span v-show="level.levelType=='1'">(男)</span>
60 <span v-show="level.levelType=='2'">(女)</span>
61 </el-checkbox>
62 </el-checkbox-group>
63 </div>
64 </div>
65 </el-collapse-item>
66 </el-collapse>
67 </el-col>
68 </el-row>
69 </el-form>
70 <el-dialog v-model="showMateList" :title="mateTitle" width="900px" draggable @close="mateClose">
71 <div class="mb20">
72 <span v-if="mateConfig.minCount!=mateConfig.maxCount">请选择{{ mateConfig.minCount }}~{{
73 mateConfig.maxCount
74 }}个队友</span>
75 <span v-else-if="mateConfig.minCount=='-1'&&mateConfig.maxCount=='-1'">请至少选择1个队友</span>
76 <span v-else>请选择{{ mateConfig.minCount }}个队友</span>
77
78 <span v-if="mateConfig.minMaleCount>0||mateConfig.maxMaleCount>0" style="margin:0 20px;">男子:
79 <span v-show="mateConfig.minMaleCount!=mateConfig.maxMaleCount&&mateConfig.minMaleCount!=-1"> 最少{{ mateConfig.minMaleCount }}</span>
80 <span v-show="mateConfig.minMaleCount!=mateConfig.maxMaleCount&&mateConfig.maxMaleCount!=-1"> 最多{{ mateConfig.maxMaleCount }}</span>
81 <span v-show="mateConfig.minMaleCount==mateConfig.maxMaleCount&&mateConfig.maxMaleCount!=-1">{{ mateConfig.maxMaleCount }}</span>
82 </span>
83 <span v-if="mateConfig.minFemaleCount>0||mateConfig.maxFemaleCount>0" style="margin:0 20px;">女子:
84 <span v-show="mateConfig.minFemaleCount!=mateConfig.maxFemaleCount&&mateConfig.minFemaleCount>0"> 最少{{ mateConfig.minFemaleCount }}</span>
85 <span v-show="mateConfig.minFemaleCount!=mateConfig.maxFemaleCount&&mateConfig.maxFemaleCount>0"> 最多{{ mateConfig.maxFemaleCount }}</span>
86 <span v-show="mateConfig.minFemaleCount==mateConfig.maxFemaleCount&&mateConfig.minFemaleCount>0">{{ mateConfig.minFemaleCount }}</span>
87 </span>
88
89 <span v-show="form.mates.length>1" style="float: right" class="text-success">已选{{ form.mates?.length-1 }}个队友</span>
90 </div>
91 <!-- <el-button v-if="teammateList.length<minCount" type="text" @click="addTeamMate">新增队友</el-button>-->
92 <el-empty v-if="teammateList.length==0" description="暂无可选队友" />
93 <div class="teammateList" style="max-height:60vh;overflow: auto;">
94 <el-checkbox-group v-model="form.mates" class="ml-4" @change="changeTeammates">
95 <el-checkbox disabled checked :label="personal.sex+'_'+personal.id" size="large">
96 <div class="optionFlex" style="width: auto;">
97 <div style="width: 40px;"><img v-show="personal.picUrl" :src="personal.picUrl" width="40"></div>
98 <p class="name" style="width: 200px">{{ personal.realName }}
99 <span v-show="personal.sex=='0'">(女)</span>
100 <span v-show="personal.sex=='1'">(男)</span>
101 </p>
102 <el-select v-show="sonLevelList.length>0" v-model="personal.sonlevel" clearable>
103 <el-option v-for="son in sonLevelList" :value="son.id" :label="son.name">{{ son.name }}</el-option>
104 </el-select>
105 </div>
106 </el-checkbox>
107
108 <div v-for="(item,index) in teammateList" :key="item.id" class="mb20">
109 <el-checkbox :label="item.sex+'_'+item.id" size="large" :disabled="item.disabled">
110 <div class="optionFlex" style="width: auto;">
111 <span>{{ index+1 }}</span>
112 <div style="width: 40px;"><img v-show="item.picUrl" :src="item.picUrl" width="40"></div>
113 <p class="name" style="width: 200px">{{ item.realName }}
114 <span v-if="item.sex=='0'">(女)</span>
115 <span v-else>(男)</span>
116 </p>
117 <el-select v-show="sonLevelList.length>0" v-model="item.sonlevel" clearable>
118 <el-option v-for="son in sonLevelList" :value="son.id" :label="son.name">{{ son.name }}</el-option>
119 </el-select>
120 </div>
121 </el-checkbox>
122 <el-button v-if="noPhotoCanSign=='0'&&(!item.picUrl)" class="ml20" type="text" @click="editPersonInfo(item.id,nowMan.groupId)">
123 上传照片
124 </el-button>
125 </div>
126 </el-checkbox-group>
127 </div>
128
129 <el-transfer
130 v-model="form.mates" :data="teammateList" :titles="['可选队友','已选队友']"
131 @left-check-change="changeTeammates" @change="transferChange"
132 >
133 <template #default="scope">
134 <div class="transferItem">
135 <img v-show="scope.option.picUrl" :src="scope.option.picUrl" width="50" height="70">
136 <div class="name">
137 {{ scope.option.realName }}
138 <span v-if="scope.option.sex=='0'"></span>
139 <span v-else></span>
140 </div>
141 <el-select v-show="sonLevelList.length>0" v-model="scope.option.sonlevel" clearable>
142 <el-option v-for="son in sonLevelList" :key="son.id" :value="son.id" :label="son.name">{{ son.name }}</el-option>
143 </el-select>
144 </div>
145 </template>
146 </el-transfer>
147
148 <template #footer>
149 <div class="dialog-footer text-center">
150 <el-button type="primary" @click="chooseMateDone">确定</el-button>
151 </div>
152 </template>
153
154 </el-dialog>
155
156
157 <dialogPersonInfo ref="editPersonInfoRef" @submitForm="getAthletesList" />
158
159 </el-dialog>
160 </template>
161
162 <script setup>
163 import { reactive, ref, toRefs, watch } from 'vue'
164 import { getCurrentInstance, nextTick, onMounted } from '@vue/runtime-core'
165 import * as match from '@/apiPc/match'
166 import { ElMessage } from 'element-plus'
167
168 const { proxy } = getCurrentInstance()
169 const emit = defineEmits(['submitForm'])
170 import dialogPersonInfo from '../components/addCoach'
171 import _ from 'lodash'
172
173 const data = reactive({
174 show: false,
175 title: '', mateTitle: '',
176 signType: '',
177 form: {
178 levelId: [],
179 mates: []
180 },
181 athletesList: [],
182 signProjectList: [],
183 signGroupList: [],
184 showMateList: false,
185 showBtn: false,
186 teammateList: [],
187 rankId: '0',
188 treeData: [],
189 loading: false,
190 mateConfig: {},
191 noPhotoCanSign: null,
192 coachOrLeaderFlag: null,
193 personal: {},
194 activeNames: [0],
195 okMates: []
196 })
197 const {
198 signType,
199 form,
200 rules,
201 loading,
202 activeNames,
203 athletesList,
204 treeData,
205 show,
206 title, mateTitle,
207 personal,
208 rankId,
209 showMateList,
210 showBtn,
211 teammateList,
212 mateConfig,
213 noPhotoCanSign,
214 coachOrLeaderFlag,
215 okMates
216 } = toRefs(data)
217 let matchId
218 let groupId
219 watch(show, (val) => {
220 if (!val) {
221 form.value = {}
222 treeData.value = []
223 delWatch()
224 }
225 })
226 const changePersonal = (item) => {
227 // delWatch()
228 personal.value = item
229 form.value.manId = item.id
230 getTree()
231 }
232
233 function getTree() {
234 noLevelId = ''
235 loading.value = true
236 match.getMySignListTree(matchId, form.value.manId, rankId.value).then(res => {
237 treeData.value = res.data
238 // 循环项目,组,级别 赋值是否checked
239 getMyIsSign()
240 })
241 }
242
243 let signOk = {}
244
245 function getMyIsSign() {
246 delWatch()
247 form.value.levelId = []
248 match.getMySignIds(matchId, form.value.manId, rankId.value).then(res => {
249 loading.value = false
250 signOk = res.data
251 for (const s of signOk) {
252 form.value.levelId.push(s.eid)
253 for (const p of treeData.value) {
254 if (p.levelId == s.eid) {
255 p.checked = true
256 p.signId = s.signId
257 p.belongToThisTeam = s.belongToThisTeam
258 } else {
259 for (const g of p.groupList) {
260 g.type = p.type
261 if (g.levelId == s.eid) {
262 g.checked = true
263 g.signId = s.signId
264 g.belongToThisTeam = s.belongToThisTeam
265 } else {
266 for (const l of g.levelList) {
267 l.type = p.type
268 if (s.eid == l.id) {
269 l.checked = true
270 l.signId = s.signId
271 l.belongToThisTeam = s.belongToThisTeam
272 }
273 }
274 }
275 }
276 }
277 }
278 }
279 if (signOk.length < 1) {
280 for (const p of treeData.value) {
281 for (const g of p.groupList) {
282 g.type = p.type
283 for (const l of g.levelList) {
284 l.type = p.type
285 }
286 }
287 }
288 }
289 addWatch()
290 })
291 }
292
293 //#region 监听叶子的数量变化
294 let noLevelId
295 let levelInfo
296 let watchHandle = null
297
298 function addWatch() {
299 delWatch()
300 watchHandle = watch(() => form.value.levelId, (newValue, oldValue) => {
301 if (!newValue) return
302 oldValue = _.uniq(oldValue)
303 newValue = _.uniq(newValue)
304 // console.log(newValue, oldValue)
305 let temp
306 let isAdd = false
307 if (newValue?.length > oldValue?.length) {
308 isAdd = true
309 temp = _.difference(newValue, oldValue)
310 } else {
311 isAdd = false
312 temp = _.difference(oldValue, newValue)
313 }
314 if (newValue[0] == temp[0]) {
315
316 }
317 if (temp.length === 1) {
318 levelInfo = findlevelInfo(temp[0], treeData.value, 1)
319 if (isAdd) {
320 noLevelId = temp[0]
321 judgeChooseTeam(levelInfo.type, temp[0])
322 } else {
323 if (!temp[0] || temp[0] == undefined) {
324 return
325 }
326 removeThis(levelInfo.signId)
327 }
328 }
329 // console.log(isAdd, temp[0])
330 })
331 }
332
333 function delWatch() {
334 if (watchHandle) {
335 watchHandle()
336 watchHandle = null
337 }
338 }
339
340 function findlevelInfo(id, list, deep) {
341 let info = null
342 _.some(list, (l) => {
343 switch (deep) {
344 case 1:// p
345 if (l.levelId == id) {
346 info = l
347 } else {
348 info = findlevelInfo(id, l.groupList, 2)
349 }
350 break
351 case 2:// g
352 if (l.levelId == id) {
353 info = l
354 } else {
355 info = findlevelInfo(id, l.levelList, 3)
356 }
357 break
358 case 3:// l
359 if (l.id == id) {
360 info = l
361 }
362 break
363 }
364 return info
365 })
366
367 return info
368 }
369
370 //#endregion
371 function getAthletesList() {
372 match.getMyGroupForCpt(groupId, matchId).then(res => {
373 athletesList.value = res.data.athletes
374 if (form.value.manId) {
375 for (const a of athletesList.value) {
376 if (a.id == form.value.manId) {
377 nowMan.value = a
378 }
379 }
380 }
381 })
382 }
383
384 const open = (params) => {
385 show.value = true
386 matchId = params.matchId
387 groupId = params.groupId
388 signType.value = params.signType
389 title.value = params.title
390 rankId.value = params.rankId || ''
391 noPhotoCanSign.value = params.noPhotoCanSign
392 coachOrLeaderFlag.value = params.coachOrLeaderFlag
393 if (params.personal) {
394 form.value.manId = params.personal.id
395 setTimeout(() => {
396 proxy.$refs[params.personal.id][0].scrollIntoView({ block: 'start', behavior: 'smooth' })
397 }, 200)
398
399 getTree()
400 personal.value = params.personal
401 }
402 if (groupId != 0) {
403 if (params.choosedList) {
404 athletesList.value = params.choosedList
405 if (form.value.manId) {
406 for (const a of athletesList.value) {
407 if (a.id == form.value.manId) {
408 nowMan.value = a
409 }
410 }
411 }
412 } else {
413 getAthletesList()
414 }
415 }
416 }
417 defineExpose({
418 open
419 })
420
421 const nowMan = ref({})
422 const sonLevelList = ref([])
423 let sonLevelIds = []
424
425 function editPersonInfo(id, groupId) {
426 const params = {
427 id: id,
428 groupId: groupId
429 }
430 proxy.$refs['editPersonInfoRef'].open(params)
431 }
432
433 function addTeamMate() {
434 const params = {
435 id: 0,
436 groupId: groupId
437 }
438 proxy.$refs['editPersonInfoRef'].open(params)
439 }
440 function transferChange(value, direction, movedKeys) {
441 console.log(value, direction, movedKeys)
442 console.log(form.value.mates)
443 }
444 const judgeChooseTeam = (type, levelId) => {
445 const tmArr = ['1', '2', '3', '4', '6']
446 if (tmArr.indexOf(type) > -1) {
447 getTeammate(levelId)
448 } else {
449 const obj = {
450 levelId: levelId,
451 athleteIds: form.value.manId,
452 groupId: groupId,
453 teamId: rankId.value || ''
454 }
455 saveOne(obj)
456 }
457 }
458 const getTeammate = (levelId) => {
459 const obj = {
460 levelId: levelId,
461 groupId: groupId,
462 personId: form.value.manId
463 }
464 match.getCanSignLevelPerson(obj).then(res => {
465 mateConfig.value = res.data
466 teammateList.value = res.data.personList
467 for (const p of teammateList.value) {
468 p.disabled = false
469 if (mateConfig.value.maxMaleCount == 0 && p.sex == '1') {
470 p.disabled = true
471 }
472 if (mateConfig.value.maxFemaleCount == 0 && p.sex == '0') {
473 p.disabled = true
474 }
475 p.key = `${p.sex}_${p.id}`
476 p.label = `${p.realName}(${p.sexStr})`
477 }
478 getSonLevels(levelId)
479 mateTitle.value = `选择队友 (${teammateList.value.length})`
480 showMateList.value = true
481 form.value.mates = []
482 sonLevelIds = []
483 personal.value.sonlevel = ''
484 }).catch(error => {
485 getMyIsSign()
486 })
487 }
488
489 function getSonLevels(level) {
490 sonLevelList.value = []
491 match.querySonLevel(level).then(res => {
492 sonLevelList.value = res.data
493 })
494 }
495
496 let manNum = 0
497 let femaleNum = 0
498 let mates = []
499 const changeTeammates = (e) => {
500 mates = []
501 manNum = 0
502 femaleNum = 0
503 for (const m of e) {
504 const arr = m.split('_')
505 mates.push(arr[1])
506 if (personal.value.id == arr[1]) {
507 continue
508 }
509 if (arr[0] == '1') {
510 manNum++
511 } else {
512 femaleNum++
513 }
514 }
515 // console.log(mates, mateConfig.value)
516 for (const p of teammateList.value) {
517 if (mateConfig.value.maxMaleCount != -1 && manNum == mateConfig.value.maxMaleCount && p.sex == '1' && mates.indexOf(p.id) == -1) {
518 p.disabled = true
519 } else if (mateConfig.value.maxFemaleCount != -1 && femaleNum == mateConfig.value.maxFemaleCount && p.sex == '0' && mates.indexOf(p.id) == -1) {
520 p.disabled = true
521 } else if (mates.indexOf(p.id) == -1 && mateConfig.value.maxCount != -1 && (mates.length - 1) == mateConfig.value.maxCount) {
522 p.disabled = true
523 } else {
524 p.disabled = false
525 }
526 }
527 }
528 const mateClose = () => {
529 mates = []
530 form.value.mates = []
531 sonLevelIds = []
532 teammateList.value = []
533 getMyIsSign()
534 }
535
536 function chooseMateDone() {
537 if (mateConfig.value.minMaleCount != '-1' && mateConfig.value.minMaleCount != '0' && manNum < mateConfig.value.minMaleCount) {
538 ElMessage.error(`至少选择${mateConfig.value.minMaleCount}个男队友`)
539 return
540 }
541 if (mateConfig.value.maxMaleCount != '-1' && mateConfig.value.maxMaleCount != '0' && manNum > mateConfig.value.maxMaleCount) {
542 ElMessage.error(`最多选择${mateConfig.value.maxMaleCount}个男队友`)
543 return
544 }
545 if (mateConfig.value.minFemaleCount != '-1' && mateConfig.value.minFemaleCount != '0' && femaleNum < mateConfig.value.minFemaleCount) {
546 ElMessage.error(`至少选择${mateConfig.value.minFemaleCount}个女队友`)
547 return
548 }
549 if (mateConfig.value.maxFemaleCount != '-1' && mateConfig.value.maxFemaleCount != '0' && femaleNum > mateConfig.value.maxFemaleCount) {
550 ElMessage.error(`最多选择${mateConfig.value.maxFemaleCount}个女队友`)
551 return
552 }
553 if ((mates.length < mateConfig.value.minCount) && mateConfig.value.minCount > 0) {
554 ElMessage.error(`至少选择${mateConfig.value.minCount}个队友`)
555 return
556 }
557 const athleteIds = []
558 console.log('mates', mates)
559 for (const p of teammateList.value) {
560 if (mates.indexOf(p.id) != -1) {
561 if (sonLevelList.value.length > 0 && !p.sonlevel) {
562 ElMessage.error(`请分配级别`)
563 return
564 }
565 sonLevelIds.push(p.sonlevel)
566 athleteIds.push(p.id)
567 }
568 }
569 if (sonLevelList.value.length > 0 && !personal.value.sonlevel) {
570 ElMessage.error(`请分配级别`)
571 return
572 }
573 sonLevelIds.push(personal.value.sonlevel)
574 athleteIds.push(personal.value.id)
575 if (sonLevelList.value.length == 0) {
576 sonLevelIds = []
577 }
578 const obj = {
579 levelId: noLevelId,
580 athleteIds: athleteIds.toString(),
581 sonLevelIds: sonLevelIds.toString() || '',
582 groupId: groupId,
583 teamId: rankId.value || ''
584 }
585 // 半提交
586 saveOne(obj)
587 }
588
589
590 const saveOne = (obj) => {
591 loading.value = true
592 match.sportsmanDone(obj).then(res => {
593 if (res.msg.indexOf('Exception:') > -1) {
594 const msg = res.msg.slice(10)
595 ElMessage({
596 type: 'warning',
597 message: msg
598 })
599 // form.value.mates = []
600 sonLevelIds = []
601 getMyIsSign()
602 return
603 }
604 sonLevelIds = []
605 // form.value.mates = []
606 showMateList.value = false
607 sonLevelList.value = []
608 getMyIsSign()
609 emit('submitForm')
610 }).catch(err => {
611 // 取消这个勾
612 getMyIsSign()
613 sonLevelIds = []
614 })
615 }
616
617 function removeThis(id) {
618 loading.value = true
619 match.deleteSign(id).then(res => {
620 // 重新获取已报名信息
621 loading.value = false
622 emit('submitForm')
623 }).catch(err => {
624 getMyIsSign()
625 })
626 }
627 </script>
628
629 <style lang="scss" scoped>
630 .el-transfer{
631 --el-transfer-item-height: 70px;
632 --el-transfer-panel-width: 320px;
633 }
634 .transferItem{display: flex;align-items: center;
635 img{margin-right: 6px;}
636 .name{line-height: 1.6;font-size: 15px;
637 span{display: block;color: #999;font-size: 14px}
638 }
639 }
640 .optiontitle {
641 font-size: 14px;
642 padding: 0 10px;
643 line-height: 1;
644 margin: 10px 0;
645 border-left: 2px solid #1ab394;
646 }
647
648 .optionFlex {
649 display: flex;
650 align-items: center;
651 padding: 10px 0;
652 width: 200px;
653
654 .name {
655 margin: 0 20px;
656 font-size: 16px;
657 }
658 }
659
660 .el-radio-group {
661 width: 100%;
662 display: block;
663 }
664
665 .athleteBox {
666 height: 80px;
667 display: flex;
668 align-items: center;
669
670 :deep(.el-radio__label) {
671 display: flex;
672 align-items: center;
673 margin: 0 20px;
674 }
675
676 .el-radio__inner {
677 scale: 1.5;
678 }
679
680 .name {
681 margin: 0 20px;
682 font-size: 16px;
683 }
684 }
685
686 .athleteBox:hover {
687 background: #efefef;
688 }
689
690 .tip {
691 font-size: 13px;
692 color: #999;
693 margin: 10px 0;
694
695 i {
696 color: red;
697 margin: 0 4px 0 0;
698 }
699 }
700
701 p.title {
702 font-size: 16px;
703 margin: 0 0 15px;
704 }
705
706 :deep(.el-collapse-item) {
707 background: #FBFCFD;
708 margin: 0 0 16px;
709 padding: 0 15px;
710 }
711
712 :deep(.el-collapse-item__wrap) {
713 background: #FBFCFD;
714 border: none;
715 padding: 0 10px;
716 }
717
718 :deep(.el-collapse) {
719 border: none;
720 }
721
722 :deep(.el-collapse-item__header) {
723 border: none;
724 background: #ececec;
725 padding: 0 0 0 10px; font-size: 15px;
726 }
727
728 :deep(.el-collapse-item__content) {
729 padding-bottom: 0;
730 }
731
732 :deep(.el-checkbox__input.is-disabled+span.el-checkbox__label) {
733 color: #4C5359;
734 }
735
736 .fake-collapse-item {
737 background: #FBFCFD;
738 margin: 0 0 16px;
739 padding: 0 15px;
740 }
741 :deep(.el-checkbox.el-checkbox--large .el-checkbox__label){
742 font-size: 16px;
743 }
744 .teammateList :deep(.el-checkbox.el-checkbox--large) {
745 height: auto;
746 }
747 </style>
1 <template>
2 <el-dialog
3 v-model="show" destroy-on-close :title="title" width="1000px" append-to-body
4 :close-on-click-modal="false" @close="delWatch"
5 >
6 <el-form
7 ref="ruleFormRef"
8 label-position="top" label-width="120px" class="chooseForm" :model="form"
9 :rules="rules"
10 >
11 <el-row class="athletesform">
12 <el-col v-show="signType!=0" :span="8" style="max-height: 70vh;overflow: auto;">
13 <el-form-item label="可报运动员" class="athletes">
14 <el-radio-group v-model="form.manId" class="ml-4">
15 <div v-for="item in athletesList" :key="item.id" :ref="item.id" class="mb20">
16 <el-radio-button :label="item.id" size="large" @change="changePersonal(item)">
17 <div class="optionFlex">
18 <el-avatar v-show="item.picUrl" :size="40" :src="item.picUrl" />
19 <p class="name">{{ item.realName }}
20 <span v-show="item.sex=='0'">(女)</span>
21 <span v-show="item.sex=='1'">(男)</span>
22 </p>
23 </div>
24 </el-radio-button>
25 <el-button
26 v-if="noPhotoCanSign=='0'&&(!item.picUrl)" class="ml20" type="text"
27 @click="editPersonInfo(item.id,nowMan.groupId)"
28 >上传照片
29 </el-button>
30 </div>
31 </el-radio-group>
32 </el-form-item>
33 </el-col>
34 <el-col v-loading="loading" :span="16" style="max-height: 70vh;overflow: auto;">
35 <el-empty v-show="treeData.length<1" description="请选择运动员" />
36 <el-collapse v-for="(project,index) in treeData" :key="project.id" v-model="activeNames">
37 <div v-show="project.hasNext==0&&project.canSign=='1'" class="fake-collapse-item">
38 <el-checkbox-group v-model="form.levelId" size="large">
39 <el-checkbox :label="project.levelId">{{ project.name }}</el-checkbox>
40 </el-checkbox-group>
41 </div>
42 <el-collapse-item v-show="project.hasNext==1&&project.canSign=='1'" :title="project.name" :name="index">
43 <div v-for="group in project.groupList" :key="group.id">
44 <div v-show="group.hasNext==0">
45 <el-checkbox-group v-model="form.levelId" size="large">
46 <el-checkbox v-show="group.canSign=='1'" :label="group.levelId">{{ group.name }}</el-checkbox>
47 <!-- <el-checkbox v-show="group.hasNext!=0" disabled :label="group.id">{{ group.name }}</el-checkbox>-->
48 </el-checkbox-group>
49 </div>
50
51 <div v-show="group.hasNext==1">
52 <el-checkbox-group
53 v-for="level in group.levelList" :key="level.id" v-model="form.levelId"
54 size="large"
55 >
56 <!-- project.type判断选队友 signId删除报项 :disabled="level.canSign==0||level.belongToThisTeam==0"-->
57 <el-checkbox v-show="level.canSign==1" :label="level.id" :checked="level.checked">
58 {{ group.name }}{{ level.name }}
59 <span v-show="level.levelType=='1'">(男)</span>
60 <span v-show="level.levelType=='2'">(女)</span>
61 </el-checkbox>
62 </el-checkbox-group>
63 </div>
64 </div>
65 </el-collapse-item>
66 </el-collapse>
67 </el-col>
68 </el-row>
69 </el-form>
70 <el-dialog v-model="showMateList" title="选择队友" width="700px" draggable @close="mateClose">
71 <div class="mb20">
72 <span v-if="mateConfig.minCount!=mateConfig.maxCount">请选择{{ mateConfig.minCount }}~{{
73 mateConfig.maxCount
74 }}个队友</span>
75 <span v-else-if="mateConfig.minCount=='-1'&&mateConfig.maxCount=='-1'">请至少选择1个队友</span>
76 <span v-else>请选择{{ mateConfig.minCount }}个队友</span>
77
78 <span v-if="mateConfig.minMaleCount>0||mateConfig.maxMaleCount>0" style="margin:0 20px;">男子:
79 <span v-show="mateConfig.minMaleCount!=mateConfig.maxMaleCount&&mateConfig.minMaleCount!=-1"> 最少{{ mateConfig.minMaleCount }}</span>
80 <span v-show="mateConfig.minMaleCount!=mateConfig.maxMaleCount&&mateConfig.maxMaleCount!=-1"> 最多{{ mateConfig.maxMaleCount }}</span>
81 <span v-show="mateConfig.minMaleCount==mateConfig.maxMaleCount&&mateConfig.maxMaleCount!=-1">{{ mateConfig.maxMaleCount }}</span>
82 </span>
83 <span v-if="mateConfig.minFemaleCount>0||mateConfig.maxFemaleCount>0" style="margin:0 20px;">女子:
84 <span v-show="mateConfig.minFemaleCount!=mateConfig.maxFemaleCount&&mateConfig.minFemaleCount>0"> 最少{{ mateConfig.minFemaleCount }}</span>
85 <span v-show="mateConfig.minFemaleCount!=mateConfig.maxFemaleCount&&mateConfig.maxFemaleCount>0"> 最多{{ mateConfig.maxFemaleCount }}</span>
86 <span v-show="mateConfig.minFemaleCount==mateConfig.maxFemaleCount&&mateConfig.minFemaleCount>0">{{ mateConfig.minFemaleCount }}</span>
87 </span>
88 <span v-show="form?.mates?.length>1" style="float: right" class="text-success">已选{{ form?.mates?.length-1 }}个队友</span>
89
90 </div>
91 <!-- <el-button v-if="teammateList.length<minCount" type="text" @click="addTeamMate">新增队友</el-button>-->
92 <el-empty v-if="teammateList.length==0" description="暂无可选队友" />
93 <div class="teammateList" style="max-height:60vh;overflow: auto;">
94 <el-checkbox-group v-model="form.mates" class="ml-4" @change="changeTeammates">
95 <el-checkbox disabled checked :label="personal.sex+'_'+personal.id" size="large">
96 <div class="optionFlex" style="width: auto;">
97 <el-avatar v-show="personal.picUrl" :size="40" :src="personal.picUrl" />
98 <p class="name" style="width: 200px">{{ personal.realName }}
99 <span v-show="personal.sex=='0'">(女)</span>
100 <span v-show="personal.sex=='1'">(男)</span>
101 </p>
102 <el-select v-show="sonLevelList.length>0" v-model="personal.sonlevel" clearable>
103 <el-option v-for="son in sonLevelList" :value="son.id" :label="son.name">{{ son.name }}</el-option>
104 </el-select>
105 </div>
106 </el-checkbox>
107
108 <div v-for="(item,index) in teammateList" :key="item.id" class="mb20">
109 <el-checkbox :label="item.sex+'_'+item.id" size="large" :disabled="item.cantchosemate">
110 <div class="optionFlex" style="width: auto;">
111 <span>{{ index+1 }}</span>
112 <el-avatar v-show="item.picUrl" :size="40" :src="item.picUrl" />
113 <p class="name" style="width: 200px">{{ item.realName }}
114 <span v-if="item.sex=='0'">(女)</span>
115 <span v-else>(男)</span>
116 </p>
117 <el-select v-show="sonLevelList.length>0" v-model="item.sonlevel" clearable>
118 <el-option v-for="son in sonLevelList" :value="son.id" :label="son.name">{{ son.name }}</el-option>
119 </el-select>
120 </div>
121 </el-checkbox>
122 <el-button v-if="noPhotoCanSign=='0'&&(!item.picUrl)" class="ml20" type="text" @click="editPersonInfo(item.id,nowMan.groupId)">
123 上传照片
124 </el-button>
125 </div>
126 </el-checkbox-group>
127 </div>
128
129 <template #footer>
130 <div class="dialog-footer text-center">
131 <el-button type="primary" @click="chooseMateDone">确定</el-button>
132 </div>
133 </template>
134
135 </el-dialog>
136
137
138 <dialogPersonInfo ref="editPersonInfoRef" @submitForm="getAthletesList" />
139
140 </el-dialog>
141 </template>
142
143 <script setup>
144 import { reactive, ref, toRefs, watch } from 'vue'
145 import { getCurrentInstance, nextTick, onMounted } from '@vue/runtime-core'
146 import * as match from '@/apiPc/match'
147 import { ElMessage } from 'element-plus'
148
149 const { proxy } = getCurrentInstance()
150 const emit = defineEmits(['submitForm'])
151 import dialogPersonInfo from '../components/addCoach'
152 import _ from 'lodash'
153
154 const data = reactive({
155 show: false,
156 title: '',
157 signType: '',
158 form: {
159 levelId: [],
160 mates: []
161 },
162 athletesList: [],
163 signProjectList: [],
164 signGroupList: [],
165 showMateList: false,
166 showBtn: false,
167 teammateList: [],
168 rankId: '0',
169 treeData: [],
170 loading: false,
171 mateConfig: {},
172 noPhotoCanSign: null,
173 coachOrLeaderFlag: null,
174 personal: {},
175 activeNames: [0]
176 })
177 const {
178 signType,
179 form,
180 rules,
181 loading,
182 activeNames,
183 athletesList,
184 treeData,
185 show,
186 title,
187 personal,
188 rankId,
189 showMateList,
190 showBtn,
191 teammateList,
192 mateConfig,
193 noPhotoCanSign,
194 coachOrLeaderFlag
195 } = toRefs(data)
196 let matchId
197 let groupId
198 watch(show, (val) => {
199 if (!val) {
200 form.value = {}
201 treeData.value = []
202 delWatch()
203 }
204 })
205 const changePersonal = (item) => {
206 // delWatch()
207 personal.value = item
208 form.value.manId = item.id
209 getTree()
210 }
211
212 function getTree() {
213 noLevelId = ''
214 loading.value = true
215 match.getMySignListTree(matchId, form.value.manId, rankId.value).then(res => {
216 treeData.value = res.data
217 // 循环项目,组,级别 赋值是否checked
218 getMyIsSign()
219 })
220 }
221
222 let signOk = {}
223
224 function getMyIsSign() {
225 delWatch()
226 form.value.levelId = []
227 match.getMySignIds(matchId, form.value.manId, rankId.value).then(res => {
228 loading.value = false
229 signOk = res.data
230 for (const s of signOk) {
231 form.value.levelId.push(s.eid)
232 for (const p of treeData.value) {
233 if (p.levelId == s.eid) {
234 p.checked = true
235 p.signId = s.signId
236 p.belongToThisTeam = s.belongToThisTeam
237 } else {
238 for (const g of p.groupList) {
239 g.type = p.type
240 if (g.levelId == s.eid) {
241 g.checked = true
242 g.signId = s.signId
243 g.belongToThisTeam = s.belongToThisTeam
244 } else {
245 for (const l of g.levelList) {
246 l.type = p.type
247 if (s.eid == l.id) {
248 l.checked = true
249 l.signId = s.signId
250 l.belongToThisTeam = s.belongToThisTeam
251 }
252 }
253 }
254 }
255 }
256 }
257 }
258 if (signOk.length < 1) {
259 for (const p of treeData.value) {
260 for (const g of p.groupList) {
261 g.type = p.type
262 for (const l of g.levelList) {
263 l.type = p.type
264 }
265 }
266 }
267 }
268 addWatch()
269 })
270 }
271
272 //#region 监听叶子的数量变化
273 let noLevelId
274 let levelInfo
275 let watchHandle = null
276
277 function addWatch() {
278 delWatch()
279 watchHandle = watch(() => form.value.levelId, (newValue, oldValue) => {
280 if (!newValue) return
281 oldValue = _.uniq(oldValue)
282 newValue = _.uniq(newValue)
283 // console.log(newValue, oldValue)
284 let temp
285 let isAdd = false
286 if (newValue?.length > oldValue?.length) {
287 isAdd = true
288 temp = _.difference(newValue, oldValue)
289 } else {
290 isAdd = false
291 temp = _.difference(oldValue, newValue)
292 }
293 if (newValue[0] == temp[0]) {
294
295 }
296 if (temp.length === 1) {
297 levelInfo = findlevelInfo(temp[0], treeData.value, 1)
298 if (isAdd) {
299 noLevelId = temp[0]
300 judgeChooseTeam(levelInfo.type, temp[0])
301 } else {
302 if (!temp[0] || temp[0] == undefined) {
303 return
304 }
305 removeThis(levelInfo.signId)
306 }
307 }
308 // console.log(isAdd, temp[0])
309 })
310 }
311
312 function delWatch() {
313 if (watchHandle) {
314 watchHandle()
315 watchHandle = null
316 }
317 }
318
319 function findlevelInfo(id, list, deep) {
320 let info = null
321 _.some(list, (l) => {
322 switch (deep) {
323 case 1:// p
324 if (l.levelId == id) {
325 info = l
326 } else {
327 info = findlevelInfo(id, l.groupList, 2)
328 }
329 break
330 case 2:// g
331 if (l.levelId == id) {
332 info = l
333 } else {
334 info = findlevelInfo(id, l.levelList, 3)
335 }
336 break
337 case 3:// l
338 if (l.id == id) {
339 info = l
340 }
341 break
342 }
343 return info
344 })
345
346 return info
347 }
348
349 //#endregion
350 function getAthletesList() {
351 match.getMyGroupForCpt(groupId, matchId).then(res => {
352 athletesList.value = res.data.athletes
353 if (form.value.manId) {
354 for (const a of athletesList.value) {
355 if (a.id == form.value.manId) {
356 nowMan.value = a
357 }
358 }
359 }
360 })
361 }
362
363 const open = (params) => {
364 show.value = true
365 matchId = params.matchId
366 groupId = params.groupId
367 signType.value = params.signType
368 title.value = params.title
369 rankId.value = params.rankId || ''
370 noPhotoCanSign.value = params.noPhotoCanSign
371 coachOrLeaderFlag.value = params.coachOrLeaderFlag
372 if (params.personal) {
373 form.value.manId = params.personal.id
374 setTimeout(() => {
375 proxy.$refs[params.personal.id][0].scrollIntoView({ block: 'start', behavior: 'smooth' })
376 }, 200)
377
378 getTree()
379 personal.value = params.personal
380 }
381 if (groupId != 0) {
382 if (params.choosedList) {
383 athletesList.value = params.choosedList
384 if (form.value.manId) {
385 for (const a of athletesList.value) {
386 if (a.id == form.value.manId) {
387 nowMan.value = a
388 }
389 }
390 }
391 } else {
392 getAthletesList()
393 }
394 }
395 }
396 defineExpose({
397 open
398 })
399
400 const nowMan = ref({})
401 const sonLevelList = ref([])
402 let sonLevelIds = []
403
404 function editPersonInfo(id, groupId) {
405 const params = {
406 id: id,
407 groupId: groupId
408 }
409 proxy.$refs['editPersonInfoRef'].open(params)
410 }
411
412 function addTeamMate() {
413 const params = {
414 id: 0,
415 groupId: groupId
416 }
417 proxy.$refs['editPersonInfoRef'].open(params)
418 }
419 function transferChange(value, direction, movedKeys) {
420 console.log(value, direction, movedKeys)
421 }
422 const judgeChooseTeam = (type, levelId) => {
423 const tmArr = ['1', '2', '3', '4', '6']
424 if (tmArr.indexOf(type) > -1) {
425 getTeammate(levelId)
426 } else {
427 const obj = {
428 levelId: levelId,
429 athleteIds: form.value.manId,
430 groupId: groupId,
431 teamId: rankId.value || ''
432 }
433 saveOne(obj)
434 }
435 }
436 const getTeammate = (levelId) => {
437 const obj = {
438 levelId: levelId,
439 groupId: groupId,
440 personId: form.value.manId
441 }
442 match.getCanSignLevelPerson(obj).then(res => {
443 mateConfig.value = res.data
444 teammateList.value = res.data.personList
445 for (const p of teammateList.value) {
446 p.cantchosemate = false
447 if (mateConfig.value.maxMaleCount == 0 && p.sex == '1') {
448 p.cantchosemate = true
449 }
450 if (mateConfig.value.maxFemaleCount == 0 && p.sex == '0') {
451 p.cantchosemate = true
452 }
453 }
454 getSonLevels(levelId)
455 showMateList.value = true
456 form.value.mates = []
457 sonLevelIds = []
458 personal.value.sonlevel = ''
459 }).catch(error => {
460 getMyIsSign()
461 })
462 }
463
464 function getSonLevels(level) {
465 sonLevelList.value = []
466 match.querySonLevel(level).then(res => {
467 sonLevelList.value = res.data
468 })
469 }
470
471 let manNum = 0
472 let femaleNum = 0
473 let mates = []
474 const changeTeammates = (e) => {
475 mates = []
476 manNum = 0
477 femaleNum = 0
478 for (const m of e) {
479 const arr = m.split('_')
480 mates.push(arr[1])
481 if (personal.value.id == arr[1]) {
482 continue
483 }
484 if (arr[0] == '1') {
485 manNum++
486 } else {
487 femaleNum++
488 }
489 }
490 // console.log(mates, mateConfig.value)
491 for (const p of teammateList.value) {
492 if (mateConfig.value.maxMaleCount != -1 && manNum == mateConfig.value.maxMaleCount && p.sex == '1' && mates.indexOf(p.id) == -1) {
493 p.cantchosemate = true
494 } else if (mateConfig.value.maxFemaleCount != -1 && femaleNum == mateConfig.value.maxFemaleCount && p.sex == '0' && mates.indexOf(p.id) == -1) {
495 p.cantchosemate = true
496 } else if (mates.indexOf(p.id) == -1 && mateConfig.value.maxCount != -1 && (mates.length - 1) == mateConfig.value.maxCount) {
497 p.cantchosemate = true
498 } else {
499 p.cantchosemate = false
500 }
501 }
502 }
503 const mateClose = () => {
504 mates = []
505 form.value.mates = []
506 sonLevelIds = []
507 teammateList.value = []
508 getMyIsSign()
509 }
510
511 function chooseMateDone() {
512 if (mateConfig.value.minMaleCount != '-1' && mateConfig.value.minMaleCount != '0' && manNum < mateConfig.value.minMaleCount) {
513 ElMessage.error(`至少选择${mateConfig.value.minMaleCount}个男队友`)
514 return
515 }
516 if (mateConfig.value.maxMaleCount != '-1' && mateConfig.value.maxMaleCount != '0' && manNum > mateConfig.value.maxMaleCount) {
517 ElMessage.error(`最多选择${mateConfig.value.maxMaleCount}个男队友`)
518 return
519 }
520 if (mateConfig.value.minFemaleCount != '-1' && mateConfig.value.minFemaleCount != '0' && femaleNum < mateConfig.value.minFemaleCount) {
521 ElMessage.error(`至少选择${mateConfig.value.minFemaleCount}个女队友`)
522 return
523 }
524 if (mateConfig.value.maxFemaleCount != '-1' && mateConfig.value.maxFemaleCount != '0' && femaleNum > mateConfig.value.maxFemaleCount) {
525 ElMessage.error(`最多选择${mateConfig.value.maxFemaleCount}个女队友`)
526 return
527 }
528 if ((mates.length < mateConfig.value.minCount) && mateConfig.value.minCount > 0) {
529 ElMessage.error(`至少选择${mateConfig.value.minCount}个队友`)
530 return
531 }
532 const athleteIds = []
533 console.log('mates', mates)
534 for (const p of teammateList.value) {
535 if (mates.indexOf(p.id) != -1) {
536 if (sonLevelList.value.length > 0 && !p.sonlevel) {
537 ElMessage.error(`请分配级别`)
538 return
539 }
540 sonLevelIds.push(p.sonlevel)
541 athleteIds.push(p.id)
542 }
543 }
544 if (sonLevelList.value.length > 0 && !personal.value.sonlevel) {
545 ElMessage.error(`请分配级别`)
546 return
547 }
548 sonLevelIds.push(personal.value.sonlevel)
549 athleteIds.push(personal.value.id)
550 if (sonLevelList.value.length == 0) {
551 sonLevelIds = []
552 }
553 const obj = {
554 levelId: noLevelId,
555 athleteIds: athleteIds.toString(),
556 sonLevelIds: sonLevelIds.toString() || '',
557 groupId: groupId,
558 teamId: rankId.value || ''
559 }
560 // 半提交
561 saveOne(obj)
562 }
563
564 const saveOne = (obj) => {
565 loading.value = true
566 match.sportsmanDone(obj).then(res => {
567 if (res.msg.indexOf('Exception:') > -1) {
568 const msg = res.msg.slice(10)
569 ElMessage({
570 type: 'warning',
571 message: msg
572 })
573 // form.value.mates = []
574 sonLevelIds = []
575 getMyIsSign()
576 return
577 }
578 sonLevelIds = []
579 // form.value.mates = []
580 showMateList.value = false
581 sonLevelList.value = []
582 getMyIsSign()
583 emit('submitForm')
584 }).catch(err => {
585 // 取消这个勾
586 getMyIsSign()
587 sonLevelIds = []
588 })
589 }
590
591 function removeThis(id) {
592 loading.value = true
593 match.deleteSign(id).then(res => {
594 // 重新获取已报名信息
595 loading.value = false
596 emit('submitForm')
597 }).catch(err => {
598 getMyIsSign()
599 })
600 }
601 </script>
602
603 <style lang="scss" scoped>
604 .optiontitle {
605 font-size: 14px;
606 padding: 0 10px;
607 line-height: 1;
608 margin: 10px 0;
609 border-left: 2px solid #1ab394;
610 }
611
612 .optionFlex {
613 display: flex;
614 align-items: center;
615 padding: 10px 0;
616 width: 200px;
617
618 .name {
619 margin: 0 20px;
620 font-size: 16px;
621 }
622 }
623
624 .el-radio-group {
625 width: 100%;
626 display: block;
627 }
628
629 .athleteBox {
630 height: 80px;
631 display: flex;
632 align-items: center;
633
634 :deep(.el-radio__label) {
635 display: flex;
636 align-items: center;
637 margin: 0 20px;
638 }
639
640 .el-radio__inner {
641 scale: 1.5;
642 }
643
644 .name {
645 margin: 0 20px;
646 font-size: 16px;
647 }
648 }
649
650 .athleteBox:hover {
651 background: #efefef;
652 }
653
654 .tip {
655 font-size: 13px;
656 color: #999;
657 margin: 10px 0;
658
659 i {
660 color: red;
661 margin: 0 4px 0 0;
662 }
663 }
664
665 p.title {
666 font-size: 16px;
667 margin: 0 0 15px;
668 }
669
670 :deep(.el-collapse-item) {
671 background: #FBFCFD;
672 margin: 0 0 16px;
673 padding: 0 15px;
674 }
675
676 :deep(.el-collapse-item__wrap) {
677 background: #FBFCFD;
678 border: none;
679 padding: 0 10px;
680 }
681
682 :deep(.el-collapse) {
683 border: none;
684 }
685
686 :deep(.el-collapse-item__header) {
687 border: none;
688 background: #ececec;
689 padding: 0 0 0 10px; font-size: 15px;
690 }
691
692 :deep(.el-collapse-item__content) {
693 padding-bottom: 0;
694 }
695
696 :deep(.el-checkbox__input.is-disabled+span.el-checkbox__label) {
697 color: #4C5359;
698 }
699
700 .fake-collapse-item {
701 background: #FBFCFD;
702 margin: 0 0 16px;
703 padding: 0 15px;
704 }
705 :deep(.el-checkbox.el-checkbox--large .el-checkbox__label){
706 font-size: 16px;
707 }
708 .teammateList :deep(.el-checkbox.el-checkbox--large) {
709 height: auto;
710 }
711 </style>
...@@ -3,10 +3,14 @@ ...@@ -3,10 +3,14 @@
3 <div class="box"> 3 <div class="box">
4 <el-card class="mb60 mt30"> 4 <el-card class="mb60 mt30">
5 <div class="text-center mt30"> 5 <div class="text-center mt30">
6 <el-icon color="#32B16C" size="80"><SuccessFilled /></el-icon> 6 <el-icon color="#32B16C" size="80">
7 <p class="text-success mb20">{{ language==0?'支付成功':'successfully!' }}</p> 7 <SuccessFilled/>
8 </el-icon>
9 <p class="text-success mb20">{{ language == 0 ? '支付成功' : 'successfully!' }}</p>
8 10
9 <el-button type="primary" class="btn-lineG mb60" @click="goBillDetail" round>{{ language==0?'返回订单详情':'Return order details' }}</el-button> 11 <el-button type="primary" class="btn-lineG mb60" @click="goBillDetail" round>
12 {{ language == 0 ? '返回订单详情' : 'Return order details' }}
13 </el-button>
10 </div> 14 </div>
11 </el-card> 15 </el-card>
12 </div> 16 </div>
...@@ -16,22 +20,24 @@ ...@@ -16,22 +20,24 @@
16 <script setup> 20 <script setup>
17 import {ref} from "vue"; 21 import {ref} from "vue";
18 import cache from "@/plugins/cache"; 22 import cache from "@/plugins/cache";
19 import {useRoute,useRouter} from "vue-router"; 23 import {useRoute, useRouter} from "vue-router";
20 import {onMounted} from "@vue/runtime-core"; 24 import {onMounted} from "@vue/runtime-core";
21 import {callbackPalPay} from "@/apiPc/match"; 25 import {callbackPalPay} from "@/apiPc/match";
26
22 const route = useRoute() 27 const route = useRoute()
23 const router = useRouter() 28 const router = useRouter()
24 const language = ref(cache.local.get('language') || 0) 29 const language = ref(cache.local.get('language') || 0)
25 const orderId = ref(route.query.orderId) 30 const orderId = ref(route.query.orderId)
26 31
27 onMounted(()=>{ 32 onMounted(() => {
28 callbackPalPay(route.query.orderId).then(res=>{ 33 callbackPalPay(route.query.orderId).then(res => {
29 34
30 }) 35 })
31 }) 36 })
37
32 function goBillDetail() { 38 function goBillDetail() {
33 router.push({ 39 router.push({
34 name:`signPay`, 40 name: `signPay`,
35 query: { 41 query: {
36 orderId: route.query.orderId 42 orderId: route.query.orderId
37 } 43 }
......
...@@ -131,13 +131,14 @@ const zuQuery = ref({ ...@@ -131,13 +131,14 @@ const zuQuery = ref({
131 groupName:'' 131 groupName:''
132 }) 132 })
133 onMounted(()=>{ 133 onMounted(()=>{
134 // console.log(route.query) 134 Promise.all([
135 getSignList() 135 getMatch(),
136 getSignList(),
136 getFee(groupId.value) 137 getFee(groupId.value)
138 ])
137 if(user.utype=='1'){ 139 if(user.utype=='1'){
138 getMyMemberTable() 140 getMyMemberTable()
139 } 141 }
140 getMatch()
141 }) 142 })
142 function getMatch() { 143 function getMatch() {
143 match.getMatchById({ 144 match.getMatchById({
...@@ -151,7 +152,6 @@ function getMyMemberTable() { ...@@ -151,7 +152,6 @@ function getMyMemberTable() {
151 myMemberTable.value = res.rows 152 myMemberTable.value = res.rows
152 }) 153 })
153 } 154 }
154
155 function getSignList() { 155 function getSignList() {
156 match.getMySignInfoList(zuQuery.value).then(res=>{ 156 match.getMySignInfoList(zuQuery.value).then(res=>{
157 signInfoList.value = res.data.singleData 157 signInfoList.value = res.data.singleData
......
1 <template>
2 <div class="app-container">
3
4 <div class="box ph-30">
5 <div class="panel">
6 <div class="panel-header">
7 <h3 class="panel-title">填写报名信息</h3>
8 </div>
9 <div class="panel-body">
10 <el-form ref="ruleFormRef" label-width="120px" class="signForm" :model="form" :rules="rules">
11 <el-row>
12 <el-col :span="8" :offset="2">
13 <el-form-item label="照片" prop="picUrl">
14 <ImageUpload v-model="form.picUrl" class="threeFour" :limit="1" :is-show-tip="false" />
15 <span class="tip"><i>*</i>请上传近期 彩色免冠照片</span>
16 </el-form-item>
17 </el-col>
18 <el-col :span="10">
19 <el-form-item label="姓名" prop="realName">
20 <el-input v-model="form.realName" placeholder="请输入姓名" />
21 </el-form-item>
22
23 <el-form-item label="证件类型" prop="idcType">
24 <el-select v-model="form.idcType" placeholder="请选择证件类型">
25 <el-option
26 v-for="item in certificates"
27 :key="item.value"
28 :label="item.label"
29 :value="item.value"
30 />
31 </el-select>
32 </el-form-item>
33 <el-form-item label="证件号码" prop="idcCode">
34 <el-input v-model="form.idcCode" placeholder="请输入证件号码" @blur="checkCode" />
35 </el-form-item>
36 <el-form-item label="性别" prop="sex">
37 <el-radio-group v-model="form.sex">
38 <el-radio label="1" size="large"></el-radio>
39 <el-radio label="0" size="large"></el-radio>
40 </el-radio-group>
41 </el-form-item>
42 <el-form-item label="出生日期" prop="birth">
43 <el-date-picker
44 v-model="form.birth"
45 type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
46 placeholder="请选择出生日期"
47 />
48 </el-form-item>
49
50 <el-form-item label="联系方式" prop="phone">
51 <el-input v-model="form.phone" placeholder="请输入联系方式" />
52 </el-form-item>
53 <el-form-item label="国籍" prop="countryId">
54 <el-select v-model="form.countryId" class="m-2" @change="changeCountryId">
55 <el-option v-for="item in countryList" :key="item.id" :label="language==0?item.name:item.enName" :value="item.id" />
56 </el-select>
57 </el-form-item>
58 <el-form-item label="民族" prop="nation">
59 <el-select v-model="form.nation" style="width: 100%;">
60 <el-option
61 v-for="item in nationList"
62 :key="item.name"
63 :label="item.name"
64 :value="item.name"
65 />
66 </el-select>
67 </el-form-item>
68 </el-col>
69 </el-row>
70 </el-form>
71 <el-row v-if="participantsInfoArr&&participantsInfoArr.length>0">
72 <el-col :span="16" :offset="4">
73 <el-form label-width="120px">
74 <h3>补充信息</h3>
75 <el-form-item v-for="(s,index) in participantsInfoArr" :key="index">
76 <template #label>
77 <span v-if="s.status == 0" class="red">*</span>{{ s.name }}
78 </template>
79 <el-input v-if="s.type == '0'" v-model="s.value" />
80 <el-input v-if="s.type == '1'" v-model="s.value" type="number" />
81 <el-select v-if="s.type == '4'" v-model="s.value" class="m-2">
82 <el-option v-for="item in s.option" :key="item.id" :label="item.name" :value="item.name" />
83 </el-select>
84 <ImageUpload
85 v-if="s.type == '3'" v-model="s.value" :limit="1"
86 :is-show-tip="false"
87 />
88 <!-- 文件 2-->
89 <FileUpload v-if="s.type == '2'" v-model="s.fixWxFile" :action="uploadUrl" />
90
91 </el-form-item>
92 </el-form>
93 </el-col>
94 </el-row>
95 </div>
96 <div class="panel-footer text-center">
97 <el-button type="danger" plain round @click="goPrev()">上一步</el-button>
98 <el-button v-if="personId!='0'" type="success" round @click="goBack()">完成</el-button>
99 <el-button v-else type="danger" round @click="submitForm()">下一步</el-button>
100 </div>
101 </div>
102 </div>
103 </div>
104 </template>
105
106 <script setup>
107 import { reactive } from 'vue'
108 import { getCurrentInstance, onMounted } from '@vue/runtime-core'
109 import * as match from '@/apiPc/match'
110 import { toRefs } from '@vueuse/shared'
111 import { useRouter } from 'vue-router'
112 import { ElMessage } from 'element-plus'
113
114 const uploadUrl = ref('/upload/upLoadToFileServer')
115 const { proxy } = getCurrentInstance()
116 const router = useRouter()
117 const route = useRoute()
118 import { nationList } from '@/assets/js/data'
119
120 const data = reactive({
121 form: {
122 idcType: 0,
123 countryId: 240,
124 nation: '汉族'
125 },
126 rules: {
127 // picUrl: { required: true, message: '请上传您的照片', trigger: 'blur' },
128 // idcFrontImg: { required: true, message: '请上传身份证正面', trigger: 'blur' },
129 // idcBackImg: { required: true, message: '请上传身份证反面', trigger: 'blur' },
130 realName: { required: true, message: '请填写您的姓名', trigger: 'blur' },
131 sex: { required: true, message: '请选择您的性别', trigger: 'change' },
132 birth: { required: true, message: '请填写您的生日', trigger: 'blur' },
133 idcType: { required: true, message: '请选择您的证件', trigger: 'change' },
134 idcCode: { required: true, message: '请填写您的证件号', trigger: 'blur' }
135 // phone: { required: true, message: '请填写您的联系方式', trigger: 'blur' }
136 },
137 certificates: [
138 {
139 value: '0',
140 label: '居民身份证'
141 },
142 {
143 value: '1',
144 label: '护照'
145 },
146 {
147 value: '2',
148 label: '其他'
149 }
150 ],
151 participantsInfoArr: [],
152 noPhotoCanSign: '',
153 countryList: [],
154 personId: '0'
155 })
156 const {
157 form, rules, certificates, participantsInfoArr, noPhotoCanSign, countryList, personId
158 } = toRefs(data)
159 let matchId = ''
160 const extraId = ''
161 onMounted(() => {
162 const params = route.params
163 const query = route.query
164 matchId = params.id
165 // 获取赛事详情
166 init(matchId)
167 getCountryList()
168 })
169 let coachOrLeaderFlag
170
171 function init(matchId) {
172 match.getMatchById({ id: matchId }).then(res => {
173 coachOrLeaderFlag = res.data.coachOrLeaderFlag
174 noPhotoCanSign.value = res.data.noPhotoCanSign
175 if (res.data.participantsInfo) {
176 participantsInfoArr.value = JSON.parse(res.data.participantsInfo)
177 }
178 match.getMyPersonInfoWithcptId(matchId).then(res => {
179 form.value = res.data
180 if (res.data.cptPersonInfo?.personInfo) {
181 // 补充字段信息
182 participantsInfoArr.value = JSON.parse(form.value.cptPersonInfo.personInfo)
183 for (var n of participantsInfoArr.value) {
184 if (n.type == '3' && n.value.url) {
185 // 图片
186 n.value = n.value.url
187 }
188 if (n.type == '2') {
189 // 文件
190 var arr = [{
191 name: n.value.name,
192 url: n.value.url
193 }]
194 n.fixWxFile = arr
195 }
196 }
197 }
198 })
199 })
200 }
201
202 function getCountryList() {
203 match.countryList().then(res => {
204 countryList.value = res.data
205 })
206 }
207
208 function goBack() {
209 let fileInfo = {}
210 for (const n of participantsInfoArr.value) {
211 if (n.status == 0 && (!n.value && !n.fixWxFile)) {
212 ElMessage.error('请完善必填字段')
213 return
214 }
215 if (n.type == '2') {
216 const temp = n.fixWxFile[0].name.split('.')
217 fileInfo = {
218 url: n.fixWxFile[0].url,
219 name: n.fixWxFile[0].name,
220 extname: temp[temp.length - 1]
221 }
222 n.value = fileInfo
223 }
224 }
225 let obj = {}
226 if (extraId != '0') { // 修改
227 obj = {
228 cptId: matchId,
229 personId: form.value.id,
230 id: extraId,
231 personInfo: JSON.stringify(participantsInfoArr.value)
232 }
233 } else { // 没填过
234 obj = {
235 cptId: matchId,
236 personId: form.value.id,
237 personInfo: JSON.stringify(participantsInfoArr.value)
238 }
239 }
240 match.saveSupplementInfo(obj).then(res => {
241 // 返回
242 router.go(-1)
243 })
244 }
245
246 function goPrev() {
247 router.go(-1)
248 }
249
250 function changeCountryId() {
251 if (form.value.countryId != 240) {
252 form.value.nation = '其他'
253 }
254 }
255
256 function checkCode() {
257 if (form.value.idcType == 0 && form.value.idcCode) {
258 if (!(/(^\d{15}$)|(^\d{17}([0-9]|X)$)/.test(form.value.idcCode))) {
259 ElMessage.error('请输入正确的身份证号码')
260 } else {
261 let tmpStr = ''
262 if (form.value.idcCode.length == 15) {
263 tmpStr = form.value.idcCode.substring(6, 12)
264 tmpStr = '19' + tmpStr
265 tmpStr = tmpStr.substring(0, 4) + '-' + tmpStr.substring(4, 6) + '-' + tmpStr.substring(6)
266 } else {
267 tmpStr = form.value.idcCode.substring(6, 14)
268 tmpStr = tmpStr.substring(0, 4) + '-' + tmpStr.substring(4, 6) + '-' + tmpStr.substring(6)
269 }
270 form.value.birth = tmpStr
271
272 const res = /^(\d{6})(\d{4})(\d{2})(\d{2})(\d{3})([0-9]|X)$/
273 if (form.value.idcCode && res.test(form.value.idcCode)) {
274 const genderCode = form.value.idcCode.charAt(16)
275 if (parseInt(genderCode) % 2 == 0) {
276 form.value.sex = '0'
277 } else {
278 form.value.sex = '1'
279 }
280 }
281 }
282 }
283 }
284
285 function submitForm() {
286 proxy.$refs['ruleFormRef'].validate((valid, fields) => {
287 if (valid) {
288 // var pattern = /^1[345789]\d{9}$/
289 // if (!pattern.test(form.value.phone)) {
290 // ElMessage.error('请输入正确的手机号')
291 // return
292 // }
293 if (form.value.idcType == 0 && !(/(^\d{15}$)|(^\d{17}([0-9]|X)$)/.test(form.value.idcCode))) {
294 ElMessage.error('请输入正确的身份证号码')
295 return
296 }
297 // 验证补充信息必填
298 for (const n of participantsInfoArr.value) {
299 if (n.status == 0 && (!n.value && !n.fixWxFile)) {
300 ElMessage.error(`请完善${n.name}信息`)
301 return
302 }
303 }
304 if (participantsInfoArr.value) {
305 let fileInfo = {}
306 for (var p of participantsInfoArr.value) {
307 if (p.type == '2' && p.fixWxFile) {
308 const temp = p.fixWxFile[0].name.split('.')
309 fileInfo = {
310 url: p.fixWxFile[0].url,
311 name: p.fixWxFile[0].name,
312 extname: temp[temp.length - 1]
313 }
314 p.value = fileInfo
315 }
316 }
317 }
318
319
320 let obj = {}
321 if (form.value.cptPersonInfo == null) {
322 obj = {
323 cptId: matchId,
324 personId: form.value.id,
325 personInfo: JSON.stringify(participantsInfoArr.value)
326 }
327 } else {
328 obj = {
329 cptId: matchId,
330 id: form.value.cptPersonInfo.id,
331 personId: form.value.id,
332 personInfo: JSON.stringify(participantsInfoArr.value)
333 }
334 }
335 form.value.label = '0'
336 match.saveMyBaseInfo(form.value).then(res => {
337 obj.personId = res.data
338 match.saveSupplementInfo(obj).then(res2 => {
339 if (coachOrLeaderFlag == '0') {
340 // 不选教练 去选项目
341 router.push({
342 path: `chooseProject`,
343 query: {
344 matchId: matchId
345 }
346 })
347 } else {
348 router.push({
349 path: `chooseCoach`,
350 query: {
351 matchId: matchId,
352 signType: '0'
353 }
354 })
355 }
356 })
357 })
358 } else {
359 console.log(form.value, fields)
360 }
361 })
362 }
363
364 </script>
365
366 <style scoped lang="scss">
367 .app-container {
368 padding: 0;
369 background: #F5F7F9;
370 }
371
372 .panel-footer .el-button--danger {
373 padding: 0 40px;
374 }
375
376 .signForm {
377 .el-form-item__label {
378 color: #4C5359;
379 }
380 }
381
382 .tip {
383 font-size: 13px;
384 color: #999;
385 margin: 10px 0;
386
387 i {
388 color: red;
389 margin: 0 4px 0 0;
390 }
391 }
392
393 .threeFour {
394 width: 100%;
395 }
396
397 :deep(.el-upload--picture-card) {
398 width: 120px;
399 height: 160px;
400 }
401
402 :deep(.el-upload-list--picture-card .el-upload-list__item) {
403 width: 120px;
404 height: 160px;
405 }
406
407 .red {
408 color: #f56c6c;
409 }
410 </style>
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
15 <el-row> 15 <el-row>
16 <el-col :lg="8" :offset="2"> 16 <el-col :lg="8" :offset="2">
17 <el-form-item :label="language==0?'团体Logo':'Group Logo'" prop="imgUrl"> 17 <el-form-item :label="language==0?'团体Logo':'Group Logo'" prop="imgUrl">
18 <ImageUpload2 v-model="form.imgUrl" :crop-width="200" :crop-height="200" :limit="1"/> 18 <ImageUpload2 v-model="form.imgUrl" :is-show-tip="false" :crop-width="200" :crop-height="200" :limit="1"/>
19 <span class="tip" v-if="language==0">请上传不超过 <i>5M</i> 的文件 格式为 <i>png/jpg/jpeg</i> 的文件</span> 19 <span class="tip" v-if="language==0">请上传不超过 <i>5M</i> 的文件 格式为 <i>png/jpg/jpeg</i> 的文件</span>
20 <span class="tip" v-else>Please upload a file in the format of 20 <span class="tip" v-else>Please upload a file in the format of
21 <i>png/jpg/jpeg</i> that does not exceed <i>5MB</i> 21 <i>png/jpg/jpeg</i> that does not exceed <i>5MB</i>
...@@ -30,10 +30,10 @@ ...@@ -30,10 +30,10 @@
30 <el-input v-model="form.name" :placeholder="language==0?'请输入团体名称':''" /> 30 <el-input v-model="form.name" :placeholder="language==0?'请输入团体名称':''" />
31 </el-form-item> 31 </el-form-item>
32 <el-form-item :label="language==0?'负责人姓名':'Contact Person'" prop="contactPerson"> 32 <el-form-item :label="language==0?'负责人姓名':'Contact Person'" prop="contactPerson">
33 <el-input v-model="form.contactPerson" placeholder="请输入联系人" /> 33 <el-input v-model="form.contactPerson" :placeholder="language==0?'请输入联系人':''" />
34 </el-form-item> 34 </el-form-item>
35 <el-form-item :label="language==0?'邮箱':'Email'" required prop="contactEmail"> 35 <el-form-item :label="language==0?'邮箱':'Email'" required prop="contactEmail">
36 <el-input v-model="form.contactEmail" type="email" placeholder="请输入内容"/> 36 <el-input v-model="form.contactEmail" type="email" :placeholder="language==0?'请输入内容':''"/>
37 </el-form-item> 37 </el-form-item>
38 <el-form-item :label="language==0?'团体类型':'Group type'" prop="type"> 38 <el-form-item :label="language==0?'团体类型':'Group type'" prop="type">
39 <el-select v-model="form.type" :placeholder="language==0?'请选择团体类型':''" style="width: 100%;"> 39 <el-select v-model="form.type" :placeholder="language==0?'请选择团体类型':''" style="width: 100%;">
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
45 </el-select> 45 </el-select>
46 </el-form-item> 46 </el-form-item>
47 <el-form-item :label="language==0?'详细地址':'Detailed Address'" required prop="address"> 47 <el-form-item :label="language==0?'详细地址':'Detailed Address'" required prop="address">
48 <el-input type="textarea" v-model="form.address" class="mt10" placeholder="请输入详细地址"/> 48 <el-input type="textarea" v-model="form.address" class="mt10" :placeholder="language==0?'请输入详细地址':''"/>
49 </el-form-item> 49 </el-form-item>
50 50
51 51
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
66 </el-select> 66 </el-select>
67 <ImageUpload v-if="s.type == '3'" v-model="s.value" :limit="1" :is-show-tip="false" /> 67 <ImageUpload v-if="s.type == '3'" v-model="s.value" :limit="1" :is-show-tip="false" />
68 <!-- 文件 2--> 68 <!-- 文件 2-->
69 <FileUpload v-if="s.type == '2'" v-model="s.fixWxFile" :action="uploadUrl" :accept="accept" /> 69 <FileUpload v-if="s.type == '2'" :button-text="language==0?'上传文件':'Upload file'" :is-show-tip="false" v-model="s.fixWxFile" :action="uploadUrl" :accept="accept" />
70 70
71 </el-form-item> 71 </el-form-item>
72 </el-col> 72 </el-col>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!