ソースを参照

修改 商品合约 合约汇总 表头

huangbin 4 年 前
コミット
ae16f4ab40

+ 2 - 1
src/services/bus/goods.ts

@@ -44,9 +44,10 @@ export function getQutoGoodsByTradeMode(trademode: TradeMode) {
                 // 找到行情数据
                 const quote = getQuoteDayInfoByCode(el.goodscode);
                 if (quote) {
-                    Object.assign(quote, { goodsname: el.goodsname })
+                    Object.assign(quote, { goodsname: el.goodsname, goodsid: el.goodsid })
                     result.value.push(quote)
                 }
+                console.log('result', result)
             })
         }
     })

+ 3 - 2
src/services/bus/holdPosition.ts

@@ -17,7 +17,7 @@ export const useProfitloss = (record: QueryTradePositionRsp) => {
     }
 }
 
-// 持仓金额(市值(所有权)) = 数量 * 现价 * 合约单位
+// 市值(所有权) = 数量 * 现价 * 合约单位
 export const useHolderprice = (record: QueryTradePositionRsp) => {
     // 最新价
     const lastPrice = getQuoteDayInfoByCodeFindPrice(record.goodscode);
@@ -27,4 +27,5 @@ export const useHolderprice = (record: QueryTradePositionRsp) => {
     } else {
         return lastPrice
     }
-}
+}
+

+ 1 - 1
src/views/market/spot_trade/spot_trade_order_transaction/setup.ts

