huangbin 4 years ago
parent
commit
eba8370a7b

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

@@ -24,10 +24,11 @@ import { ComposeTableParam, BtnList, defineComponent, handleComposeTable, ModalE
 import { _closeModal } from '@/common/setup/modal/modal';
 import { queryAgreementConfig } from '@/services/go/ermcp/qhj';
 import { queryOrderQuoteDetail } from '@/services/go/wrtrade';
-import { QueryOrderQuoteDetailReq, WrOrderQuoteDetail } from '@/services/go/wrtrade/interface';
+import { QueryOrderQuoteDetailReq, WrOrderQuote, WrOrderQuoteDetail } from '@/services/go/wrtrade/interface';
 import { defineAsyncComponent, PropType, ref } from 'vue';
 import { BtnList as btnListType } from '@/common/components/btnList/interface';
 import { handleModalComponent } from '@/common/setup/asyncComponent';
+import { getWrPriceAndHaswrType } from '../../setup';
 
 export default defineComponent({
     emits: ['cancel', 'openComponent'],
@@ -41,6 +42,10 @@ export default defineComponent({
             default: [],
             type: Array as PropType<btnListType[]>,
         },
+        selectedRow: {
+            type: Object as PropType<WrOrderQuote>,
+            default: {},
+        },
     },
     components: {
         BtnList,
@@ -53,12 +58,15 @@ export default defineComponent({
         }
         // 获取列表数据
         const queryTableAction = () => {
-            // const param: QueryOrderQuoteReq = {
-            //     wrpricetype: 2,
-            //     haswr: 1,
-            // };
-            // queryTable(queryOrderQuote, param);
-            queryTable(queryAgreementConfig);
+            const { wrpricetype, haswr } = getWrPriceAndHaswrType(props.enumName);
+            const param: QueryOrderQuoteDetailReq = {
+                buyorsell: 0,
+                wrpricetype,
+                haswr,
+                wrfactortypeid: props.selectedRow.wrfactortypeid,
+                goodsid: props.selectedRow.goodsid,
+            };
+            queryTable(queryOrderQuoteDetail, param);
         };
         // 表格通用逻辑
         const param: ComposeTableParam = {

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

@@ -7,17 +7,17 @@
         <LeftOutlined />
       </a>
       <div class="titleBtn">
-        <div class="name">螺纹钢</div>
+        <div class="name">{{selectedRow.deliverygoodsname}}</div>
         <div class="arrowRightIcon"></div>
       </div>
       <div class="titleBtn titleBtn2">
         <div class="arrowLeftIcon"></div>
-        <div class="name">12mm-江铜</div>
+        <div class="name">{{selectedRow.wrgoodsname}}</div>
         <div class="arrowRightIcon"></div>
       </div>
       <div class="titleBtn titleBtn3">
         <div class="arrowLeftIcon"></div>
-        <div class="name">华南仓库</div>
+        <div class="name">{{selectedRow.warehousename}}</div>
       </div>
       <div class="green">
         <div class="numBlock">
@@ -55,12 +55,14 @@
              v-if="buyMarket.isMarket">
         <Buy :enumName="enumName"
              @openComponent="openComponent"
+             :selectedRow="selectedRow"
              :btnList="buyMarket.btnList" />
       </a-col>
       <a-col :span="12"
              v-if="sellMarket.isMarket">
         <Sell :enumName="enumName"
               @openComponent="openComponent"
+              :selectedRow="selectedRow"
               :btnList="sellMarket.btnList" />
       </a-col>
     </a-row>
@@ -76,7 +78,7 @@ import { EnumRouterName } from '@/common/constants/enumRouterName';
 import { ComposeTableParam, defineAsyncComponent, defineComponent, BtnList, handleComposeTable, ModalEnum, queryTableList } from '@/common/export/commonTable';
 import { _closeModal } from '@/common/setup/modal/modal';
 import { queryOrderQuoteDetail } from '@/services/go/wrtrade';
-import { QueryOrderQuoteDetailReq, WrOrderQuoteDetail } from '@/services/go/wrtrade/interface';
+import { QueryOrderQuoteDetailReq, WrOrderQuote, WrOrderQuoteDetail } from '@/services/go/wrtrade/interface';
 import { LeftOutlined } from '@ant-design/icons-vue';
 import { handleBuyAndSellList } from './setup';
 import Buy from './components/buy/index.vue';
@@ -92,7 +94,7 @@ export default defineComponent({
     name: 'buy-sell-market',
     props: {
         selectedRow: {
-            type: Object as PropType<any>,
+            type: Object as PropType<WrOrderQuote>,
             default: {},
         },
         enumName: {

+ 31 - 0
src/views/market/spot_trade/components/buy-sell-market/setup.ts

@@ -16,3 +16,34 @@ export function handleBuyAndSellList<T>(menuType: EnumRouterName, isDetail: bool
         loading, tableList, columns, expandedRowKeys, selectedRow, Rowclick, queryTable
     }
 }
+
+// 获取 wrpricetype, haswr
+export function getWrPriceAndHaswrType(enumName: EnumRouterName) {
+    let wrpricetype = 1, haswr = 0;
+    switch (enumName) {
+        case EnumRouterName.warehouse_receipt_trade_price:
+            wrpricetype = 1;
+            haswr = 1
+            break
+        case EnumRouterName.warehouse_receipt_trade_floating_price:
+            wrpricetype = 2;
+            haswr = 1
+            break
+        case EnumRouterName.warehouse_pre_sale_price:
+            wrpricetype = 1;
+            haswr = 0
+            break
+        case EnumRouterName.warehouse_pre_sale_floating_price:
+            wrpricetype = 2;
+            haswr = 0
+            break
+    }
+    return { wrpricetype, haswr }
+}
+
+export function getBuyMarketTableKey(enumName: EnumRouterName) {
+    const result = 'table_pcweb_spot_trade_warehouse_price_trading_hall_buy'
+    // switch(enumName) {
+    //     case
+    // }
+}