fix(settlement): 要求封盘后才能结算并优化预览流程
封盘前禁止录入比分与生成预览;待结算未确认前可解除封盘。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -300,6 +300,15 @@ async function loadMatch() {
|
||||
router.replace('/matches');
|
||||
return;
|
||||
}
|
||||
const settleable =
|
||||
detail.status === 'CLOSED' ||
|
||||
detail.status === 'PENDING_SETTLEMENT' ||
|
||||
detail.status === 'SETTLED';
|
||||
if (!settleable) {
|
||||
ElMessage.warning(t('settlement.must_close_first'));
|
||||
router.replace('/matches');
|
||||
return;
|
||||
}
|
||||
match.value = detail;
|
||||
if (detail.score) {
|
||||
score.value = { ...detail.score };
|
||||
@@ -372,6 +381,7 @@ async function previewSettlement() {
|
||||
const itemsPage = data.data.items as PreviewItemsPage;
|
||||
previewPage.value = itemsPage.page;
|
||||
previewPageSize.value = itemsPage.pageSize;
|
||||
await loadMatch();
|
||||
} catch (e: unknown) {
|
||||
ElMessage.error(settlementApiError(e, t('settlement.preview_failed')));
|
||||
} finally {
|
||||
|
||||
@@ -166,10 +166,12 @@ function canCloseRow(row: unknown) {
|
||||
return matchStatus(row) === 'PUBLISHED';
|
||||
}
|
||||
function canReopenRow(row: unknown) {
|
||||
return matchStatus(row) === 'CLOSED';
|
||||
const s = matchStatus(row);
|
||||
return s === 'CLOSED' || s === 'PENDING_SETTLEMENT';
|
||||
}
|
||||
function canSettleRow(row: unknown) {
|
||||
return matchStatus(row) !== 'DRAFT';
|
||||
const s = matchStatus(row);
|
||||
return s === 'CLOSED' || s === 'PENDING_SETTLEMENT' || s === 'SETTLED';
|
||||
}
|
||||
function settleButtonLabel(row: unknown) {
|
||||
return matchStatus(row) === 'SETTLED' ? t('common.resettle') : t('common.settle');
|
||||
|
||||
Reference in New Issue
Block a user