|
|
@@ -1,34 +1,18 @@
|
|
|
<!-- 红包码活动列表 -->
|
|
|
<template>
|
|
|
<div class="red-bag-activity">
|
|
|
- <common-table
|
|
|
- ref="pageRef"
|
|
|
- :pageConfig="pageConfig"
|
|
|
- :columns="columns"
|
|
|
- :tools="false"
|
|
|
- :body-style="{ padding: '10px 0' }"
|
|
|
- >
|
|
|
+ <common-table ref="pageRef" :pageConfig="pageConfig" :columns="columns" :tools="false"
|
|
|
+ :body-style="{ padding: '10px 0' }">
|
|
|
<template #toolbar>
|
|
|
<div style="display: flex; align-items: center; gap: 10px">
|
|
|
- <el-select
|
|
|
- v-model="activityStatus"
|
|
|
- placeholder="活动状态"
|
|
|
- clearable
|
|
|
- style="width: 250px"
|
|
|
- >
|
|
|
+ <el-select v-model="activityStatus" placeholder="活动状态" clearable style="width: 250px">
|
|
|
<el-option label="进行中" :value="1" />
|
|
|
<el-option label="已结束" :value="0" />
|
|
|
</el-select>
|
|
|
<el-button type="primary" @click="reload()">查询</el-button>
|
|
|
- <el-button type="primary" plain @click="reset"
|
|
|
- >重置</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- :icon="PlusOutlined"
|
|
|
- @click="handleAdd()"
|
|
|
- v-permission="'marketing:redBag:add'"
|
|
|
- >
|
|
|
+ <el-button type="primary" plain @click="reset">重置</el-button>
|
|
|
+ <el-button type="primary" :icon="PlusOutlined" @click="handleAdd()"
|
|
|
+ v-permission="'marketing:redBag:add'">
|
|
|
新增
|
|
|
</el-button>
|
|
|
</div>
|
|
|
@@ -41,82 +25,40 @@
|
|
|
</template>
|
|
|
|
|
|
<template #action="{ row }">
|
|
|
- <el-button
|
|
|
- link
|
|
|
- type="primary"
|
|
|
- v-permission="'marketing:redBag:detail'"
|
|
|
- @click="handleDetail(row)"
|
|
|
- >
|
|
|
+ <el-button link type="primary" v-permission="'marketing:redBag:detail'" @click="handleDetail(row)">
|
|
|
[查看数据]
|
|
|
</el-button>
|
|
|
- <el-button
|
|
|
- v-if="row.activityStatus === 1"
|
|
|
- link
|
|
|
- type="danger"
|
|
|
- v-permission="'marketing:redBag:end'"
|
|
|
- @click="handleEnd(row)"
|
|
|
- >
|
|
|
+ <el-button v-if="row.activityStatus === 1" link type="danger" v-permission="'marketing:redBag:end'"
|
|
|
+ @click="handleEnd(row)">
|
|
|
[结束活动]
|
|
|
</el-button>
|
|
|
- <el-button
|
|
|
- link
|
|
|
- type="primary"
|
|
|
- v-permission="'marketing:redBag:download'"
|
|
|
- @click="handleDownload(row)"
|
|
|
- >
|
|
|
+ <el-button link type="primary" v-permission="'marketing:redBag:download'" @click="handleDownload(row)">
|
|
|
[下载文件]
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</common-table>
|
|
|
|
|
|
<!-- 新增红包活动弹窗 -->
|
|
|
- <el-dialog
|
|
|
- v-model="dialogVisible"
|
|
|
- title="新增红包活动"
|
|
|
- width="500px"
|
|
|
- :close-on-click-modal="false"
|
|
|
- >
|
|
|
- <el-form
|
|
|
- ref="formRef"
|
|
|
- :model="formData"
|
|
|
- :rules="formRules"
|
|
|
- label-width="100px"
|
|
|
- >
|
|
|
+ <el-dialog v-model="dialogVisible" title="新增红包活动" width="500px" :close-on-click-modal="false">
|
|
|
+ <el-form ref="formRef" :model="formData" :rules="formRules" label-width="100px">
|
|
|
<el-form-item label="红包码名称" prop="name">
|
|
|
- <el-input
|
|
|
- v-model="formData.name"
|
|
|
- placeholder="请输入红包码名称"
|
|
|
- />
|
|
|
+ <el-input v-model="formData.name" placeholder="请输入红包码名称" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="红包码数量" prop="redNum">
|
|
|
- <el-input-number
|
|
|
- v-model="formData.redNum"
|
|
|
- :min="1"
|
|
|
- :max="999999"
|
|
|
- placeholder="请输入红包码数量"
|
|
|
- style="width: 100%"
|
|
|
- />
|
|
|
+ <el-input-number v-model="formData.redNum" :min="1" :max="999999" placeholder="请输入红包码数量"
|
|
|
+ style="width: 100%" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
|
<el-button @click="dialogVisible = false">取消</el-button>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click="handleSubmit"
|
|
|
- :loading="submitLoading"
|
|
|
- >
|
|
|
+ <el-button type="primary" @click="handleSubmit" :loading="submitLoading">
|
|
|
确定
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 红包码详情弹窗 -->
|
|
|
- <el-dialog
|
|
|
- v-model="detailDialogVisible"
|
|
|
- title="红包码详情"
|
|
|
- width="1440px"
|
|
|
- :close-on-click-modal="false"
|
|
|
- >
|
|
|
+ <el-dialog v-model="detailDialogVisible" title="红包码详情" width="1440px" :close-on-click-modal="false">
|
|
|
<red-bag-detail :activity-id="currentActivityId" />
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
@@ -296,10 +238,19 @@
|
|
|
};
|
|
|
|
|
|
// 下载文件
|
|
|
- const handleDownload = (row) => {
|
|
|
- window.open(
|
|
|
- `${import.meta.env.VITE_BASE_API}/activity/red/bag/detail/activity/redBag/detail/download?activityId=${row.id}`
|
|
|
- );
|
|
|
+ const handleDownload = async (row) => {
|
|
|
+ request({
|
|
|
+ url: '/activity/red/bag/detail/activity/redBag/detail/download',
|
|
|
+ method: 'POST',
|
|
|
+ data: { activityId: row.id },
|
|
|
+ }).then(res => {
|
|
|
+ console.log(res, 'xxx')
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ ElMessage.success(res.data.data)
|
|
|
+ } else {
|
|
|
+ ElMessage.error(res.data.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
};
|
|
|
|
|
|
// 查看详情
|