|
|
@@ -13,13 +13,13 @@
|
|
|
<span>{{ formatDecimal(selectedRow.curholderamount) }}</span>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="持仓数量">
|
|
|
- <span>{{ formatDecimal(selectedRow.curpositionqty) }}</span>
|
|
|
+ <span>{{ selectedRow.curpositionqty }}</span>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="冻结数量">
|
|
|
- <span>{{ formatDecimal(selectedRow.frozenqty) }}</span>
|
|
|
+ <span>{{ selectedRow.frozenqty }}</span>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="可用数量">
|
|
|
- <span>{{ formatDecimal(selectedRow.enableqty) }}</span>
|
|
|
+ <span>{{ selectedRow.enableqty }}</span>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="持仓均价">
|
|
|
<span>{{ formatDecimal(selectedRow.averageprice) }}</span>
|
|
|
@@ -28,8 +28,15 @@
|
|
|
<span :class="handlePriceColor(closepl, 0)">{{ formatDecimal(closepl) }}</span>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="OrderQty" label="转让数量">
|
|
|
- <el-input-number placeholder="请输入数量" v-model="formData.OrderQty" :precision="0" :max="selectedRow.enableqty"
|
|
|
- :min="0" />
|
|
|
+ <div class="g-qty-group">
|
|
|
+ <el-input-number placeholder="请输入数量" v-model="formData.OrderQty" :precision="0"
|
|
|
+ :max="selectedRow.enableqty" :min="0" />
|
|
|
+ <el-radio-group size="small" v-model="qtyStep" @change="onRadioChange">
|
|
|
+ <el-radio v-for="(value, index) in qtyStepList" :key="index" :label="value" border>
|
|
|
+ {{ parsePercent(value, 0) }}
|
|
|
+ </el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </div>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="OrderPrice" label="转让价格">
|
|
|
<el-input-number placeholder="请输入价格" v-model="formData.OrderPrice"
|
|
|
@@ -47,7 +54,7 @@
|
|
|
import { ref, PropType, computed, onMounted } from 'vue'
|
|
|
import { ElMessage, FormInstance, FormRules } from 'element-plus'
|
|
|
import { useOrder } from '@/business/trade'
|
|
|
-import { formatDecimal, handlePriceColor } from '@/filters'
|
|
|
+import { formatDecimal, handlePriceColor, parsePercent } from '@/filters'
|
|
|
import { getBuyOrSellName, BuyOrSell } from '@/constants/order'
|
|
|
import { useFuturesStore } from '@/stores'
|
|
|
import { EBuildType, EDelistingType, EListingSelectType, EOrderOperateType, EPriceMode, EValidType } from '@/constants/client'
|
|
|
@@ -73,6 +80,8 @@ const { formSubmit, formData, loading } = useOrder()
|
|
|
const show = ref(true)
|
|
|
const refresh = ref(false)
|
|
|
const formRef = ref<FormInstance>()
|
|
|
+const qtyStepList = [0.25, 0.75, 1] // 数量步长列表
|
|
|
+const qtyStep = ref<number>() // 数量步长
|
|
|
|
|
|
const formRules: FormRules = {
|
|
|
OrderPrice: [{
|
|
|
@@ -116,6 +125,10 @@ const onCloseSumit = () => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+const onRadioChange = (value: number) => {
|
|
|
+ formData.OrderQty = Math.trunc(props.selectedRow.enableqty * value)
|
|
|
+}
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
const { bid, ask, presettle = 0 } = quote.value ?? {}
|
|
|
switch (props.selectedRow.buyorsell) {
|
|
|
@@ -128,5 +141,6 @@ onMounted(() => {
|
|
|
default:
|
|
|
formData.OrderPrice = presettle
|
|
|
}
|
|
|
+ formData.OrderQty = props.selectedRow.enableqty
|
|
|
})
|
|
|
</script>
|