Commit c48ade89 by chenwq

ui改版-会员中心

1 parent 967dc2a7
......@@ -67,47 +67,13 @@
<el-button size="small" class="cancelBtn" @click="cancelEdit">取消</el-button>
<el-button size="small" class="saveBtn" type="primary" @click="submitRuleForm('ruleForm')">保存</el-button>
<el-button size="small" class="lookUpBtn" type="primary" @click="openDialog">查看权益</el-button>
<!-- <el-button :size="small" type="primary" @click="handleExport">导出</el-button> -->
</div>
</div>
</div>
<!-- <div class="pageTitle" v-if="!(merchantModel == 2 && accountLevel == 1)">会员用户</div> -->
<div class="pageTitle">会员用户</div>
<div class="live-room container p-t-20 ">
<el-form :inline="true" style="width: 100%" :model="searchForm" label-width="70px" label-position="right">
<el-row>
<el-form-item size="small" label="会员用户">
<el-input :size="size" v-model="searchForm.userInfo" placeholder="请输入会员用户或手机号" clearable></el-input>
</el-form-item>
<el-form-item size="small" label="门店" style="margin-left: -10px">
<el-input :size="size" v-model="searchForm.merchantName" placeholder="请输入门店" clearable></el-input>
</el-form-item>
<el-form-item size="small" label="状态" style="margin-left: -10px">
<el-select size="small" v-model="searchForm.status" placeholder="请选择">
<el-option v-for="item in memberCenterStatus" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
</el-select>
</el-form-item>
</el-row>
<el-row>
<el-form-item size="small" label="会员类型">
<el-select size="small" v-model="searchForm.memberType" placeholder="请选择">
<el-option v-for="item in memberTypeLists" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
</el-select>
</el-form-item>
<el-form-item size="small" label="开通日期" style="margin-left: -10px">
<el-date-picker :size="size" v-model="searchForm.daterange" type="daterange" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions || {}"></el-date-picker>
</el-form-item>
<el-form-item size="small" label="开通方式" style="margin-left: -10px">
<el-select size="small" v-model="searchForm.activeType" placeholder="请选择">
<el-option v-for="item in openModeLists" :key="item.activeType" :label="item.activeTypeDesc" :value="item.activeType"></el-option>
</el-select>
</el-form-item>
<el-form-item size="small" class="fr-mr0">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" @click="handleReset">重置</el-button>
</el-form-item>
</el-row>
</el-form>
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="flex-between m-b-10 m-t-10">
<div class="text-16 color-3 weight-5">会员列表</div>
<div class="export" @click="handleExport">全部导出</div>
......@@ -199,11 +165,6 @@ export default {
QRcode: ''
}, //推广
isQRVisible: false,
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now() || time.getTime() < new Date('2017-12-31').getTime()
}
},
size: 'small',
getListApi: getCenterListApi,
searchForm: {
......@@ -211,54 +172,59 @@ export default {
status: '',
merchantName: '',
memberType: '',
activeType: ''
activeType: '',
daterange: ''
},
searchFormTable: {},
memberTypeLists: [
// 搜索
searchFormData: [
{
dictValue: '',
dictLabel: '全部'
label: '会员用户',
name: 'userInfo',
type: 'input',
placeholder: '请输入会员用户或手机号',
maxlength: 100
},
{
dictValue: 1,
dictLabel: '正式会员'
label: '门店',
name: 'merchantName',
type: 'input',
maxlength: 100
},
{
dictValue: 2,
dictLabel: '试用会员'
}
],
openModeLists: [
{
dictValue: '',
dictLabel: '全部'
label: '状态',
name: 'status',
type: 'select',
optionList: [],
optionId: 'dictValue',
optionLabel: 'dictLabel',
optionsName: 'memberCenterStatuList'
},
{
dictValue: 6,
dictLabel: '付费开通'
label: '会员类型',
name: 'memberType',
type: 'select',
optionList: [],
optionId: 'dictValue',
optionLabel: 'dictLabel',
optionsName: 'memberTypeLists'
},
{
dictValue: 12,
dictLabel: '无忧服务'
label: '开通日期',
name: 'daterange',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
dictValue: 0,
dictLabel: '试用领取'
}
],
memberCenterStatus: [
{
dictValue: '',
dictLabel: '全部'
},
{
dictValue: 1,
dictLabel: '生效中'
label: '开通方式',
name: 'activeType',
type: 'select',
optionList: [],
optionId: 'dictValue',
optionLabel: 'dictLabel',
optionsName: 'openModeList'
},
{
dictValue: 2,
dictLabel: '已失效'
}
],
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
......@@ -284,14 +250,14 @@ export default {
label: '会员类型',
prop: 'memberType',
formatter: cellValue => {
return this.baseDataList.memberTypeList.find(item => item.confId == cellValue.memberType).confName
return cellValue.memberType ? this.baseData.memberTypeList.find(item => item.confId == cellValue.memberType).confName : '-'
}
},
{
label: '状态',
prop: 'status',
formatter: cellValue => {
return this.baseDataList.statusList.find(item => item.confId == cellValue.memberStatus).confName
return cellValue.memberStatus ? this.baseData.statusList.find(item => item.confId == cellValue.memberStatus).confName : '-'
}
}
]
......@@ -314,9 +280,43 @@ export default {
}
]
},
baseDataList: {
baseData: {
statusList: statusList,
memberTypeList: memberTypeList
memberTypeList: memberTypeList,
memberCenterStatuList: [
{
dictValue: 1,
dictLabel: '生效中'
},
{
dictValue: 2,
dictLabel: '已失效'
}
],
memberTypeLists: [
{
dictValue: 1,
dictLabel: '正式会员'
},
{
dictValue: 2,
dictLabel: '试用会员'
}
],
openModeList: [
{
dictValue: 6,
dictLabel: '付费开通'
},
{
dictValue: 12,
dictLabel: '无忧服务'
},
{
dictValue: 0,
dictLabel: '试用领取'
}
]
},
isShowEditWrap: false,
......@@ -354,13 +354,41 @@ export default {
this.getCardContentFun()
this.getCardtypeList()
},
mounted() { },
mounted() {
this.getOptionsList('searchFormData')
},
methods: {
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
//门店会员开通方式
getCardtypeList() {
getCardtypeList({}).then(res => {
if (res.code == 0) {
this.openModeLists = res.data
this.openModeList = res.data
}
})
},
......@@ -468,26 +496,13 @@ export default {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (params.daterange) {
params.startTime = this.searchForm.daterange[0] + ' 00:00:00'
params.endTime = this.searchForm.daterange[1] + ' 23:59:59'
} else {
if (params.beginTime) delete params.beginTime && delete params.endTime
params.startTime = new Date(this.searchForm.daterange[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endTime = new Date(this.searchForm.daterange[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.daterange
return params
},
beforeSearchFn() {
// return new Promise((resolve, reject) => {
// this.searchFormTable = JSON.parse(JSON.stringify(this.searchForm))
// if (this.searchFormTable.daterange) {
// this.searchFormTable.startTime = this.searchForm.daterange[0] + ' 00:00:00'
// this.searchFormTable.endTime = this.searchForm.daterange[1] + ' 23:59:59'
// } else {
// if (this.searchFormTable.beginTime) delete this.searchFormTable.beginTime && delete this.searchFormTable.endTime
// }
// delete this.searchFormTable.daterange
// resolve()
// })
return new Promise((resolve, reject) => {
this.searchFormTable = this.getParams()
resolve()
......@@ -500,7 +515,14 @@ export default {
})
},
handleReset() {
this.searchForm = {}
this.searchForm = {
userInfo: '',
status: '',
merchantName: '',
memberType: '',
activeType: '',
daterange: ''
}
this.handleSearch()
},
handleSearch() {
......@@ -538,10 +560,6 @@ export default {
width: 53px;
margin: 0 3px;
}
.proForm {
// display: flex;
// justify-content: center;
}
.lineCtn {
display: flex;
flex-direction: row;
......@@ -723,9 +741,9 @@ export default {
.el-range-editor--small.el-input__inner {
width: 215px;
}
/deep/ .container .el-input--small .el-input__inner {
width: 215px;
}
// /deep/ .container .el-input--small .el-input__inner {
// width: 215px;
// }
/deep/ .el-dialog__header .el-dialog__title {
// font-size: 16px;
// color: #000;
......
<template>
<div class="live-room marketing">
<div class="live-room container">
<div class="flex">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<!-- <div class="flex">
<el-form :inline="true" style="width: 100%" :model="searchForm" label-width="70px" label-position="right">
<el-row>
<el-form-item size="small" label="订单编号">
......@@ -43,27 +44,26 @@
</el-form-item>
</el-row>
</el-form>
</div>
</div> -->
<div class="choseRow m-b-10">
<div class="choseItem" :class="{ active: currentIndex == index + 1 }" v-for="(item, index) in choseList" :key="index" @click="tabClick(index + 1)">
{{ item }}
</div>
</div>
<GLTable ref="memberOrderRef" v-if="isReload" :noDataImg="url" @setTableFinishFun="setTableFinishFun" :searchForm="searchFormTable" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<template slot="orderType" slot-scope="scope">
<div slot="orderType" slot-scope="scope" style="width: 200px">
<template v-if="scope.scope.orderType == 1">
<span>{{ scope.scope.packageType == 1 ? '门店套餐' : '集团套餐' }}</span>
</template>
<template v-else>
<span>会员卡</span>
</template>
</template>
</div>
<span class="table-btns" slot="auth-button" slot-scope="scope" :data="scope.scope">
<!-- <el-button type="text" @click="handleDetail(scope.scope)" v-if="scope.scope.orderType == 1">详情</el-button>
<el-button type="text" style="color:#eee" v-else>详情</el-button> -->
<GLButton @click="handleDetail(scope.scope)" fn="订单详情" type="text" v-if="scope.scope.orderType == 1">详情</GLButton>
<!-- <GLButton @click="handleDetail(scope.scope)" fn="订单详情" type="text" v-if="scope.scope.orderType == 1">详情</GLButton>
<GLButton style="color: #eee" fn="订单详情" type="text" v-else>详情</GLButton>
<GLButton fn="退款" v-if="scope.scope.refundFlag == 1" type="text" @click="handleRefund(scope.scope)">退款</GLButton>
<GLButton fn="退款" v-if="scope.scope.refundFlag == 1" type="text" @click="handleRefund(scope.scope)">退款</GLButton> -->
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</span>
</GLTable>
</div>
......@@ -90,11 +90,6 @@ export default {
accountLevel: 0, //1,2,3,4工厂,省代,市代,门店
url: url,
isReload: true,
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now() || time.getTime() < new Date('2017-12-31').getTime()
}
},
size: 'small',
searchForm: {
orderStatus: '', //默认查询全部
......@@ -102,21 +97,82 @@ export default {
// daterange:''
orderType: ''
},
// 搜索
searchFormData: [
{
label: '订单编号',
name: 'orderCode',
type: 'input',
maxlength: 100
},
{
label: '名称',
name: 'packageName',
type: 'input',
maxlength: 100
},
{
label: '类型',
name: 'orderType',
type: 'select',
optionList: [],
optionId: 'dictValue',
optionLabel: 'dictLabel',
optionsName: 'orderTypeList'
},
{
label: '用户信息',
name: 'userInfo',
type: 'input',
placeholder: '请输入用户名或手机号',
maxlength: 100
},
{
label: '下单时间',
name: 'daterange',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '开通门店',
name: 'merchantName',
type: 'input',
maxlength: 100
}
],
choseList: ['全部', '待收货', '已完成', '退款|售后'],
currentIndex: 1,
searchFormTable: {},
orderTypeList: [
// 表格按钮
tableButtonList: [
{
dictValue: '',
dictLabel: '全部'
},
{
dictValue: 1,
dictLabel: '套餐'
type: 'GLButton',
name: '详情',
attrs: {
type: 'text',
fn: '订单详情',
disabled: row => {
return row.orderType != 1
}
},
listeners: {
click: this.handleDetail
}
},
{
dictValue: 2,
dictLabel: '会员卡'
type: 'GLButton',
name: '退款',
attrs: {
type: 'text',
fn: '退款'
},
condition: row => {
return row.refundFlag == 1
},
listeners: {
click: this.handleRefund
}
}
],
// 表格组件
......@@ -137,7 +193,7 @@ export default {
prop: 'orderType',
addHtml: 'orderType'
// formatter: cellValue => {
// return this.baseDataList.orderTypesList.find(item => item.confId == cellValue.orderType).confName
// return this.baseData.orderTypesList.find(item => item.confId == cellValue.orderType).confName
// }
},
{
......@@ -154,18 +210,18 @@ export default {
prop: 'orderStatus',
width: '80',
formatter: cellValue => {
return this.baseDataList.orderStatusList.find(item => item.confId == cellValue.orderStatus).confName
return this.baseData.orderStatusList.find(item => item.confId == cellValue.orderStatus).confName
}
},
{
label: '下单时间',
prop: 'createDate',
width: 160
width: 200
},
{
label: '开通门店',
prop: 'merchantName',
width: '180'
width: 220
},
{
label: '推荐人',
......@@ -178,6 +234,7 @@ export default {
{
label: '用户信息',
prop: 'accountName',
width: 220,
formatter: cellValue => {
return cellValue.accountName + ' ' + cellValue.mobile
}
......@@ -185,13 +242,23 @@ export default {
{
label: '订单号',
prop: 'orderCode',
width: 190
width: 200
}
]
},
baseDataList: {
baseData: {
orderTypesList: orderTypesList,
orderStatusList: orderStatusList
orderStatusList: orderStatusList,
orderTypeList: [
{
dictValue: 1,
dictLabel: '套餐'
},
{
dictValue: 2,
dictLabel: '会员卡'
}
],
}
}
},
......@@ -205,8 +272,36 @@ export default {
this.tableParams.tableColumns.splice(idx, 1)
}
},
mounted() { },
mounted() {
this.getOptionsList('searchFormData')
},
methods: {
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
tabClick(index) {
this.currentIndex = index
switch (index) {
......@@ -241,10 +336,8 @@ export default {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (params.daterange) {
params.startTime = this.searchForm.daterange[0] + ' 00:00:00'
params.endTime = this.searchForm.daterange[1] + ' 23:59:59'
} else {
if (params.beginTime) delete params.beginTime && delete params.endTime
params.startTime = new Date(this.searchForm.daterange[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endTime = new Date(this.searchForm.daterange[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.daterange
return params
......@@ -311,9 +404,10 @@ export default {
handleReset() {
this.isReload = false
this.currentIndex = 1
this.searchForm = {}
this.searchForm.orderStatus = '' //默认查询全部
this.searchForm.orderType = ''
this.searchForm = {
orderStatus: '',
orderType: ''
}
// this.handleSearch()
this.$nextTick(() => {
this.isReload = true
......@@ -324,9 +418,9 @@ export default {
</script>
<style lang="scss" scoped>
/deep/.el-input--small .el-input__inner {
width: 215px;
}
// /deep/.el-input--small .el-input__inner {
// width: 215px;
// }
.el-range-editor.is-active,
.el-range-editor.is-active:hover {
border-color: #5850ff;
......
<template>
<div class="marketing">
<div class="btnWrap">
<!-- <el-button :size="size" type="primary" @click="handleCreate" icon="el-icon-plus">创建套餐</el-button> -->
<GLButton type="primary" @click="handleCreate" size="small" icon="el-icon-plus" fn="创建套餐" mode="el-button">创建套餐</GLButton>
<!-- <el-button :size="size" @click="showViewer = true">查看示例效果</el-button> -->
<el-image-viewer
v-if="showViewer"
:on-close="
<el-image-viewer v-if="showViewer" :on-close="
() => {
showViewer = false
}
"
:url-list="srcList"
style="padding:4%;"
/>
" :url-list="srcList" style="padding:4%;" />
</div>
<tip-panel class="list-panel" panelMinHeight="40px" :panelContent="panelContent" v-if="isFirstShow" @closePanel="closePanel"></tip-panel>
<template v-if="accountLevel == 4 && merchantModel == 1">
......@@ -36,30 +30,23 @@
<span class="table-btns" slot="optionsFun" slot-scope="scope" :data="scope.scope">
<template v-if="!(accountLevel == 4 && activetab == 1)">
<template v-if="scope.scope.state === 0">
<!-- <el-button type="text" @click="handleEdit(scope.scope)">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button> -->
<!-- <template v-if="scope.scope.state === 0">
<GLButton type="text" @click="handleEdit(scope.scope)" fn="编辑套餐">编辑</GLButton>
<GLButton type="text" @click="handleUpOption(scope.scope)" fn="上架">上架</GLButton>
<GLButton type="text" @click="handleDelete(scope.scope)" fn="删除">删除</GLButton>
</template>
<template v-else-if="scope.scope.state === 1">
<!-- <el-button type="text" @click="handleDownOption(scope.scope)">下架</el-button>
<el-button type="text" @click="handleEdit(scope.scope)">编辑</el-button> -->
<GLButton type="text" @click="handleDownOption(scope.scope)" fn="下架">下架</GLButton>
<GLButton type="text" @click="handleEdit(scope.scope)" fn="编辑套餐">编辑</GLButton>
</template>
<template v-else>
<!-- <el-button type="text" @click="handleEdit(scope.scope)">编辑</el-button>
<el-button type="text" @click="handleUpOption(scope.scope)">上架</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button> -->
<GLButton type="text" @click="handleEdit(scope.scope)" fn="编辑套餐">编辑</GLButton>
<GLButton type="text" @click="handleUpOption(scope.scope)" fn="上架">上架</GLButton>
<GLButton type="text" @click="handleDelete(scope.scope)" fn="删除">删除</GLButton>
</template>
<GLButton type="text" @click="handleUpdateToTop(scope.scope)" v-if="scope.scope.topFlag == 2 && accountLevel != 4" fn="置顶推荐">置顶推荐</GLButton>
<el-button type="text" v-if="scope.scope.topFlag == 1 && accountLevel != 4">已置顶推荐</el-button>
<el-button type="text" v-if="scope.scope.topFlag == 1 && accountLevel != 4">已置顶推荐</el-button> -->
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</template>
</span>
</GLTable>
......@@ -125,6 +112,86 @@ export default {
}
],
activetab: 0,
// 表格按钮
tableButtonList: [
{
type: 'GLButton',
name: '编辑',
attrs: {
type: 'text',
fn: '编辑套餐'
},
listeners: {
click: this.handleEdit
}
},
{
type: 'GLButton',
name: '上架',
attrs: {
type: 'text',
fn: '上架'
},
condition: row => {
return row.state != 1
},
listeners: {
click: this.handleUpOption
}
},
{
type: 'GLButton',
name: '下架',
attrs: {
type: 'text',
fn: '下架'
},
condition: row => {
return row.state == 1
},
listeners: {
click: this.handleDownOption
}
},
{
type: 'GLButton',
name: '删除',
attrs: {
type: 'text',
fn: '删除'
},
condition: row => {
return row.state != 1
},
listeners: {
click: this.handleDelete
}
},
{
type: 'GLButton',
name: '置顶推荐',
attrs: {
type: 'text',
fn: '置顶推荐'
},
condition: row => {
return row.topFlag == 2 && this.accountLevel != 4
},
listeners: {
click: this.handleUpdateToTop
}
},
{
type: 'el-button',
name: '已置顶推荐',
attrs: {
type: 'text'
},
condition: row => {
return row.topFlag == 1 && this.accountLevel != 4
}
}
],
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
......@@ -146,7 +213,8 @@ export default {
},
{
label: '套餐售价/元',
prop: 'packagePrice'
prop: 'packagePrice',
width: 180
},
{
label: '说明',
......@@ -212,7 +280,7 @@ export default {
this.dynamicFile()
this.getLoginCountFun()
},
mounted() {},
mounted() { },
methods: {
dynamicFile() {
let { activetab, accountLevel } = this
......@@ -333,7 +401,7 @@ export default {
})
},
// 查看示例效果
handleLook(row) {},
handleLook(row) { },
handleDelete(row) {
this.$messageBox.confirm('是否删除该套餐?', '删除', {
confirmButtonText: '确定',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!