|
|
@@ -7,40 +7,41 @@
|
|
|
</template>
|
|
|
<Form ref="formRef" class="g-form__container" @submit="onCloseSumit">
|
|
|
<CellGroup title="持仓信息" inset>
|
|
|
- <Cell title="代码/名称" :value="`${selectedRow.goodscode}/${selectedRow.goodsname}`" />
|
|
|
- <Cell title="持仓方向" :value="getBuyOrSellName(selectedRow.buyorsell, 1)" />
|
|
|
- <Cell :title="`持仓价格(${getGoodsCurrencyItemName(selectedRow.currencyid)})`"
|
|
|
+ <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')}(${currency(selectedRow.currencyid)})`"
|
|
|
: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="`行情价格(${currency(selectedRow.currencyid)})`">
|
|
|
<template #value>
|
|
|
<span :class="selectedRow.lastPriceClass">
|
|
|
{{ selectedRow.lastPrice.toFixed(selectedRow.decimalplace) }}
|
|
|
</span>
|
|
|
</template>
|
|
|
</Cell>
|
|
|
- <Cell :title="`浮动盈亏(${getGoodsCurrencyItemName(selectedRow.currencyid)})`">
|
|
|
+ <Cell :title="`${t('position.goods.holddetail.profitLoss')}(${currency(selectedRow.currencyid)})`">
|
|
|
<template #value>
|
|
|
<span :class="selectedRow.profitLossClass">
|
|
|
{{ selectedRow.profitLoss.toFixed(selectedRow.decimalplace) }}
|
|
|
</span>
|
|
|
</template>
|
|
|
</Cell>
|
|
|
- <Field label="价格方式" is-link>
|
|
|
+ <Field :label="t('digital.pricemode')" is-link>
|
|
|
<template #input>
|
|
|
<app-select v-model="formData.PriceMode" :options="getPricemode2List()" />
|
|
|
</template>
|
|
|
</Field>
|
|
|
- <Field label="价格" :rules="formRules.OrderPrice"
|
|
|
+ <Field :label="t('quote.swap.orderprice')" :rules="formRules.OrderPrice"
|
|
|
v-if="formData.PriceMode === EPriceMode.PRICEMODE_LIMIT">
|
|
|
<template #input>
|
|
|
<app-stepper v-model="formData.OrderPrice" :min="0" :decimal-length="quote?.decimalplace"
|
|
|
:step="quote?.decimalvalue" />
|
|
|
</template>
|
|
|
</Field>
|
|
|
- <Cell title="价格" value="最优市价" v-if="formData.PriceMode === EPriceMode.PRICEMODE_MARKET" />
|
|
|
- <Field name="OrderQty" :rules="formRules.OrderQty" label="数量">
|
|
|
+ <Cell :title="t('quote.swap.orderprice')" :value="t('digital.optimal')"
|
|
|
+ v-if="formData.PriceMode === EPriceMode.PRICEMODE_MARKET" />
|
|
|
+ <Field name="OrderQty" :rules="formRules.OrderQty" :label="t('quote.goods.orderqty')">
|
|
|
<template #input>
|
|
|
<app-stepper v-model="formData.OrderQty" min="0.0" :max="selectedRow.enableqty"
|
|
|
:auto-fixed="false" integer />
|
|
|
@@ -88,16 +89,20 @@ const formRef = shallowRef<FormInstance>()
|
|
|
const showModal = shallowRef(true)
|
|
|
const { formSubmit, formData } = useOrder()
|
|
|
|
|
|
+const currency = (id: number) => {
|
|
|
+ return getGoodsCurrencyItemName(id)
|
|
|
+}
|
|
|
+
|
|
|
// 表单验证规则
|
|
|
const formRules: { [key: string]: FieldRule[] } = {
|
|
|
OrderPrice: [{
|
|
|
- message: '请输入价格',
|
|
|
+ message: t('quote.goods.pleaseenterorderprice'),
|
|
|
validator: () => {
|
|
|
return !!formData.OrderPrice
|
|
|
}
|
|
|
}],
|
|
|
OrderQty: [{
|
|
|
- message: '请输入数量',
|
|
|
+ message: t('quote.goods.pleaseenterorderqty'),
|
|
|
validator: () => {
|
|
|
return !!formData.OrderQty
|
|
|
}
|
|
|
@@ -106,7 +111,7 @@ const formRules: { [key: string]: FieldRule[] } = {
|
|
|
|
|
|
const onCloseSumit = () => {
|
|
|
dialog({
|
|
|
- message: '确认要平仓吗?',
|
|
|
+ message: t('position.swap.tips1'),
|
|
|
showCancelButton: true,
|
|
|
}).then(() => {
|
|
|
|
|
|
@@ -127,7 +132,7 @@ const onCloseSumit = () => {
|
|
|
/// loding....
|
|
|
fullloading((hideLoading) => {
|
|
|
formSubmit().then(() => {
|
|
|
- hideLoading('提交成功', 'success')
|
|
|
+ hideLoading(t('common.submitsuccess'), 'success')
|
|
|
closed()
|
|
|
}).catch((err) => {
|
|
|
hideLoading(err, 'fail')
|