@@ -58,7 +58,7 @@ export function handleDeliveryRelation(param: deliverytype[]) {
     function findDeilverGoodsByGoodsCode(goodscode: string) {
         return allDeliverGoods.value.find(e => e.goodscode === goodscode)!
     }
-    return { deliverGoods, updateGeliverGoods, getQuoteList, goodsList: allDeliverGoods, findDeilverGoodsByGoodsCode }
+    return { deliverGoods, allDeliverGoods, updateGeliverGoods, getQuoteList, goodsList: allDeliverGoods, findDeilverGoodsByGoodsCode }
 }
 
 export const columnsList = [

+ 61 - 46
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_listing_transfer/index.vue

@@ -1,50 +1,65 @@
 <template>
-    <!--订单交易 挂牌转让-->
-    <div class="topTableHeight">
-        <a-table :columns="columns" :class="['srcollYTable', isBottom ? 'secondTabTable' : 'secondTabTableNoBottom', getQuoteList().length ? 'noPlaceHolder' : 'hasPlaceHolder']" :scroll="{ x: '100%', y: isBottom ? 'calc(100vh- 407px)' : 'calc(100vh - 167px)' }" :pagination="false" :loading="loading" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" rowKey="goodscode" ref="tableRef" :data-source="getQuoteList()">
-            <template #totalturnover="{ text }">
-                <span>{{ changeUnit(text) }}</span>
-            </template>
-            <!-- 涨跌 -->
-            <template #change="{ record }">
-                <span>{{ quoteChange(record, record.decimalplace) }}</span>
-            </template>
-            <!-- 幅度 -->
-            <template #amplitude="{ record }">
-                <span>{{ quoteAmplitude(record, record.decimalplace) }}</span>
-            </template>
-            <!-- 振幅 -->
-            <template #vibration="{ record }">
-                <span>{{ quoteAmplituOfVibration(record, record.decimalplace) }}</span>
-            </template>
-            <template #index="{ index }">
-                <span>{{ index + 1 }}</span>
-            </template>
-            <!-- 买价 -->
-            <template #bid="{ text, record }">
-                <span :class="handleQuotePriceColor(text, record.presettle)">{{ text }}</span>
-            </template>
-            <!-- 卖价 -->
-            <template #ask="{ text, record }">
-                <span :class="handleQuotePriceColor(text, record.presettle)">{{ text }}</span>
-            </template>
-            <!-- 最新价 -->
-            <template #last="{ text, record }">
-                <span :class="handleQuotePriceColor(text, record.presettle)">{{ text }}</span>
-            </template>
-            <!-- 最低价 -->
-            <template #lowest="{ text, record }">
-                <span :class="handleQuotePriceColor(text, record.presettle)">{{ text }}</span>
-            </template>
-            <!-- 最高价 -->
-            <template #highest="{ text, record }">
-                <span :class="handleQuotePriceColor(text, record.presettle)">{{ text }}</span>
-            </template>
-        </a-table>
-        <!-- 右键 -->
-        <contextMenu :contextMenu="contextMenu" @cancel="closeContext" :list="btnList"></contextMenu>
-        <component :is="componentId" v-if="componentId" :selectedRow="selectedRow" :deliverGoods="findDeilverGoodsByGoodsCode(selectedRow.goodscode)" @cancel="closeComponent"></component>
-    </div>
+  <!--订单交易 挂牌转让-->
+  <div class="topTableHeight">
+    <a-table :columns="columns"
+             :class="['srcollYTable', isBottom ? 'secondTabTable' : 'secondTabTableNoBottom', getQuoteList().length ? 'noPlaceHolder' : 'hasPlaceHolder']"
+             :scroll="{ x: '100%', y: isBottom ? 'calc(100vh- 407px)' : 'calc(100vh - 167px)' }"
+             :pagination="false"
+             :loading="loading"
+             :expandedRowKeys="expandedRowKeys"
+             :customRow="Rowclick"
+             rowKey="goodscode"
+             ref="tableRef"
+             :data-source="getQuoteList()">
+      <template #totalturnover="{ text }">
+        <span>{{ changeUnit(text) }}</span>
+      </template>
+      <!-- 涨跌 -->
+      <template #change="{ record }">
+        <span>{{ quoteChange(record, record.decimalplace) }}</span>
+      </template>
+      <!-- 幅度 -->
+      <template #amplitude="{ record }">
+        <span>{{ quoteAmplitude(record, record.decimalplace) }}</span>
+      </template>
+      <!-- 振幅 -->
+      <template #vibration="{ record }">
+        <span>{{ quoteAmplituOfVibration(record, record.decimalplace) }}</span>
+      </template>
+      <template #index="{ index }">
+        <span>{{ index + 1 }}</span>
+      </template>
+      <!-- 买价 -->
+      <template #bid="{ text, record }">
+        <span :class="handleQuotePriceColor(text, record.presettle)">{{ text }}</span>
+      </template>
+      <!-- 卖价 -->
+      <template #ask="{ text, record }">
+        <span :class="handleQuotePriceColor(text, record.presettle)">{{ text }}</span>
+      </template>
+      <!-- 最新价 -->
+      <template #last="{ text, record }">
+        <span :class="handleQuotePriceColor(text, record.presettle)">{{ text }}</span>
+      </template>
+      <!-- 最低价 -->
+      <template #lowest="{ text, record }">
+        <span :class="handleQuotePriceColor(text, record.presettle)">{{ text }}</span>
+      </template>
+      <!-- 最高价 -->
+      <template #highest="{ text, record }">
+        <span :class="handleQuotePriceColor(text, record.presettle)">{{ text }}</span>
+      </template>
+    </a-table>
+    <!-- 右键 -->
+    <contextMenu :contextMenu="contextMenu"
+                 @cancel="closeContext"
+                 :list="btnList"></contextMenu>
+    <component :is="componentId"
+               v-if="componentId"
+               :selectedRow="selectedRow"
+               :deliverGoods="findDeilverGoodsByGoodsCode(selectedRow.goodscode)"
+               @cancel="closeComponent"></component>
+  </div>
 </template>
 
 <script lang="ts">

+ 132 - 4
src/views/order/commodity_contract/components/commodity_contract_summary/index.vue

@@ -1,7 +1,7 @@
 <template>
   <!-- 商品订单 - 合约汇总 -->
   <section>
-    <a-table :columns="columns"
+    <a-table :columns="tabColumns"
              class="srcollYTable expandLeftTable"
              :scroll="{ x: '100%', y: '190px' }"
              :pagination="false"
@@ -32,13 +32,16 @@
         <a>{{ text ? text : 0 }}</a>
       </template>
       <!-- 持仓金额  -->
-      <template #holderprice="{ record }">
+      <!-- <template #holderprice="{ record }">
         <a>{{ useHolderprice(record) }}</a>
-      </template>
+      </template> -->
       <!-- 持仓盈亏 -->
       <template #profitloss="{ record }">
         <span>{{ record.averageprice ? useProfitloss(record) : '--' }}</span>
       </template>
+      <template #buyorsell="{ record }">
+        <span>{{ getBuyOrSellName(record.buyorsell) }}</span>
+      </template>
     </a-table>
     <component :is="componentId"
                v-if="componentId"
@@ -60,10 +63,124 @@ import { expandIcon } from '@/common/setup/table/clolumn';
 import { handleComposeOrderTable } from '@/common/setup/table/compose';
 import { ComposeOrderTableParam } from '@/common/setup/table/interface';
 import { handleSubcriteQuote } from '@/common/setup/table/tableQuote';
-import { findGoodsTradeModeById, getQuoteDayInfoByCodeFindPrice } from '@/services/bus/goods';
+import { findGoodsTradeModeById, getQuoteDayInfoByCodeFindPrice, getQutoGoodsByTradeMode } from '@/services/bus/goods';
 import { useHolderprice, useProfitloss } from '@/services/bus/holdPosition';
 import { queryTradePosition } from '@/services/go/ermcp/order';
 import { QueryTradePositionRsp } from '@/services/go/ermcp/order/interface';
+import { getBuyOrSellName, getChannelBuildName } from '@/common/constants/enumsName';
+
+const tabColumns = [
+    {
+        key: '10th',
+        dataIndex: 'goodsname',
+        title: '订单合约',
+        align: 'center',
+        slots: {
+            customRender: 'goodsname',
+        },
+        width: 120,
+    },
+    {
+        key: '7th',
+        dataIndex: 'buyorsell',
+        title: '方向',
+        align: 'center',
+        slots: {
+            customRender: 'buyorsell',
+        },
+        width: 120,
+    },
+    {
+        key: '8th',
+        dataIndex: 'curpositionqty',
+        title: '持有数量',
+        align: 'center',
+        slots: {
+            customRender: 'curpositionqty',
+        },
+        width: 120,
+    },
+    {
+        key: '9th',
+        dataIndex: 'enableqty',
+        title: '可用数量',
+        align: 'center',
+        slots: {
+            customRender: 'enableqty',
+        },
+        width: 120,
+    },
+    {
+        key: '0th',
+        dataIndex: 'frozenqty',
+        title: '冻结数量',
+        align: 'center',
+        slots: {
+            customRender: 'frozenqty',
+        },
+        width: 120,
+    },
+    {
+        key: '1th',
+        dataIndex: 'averageprice',
+        title: '均价',
+        align: 'center',
+        slots: {
+            customRender: 'averageprice',
+        },
+        width: 120,
+    },
+    {
+        key: '2th',
+        dataIndex: 'lastprice',
+        title: '现价',
+        align: 'center',
+        slots: {
+            customRender: 'lastprice',
+        },
+        width: 120,
+    },
+    {
+        key: '3th',
+        dataIndex: 'curholderamount',
+        title: '持仓金额',
+        align: 'center',
+        slots: {
+            customRender: 'curholderamount',
+        },
+        width: 120,
+    },
+    {
+        key: '4th',
+        dataIndex: 'usedmargin',
+        title: '占用保证金',
+        align: 'center',
+        slots: {
+            customRender: 'usedmargin',
+        },
+        width: 130,
+    },
+    {
+        key: '5th',
+        dataIndex: 'marketamount',
+        title: '市值',
+        align: 'center',
+        slots: {
+            customRender: 'marketamount',
+        },
+        width: 120,
+    },
+    {
+        key: '6th',
+        dataIndex: 'profitloss',
+        title: '浮动盈亏',
+        align: 'center',
+        slots: {
+            customRender: 'profitloss',
+        },
+        width: 120,
+    },
+];
 
 export default defineComponent({
     name: enumOrderComponents.commodity_contract_summary,
@@ -80,9 +197,18 @@ export default defineComponent({
         const { subscribeAction } = handleSubcriteQuote();
         // 交割商品
         handleDeliveryRelation();
+
+        // 挂牌点选商品
+        //         const { deliverGoods, getQuoteList, goodsList, } = handleDeliveryRelation([1, 3]);
+        //         // 参考行情商品
+        // const goodsList = getQutoGoodsByTradeMode(TradeMode.quote99);
         // 获取列表数据
         const queryTableAction = () => {
             queryTable(queryTradePosition).then((res) => {
+                const result: string[] = []
+                res.forEach(el => {
+
+                })
                 const goodsList = res.map((el) => {
                     return el.goodscode;
                 });
@@ -120,6 +246,8 @@ export default defineComponent({
             useHolderprice,
             useProfitloss,
             handleBtnList,
+            tabColumns,
+            getBuyOrSellName,
         };
     },
 });