Handy_Cao пре 4 недеља
родитељ
комит
4eee0b21c5

+ 2 - 2
src/packages/digital/views/contract/components/position/detail/market-close/index.vue

@@ -31,7 +31,7 @@ const userStore = useUserStore()
 const onBeforeClose = (action: string) => {
     if (action === 'confirm') {
         fullloading((hideLoading) => {
-            const { marketid, goodsid, holderqty, tradeid, agreeunit, buyorsell } = props.selectedItem ?? {}
+            const { marketid, goodsid, holderqty, freezeqty, tradeid, agreeunit, buyorsell } = props.selectedItem ?? {}
 
             /// 获取对应的市场ID
             formData.Header = { GoodsID: goodsid, MarketID: marketid }
@@ -41,7 +41,7 @@ const onBeforeClose = (action: string) => {
             formData.TimevalidType = EValidType.VALIDTYPE_DR
             formData.OperateType = EOrderOperateType.ORDEROPERATETYPE_HOLDER_CLOSE
             formData.BuildType = EBuildType.BUILDTYPE_CLOSE
-            formData.OrderQty = holderqty / agreeunit // 数量÷合约乘数
+            formData.OrderQty = holderqty-freezeqty // 数量÷合约乘数
             formData.RelatedID = handleRequestBigNumber(tradeid) // 关联单号
             formData.BuyOrSell = buyorsell === BuyOrSell.Buy ? BuyOrSell.Sell : BuyOrSell.Buy // 持仓反方向
             const param112 = userStore.getSystemParamValue('112')

+ 2 - 2
src/packages/digital/views/contract/components/position/list/market-close/index.vue

@@ -30,7 +30,7 @@ const userStore = useUserStore()
 const onBeforeClose = (action: string) => {
     if (action === 'confirm') {
         fullloading((hideLoading) => {
-            const { marketid, goodsid, enableqty, agreeunit, buyorsell } = props.selectedRow ?? {}
+            const { marketid, goodsid, enableqty, buyorsell } = props.selectedRow ?? {}
 
             /// 获取对应的市场ID
             formData.Header = { GoodsID: goodsid, MarketID: marketid }
@@ -40,7 +40,7 @@ const onBeforeClose = (action: string) => {
             formData.TimevalidType = EValidType.VALIDTYPE_DR
             formData.OperateType = EOrderOperateType.ORDEROPERATETYPE_NORMAL
             formData.BuildType = EBuildType.BUILDTYPE_CLOSE
-            formData.OrderQty = enableqty / agreeunit // 数量÷合约乘数
+            formData.OrderQty = enableqty
             formData.BuyOrSell = buyorsell === BuyOrSell.Buy ? BuyOrSell.Sell : BuyOrSell.Buy // 持仓反方向
             const param112 = userStore.getSystemParamValue('112')
             formData.MarketMaxSub = Number(param112) || 100

+ 12 - 1
src/packages/digital/views/contract/goods/list/index.vue

@@ -83,11 +83,12 @@
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, onMounted, computed } from 'vue'
+import { shallowRef, onMounted, computed, onActivated, onUnmounted } from 'vue'
 import { Search, Tab, Tabs, Image, Empty } from 'vant'
 import { useNavigation } from '@mobile/router/navigation'
 import { parsePercent, handleNumberValue, getFirstImage } from '@/filters'
 import { useFuturesStore, useUserStore } from '@/stores'
+import quoteSocket from '@/services/websocket/quote'
 
 const { router } = useNavigation()
 const userStore = useUserStore()
@@ -107,10 +108,20 @@ const rowClick = (row: Model.GoodsQuote) => {
     })
 }
 
+const subscribe = quoteSocket.createSubscribe()
+
+onActivated(() =>  {
+    const goodsCodes = goodsList.value.map((e) => e.goodscode.toUpperCase())
+    subscribe.start(...goodsCodes)
+})
+
 onMounted(() => {
     const [firstGroup] = goodsGroups
     currentGroupId.value = firstGroup ? firstGroup.goodsgroupid : 0
 })
+
+onUnmounted(() => subscribe.stop())
+
 </script>
 
 <style lang="less">