瀏覽代碼

feat(system): 添加奖励发放审核功能并优化相关页面

- 在 claims API 中添加 auditSendReward 函数用于审核奖励发放
- 更新 receivers 页面,修改添加和编辑对话框的标题
- 在 tournaments 页面中添加审核按钮和相关功能
- 优化 tournaments 页面的列显示,将"状态"列的属性改为 claimedText
fugui001 5 月之前
父節點
當前提交
20976e7b24

+ 12 - 0
src/api/system/business/claims/index.ts

@@ -73,3 +73,15 @@ export const deleteClaim = (data: { id: number; tournamentId: number }) => {
     data
   });
 };
+
+/**
+ * 审核奖励发放
+ * @param data
+ */
+export const auditSendReward = (data: ClaimsForm) => {
+  return request({
+    url: '/business/claims/auditSendReward',
+    method: 'POST',
+    data: data
+  });
+};

+ 3 - 3
src/views/system/business/receivers/index.vue

@@ -191,7 +191,7 @@ const handleSelectionChange = (selection: ReceiversVO[]) => {
 const handleAdd = () => {
   reset();
   dialog.visible = true;
-  dialog.title = '添加【请填写功能名称】';
+  dialog.title = '发送消息';
 };
 
 /** 修改按钮操作 */
@@ -201,7 +201,7 @@ const handleUpdate = async (row?: ReceiversVO) => {
   const res = await getReceivers(_id);
   Object.assign(form.value, res.data);
   dialog.visible = true;
-  dialog.title = '修改【请填写功能名称】';
+  dialog.title = '查看消息';
 };
 
 /** 提交按钮 */
@@ -224,7 +224,7 @@ const submitForm = () => {
 /** 删除按钮操作 */
 const handleDelete = async (row?: ReceiversVO) => {
   const _ids = row?.id || ids.value;
-  await proxy?.$modal.confirm('是否确认删除【请填写功能名称】编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
+  await proxy?.$modal.confirm('是否确认删除【消息】编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
   await delReceivers(_ids);
   proxy?.$modal.msgSuccess('删除成功');
   await getList();

+ 26 - 5
src/views/system/business/tournaments/index.vue

@@ -389,7 +389,7 @@
           </template>
         </el-table-column>
 
-        <el-table-column prop="claimed" label="状态" align="center"></el-table-column>
+        <el-table-column prop="claimedText" label="状态" align="center"></el-table-column>
 
         <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
           <template #default="scope">
@@ -397,7 +397,7 @@
               <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">查看牌局</el-button>
             </el-tooltip>
             <el-tooltip content="审核" placement="top">
-              <el-button link type="primary" icon="Audit">审核</el-button>
+              <el-button link type="primary" icon="Audit" @click="handleAudit(scope.row)">审核</el-button>
             </el-tooltip>
             <el-tooltip content="移除" placement="top">
               <el-button link type="primary" icon="Delete" @click="handleClaimsDelete(scope.row)">移除</el-button>
@@ -449,7 +449,7 @@ import {
 import { selectItemsSelList } from '@/api/system/business/items';
 import { selectBlindLevelsById } from '@/api/system/business/levels';
 import { selectBlingStructuresInfo } from '@/api/system/business/structures';
-import { listClaims, deleteClaim } from '@/api/system/business/claims';
+import { listClaims, deleteClaim ,auditSendReward } from '@/api/system/business/claims';
 import { TournamentsVO, TournamentsQuery, TournamentsForm, TournamentsBindStructuresVO } from '@/api/system/business/tournaments/types';
 import { ref } from 'vue';
 import LevelsIndex from '@/views/system/business/levels/index.vue';
@@ -1056,8 +1056,7 @@ const tournamentInfo = ref<Partial<TournamentsVO>>({
   blindStructuresName: '',
   lateRegistrationLevel: 0,
   tournamentsBiId: '',
-  signNum: 0,
-
+  signNum: 0
 });
 
 const auditData = ref<ClaimsVO[]>([]);
@@ -1154,6 +1153,28 @@ const confirmRemove = async () => {
   }
 };
 
+// 审核操作
+const handleAudit = async (row: ClaimsVO) => {
+  try {
+    await ElMessageBox.confirm('确定要审核该记录吗?', '提示', {
+      confirmButtonText: '确定',
+      cancelButtonText: '取消',
+      type: 'warning'
+    });
+
+    // 用户点击了【确定】
+    await auditSendReward(row); // 调用接口,假设接口接受 id 参数
+    ElMessage.success('审核成功');
+    getList(); // 刷新列表
+  } catch (error) {
+    if (error === 'cancel') {
+      ElMessage.info('已取消审核');
+    } else {
+      ElMessage.error('审核失败');
+    }
+  }
+};
+
 const handleViewLevelsSee = (tournamentsVO: TournamentsVO | undefined | null) => {
   if (!tournamentsVO || !tournamentsVO.blindStructureId) {
     proxy?.$modal.msgWarning('该赛事未绑定盲注表');