完成周奖励后台

This commit is contained in:
dragon
2025-02-07 17:24:59 +08:00
parent a73f806d92
commit e31f755216
2 changed files with 157 additions and 52 deletions

View File

@@ -20,13 +20,35 @@ export const chargeAgentExport = query => {
}; };
// 获取 周期列表 // 获取 周期列表
export const getDateCycleList = query => { export const getDateCycleList = query => {
return request({ return request({
url: '/anchorSalaryBill/dateCycle/list', url: '/anchorSalaryBill/dateCycle/list',
method: 'get', method: 'get',
params: query params: query
}); });
}; };
// 获取 周奖励周期列表
export const familyMemberWeekLevelRewardListCycleDate = query => {
return request({
url: '/admin/familyMemberWeekLevelReward/listCycleDate',
method: 'get',
params: query
});
};
// 获取 周奖励查询列表
export const familyMemberWeekLevelRewardPage = query => {
return request({
url: '/admin/familyMemberWeekLevelReward/page',
method: 'get',
params: query
});
};
// 导出
export const familyMemberWeekLevelRewardExport = query => {
window.location.href = `/admin/familyMemberWeekLevelReward/export?${genQueryParam(query)}`;
return;
};
// 获取 公会钻石薪资流水统计 列表 // 获取 公会钻石薪资流水统计 列表
export const getAgencyDiamondFlow = query => { export const getAgencyDiamondFlow = query => {

View File

@@ -1,6 +1,23 @@
<template> <template>
<div class="box"> <div class="box">
<!-- 查询 --> <!-- 查询 -->
<div class="inquire">
<div class="block">
<span class="demonstration">分区</span>
<el-select
v-model="inquire.partitionId"
style="width: 75%"
placeholder="请选择"
>
<el-option
v-for="item in inquire.partitionArr"
:key="item.id"
:label="item.desc"
:value="item.id"
></el-option>
</el-select>
</div>
</div>
<div class="inquire"> <div class="inquire">
<span>周期</span> <span>周期</span>
<el-select v-model="inquire.gameArrVal" placeholder="请选择"> <el-select v-model="inquire.gameArrVal" placeholder="请选择">
@@ -33,7 +50,13 @@
" "
>查询</el-button >查询</el-button
> >
<el-button class="primary" type="primary" @click="confirmExport2Excel()" <el-button
class="primary"
type="primary"
@click="
this.inquire.userId = '';
this.getData();
"
>重置搜索</el-button >重置搜索</el-button
> >
<el-button class="primary" type="primary" @click="confirmExport2Excel()" <el-button class="primary" type="primary" @click="confirmExport2Excel()"
@@ -49,17 +72,21 @@
border border
style="width: 100%; margin-top: 25px" style="width: 100%; margin-top: 25px"
> >
<el-table-column prop="x" align="center" label="期" /> <el-table-column prop="cycleDate" align="center" label="期" />
<el-table-column prop="x" align="center" label="公会ID" /> <el-table-column prop="familyId" align="center" label="公会ID" />
<el-table-column prop="x" align="center" label="公会昵称" /> <el-table-column prop="familyName" align="center" label="公会昵称" />
<el-table-column prop="x" align="center" label="公会ID" /> <el-table-column prop="familyOwnerId" align="center" label="公会ID" />
<el-table-column prop="x" align="center" label="公会长昵称" /> <el-table-column
<el-table-column prop="x" align="center" label="主播ID" /> prop="familyOwnerNick"
<el-table-column prop="x" align="center" label="主播昵称" /> align="center"
<el-table-column prop="x" align="center" label="主播等级" /> label="公会长昵称"
<el-table-column prop="x" align="center" label="钻石流水" /> />
<el-table-column prop="x" align="center" label="已获得金币" /> <el-table-column prop="erbanNo" align="center" label="主播ID" />
<el-table-column prop="x" align="center" label="已领取金币" /> <el-table-column prop="nick" align="center" label="主播昵称" />
<el-table-column prop="level" align="center" label="主播等级" />
<el-table-column prop="processNum" align="center" label="钻石流水" />
<el-table-column prop="rewardNum" align="center" label="已获得金币" />
<el-table-column prop="receivedNum" align="center" label="已领取金币" />
</el-table> </el-table>
<!-- 分页 --> <!-- 分页 -->
@@ -77,7 +104,12 @@
</div> </div>
</template> </template>
<script> <script>
import {} from "@/api/relAgency/relAgency"; import {
familyMemberWeekLevelRewardPage,
familyMemberWeekLevelRewardExport,
familyMemberWeekLevelRewardListCycleDate,
} from "@/api/relAgency/relAgency";
import { listPartitionInfo } from "@/api/noblemanNew/noblemanNew";
// @ts-ignore // @ts-ignore
import { dateFormat } from "@/utils/system-helper"; import { dateFormat } from "@/utils/system-helper";
// @ts-ignore // @ts-ignore
@@ -91,9 +123,14 @@ export default {
loading: false, loading: false,
//查询所需条件对象 //查询所需条件对象
inquire: { inquire: {
userId:'', userId: "",
gamesArr:'', gamesArr: [],
gameArrVal:[], gameArrVal: 1,
partitionId: 1,
partitionArr: [
{ id: 1, desc: "英语区" },
{ id: 2, desc: "阿拉伯" },
],
}, },
// 表格 // 表格
tableData: [], tableData: [],
@@ -103,47 +140,93 @@ export default {
pageSize: 10, //条数 pageSize: 10, //条数
}; };
}, },
created() {}, created() {
// const timestamps = this.getCurrentWeekTimestamps();
// var obj = {};
// timestamps.forEach((res, i) => {
// this.inquire.gamesArr[i] = {
// gameName: dateFormat(res, "yyyy-MM-dd"),
// gameId: dateFormat(res, "yyyy-MM-dd"),
// };
// });
// this.inquire.gameArrVal = this.inquire.gamesArr[0].gameId;
familyMemberWeekLevelRewardListCycleDate().then((res) => {
if (res.code == 200) {
res.data.forEach((res, i) => {
this.inquire.gamesArr[i] = {
gameName: `${dateFormat(res.startDate, "yyyy-MM-dd")}~${dateFormat(
res.endDate,
"yyyy-MM-dd"
)}`,
gameId: res.dateCycle,
};
});
this.inquire.gameArrVal = this.inquire.gamesArr[0].gameId;
this.getData();
} else {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
});
// listPartitionInfo().then((res) => {
// this.inquire.partitionArr = res.data;
// this.inquire.partitionId = this.inquire.partitionArr[0].id;
// this.getData();
// });
},
methods: { methods: {
// 查询接口 // 查询接口
getData() { getData() {
this.isLoading = true; this.isLoading = true;
this.loading = true; this.loading = true;
let time = this.inquire.time; familyMemberWeekLevelRewardPage({
let startTime = ""; cycleDate: this.inquire.gameArrVal,
let endTime = ""; erbanNo: this.inquire.userId,
if (time && time.length > 0) { pageNo: this.currentPage,
startTime = dateFormat(this.inquire.time[0], "yyyy-MM-dd hh:mm:ss"); pageSize: this.pageSize,
endTime = dateFormat(this.inquire.time[1], "yyyy-MM-dd hh:mm:ss"); partitionId: this.inquire.partitionId,
}).then((res) => {
if (res.code == 200) {
this.total = res.data.total;
this.tableData = res.data.rows;
} else {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
this.loading = false;
this.isLoading = false;
});
},
getCurrentWeekTimestamps() {
const today = new Date();
const dayOfWeek = today.getDay(); // 0周日到6周六
// 计算到周一的天数差:周日需-6天其他天减(当前星期数 - 1)
const diffToMonday = dayOfWeek === 0 ? -6 : 1 - dayOfWeek;
const monday = new Date(today);
monday.setDate(monday.getDate() + diffToMonday);
monday.setHours(0, 0, 0, 0); // 设置为周一的0点
const weekTimestamps = [];
for (let i = 0; i < 7; i++) {
const date = new Date(monday);
date.setDate(monday.getDate() + i);
weekTimestamps.push(date.getTime());
} }
// statisPage({ return weekTimestamps; // 包含周一到周日每天0点的时间戳数组
// gameId: this.inquire.gameArrVal, },
// startTime: startTime, // 导出
// endTime: endTime, confirmExport2Excel() {
// pageNum: this.currentPage, familyMemberWeekLevelRewardExport({
// pageSize: this.pageSize, cycleDate: this.inquire.gameArrVal,
// }).then((res) => { erbanNo: this.inquire.userId,
// if (res.code == 200) { partitionId: this.inquire.partitionId,
// // 判断返回的记录是否为空数组 }).then();
// const records = res.data.records;
// if (records.length > 0) {
// // 如果有数据,追加到表格数据中
// this.tableData = [...this.tableData, ...records];
// this.currentPage++; // 更新当前页码
// } else {
// // 如果数据长度为 0停止加载
// this.isFinished = true;
// }
// } else {
// ElMessage({
// showClose: true,
// message: res.message,
// type: "error",
// });
// }
// this.loading = false;
// this.isLoading = false;
// });
}, },
// 分页导航 // 分页导航
handleSizeChange() { handleSizeChange() {