营销活动
This commit is contained in:
@@ -0,0 +1,70 @@
|
|||||||
|
<template>
|
||||||
|
<div class="AppMarketingActivity">
|
||||||
|
<keep-alive :include="['List']">
|
||||||
|
<component ref="component" :is="component" @change="onChange" :params="params" :instance="instance" :dict="dict"></component>
|
||||||
|
</keep-alive>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Detail from './components/Detail'
|
||||||
|
import List from './components/List'
|
||||||
|
import Add from './components/Add'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'AppMarketingActivity',
|
||||||
|
label: '营销活动',
|
||||||
|
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object
|
||||||
|
},
|
||||||
|
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
component: 'List',
|
||||||
|
params: {},
|
||||||
|
include: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
components: {
|
||||||
|
Add,
|
||||||
|
List,
|
||||||
|
Detail
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
onChange (data) {
|
||||||
|
if (data.type === 'Add') {
|
||||||
|
this.component = 'Add'
|
||||||
|
this.params = data.params
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.type === 'Detail') {
|
||||||
|
this.component = 'Detail'
|
||||||
|
this.params = data.params
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.type === 'List') {
|
||||||
|
this.component = 'List'
|
||||||
|
this.params = data.params
|
||||||
|
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (data.isRefresh) {
|
||||||
|
this.$refs.component.getList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.AppMarketingActivity {
|
||||||
|
height: 100%;
|
||||||
|
background: #F3F6F9;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,285 @@
|
|||||||
|
<template>
|
||||||
|
<ai-detail class="content-add">
|
||||||
|
<template slot="title">
|
||||||
|
<ai-title :title="params.id ? '编辑活动' : '添加活动'" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
|
||||||
|
</ai-title>
|
||||||
|
</template>
|
||||||
|
<template slot="content">
|
||||||
|
<ai-card title="基本信息">
|
||||||
|
<template #content>
|
||||||
|
<el-form class="ai-form" :model="form" label-width="180px!important" ref="form">
|
||||||
|
<el-form-item prop="title" style="width: 100%;" label="标题" :rules="[{required: true, message: '请输入活动标题', trigger: 'change'}]">
|
||||||
|
<el-input size="small" placeholder="请输入活动标题" v-model="form.title"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="beginTime" label="开始时间" :rules="[{required: true, message: '请选择开始时间', trigger: 'change'}]">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="form.beginTime"
|
||||||
|
type="datetime"
|
||||||
|
style="width: 100%"
|
||||||
|
size="small"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
placeholder="请选择开始时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="endTime" label="结束时间" :rules="[{required: true, message: '请选择结束时间', trigger: 'change'}]">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="form.endTime"
|
||||||
|
type="datetime"
|
||||||
|
style="width: 100%"
|
||||||
|
size="small"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
placeholder="请选择结束时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="beginTime1" label="第一轮抽奖开始时间" :rules="[{required: true, message: '请选择第一轮抽奖开始时间', trigger: 'change'}]">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="form.beginTime1"
|
||||||
|
type="datetime"
|
||||||
|
style="width: 100%"
|
||||||
|
size="small"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
placeholder="第一轮抽奖开始时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="round1ActiveLimit" label="第一轮抽奖限制日活天数">
|
||||||
|
<el-input-number size="small" v-model="form.round1ActiveLimit" :min="0"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="beginTime2" label="第二轮抽奖开始时间" :rules="[{required: true, message: '第二轮抽奖开始时间', trigger: 'change'}]">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="form.beginTime2"
|
||||||
|
type="datetime"
|
||||||
|
style="width: 100%"
|
||||||
|
size="small"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
placeholder="第二轮抽奖开始时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="round2ActiveLimit" label="第二轮抽奖限制日活天数" :rules="[{required: true, message: '请输入', trigger: 'change'}]">
|
||||||
|
<el-input-number size="small" v-model="form.round2ActiveLimit" :min="1"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="beginTime3" label="第三轮抽奖开始时间" :rules="[{required: true, message: '第三轮抽奖开始时间', trigger: 'change'}]">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="form.beginTime3"
|
||||||
|
type="datetime"
|
||||||
|
style="width: 100%"
|
||||||
|
size="small"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
placeholder="第三轮抽奖开始时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="round3ActiveLimit" label="第三轮抽奖限制日活天数" :rules="[{required: true, message: '请输入', trigger: 'change'}]">
|
||||||
|
<el-input-number size="small" v-model="form.round3ActiveLimit" :min="1"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="beginTime4" label="第四轮抽奖开始时间" :rules="[{required: true, message: '第四轮抽奖开始时间', trigger: 'change'}]">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="form.beginTime4"
|
||||||
|
type="datetime"
|
||||||
|
style="width: 100%"
|
||||||
|
size="small"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
placeholder="第四轮抽奖开始时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="round4ActiveLimit" label="第四轮抽奖限制日活天数" :rules="[{required: true, message: '请输入', trigger: 'change'}]">
|
||||||
|
<el-input-number size="small" v-model="form.round4ActiveLimit" :min="1"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
<div>
|
||||||
|
<el-form-item :label="'奖品' + (index + 1)" style="width: 100%;" v-for="(item, index) in form.prizes" :key="'prizes' + (index + 1)">
|
||||||
|
<div>
|
||||||
|
<div class="form-flex">
|
||||||
|
<div class="prize-item">
|
||||||
|
<span>奖品名称:</span>
|
||||||
|
<el-input size="small" style="width: 265px;" placeholder="请输入奖品名称" v-model="item.name"></el-input>
|
||||||
|
</div>
|
||||||
|
<div class="prize-item">
|
||||||
|
<span>中奖名称:</span>
|
||||||
|
<el-input size="small" style="width: 265px;" placeholder="指定第x个抽奖的人中奖,多个逗号隔开" v-model="item.rule"></el-input>
|
||||||
|
</div>
|
||||||
|
<div class="prize-item">
|
||||||
|
<span>奖品总数:</span>
|
||||||
|
<el-input-number size="small" v-model="item.total" :min="1"></el-input-number>
|
||||||
|
</div>
|
||||||
|
<div class="prize-item">
|
||||||
|
<span>奖品排序:</span>
|
||||||
|
<el-input-number size="small" v-model="item.showIndex" :min="1"></el-input-number>
|
||||||
|
</div>
|
||||||
|
<div class="prize-item">
|
||||||
|
<span>奖品排序:</span>
|
||||||
|
<el-radio-group v-model="item.belongRound">
|
||||||
|
<el-radio :label="1">第一轮</el-radio>
|
||||||
|
<el-radio :label="2">第二轮</el-radio>
|
||||||
|
<el-radio :label="3">第三轮</el-radio>
|
||||||
|
<el-radio :label="4">第四轮</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</div>
|
||||||
|
<div class="prize-item">
|
||||||
|
<span>是否默认:</span>
|
||||||
|
<el-switch
|
||||||
|
v-model="item.defaultPrize"
|
||||||
|
active-value="1"
|
||||||
|
inactive-value="0">
|
||||||
|
</el-switch>
|
||||||
|
</div>
|
||||||
|
<div class="prize-item">
|
||||||
|
<span>奖品图片:</span>
|
||||||
|
<ai-uploader
|
||||||
|
:instance="instance"
|
||||||
|
v-model="item.picture"
|
||||||
|
:limit="1">
|
||||||
|
</ai-uploader>
|
||||||
|
</div>
|
||||||
|
<div class="prize-item">
|
||||||
|
<el-button type="danger" @click="remove(index)">删除</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
<el-form-item style="width: 100%;">
|
||||||
|
<el-button type="primary" @click="add">添加奖品</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
</ai-card>
|
||||||
|
</template>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="cancel">取消</el-button>
|
||||||
|
<el-button type="primary" @click="confirm">提交</el-button>
|
||||||
|
</template>
|
||||||
|
</ai-detail>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { mapState } from 'vuex'
|
||||||
|
export default {
|
||||||
|
name: 'Add',
|
||||||
|
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
params: Object
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
info: {},
|
||||||
|
form: {
|
||||||
|
title: '',
|
||||||
|
beginTime: '',
|
||||||
|
beginTime1: '',
|
||||||
|
beginTime2: '',
|
||||||
|
beginTime3: '',
|
||||||
|
beginTime4: '',
|
||||||
|
endTime: '',
|
||||||
|
round1ActiveLimit: '',
|
||||||
|
round2ActiveLimit: '',
|
||||||
|
round3ActiveLimit: '',
|
||||||
|
round4ActiveLimit: '',
|
||||||
|
prizes: []
|
||||||
|
},
|
||||||
|
id: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
...mapState(['user'])
|
||||||
|
},
|
||||||
|
|
||||||
|
created () {
|
||||||
|
if (this.params && this.params.id) {
|
||||||
|
this.id = this.params.id
|
||||||
|
this.getInfo(this.params.id)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
getInfo (id) {
|
||||||
|
this.instance.post(`/app/appmarketingactivityinfo/queryDetailById?id=${id}`).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.form = res.data
|
||||||
|
|
||||||
|
if (res.data.prizes.length) {
|
||||||
|
this.form.prizes = res.data.prizes.map(v => {
|
||||||
|
return {
|
||||||
|
...v,
|
||||||
|
picture: [{
|
||||||
|
url: v.picture
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
add () {
|
||||||
|
this.form.prizes.push({
|
||||||
|
name: '',
|
||||||
|
picture: [],
|
||||||
|
rule: '',
|
||||||
|
showIndex: '',
|
||||||
|
total: '',
|
||||||
|
defaultPrize: '',
|
||||||
|
belongRound: ''
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
remove (index) {
|
||||||
|
this.form.prizes.splice(index, 1)
|
||||||
|
},
|
||||||
|
|
||||||
|
confirm () {
|
||||||
|
this.$refs.form.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.instance.post(`/app/appmarketingactivityinfo/addOrUpdate`, {
|
||||||
|
...this.form,
|
||||||
|
id: this.params.id || '',
|
||||||
|
prizes: this.form.prizes.map(v => {
|
||||||
|
return {
|
||||||
|
...v,
|
||||||
|
picture: v.picture[0].url
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.$message.success('提交成功')
|
||||||
|
setTimeout(() => {
|
||||||
|
this.cancel(true)
|
||||||
|
}, 600)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
cancel (isRefresh) {
|
||||||
|
this.$emit('change', {
|
||||||
|
type: 'List',
|
||||||
|
isRefresh: !!isRefresh
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.form-flex {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.prize-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 14px;
|
||||||
|
width: 50%;
|
||||||
|
|
||||||
|
span {
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
<template>
|
||||||
|
<ai-detail class="detail">
|
||||||
|
<template slot="title">
|
||||||
|
<ai-title title="活动详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
|
||||||
|
</ai-title>
|
||||||
|
</template>
|
||||||
|
<template slot="content">
|
||||||
|
<ai-card title="基本信息">
|
||||||
|
<template #content>
|
||||||
|
<ai-wrapper
|
||||||
|
label-width="120px">
|
||||||
|
<ai-info-item label="活动标题" :value="info.title"></ai-info-item>
|
||||||
|
<ai-info-item label="活动内容" isLine>
|
||||||
|
<AiArticle :value="info.content"></AiArticle>
|
||||||
|
</ai-info-item>
|
||||||
|
<ai-info-item label="附件" isLine>
|
||||||
|
<AiFileList :fileList="info.files"></AiFileList>
|
||||||
|
</ai-info-item>
|
||||||
|
</ai-wrapper>
|
||||||
|
</template>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="报名列表">
|
||||||
|
<template #content>
|
||||||
|
<ai-table
|
||||||
|
:tableData="tableData"
|
||||||
|
:col-configs="colConfigs"
|
||||||
|
:total="total"
|
||||||
|
style="margin-top: 6px;"
|
||||||
|
:current.sync="search.current"
|
||||||
|
:size.sync="search.size"
|
||||||
|
@getList="getList">
|
||||||
|
<!-- <el-table-column slot="options" width="90px" fixed="right" label="操作" align="center">
|
||||||
|
<template slot-scope="{ row }">
|
||||||
|
<div class="table-options">
|
||||||
|
<el-button type="text" @click="toAdd(row.id)">编辑</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
</ai-table>
|
||||||
|
</template>
|
||||||
|
</ai-card>
|
||||||
|
</template>
|
||||||
|
</ai-detail>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'Detail',
|
||||||
|
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
params: Object
|
||||||
|
},
|
||||||
|
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
colConfigs: [
|
||||||
|
{ prop: 'userName', label: '姓名', align: 'left', width: '200px' },
|
||||||
|
{ prop: 'userPhone', label: '手机号', align: 'center' },
|
||||||
|
{ prop: 'createTime', label: '报名时间', align: 'center' }
|
||||||
|
],
|
||||||
|
search: {
|
||||||
|
size: 10,
|
||||||
|
current: 1
|
||||||
|
},
|
||||||
|
tableData: [],
|
||||||
|
total: 0,
|
||||||
|
info: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
created () {
|
||||||
|
this.getInfo()
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
getList() {
|
||||||
|
this.instance.post(`/app/appactivityinfo/signUpList?activityId=${this.params.id}`, null, {
|
||||||
|
params: {
|
||||||
|
...this.search
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.tableData = res.data.records
|
||||||
|
this.total = res.data.total
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
getInfo () {
|
||||||
|
this.instance.post(`/app/appactivityinfo/queryDetailById?id=${this.params.id}`).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
if (res.data) {
|
||||||
|
this.info = res.data
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
cancel () {
|
||||||
|
this.$emit('change', {
|
||||||
|
type: 'List',
|
||||||
|
isRefresh: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,148 @@
|
|||||||
|
<template>
|
||||||
|
<ai-list class="notice">
|
||||||
|
<template slot="title">
|
||||||
|
<ai-title title="营销活动" isShowBottomBorder>
|
||||||
|
</ai-title>
|
||||||
|
</template>
|
||||||
|
<template slot="content">
|
||||||
|
<ai-search-bar class="search-bar">
|
||||||
|
<template #left>
|
||||||
|
<ai-select
|
||||||
|
v-model="search.status"
|
||||||
|
clearable
|
||||||
|
placeholder="请选择活动状态"
|
||||||
|
:selectList="statusList"
|
||||||
|
@change="search.current = 1, getList()">
|
||||||
|
</ai-select>
|
||||||
|
<el-button size="small" type="primary" icon="iconfont iconAdd" @click="toAdd('')">添加</el-button>
|
||||||
|
</template>
|
||||||
|
<template #right>
|
||||||
|
<el-input
|
||||||
|
v-model="search.title"
|
||||||
|
class="search-input"
|
||||||
|
size="small"
|
||||||
|
v-throttle="() => {search.current = 1, getList()}"
|
||||||
|
placeholder="请选择活动标题"
|
||||||
|
clearable
|
||||||
|
@clear="search.current = 1, search.province = '', getList()"
|
||||||
|
suffix-icon="iconfont iconSearch">
|
||||||
|
</el-input>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-table
|
||||||
|
:tableData="tableData"
|
||||||
|
:col-configs="colConfigs"
|
||||||
|
:total="total"
|
||||||
|
style="margin-top: 6px;"
|
||||||
|
:current.sync="search.current"
|
||||||
|
:size.sync="search.size"
|
||||||
|
@getList="getList">
|
||||||
|
<el-table-column slot="options" width="180px" fixed="right" label="操作" align="center">
|
||||||
|
<template slot-scope="{ row }">
|
||||||
|
<div class="table-options">
|
||||||
|
<el-button type="text" @click="toAdd(row.id)">编辑</el-button>
|
||||||
|
<el-button type="text" @click="toDetail(row.id)">详情</el-button>
|
||||||
|
<el-button type="text" @click="remove(row.id)">删除</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</template>
|
||||||
|
</ai-list>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'List',
|
||||||
|
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object
|
||||||
|
},
|
||||||
|
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
search: {
|
||||||
|
current: 1,
|
||||||
|
size: 10,
|
||||||
|
title: '',
|
||||||
|
status: ''
|
||||||
|
},
|
||||||
|
total: 10,
|
||||||
|
colConfigs: [
|
||||||
|
{ prop: 'title', label: '活动标题', align: 'left' },
|
||||||
|
{ prop: 'createUserName', label: '创建人', align: 'center' },
|
||||||
|
{ prop: 'beginTime', label: '开始时间', align: 'center' },
|
||||||
|
{ prop: 'endTime', label: '结束时间', align: 'center' },
|
||||||
|
{ prop: 'createTime', label: '创建时间', align: 'center' }
|
||||||
|
],
|
||||||
|
tableData: [],
|
||||||
|
statusList: [
|
||||||
|
{
|
||||||
|
dictValue: '0',
|
||||||
|
dictName: '未开始'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dictValue: '1',
|
||||||
|
dictName: '进行中'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dictValue: '2',
|
||||||
|
dictName: '已结束'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
created() {
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
getList() {
|
||||||
|
this.instance.post(`/app/appmarketingactivityinfo/list`, null, {
|
||||||
|
params: {
|
||||||
|
...this.search
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.tableData = res.data.records
|
||||||
|
this.total = res.data.total
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
remove (id) {
|
||||||
|
this.$confirm('确定删除该活动?').then(() => {
|
||||||
|
this.instance.post(`/app/appmarketingactivityinfo/delete?id=${id}`).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.$message.success('删除成功!')
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
toDetail (id) {
|
||||||
|
this.$emit('change', {
|
||||||
|
type: 'Detail',
|
||||||
|
params: {
|
||||||
|
id: id || ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
toAdd(id) {
|
||||||
|
this.$emit('change', {
|
||||||
|
type: 'Add',
|
||||||
|
params: {
|
||||||
|
id: id || ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user