|
@@ -27,10 +27,26 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div class="table-title adfacjb">
|
|
<div class="table-title adfacjb">
|
|
|
<div class="table-title-left">会员列表共({{ total }})人</div>
|
|
<div class="table-title-left">会员列表共({{ total }})人</div>
|
|
|
- <div class="table-title-right">
|
|
|
|
|
- <el-button type="primary" icon="el-icon-plus" @click="handleExportTicket">导入专享券</el-button>
|
|
|
|
|
- <el-button type="primary" icon="el-icon-plus" @click="handleExportHeart">导入爱心值</el-button>
|
|
|
|
|
- <el-button type="primary" icon="el-icon-plus" @click="handleAdd" v-if="$hasPermission('core:appuser:save')">新增会员</el-button>
|
|
|
|
|
|
|
+ <div class="table-title-right adfac">
|
|
|
|
|
+ <el-button type="default" @click="handleDownloadTieket" v-if="$hasPermission('core:appuser:downloadTicket')">下载专享券导入模板</el-button>
|
|
|
|
|
+ <el-upload v-if="$hasPermission('core:appuser:importTicket')"
|
|
|
|
|
+ :action="uploadUrl"
|
|
|
|
|
+ :headers="uploadHeaders"
|
|
|
|
|
+ :on-success="uploadFileSuccess"
|
|
|
|
|
+ :before-upload="beforeAvatarUpload"
|
|
|
|
|
+ :limit="1">
|
|
|
|
|
+ <el-button type="primary" style="margin-left: 10px;">导入专享券</el-button>
|
|
|
|
|
+ </el-upload>
|
|
|
|
|
+ <el-button type="default" @click="handleDownloadLove" style="margin-left: 10px;" v-if="$hasPermission('core:appuser:downloadLove')">下载爱心值导入模板</el-button>
|
|
|
|
|
+ <el-upload v-if="$hasPermission('core:appuser:importLove')"
|
|
|
|
|
+ :action="uploadUrl2"
|
|
|
|
|
+ :headers="uploadHeaders"
|
|
|
|
|
+ :on-success="uploadFileSuccess"
|
|
|
|
|
+ :before-upload="beforeAvatarUpload"
|
|
|
|
|
+ :limit="1">
|
|
|
|
|
+ <el-button type="primary" style="margin-left: 10px;">导入爱心值</el-button>
|
|
|
|
|
+ </el-upload>
|
|
|
|
|
+ <el-button type="primary" @click="handleAdd" v-if="$hasPermission('core:appuser:save')" style="margin-left: 10px;">新增会员</el-button>
|
|
|
<el-button type="default" @click="handleExcel" v-if="$hasPermission('core:appuser:export')">导出Excel</el-button>
|
|
<el-button type="default" @click="handleExcel" v-if="$hasPermission('core:appuser:export')">导出Excel</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -65,7 +81,7 @@
|
|
|
<el-table-column label="操作" width="300" fixed="right">
|
|
<el-table-column label="操作" width="300" fixed="right">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
<el-button link type="text" @click="handleDetail(scope.row)" v-if="$hasPermission('core:appuser:detail')">会员详情</el-button>
|
|
<el-button link type="text" @click="handleDetail(scope.row)" v-if="$hasPermission('core:appuser:detail')">会员详情</el-button>
|
|
|
- <el-button link type="text" @click="handleCreateCode(scope.row)" v-if="$hasPermission('core:appuser:code')">生成邀请码</el-button>
|
|
|
|
|
|
|
+ <!-- <el-button link type="text" @click="handleCreateCode(scope.row)" v-if="$hasPermission('core:appuser:code')">生成邀请码</el-button> -->
|
|
|
<el-button link type="text" @click="handleDelete(scope.row)" v-if="$hasPermission('core:appuser:delete')">删除</el-button>
|
|
<el-button link type="text" @click="handleDelete(scope.row)" v-if="$hasPermission('core:appuser:delete')">删除</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -100,7 +116,12 @@ export default {
|
|
|
total: 0,
|
|
total: 0,
|
|
|
channelOptions: [],
|
|
channelOptions: [],
|
|
|
dataList: [],
|
|
dataList: [],
|
|
|
- loading: false
|
|
|
|
|
|
|
+ loading: false,
|
|
|
|
|
+ uploadUrl: `${window.SITE_CONFIG['apiURL']}/core/activity/coupon/import`,
|
|
|
|
|
+ uploadUrl2: `${window.SITE_CONFIG['apiURL']}/core/love/value/record/import`,
|
|
|
|
|
+ uploadHeaders: {
|
|
|
|
|
+ token: Cookies.get('token')
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created () {
|
|
created () {
|
|
@@ -138,6 +159,34 @@ export default {
|
|
|
}
|
|
}
|
|
|
this.getList()
|
|
this.getList()
|
|
|
},
|
|
},
|
|
|
|
|
+ handleDownloadTieket () {
|
|
|
|
|
+ window.location.href = `${window.SITE_CONFIG['apiURL']}/core/activity/coupon/download?token=${Cookies.get('token')}`
|
|
|
|
|
+ },
|
|
|
|
|
+ handleExportTicket () {
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+ handleDownloadLove () {
|
|
|
|
|
+ window.location.href = `${window.SITE_CONFIG['apiURL']}/core/love/value/record/download?token=${Cookies.get('token')}`
|
|
|
|
|
+ },
|
|
|
|
|
+ handleExportHeart () {
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+ beforeAvatarUpload (file) {
|
|
|
|
|
+ const isXls = file.type === 'application/vnd.ms-excel'
|
|
|
|
|
+ const isXlsx = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
|
|
|
|
+ if (!isXls && !isXlsx) {
|
|
|
|
|
+ this.$message.error('上传文件只能是 xls 或 xlsx 格式!')
|
|
|
|
|
+ }
|
|
|
|
|
+ return isXls || isXlsx
|
|
|
|
|
+ },
|
|
|
|
|
+ uploadFileSuccess (response, file, fileList) {
|
|
|
|
|
+ if (response && response.code === 0) {
|
|
|
|
|
+ this.$message.success('导入成功!')
|
|
|
|
|
+ this.getList()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error(response.msg || '文件上传失败!')
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
handleAdd () {
|
|
handleAdd () {
|
|
|
this.$router.push({ name: 'memberAdd' })
|
|
this.$router.push({ name: 'memberAdd' })
|
|
|
},
|
|
},
|
|
@@ -179,6 +228,9 @@ export default {
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
|
|
|
+::v-deep .el-upload-list{
|
|
|
|
|
+ display: none;
|
|
|
|
|
+}
|
|
|
.page-title{
|
|
.page-title{
|
|
|
font-family: PingFang-SC, PingFang-SC;
|
|
font-family: PingFang-SC, PingFang-SC;
|
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
@@ -208,6 +260,11 @@ export default {
|
|
|
font-size: 16px;
|
|
font-size: 16px;
|
|
|
color: #252525;
|
|
color: #252525;
|
|
|
line-height: 22px;
|
|
line-height: 22px;
|
|
|
|
|
+ width: 200px;
|
|
|
|
|
+ }
|
|
|
|
|
+ &-right{
|
|
|
|
|
+ width: calc(100% - 200px);
|
|
|
|
|
+ justify-content: flex-end;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|