用户充值等级
This commit is contained in:
19
src/api/userRechargeLevel/userRechargeLevel.js
Normal file
19
src/api/userRechargeLevel/userRechargeLevel.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
// 获取用户充值等级列表
|
||||
export const listLevel = query => {
|
||||
return request({
|
||||
url: '/admin/recharge/userRechargeLevel/listLevel',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
// 获取用户充值等级列表
|
||||
export const pageUserRechargeLevel = query => {
|
||||
return request({
|
||||
url: '/admin/recharge/userRechargeLevel/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
196
src/views/users/userRechargeLevel.vue
Normal file
196
src/views/users/userRechargeLevel.vue
Normal file
@@ -0,0 +1,196 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<div class="inquire">
|
||||
<span>平台ID:</span>
|
||||
<el-input v-model="formData.erbanNo"
|
||||
placeholder=""
|
||||
class="input" />
|
||||
</div>
|
||||
<div class="inquire">
|
||||
<span>分区</span>
|
||||
<partition-select v-model:partition-id="formData.partitionId"
|
||||
v-model:after-init="getData" />
|
||||
</div>
|
||||
<div class="inquire">
|
||||
<el-select v-model="formData.level">
|
||||
<el-option label="全部"
|
||||
value=""></el-option>
|
||||
<el-option v-for="item in levelList"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="item"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<el-button style=""
|
||||
type="primary"
|
||||
@click="getData">查询</el-button>
|
||||
<el-button style=""
|
||||
type="primary"
|
||||
@click="resetFormData">重置</el-button>
|
||||
<!-- 表格数据 -->
|
||||
<el-table v-loading="tableData.loading"
|
||||
:data="tableData.data"
|
||||
ref="multipleTable"
|
||||
@selection-change="handleSelectionChange"
|
||||
border
|
||||
style="width: 100%; margin-top: 25px">
|
||||
<el-table-column prop="erbanNo"
|
||||
align="center"
|
||||
label="用户ID" />
|
||||
<el-table-column prop="nick"
|
||||
align="center"
|
||||
label="用户昵称" />
|
||||
<el-table-column prop="partitionDesc"
|
||||
align="center"
|
||||
label="分区" />
|
||||
<el-table-column prop="regionDesc"
|
||||
align="center"
|
||||
label="国家" />
|
||||
<el-table-column prop="level"
|
||||
align="center"
|
||||
label="充值等级" />
|
||||
<el-table-column prop="isRechargeUser"
|
||||
align="center"
|
||||
label="是否充值代理">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.isRechargeUser ? '是' : '否' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="totalGold"
|
||||
align="center"
|
||||
label="总充值金额">
|
||||
<template v-slot="scope">
|
||||
{{ formattedNumber(scope.row.totalGold) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="last60TotalGold"
|
||||
align="center"
|
||||
label="近60天充值金额">
|
||||
<template v-slot="scope">
|
||||
{{ formattedNumber(scope.row.last60TotalGold) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<el-pagination style="margin-top: 10px"
|
||||
class="paginationClass"
|
||||
:current-page="formData.page"
|
||||
:page-size="formData.pageSize"
|
||||
:page-sizes="[20, 50, 100, 200]"
|
||||
layout="sizes, prev, pager, next"
|
||||
:total="tableData.total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, onMounted, reactive, computed } from 'vue'
|
||||
import PartitionSelect from "@/views/common/partitionSelect.vue";
|
||||
import { listLevel, pageUserRechargeLevel } from '@/api/userRechargeLevel/userRechargeLevel'
|
||||
import { ElMessage } from "element-plus";
|
||||
|
||||
export default {
|
||||
name: 'userRechargeLevel',
|
||||
components: {
|
||||
PartitionSelect
|
||||
},
|
||||
setup () {
|
||||
const levelList = ref([])
|
||||
const formData = reactive({
|
||||
partitionId: undefined,
|
||||
page: 1,
|
||||
pageSize: 20,
|
||||
erbanNo: '',
|
||||
level: '',
|
||||
})
|
||||
const tableData = reactive({
|
||||
data: [],
|
||||
total: 0,
|
||||
loading: false,
|
||||
})
|
||||
const initLevelSelect = () => {
|
||||
listLevel().then(res => {
|
||||
if (res.code !== 200) {
|
||||
ElMessage.error(res.message);
|
||||
return
|
||||
}
|
||||
levelList.value = res.data;
|
||||
})
|
||||
};
|
||||
const getData = () => {
|
||||
tableData.loading = true;
|
||||
pageUserRechargeLevel(formData).then(res => {
|
||||
if (res.code != 200) {
|
||||
ElMessage.error(res.message);
|
||||
return
|
||||
}
|
||||
tableData.data = res.data.rows
|
||||
tableData.total = res.data.total
|
||||
}).finally(() => {
|
||||
tableData.loading = false;
|
||||
})
|
||||
};
|
||||
// 千分位
|
||||
const formattedNumber = computed(() => {
|
||||
return (num) => {
|
||||
if (num === null || num === undefined) return '';
|
||||
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
||||
};
|
||||
})
|
||||
const handleSizeChange = (val) => {
|
||||
formData.pageSize = val;
|
||||
getData();
|
||||
};
|
||||
const handleCurrentChange = (val) => {
|
||||
formData.page = val;
|
||||
getData();
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
initLevelSelect();
|
||||
});
|
||||
|
||||
return {
|
||||
formData,
|
||||
getData,
|
||||
tableData,
|
||||
levelList,
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
formattedNumber
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.box {
|
||||
padding-top: 20px;
|
||||
background: #ecf0f5;
|
||||
|
||||
.inquire {
|
||||
display: inline-block;
|
||||
margin-right: 20px;
|
||||
|
||||
span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.input {
|
||||
width: 180px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.dialogTableVisibleBut {
|
||||
display: block;
|
||||
margin: 30px 0 0 830px;
|
||||
}
|
||||
|
||||
.paginationClass {
|
||||
margin: 15px 0 5px 0px;
|
||||
}
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user