赛事记录退款规则

This commit is contained in:
马梓彭 2026-04-17 12:48:16 +08:00
parent f25644a6ca
commit 53b955bf9f
3 changed files with 93 additions and 8 deletions

View File

@ -52,9 +52,11 @@ export const eventscorePageathletePost = (data) => {
* id: number, * id: number,
* name: string, * name: string,
* age: number, * age: number,
* gender: string, * gender: number,
* idCard: string, * idCardNumber: string,
* phone: string, * idCardImageUrl: string,
* idCardBackImageUrl: string,
* mobile: string,
* certificateId: number * certificateId: number
* }> * }>
* }>} * }>}

View File

@ -179,6 +179,18 @@
<template #index="scope"> <template #index="scope">
{{ scope.$index + 1 }} {{ scope.$index + 1 }}
</template> </template>
<template #idCardImageUrl="scope">
<PreviewImage
v-if="scope.row.idCardImageUrl"
:src="scope.row.idCardImageUrl"
width="100px"
height="80px"
fit="cover"
radius="4px"
:show-zoom-icon="true"
/>
<span v-else>-</span>
</template>
<template #action="scope"> <template #action="scope">
<el-button size="small" text type="primary" @click="viewCertificate(scope.row.id)"> 查看证书 <el-button size="small" text type="primary" @click="viewCertificate(scope.row.id)"> 查看证书
</el-button> </el-button>
@ -194,6 +206,18 @@
<template #index="scope"> <template #index="scope">
{{ scope.$index + 1 }} {{ scope.$index + 1 }}
</template> </template>
<template #idCardImageUrl="scope">
<PreviewImage
v-if="scope.row.idCardImageUrl"
:src="scope.row.idCardImageUrl"
width="100px"
height="80px"
fit="cover"
radius="4px"
:show-zoom-icon="true"
/>
<span v-else>-</span>
</template>
<template #action="scope"> <template #action="scope">
<el-button size="small" text type="primary" @click="viewCertificate(scope.row.id)"> 查看证书 <el-button size="small" text type="primary" @click="viewCertificate(scope.row.id)"> 查看证书
</el-button> </el-button>
@ -288,7 +312,7 @@
</template> </template>
<script setup> <script setup>
import { ref, reactive, computed, onMounted, watch, nextTick } from 'vue'; import { ref, reactive, computed, onMounted, watch, nextTick, h } from 'vue';
import { ElMessage, ElMessageBox } from 'element-plus'; import { ElMessage, ElMessageBox } from 'element-plus';
import { Check, View, Download, Rank, Warning } from '@element-plus/icons-vue'; import { Check, View, Download, Rank, Warning } from '@element-plus/icons-vue';
import { eventDetailGet } from '/@/api/match/event'; import { eventDetailGet } from '/@/api/match/event';
@ -930,6 +954,7 @@ const columnsCoach = ref([
{ {
prop: 'gender', prop: 'gender',
label: '性别', label: '性别',
width: '100px',
search: { search: {
el: 'select', el: 'select',
}, },
@ -938,7 +963,11 @@ const columnsCoach = ref([
{ label: '女', value: 1 }, { label: '女', value: 1 },
], ],
}, },
{ prop: 'idCardNumber', label: '身份证号', }, {
prop: 'idCardImageUrl',
label: '身份证正面',
width: '150px'
},
{ prop: 'mobile', label: '联系电话', search: { el: 'input' }, }, { prop: 'mobile', label: '联系电话', search: { el: 'input' }, },
{ prop: 'action', label: '操作', align: 'center', width: 140, fixed: 'right' } { prop: 'action', label: '操作', align: 'center', width: 140, fixed: 'right' }
]) ])
@ -949,6 +978,7 @@ const columnsLeader = ref([
{ {
prop: 'gender', prop: 'gender',
label: '性别', label: '性别',
width: '100px',
search: { search: {
el: 'select', el: 'select',
}, },
@ -957,7 +987,11 @@ const columnsLeader = ref([
{ label: '女', value: 1 }, { label: '女', value: 1 },
], ],
}, },
{ prop: 'idCardNumber', label: '身份证号', }, {
prop: 'idCardImageUrl',
label: '身份证正面',
width: '150px'
},
{ prop: 'mobile', label: '联系电话', search: { el: 'input' }, }, { prop: 'mobile', label: '联系电话', search: { el: 'input' }, },
{ prop: 'action', label: '操作', align: 'center', width: 140, fixed: 'right' } { prop: 'action', label: '操作', align: 'center', width: 140, fixed: 'right' }
]) ])
@ -1103,6 +1137,16 @@ const openIssueCertificateDialog = async () => {
certificateDialogVisible.value = true; certificateDialogVisible.value = true;
}; };
// 获取页面类型标识
const getPageType = () => {
const pageTypeMap = {
'运动员': 1,
'教练': 2,
'领队': 3
};
return pageTypeMap[user.value] || 1;
};
// 发放证书 // 发放证书
const issueCertificate = async () => { const issueCertificate = async () => {
if (!selectListIds.value || selectListIds.value.length === 0) { if (!selectListIds.value || selectListIds.value.length === 0) {
@ -1120,7 +1164,8 @@ const issueCertificate = async () => {
const res = await eventscoreIssuecertificatePost({ const res = await eventscoreIssuecertificatePost({
personIds: selectListIds.value, personIds: selectListIds.value,
eventId: initParam.value.eventId, eventId: initParam.value.eventId,
certificateId: selectedCertificateId.value certificateId: selectedCertificateId.value,
pageType: getPageType()
}); });
if (res?.succeeded) { if (res?.succeeded) {
ElMessage.success(`证书发放成功!成功 ${res.data?.successCount || 0} 条,失败 ${res.data?.failCount || 0} 条`); ElMessage.success(`证书发放成功!成功 ${res.data?.successCount || 0} 条,失败 ${res.data?.failCount || 0} 条`);

View File

@ -384,7 +384,15 @@
<el-alert title="注意" type="warning" :closable="false" show-icon style="margin-bottom: 16px;"> <el-alert title="注意" type="warning" :closable="false" show-icon style="margin-bottom: 16px;">
<template #default> <template #default>
<div> <div>
<p>• 退款规则:开赛前7天扣除金额5%,3-7天扣除金额10%,3天内扣除金额20%</p> <p v-if="cancelPreviewData?.applicableRefundRule">
• 当前规则:{{ cancelPreviewData.applicableRefundRule }}
</p>
<p v-if="cancelPreviewData?.refundRules?.length">
• 退款规则:
<template v-for="rule in formatRefundRules(cancelPreviewData.refundRules)" :key="rule.label">
{{ rule.label }}{{ rule.deductPercentage }}%,
</template>
</p>
<p>• 退款路径:原路退款,请注意查收</p> <p>• 退款路径:原路退款,请注意查收</p>
</div> </div>
</template> </template>
@ -708,6 +716,36 @@ const formatGenderRequirement = (gender) => {
return genderMap[gender] ?? '不限'; return genderMap[gender] ?? '不限';
}; };
const formatRefundRules = (rules) => {
if (!rules || !Array.isArray(rules) || rules.length === 0) return [];
const formattedRules = [];
for (const rule of rules) {
const dayStart = Number(rule.dayStart);
const dayEnd = Number(rule.dayEnd);
const deductPercentage = Number(rule.deductPercentage);
let label = '';
if (dayStart === 7 && dayEnd === 999) {
label = '开赛前7天扣除金额';
} else if (dayStart === 3 && dayEnd === 7) {
label = '3-7天扣除金额';
} else if (dayStart === 0 && dayEnd === 3) {
label = '3天内扣除金额';
} else {
continue;
}
formattedRules.push({
label,
deductPercentage: isNaN(deductPercentage) ? 0 : deductPercentage
});
}
return formattedRules;
};
// 格式化项目标题 // 格式化项目标题
const formatItemTitle = (item) => { const formatItemTitle = (item) => {
const projectType = item.projectTypeName || ''; const projectType = item.projectTypeName || '';