新增 - 钻石清除记录

This commit is contained in:
2025-08-14 18:25:41 +08:00
parent 6b9b090089
commit 8a15bd6a2d
3 changed files with 233 additions and 8 deletions

View File

@@ -32,4 +32,21 @@ export const getGuildPolicyMicDayDetail = query => {
method: 'get',
params: query
});
};
};
// 钻石清空记录列表
export const getGuildPolicyClearDiamond = query => {
return request({
url: '/admin/guildPolicy2ClearDiamond',
method: 'get',
params: query
});
};
// 查询公会成员薪资明细导出
export const exportClearDiamond = query => {
return request({
url: `/admin/guildPolicy2ClearDiamond/export`,
method: 'get',
params: query,
responseType: 'blob'
});
}

View File

@@ -48,7 +48,11 @@
<el-table-column prop="erbanNo" align="center" label="主播ID" />
<el-table-column prop="nick" align="center" label="主播昵称" />
<el-table-column prop="diamondNum" align="center" label="钻石收入" />
<el-table-column prop="micMinutes" align="center" label="活跃时长(分钟)" />
<el-table-column
prop="micMinutes"
align="center"
label="活跃时长(分钟)"
/>
<el-table-column prop="micDay" align="center" label="有效天数">
<template v-slot="scope">
<el-button @click="micDayDetail(scope.row)" type="text" size="small">
@@ -90,12 +94,16 @@
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="statDate" align="center" label="日期" />
<el-table-column prop="micMinutes" align="center" label="活跃时长(分钟)" />
<el-table-column prop="day" align="center" label="是否有效" >
<template v-slot="scope">
{{ scope.row.micDay>=1?'有效':'无效' }}
</template>
</el-table-column>
<el-table-column
prop="micMinutes"
align="center"
label="活跃时长(分钟)"
/>
<el-table-column prop="day" align="center" label="是否有效">
<template v-slot="scope">
{{ scope.row.micDay >= 1 ? "有效" : "无效" }}
</template>
</el-table-column>
</el-table>
<!-- 操作 -->
<template #footer>
@@ -211,6 +219,14 @@ const confirmExportExcel = async () => {
});
}
};
const handleSizeChange = (val) => {
formData.pageSize = val;
getData();
};
const handleCurrentChange = (val) => {
formData.pageNo = val;
getData();
};
onMounted(() => {
getGuildPolicyCycleDates().then((res) => {
if (res.code == 200) {

View File

@@ -0,0 +1,192 @@
<template>
<div class="box">
<div class="inquire">
<span>公会ID:</span>
<el-input v-model="formData.guildId" placeholder="" class="input" />
</div>
<div class="inquire">
<span>公会长ID:</span>
<el-input v-model="formData.ownerErbanNo" placeholder="" class="input" />
</div>
<div class="inquire">
<span>主播ID:</span>
<el-input v-model="formData.erbanNo" placeholder="" class="input" />
</div>
<div class="inquire">
<span>周期</span>
<el-select v-model="formData.cycleDate" placeholder="请选择" clearable>
<el-option
v-for="item in dateCycleArr"
:key="item.cycleDate"
:label="item.intervalFormatter"
:value="item.cycleDate"
>
</el-option>
</el-select>
</div>
<el-button style="" type="primary" @click="getData()">查询</el-button>
<el-button style="" type="primary" @click="confirmExportExcel()"
>导出</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="guildId" align="center" label="公会ID" />
<el-table-column prop="guildName" align="center" label="公会昵称" />
<el-table-column prop="erbanNo" align="center" label="主播ID" />
<el-table-column prop="nick" align="center" label="主播昵称" />
<el-table-column prop="diamondNum" align="center" label="清除钻石数" />
<el-table-column prop="createTime" align="center" label="清除时间" />
</el-table>
<!-- 分页 -->
<el-pagination
style="margin-top: 10px"
class="paginationClass"
:current-page="formData.pageNo"
:page-size="formData.pageSize"
:page-sizes="[10, 20, 50, 100, 200]"
layout="sizes, prev, pager, next"
:total="tableData.total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</template>
<script>
export default {
name: "diamondClearanceRecord",
};
</script>
<script setup>
import { ref, onMounted, reactive, computed } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import {
getGuildPolicyClearDiamond,
exportClearDiamond,
getGuildPolicyCycleDates,
} from "@/api/SalaryDetails/SalaryDetails.js";
import { formatDate } from "@/utils/relDate";
const formData = reactive({
pageNo: 1,
pageSize: 10,
erbanNo: "",
guildId: "",
ownerErbanNo: "",
cycleDate: "",
});
const tableData = reactive({
data: [],
total: 0,
loading: false,
});
const dateCycleArr = ref([]);
// 查询
const getData = () => {
tableData.loading = true;
getGuildPolicyClearDiamond(formData).then((res) => {
if (res.code == 200) {
tableData.data = res.data.rows;
tableData.total = res.data.total;
tableData.loading = false;
} else {
tableData.loading = false;
ElMessage.error(res.message);
}
});
};
// 导出
const confirmExportExcel = async () => {
// Object.assign(formData, { pageSize: 10000, pageNo: 1 });
try {
const res = await exportClearDiamond(formData);
if (res) {
ElMessage({
message: "导出成功",
type: "success",
});
let time = formatDate(new Date());
let alink = document.createElement("a");
alink.download = `钻石清除记录${time}.xls`;
alink.style.display = "none";
const blob = new Blob([res]);
alink.href = URL.createObjectURL(blob);
document.body.appendChild(alink);
alink.click();
URL.revokeObjectURL(alink.href);
}
} catch (error) {
ElMessage({
message: error.message,
type: "error",
});
}
};
const handleSizeChange = (val) => {
formData.pageSize = val;
getData();
};
const handleCurrentChange = (val) => {
formData.pageNo = val;
getData();
};
onMounted(() => {
getGuildPolicyCycleDates().then((res) => {
if (res.code == 200) {
dateCycleArr.value = res.data;
} else {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
});
});
</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;
}
}
.selectBox {
display: flex;
height: 35px;
line-height: 35px;
margin-bottom: 20px;
}
.selectBoxImg {
height: 150px;
}
</style>