Prechádzať zdrojové kódy

掉期订单 关闭表格市值

huangbin 4 rokov pred
rodič
commit
2e30db9c34

+ 2 - 2
src/views/order/swap_the_order/components/swap_commodity_contract_summary/setup.ts

@@ -49,7 +49,7 @@ export function getTableColums() {
         { key: 'averageprice', title: '均价' },
         { key: 'lastprice', title: '现价' },
         { key: 'curholderamount', title: '持仓金额' },
-        { key: 'marketamount', title: '市值' },
+        // { key: 'marketamount', title: '市值' },
         { key: 'profitloss', title: '浮动盈亏' },
     ]
     return useSetColumns(list)
@@ -87,7 +87,7 @@ export const useDetail = () => {
             { key: 'openprice', title: '建仓价' },
             { key: 'tradeid', title: '持仓单号', width: 160 },
             { key: 'holderamount', title: '建仓金额' },
-            { key: 'marketamount', title: '市值' },
+            // { key: 'marketamount', title: '市值' },
             { key: 'profitloss', title: '浮动盈亏' },
             { key: 'operate', title: '操作', width: 160 },
         ]

+ 70 - 68
src/views/search/search_document_records/search_commodity_contract/search_document_records_contract_summary/index.vue

@@ -1,15 +1,17 @@
 <template>
   <!-- 单据记录 商品合约-->
   <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 }">
         <a>{{ formatTime(record.createtime) }}</a>
       </template>
@@ -23,7 +25,7 @@
       </template>
       <!-- 持仓盈亏 -->
       <template #profitloss="{ record }">
-        <span>{{ record.averageprice ? useProfitloss(record, findGoodsCode(record.goodsid, record.goodscode, swapList)) : '--' }}</span>
+        <span>{{ record.averageprice ? useProfitloss(record) : '--' }}</span>
       </template>
       <template #buyorsell="{ record }">
         <span>{{ getBuyOrSellName(record.buyorsell) }}</span>
@@ -54,65 +56,65 @@ import { ref } from 'vue';
 import { expandIcon } from '@/common/setup/table/clolumn';
 
 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>
 <style lang="less">