Просмотр исходного кода

Merge branch 'master' of http://47.101.159.18:3000/Muchinfo/MTP2.0_WEB

li.shaoyi 4 лет назад
Родитель
Сommit
da5847df2b

+ 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
     }
-}
+}
+

+ 3 - 3
src/services/proto/warehousetrade/index.ts

@@ -1,8 +1,8 @@
 import {
     DeliveryOrderReq,
     HdWRDealOrderReq,
-    HdWROrderReq, PaymentArrearsReq, TradeHoldTransferApplyAuditReqType, TradeHoldTransferApplyReq, WarehouseRepurchaseReq, WrBargainApplyReq, WRListingCancelOrderReq, WROutApplyCancelReq,
-    WROutApplyReq, WROutCancelReq, WROutConfirmReq, WRTradeFinanceBuyCancelReq, HolderCloseReq
+    HdWROrderReq, HolderCloseReq, PaymentArrearsReq, TradeHoldTransferApplyAuditReqType, TradeHoldTransferApplyReq, WarehouseRepurchaseReq, WrBargainApplyReq, WRListingCancelOrderReq, WROutApplyCancelReq,
+    WROutApplyReq, WROutCancelReq, WROutConfirmReq, WRTradeFinanceBuyCancelReq
 } from "@/services/proto/warehousetrade/interface";
 import { protoMiddleware } from "@/services/socket/protobuf/buildReq";
 import { HeadEnum } from "@/services/socket/protobuf/protoHeader";
