li.shaoyi 3 years ago
parent
commit
138097af32

+ 4 - 1
src/views/market/futures/compoments/futures-trade/index.vue

@@ -134,6 +134,9 @@ export default defineComponent({
       type: Object as PropType<GoodsQuote & QueryErmcpTradePositionRsp & Ermcp3SellBuyContract & Ermcp3HedgePlan & ErmcpRealExposureModel & Ermcp2HedgedItemRsp>,
       default: () => ({}),
     },
+    accountId: {
+      type: Number,
+    }
   },
   setup(props, context) {
     const { visible, cancel } = _closeModal(context);
@@ -256,7 +259,7 @@ export default defineComponent({
         tmpList = tmpList.filter((e) => e.relateduserid === tradeuserid);
       }
       if (tmpList.length) {
-        formData.AccountID = tmpList[0].accountid;
+        formData.AccountID = props.accountId ?? tmpList[0].accountid;
       }
       return tmpList;
     })

+ 4 - 2
src/views/order/futures_information/components/futures_information_position/index.vue

@@ -12,7 +12,8 @@
       </a-table>
     </template>
   </mtp-table-scroll>
-  <component :is="componentId" v-if="componentId" :selectedRow="selectedRow" @cancel="closeComponent"></component>
+  <component :is="componentId" v-if="componentId" v-bind="{ selectedRow, accountId: tradeAccount?.accountid }"
+    @cancel="closeComponent"></component>
 </template>
 
 <script lang="ts">
@@ -40,7 +41,7 @@ export default defineComponent({
   },
   setup(props) {
     const { auth } = props.parentComponent;
-    const { loading, tradePositionList } = useTradeAccount();
+    const { loading, tradePositionList, tradeAccount } = useTradeAccount();
 
     // 表格通用逻辑
     const param: ComposeOrderTableParam = {
@@ -54,6 +55,7 @@ export default defineComponent({
       expandIcon,
       tradePositionList,
       auth,
+      tradeAccount,
     };
   },
 });