|
@@ -47,14 +47,14 @@
|
|
|
@click="onBeforeSubmit(EBuildType.BUILDTYPE_OPEN)">订立买入</Button>
|
|
@click="onBeforeSubmit(EBuildType.BUILDTYPE_OPEN)">订立买入</Button>
|
|
|
<Button type="primary" block square
|
|
<Button type="primary" block square
|
|
|
:disabled="!formData.OrderQty || !sellQty || (formData.OrderQty > sellQty)"
|
|
:disabled="!formData.OrderQty || !sellQty || (formData.OrderQty > sellQty)"
|
|
|
- @click="onBeforeSubmit(EBuildType.BUILDTYPE_CLOSE)">
|
|
|
|
|
|
|
+ @click="onBeforeSubmit(EBuildType.BUILDTYPE_CLOSE)" v-if="quote?.trademode !== 16">
|
|
|
<span>转让买入</span>
|
|
<span>转让买入</span>
|
|
|
<span v-if="sellQty">(≤{{ sellQty }})</span>
|
|
<span v-if="sellQty">(≤{{ sellQty }})</span>
|
|
|
</Button>
|
|
</Button>
|
|
|
</template>
|
|
</template>
|
|
|
<template v-if="buyOrSell === BuyOrSell.Sell">
|
|
<template v-if="buyOrSell === BuyOrSell.Sell">
|
|
|
<Button type="danger" block square :disabled="!formData.OrderQty"
|
|
<Button type="danger" block square :disabled="!formData.OrderQty"
|
|
|
- @click="onBeforeSubmit(EBuildType.BUILDTYPE_OPEN)">订立卖出</Button>
|
|
|
|
|
|
|
+ @click="onBeforeSubmit(EBuildType.BUILDTYPE_OPEN)" v-if="quote?.trademode !== 16">订立卖出</Button>
|
|
|
<Button type="primary" block square
|
|
<Button type="primary" block square
|
|
|
:disabled="!formData.OrderQty || !buyQty || (formData.OrderQty > buyQty)"
|
|
:disabled="!formData.OrderQty || !buyQty || (formData.OrderQty > buyQty)"
|
|
|
@click="onBeforeSubmit(EBuildType.BUILDTYPE_CLOSE)">
|
|
@click="onBeforeSubmit(EBuildType.BUILDTYPE_CLOSE)">
|
|
@@ -93,11 +93,12 @@ const props = defineProps({
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-const { getOrderQty } = usePosition(50)
|
|
|
|
|
-const { formData, formSubmit } = useOrder()
|
|
|
|
|
const accountStore = useAccountStore()
|
|
const accountStore = useAccountStore()
|
|
|
const futuresStore = useFuturesStore()
|
|
const futuresStore = useFuturesStore()
|
|
|
const quote = futuresStore.getGoodsQuote(props.goodsCode)
|
|
const quote = futuresStore.getGoodsQuote(props.goodsCode)
|
|
|
|
|
+
|
|
|
|
|
+const { getOrderQty } = usePosition(quote.value?.trademode ?? 0)
|
|
|
|
|
+const { formData, formSubmit } = useOrder()
|
|
|
const formRef = shallowRef<FormInstance>()
|
|
const formRef = shallowRef<FormInstance>()
|
|
|
const showModal = shallowRef(true)
|
|
const showModal = shallowRef(true)
|
|
|
const refresh = shallowRef(true) // 是否刷新父组件数据
|
|
const refresh = shallowRef(true) // 是否刷新父组件数据
|
|
@@ -139,7 +140,7 @@ const buyQty = computed(() => getOrderQty(BuyOrSell.Buy, props.goodsCode))
|
|
|
const sellQty = computed(() => getOrderQty(BuyOrSell.Sell, props.goodsCode))
|
|
const sellQty = computed(() => getOrderQty(BuyOrSell.Sell, props.goodsCode))
|
|
|
|
|
|
|
|
// 表单验证规则
|
|
// 表单验证规则
|
|
|
-const formRules: { [key in keyof Proto.OrderReq]?: FieldRule[] } = {
|
|
|
|
|
|
|
+const formRules: { [key: string]: FieldRule[] } = {
|
|
|
OrderPrice: [{
|
|
OrderPrice: [{
|
|
|
message: '请输入价格',
|
|
message: '请输入价格',
|
|
|
validator: () => {
|
|
validator: () => {
|