|
@@ -5,22 +5,22 @@
|
|
|
<template #header>
|
|
<template #header>
|
|
|
<app-navbar title="汇总平仓" @back="closed" />
|
|
<app-navbar title="汇总平仓" @back="closed" />
|
|
|
</template>
|
|
</template>
|
|
|
- <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)" />
|
|
|
|
|
- <Cell :title="`持仓价格(${getGoodsCurrencyItemName(selectedRow.currencyid)})`"
|
|
|
|
|
|
|
+ <Form ref="formRef" class="g-form__container" @submit="onCloseSumit">
|
|
|
|
|
+ <CellGroup :title="t('position.goods.subtitle')" inset>
|
|
|
|
|
+ <Cell :title="t('digital.goodscode')" :value="`${selectedRow.goodscode}/${selectedRow.goodsname}`" />
|
|
|
|
|
+ <Cell :title="t('position.transfer.buyorsell')" :value="getBuyOrSellName(selectedRow.buyorsell, 1)" />
|
|
|
|
|
+ <Cell :title="`${t('position.goods.holddetail.holderprice')}(${getGoodsCurrencyItemName(selectedRow.currencyid)})`"
|
|
|
:value="selectedRow.averageprice" />
|
|
:value="selectedRow.averageprice" />
|
|
|
- <Cell :title="`持仓量(${selectedRow.goodscode})`" :value="selectedRow.curpositionqty" />
|
|
|
|
|
- <Cell :title="`冻结量(${selectedRow.goodscode})`" :value="selectedRow.frozenqty" />
|
|
|
|
|
- <Cell :title="`行情价格(${getGoodsCurrencyItemName(selectedRow.currencyid)})`">
|
|
|
|
|
|
|
+ <Cell :title="`${t('quote.holdvolume')}(${selectedRow.goodscode})`" :value="selectedRow.curpositionqty" />
|
|
|
|
|
+ <Cell :title="`${t('position.goods.frozenqty')}(${selectedRow.goodscode})`" :value="selectedRow.frozenqty" />
|
|
|
|
|
+ <Cell :title="`${t('digital.quoteprice')}(${getGoodsCurrencyItemName(selectedRow.currencyid)})`">
|
|
|
<template #value>
|
|
<template #value>
|
|
|
<span :class="selectedRow.lastPriceClass">
|
|
<span :class="selectedRow.lastPriceClass">
|
|
|
{{ selectedRow.lastPrice.toFixed(selectedRow.decimalplace) }}
|
|
{{ selectedRow.lastPrice.toFixed(selectedRow.decimalplace) }}
|
|
|
</span>
|
|
</span>
|
|
|
</template>
|
|
</template>
|
|
|
</Cell>
|
|
</Cell>
|
|
|
- <Cell :title="`浮动盈亏(${getGoodsCurrencyItemName(selectedRow.currencyid)})`">
|
|
|
|
|
|
|
+ <Cell :title="`${t('position.goods.holddetail.profitLoss')}(${getGoodsCurrencyItemName(selectedRow.currencyid)})`">
|
|
|
<template #value>
|
|
<template #value>
|
|
|
<span :class="selectedRow.profitLossClass">
|
|
<span :class="selectedRow.profitLossClass">
|
|
|
{{ selectedRow.profitLoss.toFixed(selectedRow.decimalplace) }}
|
|
{{ selectedRow.profitLoss.toFixed(selectedRow.decimalplace) }}
|
|
@@ -28,10 +28,10 @@
|
|
|
</template>
|
|
</template>
|
|
|
</Cell>
|
|
</Cell>
|
|
|
</CellGroup>
|
|
</CellGroup>
|
|
|
- <CellGroup title="止盈止损" inset>
|
|
|
|
|
- <Cell :value="`价格 (>=${pricePoints.takeProfit.toFixed(selectedRow.decimalplace)})`">
|
|
|
|
|
|
|
+ <CellGroup :title="t('digital.spsl')" inset>
|
|
|
|
|
+ <Cell :value="`${t('mine.setting.price')} (>=${pricePoints.takeProfit.toFixed(selectedRow.decimalplace)})`">
|
|
|
<template #title>
|
|
<template #title>
|
|
|
- <Checkbox v-model="formData.TPFlag">止盈</Checkbox>
|
|
|
|
|
|
|
+ <Checkbox v-model="formData.TPFlag">{{ $t('digital.sp') }}</Checkbox>
|
|
|
</template>
|
|
</template>
|
|
|
</Cell>
|
|
</Cell>
|
|
|
<Field name="SpPrice" :rules="formRules.SpPrice">
|
|
<Field name="SpPrice" :rules="formRules.SpPrice">
|
|
@@ -43,9 +43,9 @@
|
|
|
</Field>
|
|
</Field>
|
|
|
</CellGroup>
|
|
</CellGroup>
|
|
|
<CellGroup inset>
|
|
<CellGroup inset>
|
|
|
- <Cell :value="`价格 (>=${pricePoints.stopLoss.toFixed(selectedRow.decimalplace)})`">
|
|
|
|
|
|
|
+ <Cell :value="`${t('mine.setting.price')} (>=${pricePoints.stopLoss.toFixed(selectedRow.decimalplace)})`">
|
|
|
<template #title>
|
|
<template #title>
|
|
|
- <Checkbox v-model="formData.SLFlag">止损</Checkbox>
|
|
|
|
|
|
|
+ <Checkbox v-model="formData.SLFlag">{{ $t('digital.sl') }}</Checkbox>
|
|
|
</template>
|
|
</template>
|
|
|
</Cell>
|
|
</Cell>
|
|
|
<Field name="SlPrice" :rules="formRules.SlPrice">
|
|
<Field name="SlPrice" :rules="formRules.SlPrice">
|
|
@@ -58,7 +58,7 @@
|
|
|
</CellGroup>
|
|
</CellGroup>
|
|
|
</Form>
|
|
</Form>
|
|
|
<div class="g-form__footer inset">
|
|
<div class="g-form__footer inset">
|
|
|
- <Button type="primary" @click="formRef?.submit()" block>提交</Button>
|
|
|
|
|
|
|
+ <Button type="primary" @click="formRef?.submit()" block>{{ $t('operation.submit') }}</Button>
|
|
|
</div>
|
|
</div>
|
|
|
</app-view>
|
|
</app-view>
|
|
|
</app-modal>
|
|
</app-modal>
|
|
@@ -70,8 +70,8 @@ import { CellGroup, Cell, Button, FieldRule, Form, Field, FormInstance, Checkbox
|
|
|
import { dialog, fullloading } from '@/utils/vant'
|
|
import { dialog, fullloading } from '@/utils/vant'
|
|
|
import { getBuyOrSellName, getGoodsCurrencyItemName, BuyOrSell } from '@/constants/order'
|
|
import { getBuyOrSellName, getGoodsCurrencyItemName, BuyOrSell } from '@/constants/order'
|
|
|
import { useOrder } from '@/business/trade'
|
|
import { useOrder } from '@/business/trade'
|
|
|
-import { useFuturesStore } from '@/stores'
|
|
|
|
|
-import { EPriceMode } from '@/constants/client'
|
|
|
|
|
|
|
+import { i18n, useFuturesStore, useUserStore } from '@/stores'
|
|
|
|
|
+import { EBuildType, EDelistingType, EOrderOperateType, EListingSelectType, EPriceMode, EValidType } from '@/constants/client'
|
|
|
import AppModal from '@/components/base/modal/index.vue'
|
|
import AppModal from '@/components/base/modal/index.vue'
|
|
|
import AppStepper from '@mobile/components/base/stepper/index.vue'
|
|
import AppStepper from '@mobile/components/base/stepper/index.vue'
|
|
|
|
|
|
|
@@ -87,6 +87,8 @@ const props = defineProps({
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+const { global: { t } } = i18n
|
|
|
|
|
+const userStore = useUserStore()
|
|
|
const futuresStore = useFuturesStore()
|
|
const futuresStore = useFuturesStore()
|
|
|
const formRef = shallowRef<FormInstance>()
|
|
const formRef = shallowRef<FormInstance>()
|
|
|
const showModal = shallowRef(true)
|
|
const showModal = shallowRef(true)
|
|
@@ -146,8 +148,36 @@ const formRules: { [key: string]: FieldRule[] } = {
|
|
|
}],
|
|
}],
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const onSubmit = () => {
|
|
|
|
|
- console.log('提交成功')
|
|
|
|
|
|
|
+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(t('common.submitsuccess'), 'success')
|
|
|
|
|
+ closed()
|
|
|
|
|
+ }).catch((err) => {
|
|
|
|
|
+ hideLoading(err, 'fail')
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 关闭弹窗
|
|
// 关闭弹窗
|