|
|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
- <app-popup :title="'摘牌'" v-model:show="showModal" :refresh="refresh">
|
|
|
- <Form class="swap-delisting__form" ref="formRef" @submit="onSubmit" v-if="props">
|
|
|
+ <app-popup class="g-form" :title="'摘牌'" v-model:show="showModal" :refresh="refresh">
|
|
|
+ <Form class="g-form__container" ref="formRef" @submit="onSubmit" v-if="props">
|
|
|
<Field label="交易账户">
|
|
|
<template #input>
|
|
|
<span>{{ accountStore.currentAccountId }}</span>
|
|
|
@@ -26,7 +26,9 @@
|
|
|
</Field>
|
|
|
<Field label="挂牌价格" v-if="priceMove === 2">
|
|
|
<template #input>
|
|
|
- <span :class="quote?.lastColor">{{ selectedRow.pricemode === 3 ? (selectedRow.marketmaxsub+(quote?.last ?? 0.0)).toFixed(goods?.decimalplace ?? 2.0) : selectedRow.orderprice }}</span>
|
|
|
+ <span :class="quote?.lastColor">{{ selectedRow.pricemode === 3 ? (selectedRow.marketmaxsub +
|
|
|
+ (quote?.last
|
|
|
+ ?? 0.0)).toFixed(goods?.decimalplace ?? 2.0) : selectedRow.orderprice }}</span>
|
|
|
</template>
|
|
|
</Field>
|
|
|
<Field label="挂牌价格" v-if="selectedRow.pricemode === 3">
|
|
|
@@ -42,15 +44,19 @@
|
|
|
<span>{{ selectedRow.orderqty }}</span>
|
|
|
</template>
|
|
|
</Field>
|
|
|
- <el-form-item v-if="priceMode != 1" prop="OrderPrice" :label="selectedRow.buyorsell === 0 ? '卖出价格' : '买入价格'">
|
|
|
- <el-input-number placeholder="请输入" :min="0.0" :step="Math.pow(10, -1*(goods?.decimalplace ?? 0))" :precision="(goods?.decimalplace ?? 2)" v-model="formData.OrderPrice" @change="calculateDelistingAmount"/>
|
|
|
- </el-form-item>
|
|
|
+ <Field v-if="priceMode !== 1" prop="OrderPrice" :label="selectedRow.buyorsell === 0 ? '卖出价格' : '买入价格'">
|
|
|
+ <template #input>
|
|
|
+ <Stepper theme="round" button-size="22" :min="0.0" :step="Math.pow(10, -1 * (goods?.decimalplace ?? 0))"
|
|
|
+ :decimal-length="(goods?.decimalplace ?? 2)" v-model="formData.OrderPrice"
|
|
|
+ @change="calculateDelistingAmount" />
|
|
|
+ </template>
|
|
|
+ </Field>
|
|
|
<Field name="OrderQty" :rules="formRules.OrderQty" label="摘牌数量">
|
|
|
<template #input>
|
|
|
<div class="g-qty-group">
|
|
|
<div class="g-qty-group__stepper">
|
|
|
- <Stepper v-model="formData.OrderQty" theme="round" :max="selectedRow.orderqty" button-size="22" :min="0"
|
|
|
- :step="qtyStep" integer @change="calculateDelistingAmount"/>
|
|
|
+ <Stepper v-model="formData.OrderQty" theme="round" :max="selectedRow.orderqty" button-size="22"
|
|
|
+ :min="0" :step="qtyStep" integer @change="calculateDelistingAmount" />
|
|
|
</div>
|
|
|
<RadioGroup v-model="qtyStep" direction="horizontal" @change="onRadioChange">
|
|
|
<Radio v-for="(value, index) in qtyStepList" :key="index" :name="value">{{ value }}
|
|
|
@@ -76,7 +82,9 @@
|
|
|
</Field>
|
|
|
</Form>
|
|
|
<template #footer>
|
|
|
- <Button type="danger" block round @click="formRef?.submit">{{ selectedRow.buyorsell === 0 ? '卖出' : '买入' }}</Button>
|
|
|
+ <Button type="danger" block round @click="formRef?.submit">
|
|
|
+ {{ selectedRow.buyorsell === 0 ? '卖出' : '买入' }}
|
|
|
+ </Button>
|
|
|
</template>
|
|
|
</app-popup>
|
|
|
</template>
|
|
|
@@ -116,7 +124,7 @@ const refresh = shallowRef(false) // 是否刷新父组件数据
|
|
|
// 数量步长列表
|
|
|
const qtyStepList = [1, 5, 10, 20, 30, 50]
|
|
|
// 数量步长
|
|
|
-const qtyStep = shallowRef(qtyStepList[0])
|
|
|
+const qtyStep = shallowRef(qtyStepList[0])
|
|
|
/// 挂牌金额
|
|
|
const amount = shallowRef(0.0)
|
|
|
/// 履约保证金
|
|
|
@@ -128,7 +136,7 @@ const priceMode = shallowRef(EPriceMode.PRICEMODE_MARKET)
|
|
|
/// 保证金配置
|
|
|
const margin = shallowRef<Model.TjmdTodayAccountMarginRsp>()
|
|
|
/// 商品信息
|
|
|
-const goods = computed(() => futuresStore.getGoods(props.selectedRow.goodsid) )
|
|
|
+const goods = computed(() => futuresStore.getGoods(props.selectedRow.goodsid))
|
|
|
/// 默认价格为挂牌价格
|
|
|
formData.OrderPrice = props.selectedRow.orderprice ?? 0.0
|
|
|
/// 商品价格
|
|
|
@@ -184,23 +192,23 @@ const calculateDelistingAmount = () => {
|
|
|
if (props.selectedRow.pricemode === 3) {
|
|
|
if (MarginAlgorithm === 1) {
|
|
|
/// 价格*数量*合约单位*保证金比例
|
|
|
- permargin.value = ((quote.value?.last ?? 0.0)+(marketmaxsub))*OrderQty*agreeunit*MarketMarginValue
|
|
|
+ permargin.value = ((quote.value?.last ?? 0.0) + (marketmaxsub)) * OrderQty * agreeunit * MarketMarginValue
|
|
|
} else {
|
|
|
/// 数量*保证金值
|
|
|
- permargin.value = OrderQty*MarketMarginValue
|
|
|
+ permargin.value = OrderQty * MarketMarginValue
|
|
|
}
|
|
|
- amount.value = OrderQty*((quote.value?.last ?? 0.0)+(marketmaxsub))*agreeunit
|
|
|
+ amount.value = OrderQty * ((quote.value?.last ?? 0.0) + (marketmaxsub)) * agreeunit
|
|
|
} else {
|
|
|
const { OrderPrice = 0.0 } = formData
|
|
|
/// 按比例
|
|
|
if (MarginAlgorithm === 1) {
|
|
|
/// 价格*数量*合约单位*保证金比例
|
|
|
- permargin.value = OrderPrice*OrderQty*agreeunit*MarketMarginValue
|
|
|
+ permargin.value = OrderPrice * OrderQty * agreeunit * MarketMarginValue
|
|
|
} else {
|
|
|
/// 数量*保证金值
|
|
|
- permargin.value = OrderQty*MarketMarginValue
|
|
|
+ permargin.value = OrderQty * MarketMarginValue
|
|
|
}
|
|
|
- amount.value = OrderQty*OrderPrice*agreeunit
|
|
|
+ amount.value = OrderQty * OrderPrice * agreeunit
|
|
|
}
|
|
|
}
|
|
|
}
|