|
@@ -1,15 +1,17 @@
|
|
|
<template>
|
|
<template>
|
|
|
<!-- 单据记录 商品合约-->
|
|
<!-- 单据记录 商品合约-->
|
|
|
<div class="topTableHeight">
|
|
<div class="topTableHeight">
|
|
|
- <a-table :columns="tabColumns"
|
|
|
|
|
- class="srcollYTable"
|
|
|
|
|
- :scroll="{ x: '100%', y: 'calc(100vh - 405px)' }"
|
|
|
|
|
- :pagination="false"
|
|
|
|
|
- :loading="loading"
|
|
|
|
|
- :expandedRowKeys="expandedRowKeys"
|
|
|
|
|
- :customRow="Rowclick"
|
|
|
|
|
- rowKey="key"
|
|
|
|
|
- :data-source="tableList">
|
|
|
|
|
|
|
+ <a-table
|
|
|
|
|
+ :columns="tabColumns"
|
|
|
|
|
+ class="srcollYTable"
|
|
|
|
|
+ :scroll="{ x: '100%', y: 'calc(100vh - 405px)' }"
|
|
|
|
|
+ :pagination="false"
|
|
|
|
|
+ :loading="loading"
|
|
|
|
|
+ :expandedRowKeys="expandedRowKeys"
|
|
|
|
|
+ :customRow="Rowclick"
|
|
|
|
|
+ rowKey="key"
|
|
|
|
|
+ :data-source="tableList"
|
|
|
|
|
+ >
|
|
|
<template #createtime="{ record }">
|
|
<template #createtime="{ record }">
|
|
|
<a>{{ formatTime(record.createtime) }}</a>
|
|
<a>{{ formatTime(record.createtime) }}</a>
|
|
|
</template>
|
|
</template>
|
|
@@ -23,7 +25,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
<!-- 持仓盈亏 -->
|
|
<!-- 持仓盈亏 -->
|
|
|
<template #profitloss="{ record }">
|
|
<template #profitloss="{ record }">
|
|
|
- <span>{{ record.averageprice ? useProfitloss(record, findGoodsCode(record.goodsid, record.goodscode, swapList)) : '--' }}</span>
|
|
|
|
|
|
|
+ <span>{{ record.averageprice ? useProfitloss(record) : '--' }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
<template #buyorsell="{ record }">
|
|
<template #buyorsell="{ record }">
|
|
|
<span>{{ getBuyOrSellName(record.buyorsell) }}</span>
|
|
<span>{{ getBuyOrSellName(record.buyorsell) }}</span>
|
|
@@ -54,65 +56,65 @@ import { ref } from 'vue';
|
|
|
import { expandIcon } from '@/common/setup/table/clolumn';
|
|
import { expandIcon } from '@/common/setup/table/clolumn';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
- name: EnumRouterName.search_document_records_contract_summary,
|
|
|
|
|
- setup() {
|
|
|
|
|
- // 表格列表数据
|
|
|
|
|
- const { loading, tableList, queryTable } = queryTableList<QueryTradePositionRsp>();
|
|
|
|
|
- const { subscribeAction } = handleSubcriteQuote();
|
|
|
|
|
- const swapList = ref<QueryQuoteGoodsListRsp[]>([]);
|
|
|
|
|
- // 获取列表数据
|
|
|
|
|
- const queryTableAction = () => {
|
|
|
|
|
- Promise.all([queryTable(queryTradePosition), getSwapList()]).then((res) => {
|
|
|
|
|
- swapList.value = res[1];
|
|
|
|
|
- tableList.value = res[0];
|
|
|
|
|
- const goodsSet = new Set<string>();
|
|
|
|
|
- res[0].forEach((el) => {
|
|
|
|
|
- // 商品掉期取参考行情最新价,挂牌点选取自己行情的最新价
|
|
|
|
|
- const goodscode = findGoodsCode(el.goodsid, el.goodscode, swapList.value);
|
|
|
|
|
- if (goodscode) {
|
|
|
|
|
- goodsSet.add(goodscode);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- // 行情订阅
|
|
|
|
|
- subscribeAction([...goodsSet]);
|
|
|
|
|
- });
|
|
|
|
|
- };
|
|
|
|
|
- // 现价
|
|
|
|
|
- function getLastprice(record: QueryTradePositionRsp) {
|
|
|
|
|
- let result: number | string = '--';
|
|
|
|
|
- const goodscode = findGoodsCode(record.goodsid, record.goodscode, swapList.value);
|
|
|
|
|
- if (goodscode) {
|
|
|
|
|
- result = getQuoteDayInfoByCodeFindPrice(goodscode);
|
|
|
|
|
- }
|
|
|
|
|
- return result;
|
|
|
|
|
- }
|
|
|
|
|
- function isDiaoQi(record: QueryTradePositionRsp) {
|
|
|
|
|
- return findGoodsTradeModeById(record.goodsid) === TradeMode.DiaoQi;
|
|
|
|
|
- }
|
|
|
|
|
- // 表格通用逻辑
|
|
|
|
|
- const param: ComposeTableParam = {
|
|
|
|
|
- queryFn: queryTableAction,
|
|
|
|
|
- menuType: EnumRouterName.warehouse_pre_sale_price,
|
|
|
|
|
- tableName: 'table_pcweb_spot_trade_warehouse_sale_price',
|
|
|
|
|
- tableFilterKey: [],
|
|
|
|
|
- isDetail: false,
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ name: EnumRouterName.search_document_records_contract_summary,
|
|
|
|
|
+ setup() {
|
|
|
|
|
+ // 表格列表数据
|
|
|
|
|
+ const { loading, tableList, queryTable } = queryTableList<QueryTradePositionRsp>();
|
|
|
|
|
+ const { subscribeAction } = handleSubcriteQuote();
|
|
|
|
|
+ const swapList = ref<QueryQuoteGoodsListRsp[]>([]);
|
|
|
|
|
+ // 获取列表数据
|
|
|
|
|
+ const queryTableAction = () => {
|
|
|
|
|
+ Promise.all([queryTable(queryTradePosition), getSwapList()]).then((res) => {
|
|
|
|
|
+ swapList.value = res[1];
|
|
|
|
|
+ tableList.value = res[0];
|
|
|
|
|
+ const goodsSet = new Set<string>();
|
|
|
|
|
+ res[0].forEach((el) => {
|
|
|
|
|
+ // 商品掉期取参考行情最新价,挂牌点选取自己行情的最新价
|
|
|
|
|
+ const goodscode = findGoodsCode(el.goodsid, el.goodscode, swapList.value);
|
|
|
|
|
+ if (goodscode) {
|
|
|
|
|
+ goodsSet.add(goodscode);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ // 行情订阅
|
|
|
|
|
+ subscribeAction([...goodsSet]);
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
+ // 现价
|
|
|
|
|
+ function getLastprice(record: QueryTradePositionRsp) {
|
|
|
|
|
+ let result: number | string = '--';
|
|
|
|
|
+ const goodscode = findGoodsCode(record.goodsid, record.goodscode, swapList.value);
|
|
|
|
|
+ if (goodscode) {
|
|
|
|
|
+ result = getQuoteDayInfoByCodeFindPrice(goodscode);
|
|
|
|
|
+ }
|
|
|
|
|
+ return result;
|
|
|
|
|
+ }
|
|
|
|
|
+ function isDiaoQi(record: QueryTradePositionRsp) {
|
|
|
|
|
+ return findGoodsTradeModeById(record.goodsid) === TradeMode.DiaoQi;
|
|
|
|
|
+ }
|
|
|
|
|
+ // 表格通用逻辑
|
|
|
|
|
+ const param: ComposeTableParam = {
|
|
|
|
|
+ queryFn: queryTableAction,
|
|
|
|
|
+ menuType: EnumRouterName.warehouse_pre_sale_price,
|
|
|
|
|
+ tableName: 'table_pcweb_spot_trade_warehouse_sale_price',
|
|
|
|
|
+ tableFilterKey: [],
|
|
|
|
|
+ isDetail: false,
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
- return {
|
|
|
|
|
- ...handleComposeTable<QueryTradePositionRsp>(param),
|
|
|
|
|
- loading,
|
|
|
|
|
- tableList,
|
|
|
|
|
- tabColumns,
|
|
|
|
|
- formatTime,
|
|
|
|
|
- getLastprice,
|
|
|
|
|
- useProfitloss,
|
|
|
|
|
- findGoodsCode,
|
|
|
|
|
- swapList,
|
|
|
|
|
- getBuyOrSellName,
|
|
|
|
|
- isDiaoQi,
|
|
|
|
|
- expandIcon,
|
|
|
|
|
- };
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...handleComposeTable<QueryTradePositionRsp>(param),
|
|
|
|
|
+ loading,
|
|
|
|
|
+ tableList,
|
|
|
|
|
+ tabColumns,
|
|
|
|
|
+ formatTime,
|
|
|
|
|
+ getLastprice,
|
|
|
|
|
+ useProfitloss,
|
|
|
|
|
+ findGoodsCode,
|
|
|
|
|
+ swapList,
|
|
|
|
|
+ getBuyOrSellName,
|
|
|
|
|
+ isDiaoQi,
|
|
|
|
|
+ expandIcon,
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|
|
|
<style lang="less">
|
|
<style lang="less">
|