文件

367 行
17 KiB
HTML
可执行文件

<!--[1.8.70]-->
<style>
.tags {
margin: 15px 15px 0 0;
}
</style>
<div id="vipIndexApp">
<el-form :inline="true" size="small">
<el-form-item>
<el-input placeholder="昵称/手机号/实体卡"
type="text" size="small"
v-model="searchForm.keyword" clearable
@keydown.enter.exact.native.prevent="handleCurrentChange(1)" style="width:200px">
</el-input>
</el-form-item>
<el-form-item v-if="storeAuth.store_show_vip_info==1">
<select-store :store-id.sync="searchForm.store_id"
:store-status="3"
:show-status="true"
:placeholder="'会员所属门店'"></select-store>
</el-form-item>
<el-form-item>
<el-select size="small" v-model="searchForm.status" placeholder="会员状态" clearable>
<el-option v-for="item in vipStatus"
:key="item.status"
:label="item.name"
:value="item.status">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button size="small" plain type="primary" @click="handleCurrentChange(1)">搜索</el-button>
<el-button v-if="storeAuth.data_export==1&&operate.exportVip" @click="exportTable">导出</el-button>
<el-button size="small" @click="showEditMore = !showEditMore">>>>更多搜索</el-button>
</el-form-item>
<div v-show="showEditMore" style="display: flex;flex-direction: row;flex-wrap: wrap;">
<el-form-item>
<vip-more-search :section="searchForm.section"></vip-more-search>
</el-form-item>
</div>
</el-form>
<div class="table-top-card-box">
<div class="table-top-card">
<div class="table-top-card-header">会员总数</div>
<div class="table-top-card-body">{{sumData.all_count}}</div>
</div>
<div class="table-top-card">
<div class="table-top-card-header">昨日新会员</div>
<div class="table-top-card-body">{{sumData.yesterday_count}}</div>
</div>
<div class="table-top-card">
<div class="table-top-card-header">上周新会员</div>
<div class="table-top-card-body">{{sumData.last_week_count}}</div>
</div>
<div class="table-top-card">
<div class="table-top-card-header">总可用积分</div>
<div class="table-top-card-body">{{sumData.all_integral}}</div>
</div>
<div class="table-top-card">
<div class="table-top-card-header">总可用余额</div>
<div class="table-top-card-body">{{sumData.all_balance}}</div>
</div>
</div>
<!--列表-->
<div style="max-width: calc(100vw - 208px);margin-top: 20px;">
<el-table border :data="vipList" size="small" :max-height="tableHeight"
:header-cell-style="{background:'#F5F7FA',color:'#606266'}">
<el-table-column align="center" type="index" label="序号" width="50" align="center"></el-table-column>
<el-table-column align="center" label="姓名/昵称" show-overflow-tooltip
min-width="120">
<template slot-scope="scope">
<span v-if="scope.row.name">{{scope.row.name}}</span><br/>
<span v-if="scope.row.nickname">{{scope.row.nickname}}</span>
</template>
</el-table-column>
<el-table-column align="center" prop="mobile_phone" label="手机号" min-width="100px"
show-overflow-tooltip></el-table-column>
<el-table-column align="center" prop="user_label" label="会员标签" min-width="100"></el-table-column>
<el-table-column align="center" prop="card_key" label="实体卡号" min-width="70"
show-overflow-tooltip></el-table-column>
<el-table-column align="center" prop="birthday" min-width="100" label="生日"
show-overflow-tooltip></el-table-column>
<el-table-column align="center" prop="grade_name" label="等级" min-width="90"
show-overflow-tooltip></el-table-column>
<el-table-column align="center" prop="discount" label="折扣" min-width="60"
show-overflow-tooltip></el-table-column>
<el-table-column align="center" prop="balance" label="余额" min-width="80"
show-overflow-tooltip></el-table-column>
<el-table-column align="center" prop="integral" label="积分" min-width="60"
show-overflow-tooltip></el-table-column>
<el-table-column align="center" prop="store_name" label="所属门店" min-width="90"
show-overflow-tooltip></el-table-column>
<el-table-column align="center" prop="guide_name" label="所属导购" min-width="90"
show-overflow-tooltip></el-table-column>
<el-table-column align="center" prop="add_time" label="激活时间" min-width="140"
show-overflow-tooltip></el-table-column>
<el-table-column align="center" prop="status_name" label="状态" min-width="70"
show-overflow-tooltip></el-table-column>
<el-table-column align="center" fixed="right" label="操作" width="130">
<template slot-scope="scope">
<el-button type="text" size="mini" @click="toDetails(scope.row.id)">详细信息</el-button>
<el-dropdown>
<el-button plain type="text" size="mini">更多操作</el-button>
<el-dropdown-menu slot="dropdown">
<div style="display: flex;flex-direction: column;padding: 0 10px">
<el-button size="mini" type="text" v-if="operate.rechargeList"
@click.native="refund(scope.row.id)">余额退款
</el-button>
<template v-if="storeAuth.store_operation_vip==1">
<!--冻结-->
<vip-frozen v-if="operate.frozenVip && scope.row.status==1"
:vid="scope.row.id" :type="3" @end="getVipList"></vip-frozen>
<!--挂失-->
<vip-loss v-if="operate.lossVip && scope.row.status == 1"
:vid="scope.row.id" :type="3" @end="getVipList"></vip-loss>
<!--恢复-->
<vip-thaw v-if="operate.thawVip && (scope.row.status == 3 || scope.row.status == 4)"
:vid="scope.row.id" :type="3" @end="getVipList"></vip-thaw>
<!--密码-->
<vip-password v-if="operate.modifyPassword"
:vid="scope.row.id" :type="3"></vip-password>
<template v-if="storeAuth.store_edit_vip_info==1&&operate.modifyVip">
<el-button size="mini" type="text" @click.native="modifyVip(scope.row)">修改信息
</el-button>
<el-button size="mini" type="text" @click.native="doSetVipLabel(scope.row.id)">会员标签
</el-button>
</template>
</template>
</div>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
<div slot="empty" v-if="!loading">暂无数据</div>
<div slot="empty" v-else><span class="el-icon-loading"></span></div>
</el-table>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10, 15, 20, 25, 30, 35, 40, 45, 50]"
:page-size="100"
layout="total, sizes, prev, pager, next, jumper"
:total="currentLen">
</el-pagination>
</div>
<!--编辑会员-->
<edit-vip-info :show="showModifyDialog"
:type="3"
:edit-data="editForm"
@end="editVipEnd"></edit-vip-info>
<!-- 会员标签 -->
<edit-vip-label :show="showSetVipLabelDialog"
:vid="edit_vid"
@end="editVipLabelEnd"></edit-vip-label>
</div>
<script src="/Public/Retail/common/js/select-store.js"></script>
<script src="/Public/Retail/common/js/select-vip-grade.js?v=1.0.2"></script>
<script src="/Public/Retail/js/vip/common-operate.js"></script>
<script src="/Public/Retail/js/vip/edit-vip-label.js"></script>
<script type="text/javascript">
var vipIndexApp = new Vue({
el: '#vipIndexApp',
data: {
tableHeight: (MenuApp.getContainerClientHeight() - 240) + 'px',
operate: {},
vipList: [],//会员列表
sumData: {
all_count: 0,//会员总数
yesterday_count: 0,//昨日新增会员
last_week_count: 0,//上周新增会员
all_integral: 0,//当前可使用总积分
all_balance: 0,//当前可使用总余额
},
searchForm: {
store_id: '',
keyword: '',
status: '',
section: {
integral: '',
balance: '',
purchase: '',
type: '',
time: '',
}
},
editForm: {},//编辑会员的资料
showModifyDialog: false,//是否显示编辑会员
showEditMore: false,//是否显示更多操作
currentPage: 1,//页
currentLimit: 10,//每页数量
currentLen: 10,//当前条件下总数量
loading: true,//列表是否在加载中
vipStatus: [
{name: '正常会员', status: 1},
{name: '已冻结会员', status: 3},
{name: '已挂失会员', status: 4},
],
edit_vid: '',//当前编辑标签的会员id
showSetVipLabelDialog: false,//是否显示会员标签设置
},
methods: {
//查看会员信息
toDetails(id) {
layer.open({
type: 2,
title: "详细信息",
content: "{:U('MemberAnalyze/detail')}?id=" + id,
area: ["calc(100% - 160px)", "calc(100% - 65px)"],
offset: 'rb',
resize: false,
shade: 0,
move: false
});
},
//余额退款
refund(id) {
layer.open({
type: 2,
title: "充值列表",
content: "{:U('rechargeIndex')}?id=" + id,
area: ['calc(100% - 160px)', 'calc(100% - 65px)'],
offset: 'rb',
resize: false,
shade: 0,
move: false,
end: () => {
this.getVipList();
}
})
},
//修改会员信息
modifyVip(item) {
this.editForm = {...item};
this.showModifyDialog = true;
},
editVipEnd() {
this.showModifyDialog = false;
this.getVipList();
},
//显示修改会员标签
doSetVipLabel(id) {
//会员标签
this.edit_vid = id;
this.showSetVipLabelDialog = true;
},
editVipLabelEnd() {
this.showSetVipLabelDialog = false;
this.getVipList();
},
//切换每页筛选数量
handleSizeChange(val) {
this.currentLimit = val;
this.currentPage = 1;
this.getVipList();
},
//切换页数
handleCurrentChange(val) {
this.currentPage = val;
this.getVipList();
},
//获取统计数据
getSumData() {
if ([1, 2, 3].indexOf(this.searchForm.section.type) > -1) {
if (!this.searchForm.section.time) {
return this.$message.warning('请选择时间');
}
}
this.sendRequest('Retail/Vips/getSumData', {
data: {
...this.searchForm,
section: JSON.stringify(this.searchForm.section),
},
success: (res) => {
if (res.status == 1) {
this.sumData.yesterday_count = res.data.yesterday_count;
this.sumData.last_week_count = res.data.last_week_count;
this.sumData.all_integral = res.data.all_integral;
this.sumData.all_balance = res.data.all_balance;
} else {
this.$message.error(res.message);
}
}
})
},
//获取会员列表
getVipList(fn) {
this.loading = true;
this.sendRequest('Retail/Vips/vipList', {
data: {
page: this.currentPage,
limit: this.currentLimit,
...this.searchForm,
section: JSON.stringify(this.searchForm.section),
},
success: (res) => {
this.loading = false;
if (res.status == 1) {
this.sumData.all_count = res.data.count;
this.vipList = [];
this.vipList = res.data.list;
this.currentLen = parseInt(res.data.count);
this.$nextTick(() => {
typeof fn == "function" && fn()
})
} else {
this.$message.error(res.message);
}
}
})
},
//导出
exportTable() {
this.$confirm('将会根据您的筛选条件导出,您确认导出会员吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let keyword = this.searchForm.keyword;
let status = this.searchForm.status;
let section = this.searchForm.section;
window.location.href = `{:U('exportVip')}?keyword=${keyword}&store_id=${this.searchForm.store_id}&status=${status}&section=${JSON.stringify(section)}`;
}).catch(() => {
});
},
//获取操作权限
getOperate() {
this.checkOperateAuth({
exportVip: '/index.php/Retail/Vips/exportVip',
frozenVip: '/index.php/Retail/Vips/frozenVip',
lossVip: '/index.php/Retail/Vips/lossVip',
thawVip: '/index.php/Retail/Vips/thawVip',
modifyPassword: '/index.php/Retail/Vips/modifyPassword',
modifyVip: '/index.php/Retail/Vips/modifyVip',
rechargeList: '/index.php/Retail/Vips/rechargeList',
}, (data) => {
this.operate = data;
})
},
},
created() {
this.getOperate();
this.handleCurrentChange(1);
this.getSumData();
}
});
</script>