完成周奖励后台

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

@@ -27,6 +27,28 @@ export const getDateCycleList = 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 => {

View File

@@ -1,6 +1,23 @@
<template>
<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">
<span>周期</span>
<el-select v-model="inquire.gameArrVal" placeholder="请选择">
@@ -33,7 +50,13 @@
"
>查询</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 class="primary" type="primary" @click="confirmExport2Excel()"
@@ -49,17 +72,21 @@
border
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="x" align="center" label="期" />
<el-table-column prop="x" align="center" label="公会ID" />
<el-table-column prop="x" align="center" label="公会昵称" />
<el-table-column prop="x" align="center" label="公会ID" />
<el-table-column prop="x" align="center" label="公会长昵称" />
<el-table-column prop="x" align="center" label="主播ID" />
<el-table-column prop="x" align="center" label="主播昵称" />
<el-table-column prop="x" align="center" label="主播等级" />
<el-table-column prop="x" align="center" label="钻石流水" />
<el-table-column prop="x" align="center" label="已获得金币" />
<el-table-column prop="x" align="center" label="已领取金币" />
<el-table-column prop="cycleDate" align="center" label="期" />
<el-table-column prop="familyId" align="center" label="公会ID" />
<el-table-column prop="familyName" align="center" label="公会昵称" />
<el-table-column prop="familyOwnerId" align="center" label="公会ID" />
<el-table-column
prop="familyOwnerNick"
align="center"
label="公会长昵称"
/>
<el-table-column prop="erbanNo" align="center" label="主播ID" />
<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>
<!-- 分页 -->
@@ -77,7 +104,12 @@
</div>
</template>
<script>
import {} from "@/api/relAgency/relAgency";
import {
familyMemberWeekLevelRewardPage,
familyMemberWeekLevelRewardExport,
familyMemberWeekLevelRewardListCycleDate,
} from "@/api/relAgency/relAgency";
import { listPartitionInfo } from "@/api/noblemanNew/noblemanNew";
// @ts-ignore
import { dateFormat } from "@/utils/system-helper";
// @ts-ignore
@@ -91,9 +123,14 @@ export default {
loading: false,
//查询所需条件对象
inquire: {
userId:'',
gamesArr:'',
gameArrVal:[],
userId: "",
gamesArr: [],
gameArrVal: 1,
partitionId: 1,
partitionArr: [
{ id: 1, desc: "英语区" },
{ id: 2, desc: "阿拉伯" },
],
},
// 表格
tableData: [],
@@ -103,47 +140,93 @@ export default {
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: {
// 查询接口
getData() {
this.isLoading = true;
this.loading = true;
let time = this.inquire.time;
let startTime = "";
let endTime = "";
if (time && time.length > 0) {
startTime = dateFormat(this.inquire.time[0], "yyyy-MM-dd hh:mm:ss");
endTime = dateFormat(this.inquire.time[1], "yyyy-MM-dd hh:mm:ss");
familyMemberWeekLevelRewardPage({
cycleDate: this.inquire.gameArrVal,
erbanNo: this.inquire.userId,
pageNo: this.currentPage,
pageSize: this.pageSize,
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({
// gameId: this.inquire.gameArrVal,
// startTime: startTime,
// endTime: endTime,
// pageNum: this.currentPage,
// pageSize: this.pageSize,
// }).then((res) => {
// if (res.code == 200) {
// // 判断返回的记录是否为空数组
// 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;
// });
return weekTimestamps; // 包含周一到周日每天0点的时间戳数组
},
// 导出
confirmExport2Excel() {
familyMemberWeekLevelRewardExport({
cycleDate: this.inquire.gameArrVal,
erbanNo: this.inquire.userId,
partitionId: this.inquire.partitionId,
}).then();
},
// 分页导航
handleSizeChange() {