|
@@ -43,17 +43,18 @@
|
|
|
<el-radio-group size="small" v-model="qtyStep" :validate-event="false" @change="onRadioChange">
|
|
<el-radio-group size="small" v-model="qtyStep" :validate-event="false" @change="onRadioChange">
|
|
|
<el-radio v-for="(value, index) in qtyStepList" :key="index" :label="value" border />
|
|
<el-radio v-for="(value, index) in qtyStepList" :key="index" :label="value" border />
|
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
|
- <div style="line-height: 1;font-size: 12px;color: #7a8a94;" v-if="false">可用资金订立量:{{ enableQty }}</div>
|
|
|
|
|
|
|
+ <div style="line-height: 1;font-size: 12px;color: #7a8a94;" v-if="false">可用资金订立量:{{ enableQty }}
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item class="footer-btnbar">
|
|
<el-form-item class="footer-btnbar">
|
|
|
<template v-if="formData.BuyOrSell === BuyOrSell.Buy">
|
|
<template v-if="formData.BuyOrSell === BuyOrSell.Buy">
|
|
|
<el-button ref="submitRef" type="primary" :loading="loading"
|
|
<el-button ref="submitRef" type="primary" :loading="loading"
|
|
|
:disabled="!selectedGoodsId || !formData.OrderQty"
|
|
:disabled="!selectedGoodsId || !formData.OrderQty"
|
|
|
- @click="onSubmit(EBuildType.BUILDTYPE_OPEN)">订立</el-button>
|
|
|
|
|
|
|
+ @click="onBeforeSubmit(EBuildType.BUILDTYPE_OPEN)">订立</el-button>
|
|
|
<el-button type="primary" :loading="loading"
|
|
<el-button type="primary" :loading="loading"
|
|
|
:disabled="!formData.OrderQty || !sellQty || (formData.OrderQty > sellQty)"
|
|
:disabled="!formData.OrderQty || !sellQty || (formData.OrderQty > sellQty)"
|
|
|
- @click="onSubmit(EBuildType.BUILDTYPE_CLOSE)">
|
|
|
|
|
|
|
+ @click="onBeforeSubmit(EBuildType.BUILDTYPE_CLOSE)" v-if="!isTrademode16">
|
|
|
<span>转让</span>
|
|
<span>转让</span>
|
|
|
<span v-if="sellQty">(≤{{ sellQty }})</span>
|
|
<span v-if="sellQty">(≤{{ sellQty }})</span>
|
|
|
</el-button>
|
|
</el-button>
|
|
@@ -61,10 +62,10 @@
|
|
|
<template v-if="formData.BuyOrSell === BuyOrSell.Sell">
|
|
<template v-if="formData.BuyOrSell === BuyOrSell.Sell">
|
|
|
<el-button ref="submitRef" type="primary" :loading="loading"
|
|
<el-button ref="submitRef" type="primary" :loading="loading"
|
|
|
:disabled="!selectedGoodsId || !formData.OrderQty"
|
|
:disabled="!selectedGoodsId || !formData.OrderQty"
|
|
|
- @click="onSubmit(EBuildType.BUILDTYPE_OPEN)">订立</el-button>
|
|
|
|
|
|
|
+ @click="onBeforeSubmit(EBuildType.BUILDTYPE_OPEN)" v-if="!isTrademode16">订立</el-button>
|
|
|
<el-button type="primary" :loading="loading"
|
|
<el-button type="primary" :loading="loading"
|
|
|
:disabled="!formData.OrderQty || !buyQty || (formData.OrderQty > buyQty)"
|
|
:disabled="!formData.OrderQty || !buyQty || (formData.OrderQty > buyQty)"
|
|
|
- @click="onSubmit(EBuildType.BUILDTYPE_CLOSE)">
|
|
|
|
|
|
|
+ @click="onBeforeSubmit(EBuildType.BUILDTYPE_CLOSE)">
|
|
|
<span>转让</span>
|
|
<span>转让</span>
|
|
|
<span v-if="buyQty">(≤{{ buyQty }})</span>
|
|
<span v-if="buyQty">(≤{{ buyQty }})</span>
|
|
|
</el-button>
|
|
</el-button>
|
|
@@ -92,7 +93,7 @@ const futuresStore = useFuturesStore()
|
|
|
|
|
|
|
|
const { selectedGoodsId, selectedGoods, marketGoodsList } = futuresStore.$toRefs()
|
|
const { selectedGoodsId, selectedGoods, marketGoodsList } = futuresStore.$toRefs()
|
|
|
const { formData, loading, formSubmit } = useOrder()
|
|
const { formData, loading, formSubmit } = useOrder()
|
|
|
-const { getOrderQty } = usePosition(50)
|
|
|
|
|
|
|
+const { getOrderQty } = usePosition(selectedGoods.value?.trademode ?? 0)
|
|
|
const formRef = shallowRef<FormInstance>()
|
|
const formRef = shallowRef<FormInstance>()
|
|
|
const qtyStepList = [1, 10, 100] // 数量步长列表
|
|
const qtyStepList = [1, 10, 100] // 数量步长列表
|
|
|
const qtyStep = shallowRef(qtyStepList[0]) // 数量步长
|
|
const qtyStep = shallowRef(qtyStepList[0]) // 数量步长
|
|
@@ -101,6 +102,8 @@ const priceRef = shallowRef()
|
|
|
const qtyRef = shallowRef()
|
|
const qtyRef = shallowRef()
|
|
|
const submitRef = shallowRef()
|
|
const submitRef = shallowRef()
|
|
|
|
|
|
|
|
|
|
+const isTrademode16 = computed(() => selectedGoods.value?.trademode === 16)
|
|
|
|
|
+
|
|
|
// 价格步长
|
|
// 价格步长
|
|
|
const priceStep = computed(() => {
|
|
const priceStep = computed(() => {
|
|
|
const { quoteminunit = 0, decimalplace = 0 } = selectedGoods.value ?? {}
|
|
const { quoteminunit = 0, decimalplace = 0 } = selectedGoods.value ?? {}
|
|
@@ -195,42 +198,51 @@ const onPriceClick = (buyorsell: BuyOrSell, value: number) => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// 提交挂牌
|
|
|
|
|
-const onSubmit = (buildType: number) => {
|
|
|
|
|
|
|
+const onBeforeSubmit = (buildType: EBuildType) => {
|
|
|
formRef.value?.validate((valid) => {
|
|
formRef.value?.validate((valid) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
- ElMessageBox.confirm(
|
|
|
|
|
- '*若存在价格匹配的反方向委托订单,系统将会自动撤销。',
|
|
|
|
|
- '是否立即挂牌?'
|
|
|
|
|
- ).then(() => {
|
|
|
|
|
- const { marketid = 0, goodsid = 0 } = selectedGoods.value ?? {}
|
|
|
|
|
- /// 获取对应的市场ID
|
|
|
|
|
- formData.MarketID = marketid
|
|
|
|
|
- formData.PriceMode = EPriceMode.PRICEMODE_LIMIT
|
|
|
|
|
- formData.GoodsID = goodsid
|
|
|
|
|
- formData.ListingSelectType = EListingSelectType.LISTINGSELECTTYPE_DELISTINGTHENLISTING
|
|
|
|
|
- formData.DelistingType = EDelistingType.DELISTINGTYPE_PRICE
|
|
|
|
|
- formData.TimevalidType = EValidType.VALIDTYPE_DR
|
|
|
|
|
- formData.OperateType = EOrderOperateType.ORDEROPERATETYPE_NORMAL
|
|
|
|
|
- formData.BuildType = buildType
|
|
|
|
|
|
|
+ formData.BuildType = buildType
|
|
|
|
|
+ if (isTrademode16.value) {
|
|
|
|
|
+ ElMessageBox.confirm(
|
|
|
|
|
+ '是否立即挂牌?',
|
|
|
|
|
+ '提示'
|
|
|
|
|
+ ).then(() => onSubmit())
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ElMessageBox.confirm(
|
|
|
|
|
+ '*若存在价格匹配的反方向委托订单,系统将会自动撤销。',
|
|
|
|
|
+ '是否立即挂牌?'
|
|
|
|
|
+ ).then(() => onSubmit())
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
- formSubmit().then(() => {
|
|
|
|
|
- if (settingStore.getSettingValue('orderQtyIsEmpty')) {
|
|
|
|
|
- formData.OrderQty = undefined
|
|
|
|
|
- qtyStep.value = 0
|
|
|
|
|
- }
|
|
|
|
|
- ElMessage.success('挂牌成功')
|
|
|
|
|
- }).catch((err) => {
|
|
|
|
|
- ElMessage.error('挂牌失败:' + err)
|
|
|
|
|
- }).finally(() => {
|
|
|
|
|
- const focusType = settingStore.getSettingValue('orderFocusType')
|
|
|
|
|
- if (focusType === 2 || isDisabled.value) {
|
|
|
|
|
- qtyInputFocus()
|
|
|
|
|
- } else {
|
|
|
|
|
- priceInputFocus()
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
|
|
+// 提交挂牌
|
|
|
|
|
+const onSubmit = () => {
|
|
|
|
|
+ const { marketid = 0, goodsid = 0 } = selectedGoods.value ?? {}
|
|
|
|
|
+ /// 获取对应的市场ID
|
|
|
|
|
+ formData.MarketID = marketid
|
|
|
|
|
+ formData.PriceMode = EPriceMode.PRICEMODE_LIMIT
|
|
|
|
|
+ formData.GoodsID = goodsid
|
|
|
|
|
+ formData.ListingSelectType = EListingSelectType.LISTINGSELECTTYPE_DELISTINGTHENLISTING
|
|
|
|
|
+ formData.DelistingType = EDelistingType.DELISTINGTYPE_PRICE
|
|
|
|
|
+ formData.TimevalidType = EValidType.VALIDTYPE_DR
|
|
|
|
|
+ formData.OperateType = EOrderOperateType.ORDEROPERATETYPE_NORMAL
|
|
|
|
|
+
|
|
|
|
|
+ formSubmit().then(() => {
|
|
|
|
|
+ if (settingStore.getSettingValue('orderQtyIsEmpty')) {
|
|
|
|
|
+ formData.OrderQty = undefined
|
|
|
|
|
+ qtyStep.value = 0
|
|
|
|
|
+ }
|
|
|
|
|
+ ElMessage.success('挂牌成功')
|
|
|
|
|
+ }).catch((err) => {
|
|
|
|
|
+ ElMessage.error('挂牌失败:' + err)
|
|
|
|
|
+ }).finally(() => {
|
|
|
|
|
+ const focusType = settingStore.getSettingValue('orderFocusType')
|
|
|
|
|
+ if (focusType === 2 || isDisabled.value) {
|
|
|
|
|
+ qtyInputFocus()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ priceInputFocus()
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|