|
|
@@ -12,6 +12,15 @@
|
|
|
<selectAccount v-model="formModel.accountName" @change="changeCompany" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
+ <a-col :span="6">
|
|
|
+ <a-form-item field="keyword" label="时间段">
|
|
|
+ <a-select v-model="formModel.filterHours" placeholder="请选择时间段" allow-clear
|
|
|
+ @change="changeFilterHours">
|
|
|
+ <a-option v-for="hour in 24" :key="hour - 1" :value="hour"
|
|
|
+ :label="`${hour - 1}:00`" />
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
<a-col :span="8">
|
|
|
<a-form-item field="query_date" :label="$t('searchTable.form.report_date')">
|
|
|
<a-range-picker v-model="formModel.query_date" style="width: 100%"
|
|
|
@@ -97,32 +106,37 @@
|
|
|
:data="renderData" :bordered="{ headerCell: true }" :size="size" :load-more="loadMore"
|
|
|
@page-change="onPageChange" @page-size-change="onPageSizeChange">
|
|
|
<template #xAxis="{ record }">
|
|
|
- <!-- <template v-if="record.accountName !== '' && !record.isLeaf">
|
|
|
- {{ record.accountName }}
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- {{ dayjs(record.report_date).format(record.isLeaf ? 'HH:mm' : 'YYYY-MM-DD') }}
|
|
|
- </template> -->
|
|
|
+
|
|
|
+ <template v-if="formModel.filterHours">
|
|
|
+
|
|
|
+ <template v-if="record.isLeaf">
|
|
|
+ {{ record.accountName }}
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ {{ dayjs(record.report_date).format('YYYY-MM-DD HH:mm') }}
|
|
|
+ </template>
|
|
|
+
|
|
|
|
|
|
|
|
|
- <template v-if="record.isLeaf || record.accountName == ''">
|
|
|
- {{ dayjs(record.report_date).format(record.isLeaf ? 'HH:mm' : 'YYYY-MM-DD') }}
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
- <a-typography-text type="secondary">
|
|
|
- {{ dayjs(record.report_date).format('YYYY-MM-DD') }}
|
|
|
- </a-typography-text>
|
|
|
+ <template v-if="record.isLeaf || record.accountName == ''">
|
|
|
+ {{ dayjs(record.report_date).format(record.isLeaf ? 'HH:mm' : 'YYYY-MM-DD') }}
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <template v-if="!formModel.accountName">
|
|
|
+ {{ record.accountName }}
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <a-typography-text type="secondary">
|
|
|
+ {{ dayjs(record.report_date).format('YYYY-MM-DD') }}
|
|
|
+ </a-typography-text>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
|
|
|
- {{ record.accountName }}
|
|
|
</template>
|
|
|
-
|
|
|
- </template>
|
|
|
-
|
|
|
- <template #accountName="{ record }">
|
|
|
- {{ record.isLeaf ? '' : record.accountName }}
|
|
|
</template>
|
|
|
|
|
|
-
|
|
|
<template #pay_ord_amt_56="{ record }">
|
|
|
<viewOrdersModal filter-type='pay_ord_amt_56' :data="record">
|
|
|
{{ amountFormat(record.pay_ord_amt_56) }}
|
|
|
@@ -292,6 +306,7 @@ import { numberFormat, amountFormat } from '@/utils/util';
|
|
|
import {
|
|
|
queryTkReport,
|
|
|
queryTkReportDailys,
|
|
|
+ queryTkReportHourlys,
|
|
|
queryTkReportHourtrend,
|
|
|
TkReportRecord,
|
|
|
TkReportParams,
|
|
|
@@ -312,6 +327,7 @@ type Column = TableColumnData & { checked?: true };
|
|
|
|
|
|
const generateFormModel = () => {
|
|
|
return {
|
|
|
+ filterHours: undefined as number | undefined,
|
|
|
accountName: '',
|
|
|
query_date: [],
|
|
|
current: 1,
|
|
|
@@ -795,7 +811,20 @@ const fetchData = async (
|
|
|
setLoading(true);
|
|
|
try {
|
|
|
let list: TkReportRecord[] = [];
|
|
|
- if (formModel.value.accountName) {
|
|
|
+ if (formModel.value.filterHours) {
|
|
|
+ const { data } = await queryTkReportHourlys(params);
|
|
|
+ console.log(data);
|
|
|
+ if (!data) return;
|
|
|
+ list = data.list.map((item: TkReportRecord) => ({
|
|
|
+ ...item,
|
|
|
+ order_ord_amt_12_14: item.order_ord_amt_12 + item.order_ord_amt_14,
|
|
|
+ order_ord_tfee_12_14: item.order_ord_tfee_12 + item.order_ord_tfee_14,
|
|
|
+ }));
|
|
|
+ renderData.value = list;
|
|
|
+ pagination.current = data.page;
|
|
|
+ pagination.total = data.count;
|
|
|
+
|
|
|
+ } else if (formModel.value.accountName) {
|
|
|
const { data } = await queryTkReport(params);
|
|
|
console.log(data);
|
|
|
if (!data) return;
|
|
|
@@ -816,13 +845,13 @@ const fetchData = async (
|
|
|
...item,
|
|
|
order_ord_amt_12_14: item.order_ord_amt_12 + item.order_ord_amt_14,
|
|
|
order_ord_tfee_12_14: item.order_ord_tfee_12 + item.order_ord_tfee_14,
|
|
|
+ isLeaf: false,
|
|
|
+
|
|
|
}));
|
|
|
renderData.value = list;
|
|
|
pagination.current = data.page;
|
|
|
pagination.total = data.count;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
} catch (err) {
|
|
|
console.log(err);
|
|
|
// you can report use errorHandler or other
|
|
|
@@ -840,7 +869,28 @@ const loadMore = async (
|
|
|
try {
|
|
|
let list: TableData[] = [];
|
|
|
|
|
|
- if (row.accountName === '') {
|
|
|
+ if (formModel.value.filterHours) {
|
|
|
+ const params: TkReportParams = {
|
|
|
+ query_date: [row.report_date, row.report_date],
|
|
|
+ filterHours: formModel.value.filterHours,
|
|
|
+ accountId: row.accountId,
|
|
|
+ current: 1,
|
|
|
+ pageSize: 24,
|
|
|
+ sort: 'report_date',
|
|
|
+ order: 'descending',
|
|
|
+ };
|
|
|
+
|
|
|
+ const { data } = await queryTkReportHourtrend(params);
|
|
|
+ console.log(data);
|
|
|
+ if (!data) return;
|
|
|
+ list = data.list.map((item: TkReportRecord) => ({
|
|
|
+ ...item,
|
|
|
+ order_ord_amt_12_14: item.order_ord_amt_12 + item.order_ord_amt_14,
|
|
|
+ order_ord_tfee_12_14: item.order_ord_tfee_12 + item.order_ord_tfee_14,
|
|
|
+ isLeaf: true,
|
|
|
+ }));
|
|
|
+ }
|
|
|
+ else if (row.accountName === '') {
|
|
|
const params: TkReportParams = {
|
|
|
query_date: [row.report_date, row.report_date],
|
|
|
current: 1,
|
|
|
@@ -906,6 +956,19 @@ const changeCompany = (value: any) => {
|
|
|
};
|
|
|
|
|
|
|
|
|
+const changeFilterHours = (value: any) => {
|
|
|
+ const reset = () => {
|
|
|
+ formModel.value = generateFormModel();
|
|
|
+ };
|
|
|
+ formModel.value.filterHours = value
|
|
|
+
|
|
|
+ fetchData({
|
|
|
+ ...basePagination,
|
|
|
+ ...formModel.value,
|
|
|
+ } as unknown as TkReportParams);
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
const onPageChange = (current: number) => {
|