|
|
@@ -20,7 +20,7 @@
|
|
|
@change="calculateListingAmount" />
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="priceMove === 3" prop="MarketMaxSub" label="点差">
|
|
|
- <el-input-number placeholder="请输入" :min="minBasis" :maxBasis="maxBasis" :precision="2"
|
|
|
+ <el-input-number placeholder="请输入" :min="minspread" :maxBasis="maxspread" :precision="2"
|
|
|
v-model="formData.MarketMaxSub" @change="calculateListingAmount" />
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="OrderQty" label="挂牌数量">
|
|
|
@@ -67,7 +67,6 @@ import { useAccountStore, useFuturesStore, useUserStore } from '@/stores'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
|
import { queryTjmdTodayAccountMargin } from '@/services/api/swap'
|
|
|
import AppDrawer from '@pc/components/base/drawer/index.vue'
|
|
|
-import { queryWrMarketTradeConfig } from '@/services/api/goods'
|
|
|
|
|
|
const props = defineProps({
|
|
|
quoteGoods: {
|
|
|
@@ -86,10 +85,6 @@ const priceMove = shallowRef(EPriceMode.PRICEMODE_LIMIT)
|
|
|
const amount = shallowRef(0.0)
|
|
|
/// 履约保证金
|
|
|
const permargin = shallowRef(0.0)
|
|
|
-/// 最大基差范围上限
|
|
|
-const maxBasis = shallowRef(1000.0)
|
|
|
-/// 最小基差范围下限
|
|
|
-const minBasis = shallowRef(-1000.0)
|
|
|
|
|
|
const { formData, formSubmit, loading } = useOrder()
|
|
|
const show = shallowRef(true)
|
|
|
@@ -97,6 +92,7 @@ const refresh = shallowRef(false)
|
|
|
const formRef = shallowRef<FormInstance>()
|
|
|
const qtyStepList = [1, 5, 10, 20, 30, 50] // 数量步长列表
|
|
|
const qtyStep = shallowRef(qtyStepList[0]) // 数量步长
|
|
|
+const { maxspread = 1000, minspread = -1000 } = futuresStore.getGoods(props.quoteGoods.goodsid) ?? {}
|
|
|
|
|
|
// 商品盘面
|
|
|
const quote = futuresStore.getGoodsQuote(props.quoteGoods.refgoodsid) ?? {}
|
|
|
@@ -106,8 +102,6 @@ const estimateprice = shallowRef(quote.value?.last ?? 0.0)
|
|
|
const margin = shallowRef<Model.TjmdTodayAccountMarginRsp>()
|
|
|
/// 商品信息
|
|
|
const goods = computed(() => futuresStore.getGoods(props.quoteGoods.goodsid))
|
|
|
-/// 市场交易参数配置
|
|
|
-const config = shallowRef<Model.WrMarketTradeConfigRsp>()
|
|
|
|
|
|
/// 查询交易保证金信息
|
|
|
useRequest(queryTjmdTodayAccountMargin, {
|
|
|
@@ -125,22 +119,6 @@ useRequest(queryTjmdTodayAccountMargin, {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
-/// 查询市场交易参数配置
|
|
|
-useRequest(queryWrMarketTradeConfig, {
|
|
|
- params: {
|
|
|
- marketid: userStore.getMarketId('TRADEMODE_TJMD')
|
|
|
- },
|
|
|
- onSuccess: (res) => {
|
|
|
- /// 数据赋值
|
|
|
- if (res.data.length != 0) {
|
|
|
- /// 获取参数
|
|
|
- config.value = res.data[0]
|
|
|
- /// 计算基差范围
|
|
|
- calculateBasis()
|
|
|
- }
|
|
|
- }
|
|
|
-})
|
|
|
-
|
|
|
const formRules: FormRules = {
|
|
|
OrderPrice: [{
|
|
|
required: true,
|
|
|
@@ -210,23 +188,6 @@ const calculateListingAmount = () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-/// 计算基差范围
|
|
|
-const calculateBasis = () => {
|
|
|
- /// 获取配置
|
|
|
- if (config.value) {
|
|
|
- const { basisdownratio, basisupratio } = config.value
|
|
|
- const { preclose = 0 } = quote.value ?? {}
|
|
|
- console.log(basisdownratio, basisupratio, preclose)
|
|
|
- /* 基差范围大小
|
|
|
- 基差价格可以为负或为0
|
|
|
- 基差范围:
|
|
|
- 最大值=基差取值上限百分比*关联期货合约昨收价
|
|
|
- 最小值= -1 * 基差取值下限百分比*关联期货合约昨收价 */
|
|
|
- maxBasis.value = basisupratio * preclose
|
|
|
- minBasis.value = -1.0 * basisdownratio * preclose
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
const onCancel = (isRefresh = false) => {
|
|
|
show.value = false
|
|
|
refresh.value = isRefresh
|