成绩与证书:教练和领队分开显示

This commit is contained in:
马梓彭 2026-03-30 11:28:04 +08:00
parent dad13093a4
commit 2f5581ca19

View File

@ -84,7 +84,11 @@
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="成绩与证书" name="fourth"> <el-tab-pane label="成绩与证书" name="fourth">
<el-segmented v-model="user" :options="userList" style="margin-bottom: 10px" /> <el-radio-group v-model="user" style="margin-bottom: 10px">
<el-radio-button value="运动员">运动员</el-radio-button>
<el-radio-button value="教练">教练</el-radio-button>
<el-radio-button value="领队">领队</el-radio-button>
</el-radio-group>
<ProTable v-if="user == '运动员'" ref="tableuu" :request-api="eventscorePageathletePost" <ProTable v-if="user == '运动员'" ref="tableuu" :request-api="eventscorePageathletePost"
:columns="columnsScore" :pagination="true" :tool-button="false" :initParam="initParam" toolButton :columns="columnsScore" :pagination="true" :tool-button="false" :initParam="initParam" toolButton
preserve-expanded-content @selectionChange="selection"> preserve-expanded-content @selectionChange="selection">
@ -101,9 +105,24 @@
</template> </template>
</ProTable> </ProTable>
<ProTable v-else ref="tablenn" :request-api="eventscorePagecoachleaderPost" :columns="columnsLeader" <ProTable v-if="user == '教练'" ref="tableCoach" :request-api="eventscorePagecoachleaderPost"
:pagination="true" :tool-button="false" :initParam="initParam" toolButton preserve-expanded-content :columns="columnsCoach" :pagination="true" :tool-button="false" :initParam="initParamCoach" toolButton
@selectionChange="selection"> preserve-expanded-content @selectionChange="selection">
<template #tools>
<el-button v-auth="'event:add'" type="primary" @click="allSure"> 发放证书 </el-button>
</template>
<template #index="scope">
{{ scope.$index + 1 }}
</template>
<template #action="scope">
<el-button size="small" text type="primary" @click="onLookBook(scope.row.id)"> 查看证书
</el-button>
</template>
</ProTable>
<ProTable v-if="user == '领队'" ref="tableLeader" :request-api="eventscorePagecoachleaderPost"
:columns="columnsLeader" :pagination="true" :tool-button="false" :initParam="initParamLeader" toolButton
preserve-expanded-content @selectionChange="selection">
<template #tools> <template #tools>
<el-button v-auth="'event:add'" type="primary" @click="allSure"> 发放证书 </el-button> <el-button v-auth="'event:add'" type="primary" @click="allSure"> 发放证书 </el-button>
</template> </template>
@ -150,7 +169,8 @@ const eventlist = ref([]);
const importingScore = ref(false); const importingScore = ref(false);
const scoreFileInputRef = ref(null); const scoreFileInputRef = ref(null);
const tableuu = ref(); const tableuu = ref();
const tablenn = ref(); const tableCoach = ref();
const tableLeader = ref();
// 表单数据(响应式对象) // 表单数据(响应式对象)
const formData = ref({ const formData = ref({
// 步骤1:基本信息 // 步骤1:基本信息
@ -239,6 +259,18 @@ const initParam = ref({
id: '', id: '',
}) })
const initParamCoach = computed(() => ({
refresh: initParam.value.refresh,
id: initParam.value.id,
personType: 'Coach'
}))
const initParamLeader = computed(() => ({
refresh: initParam.value.refresh,
id: initParam.value.id,
personType: 'Leader'
}))
const columns = reactive([ const columns = reactive([
{ {
width: '120px', width: '120px',
@ -372,7 +404,6 @@ const allSure = async () => {
//=================================成绩与证书================================== //=================================成绩与证书==================================
const user = ref('运动员') const user = ref('运动员')
const userList = ref(['运动员', '教练/领队'])
const columnsScore = ref([ const columnsScore = ref([
{ prop: 'index', label: '序号', align: 'center', type: 'selection' }, { prop: 'index', label: '序号', align: 'center', type: 'selection' },
{ prop: 'name', label: '姓名', width: '120px', }, { prop: 'name', label: '姓名', width: '120px', },
@ -392,9 +423,28 @@ const columnsScore = ref([
{ prop: 'unitName', label: '单位', }, { prop: 'unitName', label: '单位', },
{ prop: 'action', label: '操作', align: 'center', width: 140, fixed: 'right' } { prop: 'action', label: '操作', align: 'center', width: 140, fixed: 'right' }
]) ])
const columnsCoach = ref([
{ prop: 'index', label: '序号', align: 'center', type: 'selection' },
{ prop: 'name', label: '教练姓名', width: '120px', search: { el: 'input' }, },
{ prop: 'age', label: '年龄', width: '120px', },
{
prop: 'gender',
label: '性别',
search: {
el: 'select',
},
enum: [
{ label: '男', value: 0 },
{ label: '女', value: 1 },
],
},
{ prop: 'idCard', label: '身份证号', },
{ prop: 'phone', label: '联系电话', search: { el: 'input' }, },
{ prop: 'action', label: '操作', align: 'center', width: 140, fixed: 'right' }
])
const columnsLeader = ref([ const columnsLeader = ref([
{ prop: 'index', label: '序号', align: 'center', type: 'selection' }, { prop: 'index', label: '序号', align: 'center', type: 'selection' },
{ prop: 'name', label: '姓名', width: '120px', search: { el: 'input' }, }, { prop: 'name', label: '领队姓名', width: '120px', search: { el: 'input' }, },
{ prop: 'age', label: '年龄', width: '120px', }, { prop: 'age', label: '年龄', width: '120px', },
{ {
prop: 'gender', prop: 'gender',
@ -417,7 +467,13 @@ const refreshScoreTable = () => {
tableuu.value?.reset?.(); tableuu.value?.reset?.();
return; return;
} }
tablenn.value?.reset?.(); if (user.value === '教练') {
tableCoach.value?.reset?.();
return;
}
if (user.value === '领队') {
tableLeader.value?.reset?.();
}
}; };
const inScore = () => { const inScore = () => {