添加:活动相关
This commit is contained in:
parent
6c28c377bf
commit
d9e4ec2640
|
|
@ -790,7 +790,30 @@ export function commissionList(data) {
|
|||
}
|
||||
|
||||
|
||||
|
||||
// 活动分类 - 列表获取
|
||||
export function activityCateList(data) {
|
||||
return request.get('marketing/activity/cate/list', data)
|
||||
}
|
||||
// 活动分类 - 编辑表单
|
||||
export function activityCateEditFrom(data) {
|
||||
return request.post('marketing/activity/cate/editForm',data)
|
||||
}
|
||||
// 活动分类 - 删除
|
||||
export function activityCateDel(data) {
|
||||
return request.post('marketing/activity/cate/delInfo', data)
|
||||
}
|
||||
// 活动 - 列表获取
|
||||
export function activityList(data) {
|
||||
return request.get('marketing/activity/list', data)
|
||||
}
|
||||
// 活动 - 编辑表单
|
||||
export function activityEditFrom(data) {
|
||||
return request.post('marketing/activity/editForm',data)
|
||||
}
|
||||
// 活动 - 删除
|
||||
export function activityDel(data) {
|
||||
return request.post('marketing/activity/delInfo', data)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -545,6 +545,38 @@ const marketingRouter =
|
|||
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'activity',
|
||||
name: 'Activity',
|
||||
meta: {
|
||||
title: '活动中心',
|
||||
noCache: true
|
||||
},
|
||||
redirect: 'noRedirect',
|
||||
component: () => import('@/views/marketing/activity/index'),
|
||||
children: [
|
||||
{
|
||||
path: 'cate',
|
||||
name: `agentList`,
|
||||
meta: {
|
||||
title: '活动分类',
|
||||
noCache: true
|
||||
},
|
||||
component: () => import('@/views/marketing/activity/activity/cate')
|
||||
},
|
||||
{
|
||||
path: 'index',
|
||||
name: `agentList`,
|
||||
meta: {
|
||||
title: '活动列表',
|
||||
noCache: true
|
||||
},
|
||||
component: () => import('@/views/marketing/activity/activity/index')
|
||||
},
|
||||
]
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,123 @@
|
|||
<template>
|
||||
<div class="divBox">
|
||||
<!--主要内容-->
|
||||
<el-card class="box-card">
|
||||
<!--顶部搜索栏-->
|
||||
<div slot="header" class="clearfix">
|
||||
<div class="container">
|
||||
<el-form inline size="small" label-width="80px">
|
||||
<el-form-item label="">
|
||||
<el-input v-model="tableFrom.title" placeholder="请输入分类名称">
|
||||
<el-button slot="append" icon="el-icon-search" class="el-button-solt" @click="getList(1)"/>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-button size="small" type="success" @click="editCate">添加分类</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<!--表格信息-->
|
||||
<el-table v-loading="listLoading" :data="tableData.data" style="width: 100%" size="mini">
|
||||
<el-table-column label="ID" prop="id" min-width="80" align="center"/>
|
||||
<el-table-column label="分类名称" prop="title" min-width="100" align="center"/>
|
||||
<el-table-column label="操作" min-width="100" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="editCate({id: scope.row.id})">编辑</el-button>
|
||||
<el-button type="text" size="small" @click="delCate(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页-->
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
:page-sizes="[20, 40, 60, 80]"
|
||||
:page-size="tableFrom.limit"
|
||||
:current-page="tableFrom.page"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="tableData.total"
|
||||
@size-change="handleUserSizeChange"
|
||||
@current-change="pageUserChange"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {activityCateDel, activityCateEditFrom, activityCateList} from "@/api/marketing";
|
||||
|
||||
export default {
|
||||
name: "preSaleProductList",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
// 列表
|
||||
listLoading: false,
|
||||
tableFrom: {
|
||||
page: 1,
|
||||
limit: 20,
|
||||
title: '',
|
||||
},
|
||||
tableData: {
|
||||
data: [],
|
||||
total: 0,
|
||||
},
|
||||
};
|
||||
},
|
||||
watch: {},
|
||||
mounted() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
// 列表
|
||||
getList(num = ''){
|
||||
let _this = this;
|
||||
_this.listLoading = true;
|
||||
_this.tableFrom.page = num ? num : _this.tableFrom.page;
|
||||
activityCateList(_this.tableFrom).then((res) => {
|
||||
_this.tableData.data = res.data.list;
|
||||
_this.tableData.total = res.data.count;
|
||||
_this.listLoading = false;
|
||||
}).catch((res) => {
|
||||
_this.listLoading = false;
|
||||
_this.$message.error(res.message);
|
||||
});
|
||||
},
|
||||
pageUserChange(page) {
|
||||
this.tableFrom.page = page;
|
||||
this.getList('');
|
||||
},
|
||||
handleUserSizeChange(val) {
|
||||
this.tableFrom.limit = val;
|
||||
this.getList('');
|
||||
},
|
||||
// 添加 || 编辑
|
||||
editCate(data = {}){
|
||||
this.$modalForm(activityCateEditFrom(data)).then(() => this.getList(''));
|
||||
},
|
||||
// 删除
|
||||
delCate(id){
|
||||
let _this = this;
|
||||
this.$confirm('删除后不可恢复,您确认删除吗?', '提示', {
|
||||
confirmButtonText: '删除',
|
||||
cancelButtonText: '不删除',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
activityCateDel({ id: id}).then((res) => {
|
||||
_this.getList('')
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功'
|
||||
})
|
||||
}).catch((res) => {
|
||||
console.log('错误',res)
|
||||
});
|
||||
}).catch(action => {})
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
||||
|
|
@ -0,0 +1,123 @@
|
|||
<template>
|
||||
<div class="divBox">
|
||||
<!--主要内容-->
|
||||
<el-card class="box-card">
|
||||
<!--顶部搜索栏-->
|
||||
<div slot="header" class="clearfix">
|
||||
<div class="container">
|
||||
<el-form inline size="small" label-width="80px">
|
||||
<el-form-item label="">
|
||||
<el-input v-model="tableFrom.title" placeholder="请输入活动名称">
|
||||
<el-button slot="append" icon="el-icon-search" class="el-button-solt" @click="getList(1)"/>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-button size="small" type="success" @click="editCate">添加活动</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<!--表格信息-->
|
||||
<el-table v-loading="listLoading" :data="tableData.data" style="width: 100%" size="mini">
|
||||
<el-table-column label="ID" prop="id" min-width="80" align="center"/>
|
||||
<el-table-column label="分类名称" prop="title" min-width="100" align="center"/>
|
||||
<el-table-column label="操作" min-width="100" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="editCate({id: scope.row.id})">编辑</el-button>
|
||||
<el-button type="text" size="small" @click="delCate(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页-->
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
:page-sizes="[20, 40, 60, 80]"
|
||||
:page-size="tableFrom.limit"
|
||||
:current-page="tableFrom.page"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="tableData.total"
|
||||
@size-change="handleUserSizeChange"
|
||||
@current-change="pageUserChange"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {activityDel, activityEditFrom, activityList} from "@/api/marketing";
|
||||
|
||||
export default {
|
||||
name: "preSaleProductList",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
// 列表
|
||||
listLoading: false,
|
||||
tableFrom: {
|
||||
page: 1,
|
||||
limit: 20,
|
||||
title: '',
|
||||
},
|
||||
tableData: {
|
||||
data: [],
|
||||
total: 0,
|
||||
},
|
||||
};
|
||||
},
|
||||
watch: {},
|
||||
mounted() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
// 列表
|
||||
getList(num = ''){
|
||||
let _this = this;
|
||||
_this.listLoading = true;
|
||||
_this.tableFrom.page = num ? num : _this.tableFrom.page;
|
||||
activityList(_this.tableFrom).then((res) => {
|
||||
_this.tableData.data = res.data.list;
|
||||
_this.tableData.total = res.data.count;
|
||||
_this.listLoading = false;
|
||||
}).catch((res) => {
|
||||
_this.listLoading = false;
|
||||
_this.$message.error(res.message);
|
||||
});
|
||||
},
|
||||
pageUserChange(page) {
|
||||
this.tableFrom.page = page;
|
||||
this.getList('');
|
||||
},
|
||||
handleUserSizeChange(val) {
|
||||
this.tableFrom.limit = val;
|
||||
this.getList('');
|
||||
},
|
||||
// 添加 || 编辑
|
||||
editCate(data = {}){
|
||||
this.$modalForm(activityEditFrom(data)).then(() => this.getList(''));
|
||||
},
|
||||
// 删除
|
||||
delCate(id){
|
||||
let _this = this;
|
||||
this.$confirm('删除后不可恢复,您确认删除吗?', '提示', {
|
||||
confirmButtonText: '删除',
|
||||
cancelButtonText: '不删除',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
activityDel({ id: id}).then((res) => {
|
||||
_this.getList('')
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功'
|
||||
})
|
||||
}).catch((res) => {
|
||||
console.log('错误',res)
|
||||
});
|
||||
}).catch(action => {})
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<template>
|
||||
<router-view />
|
||||
</template>
|
||||
Loading…
Reference in New Issue