|
@@ -15,20 +15,23 @@
|
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item v-if="priceMove === 2" prop="OrderPrice" label="挂牌价格">
|
|
<el-form-item v-if="priceMove === 2" prop="OrderPrice" label="挂牌价格">
|
|
|
- <el-input-number placeholder="请输入" :min="0" :step="Math.pow(10, -1*(goods?.decimalplace ?? 0))" :precision="(goods?.decimalplace ?? 2)" v-model="formData.OrderPrice" @change="calculateListingAmount"/>
|
|
|
|
|
|
|
+ <el-input-number placeholder="请输入" :min="0" :step="Math.pow(10, -1 * (goods?.decimalplace ?? 0))"
|
|
|
|
|
+ :precision="(goods?.decimalplace ?? 2)" v-model="formData.OrderPrice"
|
|
|
|
|
+ @change="calculateListingAmount" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item v-if="priceMove === 3" prop="MarketMaxSub" label="点差">
|
|
<el-form-item v-if="priceMove === 3" prop="MarketMaxSub" label="点差">
|
|
|
- <el-input-number placeholder="请输入" :min="minBasis" :maxBasis="maxBasis" :precision="2" v-model="formData.MarketMaxSub" @change="calculateListingAmount" />
|
|
|
|
|
|
|
+ <el-input-number placeholder="请输入" :min="minBasis" :maxBasis="maxBasis" :precision="2"
|
|
|
|
|
+ v-model="formData.MarketMaxSub" @change="calculateListingAmount" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item prop="OrderQty" label="挂牌数量">
|
|
<el-form-item prop="OrderQty" label="挂牌数量">
|
|
|
<div class="g-qty-group">
|
|
<div class="g-qty-group">
|
|
|
- <el-input-number placeholder="请输入" :min="0" :precision="0" :step="qtyStep"
|
|
|
|
|
- v-model="formData.OrderQty" @change="calculateListingAmount" />
|
|
|
|
|
|
|
+ <el-input-number placeholder="请输入" :min="0" :precision="0" :step="qtyStep" v-model="formData.OrderQty"
|
|
|
|
|
+ @change="calculateListingAmount" />
|
|
|
<el-radio-group size="small" v-model="qtyStep" @change="onRadioChange">
|
|
<el-radio-group size="small" v-model="qtyStep" @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" border />
|
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
|
</div>
|
|
</div>
|
|
|
- </el-form-item>
|
|
|
|
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="交易账号">
|
|
<el-form-item label="交易账号">
|
|
|
<span>{{ accountStore.currentAccountId }}</span>
|
|
<span>{{ accountStore.currentAccountId }}</span>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -102,7 +105,7 @@ const estimateprice = shallowRef(quote.value?.last ?? 0.0)
|
|
|
/// 保证金参数设置
|
|
/// 保证金参数设置
|
|
|
const margin = shallowRef<Model.TjmdTodayAccountMarginRsp>()
|
|
const margin = shallowRef<Model.TjmdTodayAccountMarginRsp>()
|
|
|
/// 商品信息
|
|
/// 商品信息
|
|
|
-const goods = computed(() => futuresStore.getGoods(props.quoteGoods.goodsid) )
|
|
|
|
|
|
|
+const goods = computed(() => futuresStore.getGoods(props.quoteGoods.goodsid))
|
|
|
/// 市场交易参数配置
|
|
/// 市场交易参数配置
|
|
|
const config = shallowRef<Model.WrMarketTradeConfigRsp>()
|
|
const config = shallowRef<Model.WrMarketTradeConfigRsp>()
|
|
|
|
|
|
|
@@ -161,13 +164,8 @@ const formRules: FormRules = {
|
|
|
}],
|
|
}],
|
|
|
MarketMaxSub: [{
|
|
MarketMaxSub: [{
|
|
|
required: true,
|
|
required: true,
|
|
|
- validator: (rule, value, callback) => {
|
|
|
|
|
- if (value) {
|
|
|
|
|
- callback()
|
|
|
|
|
- } else {
|
|
|
|
|
- callback(new Error('请输入点差'))
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ type: 'number',
|
|
|
|
|
+ message: '请输入点差'
|
|
|
}],
|
|
}],
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -188,45 +186,45 @@ const calculateListingAmount = () => {
|
|
|
const { agreeunit = 0 } = goods.value ?? {}
|
|
const { agreeunit = 0 } = goods.value ?? {}
|
|
|
/// 按比例
|
|
/// 按比例
|
|
|
if (MarginAlgorithm === 1) {
|
|
if (MarginAlgorithm === 1) {
|
|
|
- permargin.value = OrderPrice*OrderQty*agreeunit*MarketMarginValue
|
|
|
|
|
|
|
+ permargin.value = OrderPrice * OrderQty * agreeunit * MarketMarginValue
|
|
|
} else {
|
|
} else {
|
|
|
- permargin.value = OrderQty*MarketMarginValue
|
|
|
|
|
|
|
+ permargin.value = OrderQty * MarketMarginValue
|
|
|
}
|
|
}
|
|
|
- amount.value = OrderQty*OrderPrice*agreeunit
|
|
|
|
|
|
|
+ amount.value = OrderQty * OrderPrice * agreeunit
|
|
|
} else {
|
|
} else {
|
|
|
const last = futuresStore.getQuotePrice(props.quoteGoods.refgoodscode)
|
|
const last = futuresStore.getQuotePrice(props.quoteGoods.refgoodscode)
|
|
|
const basic = formData.MarketMaxSub ?? 0.0
|
|
const basic = formData.MarketMaxSub ?? 0.0
|
|
|
/// 浮动估算价价
|
|
/// 浮动估算价价
|
|
|
- estimateprice.value = basic+last.value
|
|
|
|
|
|
|
+ estimateprice.value = basic + last.value
|
|
|
const { MarginAlgorithm, MarketMarginValue } = margin.value?.infoc
|
|
const { MarginAlgorithm, MarketMarginValue } = margin.value?.infoc
|
|
|
const { OrderQty = 0 } = formData
|
|
const { OrderQty = 0 } = formData
|
|
|
const { agreeunit = 0 } = goods.value ?? {}
|
|
const { agreeunit = 0 } = goods.value ?? {}
|
|
|
/// 按比例
|
|
/// 按比例
|
|
|
if (MarginAlgorithm === 1) {
|
|
if (MarginAlgorithm === 1) {
|
|
|
- permargin.value = estimateprice.value*OrderQty*agreeunit*MarketMarginValue
|
|
|
|
|
|
|
+ permargin.value = estimateprice.value * OrderQty * agreeunit * MarketMarginValue
|
|
|
} else {
|
|
} else {
|
|
|
- permargin.value = OrderQty*MarketMarginValue
|
|
|
|
|
|
|
+ permargin.value = OrderQty * MarketMarginValue
|
|
|
}
|
|
}
|
|
|
- amount.value = OrderQty*estimateprice.value*agreeunit
|
|
|
|
|
|
|
+ amount.value = OrderQty * estimateprice.value * agreeunit
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/// 计算基差范围
|
|
/// 计算基差范围
|
|
|
const calculateBasis = () => {
|
|
const calculateBasis = () => {
|
|
|
- /// 获取配置
|
|
|
|
|
- if (config.value) {
|
|
|
|
|
- const { basisdownratio, basisupratio} = config.value
|
|
|
|
|
|
|
+ /// 获取配置
|
|
|
|
|
+ if (config.value) {
|
|
|
|
|
+ const { basisdownratio, basisupratio } = config.value
|
|
|
const { preclose = 0 } = quote.value ?? {}
|
|
const { preclose = 0 } = quote.value ?? {}
|
|
|
console.log(basisdownratio, basisupratio, preclose)
|
|
console.log(basisdownratio, basisupratio, preclose)
|
|
|
- /* 基差范围大小
|
|
|
|
|
- 基差价格可以为负或为0
|
|
|
|
|
- 基差范围:
|
|
|
|
|
- 最大值=基差取值上限百分比*关联期货合约昨收价
|
|
|
|
|
- 最小值= -1 * 基差取值下限百分比*关联期货合约昨收价 */
|
|
|
|
|
- maxBasis.value = basisupratio*preclose
|
|
|
|
|
- minBasis.value = -1.0*basisdownratio*preclose
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ /* 基差范围大小
|
|
|
|
|
+ 基差价格可以为负或为0
|
|
|
|
|
+ 基差范围:
|
|
|
|
|
+ 最大值=基差取值上限百分比*关联期货合约昨收价
|
|
|
|
|
+ 最小值= -1 * 基差取值下限百分比*关联期货合约昨收价 */
|
|
|
|
|
+ maxBasis.value = basisupratio * preclose
|
|
|
|
|
+ minBasis.value = -1.0 * basisdownratio * preclose
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const onCancel = (isRefresh = false) => {
|
|
const onCancel = (isRefresh = false) => {
|
|
@@ -239,7 +237,7 @@ const onSubmit = () => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
ElMessageBox.confirm('是否立即挂牌?').then(() => {
|
|
ElMessageBox.confirm('是否立即挂牌?').then(() => {
|
|
|
/// 买卖方向
|
|
/// 买卖方向
|
|
|
- const { goodsid } = props.quoteGoods?? {}
|
|
|
|
|
|
|
+ const { goodsid } = props.quoteGoods ?? {}
|
|
|
/// 获取对应的市场ID
|
|
/// 获取对应的市场ID
|
|
|
formData.MarketID = futuresStore.getGoodsMarket(goodsid)
|
|
formData.MarketID = futuresStore.getGoodsMarket(goodsid)
|
|
|
formData.OrderPrice = priceMove.value === EPriceMode.PRICEMODE_LIMIT ? formData.OrderPrice : 0.0
|
|
formData.OrderPrice = priceMove.value === EPriceMode.PRICEMODE_LIMIT ? formData.OrderPrice : 0.0
|