|
|
@@ -38,7 +38,8 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="OrderQty" label="数量">
|
|
|
<div class="g-qty-group">
|
|
|
- <el-input-number ref="qtyRef" placeholder="请输入" :min="0" :precision="0" :step="qtyStep || 1"
|
|
|
+ <el-input-number ref="qtyRef" placeholder="请输入" :min="0"
|
|
|
+ :max="settingStore.getSettingValue('orderMaxQty')" :precision="0" :step="qtyStep || 1"
|
|
|
v-model="formData.OrderQty" @keyup.enter="submitFocus" />
|
|
|
<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 />
|
|
|
@@ -47,10 +48,10 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item class="footer-btnbar">
|
|
|
<el-button ref="submitRef" type="danger" :loading="loading" :disabled="!selectedGoodsId"
|
|
|
- @click="onSubmit"
|
|
|
+ @click="onBeforeSubmit"
|
|
|
v-if="formData.BuyOrSell === BuyOrSell.Buy && !selectedGoods?.iscannotbuy">订立</el-button>
|
|
|
<el-button ref="submitRef" type="primary" :loading="loading"
|
|
|
- :disabled="!formData.OrderQty || !enableqty || (formData.OrderQty > enableqty)" @click="onSubmit"
|
|
|
+ :disabled="!formData.OrderQty || !enableqty || (formData.OrderQty > enableqty)" @click="onBeforeSubmit"
|
|
|
v-if="formData.BuyOrSell === BuyOrSell.Sell">
|
|
|
<span>转让</span>
|
|
|
<span v-if="enableqty">(≤{{ enableqty }})</span>
|
|
|
@@ -171,39 +172,49 @@ const onPriceClick = (buyorsell: BuyOrSell, value: number) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// 提交挂牌
|
|
|
-const onSubmit = () => {
|
|
|
+const onBeforeSubmit = () => {
|
|
|
formRef.value?.validate((valid) => {
|
|
|
if (valid) {
|
|
|
- ElMessageBox.confirm(
|
|
|
- '是否立即挂牌?',
|
|
|
- '提示'
|
|
|
- ).then(() => {
|
|
|
- const { marketid = 0, goodsid = 0 } = selectedGoods.value ?? {}
|
|
|
- formData.MarketID = marketid
|
|
|
- formData.GoodsID = goodsid
|
|
|
- formData.TimevalidType = EValidType.VALIDTYPE_YZ
|
|
|
- formData.PriceMode = EPriceMode.PRICEMODE_LIMIT
|
|
|
- formData.ListingSelectType = EListingSelectType.LISTINGSELECTTYPE_DELISTINGTHENLISTING
|
|
|
- formData.BuildType = formData.BuyOrSell === BuyOrSell.Sell ? EBuildType.BUILDTYPE_CLOSE : EBuildType.BUILDTYPE_OPEN
|
|
|
- formData.DelistingType = EDelistingType.DELISTINGTYPE_PRICE
|
|
|
+ if (settingStore.getSettingValue('showOrderDialog')) {
|
|
|
+ ElMessageBox.confirm(
|
|
|
+ '是否立即挂牌?',
|
|
|
+ '提示'
|
|
|
+ ).then(() => onSubmit())
|
|
|
+ } else {
|
|
|
+ onSubmit()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
|
|
|
- formSubmit().then(() => {
|
|
|
- ElMessage.success('挂牌成功')
|
|
|
- getMineTradePositionExs({
|
|
|
- goodsid: selectedGoodsId.value
|
|
|
- })
|
|
|
- }).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 ?? {}
|
|
|
+ formData.MarketID = marketid
|
|
|
+ formData.GoodsID = goodsid
|
|
|
+ formData.TimevalidType = EValidType.VALIDTYPE_YZ
|
|
|
+ formData.PriceMode = EPriceMode.PRICEMODE_LIMIT
|
|
|
+ formData.ListingSelectType = EListingSelectType.LISTINGSELECTTYPE_DELISTINGTHENLISTING
|
|
|
+ formData.BuildType = formData.BuyOrSell === BuyOrSell.Sell ? EBuildType.BUILDTYPE_CLOSE : EBuildType.BUILDTYPE_OPEN
|
|
|
+ formData.DelistingType = EDelistingType.DELISTINGTYPE_PRICE
|
|
|
+
|
|
|
+ formSubmit().then(() => {
|
|
|
+ if (settingStore.getSettingValue('showOrderSuccessMessage')) {
|
|
|
+ ElMessage.success('挂牌成功')
|
|
|
+ }
|
|
|
+ getMineTradePositionExs({
|
|
|
+ goodsid: selectedGoodsId.value
|
|
|
+ })
|
|
|
+ }).catch((err) => {
|
|
|
+ if (settingStore.getSettingValue('showOrderFailMessage')) {
|
|
|
+ ElMessage.error('挂牌失败:' + err)
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
+ const focusType = settingStore.getSettingValue('orderFocusType')
|
|
|
+ if (focusType === 2 || isDisabled.value) {
|
|
|
+ qtyInputFocus()
|
|
|
+ } else {
|
|
|
+ priceInputFocus()
|
|
|
}
|
|
|
})
|
|
|
}
|