li.shaoyi há 3 semanas atrás
pai
commit
c589c30590

+ 5 - 34
src/packages/digital/views/contract/components/position/list/tpsl/index.vue

@@ -5,7 +5,7 @@
             <template #header>
                 <app-navbar title="汇总平仓" @back="closed" />
             </template>
-            <Form ref="formRef" class="g-form__container" @submit="onCloseSumit">
+            <Form ref="formRef" class="g-form__container" @submit="onSubmit">
                 <CellGroup title="持仓信息" inset>
                     <Cell title="代码/名称" :value="`${selectedRow.goodscode}/${selectedRow.goodsname}`" />
                     <Cell title="持仓方向" :value="getBuyOrSellName(selectedRow.buyorsell, 1)" />
@@ -70,8 +70,8 @@ import { CellGroup, Cell, Button, FieldRule, Form, Field, FormInstance, Checkbox
 import { dialog, fullloading } from '@/utils/vant'
 import { getBuyOrSellName, getGoodsCurrencyItemName, BuyOrSell } from '@/constants/order'
 import { useOrder } from '@/business/trade'
-import { useFuturesStore, useUserStore } from '@/stores'
-import { EBuildType, EDelistingType, EOrderOperateType, EListingSelectType, EPriceMode, EValidType } from '@/constants/client'
+import { useFuturesStore } from '@/stores'
+import { EPriceMode } from '@/constants/client'
 import AppModal from '@/components/base/modal/index.vue'
 import AppStepper from '@mobile/components/base/stepper/index.vue'
 
@@ -87,7 +87,6 @@ const props = defineProps({
     }
 })
 
-const userStore = useUserStore()
 const futuresStore = useFuturesStore()
 const formRef = shallowRef<FormInstance>()
 const showModal = shallowRef(true)
@@ -147,36 +146,8 @@ const formRules: { [key: string]: FieldRule[] } = {
     }],
 }
 
-const onCloseSumit = () => {
-    dialog({
-        message: '确认要平仓吗?',
-        showCancelButton: true,
-    }).then(() => {
-
-        const { marketid, goodsid, buyorsell } = props.selectedRow
-        /// 市场ID
-        formData.Header = { GoodsID: goodsid }
-        formData.MarketID = marketid
-        formData.BuyOrSell = buyorsell === BuyOrSell.Buy ? BuyOrSell.Sell : BuyOrSell.Buy
-        formData.GoodsID = goodsid
-        formData.ListingSelectType = EListingSelectType.LISTINGSELECTTYPE_DELISTINGTHENLISTING
-        formData.DelistingType = EDelistingType.DELISTINGTYPE_PRICE
-        formData.BuildType = EBuildType.BUILDTYPE_CLOSE
-        formData.TimevalidType = EValidType.VALIDTYPE_DR
-        formData.OperateType = EOrderOperateType.ORDEROPERATETYPE_NORMAL
-        const param112 = userStore.getSystemParamValue('112')
-        formData.MarketMaxSub = Number(param112) || 100
-
-        /// loding....
-        fullloading((hideLoading) => {
-            formSubmit().then(() => {
-                hideLoading('提交成功', 'success')
-                closed()
-            }).catch((err) => {
-                hideLoading(err, 'fail')
-            })
-        })
-    })
+const onSubmit = () => {
+    console.log('提交成功')
 }
 
 // 关闭弹窗