@@ -140,7 +140,7 @@ export const tradeHoldTransferApplyAuditReq = (param: TradeHoldTransferApplyAudi
  * @constructor
  */
 export const holderClose = (param: HolderCloseReq): Promise<any> => {
-    return protoMiddleware(param, 'HolderCloseReq', 'HolderCloseRsp', HeadEnum.tradeMode17)
+    return protoMiddleware(param, 'HolderCloseReq', 'HolderCloseRsp', HeadEnum.tradeMode46)
 }
 
 // /**

+ 5 - 5
src/services/proto/warehousetrade/interface.ts

@@ -1,4 +1,4 @@
-/** 
+/**
  * 对应 public/proto/mtp.proto 类型
 */
 
@@ -331,15 +331,15 @@ export interface TradeHoldTransferApplyAuditReqType {
 
 export interface HolderCloseReq {
     TradeID: number; // uint64 持仓单号
-    ClientSerialNo: string; // string 客户端流水号
-    ClientOrderTime: string; // string 客户端委托时间
-    ClientType: number; // uint32 终端类型
+    ClientSerialNo?: string; // string 客户端流水号
+    ClientOrderTime?: string; // string 客户端委托时间
+    ClientType?: number; // uint32 终端类型
     LoginID: number; // uint64 登陆账号
     AccountID: number; // uint64 交易账号
     GoodsID: number; // uint32 商品ID
     BuyOrSell: number; // uint32 买卖方向
     MarketID: number; // uint32 市场ID
-    OrderSrc: number; // uint32 单据来源
+    OrderSrc?: number; // uint32 单据来源
     OperatorID: number; // uint64 操作员账号ID
 }
 

+ 161 - 129
src/views/market/spot_trade/components/goods-chart/chart/index.vue

@@ -1,135 +1,167 @@
 <template>
-    <!-- 交易图表  -->
-    <div class="chart-container">
-        <div class="chart-content">
-            <div class="chart-content__header">
-                <a-radio-group class="chart-content__tabs" v-model:value="activeCycleType">
-                    <template v-for="item in chartType" :key="item.type">
-                        <a-radio-button :value="item.type">{{ item.name }}</a-radio-button>
-                    </template>
-                </a-radio-group>
-                <a-radio-group class="chart-content__tabs" v-model:value="activeSeriesType" v-show="activeCycleType !== CycleType.time">
-                    <a-radio-button value="MACD">MACD</a-radio-button>
-                    <a-radio-button value="VOL">VOL</a-radio-button>
-                    <a-radio-button value="KDJ">KDJ</a-radio-button>
-                    <a-radio-button value="CCI">CCI</a-radio-button>
-                </a-radio-group>
-            </div>
-            <echart-time class="chart-content__main" :quote-data="selectedRow" v-if="activeCycleType === CycleType.time"></echart-time>
-            <echart-kline class="chart-content__main" :quote-data="selectedRow" :cycle-type="activeCycleType" :series-type="activeSeriesType" v-else></echart-kline>
-            <div class="chart-content__footer"></div>
+  <!-- 交易图表  -->
+  <div class="chart-container">
+    <div class="chart-content">
+      <div class="chart-content__header">
+        <a-radio-group class="chart-content__tabs"
+                       v-model:value="activeCycleType">
+          <template v-for="item in chartType"
+                    :key="item.type">
+            <a-radio-button :value="item.type">{{ item.name }}</a-radio-button>
+          </template>
+        </a-radio-group>
+        <a-radio-group class="chart-content__tabs"
+                       v-model:value="activeSeriesType"
+                       v-show="activeCycleType !== CycleType.time">
+          <a-radio-button value="MACD">MACD</a-radio-button>
+          <a-radio-button value="VOL">VOL</a-radio-button>
+          <a-radio-button value="KDJ">KDJ</a-radio-button>
+          <a-radio-button value="CCI">CCI</a-radio-button>
+        </a-radio-group>
+      </div>
+      <echart-time class="chart-content__main"
+                   :quote-data="selectedRow"
+                   v-if="activeCycleType === CycleType.time"></echart-time>
+      <echart-kline class="chart-content__main"
+                    :quote-data="selectedRow"
+                    :cycle-type="activeCycleType"
+                    :series-type="activeSeriesType"
+                    v-else></echart-kline>
+      <div class="chart-content__footer"></div>
+    </div>
+    <div class="chart-slider">
+      <div class="chart-slider__button"></div>
+    </div>
+    <div class="chart-tips">
+      <div>
+        <div class="chart-tips__nav">
+          <div class="content content--left">{{ selectedRow.goodscode }}</div>
+          <div class="content content--right">{{ selectedRow.goodsname }}</div>
+        </div>
+        <div class="chart-tips__last">
+          <div
+               :class="['content content--left', handleQuotePriceColor(selectedRow.last, selectedRow.presettle)]">
+            {{ selectedRow.last }}</div>
+          <div class="content content--right">
+            <span
+                  :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)">{{ quoteChange(selectedRow) }}</span>
+            <span
+                  :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)">{{ quoteAmplitude(selectedRow) }}</span>
+          </div>
+        </div>
+        <div class="chart-tips__volume">
+          <a-row>
+            <a-col :span="8">卖一</a-col>
+            <a-col :class="handleQuotePriceColor(selectedRow.ask, selectedRow.presettle)"
+                   :span="8">{{ selectedRow.ask }}</a-col>
+            <a-col :class="handleQuotePriceColor(selectedRow.askvolume, selectedRow.presettle)"
+                   :span="8">{{ selectedRow.askvolume }}</a-col>
+          </a-row>
+          <a-row>
+            <a-col :span="8">买一</a-col>
+            <a-col :class="handleQuotePriceColor(selectedRow.bid, selectedRow.presettle)"
+                   :span="8">{{ selectedRow.bid }}</a-col>
+            <a-col :class="handleQuotePriceColor(selectedRow.bidvolume, selectedRow.presettle)"
+                   :span="8">{{ selectedRow.bidvolume }}</a-col>
+          </a-row>
         </div>
-        <div class="chart-slider">
-            <div class="chart-slider__button"></div>
+      </div>
+      <div class="chart-tips__tik">
+        <div class="row-header">
+          <h4>分时成交</h4>
+          <a-row>
+            <a-col :span="8">时间</a-col>
+            <a-col :span="8">价格</a-col>
+            <a-col :span="8">现量</a-col>
+          </a-row>
         </div>
