|
|
@@ -28,19 +28,17 @@
|
|
|
{{ formatDecimal(selectedRow.closepl, selectedRow.decimalplace) }}
|
|
|
</span>
|
|
|
</el-form-item>
|
|
|
- <el-form-item prop="OrderQty" :label="t('position.goods.qty')">
|
|
|
- <div class="g-qty-group">
|
|
|
- <el-input-number :placeholder="t('position.goods.tips2')" v-model="formData.OrderQty" :precision="0"
|
|
|
- :max="selectedRow.enableqty" :min="0" />
|
|
|
- <el-radio-group size="small" v-model="qtyStep" @change="onRadioChange">
|
|
|
- <el-radio v-for="(value, index) in qtyStepList" :key="index" :label="value" border
|
|
|
- style="width: 25%;">
|
|
|
- {{ parsePercent(value, 0) }}
|
|
|
- </el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </div>
|
|
|
+ <el-form-item prop="PriceMode" :label="t('quote.pricing.pricemode')">
|
|
|
+ <el-radio-group v-model="formData.PriceMode">
|
|
|
+ <el-radio v-for="(item, index) in getPricemode2List()" :key="index" :label="item.value">
|
|
|
+ {{ item.label }}
|
|
|
+ </el-radio>
|
|
|
+ </el-radio-group>
|
|
|
</el-form-item>
|
|
|
- <el-form-item prop="OrderPrice" :label="t('position.goods.transferprice')">
|
|
|
+ <el-form-item prop="MarketMaxSub" :label="t('quote.pricing.marketmaxsub')" v-if="formData.PriceMode === PriceMode.Market">
|
|
|
+ <el-input-number ref="priceRef" :placeholder="t('common.pleaseenter')" :min="0" :max="999" v-model="formData.MarketMaxSub" integer/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="OrderPrice" :label="t('position.goods.transferprice')" v-if="formData.PriceMode === PriceMode.Limit">
|
|
|
<div class="el-form-item--col">
|
|
|
<el-input-number :placeholder="t('position.goods.tips1')" v-model="formData.OrderPrice" :step="quote?.decimalvalue"
|
|
|
:precision="quote?.decimalplace" />
|
|
|
@@ -56,6 +54,18 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item prop="OrderQty" :label="t('position.goods.qty')">
|
|
|
+ <div class="g-qty-group">
|
|
|
+ <el-input-number :placeholder="t('position.goods.tips2')" v-model="formData.OrderQty" :precision="0"
|
|
|
+ :max="selectedRow.enableqty" :min="0" />
|
|
|
+ <el-radio-group size="small" v-model="qtyStep" @change="onRadioChange">
|
|
|
+ <el-radio v-for="(value, index) in qtyStepList" :key="index" :label="value" border
|
|
|
+ style="width: 25%;">
|
|
|
+ {{ parsePercent(value, 0) }}
|
|
|
+ </el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
|
<el-button type="info" @click="onCancel(false)">{{ t('operation.cancel') }}</el-button>
|
|
|
@@ -65,13 +75,13 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { ref, PropType, onMounted } from 'vue'
|
|
|
+import { ref, PropType, onMounted, computed } from 'vue'
|
|
|
import { ElMessage, FormInstance, FormRules } from 'element-plus'
|
|
|
import { useOrder } from '@/business/trade'
|
|
|
import { formatDecimal, parsePercent } from '@/filters'
|
|
|
-import { getBuyOrSellName, BuyOrSell } from '@/constants/order'
|
|
|
+import { getBuyOrSellName, BuyOrSell, getPricemode2List, PriceMode } from '@/constants/order'
|
|
|
import { useFuturesStore, i18n } from '@/stores'
|
|
|
-import { EBuildType, EDelistingType, EListingSelectType, EOrderOperateType, EPriceMode, EValidType } from '@/constants/client'
|
|
|
+import { EBuildType, EDelistingType, EListingSelectType, EOrderOperateType, EValidType } from '@/constants/client'
|
|
|
import Icon from '@pc/components/base/icon/index.vue'
|
|
|
import AppDrawer from '@pc/components/base/drawer/index.vue'
|
|
|
|
|
|
@@ -115,14 +125,19 @@ const onCancel = (isRefresh = false) => {
|
|
|
refresh.value = isRefresh
|
|
|
}
|
|
|
|
|
|
+const marketPrice = computed(() => {
|
|
|
+ const { ask = 0, bid = 0 } = quote.value ?? {}
|
|
|
+ return formData.BuyOrSell === BuyOrSell.Buy ? ask : bid
|
|
|
+})
|
|
|
+
|
|
|
const onCloseSumit = () => {
|
|
|
formRef.value?.validate((valid) => {
|
|
|
if (valid) {
|
|
|
const { marketid, goodsid, buyorsell } = props.selectedRow
|
|
|
/// 市场ID
|
|
|
formData.Header = { GoodsID: goodsid }
|
|
|
+ if (formData.PriceMode === PriceMode.Market) { formData.OrderPrice = marketPrice.value }
|
|
|
formData.MarketID = marketid
|
|
|
- formData.PriceMode = EPriceMode.PRICEMODE_LIMIT
|
|
|
formData.BuyOrSell = buyorsell === BuyOrSell.Buy ? BuyOrSell.Sell : BuyOrSell.Buy
|
|
|
formData.GoodsID = goodsid
|
|
|
formData.ListingSelectType = EListingSelectType.LISTINGSELECTTYPE_DELISTINGTHENLISTING
|
|
|
@@ -157,6 +172,7 @@ onMounted(() => {
|
|
|
default:
|
|
|
formData.OrderPrice = last || presettle
|
|
|
}
|
|
|
+ formData.PriceMode = PriceMode.Market
|
|
|
formData.OrderQty = props.selectedRow.enableqty
|
|
|
})
|
|
|
</script>
|