赛事记录退款规则
This commit is contained in:
parent
f25644a6ca
commit
53b955bf9f
@ -52,9 +52,11 @@ export const eventscorePageathletePost = (data) => {
|
||||
* id: number,
|
||||
* name: string,
|
||||
* age: number,
|
||||
* gender: string,
|
||||
* idCard: string,
|
||||
* phone: string,
|
||||
* gender: number,
|
||||
* idCardNumber: string,
|
||||
* idCardImageUrl: string,
|
||||
* idCardBackImageUrl: string,
|
||||
* mobile: string,
|
||||
* certificateId: number
|
||||
* }>
|
||||
* }>}
|
||||
|
||||
@ -179,6 +179,18 @@
|
||||
<template #index="scope">
|
||||
{{ scope.$index + 1 }}
|
||||
</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">
|
||||
<el-button size="small" text type="primary" @click="viewCertificate(scope.row.id)"> 查看证书
|
||||
</el-button>
|
||||
@ -194,6 +206,18 @@
|
||||
<template #index="scope">
|
||||
{{ scope.$index + 1 }}
|
||||
</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">
|
||||
<el-button size="small" text type="primary" @click="viewCertificate(scope.row.id)"> 查看证书
|
||||
</el-button>
|
||||
@ -288,7 +312,7 @@
|
||||
</template>
|
||||
|
||||
<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 { Check, View, Download, Rank, Warning } from '@element-plus/icons-vue';
|
||||
import { eventDetailGet } from '/@/api/match/event';
|
||||
@ -930,6 +954,7 @@ const columnsCoach = ref([
|
||||
{
|
||||
prop: 'gender',
|
||||
label: '性别',
|
||||
width: '100px',
|
||||
search: {
|
||||
el: 'select',
|
||||
},
|
||||
@ -938,7 +963,11 @@ const columnsCoach = ref([
|
||||
{ label: '女', value: 1 },
|
||||
],
|
||||
},
|
||||
{ prop: 'idCardNumber', label: '身份证号', },
|
||||
{
|
||||
prop: 'idCardImageUrl',
|
||||
label: '身份证正面',
|
||||
width: '150px'
|
||||
},
|
||||
{ prop: 'mobile', label: '联系电话', search: { el: 'input' }, },
|
||||
{ prop: 'action', label: '操作', align: 'center', width: 140, fixed: 'right' }
|
||||
])
|
||||
@ -949,6 +978,7 @@ const columnsLeader = ref([
|
||||
{
|
||||
prop: 'gender',
|
||||
label: '性别',
|
||||
width: '100px',
|
||||
search: {
|
||||
el: 'select',
|
||||
},
|
||||
@ -957,7 +987,11 @@ const columnsLeader = ref([
|
||||
{ label: '女', value: 1 },
|
||||
],
|
||||
},
|
||||
{ prop: 'idCardNumber', label: '身份证号', },
|
||||
{
|
||||
prop: 'idCardImageUrl',
|
||||
label: '身份证正面',
|
||||
width: '150px'
|
||||
},
|
||||
{ prop: 'mobile', label: '联系电话', search: { el: 'input' }, },
|
||||
{ prop: 'action', label: '操作', align: 'center', width: 140, fixed: 'right' }
|
||||
])
|
||||
@ -1103,6 +1137,16 @@ const openIssueCertificateDialog = async () => {
|
||||
certificateDialogVisible.value = true;
|
||||
};
|
||||
|
||||
// 获取页面类型标识
|
||||
const getPageType = () => {
|
||||
const pageTypeMap = {
|
||||
'运动员': 1,
|
||||
'教练': 2,
|
||||
'领队': 3
|
||||
};
|
||||
return pageTypeMap[user.value] || 1;
|
||||
};
|
||||
|
||||
// 发放证书
|
||||
const issueCertificate = async () => {
|
||||
if (!selectListIds.value || selectListIds.value.length === 0) {
|
||||
@ -1120,7 +1164,8 @@ const issueCertificate = async () => {
|
||||
const res = await eventscoreIssuecertificatePost({
|
||||
personIds: selectListIds.value,
|
||||
eventId: initParam.value.eventId,
|
||||
certificateId: selectedCertificateId.value
|
||||
certificateId: selectedCertificateId.value,
|
||||
pageType: getPageType()
|
||||
});
|
||||
if (res?.succeeded) {
|
||||
ElMessage.success(`证书发放成功!成功 ${res.data?.successCount || 0} 条,失败 ${res.data?.failCount || 0} 条`);
|
||||
|
||||
@ -384,7 +384,15 @@
|
||||
<el-alert title="注意" type="warning" :closable="false" show-icon style="margin-bottom: 16px;">
|
||||
<template #default>
|
||||
<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>
|
||||
</div>
|
||||
</template>
|
||||
@ -708,6 +716,36 @@ const formatGenderRequirement = (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 projectType = item.projectTypeName || '';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user