|
@@ -9,30 +9,29 @@
|
|
|
:rules="formRules">
|
|
:rules="formRules">
|
|
|
<el-form-item prop="GoodsID" :label="t('quote.pricing.goods')">
|
|
<el-form-item prop="GoodsID" :label="t('quote.pricing.goods')">
|
|
|
<el-select effect="dark" :placeholder="t('common.choice')" v-model="selectedGoodsId" filterable>
|
|
<el-select effect="dark" :placeholder="t('common.choice')" v-model="selectedGoodsId" filterable>
|
|
|
- <el-option :label="item.goodscode" :value="item.goodsid" v-for="(item, index) in marketGoodsList"
|
|
|
|
|
- :key="index" />
|
|
|
|
|
|
|
+ <el-option :label="item.goodscode" :value="item.goodsid"
|
|
|
|
|
+ v-for="(item, index) in marketGoodsList" :key="index" />
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item prop="BuyOrSell" :label="t('quote.pricing.buyorsell')">
|
|
<el-form-item prop="BuyOrSell" :label="t('quote.pricing.buyorsell')">
|
|
|
<el-radio-group v-model="formData.BuyOrSell">
|
|
<el-radio-group v-model="formData.BuyOrSell">
|
|
|
- <el-radio v-for="(item, index) in getBuyOrSellList()" :key="index" :label="item.value">
|
|
|
|
|
- {{ item.label }}
|
|
|
|
|
- </el-radio>
|
|
|
|
|
|
|
+ <el-radio v-for="(item, index) in getBuyOrSellList()" :key="index" :label="item.label"
|
|
|
|
|
+ :value="item.value" />
|
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item prop="PriceMode" :label="t('quote.pricing.pricemode')">
|
|
<el-form-item prop="PriceMode" :label="t('quote.pricing.pricemode')">
|
|
|
<el-radio-group v-model="formData.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 v-for="(item, index) in getPricemode2List()" :key="index" :label="item.label"
|
|
|
|
|
+ :value="item.value" />
|
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item prop="OrderQty" :label="t('quote.pricing.orderqty')">
|
|
<el-form-item prop="OrderQty" :label="t('quote.pricing.orderqty')">
|
|
|
<div class="g-qty-group">
|
|
<div class="g-qty-group">
|
|
|
- <el-input-number ref="qtyRef" :placeholder="t('common.pleaseenter')" :min="0" :max="9999999999" :precision="0" :step="qtyStep || 1"
|
|
|
|
|
- v-model="formData.OrderQty" @keyup.enter="submitFocus" />
|
|
|
|
|
|
|
+ <el-input-number ref="qtyRef" :placeholder="t('common.pleaseenter')" :min="0" :max="9999999999"
|
|
|
|
|
+ :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-group size="small" v-model="qtyStep" :validate-event="false" @change="onRadioChange">
|
|
|
- <el-radio v-for="(value, index) in qtyStepList" :key="index" :label="value" border />
|
|
|
|
|
|
|
+ <el-radio v-for="(value, index) in qtyStepList" :key="index" :label="value" :value="value" border />
|
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
|
<template
|
|
<template
|
|
|
v-if="(formData.BuyOrSell === BuyOrSell.Buy || selectedGoods?.tradeproperty !== 2) && settingStore.getSettingValue('showOrderEnableQty')">
|
|
v-if="(formData.BuyOrSell === BuyOrSell.Buy || selectedGoods?.tradeproperty !== 2) && settingStore.getSettingValue('showOrderEnableQty')">
|
|
@@ -40,7 +39,8 @@
|
|
|
style="display: flex;flex-direction: column;line-height: normal;font-size: 12px;color: #7a8a94;">
|
|
style="display: flex;flex-direction: column;line-height: normal;font-size: 12px;color: #7a8a94;">
|
|
|
<span>{{ t('quote.pricing.enableQty') }}:{{ total.enableQty }}</span>
|
|
<span>{{ t('quote.pricing.enableQty') }}:{{ total.enableQty }}</span>
|
|
|
<span>{{ t('quote.pricing.deposit') }}:{{ total.deposit.toFixed(2) }}</span>
|
|
<span>{{ t('quote.pricing.deposit') }}:{{ total.deposit.toFixed(2) }}</span>
|
|
|
- <span>{{ t('quote.pricing.avaiableMoney') }}:{{ accountStore.currentAccount.avaiableMoney?.toFixed(2) }}</span>
|
|
|
|
|
|
|
+ <span>{{ t('quote.pricing.avaiableMoney') }}:{{
|
|
|
|
|
+ accountStore.currentAccount.avaiableMoney?.toFixed(2) }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</div>
|
|
</div>
|
|
@@ -49,15 +49,17 @@
|
|
|
<el-input-number ref="priceRef" :placeholder="t('common.pleaseenter')" :min="0" :max="999" v-model="formData.MarketMaxSub"
|
|
<el-input-number ref="priceRef" :placeholder="t('common.pleaseenter')" :min="0" :max="999" v-model="formData.MarketMaxSub"
|
|
|
@keyup.enter="submitFocus" />
|
|
@keyup.enter="submitFocus" />
|
|
|
</el-form-item> -->
|
|
</el-form-item> -->
|
|
|
- <el-form-item prop="OrderPrice" :label="t('quote.pricing.price')" v-if="formData.PriceMode === PriceMode.Limit">
|
|
|
|
|
- <el-input-number ref="priceRef" :placeholder="t('common.pleaseenter')" :max="9999999999" :min="0" v-model="formData.OrderPrice"
|
|
|
|
|
- :auto-fixed="false" :decimal-length="decimalplace" :step="decimalvalue" @keyup.enter="submitFocus" />
|
|
|
|
|
|
|
+ <el-form-item prop="OrderPrice" :label="t('quote.pricing.price')"
|
|
|
|
|
+ v-if="formData.PriceMode === PriceMode.Limit">
|
|
|
|
|
+ <el-input-number ref="priceRef" :placeholder="t('common.pleaseenter')" :max="9999999999" :min="0"
|
|
|
|
|
+ v-model="formData.OrderPrice" :auto-fixed="false" :decimal-length="decimalplace"
|
|
|
|
|
+ :step="decimalvalue" @keyup.enter="submitFocus" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item class="footer-btnbar">
|
|
<el-form-item class="footer-btnbar">
|
|
|
<template v-if="formData.BuyOrSell === BuyOrSell.Buy">
|
|
<template v-if="formData.BuyOrSell === BuyOrSell.Buy">
|
|
|
<el-button ref="submitRef" type="danger" :disabled="!selectedGoodsId || !formData.OrderQty"
|
|
<el-button ref="submitRef" type="danger" :disabled="!selectedGoodsId || !formData.OrderQty"
|
|
|
- @click="onBeforeSubmit(BuildType.Open)"
|
|
|
|
|
- v-if="!selectedGoods?.iscannotbuy">{{ t('operation.order') }}</el-button>
|
|
|
|
|
|
|
+ @click="onBeforeSubmit(BuildType.Open)" v-if="!selectedGoods?.iscannotbuy">{{
|
|
|
|
|
+ t('operation.order') }}</el-button>
|
|
|
<!-- <el-button type="primary"
|
|
<!-- <el-button type="primary"
|
|
|
:disabled="!formData.OrderQty || !sellQty || (formData.OrderQty > sellQty)"
|
|
:disabled="!formData.OrderQty || !sellQty || (formData.OrderQty > sellQty)"
|
|
|
@click="onBeforeSubmit(BuildType.Close)" v-if="!isTrademode16 && riskcontrolmode != 1">
|
|
@click="onBeforeSubmit(BuildType.Close)" v-if="!isTrademode16 && riskcontrolmode != 1">
|
|
@@ -76,7 +78,7 @@
|
|
|
</el-button> -->
|
|
</el-button> -->
|
|
|
</template>
|
|
</template>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- </el-form>
|
|
|
|
|
|
|
+ </el-form>
|
|
|
</el-scrollbar>
|
|
</el-scrollbar>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -102,8 +104,8 @@ const formRef = shallowRef<FormInstance>()
|
|
|
// 数量步长列表
|
|
// 数量步长列表
|
|
|
const qtyStepList = computed(() => {
|
|
const qtyStepList = computed(() => {
|
|
|
const system_1009 = Number(getSystemParamValue('1009')) ?? 1
|
|
const system_1009 = Number(getSystemParamValue('1009')) ?? 1
|
|
|
- return [1*system_1009, 10*system_1009, 100*system_1009]
|
|
|
|
|
-})
|
|
|
|
|
|
|
+ return [1 * system_1009, 10 * system_1009, 100 * system_1009]
|
|
|
|
|
+})
|
|
|
const qtyStep = shallowRef(qtyStepList.value[0]) // 数量步长
|
|
const qtyStep = shallowRef(qtyStepList.value[0]) // 数量步长
|
|
|
const { t } = i18n.global
|
|
const { t } = i18n.global
|
|
|
|
|
|
|
@@ -148,7 +150,7 @@ const total = computed(() => {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
// 持仓汇总
|
|
// 持仓汇总
|
|
|
-const position = shallowRef<Model.TradePositionRsp[]>([])
|
|
|
|
|
|
|
+const position = shallowRef<Model.TradePositionRsp[]>([])
|
|
|
// 买方向持仓数量
|
|
// 买方向持仓数量
|
|
|
// const buyQty = computed(() => positionStore.getOrderQty(BuyOrSell.Buy, selectedGoodsId.value))
|
|
// const buyQty = computed(() => positionStore.getOrderQty(BuyOrSell.Buy, selectedGoodsId.value))
|
|
|
// 卖方向持仓数量
|
|
// 卖方向持仓数量
|
|
@@ -162,7 +164,7 @@ const isDisabled = computed(() => [3, 4].includes(orderPriceType.value))
|
|
|
// 小数位以及步进值
|
|
// 小数位以及步进值
|
|
|
const { decimalplace = 0.0 } = selectedGoods.value ?? {}
|
|
const { decimalplace = 0.0 } = selectedGoods.value ?? {}
|
|
|
const quoteminunit = selectedGoods.value?.quoteminunit ?? 1.0
|
|
const quoteminunit = selectedGoods.value?.quoteminunit ?? 1.0
|
|
|
-const decimalvalue = Math.pow(10.0, -decimalplace)*(quoteminunit == 0 ? 1 : quoteminunit)
|
|
|
|
|
|
|
+const decimalvalue = Math.pow(10.0, -decimalplace) * (quoteminunit == 0 ? 1 : quoteminunit)
|
|
|
|
|
|
|
|
const formRules: FormRules = {
|
|
const formRules: FormRules = {
|
|
|
OrderPrice: [{
|
|
OrderPrice: [{
|
|
@@ -224,10 +226,10 @@ const formRules: FormRules = {
|
|
|
const onPriceClick = (buyorsell: BuyOrSell, value: number) => {
|
|
const onPriceClick = (buyorsell: BuyOrSell, value: number) => {
|
|
|
formData.BuyOrSell = buyorsell === BuyOrSell.Sell ? BuyOrSell.Buy : BuyOrSell.Sell
|
|
formData.BuyOrSell = buyorsell === BuyOrSell.Sell ? BuyOrSell.Buy : BuyOrSell.Sell
|
|
|
// if (isDisabled.value) {
|
|
// if (isDisabled.value) {
|
|
|
- qtyInputFocus()
|
|
|
|
|
|
|
+ qtyInputFocus()
|
|
|
// } else {
|
|
// } else {
|
|
|
- formData.OrderPrice = value
|
|
|
|
|
- // priceInputFocus()
|
|
|
|
|
|
|
+ formData.OrderPrice = value
|
|
|
|
|
+ // priceInputFocus()
|
|
|
// }
|
|
// }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -271,7 +273,7 @@ const onBeforeSubmit = (buildType: BuildType) => {
|
|
|
t('common.tips1'),
|
|
t('common.tips1'),
|
|
|
t('common.tips')
|
|
t('common.tips')
|
|
|
).then(() => onSubmit())
|
|
).then(() => onSubmit())
|
|
|
- } else {
|
|
|
|
|
|
|
+ } else {
|
|
|
onSubmit()
|
|
onSubmit()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|