赛事报名费用计算
This commit is contained in:
parent
aee2f29e05
commit
b87373ee94
@ -294,25 +294,3 @@ export const usereventregistrationOrderStatusGet = (orderNo) => {
|
||||
return http.get(`/usereventregistration/order/status/${orderNo}`);
|
||||
};
|
||||
|
||||
/**
|
||||
* 费用计算预览接口
|
||||
* @param {Object} data - 计算预览信息
|
||||
* @param {number} data.eventId - 赛事ID
|
||||
* @param {Array<{groupId: number, memberIds: Array<number>}>} [data.groupMembers] - 组别队员分配
|
||||
* @param {Array<number>} [data.memberIds] - 队员ID列表(当无组别时使用)
|
||||
* @returns {Promise<{
|
||||
* chargeMode: string,
|
||||
* totalAmount: number,
|
||||
* totalPersonCount: number,
|
||||
* feeDetails: Array<{
|
||||
* itemName: string,
|
||||
* unitPrice: number,
|
||||
* quantity: number,
|
||||
* subtotal: number,
|
||||
* remark: string
|
||||
* }>
|
||||
* }>}
|
||||
*/
|
||||
export const usereventregistrationFeePreviewPost = (data) => {
|
||||
return http.post('/usereventregistration/fee/preview', data);
|
||||
};
|
||||
@ -80,21 +80,6 @@
|
||||
<!-- 赛事报名三步弹窗 -->
|
||||
<el-dialog title="赛事报名" v-model="isShowRegisterDialog" width="900px" :close-on-click-modal="false"
|
||||
@closed="clearRegisterState">
|
||||
<!-- 规则提示 -->
|
||||
<el-alert
|
||||
title="报名规则"
|
||||
type="info"
|
||||
:closable="false"
|
||||
style="margin-bottom: 20px;"
|
||||
show-icon
|
||||
>
|
||||
<template #default>
|
||||
<ul style="margin: 0; padding-left: 20px;">
|
||||
<li>一次报名操作仅允许选择并提交<strong>单个团队</strong>内的运动员</li>
|
||||
<li>该团队只能报名参与<strong>一个项目</strong></li>
|
||||
</ul>
|
||||
</template>
|
||||
</el-alert>
|
||||
<el-steps :active="activeStep" finish-status="success" align-center>
|
||||
<el-step title="选择报名项目" />
|
||||
<el-step title="分配队员" />
|
||||
@ -148,6 +133,18 @@
|
||||
</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 底部操作区域 -->
|
||||
<div class="step-footer" style="display: flex; justify-content: flex-end; margin-top: 20px;">
|
||||
<el-button @click="isShowRegisterDialog = false" style="margin-right: 10px;">取消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="handleStep1Next"
|
||||
:loading="registerLoading"
|
||||
>
|
||||
下一步
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
@ -277,15 +274,16 @@
|
||||
</div>
|
||||
|
||||
<!-- 底部操作区域 -->
|
||||
<div class="step2-footer">
|
||||
<el-button @click="handlePrevious">上一步</el-button>
|
||||
<div class="step-footer" style="display: flex; justify-content: flex-end; margin-top: 20px;">
|
||||
<el-button @click="isShowRegisterDialog = false" style="margin-right: 10px;">取消</el-button>
|
||||
<el-button @click="handlePrevious" style="margin-right: 10px;">上一步</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="handleStep2Next"
|
||||
:loading="submitDraftLoading"
|
||||
:disabled="hasAnyValidationErrors() || hasProjectCompletionCountError() || hasAnyRegistrationLimit()"
|
||||
>
|
||||
预览
|
||||
下一步
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
@ -383,9 +381,8 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class="payment-actions">
|
||||
<el-button @click="handlePrevious">上一步</el-button>
|
||||
<div class="payment-method-wrapper" v-if="!isFreePreview">
|
||||
<el-select v-model="paymentMethod" placeholder="请选择支付方式" style="width: 200px;">
|
||||
<el-select v-model="paymentMethod" placeholder="请选择支付方式" style="width: 200px; margin-right: 10px;">
|
||||
<el-option :value="1" label="微信支付" />
|
||||
<el-option :value="2" label="支付宝支付" />
|
||||
<el-option :value="3" label="银行转账" />
|
||||
@ -407,19 +404,16 @@
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<!-- 底部操作区域 -->
|
||||
<div class="step-footer" style="display: flex; justify-content: flex-end; margin-top: 20px;">
|
||||
<el-button @click="isShowRegisterDialog = false" style="margin-right: 10px;">取消</el-button>
|
||||
<el-button @click="handlePrevious">上一步</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="isShowRegisterDialog = false">取消</el-button>
|
||||
|
||||
<el-button v-if="activeStep === 0" type="primary" @click="handleStep1Next"
|
||||
:loading="registerLoading">下一步</el-button>
|
||||
<el-button v-else-if="activeStep === 1" type="primary" @click="handleStep2Next"
|
||||
:loading="submitDraftLoading">下一步</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
@ -1358,6 +1352,13 @@ const handleStep2Next = async () => {
|
||||
return;
|
||||
}
|
||||
|
||||
// 检查是否已选择团队
|
||||
const currentTeamId = usedTeamId.value ?? selectedTeamId.value;
|
||||
if (!currentTeamId) {
|
||||
ElMessage.warning('请先选择团队');
|
||||
return;
|
||||
}
|
||||
|
||||
// 构造按组别分配的数据
|
||||
const groupMembers = selectedGroupIds.value.map((gId) => ({
|
||||
groupId: gId,
|
||||
@ -1376,6 +1377,7 @@ const handleStep2Next = async () => {
|
||||
groupMembers,
|
||||
memberIds: allMemberIds,
|
||||
isDraft: true,
|
||||
teamId: usedTeamId.value ?? selectedTeamId.value,
|
||||
};
|
||||
const { succeeded, data } = await usereventregistrationSubmitPost(payload);
|
||||
if (!succeeded) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user