-        <div class="chart-tips">
-            <div>
-                <div class="chart-tips__nav">
-                    <div class="content content--left">{{ selectedRow.goodscode }}</div>
-                    <div class="content content--right">{{ selectedRow.goodsname }}</div>
-                </div>
-                <div class="chart-tips__last">
-                    <div :class="['content content--left', handleQuotePriceColor(selectedRow.last, selectedRow.presettle)]">{{ selectedRow.last }}</div>
-                    <div class="content content--right">
-                        <span :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)">{{ quoteChange(selectedRow) }}</span>
-                        <span :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)">{{ quoteAmplitude(selectedRow) }}</span>
-                    </div>
-                </div>
-                <div class="chart-tips__volume">
-                    <a-row>
-                        <a-col :span="8">卖一</a-col>
-                        <a-col :class="handleQuotePriceColor(selectedRow.ask, selectedRow.presettle)" :span="8">{{ selectedRow.ask }}</a-col>
-                        <a-col :class="handleQuotePriceColor(selectedRow.askvolume, selectedRow.presettle)" :span="8">{{ selectedRow.askvolume }}</a-col>
-                    </a-row>
-                    <a-row>
-                        <a-col :span="8">买一</a-col>
-                        <a-col :class="handleQuotePriceColor(selectedRow.bid, selectedRow.presettle)" :span="8">{{ selectedRow.bid }}</a-col>
-                        <a-col :class="handleQuotePriceColor(selectedRow.bidvolume, selectedRow.presettle)" :span="8">{{ selectedRow.bidvolume }}</a-col>
-                    </a-row>
-                </div>
-            </div>
-            <div class="chart-tips__tik">
-                <div class="row-header">
-                    <h4>分时成交</h4>
-                    <a-row>
-                        <a-col :span="8">时间</a-col>
-                        <a-col :span="8">价格</a-col>
-                        <a-col :span="8">现量</a-col>
-                    </a-row>
-                </div>
-                <div class="row-content">
-                    <a-row v-for="(item, index) in tradedList" :key="index + '11'">
-                        <a-col :span="8">{{ formatTime(item.TS, 'hm') }}</a-col>
-                        <a-col :class="handleQuotePriceColor(item.PE, selectedRow.presettle)" :span="8">{{ item.PE }}</a-col>
-                        <a-col :class="handleQuotePriceColor(item.Vol, selectedRow.presettle)" :span="8">{{ item.Vol }}</a-col>
-                    </a-row>
-                </div>
-            </div>
-            <div class="chart-tips__info">
-                <a-row>
-                    <a-col :span="4">最新</a-col>
-                    <a-col :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)" :span="8">{{ selectedRow.last }}</a-col>
-                    <a-col :span="4">均价</a-col>
-                    <a-col :class="handleQuotePriceColor(selectedRow.averageprice, selectedRow.presettle)" :span="8">{{ selectedRow.averageprice }}</a-col>
-                </a-row>
-                <a-row>
-                    <a-col :span="4">涨跌</a-col>
-                    <a-col :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)" :span="8">{{ quoteChange(selectedRow) }}</a-col>
-                    <a-col :span="4">今开</a-col>
-                    <a-col :class="handleQuotePriceColor(selectedRow.opened, selectedRow.presettle)" :span="8">{{ selectedRow.opened }}</a-col>
-                </a-row>
-                <a-row>
-                    <a-col :span="4">涨幅</a-col>
-                    <a-col :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)" :span="8">{{ quoteAmplitude(selectedRow) }}</a-col>
-                    <a-col :span="4">最高</a-col>
-                    <a-col :class="handleQuotePriceColor(selectedRow.highest, selectedRow.presettle)" :span="8">{{ selectedRow.highest }}</a-col>
-                </a-row>
-                <a-row>
-                    <a-col :span="4">总量</a-col>
-                    <a-col :span="8">{{ selectedRow.totalvolume }}</a-col>
-                    <a-col :span="4">最低</a-col>
-                    <a-col :class="handleQuotePriceColor(selectedRow.lowest, selectedRow.presettle)" :span="8">{{ selectedRow.lowest }}</a-col>
-                </a-row>
-                <a-row>
-                    <a-col :span="4">金额</a-col>
-                    <a-col :span="8" style="color: #0d96ff">{{ changeUnit(selectedRow.totalturnover) }}</a-col>
-                    <a-col :span="4">量比</a-col>
-                    <a-col :span="8">{{ '--' }}</a-col>
-                </a-row>
-                <a-row>
-                    <a-col :span="4">涨停</a-col>
-                    <a-col class="red1" :span="8">{{ selectedRow.limitup }}</a-col>
-                    <a-col :span="4">跌停</a-col>
-                    <a-col class="green" :span="8">{{ selectedRow.limitdown }}</a-col>
-                </a-row>
-                <a-row>
-                    <a-col :span="4">外盘</a-col>
-                    <a-col :span="8">{{ selectedRow.totalbidvolume }}</a-col>
-                    <a-col :span="4">内盘</a-col>
-                    <a-col :span="8">{{ selectedRow.totalaskvolume }}</a-col>
-                </a-row>
-                <a-row>
-                    <a-col :span="4">持仓</a-col>
-                    <a-col :span="8">{{ selectedRow.holdvolume }}</a-col>
-                    <a-col :span="4">结算</a-col>
-                    <a-col :span="8">{{ selectedRow.settle }}</a-col>
-                </a-row>
-                <a-row>
-                    <a-col :span="4">仓差</a-col>
-                    <a-col :span="8">{{ '--' }}</a-col>
-                    <a-col :span="4">昨结</a-col>
-                    <a-col :span="8">{{ selectedRow.presettle }}</a-col>
-                </a-row>
-                <a-row>
-                    <a-col :span="4">日增</a-col>
-                    <a-col :span="8">{{ '--' }}</a-col>
-                    <a-col :span="4">开平</a-col>
-                    <a-col :span="8">{{ '--' }}</a-col>
-                </a-row>
-            </div>
-            <!-- <div @click="watchMore" class="watchMore">查看更多</div> -->
+        <div class="row-content">
+          <a-row v-for="(item, index) in tradedList"
+                 :key="index + '11'">
+            <a-col :span="8">{{ formatTime(item.TS, 'hm') }}</a-col>
+            <a-col :class="handleQuotePriceColor(item.PE, selectedRow.presettle)"
+                   :span="8">{{ item.PE }}</a-col>
+            <a-col :class="handleQuotePriceColor(item.Vol, selectedRow.presettle)"
+                   :span="8">{{ item.Vol }}</a-col>
+          </a-row>
         </div>
+      </div>
+      <div class="chart-tips__info">
+        <a-row>
+          <a-col :span="4">最新</a-col>
+          <a-col :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)"
+                 :span="8">{{ selectedRow.last }}</a-col>
+          <a-col :span="4">均价</a-col>
+          <a-col :class="handleQuotePriceColor(selectedRow.averageprice, selectedRow.presettle)"
+                 :span="8">{{ selectedRow.averageprice }}</a-col>
+        </a-row>
+        <a-row>
+          <a-col :span="4">涨跌</a-col>
+          <a-col :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)"
+                 :span="8">{{ quoteChange(selectedRow) }}</a-col>
+          <a-col :span="4">今开</a-col>
+          <a-col :class="handleQuotePriceColor(selectedRow.opened, selectedRow.presettle)"
+                 :span="8">{{ selectedRow.opened }}</a-col>
+        </a-row>
+        <a-row>
+          <a-col :span="4">涨幅</a-col>
+          <a-col :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)"
+                 :span="8">{{ quoteAmplitude(selectedRow) }}</a-col>
+          <a-col :span="4">最高</a-col>
+          <a-col :class="handleQuotePriceColor(selectedRow.highest, selectedRow.presettle)"
+                 :span="8">{{ selectedRow.highest }}</a-col>
+        </a-row>
+        <a-row>
+          <a-col :span="4">总量</a-col>
+          <a-col :span="8">{{ selectedRow.totalvolume }}</a-col>
+          <a-col :span="4">最低</a-col>
+          <a-col :class="handleQuotePriceColor(selectedRow.lowest, selectedRow.presettle)"
+                 :span="8">{{ selectedRow.lowest }}</a-col>
+        </a-row>
+        <a-row>
+          <a-col :span="4">金额</a-col>
+          <a-col :span="8"
+                 style="color: #0d96ff">{{ changeUnit(selectedRow.totalturnover) }}</a-col>
+          <a-col :span="4">量比</a-col>
+          <a-col :span="8">{{ '--' }}</a-col>
+        </a-row>
+        <a-row>
+          <a-col :span="4">涨停</a-col>
+          <a-col class="red1"
+                 :span="8">{{ selectedRow.limitup }}</a-col>
+          <a-col :span="4">跌停</a-col>
+          <a-col class="green"
+                 :span="8">{{ selectedRow.limitdown }}</a-col>
+        </a-row>
+        <a-row>
+          <a-col :span="4">外盘</a-col>
+          <a-col :span="8">{{ selectedRow.totalbidvolume }}</a-col>
+          <a-col :span="4">内盘</a-col>
+          <a-col :span="8">{{ selectedRow.totalaskvolume }}</a-col>
+        </a-row>
+        <a-row>
+          <a-col :span="4">持仓</a-col>
+          <a-col :span="8">{{ selectedRow.holdvolume }}</a-col>
+          <a-col :span="4">结算</a-col>
+          <a-col :span="8">{{ selectedRow.settle }}</a-col>
+        </a-row>
+        <a-row>
+          <a-col :span="4">仓差</a-col>
+          <a-col :span="8">{{ '--' }}</a-col>
+          <a-col :span="4">昨结</a-col>
+          <a-col :span="8">{{ selectedRow.presettle }}</a-col>
+        </a-row>
+        <a-row>
+          <a-col :span="4">日增</a-col>
+          <a-col :span="8">{{ '--' }}</a-col>
+          <a-col :span="4">开平</a-col>
+          <a-col :span="8">{{ '--' }}</a-col>
+        </a-row>
+      </div>
+      <div @click="watchMore"
+           class="watchMore">查看更多</div>
     </div>
+  </div>
 </template>
 
 <script lang="ts">
@@ -140,7 +172,7 @@ import { QueryQuoteDayRsp, QueryHistoryTikDatasRsp, CycleType } from '@/services
 import { QueryHistoryTikDatas } from '@/services/go/quote';
 import { formatTime } from '@/common/methods';
 import { changeUnit } from '@/utils/qt/common';
-import { ComponentType } from '../setup';
+import { ComponentType } from '@/views/market/spot_trade/spot_trade_order_transaction/setup';
 import { EchartKline, EchartTime } from '@/common/components/echart';
 import { handleQuotePriceColor, quoteChange, quoteAmplitude } from '@/common/setup/table/tableQuote';
 import { useQueryData } from '@/common/setup/request';
@@ -164,7 +196,7 @@ export default defineComponent({
         const activeSeriesType = ref('MACD');
 
         function watchMore() {
-            context.emit('update', ComponentType.tradeDetail);
+            context.emit('update', ComponentType.marketContent);
         }
         const { goodscode } = props.selectedRow;
 

+ 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">

+ 93 - 68
src/views/order/commodity_contract/components/commodity_contract_summary/components/commodity_contract_summary_order_closed/index.vue

@@ -1,63 +1,87 @@
 <template>
-    <!-- 按单平仓-->
-    <Drawer :title="'按单平仓'" :placement="'right'" class="bottom486" :visible="visible" @cancel="cancel">
-        <div class="listed c_c_s_s">
-            <a-form class="inlineForm dialogForm" ref="formRef" :model="formState" :rules="rules">
-                <div class="formBar">
-                    <div class="formtop">
-                        <div class="firstTitle">
-                            <span>合约:{{ selectedRow.goodscode }}/{{ selectedRow.goodsname }}</span>
-                        </div>
-                        <div class="secondLine">
-                            <div class="left">持仓单号/方向</div>
-                            <div class="middle">数量/价格/金额</div>
-                            <div class="right">到期日/盈亏</div>
-                        </div>
-                        <a-checkbox-group class="commonCheckboxGroup" v-model:value="checked" @change="checkGroupChange">
-                            <div class="lineBar" v-for="item in tableList" :key="item.tradeid">
-                                <div class="line1">
-                                    <div class>
-                                        <a-checkbox @change="checkboxChange(item)" :value="item.tradeid"></a-checkbox>
-                                    </div>
-                                    <div class="name">{{ item.tradeid }}</div>
-                                    <div class="date">{{ formatTime(item.tradetime, 'd') }}</div>
-                                </div>
-                                <div class="line2">
-                                    <div class="left">{{ item.buyorsell === BuyOrSell.buy ? '买入' : '卖出' }}</div>
-                                    <div class="middle">
-                                        <div>{{ item.holderqty }}</div>
-                                        <div>{{ item.holderprice }}</div>
-                                        <div>{{ item.holderamount }}</div>
-                                    </div>
-                                    <div class="right red">+100</div>
-                                </div>
-                            </div>
-                        </a-checkbox-group>
-                    </div>
+  <!-- 平仓-->
+  <Drawer :title="'平仓'"
+          :placement="'right'"
+          class="bottom486"
+          :visible="visible"
+          @cancel="cancel">
+    <div class="listed c_c_s_s">
+      <a-form class="inlineForm dialogForm"
+              ref="formRef"
+              :model="formState"
+              :rules="rules">
+        <div class="formBar">
+          <div class="formtop">
+            <div class="firstTitle">
+              <span>合约:{{ selectedRow.goodscode }}/{{ selectedRow.goodsname }}</span>
+            </div>
+            <div class="secondLine">
+              <div class="left">持仓单号/方向</div>
+              <div class="middle">数量/价格/金额</div>
+              <div class="right">到期日/盈亏</div>
+            </div>
+            <a-checkbox-group class="commonCheckboxGroup"
+                              v-model:value="checked"
+                              @change="checkGroupChange">
+              <div class="lineBar"
+                   v-for="item in tableList"
+                   :key="item.tradeid">
+                <div class="line1">
+                  <div class>
+                    <a-checkbox @change="checkboxChange(item)"
+                                :value="item.tradeid"></a-checkbox>
+                  </div>
+                  <div class="name">{{ item.tradeid }}</div>
+                  <div class="date">{{ formatTime(item.tradetime, 'd') }}</div>
                 </div>
-                <div class="fixedBtns">
-                    <a-row :gutter="24">
-                        <a-col :span="24" class="mt12">
-                            <a-form-item label="估算价" name="price" class="inputIconBox mb10 not-copy">
-                                <a-input-number class="commonInput not-copy" v-model:value="formState.price" style="width: 200px" :min="0" />
-                                <MinusOutlined @click="decreasePrice" />
-                                <PlusOutlined @click="increasePirce" />
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24">
-                            <a-form-item label="估算金额" class="mb10 not-copy">
-                                <span class="white">50400.20</span>
-                            </a-form-item>
-                        </a-col>
-                    </a-row>
-                    <a-form-item class="btnCenter mt10">
-                        <a-button class="listedBtn" :loading="loading" :disabled="loading" @click="submit">提交</a-button>
-                        <a-button class="ml10 cancelBtn" @click="cancel">取消</a-button>
-                    </a-form-item>
+                <div class="line2">
+                  <div class="left">{{ item.buyorsell === BuyOrSell.buy ? '买入' : '卖出' }}</div>
+                  <div class="middle">
+                    <div>{{ item.holderqty }}</div>
+                    <div>{{ item.holderprice }}</div>
+                    <div>{{ item.holderamount }}</div>
+                  </div>
+                  <div class="right red">+100</div>
                 </div>
-            </a-form>
+              </div>
+            </a-checkbox-group>
+          </div>
         </div>
-    </Drawer>
+        <div class="fixedBtns">
+          <a-row :gutter="24"
+                 v-if="false">
+            <a-col :span="24"
+                   class="mt12">
+              <a-form-item label="估算价"
+                           name="price"
+                           class="inputIconBox mb10 not-copy">
+                <a-input-number class="commonInput not-copy"
+                                v-model:value="formState.price"
+                                style="width: 200px"
+                                :min="0" />
+                <MinusOutlined @click="decreasePrice" />
+                <PlusOutlined @click="increasePirce" />
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="估算金额"
+                           class="mb10 not-copy">
+                <span class="white">50400.20</span>
+              </a-form-item>
+            </a-col>
+          </a-row>
+          <a-form-item class="btnCenter mt10">
+            <a-button class="listedBtn"
+                      :loading="loading"
+                      :disabled="loading"
+                      @click="submit">提交</a-button>
+            <a-button class="ml10 cancelBtn"
+                      @click="cancel">取消</a-button>
+          </a-form-item>
+        </div>
+      </a-form>
+    </div>
+  </Drawer>
 </template>
 
 <script lang="ts">
@@ -69,7 +93,7 @@ import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo
 import { validateAction } from '@/common/setup/form';
 import { _closeModal } from '@/common/setup/modal/modal';
 import { queryTableList } from '@/common/setup/table';
-import { getUserId } from '@/services/bus/account';
+import { getSelectedAccountId, getUserId } from '@/services/bus/account';
 import { geLoginID_number } from '@/services/bus/login';
 import { QueryTradePositionRsp } from '@/services/go/ermcp/order/interface';
 import { queryTradeHolderDetail } from '@/services/go/order';
@@ -136,18 +160,19 @@ export default defineComponent({
             validateAction<FormState>(formRef, formState).then((res) => {
                 const param: HolderCloseReq = {
                     TradeID: Long.fromString(selected.value!.tradeid),
-                    ClientSerialNo: 'string', // string 客户端流水号
-                    ClientOrderTime: 'string', // string 客户端委托时间
-                    ClientType: 0, // uint32 终端类型
-                    LoginID: 0, // uint64 登陆账号
-                    AccountID: 0, // uint64 交易账号
-                    GoodsID: 0, // uint32 商品ID
-                    BuyOrSell: 0, // uint32 买卖方向
-                    MarketID: 0, // uint32 市场ID
-                    OrderSrc: 0, // uint32 单据来源
-                    OperatorID: 0, // uint64 操作员账号ID
+
+                    // ClientSerialNo: 'string', // string 客户端流水号
+                    // ClientOrderTime: 'string', // string 客户端委托时间
+                    // ClientType: 0, // uint32 终端类型
+                    LoginID: geLoginID_number()!, // uint64 登陆账号
+                    AccountID: getSelectedAccountId(), // uint64 交易账号
+                    GoodsID: selected.value!.goodsid,
+                    MarketID: selected.value!.marketid, // uint32 市场ID
+                    BuyOrSell: selected.value!.buyorsell,
+                    // OrderSrc: 0, // uint32 单据来源
+                    OperatorID: geLoginID_number()!, // uint64 操作员账号ID
                 };
-                requestResultLoadingAndInfo(holderClose, param, loading, ['协议平仓成功', '协议平仓失败:']).then(() => {
+                requestResultLoadingAndInfo(holderClose, param, loading, ['平仓成功', '平仓失败:']).then(() => {
                     cancel(true);
                 });
             });

+ 130 - 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,16 @@ 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 +244,8 @@ export default defineComponent({
             useHolderprice,
             useProfitloss,
             handleBtnList,
+            tabColumns,
+            getBuyOrSellName,
         };
     },
 });