|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <!-- 采购: 现货头寸-->
|
|
|
|
|
- <div class="spot-contract-peddding table-height"
|
|
|
|
|
|
|
+ <!-- 敞口: 期货头寸-->
|
|
|
|
|
+ <div class="exposure-futures table-height"
|
|
|
:loading="loading">
|
|
:loading="loading">
|
|
|
<filterCustomTable @search="search">
|
|
<filterCustomTable @search="search">
|
|
|
<BtnList :btnList="commonBtn" />
|
|
<BtnList :btnList="commonBtn" />
|
|
@@ -42,21 +42,20 @@ import filterCustomTable from '../../components/filterTable/index.vue';
|
|
|
import { getBtnList } from '@/common/setup/contextMenu/index';
|
|
import { getBtnList } from '@/common/setup/contextMenu/index';
|
|
|
import contextMenu from '@/common/components/contextMenu/index.vue';
|
|
import contextMenu from '@/common/components/contextMenu/index.vue';
|
|
|
import { getColumsAndSearch } from '../setup';
|
|
import { getColumsAndSearch } from '../setup';
|
|
|
-import { QuerySpotPosition, QuerySpotPositionDetail } from '@/services/go/ermcp/exposure/index';
|
|
|
|
|
-import { Ermcp3AreaSpot, Ermcp3AreaSpotDetail } from '@/services/go/ermcp/exposure/interface';
|
|
|
|
|
|
|
+import { QueryExposureHedgePositionDetail, QueryExposureHedgePosition } from '@/services/go/ermcp/exposure/index';
|
|
|
|
|
+import { ErmcpHedgePosition, ErmcpHedgePositionDetail } from '@/services/go/ermcp/exposure/interface';
|
|
|
import { message } from 'ant-design-vue';
|
|
import { message } from 'ant-design-vue';
|
|
|
import { handleTableEvent } from '@/common/setup/event/index';
|
|
import { handleTableEvent } from '@/common/setup/event/index';
|
|
|
import BtnList from '@/common/components/buttonList/index.vue';
|
|
import BtnList from '@/common/components/buttonList/index.vue';
|
|
|
import ThridMenu from '@/common/components/thirdMenu/index.vue';
|
|
import ThridMenu from '@/common/components/thirdMenu/index.vue';
|
|
|
import { ColumnType } from '@/common/methods/table';
|
|
import { ColumnType } from '@/common/methods/table';
|
|
|
-import { TableKey } from '@/common/methods/table/interface';
|
|
|
|
|
|
|
|
|
|
// 获取表格数据
|
|
// 获取表格数据
|
|
|
function getExposure() {
|
|
function getExposure() {
|
|
|
const loading = ref<boolean>(false);
|
|
const loading = ref<boolean>(false);
|
|
|
- const tableList = ref<Ermcp3AreaSpot[]>([]);
|
|
|
|
|
|
|
+ const tableList = ref<ErmcpHedgePosition[]>([]);
|
|
|
function queryList() {
|
|
function queryList() {
|
|
|
- QuerySpotPosition()
|
|
|
|
|
|
|
+ QueryExposureHedgePosition()
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
tableList.value = res.map((e, i) => {
|
|
tableList.value = res.map((e, i) => {
|
|
|
return { ...e, key: String(i) };
|
|
return { ...e, key: String(i) };
|
|
@@ -73,11 +72,20 @@ function getExposure() {
|
|
|
return { loading, tableList, queryList };
|
|
return { loading, tableList, queryList };
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// 控制是否打开明细
|
|
|
|
|
+function handleDrawer() {
|
|
|
|
|
+ const visible = ref<boolean>(false);
|
|
|
|
|
+ function closeDrawer() {
|
|
|
|
|
+ visible.value = !visible.value;
|
|
|
|
|
+ }
|
|
|
|
|
+ return { visible, closeDrawer };
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// 明细
|
|
// 明细
|
|
|
-function handleDrawer(loading: Ref<boolean>, selectedRow: Ermcp3AreaSpot) {
|
|
|
|
|
|
|
+function handleDeatil(loading: Ref<boolean>, selectedRow: ErmcpHedgePosition) {
|
|
|
const visible = ref<boolean>(true);
|
|
const visible = ref<boolean>(true);
|
|
|
const tabList = [{ lable: '期货明细' }];
|
|
const tabList = [{ lable: '期货明细' }];
|
|
|
- const detailTableList = ref<Ermcp3AreaSpotDetail[]>([]);
|
|
|
|
|
|
|
+ const detailTableList = ref<ErmcpHedgePositionDetail[]>([]);
|
|
|
const detailColumns = ref<ColumnType[]>([]);
|
|
const detailColumns = ref<ColumnType[]>([]);
|
|
|
function closeDrawer() {
|
|
function closeDrawer() {
|
|
|
visible.value = false;
|
|
visible.value = false;
|
|
@@ -85,49 +93,57 @@ function handleDrawer(loading: Ref<boolean>, selectedRow: Ermcp3AreaSpot) {
|
|
|
// 切换明细
|
|
// 切换明细
|
|
|
function selectMenu(index: number) {
|
|
function selectMenu(index: number) {
|
|
|
ActualExposureDetail();
|
|
ActualExposureDetail();
|
|
|
- const { columns, getColumns } = getColumsAndSearch('table_pcweb_exposure_spotposition', false);
|
|
|
|
|
|
|
+ const { columns, getColumns } = getColumsAndSearch('table_pcweb_exposure_futuresposition', false);
|
|
|
getColumns();
|
|
getColumns();
|
|
|
detailColumns.value = columns.value;
|
|
detailColumns.value = columns.value;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- // 现货明细信息
|
|
|
|
|
|
|
+ selectMenu(0);
|
|
|
|
|
+ // 期货明细
|
|
|
function ActualExposureDetail() {
|
|
function ActualExposureDetail() {
|
|
|
loading.value = true;
|
|
loading.value = true;
|
|
|
- const param = { deliverygoodsid: selectedRow.deliverygoodsid };
|
|
|
|
|
- QuerySpotPositionDetail(param)
|
|
|
|
|
|
|
+ const param = { goodsId: selectedRow.goodsid };
|
|
|
|
|
+ QueryExposureHedgePositionDetail(param)
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
detailTableList.value = res.map((e, i) => {
|
|
detailTableList.value = res.map((e, i) => {
|
|
|
return { ...e, key: String(i) };
|
|
return { ...e, key: String(i) };
|
|
|
});
|
|
});
|
|
|
loading.value = false;
|
|
loading.value = false;
|
|
|
- console.log('现货明细信息', detailTableList);
|
|
|
|
|
|
|
+ console.log('期货明细', detailTableList);
|
|
|
})
|
|
})
|
|
|
.catch((err) => {
|
|
.catch((err) => {
|
|
|
message.error(err);
|
|
message.error(err);
|
|
|
loading.value = false;
|
|
loading.value = false;
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
- return { visible, closeDrawer, tabList, selectMenu, detailTableList, detailColumns };
|
|
|
|
|
|
|
+ return { tabList, selectMenu, detailTableList, detailColumns };
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
- name: 'spot-contract-peddding',
|
|
|
|
|
- components: {},
|
|
|
|
|
|
|
+ name: 'exposure-futures',
|
|
|
|
|
+ components: {
|
|
|
|
|
+ contextMenu,
|
|
|
|
|
+ filterCustomTable,
|
|
|
|
|
+ ThridMenu,
|
|
|
|
|
+ BtnList,
|
|
|
|
|
+ },
|
|
|
setup() {
|
|
setup() {
|
|
|
- const { columns, search, getColumns } = getColumsAndSearch('table_pcweb_exposure_spotposition', true);
|
|
|
|
|
- const { expandedRowKeys, selectedRow, Rowclick } = handleTableEvent<Ermcp3AreaSpot>();
|
|
|
|
|
|
|
+ const { visible, closeDrawer } = handleDrawer();
|
|
|
|
|
+ const { columns, search, getColumns } = getColumsAndSearch('table_pcweb_exposure_futuresposition', true);
|
|
|
|
|
+ const { expandedRowKeys, selectedRow, Rowclick } = handleTableEvent<ErmcpHedgePosition>(closeDrawer);
|
|
|
const { loading, tableList, queryList } = getExposure();
|
|
const { loading, tableList, queryList } = getExposure();
|
|
|
initData(() => {
|
|
initData(() => {
|
|
|
queryList();
|
|
queryList();
|
|
|
getColumns();
|
|
getColumns();
|
|
|
});
|
|
});
|
|
|
- return { columns, search, expandedRowKeys, selectedRow, Rowclick, ...getBtnList('exposure_spot', false), loading, tableList };
|
|
|
|
|
|
|
+ return { columns, search, expandedRowKeys, selectedRow, Rowclick, visible, closeDrawer, ...getBtnList('exposure_futures', false), loading, tableList, ...handleDeatil(loading, (selectedRow as unknown) as ErmcpHedgePosition) };
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="less">
|
|
<style lang="less">
|
|
|
-.spot-contract-peddding {
|
|
|
|
|
|
|
+.exposure-futures {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ overflow: hidden;
|
|
|
}
|
|
}
|
|
|
</style
|
|
</style
|
|
|
>;
|
|
>;
|