|
@@ -10,12 +10,9 @@
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="活动状态">
|
|
<el-form-item label="活动状态">
|
|
- <el-select v-model="queryParams.status" placeholder="请选择活动状态" clearable @change="queryParams.pageNum = 1;getList()">
|
|
|
|
|
|
+ <el-select v-model="queryParams.isOn" placeholder="请选择活动状态" clearable @change="queryParams.pageNum = 1;getList()">
|
|
<el-option label="全部" value="" />
|
|
<el-option label="全部" value="" />
|
|
- <el-option label="进行中" value="init" />
|
|
|
|
- <el-option label="已结束" value="on" />
|
|
|
|
- <el-option label="草稿" value="off" />
|
|
|
|
- <el-option label="未开始" value="off" />
|
|
|
|
|
|
+ <el-option v-for="(item,index) in marketingStatusList" :label="item.dictLabel" :value="Number(item.dictValue)" :key="index"/>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-form-item>
|
|
@@ -44,41 +41,41 @@
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
</el-row>
|
|
</el-row>
|
|
<el-table v-loading="loading" :data="tableData">
|
|
<el-table v-loading="loading" :data="tableData">
|
|
- <el-table-column label="活动编号" prop="couponId" width="80" />
|
|
|
|
|
|
+ <el-table-column label="活动编号" prop="id" width="80" />
|
|
<el-table-column label="活动名称" prop="title" />
|
|
<el-table-column label="活动名称" prop="title" />
|
|
- <el-table-column label="参与人数" prop="discount"/>
|
|
|
|
- <el-table-column label="开始时间" prop="type" >
|
|
|
|
|
|
+ <el-table-column label="参与人数" prop="realNum"/>
|
|
|
|
+ <el-table-column label="开始时间" prop="startTime" >
|
|
<template slot-scope="{row}">
|
|
<template slot-scope="{row}">
|
|
- {{ JSON.parse(row.type).desc }}
|
|
|
|
|
|
+ {{ parseTime(row.startTime) }}
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="结束时间" prop="type" >
|
|
|
|
|
|
+ <el-table-column label="结束时间" prop="endTime" >
|
|
<template slot-scope="{row}">
|
|
<template slot-scope="{row}">
|
|
- {{ JSON.parse(row.type).desc }}
|
|
|
|
|
|
+ {{ parseTime(row.endTime) }}
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="状态" prop="status">
|
|
<el-table-column label="状态" prop="status">
|
|
<template slot-scope="{row}">
|
|
<template slot-scope="{row}">
|
|
- <el-tag :type="JSON.parse(row.status).value === 'on' ? 'success' : 'info'">{{ JSON.parse(row.status).desc }}</el-tag>
|
|
|
|
|
|
+ <el-tag :type="JSON.parse(row.status).value === 4 || JSON.parse(row.status).value === -1 ? 'info' : 'success'">{{ JSON.parse(row.status).desc }}</el-tag>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column fixed="right" align="right" label="操作" width="240">
|
|
<el-table-column fixed="right" align="right" label="操作" width="240">
|
|
<template slot-scope="{row}">
|
|
<template slot-scope="{row}">
|
|
- <el-button v-hasPermi="['business:marketing:query']" type="text" @click="$router.push({ name: 'MarketingQuery', query: { id: row.couponId } })">查看</el-button>
|
|
|
|
- <el-button v-if="JSON.parse(row.status).value === 'init'" v-hasPermi="['business:marketing:edit']" type="text" @click="$router.push({ name: 'MarketingEdit', query: { id: row.couponId } })">编辑</el-button>
|
|
|
|
- <el-button v-if="JSON.parse(row.status).value === 'init'" v-hasPermi="['business:marketing:edit']" type="text" @click="activityTableVisible = true">活动数据</el-button>
|
|
|
|
- <el-button v-if="JSON.parse(row.status).value === 'off' || JSON.parse(row.status).value === 'init'" v-hasPermi="['business:coupon:on']" type="text" @click="setStatus(row, 'on')">开启</el-button>
|
|
|
|
- <el-button v-if="JSON.parse(row.status).value === 'on'" v-hasPermi="['business:coupon:off']" type="text" @click="setStatus(row, 'off')">关闭</el-button>
|
|
|
|
- <el-button v-if="JSON.parse(row.status).value === 'init'" v-hasPermi="['business:coupon:remove']" class="del" type="text" @click="del(row)">删除</el-button>
|
|
|
|
|
|
+ <el-button v-hasPermi="['business:marketing:query']" type="text" @click="$router.push({ name: 'MarketingQuery', query: { id: row.id } })">查看</el-button>
|
|
|
|
+ <el-button v-if=" JSON.parse(row.status).value === 3 || JSON.parse(row.status).value === 0 || JSON.parse(row.status).value === 2 " v-hasPermi="['business:marketing:edit']" type="text" @click="$router.push({ name: 'MarketingEdit', query: { id: row.id } })">编辑</el-button>
|
|
|
|
+ <el-button v-if=" JSON.parse(row.status).value === 3 || JSON.parse(row.status).value === 4 || JSON.parse(row.status).value === -1 " v-hasPermi="['business:marketing:edit']" type="text" @click="activityTableVisible = true, ids = { id:row.id, title:row.title, realNum:row.realNum }">活动数据</el-button>
|
|
|
|
+ <el-button v-if=" JSON.parse(row.status).value === 0 " v-hasPermi="['business:coupon:on']" type="text" @click="setStatus(row, 'on')">开启</el-button>
|
|
|
|
+ <el-button v-if=" JSON.parse(row.status).value === 3 || JSON.parse(row.status).value === 2 " v-hasPermi="['business:coupon:off']" type="text" @click="setStatus(row, 'off')">关闭</el-button>
|
|
|
|
+ <el-button v-if=" JSON.parse(row.status).value === 0 " v-hasPermi="['business:coupon:remove']" class="del" type="text" @click="del(row)">删除</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
<pagination :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList()" />
|
|
<pagination :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList()" />
|
|
- <activity-table :dialog-visible="activityTableVisible" @close="activityTableVisible = false" v-if="activityTableVisible"></activity-table>
|
|
|
|
|
|
+ <activity-table :dialog-visible="activityTableVisible" :ids="ids" @close="activityTableVisible = false" v-if="activityTableVisible"></activity-table>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
-import { getCouponList, delCoupon, setCouponStatus } from '@/api/business/coupon'
|
|
|
|
|
|
+import { getMarketingList, delMarketing, setMarketingStatus, setMarketingStatusOff, } from '@/api/business/marketing'
|
|
import ActivityTable from "./components/ActivityTable";
|
|
import ActivityTable from "./components/ActivityTable";
|
|
import { accDiv } from '@/utils/util'
|
|
import { accDiv } from '@/utils/util'
|
|
export default {
|
|
export default {
|
|
@@ -93,11 +90,14 @@ export default {
|
|
tableData: [],
|
|
tableData: [],
|
|
queryParams: {},
|
|
queryParams: {},
|
|
total: 0,
|
|
total: 0,
|
|
|
|
+ ids: {},
|
|
activityTableVisible: false,
|
|
activityTableVisible: false,
|
|
|
|
+ marketingStatusList: []
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.getList(true)
|
|
this.getList(true)
|
|
|
|
+ this.getMarketingStatus()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
getList(reset) {
|
|
getList(reset) {
|
|
@@ -108,7 +108,7 @@ export default {
|
|
if (reset) {
|
|
if (reset) {
|
|
this.queryParams = { pageNum: 1, pageSize: 20 }
|
|
this.queryParams = { pageNum: 1, pageSize: 20 }
|
|
}
|
|
}
|
|
- getCouponList('pageNum='+this.queryParams.pageNum + '&pageSize='+this.queryParams.pageSize+'&', this.queryParams).then(res => {
|
|
|
|
|
|
+ getMarketingList('pageNum='+this.queryParams.pageNum + '&pageSize='+this.queryParams.pageSize+'&', this.queryParams).then(res => {
|
|
this.loading = false
|
|
this.loading = false
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
this.tableData = res.rows
|
|
this.tableData = res.rows
|
|
@@ -118,30 +118,41 @@ export default {
|
|
this.loading = false
|
|
this.loading = false
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ getMarketingStatus(){
|
|
|
|
+ this.getDicts('marketing_status').then(res=>{
|
|
|
|
+ this.marketingStatusList = res.data
|
|
|
|
+ })
|
|
|
|
+ },
|
|
setStatus(item, status) {
|
|
setStatus(item, status) {
|
|
- this.$confirm(`确认${status === 'on' ? '上架' : '下架'}券 “${item.title}” 吗?`, `${status === 'on' ? '上架' : '下架'}券`, {
|
|
|
|
|
|
+ this.$confirm(`确认${status === 'on' ? '开启' : '关闭'}活动 “${item.title}” 吗?`, `${status === 'on' ? '开启' : '关闭'}活动`, {
|
|
confirmButtonText: '确定',
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
type: 'warning'
|
|
}).then(() => {
|
|
}).then(() => {
|
|
- setCouponStatus({
|
|
|
|
- couponId: item.couponId,
|
|
|
|
- status
|
|
|
|
- }).then(res => {
|
|
|
|
- if (res.code === 0) {
|
|
|
|
- this.$message.success('操作已完成!')
|
|
|
|
- this.getList()
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ if (status === 'on'){
|
|
|
|
+ setMarketingStatus(item.id).then(res => {
|
|
|
|
+ if (res.code === 0) {
|
|
|
|
+ this.$message.success('开启已完成!')
|
|
|
|
+ this.getList()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ setMarketingStatusOff(item.id).then(res => {
|
|
|
|
+ if (res.code === 0) {
|
|
|
|
+ this.$message.success('关闭已完成!')
|
|
|
|
+ this.getList()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
})
|
|
})
|
|
},
|
|
},
|
|
del(item) {
|
|
del(item) {
|
|
- this.$confirm(`确认删除券 “${item.title}” 吗?`, '删除券', {
|
|
|
|
|
|
+ this.$confirm(`确认删除活动 “${item.title}” 吗?`, '删除活动', {
|
|
confirmButtonText: '确定',
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
type: 'warning'
|
|
}).then(() => {
|
|
}).then(() => {
|
|
- delCoupon(item.couponId).then(res => {
|
|
|
|
|
|
+ delMarketing(item.id).then(res => {
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
this.$message.success('操作已完成!')
|
|
this.$message.success('操作已完成!')
|
|
this.getList()
|
|
this.getList()
|
|
@@ -152,7 +163,7 @@ export default {
|
|
|
|
|
|
// 导出订单
|
|
// 导出订单
|
|
handleExportDraw() {
|
|
handleExportDraw() {
|
|
- this.$confirm("是否确认导出订单?", "提示", {
|
|
|
|
|
|
+ this.$confirm("是否确认导出活动数据?", "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
cancelButtonText: "取消",
|
|
cancelButtonText: "取消",
|
|
type: "warning",
|
|
type: "warning",
|
|
@@ -160,7 +171,7 @@ export default {
|
|
.then(() => {
|
|
.then(() => {
|
|
this.vloading = this.$loading({
|
|
this.vloading = this.$loading({
|
|
lock: true,
|
|
lock: true,
|
|
- text: "正在导出订单.....",
|
|
|
|
|
|
+ text: "正在导出活动数据.....",
|
|
background: "rgba(0, 0, 0, 0.7)",
|
|
background: "rgba(0, 0, 0, 0.7)",
|
|
});
|
|
});
|
|
return ticketOrderExport(this.queryParams);
|
|
return ticketOrderExport(this.queryParams);
|