活动报名功能
This commit is contained in:
@@ -47,3 +47,15 @@ export const delObj = (ids: string[]) => {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 活动报名
|
||||
* @param data 报名信息 { activityInfoId, id (子项目ID), remarks }
|
||||
*/
|
||||
export const signUp = (data: any) => {
|
||||
return request({
|
||||
url: '/stuwork/activityinfosub/signUp',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -126,16 +126,23 @@
|
||||
<span style="margin-left: 4px">活动说明</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100" align="center" fixed="right">
|
||||
<el-table-column label="操作" width="150" align="center" fixed="right">
|
||||
<template #header>
|
||||
<el-icon><Setting /></el-icon>
|
||||
<span style="margin-left: 4px">操作</span>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
icon="Delete"
|
||||
<el-button
|
||||
icon="Edit"
|
||||
link
|
||||
type="danger"
|
||||
type="primary"
|
||||
@click="handleSignUp(scope.row)">
|
||||
报名
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Delete"
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row)">
|
||||
删除
|
||||
</el-button>
|
||||
@@ -162,7 +169,7 @@
|
||||
<script setup lang="ts" name="ActivityInfoSub">
|
||||
import { reactive, ref, onMounted } from 'vue'
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObj, getActivityInfoList } from "/@/api/stuwork/activityinfosub";
|
||||
import { fetchList, delObj, getActivityInfoList, signUp } from "/@/api/stuwork/activityinfosub";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { parseTime } from "/@/utils/formatTime";
|
||||
import TableColumnControl from '/@/components/TableColumnControl/index.vue'
|
||||
@@ -243,6 +250,28 @@ const handleDelete = async (row: any) => {
|
||||
}
|
||||
}
|
||||
|
||||
// 活动报名
|
||||
const handleSignUp = async (row: any) => {
|
||||
const { confirm } = useMessageBox()
|
||||
try {
|
||||
await confirm(`确定要报名参加【${row.subTitle || '该活动'}】吗?`)
|
||||
state.loading = true
|
||||
await signUp({
|
||||
activityInfoId: row.activityInfoId,
|
||||
id: row.id,
|
||||
remarks: ''
|
||||
})
|
||||
useMessage().success('报名成功')
|
||||
getDataList()
|
||||
} catch (err: any) {
|
||||
if (err !== 'cancel') {
|
||||
useMessage().error(err.msg || '报名失败')
|
||||
}
|
||||
} finally {
|
||||
state.loading = false
|
||||
}
|
||||
}
|
||||
|
||||
// 获取活动主题列表
|
||||
const getActivityInfoListData = async () => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user