|
|
@@ -1,32 +1,16 @@
|
|
|
<template>
|
|
|
<!-- 期货报表 -->
|
|
|
- <div class="table-detail-container table-height"
|
|
|
- :loading="loading">
|
|
|
+ <div class="table-detail-container table-height" :loading="loading">
|
|
|
<Filter @update="search"></Filter>
|
|
|
- <a-table :columns="columns"
|
|
|
- class="srcollYTable"
|
|
|
- :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }"
|
|
|
- :pagination="false"
|
|
|
- :expandedRowKeys="expandedRowKeys"
|
|
|
- :customRow="Rowclick"
|
|
|
- rowKey="key"
|
|
|
- :data-source="tableList">
|
|
|
+ <a-table :columns="columns" class="srcollYTable" :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }" :pagination="false" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" rowKey="key" :data-source="tableList">
|
|
|
<!-- 持仓方向 -->
|
|
|
<template #buyorsell="{ record }">
|
|
|
<a>{{ record.buyorsell === 1 ? '卖出' : '买入' }}</a>
|
|
|
</template>
|
|
|
</a-table>
|
|
|
<!-- 明细 -->
|
|
|
- <Description v-if="visible"
|
|
|
- @close="closeDrawer"
|
|
|
- @changeTab="changeTab"
|
|
|
- :tabList="tabList">
|
|
|
- <a-table :columns="columnsDetail"
|
|
|
- class="topTable"
|
|
|
- :pagination="false"
|
|
|
- rowKey="key"
|
|
|
- :data-source="detailTableList"
|
|
|
- :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }">
|
|
|
+ <Description v-if="visible" @close="closeDrawer" @changeTab="changeTab" :tabList="tabList">
|
|
|
+ <a-table :columns="columnsDetail" class="topTable" :pagination="false" rowKey="key" :data-source="detailTableList" :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }">
|
|
|
<!-- 持仓方向 -->
|
|
|
<template #buyorsell="{ record }">
|
|
|
<a>{{ record.buyorsell === 1 ? '卖出' : '买入' }}</a>
|
|
|
@@ -52,93 +36,93 @@ import { EnumRouterName } from '@/common/constants/enumRouterName';
|
|
|
import { getTableButton } from '@/common/setup/table/button';
|
|
|
|
|
|
export default defineComponent({
|
|
|
- name: 'inventory_report_inventory_category',
|
|
|
- components: {
|
|
|
- Filter,
|
|
|
- Description,
|
|
|
- },
|
|
|
- setup() {
|
|
|
- let cycletime = '';
|
|
|
- // 表格列表数据
|
|
|
- const { loading, tableList, queryTable } = queryTableList<Ermcp3TaFutuReDataReport>();
|
|
|
- // 获取列表数据
|
|
|
- const queryTableAction = () => {
|
|
|
- const { getInitTime, getInitType } = handleInitTypeAndTime();
|
|
|
- cycletime = getInitTime();
|
|
|
- const param: QryTaFutureDataReportReq = {
|
|
|
- cycletype: getInitType(),
|
|
|
- cycletime,
|
|
|
- querytype: 1,
|
|
|
- };
|
|
|
- // 获取列表数据
|
|
|
- queryTable(qryTaFutureDataReport, param);
|
|
|
- };
|
|
|
- const param: ComposeTableDetailParam = {
|
|
|
- queryFn: queryTableAction, // 查询表格数据
|
|
|
- tableName: 'table_pcweb_futures_report', // 表头key
|
|
|
- tableFilterKey: [], // 表格过滤字段
|
|
|
- menuType: EnumRouterName.future_report_future, // 当前tab页对应的code
|
|
|
- };
|
|
|
- const {
|
|
|
- visible,
|
|
|
- closeDrawer, // 控制 drawer 组件是否显示
|
|
|
- columns,
|
|
|
- updateColumn, // 表头数据
|
|
|
- columnsDetail,
|
|
|
- registerColumnDetail,
|
|
|
- detailTableList, // 明细表头数据
|
|
|
- expandedRowKeys,
|
|
|
- selectedRow,
|
|
|
- Rowclick, // 表格事件
|
|
|
- } = handleComposeTable_detail<Ermcp3TaFutuReDataReport>(param);
|
|
|
- const chaceSearchValue = ref<TypeAndTime>();
|
|
|
+ name: 'inventory_report_inventory_category',
|
|
|
+ components: {
|
|
|
+ Filter,
|
|
|
+ Description,
|
|
|
+ },
|
|
|
+ setup() {
|
|
|
+ let cycletime = '';
|
|
|
+ // 表格列表数据
|
|
|
+ const { loading, tableList, queryTable } = queryTableList<Ermcp3TaFutuReDataReport>();
|
|
|
+ // 获取列表数据
|
|
|
+ const queryTableAction = () => {
|
|
|
+ const { getInitTime, getInitType } = handleInitTypeAndTime();
|
|
|
+ cycletime = getInitTime();
|
|
|
+ const param: QryTaFutureDataReportReq = {
|
|
|
+ cycletype: getInitType(),
|
|
|
+ cycletime,
|
|
|
+ querytype: 1,
|
|
|
+ };
|
|
|
+ // 获取列表数据
|
|
|
+ queryTable(qryTaFutureDataReport, param);
|
|
|
+ };
|
|
|
+ const param: ComposeTableDetailParam = {
|
|
|
+ queryFn: queryTableAction, // 查询表格数据
|
|
|
+ tableName: 'table_pcweb_futures_report', // 表头key
|
|
|
+ tableFilterKey: [], // 表格过滤字段
|
|
|
+ menuType: EnumRouterName.future_report_future, // 当前tab页对应的code
|
|
|
+ };
|
|
|
+ const {
|
|
|
+ visible,
|
|
|
+ closeDrawer, // 控制 drawer 组件是否显示
|
|
|
+ columns,
|
|
|
+ updateColumn, // 表头数据
|
|
|
+ columnsDetail,
|
|
|
+ registerColumnDetail,
|
|
|
+ detailTableList, // 明细表头数据
|
|
|
+ expandedRowKeys,
|
|
|
+ selectedRow,
|
|
|
+ Rowclick, // 表格事件
|
|
|
+ } = handleComposeTable_detail<Ermcp3TaFutuReDataReport>(param);
|
|
|
+ const chaceSearchValue = ref<TypeAndTime>();
|
|
|
|
|
|
- // 底部明细标签
|
|
|
- const tabList = getTableButton();
|
|
|
+ // 底部明细标签
|
|
|
+ const tabList = getTableButton();
|
|
|
|
|
|
- // 切换明细
|
|
|
- function changeTab(index: number, current: TabList) {
|
|
|
- const { code, lable } = current;
|
|
|
- const data = selectedRow.value as Ermcp3TaFutuReDataReport;
|
|
|
- const { cycletype, currencyid, goodsgroupid, goodsid, buyorsell } = data;
|
|
|
- const param: QryTaFutureDataReportReq = {
|
|
|
- querytype: 2,
|
|
|
- cycletype,
|
|
|
- cycletime,
|
|
|
- currencyid,
|
|
|
- goodsgroupid,
|
|
|
- goodsid,
|
|
|
- buyorsell,
|
|
|
- userid: chaceSearchValue.value?.userid,
|
|
|
- };
|
|
|
- if (code === 'future_report_future_detail') {
|
|
|
- // 账户明细
|
|
|
- // 注册表头
|
|
|
- registerColumnDetail('table_pcweb_futures_statement_account_details', []);
|
|
|
- } else {
|
|
|
- console.error(`${lable}没有配置对应的code: ${code},`);
|
|
|
- return;
|
|
|
- }
|
|
|
- // 查询明细数据
|
|
|
- queryResultLoadingAndInfo(qryTaFutureDataReport, loading, param).then((res) => {
|
|
|
- detailTableList.value = res;
|
|
|
- });
|
|
|
- }
|
|
|
- watchEffect(() => {
|
|
|
- if (visible.value) {
|
|
|
- if (tabList.length) {
|
|
|
- changeTab(0, tabList[0]);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- function search(value: TypeAndTime) {
|
|
|
- chaceSearchValue.value = value;
|
|
|
- cycletime = value.cycletime;
|
|
|
- const obj = Object.assign(value, { querytype: 1 });
|
|
|
- queryTable(qryTaFutureDataReport, obj);
|
|
|
+ // 切换明细
|
|
|
+ function changeTab(index: number, current: TabList) {
|
|
|
+ const { code, lable } = current;
|
|
|
+ const data = selectedRow.value as Ermcp3TaFutuReDataReport;
|
|
|
+ const { cycletype, currencyid, goodsgroupid, goodsid, buyorsell } = data;
|
|
|
+ const param: QryTaFutureDataReportReq = {
|
|
|
+ querytype: 2,
|
|
|
+ cycletype,
|
|
|
+ cycletime,
|
|
|
+ currencyid,
|
|
|
+ goodsgroupid,
|
|
|
+ goodsid,
|
|
|
+ buyorsell,
|
|
|
+ userid: chaceSearchValue.value?.userid,
|
|
|
+ };
|
|
|
+ if (code === 'future_report_future_detail') {
|
|
|
+ // 账户明细
|
|
|
+ // 注册表头
|
|
|
+ registerColumnDetail('table_pcweb_futures_statement_account_details', []);
|
|
|
+ } else {
|
|
|
+ console.error(`${lable}没有配置对应的code: ${code},`);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 查询明细数据
|
|
|
+ queryResultLoadingAndInfo(qryTaFutureDataReport, loading, param).then((res) => {
|
|
|
+ detailTableList.value = res;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ watchEffect(() => {
|
|
|
+ if (visible.value) {
|
|
|
+ if (tabList.length) {
|
|
|
+ changeTab(0, tabList[0]);
|
|
|
}
|
|
|
+ }
|
|
|
+ });
|
|
|
+ function search(value: TypeAndTime) {
|
|
|
+ chaceSearchValue.value = value;
|
|
|
+ cycletime = value.cycletime;
|
|
|
+ const obj = Object.assign(value, { querytype: 1 });
|
|
|
+ queryTable(qryTaFutureDataReport, obj);
|
|
|
+ }
|
|
|
|
|
|
- return { loading, tableList, visible, closeDrawer, columns, updateColumn, search, columnsDetail, detailTableList, expandedRowKeys, selectedRow, Rowclick, tabList, changeTab };
|
|
|
- },
|
|
|
+ return { loading, tableList, visible, closeDrawer, columns, updateColumn, search, columnsDetail, detailTableList, expandedRowKeys, selectedRow, Rowclick, tabList, changeTab };
|
|
|
+ },
|
|
|
});
|
|
|
</script>
|