huangbin 4 vuotta sitten
vanhempi
commit
1d4e977ff0

+ 1 - 0
src/common/constants/enumCommon.ts

@@ -116,6 +116,7 @@ export enum TradeMode {
     Bidding_large = 21, // 受托竞价
     EntrustedBidding = 21, // 受托竞价
     Platinum = 69, // 铂金宝
+    quote99 = 99,
 }
 
 // 协议类型

+ 18 - 0
src/services/bus/goods.ts

@@ -1,6 +1,24 @@
+import { TradeMode } from '@/common/constants/enumCommon';
 import APP from '@/services';
 import { Goods } from '../go/ermcp/goodsInfo/interface';
+import { Goodsgroup } from '../go/useInfo/interface';
+import { getMarketByTradeMode } from './market';
 
 export function getGoodsList(): Goods[] {
     return APP.get('Goods')
+}
+
+export function getAllGoodsGroups(): Goodsgroup[] {
+    return APP.get('goodsgroups')
+}
+
+export function getGoodsGroupsByTradeMode(trademode: TradeMode): Goodsgroup[] {
+    const marketInfo = getMarketByTradeMode(trademode)
+    let result: Goodsgroup[] = []
+    if (marketInfo) {
+        result = getAllGoodsGroups().filter(e => e.marketid === marketInfo.marketid)
+    } else {
+        console.warn(`trademode:${trademode}市场信息不存在`)
+    }
+    return result
 }

+ 3 - 3
src/views/market/spot_trade/components/buy-sell-market/components/buy/index.vue

@@ -44,7 +44,7 @@ export default defineComponent({
             default: [],
             type: Array as PropType<btnListType[]>,
         },
-        selectedRow: {
+        parantSelectedRow: {
             type: Object as PropType<WrOrderQuote>,
             default: {},
         },
@@ -63,8 +63,8 @@ export default defineComponent({
                 buyorsell: 0,
                 wrpricetype,
                 haswr,
-                wrfactortypeid: props.selectedRow.wrfactortypeid,
-                goodsid: props.selectedRow.goodsid,
+                wrfactortypeid: props.parantSelectedRow.wrfactortypeid,
+                goodsid: props.parantSelectedRow.goodsid,
             };
             queryTable(queryOrderQuoteDetail, param);
         };

+ 3 - 3
src/views/market/spot_trade/components/buy-sell-market/components/sell/index.vue

@@ -45,7 +45,7 @@ export default defineComponent({
             default: [],
             type: Array as PropType<btnListType[]>,
         },
-        selectedRow: {
+        parantSelectedRow: {
             type: Object as PropType<WrOrderQuote>,
             default: {},
         },
@@ -65,8 +65,8 @@ export default defineComponent({
                 buyorsell: 1,
                 wrpricetype,
                 haswr,
-                wrfactortypeid: props.selectedRow.wrfactortypeid,
-                goodsid: props.selectedRow.goodsid,
+                wrfactortypeid: props.parantSelectedRow.wrfactortypeid,
+                goodsid: props.parantSelectedRow.goodsid,
             };
             queryTable(queryOrderQuoteDetail, param);
         };

+ 2 - 2
src/views/market/spot_trade/components/buy-sell-market/index.vue

@@ -54,13 +54,13 @@
       <a-col :span="12"
              v-if="buyMarket.isMarket">
         <Buy :enumName="enumName"
-             :selectedRow="selectedRow"
+             :parantSelectedRow="selectedRow"
              :btnList="buyMarket.btnList" />
       </a-col>
       <a-col :span="12"
              v-if="sellMarket.isMarket">
         <Sell :enumName="enumName"
-              :selectedRow="selectedRow"
+              :parantSelectedRow="selectedRow"
               :btnList="sellMarket.btnList" />
       </a-col>
     </a-row>

+ 11 - 2
src/views/order/spot_warran/components/spot_warrant_spot_details/components/listing/index.vue

@@ -97,7 +97,13 @@
                 </a-select> -->
                 <a-select class="inlineFormSelect ml5"
                           style="width: 135px"
-                          placeholder="请选择商品"></a-select>
+                          placeholder="请选择商品">
+                  <a-select-option v-for="item in goodsGroup"
+                                   :value="item.goodsgroupid"
+                                   :key="item.goodsgroupid">
+                    {{item.goodsgroupname}}
+                  </a-select-option>
+                </a-select>
                 <a-select class="inlineFormSelect ml5"
                           style="width: 135px"
                           placeholder="请选择合约"></a-select>
@@ -139,6 +145,8 @@ import { validateAction } from '@/common/setup/form';
 import { ListingForm } from './interface';
 import { getMarketRunByTradeMode } from '@/services/bus/market';
 import { message } from 'ant-design-vue';
+import { getGoodsGroupsByTradeMode } from '@/services/bus/goods';
+import { TradeMode } from '@/common/constants/enumCommon';
 
 export default defineComponent({
     name: ModalEnum.spot_warrant_spot_details_listed,
@@ -156,7 +164,7 @@ export default defineComponent({
         const { rules, formState, formRef } = handlePasswordForm(props.selectedRow);
         const data = props.selectedRow;
         const loading = ref<boolean>(false);
-
+        const goodsGroup = getGoodsGroupsByTradeMode(TradeMode.quote99);
         function submit() {
             const marketInfo = getMarketRunByTradeMode(17);
             if (marketInfo) {
@@ -218,6 +226,7 @@ export default defineComponent({
             rules,
             formState,
             formRef,
+            goodsGroup,
         };
     },
 });