|
|
@@ -47,14 +47,14 @@
|
|
|
@click="onBeforeSubmit(EBuildType.BUILDTYPE_OPEN)">订立买入</Button>
|
|
|
<Button type="primary" block square
|
|
|
:disabled="!formData.OrderQty || !sellQty || (formData.OrderQty > sellQty)"
|
|
|
- @click="onBeforeSubmit(EBuildType.BUILDTYPE_CLOSE)" v-if="quote?.trademode !== 16">
|
|
|
+ @click="onBeforeSubmit(EBuildType.BUILDTYPE_CLOSE)" v-if="!isTrademode16">
|
|
|
<span>转让买入</span>
|
|
|
<span v-if="sellQty">(≤{{ sellQty }})</span>
|
|
|
</Button>
|
|
|
</template>
|
|
|
<template v-if="buyOrSell === BuyOrSell.Sell">
|
|
|
<Button type="danger" block square :disabled="!formData.OrderQty"
|
|
|
- @click="onBeforeSubmit(EBuildType.BUILDTYPE_OPEN)" v-if="quote?.trademode !== 16">订立卖出</Button>
|
|
|
+ @click="onBeforeSubmit(EBuildType.BUILDTYPE_OPEN)" v-if="!isTrademode16">订立卖出</Button>
|
|
|
<Button type="primary" block square
|
|
|
:disabled="!formData.OrderQty || !buyQty || (formData.OrderQty > buyQty)"
|
|
|
@click="onBeforeSubmit(EBuildType.BUILDTYPE_CLOSE)">
|
|
|
@@ -105,6 +105,8 @@ const refresh = shallowRef(true) // 是否刷新父组件数据
|
|
|
const qtyStepList = [1, 5, 10, 20, 30, 50] // 数量步长列表
|
|
|
const qtyStep = shallowRef(qtyStepList[0]) // 数量步长
|
|
|
|
|
|
+const isTrademode16 = computed(() => quote.value?.trademode === 16)
|
|
|
+
|
|
|
// 价格步长
|
|
|
const priceStep = computed(() => {
|
|
|
const { quoteminunit = 0, decimalplace = 0 } = quote.value ?? {}
|
|
|
@@ -140,7 +142,7 @@ const buyQty = computed(() => getOrderQty(BuyOrSell.Buy, props.goodsCode))
|
|
|
const sellQty = computed(() => getOrderQty(BuyOrSell.Sell, props.goodsCode))
|
|
|
|
|
|
// 表单验证规则
|
|
|
-const formRules: { [key in keyof Proto.OrderReq]?: FieldRule[] } = {
|
|
|
+const formRules: { [key: string]: FieldRule[] } = {
|
|
|
OrderPrice: [{
|
|
|
message: '请输入价格',
|
|
|
validator: () => {
|
|
|
@@ -165,35 +167,40 @@ const onRadioChange = (value: number) => {
|
|
|
|
|
|
// 提交挂牌
|
|
|
const onSubmit = () => {
|
|
|
- dialog({
|
|
|
- title: '确认要提交吗?',
|
|
|
- message: '*若存在价格匹配的反方向委托订单,系统将会自动撤销',
|
|
|
- showCancelButton: true,
|
|
|
- }).then(() => {
|
|
|
- const { marketid = 0, goodsid = 0 } = quote.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.BuyOrSell = props.buyOrSell
|
|
|
-
|
|
|
- fullloading((hideLoading) => {
|
|
|
- formSubmit().then(() => {
|
|
|
- hideLoading('提交成功。', 'success')
|
|
|
- }).catch((err) => {
|
|
|
- hideLoading(err, 'fail')
|
|
|
- })
|
|
|
+ const { marketid = 0, goodsid = 0 } = quote.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.BuyOrSell = props.buyOrSell
|
|
|
+
|
|
|
+ fullloading((hideLoading) => {
|
|
|
+ formSubmit().then(() => {
|
|
|
+ hideLoading('提交成功。', 'success')
|
|
|
+ }).catch((err) => {
|
|
|
+ hideLoading(err, 'fail')
|
|
|
})
|
|
|
})
|
|
|
+
|
|
|
}
|
|
|
|
|
|
const onBeforeSubmit = (buildType: EBuildType) => {
|
|
|
formData.BuildType = buildType
|
|
|
- formRef.value?.submit()
|
|
|
+ if (isTrademode16.value) {
|
|
|
+ formRef.value?.submit()
|
|
|
+ } else {
|
|
|
+ dialog({
|
|
|
+ title: '确认要提交吗?',
|
|
|
+ message: '*若存在价格匹配的反方向委托订单,系统将会自动撤销',
|
|
|
+ showCancelButton: true,
|
|
|
+ }).then(() => {
|
|
|
+ formRef.value?.submit()
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 关闭弹窗
|