|
|
|
@ -11,11 +11,9 @@ |
|
|
|
|
<a-form-item v-if="$module('user-grade')" label="会员等级"> |
|
|
|
|
<a-select v-decorator="['gradeId', { initialValue: 0 }]"> |
|
|
|
|
<a-select-option :value="0">全部</a-select-option> |
|
|
|
|
<a-select-option |
|
|
|
|
v-for="(item, index) in gradeList" |
|
|
|
|
:key="index" |
|
|
|
|
:value="item.grade_id" |
|
|
|
|
>{{ item.name }}</a-select-option> |
|
|
|
|
<a-select-option v-for="(item, index) in gradeList" :key="index" :value="item.grade_id">{{ |
|
|
|
|
item.name |
|
|
|
|
}}</a-select-option> |
|
|
|
|
</a-select> |
|
|
|
|
</a-form-item> |
|
|
|
|
<a-form-item label="注册时间"> |
|
|
|
@ -27,14 +25,7 @@ |
|
|
|
|
</a-form> |
|
|
|
|
</a-row> |
|
|
|
|
</div> |
|
|
|
|
<s-table |
|
|
|
|
ref="table" |
|
|
|
|
rowKey="user_id" |
|
|
|
|
:loading="isLoading" |
|
|
|
|
:columns="columns" |
|
|
|
|
:data="loadData" |
|
|
|
|
:pageSize="15" |
|
|
|
|
> |
|
|
|
|
<s-table ref="table" rowKey="user_id" :loading="isLoading" :columns="columns" :data="loadData" :pageSize="15"> |
|
|
|
|
<!-- 会员头像 --> |
|
|
|
|
<span slot="avatar_url" slot-scope="text"> |
|
|
|
|
<div class="avatar"> |
|
|
|
@ -72,12 +63,7 @@ |
|
|
|
|
</span> |
|
|
|
|
<!-- 操作 --> |
|
|
|
|
<span class="actions" slot="action" slot-scope="item"> |
|
|
|
|
<a |
|
|
|
|
v-if="$module('market-recharge')" |
|
|
|
|
v-action:recharge |
|
|
|
|
@click="handleRecharge(item)" |
|
|
|
|
title="会员充值" |
|
|
|
|
>充值</a> |
|
|
|
|
<a v-if="$module('market-recharge')" v-action:recharge @click="handleRecharge(item)" title="会员充值">充值</a> |
|
|
|
|
<a v-if="$module('user-grade')" v-action:grade @click="handleGrade(item)" title="会员等级">等级</a> |
|
|
|
|
<a v-action:delete @click="handleDelete(item)">删除</a> |
|
|
|
|
</span> |
|
|
|
@ -99,48 +85,52 @@ import { GradeForm, RechargeForm } from './modules' |
|
|
|
|
const columns = filterModules([ |
|
|
|
|
{ |
|
|
|
|
title: '会员ID', |
|
|
|
|
dataIndex: 'user_id' |
|
|
|
|
dataIndex: 'user_id', |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '会员头像', |
|
|
|
|
dataIndex: 'avatar_url', |
|
|
|
|
scopedSlots: { customRender: 'avatar_url' } |
|
|
|
|
scopedSlots: { customRender: 'avatar_url' }, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '昵称/手机号', |
|
|
|
|
scopedSlots: { customRender: 'main_info' } |
|
|
|
|
scopedSlots: { customRender: 'main_info' }, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '会员身份', |
|
|
|
|
dataIndex: 'user_type_text', |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '会员等级', |
|
|
|
|
moduleKey: 'user-grade', |
|
|
|
|
dataIndex: 'grade', |
|
|
|
|
scopedSlots: { customRender: 'grade' } |
|
|
|
|
scopedSlots: { customRender: 'grade' }, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '余额/积分', |
|
|
|
|
dataIndex: 'balance', |
|
|
|
|
scopedSlots: { customRender: 'balance' } |
|
|
|
|
scopedSlots: { customRender: 'balance' }, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '实际消费金额', |
|
|
|
|
dataIndex: 'expend_money', |
|
|
|
|
scopedSlots: { customRender: 'expend_money' } |
|
|
|
|
scopedSlots: { customRender: 'expend_money' }, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '注册来源', |
|
|
|
|
dataIndex: 'platform', |
|
|
|
|
scopedSlots: { customRender: 'platform' } |
|
|
|
|
scopedSlots: { customRender: 'platform' }, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '注册时间', |
|
|
|
|
dataIndex: 'create_time' |
|
|
|
|
dataIndex: 'create_time', |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '操作', |
|
|
|
|
// dataIndex: 'action', |
|
|
|
|
width: '180px', |
|
|
|
|
scopedSlots: { customRender: 'action' } |
|
|
|
|
} |
|
|
|
|
scopedSlots: { customRender: 'action' }, |
|
|
|
|
}, |
|
|
|
|
]) |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
@ -149,9 +139,9 @@ export default { |
|
|
|
|
STable, |
|
|
|
|
GradeForm, |
|
|
|
|
RechargeForm, |
|
|
|
|
PlatformIcon |
|
|
|
|
PlatformIcon, |
|
|
|
|
}, |
|
|
|
|
data () { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
// 当前表单元素 |
|
|
|
|
searchForm: this.$form.createForm(this), |
|
|
|
@ -162,56 +152,54 @@ export default { |
|
|
|
|
// table表头 |
|
|
|
|
columns, |
|
|
|
|
// 加载数据方法 必须为 Promise 对象 |
|
|
|
|
loadData: param => { |
|
|
|
|
return Api.list({ ...param, ...this.queryParam }) |
|
|
|
|
.then(response => response.data.list) |
|
|
|
|
loadData: (param) => { |
|
|
|
|
return Api.list({ ...param, ...this.queryParam }).then((response) => response.data.list) |
|
|
|
|
}, |
|
|
|
|
// 会员等级列表 |
|
|
|
|
gradeList: [] |
|
|
|
|
gradeList: [], |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
created () { |
|
|
|
|
created() { |
|
|
|
|
// 获取会员等级列表 |
|
|
|
|
this.getGradeList() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
|
|
|
|
|
// 获取会员等级列表 |
|
|
|
|
getGradeList () { |
|
|
|
|
GradeApi.all().then(result => { |
|
|
|
|
getGradeList() { |
|
|
|
|
GradeApi.all().then((result) => { |
|
|
|
|
this.gradeList = result.data.list |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 修改会员等级 |
|
|
|
|
handleGrade (item) { |
|
|
|
|
handleGrade(item) { |
|
|
|
|
this.$refs.GradeForm.handle(item) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 会员充值 |
|
|
|
|
handleRecharge (item) { |
|
|
|
|
handleRecharge(item) { |
|
|
|
|
this.$refs.RechargeForm.handle(item) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 删除记录 |
|
|
|
|
handleDelete (item) { |
|
|
|
|
handleDelete(item) { |
|
|
|
|
const app = this |
|
|
|
|
const modal = this.$confirm({ |
|
|
|
|
title: '您确定要删除该记录吗?', |
|
|
|
|
content: '删除后不可恢复', |
|
|
|
|
onOk () { |
|
|
|
|
onOk() { |
|
|
|
|
return Api.deleted({ userId: item.user_id }) |
|
|
|
|
.then(result => { |
|
|
|
|
.then((result) => { |
|
|
|
|
app.$message.success(result.message, 1.5) |
|
|
|
|
app.handleRefresh() |
|
|
|
|
}) |
|
|
|
|
.finally(result => modal.destroy()) |
|
|
|
|
} |
|
|
|
|
.finally((result) => modal.destroy()) |
|
|
|
|
}, |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 确认搜索 |
|
|
|
|
handleSearch (e) { |
|
|
|
|
handleSearch(e) { |
|
|
|
|
e.preventDefault() |
|
|
|
|
this.searchForm.validateFields((error, values) => { |
|
|
|
|
if (!error) { |
|
|
|
@ -225,11 +213,10 @@ export default { |
|
|
|
|
* 刷新列表 |
|
|
|
|
* @param Boolean bool 强制刷新到第一页 |
|
|
|
|
*/ |
|
|
|
|
handleRefresh (bool = false) { |
|
|
|
|
handleRefresh(bool = false) { |
|
|
|
|
this.$refs.table.refresh(bool) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|