Handy_Cao 1 rok pred
rodič
commit
4ce0334f8e

+ 4 - 4
public/config/columns.json

@@ -52,6 +52,10 @@
                 "label": "position.goods.buyorsell"
             },
             {
+                "field": "enableqty",
+                "label": "position.goods.holddetail.enableqty"
+            },
+            {
                 "field": "holderqty",
                 "label": "position.goods.holddetail.holderqty"
             },
@@ -60,10 +64,6 @@
                 "label": "position.goods.holddetail.freezeqty"
             },
             {
-                "field": "enableqty",
-                "label": "position.goods.holddetail.enableqty"
-            },
-            {
                 "field": "holderprice",
                 "label": "position.goods.holddetail.holderprice"
             },

+ 12 - 11
src/packages/pc/views/footer/pricing/detail2/components/transfer/index.vue

@@ -102,23 +102,24 @@ const maxQty = computed(() => {
 
 // 损益
 const closepl = computed(() => {
-    const { presettle = 0, last = 0 } = quote.value ?? {}
-    const { agreeUnit } = props.selectedRow
+    const quote = futuresStore.getGoodsQuote(props.selectedRow.tHDetailEx.goodsID)
+    const { ask = 0, bid = 0, agreeunit = 0 } = quote.value ?? {}
+    const price = props.selectedRow.tHDetailEx.buyOrSell === BuyOrSell.Buy ? bid : ask // 根据方向取买卖价
+
     const { holderQty, holderAmount, buyOrSell } = props.selectedRow.tHDetailEx
-    const goods = futuresStore.getGoods(props.selectedRow.goodsCode)
-    const { currencyid } = goods ?? {}
-    const { currencyid: tacurrencyid } = accountStore.currentAccount
-    const price = last || presettle // 没有最新价取昨结价
+    // const goods = futuresStore.getGoods(props.selectedRow.goodsCode)
+    // const { currencyid } = goods ?? {}
+    // const { currencyid: tacurrencyid } = accountStore.currentAccount
     
     // 查找汇率
     let exchangerate = 1
-    if (currencyid !== tacurrencyid) {
-        const currency = userStore.userData.exchangeRateConfigs.find((e) => e.descurrencyid === tacurrencyid && e.oricurrencyid === currencyid)
-        exchangerate = currency?.exchangerate ?? 0
-    }
+    // if (currencyid !== tacurrencyid) {
+    //     const currency = userStore.userData.exchangeRateConfigs.find((e) => e.descurrencyid === tacurrencyid && e.oricurrencyid === currencyid)
+    //     exchangerate = currency?.exchangerate ?? 1
+    // }
     
     // 计算市值 = 现价 * 数量 * 合约单位
-    const marketValue = price ? price * holderQty * agreeUnit * exchangerate : 0
+    const marketValue = price ? price * holderQty * agreeunit * exchangerate : 0
     return price ? (marketValue - holderAmount) * (buyOrSell === BuyOrSell.Buy ? 1 : -1) : 0
 })
 

+ 9 - 1
src/packages/pc/views/footer/pricing/detail2/index.vue

@@ -13,9 +13,17 @@
         <template #buyorsell="{ row }">
             {{ getBuyOrSellName(row.tHDetailEx.buyOrSell) }}
         </template>
+         <!-- 可用数量 -->
+         <template #enableqty="{ row }">
+            {{ enableqty(row) + getGoodsUnitName(row.goodsUnitID) }}
+        </template>
         <!-- 持仓数量 -->
         <template #holderqty="{ row }">
-            {{ enableqty(row) + getGoodsUnitName(row.goodsUnitID) }}
+            {{ row.tHDetailEx.holderQty*row.agreeUnit + getGoodsUnitName(row.goodsUnitID) }}
+        </template>
+        <!-- 冻结数量 -->
+        <template #freezeqty="{ row }">
+            {{ row.tHDetailEx.freezeQty*row.agreeUnit + getGoodsUnitName(row.goodsUnitID) }}
         </template>
         <!-- 持仓价格 -->
         <template #holderprice="{ row }">