恢复代码

This commit is contained in:
2025-04-23 10:03:37 +08:00
parent 90c79c16cb
commit 70adbd0e1b
16 changed files with 2795 additions and 987 deletions
+285
View File
@@ -0,0 +1,285 @@
<template>
<div class="page">
<div class="ele-body">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<a-space style="margin-bottom: 1rem">
<a-button @click="changeType(0)" :type="type === 0 ? 'primary' : ''">收款汇总表</a-button>
<a-button @click="changeType(1)" :type="type === 1 ? 'primary' : ''">收入日报表及汇总表</a-button>
</a-space>
<a-spin :spinning="loading">
<search
@search="searchData"
@reload="reload"
/>
<a-table v-if="type === 0"
:scroll="{ y: tableHeight }"
:data-source="list"
:columns="columns"
:pagination="false"
/>
<a-table v-else
:scroll="{ y: tableHeight }"
:data-source="list"
:columns="columns1"
:pagination="false"
/>
</a-spin>
</a-card>
</div>
<OrderList v-model:visible="showList" v-if="showList" :pay-type="payTypeList" :sid="sid"
:create-time-start="createTimeStart"
:create-time-end="createTimeEnd" />
</div>
</template>
<script lang="ts" setup>
import { createVNode, ref } from "vue";
import type {
ColumnItem
} from "ele-admin-pro/es/ele-pro-table/types";
import Search from "./components/search.vue";
import {
getThinkOrderExcelData, getThinkOrderExcelDataForCard
} from "@/api/think/thinkOrder";
import type {
ThinkOrder, ThinkOrderParam
} from "@/api/think/thinkOrder/model";
import OrderList from "./components/OrderList.vue";
import dayjs from "dayjs";
// 加载状态
const loading = ref(true);
const type = ref(0);
const changeType = (val) => {
type.value = val;
getList();
};
const tableHeight = document.body.clientHeight - 330;
console.log(tableHeight);
const createTimeStart = ref();
const createTimeEnd = ref();
const list = ref<any[]>([]);
const getList = async () => {
loading.value = true;
list.value = [];
if (type.value === 0) {
list.value = await getThinkOrderExcelData({
createTimeStart: createTimeStart.value ? dayjs(createTimeStart.value).unix() : undefined,
createTimeEnd: createTimeEnd.value ? dayjs(createTimeEnd.value).unix() : undefined
});
} else {
list.value = await getThinkOrderExcelDataForCard({
createTimeStart: createTimeStart.value ? dayjs(createTimeStart.value).unix() : undefined,
createTimeEnd: createTimeEnd.value ? dayjs(createTimeEnd.value).unix() : undefined
});
}
loading.value = false;
};
createTimeStart.value = dayjs().format("YYYY-MM-DD");
createTimeEnd.value = dayjs().format("YYYY-MM-DD 23:59:59");
getList();
const sid = ref<number>(0);
const columns1 = ref<ColumnItem[]>([
{
title: "场馆名称",
dataIndex: "siteName"
},
{
title: "卡类型",
children: [
{
title: "次卡",
dataIndex: "timeCardIncome",
customCell: (row) => {
return {
onClick: () => {
console.log(row);
payTypeList.value = [8, 11];
showList.value = true;
}
};
}
},
{
title: "期间卡(指月卡、季卡、年卡)",
dataIndex: "monthCardIncome",
customCell: (row) => {
return {
onClick: () => {
console.log(row);
payTypeList.value = [6, 7, 9, 10, 16, 17];
showList.value = true;
}
};
}
},
{
title: "充值卡(会员卡、IC卡)",
dataIndex: "chargeCardIncome",
customCell: (row) => {
return {
onClick: () => {
console.log(row);
payTypeList.value = [13, 14];
showList.value = true;
}
};
}
},
{
title: "散客订单",
dataIndex: "guest",
customRender: () => 0
},
{
title: "其他",
dataIndex: "otherIncome",
customCell: (row) => {
return {
onClick: () => {
console.log(row);
payTypeList.value = [2, 3, 12, 15];
showList.value = true;
}
};
}
},
{
title: "小计",
dataIndex: "siteIncome"
}
]
}
]);
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: "场馆名称",
dataIndex: "siteName"
},
{
title: "收款方式",
children: [
{
title: "微信支付",
dataIndex: "wechatIncome",
customCell: (row) => {
return {
onClick: () => {
sid.value = row.sid;
payTypeList.value = [1];
showList.value = true;
}
};
}
},
{
title: "微信支付退款",
dataIndex: "wechatRefund",
customCell: (row) => {
return {
onClick: () => {
sid.value = row.sid;
}
};
}
},
{
title: "POS机",
dataIndex: "posIncome",
customCell: (row) => {
return {
onClick: () => {
sid.value = row.sid;
payTypeList.value = [5];
showList.value = true;
}
};
}
},
{
title: "对公转账",
dataIndex: "businessIncome",
customCell: (row) => {
return {
onClick: () => {
sid.value = row.sid;
payTypeList.value = [18];
showList.value = true;
}
};
}
},
{
title: "现金收款",
dataIndex: "cashIncome",
customCell: (row) => {
return {
onClick: () => {
sid.value = row.sid;
payTypeList.value = [4];
showList.value = true;
}
};
}
},
{
title: "其他",
dataIndex: "otherIncome",
customCell: (row) => {
return {
onClick: () => {
sid.value = row.sid;
payTypeList.value = [2, 3, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17];
showList.value = true;
}
};
}
},
{
title: "小计",
dataIndex: "siteIncome"
}
]
}
]);
/* 搜索 */
const searchData = (param: ThinkOrderParam) => {
createTimeStart.value = param.createTimeStart;
createTimeEnd.value = param.createTimeEnd;
console.log(createTimeEnd.value);
getList();
};
const reload = () => {
createTimeStart.value = dayjs().format("YYYY-MM-DD");
createTimeEnd.value = dayjs().format("YYYY-MM-DD");
getList();
};
const payTypeList = ref<number[]>([]);
const showList = ref(false);
</script>
<script lang="ts">
import * as MenuIcons from "@/layout/menu-icons";
export default {
name: "ThinkOrder",
components: MenuIcons
};
</script>
<style lang="less" scoped>
.tag-icon {
padding-right: 6px;
}
</style>