|
|
@@ -46,7 +46,7 @@
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
import { shallowRef, PropType, computed } from 'vue'
|
|
|
-import { ElMessage, FormInstance, FormRules } from 'element-plus'
|
|
|
+import { ElMessage, FormInstance, FormRules, ElMessageBox } from 'element-plus'
|
|
|
import { EBuildType, EDelistingType, EListingSelectType, EOrderOperateType, EPriceMode, EValidType } from '@/constants/client'
|
|
|
import { BuyOrSell } from '@/constants/order'
|
|
|
import { useOrder } from '@/business/trade'
|
|
|
@@ -104,27 +104,32 @@ const onCancel = (isRefresh = false) => {
|
|
|
const onSubmit = (buildType: number) => {
|
|
|
formRef.value?.validate((valid) => {
|
|
|
if (valid) {
|
|
|
- const { goodsid, orderid, orderprice, buyorsell } = props.selectedRow
|
|
|
- const { marketid = 0 } = quote.value ?? {}
|
|
|
+ ElMessageBox.confirm(
|
|
|
+ '*若存在价格匹配的反方向委托订单,系统将会自动撤销。',
|
|
|
+ '是否立即摘牌?'
|
|
|
+ ).then(() => {
|
|
|
+ const { goodsid, orderid, orderprice, buyorsell } = props.selectedRow
|
|
|
+ const { marketid = 0 } = quote.value ?? {}
|
|
|
|
|
|
- /// 获取对应的市场ID
|
|
|
- formData.MarketID = marketid
|
|
|
- formData.PriceMode = EPriceMode.PRICEMODE_LIMIT
|
|
|
- formData.RelatedID = orderid
|
|
|
- formData.OrderPrice = orderprice
|
|
|
- formData.BuyOrSell = buyorsell === BuyOrSell.Buy ? BuyOrSell.Sell : BuyOrSell.Buy
|
|
|
- formData.GoodsID = goodsid
|
|
|
- formData.ListingSelectType = EListingSelectType.LISTINGSELECTTYPE_DELISTING
|
|
|
- formData.DelistingType = EDelistingType.DELISTINGTYPE_SELECTED
|
|
|
- formData.BuildType = buildType
|
|
|
- formData.TimevalidType = EValidType.VALIDTYPE_DR
|
|
|
- formData.OperateType = EOrderOperateType.ORDEROPERATETYPE_NORMAL
|
|
|
+ /// 获取对应的市场ID
|
|
|
+ formData.MarketID = marketid
|
|
|
+ formData.PriceMode = EPriceMode.PRICEMODE_LIMIT
|
|
|
+ formData.RelatedID = orderid
|
|
|
+ formData.OrderPrice = orderprice
|
|
|
+ formData.BuyOrSell = buyorsell === BuyOrSell.Buy ? BuyOrSell.Sell : BuyOrSell.Buy
|
|
|
+ formData.GoodsID = goodsid
|
|
|
+ formData.ListingSelectType = EListingSelectType.LISTINGSELECTTYPE_DELISTING
|
|
|
+ formData.DelistingType = EDelistingType.DELISTINGTYPE_SELECTED
|
|
|
+ formData.BuildType = buildType
|
|
|
+ formData.TimevalidType = EValidType.VALIDTYPE_DR
|
|
|
+ formData.OperateType = EOrderOperateType.ORDEROPERATETYPE_NORMAL
|
|
|
|
|
|
- formSubmit().then(() => {
|
|
|
- ElMessage.success('提交成功')
|
|
|
- onCancel(true)
|
|
|
- }).catch((err) => {
|
|
|
- ElMessage.error('提交失败:' + err)
|
|
|
+ formSubmit().then(() => {
|
|
|
+ ElMessage.success('提交成功')
|
|
|
+ onCancel(true)
|
|
|
+ }).catch((err) => {
|
|
|
+ ElMessage.error('提交失败:' + err)
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
})
|