添加:分配并且激活兑换码功能
This commit is contained in:
parent
a235982cc9
commit
1f8a961b24
|
|
@ -1,14 +1,15 @@
|
|||
|
||||
import request from './request'
|
||||
|
||||
/**
|
||||
* @description 验证码
|
||||
*/
|
||||
* @description 验证码
|
||||
*/
|
||||
export function captchaApi() {
|
||||
return request.get(`captcha`)
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 登录
|
||||
*/
|
||||
* @description 登录
|
||||
*/
|
||||
export function login(data) {
|
||||
return request.post(`login`, data)
|
||||
}
|
||||
|
|
@ -40,6 +41,7 @@ export function passwordFormApi() {
|
|||
export function editFormApi() {
|
||||
return request.get(`system/admin/edit/form`)
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 菜单
|
||||
*/
|
||||
|
|
@ -51,115 +53,150 @@ export function getInfo(token) {
|
|||
return request({
|
||||
url: '/vue-element-admin/user/info',
|
||||
method: 'get',
|
||||
params: { token }
|
||||
params: {token}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 标签
|
||||
*/
|
||||
export function getBaseInfo() {
|
||||
return request.get(`info`)
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 用户标签 -- 列表
|
||||
*/
|
||||
export function labelLstApi(data) {
|
||||
return request.get('user/label/lst', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 用户标签 -- 添加表单
|
||||
*/
|
||||
export function labelFormApi() {
|
||||
return request.get('user/label/form')
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 用户标签 -- 编辑表单
|
||||
*/
|
||||
export function labelEditApi(id) {
|
||||
return request.get('user/label/form/' + id)
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 用户标签 -- 删除
|
||||
*/
|
||||
export function labelDeleteApi(id) {
|
||||
return request.delete(`user/label/${id}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 自动标签 -- 添加
|
||||
*/
|
||||
export function AutolabelCreateApi(data) {
|
||||
return request.post('auto_label/create', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 自动标签 -- 列表
|
||||
*/
|
||||
export function AutolabelLstApi(data) {
|
||||
return request.get('auto_label/lst', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 自动标签 -- 编辑
|
||||
*/
|
||||
export function AutolabelUpdateApi(id, data) {
|
||||
return request.post('auto_label/update/' + id, data)
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 自动标签 -- 删除
|
||||
*/
|
||||
export function AutolabelDeleteApi(id) {
|
||||
return request.delete(`auto_label/delete/${id}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 自动标签 -- 更新
|
||||
*/
|
||||
export function AutolabelSyncApi(id) {
|
||||
return request.post('auto_label/sync/' + id)
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 用户 -- 列表
|
||||
*/
|
||||
export function userLstApi(data) {
|
||||
return request.get('user/lst', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 用户 -- 详情消费记录
|
||||
*/
|
||||
export function userOrderApi(uid, data) {
|
||||
return request.get(`user/order/${uid}`, data)
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 用户 -- 详情优惠券
|
||||
*/
|
||||
export function userCouponApi(uid, data) {
|
||||
return request.get(`user/coupon/${uid}`, data)
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 用户 -- 批量设置分组
|
||||
*/
|
||||
export function changeGroupApi(id) {
|
||||
return request.get('user/change_label/form/' + id)
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 修改商户基本信息
|
||||
*/
|
||||
export function merchantUpdate(data) {
|
||||
return request.post("/info/update", data)
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 用户搜索信息 -- 列表
|
||||
*/
|
||||
export function userSearchLstApi(data) {
|
||||
return request.get("user/search_log", data)
|
||||
return request.get("user/search_log", data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取版权信息
|
||||
* @returns
|
||||
*/
|
||||
export function getVersion() {
|
||||
export function getVersion() {
|
||||
return request.get('../api/version')
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 付费会员记录 -- 列表
|
||||
*/
|
||||
export function memberRecordListApi(data) {
|
||||
export function memberRecordListApi(data) {
|
||||
return request.get('user/svip/order_lst', data)
|
||||
}
|
||||
|
||||
// 会员卡兑换码 - 列表获取
|
||||
export function exchangeCodeList(data) {
|
||||
return request.get('user/exchangeCode/getList', data)
|
||||
}
|
||||
// 会员卡兑换码 - 批次列表获取
|
||||
export function exchangeCodeBatchList() {
|
||||
return request.get('user/exchangeCode/getBatchList')
|
||||
}
|
||||
// 会员卡兑换码 - 激活表单
|
||||
export function exchangeCodeActivateForm() {
|
||||
return request.get('user/exchangeCode/activateForm')
|
||||
}
|
||||
// 会员卡兑换码 - 激活表单
|
||||
export function exchangeCodeSearchData() {
|
||||
return request.get('user/exchangeCode/getSearchData')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,31 +17,37 @@ const userRouter =
|
|||
path: 'label',
|
||||
name: 'UserLabel',
|
||||
meta: { title: '用户标签', noCache: true },
|
||||
component: () => import('@/views/user/group'),
|
||||
component: () => import('@/views/user/group')
|
||||
},
|
||||
{
|
||||
path: 'maticlabel',
|
||||
name: 'UserAutoLabel',
|
||||
meta: { title: '自动标签', noCache: true },
|
||||
component: () => import('@/views/user/label'),
|
||||
component: () => import('@/views/user/label')
|
||||
},
|
||||
{
|
||||
path: 'list',
|
||||
name: 'UserList',
|
||||
meta: { title: '用户列表', noCache: true },
|
||||
component: () => import('@/views/user/list'),
|
||||
component: () => import('@/views/user/list')
|
||||
},
|
||||
{
|
||||
path: 'searchRecord',
|
||||
name: 'searchRecord',
|
||||
meta: { title: '用户搜索记录', noCache: true },
|
||||
component: () => import('@/views/user/search'),
|
||||
component: () => import('@/views/user/search')
|
||||
},
|
||||
{
|
||||
path: 'memberRecord',
|
||||
name: 'memberRecord',
|
||||
meta: { title: '付费会员记录', noCache: true },
|
||||
component: () => import('@/views/user/member/record'),
|
||||
component: () => import('@/views/user/member/record')
|
||||
},
|
||||
{
|
||||
path: 'exchangeCode',
|
||||
name: 'exchangeCode',
|
||||
meta: { title: '兑换码', noCache: true },
|
||||
component: () => import('@/views/user/exchangeCode/index')
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,288 @@
|
|||
<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-select v-model="tableFrom.status" class="selWidth" clearable placeholder="请选择状态">
|
||||
<el-option label="未激活" :value="0"></el-option>
|
||||
<el-option label="已激活" :value="1"></el-option>
|
||||
<el-option label="已使用" :value="2"></el-option>
|
||||
</el-select>
|
||||
<el-select v-if="Object.values(batch_list).length > 0" v-model="tableFrom.batch_unique" class="selWidth" clearable placeholder="请选择批次">
|
||||
<el-option v-for="(item,index) in batch_list" :label="index" :value="item"></el-option>
|
||||
</el-select>
|
||||
<el-select v-if="Object.values(vip_list).length > 0" v-model="tableFrom.group_data_id" class="selWidth" clearable placeholder="请选择会员卡">
|
||||
<el-option v-for="(item,index) in vip_list" :key="index" :label="item.value" :value="item.group_data_id"></el-option>
|
||||
</el-select>
|
||||
<el-select v-if="Object.values(staff_list).length > 0" v-model="tableFrom.staff_id" class="selWidth" clearable placeholder="请选择绑定员工">
|
||||
<el-option v-for="(item,index) in staff_list" :key="index" :label="item.nickname" :value="item.service_id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-button size="small" type="primary" @click="getList(1)">搜索</el-button>
|
||||
<el-button size="small" type="warning" @click="activateExchangeCode">分配并激活</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="归属批次" min-width="130" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.batch_title }}<br />
|
||||
{{ scope.row.batch_unique }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="兑换码" min-width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status == 0" type="info" effect="dark">{{ scope.row.exchange_code }}</el-tag>
|
||||
<el-tag v-else-if="scope.row.status == 1" type="primary" effect="dark">{{
|
||||
scope.row.exchange_code
|
||||
}}
|
||||
</el-tag>
|
||||
<el-tag v-else-if="scope.row.status == 2" type="success" effect="dark">{{
|
||||
scope.row.exchange_code
|
||||
}}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" min-width="150" align="center">
|
||||
<template slot="header" slot-scope="scope">
|
||||
状态<br />
|
||||
激活时间 / 使用时间
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status == 0" type="info">待激活</el-tag>
|
||||
<template v-else-if="scope.row.status == 1">
|
||||
<el-tag type="primary">
|
||||
已激活 <br />
|
||||
{{ scope.row.activate }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<template v-else-if="scope.row.status == 2">
|
||||
<el-tag type="success">
|
||||
已使用<br />
|
||||
{{ scope.row.use_time }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="绑定员工" prop="staff_nickname" min-width="100" align="center" />
|
||||
<el-table-column label="添加时间" prop="create_time" min-width="130" align="center" />
|
||||
<el-table-column label="绑定会员卡" prop="svip_name" min-width="100" align="center" />
|
||||
<el-table-column label="使用人员" min-width="230" align="center">
|
||||
<template slot-scope="scope">
|
||||
<div class="user-content" v-if="scope.row.user">
|
||||
<div class="user-avatar">
|
||||
<img :src="scope.row.user.avatar || moren" />
|
||||
</div>
|
||||
<div class="user-info">
|
||||
<div class="nickname">{{ scope.row.user.nickname }}</div>
|
||||
<div class="agent-type-text">
|
||||
<el-tag type="info" effect="dark" size="small">{{ scope.row.user.uid }}</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</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 {exchangeCodeActivateForm, exchangeCodeBatchList, exchangeCodeList, exchangeCodeSearchData} from "@/api/user";
|
||||
|
||||
export default {
|
||||
name: "preSaleProductList",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
moren: require("@/assets/images/f.png"),
|
||||
// 列表
|
||||
listLoading: false,
|
||||
tableFrom: {
|
||||
page: 1,
|
||||
limit: 20,
|
||||
status: '',
|
||||
batch_unique: '',
|
||||
staff_id: '',
|
||||
group_data_id: ''
|
||||
},
|
||||
tableData: {
|
||||
data: [],
|
||||
total: 0,
|
||||
},
|
||||
batch_list: {},
|
||||
vip_list: {},
|
||||
staff_list: {},
|
||||
};
|
||||
},
|
||||
watch: {},
|
||||
mounted() {
|
||||
this.isShow = false;
|
||||
this.getList();
|
||||
this.getBatchList();
|
||||
this.getSearchData();
|
||||
},
|
||||
methods: {
|
||||
// 列表
|
||||
getList(num = '') {
|
||||
let _this = this;
|
||||
_this.listLoading = true;
|
||||
_this.tableFrom.page = num ? num : _this.tableFrom.page;
|
||||
exchangeCodeList(_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('');
|
||||
},
|
||||
// 批次列表
|
||||
getBatchList() {
|
||||
let _this = this;
|
||||
exchangeCodeBatchList().then((res) => {
|
||||
_this.batch_list = res.data || {};
|
||||
}).catch((res) => {
|
||||
_this.$message.error(res.message);
|
||||
});
|
||||
},
|
||||
// 获取搜索对象
|
||||
getSearchData() {
|
||||
let _this = this;
|
||||
exchangeCodeSearchData().then((res) => {
|
||||
this.vip_list = res.data.vipList || {};
|
||||
this.staff_list = res.data.service || {};
|
||||
}).catch((res) => {
|
||||
_this.$message.error(res.message);
|
||||
});
|
||||
},
|
||||
// 激活
|
||||
activateExchangeCode() {
|
||||
this.$modalForm(exchangeCodeActivateForm()).then(() => this.getList(''));
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.qrcode {
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/deep/ .el-table .cell {
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.selWidth {
|
||||
margin-bottom: 10px !important;
|
||||
}
|
||||
|
||||
.user-content {
|
||||
--user-content-height-: 80px;
|
||||
|
||||
height: var(--user-content-height-);
|
||||
width: 100%;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
|
||||
.user-avatar {
|
||||
height: var(--user-content-height-);
|
||||
width: var(--user-content-height-);
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
img {
|
||||
height: 80% !important;
|
||||
width: 80% !important;
|
||||
border-radius: 50% !important;
|
||||
}
|
||||
}
|
||||
|
||||
.user-info {
|
||||
max-width: calc(100% - var(--user-content-height-));
|
||||
height: var(--user-content-height-);
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
|
||||
.nickname {
|
||||
width: 100%;
|
||||
height: 25px;
|
||||
line-height: 25px;
|
||||
text-align: left;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
|
||||
.user-id {
|
||||
color: #fff;
|
||||
background-color: #409eff;
|
||||
border-color: #409eff;
|
||||
height: 18px;
|
||||
line-height: 20px;
|
||||
font-size: 13px;
|
||||
padding: 0 5px;
|
||||
border-radius: 5px;
|
||||
margin-left: 10px;
|
||||
width: max-content !important;
|
||||
}
|
||||
}
|
||||
|
||||
.user-id {
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
font-size: 13px;
|
||||
line-height: calc(var(--user-content-height- * 35%));
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue