瀏覽代碼

修改 现货市场 买卖大厅

huangbin 3 年之前
父節點
當前提交
fa05b4d70a

+ 45 - 41
src/views/market/market-spot/components/buy-sell-market/components/buy/index.vue

@@ -1,35 +1,41 @@
 <template>
-  <!--  现货贸易 - 买卖大厅 - 卖报价牌 -->
-  <a-table :columns="handleColumn(columns)"
-           :class="['buyHallTable', isBottom ? '' : 'buyHallTableHigh', tableList.length ? '' : 'noDataTable']"
-           :scroll="{ x: '100%', y: isBottom ? 'calc(100vh- 378px)' : 'calc(100vh - 135px)' }"
-           :pagination="false"
-           :loading="loading"
-           :expandedRowKeys="expandedRowKeys"
-           :customRow="Rowclick"
-           :expandIcon="expandIcon"
-           :expandIconAsCell="false"
-           rowKey="key"
-           :data-source="tableList">
-    <!-- ,  -->
-    <!-- 额外的展开行 -->
-    <template #expandedRowRender="{ record }">
-      <BtnList :btnList="btnList"
-               :record="record"
-               class="btn-list-sticky"
-               @click="openComponent" />
-    </template>
-    <template #username="{text, record }">
-      <span>{{record.userid + " "}}{{text}}</span>
-    </template>
-  </a-table>
-  <component :is="componentId"
-             v-if="componentId"
-             :selectedRow="selectedRow"
-             :buyOrSell="BuyOrSell.buy"
-             :enumName="enumName"
-             :parantSelectedRow="parantSelectedRow"
-             @cancel="closeComponent"></component>
+    <!--  现货贸易 - 买卖大厅 - 卖报价牌 -->
+    <a-table
+        :columns="handleColumn(columns)"
+        :class="['buyHallTable', isBottom ? '' : 'buyHallTableHigh', tableList.length ? '' : 'noDataTable']"
+        :scroll="{ x: '100%', y: isBottom ? 'calc(100vh- 378px)' : 'calc(100vh - 135px)' }"
+        :pagination="false"
+        :loading="loading"
+        :expandedRowKeys="expandedRowKeys"
+        :customRow="Rowclick"
+        :expandIcon="expandIcon"
+        :expandIconAsCell="false"
+        rowKey="key"
+        :data-source="tableList"
+    >
+        <!-- ,  -->
+        <!-- 额外的展开行 -->
+        <template #expandedRowRender="{ record }">
+            <BtnList
+                :btnList="buttonList"
+                :record="record"
+                class="btn-list-sticky"
+                @click="openComponent"
+            />
+        </template>
+        <template #username="{ text, record }">
+            <span>{{ record.userid + " " }}{{ text }}</span>
+        </template>
+    </a-table>
+    <component
+        :is="componentId"
+        v-if="componentId"
+        :selectedRow="selectedRow"
+        :buyOrSell="BuyOrSell.buy"
+        :enumName="enumName"
+        :parantSelectedRow="parantSelectedRow"
+        @cancel="closeComponent"
+    ></component>
 </template>
 
 <script lang="ts">
@@ -56,10 +62,6 @@ export default defineComponent({
             default: '',
             type: String as PropType<EnumRouterName>,
         },
-        btnList: {
-            default: [],
-            type: Array as PropType<BtnListType[]>,
-        },
         parantSelectedRow: {
             type: Object as PropType<WrOrderQuote>,
             default: {},
@@ -71,17 +73,18 @@ export default defineComponent({
     },
     components: {
         BtnList,
-        warehouse_receipt_trade_floating_price_spot_trade_warehouse_delisting_buy: defineAsyncComponent(() => import('../delisting/index.vue')),
-        warehouse_receipt_trade_price_spot_trade_warehouse_delisting_buy: defineAsyncComponent(() => import('../delisting/index.vue')),
-        warehouse_pre_sale_price_spot_trade_warehouse_delisting_buy: defineAsyncComponent(() => import('../delisting/index.vue')),
-        warehouse_pre_sale_floating_price_spot_trade_warehouse_delisting_buy: defineAsyncComponent(() => import('../delisting/index.vue')),
+        delisting: defineAsyncComponent(() => import('../delisting/index.vue')),
     },
     setup(props, context) {
         const isBottom = getShowBottomValue();
-        console.log(isBottom.value, 'isBottom');
         // 表格列表数据
         const { loading, tableList, queryTable } = queryTableList<WrOrderQuoteDetail>();
         const { wrpricetype, haswr, tableKey } = getBuyMarketParam(props.enumName);
+
+        const buttonList: BtnListType[] = [
+            { lable: '摘牌', code: 'delisting', className: 'operBtn' },
+        ]
+
         // 获取列表数据
         const queryTableAction = () => {
             const param: QueryOrderQuoteDetailReq = {
@@ -113,7 +116,7 @@ export default defineComponent({
             });
             return columns;
         }
-        function handleBtnList() {}
+        function handleBtnList() { }
         return {
             isBottom,
             ...handleComposeTable<WrOrderQuoteDetail>(param),
@@ -124,6 +127,7 @@ export default defineComponent({
             enumName: props.enumName,
             expandIcon,
             handleColumn,
+            buttonList,
         };
     },
 });

+ 11 - 10
src/views/market/market-spot/components/buy-sell-market/components/delisting/index.vue

@@ -39,10 +39,10 @@
           </a-row>
           <a-row :gutter="24">
             <a-col :span="24">
-              <a-form-item label="基差" v-if="isFloat()">
+              <a-form-item label="基差" v-if="getListingMode(ListingMode.float)">
                 <span class="yellow ml8">{{ selectedRow.pricemove }}</span>
               </a-form-item>
-              <a-form-item label="挂牌价格" v-if="!isFloat()">
+              <a-form-item label="挂牌价格" v-if="!getListingMode(ListingMode.float)">
                 <span class="yellow ml8">{{ selectedRow.fixedprice }}</span>
               </a-form-item>
               <a-row :gutter="24">
@@ -53,7 +53,7 @@
               </a-form-item>
             </a-col>
           </a-row>
-          <a-row :gutter="24" v-if="isBuy() && isWR()">
+          <a-row :gutter="24" v-if="isBuy() && getAuctionwrType(AuctionwrType.hasWr)">
             <a-col :span="24">
               <a-form-item label="现货仓单" name="LadingBillId">
                 <a-select
@@ -104,14 +104,14 @@
             </a-col>
             <a-col :span="12">&nbsp;</a-col>
           </a-row>
-          <a-col :span="24" v-if="isFloat()">
+          <a-col :span="24" v-if="getListingMode(ListingMode.float)">
             <a-form-item label="估算价" name="PriceMove">
               <span class="white">{{ getPrice() }}</span>
             </a-form-item>
           </a-col>
           <a-row :gutter="24">
             <a-col :span="24" class="mt-20">
-              <a-form-item :label="isFloat() ? '估算金额' : '摘牌金额'">
+              <a-form-item :label="getListingMode(ListingMode.float) ? '估算金额' : '摘牌金额'">
                 <span class="white ml8">{{ getMoney() }}</span>
               </a-form-item>
             </a-col>
@@ -175,6 +175,9 @@ import { EnumRouterName } from '@/common/constants/enumRouterName';
 import { getCanUseMoney } from '@/services/bus/account';
 import { getQuoteDayInfoByCodeFindPrice } from '@/services/bus/goods';
 import { message } from 'ant-design-vue';
+import { getAuctionwrType, getListingMode } from '@/views/market/market-spot/setup'
+import { TradeMode, ListingMode, AuctionwrType } from '@/common/constants/enumCommon';
+
 export default defineComponent({
   name: ModalEnum.spot_trade_warehouse_financing_delisting,
   components: { Drawer, PlusOutlined, MinusOutlined },
@@ -210,8 +213,7 @@ export default defineComponent({
       return accountList.find((e) => e.accountid === formState.accountid);
     }
     const loading = ref<boolean>(false);
-    // 判断
-    const { isWR, isBuy, isFloat } = handleIs(props.enumName, props.buyOrSell);
+    const isBuy = () => props.buyOrSell === BuyOrSell.buy
     // 现货仓单
     const { wrHoldList } = handleSpotWarrant(props.enumName, props.buyOrSell, props.parantSelectedRow, loading);
     getWrPosition(props.enumName, props.buyOrSell, loading);
@@ -253,7 +255,7 @@ export default defineComponent({
           WRFactorTypeId: props.parantSelectedRow.wrfactortypeid, // uint64 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写
           TradeDate: moment().format('YYYYMMDD'), // string 交易日
           DeliveryMonth: '', // string 交收月
-          HasWr: isWR(), // uint32 是否有仓单-0:没有仓单 1:有仓单
+          HasWr: getAuctionwrType(AuctionwrType.noWr) ? 0 : 1, // uint32 是否有仓单-0:没有仓单 1:有仓单
           IsFinancing: 0, // uint32 是否融资购买(买摘牌时有效)-0:否 1:是
           ProductDetailID: 0, // uint64 金融机构产品组合ID(融资购买时有效)
         };
@@ -284,9 +286,7 @@ export default defineComponent({
       wrHoldList,
       loading,
       submit,
-      isWR,
       isBuy,
-      isFloat,
       rules,
       formState,
       formRef,
@@ -296,6 +296,7 @@ export default defineComponent({
       getMoney,
       getMargin,
       getPrice,
+      getAuctionwrType, getListingMode, ListingMode, AuctionwrType
     };
   },
 });

+ 11 - 11
src/views/market/market-spot/components/buy-sell-market/components/financing_delisting/index.vue

@@ -39,10 +39,10 @@
           </a-row>
           <a-row :gutter="24">
             <a-col :span="24">
-              <a-form-item label="基差" v-if="isFloat()">
+              <a-form-item label="基差" v-if="getListingMode(ListingMode.float)">
                 <span class="yellow ml8">{{ selectedRow.pricemove }}</span>
               </a-form-item>
-              <a-form-item label="挂牌价格" v-if="!isFloat()">
+              <a-form-item label="挂牌价格" v-if="!getListingMode(ListingMode.float)">
                 <span class="yellow ml8">{{ selectedRow.fixedprice }}</span>
               </a-form-item>
               <a-row :gutter="24">
@@ -71,7 +71,7 @@
               </a-form-item>
             </a-col>
           </a-row>
-          <a-row :gutter="24" v-if="isBuy() && isWR()">
+          <a-row :gutter="24" v-if="isBuy() && getAuctionwrType(AuctionwrType.hasWr)">
             <a-col :span="24">
               <a-form-item label="现货仓单" name="LadingBillId">
                 <a-select
@@ -122,14 +122,14 @@
             </a-col>
             <a-col :span="12">&nbsp;</a-col>
           </a-row>
-          <a-col :span="24" v-if="isFloat()">
+          <a-col :span="24" v-if="getListingMode(ListingMode.float)">
             <a-form-item label="估算价" name="PriceMove">
               <span class="white">{{ getPrice() }}</span>
             </a-form-item>
           </a-col>
           <a-row :gutter="24">
             <a-col :span="24" class="mt-20">
-              <a-form-item :label="isFloat() ? '估算金额' : '摘牌金额'">
+              <a-form-item :label="getListingMode(ListingMode.float) ? '估算金额' : '摘牌金额'">
                 <span class="white ml8">{{ getMoney() }}</span>
               </a-form-item>
             </a-col>
@@ -181,7 +181,7 @@
     :is="componentId"
     v-if="componentId"
     :selectedRow="selectedRow"
-    :isFloat="isFloat()"
+    :isFloat="getListingMode(ListingMode.float)"
     @update="choose"
     @cancel="closeComponent"
   ></component>
@@ -211,6 +211,8 @@ import moment from 'moment';
 import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { HdWRDealOrder } from '@/services/proto/warehousetrade';
 import { getQuoteDayInfoByCodeFindPrice } from '@/services/bus/goods';
+import { getAuctionwrType, getListingMode } from '@/views/market/market-spot/setup'
+import { TradeMode, ListingMode, AuctionwrType } from '@/common/constants/enumCommon';
 
 export default defineComponent({
   name: ModalEnum.spot_trade_warehouse_delisting,
@@ -247,8 +249,7 @@ export default defineComponent({
       return accountList.find((e) => e.accountid === formState.accountid);
     }
     const loading = ref<boolean>(false);
-    // 判断
-    const { isWR, isBuy, isFloat } = handleIs(props.enumName, props.buyOrSell);
+    const isBuy = () => props.buyOrSell === BuyOrSell.buy
     // 现货仓单
     const { wrHoldList } = handleSpotWarrant(props.enumName, props.buyOrSell, props.parantSelectedRow, loading);
     getWrPosition(props.enumName, props.buyOrSell, loading);
@@ -299,7 +300,7 @@ export default defineComponent({
           WRFactorTypeId: props.parantSelectedRow.wrfactortypeid, // uint64 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写
           TradeDate: moment().format('YYYYMMDD'), // string 交易日
           DeliveryMonth: '', // string 交收月
-          HasWr: isWR(), // uint32 是否有仓单-0:没有仓单 1:有仓单
+          HasWr: getAuctionwrType(AuctionwrType.noWr) ? 0 : 1, // uint32 是否有仓单-0:没有仓单 1:有仓单
           IsFinancing: 1, // uint32 是否融资购买(买摘牌时有效)-0:否 1:是
           ProductDetailID: res.caseId, // uint64 金融机构产品组合ID(融资购买时有效)
         };
@@ -332,8 +333,6 @@ export default defineComponent({
       getMoney,
       getMargin,
       isBuy,
-      isFloat,
-      isWR,
       rules,
       formState,
       formRef,
@@ -345,6 +344,7 @@ export default defineComponent({
       getCanUseMoney,
       getSelectedAccount,
       getPrice,
+      getAuctionwrType, getListingMode, ListingMode, AuctionwrType
     };
   },
 });

+ 40 - 38
src/views/market/market-spot/components/buy-sell-market/components/sell/index.vue

@@ -1,33 +1,35 @@
 <template>
-  <!-- 现货贸易 - 买卖大厅 - 买报价牌 -->
-  <a-table :columns="handleColumn(columns)"
-           :class="['sellHallTable', isBottom ? '' : 'sellHallTableHigh', tableList.length ? '' : 'noDataTable']"
-           :scroll="{ x: '100%', y: isBottom ? 'calc(100vh- 378px)' : 'calc(100vh - 135px)' }"
-           :pagination="false"
-           :loading="loading"
-           :expandedRowKeys="expandedRowKeys"
-           :customRow="Rowclick"
-           :expandIcon="expandIcon"
-           :expandIconAsCell="false"
-           rowKey="key"
-           :data-source="tableList">
-    <!-- 额外的展开行 -->
-    <template #expandedRowRender="{ record }">
-      <BtnList :btnList="btnList"
-               :record="record"
-               @click="openComponent" />
-    </template>
-    <template #username="{text, record }">
-      <span>{{record.userid + " " }}{{text}}</span>
-    </template>
-  </a-table>
-  <component :is="componentId"
-             v-if="componentId"
-             :selectedRow="selectedRow"
-             :enumName="enumName"
-             :buyOrSell="BuyOrSell.sell"
-             :parantSelectedRow="parantSelectedRow"
-             @cancel="closeComponent"></component>
+    <!-- 现货贸易 - 买卖大厅 - 买报价牌 -->
+    <a-table
+        :columns="handleColumn(columns)"
+        :class="['sellHallTable', isBottom ? '' : 'sellHallTableHigh', tableList.length ? '' : 'noDataTable']"
+        :scroll="{ x: '100%', y: isBottom ? 'calc(100vh- 378px)' : 'calc(100vh - 135px)' }"
+        :pagination="false"
+        :loading="loading"
+        :expandedRowKeys="expandedRowKeys"
+        :customRow="Rowclick"
+        :expandIcon="expandIcon"
+        :expandIconAsCell="false"
+        rowKey="key"
+        :data-source="tableList"
+    >
+        <!-- 额外的展开行 -->
+        <template #expandedRowRender="{ record }">
+            <BtnList :btnList="buttonList" :record="record" @click="openComponent" />
+        </template>
+        <template #username="{ text, record }">
+            <span>{{ record.userid + " " }}{{ text }}</span>
+        </template>
+    </a-table>
+    <component
+        :is="componentId"
+        v-if="componentId"
+        :selectedRow="selectedRow"
+        :enumName="enumName"
+        :buyOrSell="BuyOrSell.sell"
+        :parantSelectedRow="parantSelectedRow"
+        @cancel="closeComponent"
+    ></component>
 </template>
 
 <script lang="ts">
@@ -69,21 +71,20 @@ export default defineComponent({
     },
     components: {
         BtnList,
-        warehouse_receipt_trade_price_spot_trade_warehouse_delisting_sell: defineAsyncComponent(() => import('../delisting/index.vue')),
-        warehouse_receipt_trade_floating_price_spot_trade_warehouse_delisting_sell: defineAsyncComponent(() => import('../delisting/index.vue')),
-        warehouse_pre_sale_price_spot_trade_warehouse_delisting_sell: defineAsyncComponent(() => import('../delisting/index.vue')),
-        warehouse_pre_sale_floating_price_spot_trade_warehouse_delisting_sell: defineAsyncComponent(() => import('../delisting/index.vue')),
-        warehouse_receipt_trade_price_spot_trade_warehouse_financing_delisting_sell: defineAsyncComponent(() => import('../financing_delisting/index.vue')),
-        warehouse_receipt_trade_floating_price_spot_trade_warehouse_financing_delisting: defineAsyncComponent(() => import('../financing_delisting/index.vue')),
-        warehouse_pre_sale_price_spot_spot_trade_warehouse_financing_delisting: defineAsyncComponent(() => import('../financing_delisting/index.vue')),
-        warehouse_pre_sale_floating_price_spot_trade_warehouse_financing_delisting: defineAsyncComponent(() => import('../financing_delisting/index.vue')),
+        delisting: defineAsyncComponent(() => import('../delisting/index.vue')),
+        financing_delisting: defineAsyncComponent(() => import('../financing_delisting/index.vue')),
     },
     setup(props, context) {
         const isBottom = getShowBottomValue();
-        console.log(isBottom.value, 'isBottom');
         // 表格列表数据
         const { loading, tableList, queryTable } = queryTableList<WrOrderQuoteDetail>();
 
+        // 后期区分 不同市场 添加判断 是否有融资摘牌
+        const buttonList: BtnListType[] = [
+            { lable: '摘牌', code: 'delisting', className: 'operBtn' },
+            { lable: '融资摘牌', code: 'financing_delisting', className: 'operBtn' },
+        ]
+
         const { wrpricetype, haswr, tableKey } = getSellMarketParam(props.enumName);
         // 获取列表数据
         const queryTableAction = () => {
@@ -128,6 +129,7 @@ export default defineComponent({
             enumName: props.enumName,
             expandIcon,
             handleColumn,
+            buttonList,
         };
     },
 });

+ 25 - 42
src/views/market/market-spot/components/buy-sell-market/index.vue

@@ -19,7 +19,7 @@
         <div class="name">{{ selectedRow.warehousename }}</div>
         <div class="arrowRightIcon"></div>
       </div>
-      <div class="titleBtn titleBtn3" v-if="!isWR(enumName)">
+      <div class="titleBtn titleBtn3" v-if="getAuctionwrType(AuctionwrType.noWr)">
         <div class="arrowLeftIcon"></div>
         <div class="name">
           <a-month-picker
@@ -34,7 +34,7 @@
 
       <div class="priceBar bdf1 ml20">
         <div class="greenBar green">
-          <div class="numBlock" v-if="isFloat()">
+          <div class="numBlock" v-if="getListingMode(ListingMode.float)">
             <div class="first">卖基差</div>
             <div class="last">{{ selectedRow.sellpricemove }}</div>
           </div>
@@ -48,7 +48,7 @@
           </div>
         </div>
         <div class="redBar red">
-          <div class="numBlock" v-if="isFloat()">
+          <div class="numBlock" v-if="getListingMode(ListingMode.float)">
             <div class="first">买基差</div>
             <div class="last">{{ selectedRow.buypricemove }}</div>
           </div>
@@ -62,7 +62,11 @@
           </div>
         </div>
       </div>
-      <a-button class="market" v-if="isFloat()" @click="openComponent({ code: 'GoodsChart' })">
+      <a-button
+        class="market"
+        v-if="getListingMode(ListingMode.float)"
+        @click="openComponent({ code: 'GoodsChart' })"
+      >
         <div class="first">{{ selectedRow.goodscode }}</div>
         <div class="last red">{{ getGoodsPrice() }}</div>
         <LineChartOutlined />
@@ -75,23 +79,11 @@
       <BtnList :btnList="firstBtn" :record="selectedRow" @click="openComponent" />
     </div>
     <a-row class="buySellHall">
-      <a-col :span="12" v-if="sellMarket.isMarket">
-        <Sell
-          :enumName="enumName"
-          ref="sellRef"
-          :parantSelectedRow="selectedRow"
-          :time="time"
-          :btnList="handleBtnList(sellMarket.btnList)"
-        />
+      <a-col :span="12">
+        <Sell :enumName="enumName" ref="sellRef" :parantSelectedRow="selectedRow" :time="time" />
       </a-col>
-      <a-col :span="12" v-if="buyMarket.isMarket">
-        <Buy
-          :enumName="enumName"
-          ref="buyRef"
-          :time="time"
-          :parantSelectedRow="selectedRow"
-          :btnList="handleBtnList(buyMarket.btnList)"
-        />
+      <a-col :span="12">
+        <Buy :enumName="enumName" ref="buyRef" :time="time" :parantSelectedRow="selectedRow" />
       </a-col>
     </a-row>
     <component
@@ -129,6 +121,8 @@ import moment, { Moment } from 'moment';
 import { BuyOrSell } from '@/common/constants/enumCommon';
 import { QueryQuoteDayRsp } from '@/services/go/quote/interface';
 import { OperationTabMenu } from '@/services/go/commonService/interface';
+import { getAuctionwrType, getListingMode } from '@/views/market/market-spot/setup'
+import { TradeMode, ListingMode, AuctionwrType } from '@/common/constants/enumCommon';
 
 export default defineComponent({
   emits: ['cancel', 'update'],
@@ -150,16 +144,9 @@ export default defineComponent({
     LeftOutlined,
     DownOutlined,
     LineChartOutlined,
-    warehouse_receipt_trade_floating_price_spot_trade_warehouse_detail: defineAsyncComponent(() => import('../detail/index.vue')),
-    warehouse_receipt_trade_price_spot_trade_warehouse_detail: defineAsyncComponent(() => import('../detail/index.vue')),
-    warehouse_pre_sale_price_spot_trade_warehouse_detail: defineAsyncComponent(() => import('../detail/index.vue')),
-    warehouse_pre_sale_floating_price_spot_trade_warehouse_detail: defineAsyncComponent(() => import('../detail/index.vue')),
-
-    warehouse_receipt_trade_floating_price_spot_trade_warehouse_post_buying: defineAsyncComponent(() => import('../post_buying/index.vue')),
-    warehouse_receipt_trade_price_spot_trade_warehouse_post_buying: defineAsyncComponent(() => import('../post_buying/index.vue')),
-    warehouse_pre_sale_price_spot_trade_warehouse_post_buying: defineAsyncComponent(() => import('../post_buying/index.vue')),
-    warehouse_pre_sale_floating_price_spot_trade_warehouse_post_buying: defineAsyncComponent(() => import('../post_buying/index.vue')),
 
+    detail: defineAsyncComponent(() => import('../detail/index.vue')),
+    post_buying: defineAsyncComponent(() => import('../post_buying/index.vue')),
     HisChart: defineAsyncComponent(() => import('../history-chart/index.vue')),
     GoodsChart: defineAsyncComponent(() => import('../goods-chart/index.vue')), // 待优化
   },
@@ -168,13 +155,10 @@ export default defineComponent({
     const loading = ref<boolean>(false);
     const { visible, cancel } = _closeModal(context);
 
-    const { isWR, isFloat } = handleIs(props.enumName, BuyOrSell.buy);
-    // 买卖大厅 配置数据
-    // 表格操作按钮列表
-    // const { firstBtn, buyMarket, sellMarket } = handleSpotBtnList(props.enumName);
-    const firstBtn: OperationTabMenu[] = []
-    const buyMarket: OperationTabMenu[] = []
-    const sellMarket: OperationTabMenu[] = []
+    const firstBtn: BtnListType[] = [
+      { lable: '详情', code: 'detail', className: 'operBtn' },
+      { lable: '挂牌求购', code: 'post_buying', className: 'operBtn' },
+    ]
 
     // 获取浮动价商品实时价格
 
@@ -184,7 +168,7 @@ export default defineComponent({
       return result;
     }
     const uuid = v4();
-    if (isFloat()) {
+    if (getListingMode(ListingMode.float)) {
       // 如果是浮动价需要行情订阅
       const arr = [{ exchangeCode: 250, goodsCode: props.selectedRow.goodscode, subState: 0 }];
       addSubscribeQuotation(uuid, arr);
@@ -244,18 +228,17 @@ export default defineComponent({
       buyRef,
       sellRef,
       cancel,
-      isFloat,
+      getListingMode,
       getGoodsPrice,
       visible,
       firstBtn,
-      buyMarket,
-      sellMarket,
       componentId,
       closeComponent,
       openComponent,
       enumName: props.enumName,
-      handleBtnList,
-      isWR,
+      getAuctionwrType,
+      AuctionwrType,
+      ListingMode,
       timeChange,
       getSelectedRow,
     };

+ 6 - 8
src/views/market/market-spot/components/buy-sell-market/setup.ts

@@ -1,4 +1,4 @@
-import { BuyOrSell } from '@/common/constants/enumCommon';
+import { AuctionwrType, BuyOrSell, ListingMode } from '@/common/constants/enumCommon';
 import { EnumRouterName } from '@/common/constants/enumRouterName';
 import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { TableKey } from '@/common/methods/table/interface';
@@ -6,6 +6,7 @@ import { getTableColumns, getTableEvent, queryTableList } from "@/common/setup/t
 import { queryFaProductDetail } from '@/services/go/wrtrade';
 import { WrFAProductDetail } from "@/services/go/wrtrade/interface";
 import { Ref, ref } from 'vue';
+import { marketTradeType } from '../../setup';
 
 
 export function handleBuyAndSellList<T>(menuType: EnumRouterName, isDetail: boolean, tableName: keyof TableKey) {
@@ -79,16 +80,14 @@ export function getSellMarketParam(enumName: EnumRouterName) {
 }
 
 export function handleIs(enumName: EnumRouterName, buyOrSell: BuyOrSell) {
+    const arr = marketTradeType.value.split('.')
+
     /**
      *
      * @returns 1 => 仓单贸易; 0 => 仓单预售
      */
     function isWR(): 0 | 1 {
-        if (enumName === EnumRouterName.warehouse_receipt_trade_price || enumName === EnumRouterName.warehouse_receipt_trade_floating_price || enumName === EnumRouterName.warehouse_receipt_trade_blocs) {
-            return 1
-        } else {
-            return 0
-        }
+        return +arr[1] === AuctionwrType.hasWr ? 1 : 0
     }
     /**
      *
@@ -102,8 +101,7 @@ export function handleIs(enumName: EnumRouterName, buyOrSell: BuyOrSell) {
      * @returns  true => 浮动价; false =>一口价
      */
     function isFloat() {
-        return enumName === EnumRouterName.warehouse_receipt_trade_floating_price ||
-            enumName === EnumRouterName.warehouse_pre_sale_floating_price
+        return +arr[2] === ListingMode.float
     }
     return { isWR, isBuy, isFloat }
 }

+ 2 - 0
src/views/market/market-spot/index.vue

@@ -17,6 +17,7 @@ import { initData } from '@/common/methods';
 import APP from '@/services';
 import { TjmdMarketSection, TjmdMarketSectionConfig } from '@/services/go/Tjmd/interface';
 import { ref } from 'vue';
+import { setMarketId } from './setup'
 
 export default defineComponent({
   components: {
@@ -74,6 +75,7 @@ export default defineComponent({
       } else {
         componentId.value = value.trademode.toString()
       }
+      setMarketId(componentId.value)
       selctedMarket.value = value
     }
 

+ 24 - 0
src/views/market/market-spot/setup.ts

@@ -1,6 +1,7 @@
 import { BtnListType } from '@/common/components/btnList/interface';
 import { ContextMenuTemp } from '@/common/components/contextMenu/interface';
 import { handleContextMenu } from '@/common/components/contextMenu/setup';
+import { AuctionwrType, ListingMode } from '@/common/constants/enumCommon';
 import { EnumRouterName } from '@/common/constants/enumRouterName';
 import { ComposeTableParam } from '@/common/export/commonTable';
 import { initData } from '@/common/methods';
@@ -15,6 +16,29 @@ import { BuyAndSellMarket, TreeDataItem } from './interface';
 
 const buyAndSellEunm = 'buyAndSell'
 
+// 动态市场 具体显示的市场
+export const marketTradeType = ref<string>('')
+
+export function setMarketId(value: string) {
+    marketTradeType.value = value
+}
+
+function getType() {
+    return marketTradeType.value.split('.')
+}
+
+// 判断 仓单类型
+export function getAuctionwrType(type: AuctionwrType) {
+    const arr = getType()
+    return type === +arr[1]
+}
+
+// 判断 挂牌方式
+export function getListingMode(mode: ListingMode) {
+    const arr = getType()
+    return mode === +arr[2]
+}
+
 export function handleSpotBtnList(menuType: EnumRouterName) {
     const firstBtn: BtnListType[] = []
     // 买大厅数据