增加:共创股东 - 等级管理
This commit is contained in:
parent
137373bf04
commit
cf1b1fbf33
|
|
@ -392,9 +392,18 @@ export function merQuotaChangeRecord(data) {
|
||||||
return request.post('system/merchant/quota/change_record', data)
|
return request.post('system/merchant/quota/change_record', data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 共创股东 - 等级列表
|
||||||
|
export function merShareholderList(data) {
|
||||||
|
return request.get('system/merchant/shareholder_level/list',data)
|
||||||
|
}
|
||||||
|
// 共创股东 - 编辑表单
|
||||||
|
export function merShareholderEditForm(data) {
|
||||||
|
return request.post('system/merchant/shareholder_level/get_form',data)
|
||||||
|
}
|
||||||
|
// 共创股东 - 删除等级
|
||||||
|
export function merShareholderDelForm(id) {
|
||||||
|
return request.post(`system/merchant/shareholder_level/del_info/${id}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -215,6 +215,151 @@ const merchantRouter =
|
||||||
},
|
},
|
||||||
component: () => import('@/views/merchant/quota/index')
|
component: () => import('@/views/merchant/quota/index')
|
||||||
},
|
},
|
||||||
|
// 共创股东 - 列表
|
||||||
|
{
|
||||||
|
path: 'mer_shareholder',
|
||||||
|
name: 'MerShareholderList',
|
||||||
|
meta: {
|
||||||
|
title: '联盟商家共创股东管理',
|
||||||
|
noCache: true,
|
||||||
|
merchant_type: 0,
|
||||||
|
},
|
||||||
|
component: () => import('@/views/merchant/shareholder/index')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'shop_shareholder',
|
||||||
|
name: 'MerchantShareholderList',
|
||||||
|
meta: {
|
||||||
|
title: '酒道馆共创股东管理',
|
||||||
|
noCache: true,
|
||||||
|
merchant_type: 1,
|
||||||
|
},
|
||||||
|
component: () => import('@/views/merchant/shareholder/index')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'smoke_shareholder',
|
||||||
|
name: 'SmokeShareholderList',
|
||||||
|
meta: {
|
||||||
|
title: '烟酒店共创股东管理',
|
||||||
|
noCache: true,
|
||||||
|
merchant_type: 3,
|
||||||
|
},
|
||||||
|
component: () => import('@/views/merchant/shareholder/index')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'supermarket_shareholder',
|
||||||
|
name: 'supermarketShareholderList',
|
||||||
|
meta: {
|
||||||
|
title: '超市共创股东管理',
|
||||||
|
noCache: true,
|
||||||
|
merchant_type: 4,
|
||||||
|
},
|
||||||
|
component: () => import('@/views/merchant/shareholder/index')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'province_shareholder',
|
||||||
|
name: 'provinceShareholderList',
|
||||||
|
meta: {
|
||||||
|
title: '省公司门店共创股东管理',
|
||||||
|
noCache: true,
|
||||||
|
merchant_type: 5,
|
||||||
|
},
|
||||||
|
component: () => import('@/views/merchant/shareholder/index')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'hall_shareholder',
|
||||||
|
name: 'hallShareholderList',
|
||||||
|
meta: {
|
||||||
|
title: '城市会客厅共创股东管理',
|
||||||
|
noCache: true,
|
||||||
|
merchant_type: 6,
|
||||||
|
},
|
||||||
|
component: () => import('@/views/merchant/shareholder/index')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'health_shareholder',
|
||||||
|
name: 'healthShareholderList',
|
||||||
|
meta: {
|
||||||
|
title: '健康体检馆共创股东管理',
|
||||||
|
noCache: true,
|
||||||
|
merchant_type: 7,
|
||||||
|
},
|
||||||
|
component: () => import('@/views/merchant/shareholder/index')
|
||||||
|
},
|
||||||
|
// 共创股东 - 等级管理
|
||||||
|
{
|
||||||
|
path: 'mer_shareholder_level',
|
||||||
|
name: 'MerShareholderLevel',
|
||||||
|
meta: {
|
||||||
|
title: '联盟商家共创股东等级',
|
||||||
|
noCache: true,
|
||||||
|
merchant_type: 0,
|
||||||
|
},
|
||||||
|
component: () => import('@/views/merchant/shareholder/level')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'shop_shareholder_level',
|
||||||
|
name: 'MerchantShareholderLevel',
|
||||||
|
meta: {
|
||||||
|
title: '酒道馆共创股东等级',
|
||||||
|
noCache: true,
|
||||||
|
merchant_type: 1,
|
||||||
|
},
|
||||||
|
component: () => import('@/views/merchant/shareholder/level')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'smoke_shareholder_level',
|
||||||
|
name: 'SmokeShareholderLevel',
|
||||||
|
meta: {
|
||||||
|
title: '烟酒店共创股东等级',
|
||||||
|
noCache: true,
|
||||||
|
merchant_type: 3,
|
||||||
|
},
|
||||||
|
component: () => import('@/views/merchant/shareholder/level')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'supermarket_shareholder_level',
|
||||||
|
name: 'supermarketShareholderLevel',
|
||||||
|
meta: {
|
||||||
|
title: '超市共创股东等级',
|
||||||
|
noCache: true,
|
||||||
|
merchant_type: 4,
|
||||||
|
},
|
||||||
|
component: () => import('@/views/merchant/shareholder/level')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'province_shareholder_level',
|
||||||
|
name: 'provinceShareholderLevel',
|
||||||
|
meta: {
|
||||||
|
title: '省公司门店共创股东等级',
|
||||||
|
noCache: true,
|
||||||
|
merchant_type: 5,
|
||||||
|
},
|
||||||
|
component: () => import('@/views/merchant/shareholder/level')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'hall_shareholder_level',
|
||||||
|
name: 'hallShareholderLevel',
|
||||||
|
meta: {
|
||||||
|
title: '城市会客厅共创股东等级',
|
||||||
|
noCache: true,
|
||||||
|
merchant_type: 6,
|
||||||
|
},
|
||||||
|
component: () => import('@/views/merchant/shareholder/level')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'health_shareholder_level',
|
||||||
|
name: 'healthShareholderLevel',
|
||||||
|
meta: {
|
||||||
|
title: '健康体检馆共创股东等级',
|
||||||
|
noCache: true,
|
||||||
|
merchant_type: 7,
|
||||||
|
},
|
||||||
|
component: () => import('@/views/merchant/shareholder/level')
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 其他
|
// 其他
|
||||||
{
|
{
|
||||||
path: 'system',
|
path: 'system',
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,155 @@
|
||||||
|
<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="请输入等级名称" clearable>
|
||||||
|
<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="editInfo">添加等级</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="150" align="center"/>
|
||||||
|
<el-table-column label="权重" prop="weight" min-width="80" align="center"/>
|
||||||
|
<el-table-column label="数量限制" min-width="80" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.mer_quota > 0 ? scope.row.mer_quota : '不限' }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="支付金额" min-width="80" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.price > 0 ? scope.row.price : '免费' }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="成为股东赠送相关额度" align="center">
|
||||||
|
<el-table-column label="瓶装酒额度" prop="quota" min-width="80" align="center"/>
|
||||||
|
<el-table-column label="菜卡额度" prop="vegetable_quota" min-width="80" align="center"/>
|
||||||
|
<el-table-column label="油卡额度" prop="oil_quota" min-width="80" align="center"/>
|
||||||
|
<el-table-column label="封坛酒额度" prop="wine_quota" min-width="80" align="center"/>
|
||||||
|
<el-table-column label="优惠券" min-width="80" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.coupon_ids ? Object.values(scope.row.coupon_ids.split(',')).length : '0' }}张
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" min-width="100" fixed="right" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="text" size="small" @click="editInfo({id: scope.row.id})">编辑</el-button>
|
||||||
|
<el-button type="text" size="small" @click="delInfo(scope.row.id)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!--分页-->
|
||||||
|
<div class="block">
|
||||||
|
<el-pagination :page-size="tableFrom.limit" :current-page="tableFrom.page" :total="tableData.total" @current-change="pageChange" />
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {merchantTypeText} from "@/filters";
|
||||||
|
import {merShareholderDelForm, merShareholderEditForm, merShareholderList} from "@/api/merchant";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "MerchantShareholderSet",
|
||||||
|
components: {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
merchantTitle: '商户',
|
||||||
|
// 列表
|
||||||
|
listLoading: false,
|
||||||
|
tableFrom: {
|
||||||
|
page: 1,
|
||||||
|
limit: 20,
|
||||||
|
title: '',
|
||||||
|
merchant_type: '',
|
||||||
|
},
|
||||||
|
tableData: {
|
||||||
|
data: [],
|
||||||
|
total: 0,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
// 路由变更
|
||||||
|
'$route' () {
|
||||||
|
this.tableFrom.merchant_type = this.$route.meta.merchant_type || 0;
|
||||||
|
},
|
||||||
|
// 商户类型变更
|
||||||
|
'tableFrom.merchant_type' () {
|
||||||
|
this.merchantTitle = merchantTypeText(this.tableFrom.merchant_type);
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.tableFrom.merchant_type = this.$route.meta.merchant_type || 0;
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 列表
|
||||||
|
getList(num = ''){
|
||||||
|
let _this = this;
|
||||||
|
_this.listLoading = true;
|
||||||
|
_this.tableFrom.page = num ? num : _this.tableFrom.page;
|
||||||
|
merShareholderList(_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);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
pageChange(page) {
|
||||||
|
this.tableFrom.page = page;
|
||||||
|
this.getList('');
|
||||||
|
},
|
||||||
|
// 添加 || 编辑
|
||||||
|
editInfo(data = {}){
|
||||||
|
data.merchant_type = this.tableFrom.merchant_type;
|
||||||
|
this.$modalForm(merShareholderEditForm(data)).then(() => this.getList(''));
|
||||||
|
},
|
||||||
|
// 删除
|
||||||
|
delInfo(id){
|
||||||
|
let _this = this;
|
||||||
|
this.$confirm('删除后不可恢复,您确认删除吗?', '提示', {
|
||||||
|
confirmButtonText: '删除',
|
||||||
|
cancelButtonText: '不删除',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
merShareholderDelForm(id).then((res) => {
|
||||||
|
_this.getList('')
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '删除成功'
|
||||||
|
})
|
||||||
|
}).catch((res) => {
|
||||||
|
console.log('错误',res)
|
||||||
|
});
|
||||||
|
}).catch(action => {})
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
/deep/ .el-select{
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
/deep/ .cell{
|
||||||
|
padding: 0!important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Loading…
Reference in New Issue