活动报名功能
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,12 +126,19 @@
|
|||||||
<span style="margin-left: 4px">活动说明</span>
|
<span style="margin-left: 4px">活动说明</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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>
|
<template #header>
|
||||||
<el-icon><Setting /></el-icon>
|
<el-icon><Setting /></el-icon>
|
||||||
<span style="margin-left: 4px">操作</span>
|
<span style="margin-left: 4px">操作</span>
|
||||||
</template>
|
</template>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
icon="Edit"
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="handleSignUp(scope.row)">
|
||||||
|
报名
|
||||||
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
icon="Delete"
|
icon="Delete"
|
||||||
link
|
link
|
||||||
@@ -162,7 +169,7 @@
|
|||||||
<script setup lang="ts" name="ActivityInfoSub">
|
<script setup lang="ts" name="ActivityInfoSub">
|
||||||
import { reactive, ref, onMounted } from 'vue'
|
import { reactive, ref, onMounted } from 'vue'
|
||||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
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 { useMessage, useMessageBox } from "/@/hooks/message";
|
||||||
import { parseTime } from "/@/utils/formatTime";
|
import { parseTime } from "/@/utils/formatTime";
|
||||||
import TableColumnControl from '/@/components/TableColumnControl/index.vue'
|
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 () => {
|
const getActivityInfoListData = async () => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user