This commit is contained in:
yziiy
2025-12-22 15:16:30 +08:00
parent c325c22f35
commit d881fe41df
6 changed files with 42 additions and 12 deletions

View File

@@ -73,6 +73,7 @@ export function useData() {
prize_amount: parseFloat(ele.prize_amount)
}
});
pagination.value.total = data.count
pagination.value.currentPage = parseFloat(data.page);
}
loading.value = false;

View File

@@ -57,7 +57,11 @@ export function useData() {
),
},
{
label: "总值",
label: "幸运值流水",
prop: "lucky_coin"
},
{
label: "房间流水",
prop: "total_price"
},
// {
@@ -80,7 +84,7 @@ export function useData() {
...ele
}
});
total_price.value = data.total.total_price
total_price.value = data.total
pagination.value.total = data.count;
pagination.value.currentPage = data.page;
}

View File

@@ -33,7 +33,10 @@ defineOptions({
<PureTableBar title="房间流水统计" :class="[isShow && !deviceDetection() ? '!w-[60vw]' : 'w-full']"
:columns="tableLabel" @refresh="onSearch">
<template #buttons>
<div style="display: inline-flex;align-items: center;" class="mr-10">总计{{ total_price }}</div>
<div style="display: inline-flex;align-items: center;" class="mr-10">
幸运值流水总计<span style="color: red;">{{ total_price.total_lucky_coin }}</span>;
房间流水总计<span style="color: red;">{{ total_price.total_price }}</span>
</div>
<el-button type="primary" @click="exportExcel">
导出
</el-button>

View File

@@ -59,7 +59,9 @@ const getFlowData = async (index) => {
room_id: dataBytable.value.room_id,
page: pagination.value.currentPage,
page_limit: pagination.value.pageSize,
type: tagValue.value
type: 1,
stime: dateSearchValue.value ? dateSearchValue.value.length ? dateSearchValue.value[0] : '' : '',
etime: dateSearchValue.value ? dateSearchValue.value.length ? dateSearchValue.value[1] : '' : '',
})
if (code) {
PriceTotal.value = data.total.total_price
@@ -142,11 +144,12 @@ const dynamicUserColumns = ref([
])
const activeName = ref('1')
const tagValue = ref(1)
const dateSearchValue = ref([])
const tagList = ref([
{ value: 1, label: '全部流水' },
{ value: 2, label: '日流水' },
{ value: 3, label: '周流水' },
{ value: 4, label: '月流水' }
// { value: 2, label: '日流水' },
// { value: 3, label: '周流水' },
// { value: 4, label: '月流水' }
])
onMounted(() => {
getAllData()
@@ -173,6 +176,10 @@ const handleCurrentChange = (val: number) => {
pagination.value.currentPage = val;
getFlowData(activeIndex.value == '1' ? 1 : 2)
};
const changeTime = (val) => {
// console.log(val)
getFlowData(activeIndex.value == '1' ? 1 : 2)
}
const changeType = (val) => {
tagValue.value = val
pagination.value.pageSize = 10
@@ -200,7 +207,6 @@ const exportExcal = async () => {
const workSheet = utils.aoa_to_sheet(res);
const workBook = utils.book_new();
utils.book_append_sheet(workBook, workSheet, "数据报表");
// const TagName = tagList.value.filter(ele => { return ele.value == tagValue.value })
writeFile(workBook, `房间流水信息.xlsx`);
message("导出成功", {
type: "success"
@@ -242,14 +248,21 @@ const exportExcal = async () => {
<el-tab-pane label="流水信息" name="1">
<div class="flex align-middle justify-between">
<div>
<el-date-picker size="small" @change="changeTime" v-model="dateSearchValue" type="datetimerange"
format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" range-separator=""
start-placeholder="开始日期" end-placeholder="结束日期">
</el-date-picker>
</div>
<!-- <div>
<el-tag class="mr-2" style="cursor: pointer;" @click="changeType(item.value)"
:type="tagValue === item.value ? '' : 'info'" v-for="item in tagList" :key="item.value">{{
item.label }}</el-tag>
</div>
</div> -->
<div style="display: inline-flex;align-items: center;">
<div class="mr-5"><el-button size="small" type="primary" @click="exportExcal">导出当前数据</el-button></div>
总计{{ PriceTotal }}金币
幸运值流水总计<span style="color: red;">{{ PriceTotal }}</span> 流水总计<span style="color: red;">{{ PriceTotal
}}</span> 金币
</div>
</div>
<pure-table class="mt-5" ref="tableRef" align-whole="center" showOverflowTooltip table-layout="auto"

View File

@@ -79,7 +79,7 @@ export function useData() {
},
{
label: "幸运币流水",
prop: ""
prop: "lucky_coin"
},
{
label: "公会状态",

View File

@@ -16,6 +16,7 @@ const searchForm = ref({
search_stime: "",
search_etime: ""
});
const totalLuckyCoin = ref(0)
const searchLabel = ref([
{ label: "房间ID/房间昵称", prop: "room_id", type: "input" },
{ label: "添加时间", prop: "search_stime", type: "date" },
@@ -37,6 +38,10 @@ const dynamicColumns = ref([
label: "房间昵称",
prop: "room_name"
},
{
label: "幸运值流水总值",
prop: "lucky_coin"
},
{
label: "总流水值",
prop: "consumption"
@@ -66,6 +71,7 @@ const onSearch = async (formData) => {
if (code) {
tableList.value = data.lists;
totalConsumption.value = data.total_consumption;
totalLuckyCoin.value = data.total_lucky_coin;
pagination.value.total = data.count;
pagination.value.currentPage = data.page;
}
@@ -113,7 +119,10 @@ onMounted(() => {
<div>
<SearchForm class="pb-2" :LabelList="searchLabel" :formData="searchForm" @handleSearch="onSearch" />
<div class="mb-5" style="display: inline-flex; justify-content: flex-end;width: 100%;">
<div style="display: inline-flex;align-items: center;margin-right: 20px;">总流水{{ totalConsumption }}</div>
<div style="display: inline-flex;align-items: center;margin-right: 20px;">幸运值流水总计<span style="color: red;">{{
totalLuckyCoin
}}</span>总流水<span style="color: red;">{{ totalConsumption }}</span>
</div>
<el-button type="primary" @click="exportExcel">
导出表格
</el-button>