|
@@ -7,7 +7,7 @@
|
|
|
<a-form class="inlineForm" ref="formRef" :model="formData" :rules="rules">
|
|
<a-form class="inlineForm" ref="formRef" :model="formData" :rules="rules">
|
|
|
<a-form-item label="账号">
|
|
<a-form-item label="账号">
|
|
|
<a-select class="inlineFormSelect" placeholder="请选择" v-model:value="formData.AccountID">
|
|
<a-select class="inlineFormSelect" placeholder="请选择" v-model:value="formData.AccountID">
|
|
|
- <a-select-option v-for="item in accountList" :value="item.accountid" :key="item.accountid">{{ item.accountname }}</a-select-option>
|
|
|
|
|
|
|
+ <a-select-option v-for="item in accountList" :value="item.accountid" :key="item.accountid">{{ item.accountname }} - {{item.accountid}}</a-select-option>
|
|
|
</a-select>
|
|
</a-select>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
<a-form-item label="合约">
|
|
<a-form-item label="合约">
|
|
@@ -21,15 +21,15 @@
|
|
|
</a-select>
|
|
</a-select>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
<a-form-item class="inputIconBox" label="交易价格" name="OrderPrice">
|
|
<a-form-item class="inputIconBox" label="交易价格" name="OrderPrice">
|
|
|
- <!-- 限价类型不可修改 -->
|
|
|
|
|
- <template v-if="formData.PriceMode === PriceType.limit">
|
|
|
|
|
- <a-input-number class="commonInput" :value="selectedGoods.last" style="width:100%" disabled />
|
|
|
|
|
- </template>
|
|
|
|
|
- <template v-else>
|
|
|
|
|
|
|
+ <!-- 限价可修改 -->
|
|
|
|
|
+ <template v-if="selectedPriceMode === 3">
|
|
|
<a-input-number class="commonInput" v-model:value="formData.OrderPrice" style="width:100%" />
|
|
<a-input-number class="commonInput" v-model:value="formData.OrderPrice" style="width:100%" />
|
|
|
<MinusOutlined />
|
|
<MinusOutlined />
|
|
|
<PlusOutlined />
|
|
<PlusOutlined />
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+ <template v-else>
|
|
|
|
|
+ <a-input-number class="commonInput" :value="selectedGoods.last" style="width:100%" disabled />
|
|
|
|
|
+ </template>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
<a-form-item class="inputIconBox" label="交易数量" name="OrderQty">
|
|
<a-form-item class="inputIconBox" label="交易数量" name="OrderQty">
|
|
|
<a-input-number class="commonInput" :min="1" v-model:value="formData.OrderQty" style="width:100%" />
|
|
<a-input-number class="commonInput" :min="1" v-model:value="formData.OrderQty" style="width:100%" />
|
|
@@ -38,14 +38,17 @@
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-form>
|
|
</a-form>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="futures_trade__submit" v-show="selectedGoods.last">
|
|
|
|
|
|
|
+ <div class="futures_trade__submit">
|
|
|
<a-button :loading="loading" @click="submit('buy')">
|
|
<a-button :loading="loading" @click="submit('buy')">
|
|
|
|
|
+ <span>{{buyPrice}}</span>
|
|
|
<span>买入</span>
|
|
<span>买入</span>
|
|
|
</a-button>
|
|
</a-button>
|
|
|
<a-button :loading="loading" @click="submit('sell')">
|
|
<a-button :loading="loading" @click="submit('sell')">
|
|
|
|
|
+ <span>{{sellPrice}}</span>
|
|
|
<span>卖出</span>
|
|
<span>卖出</span>
|
|
|
</a-button>
|
|
</a-button>
|
|
|
<a-button :loading="loading" @click="submit('close')">
|
|
<a-button :loading="loading" @click="submit('close')">
|
|
|
|
|
+ <span>优先平今</span>
|
|
|
<span>平仓</span>
|
|
<span>平仓</span>
|
|
|
</a-button>
|
|
</a-button>
|
|
|
</div>
|
|
</div>
|
|
@@ -88,6 +91,11 @@ export default defineComponent({
|
|
|
const formRef = ref();
|
|
const formRef = ref();
|
|
|
const loading = ref<boolean>(false);
|
|
const loading = ref<boolean>(false);
|
|
|
|
|
|
|
|
|
|
+ // 买价
|
|
|
|
|
+ const buyPrice = ref(0);
|
|
|
|
|
+ // 卖价
|
|
|
|
|
+ const sellPrice = ref(0);
|
|
|
|
|
+
|
|
|
// 选中的商品合约
|
|
// 选中的商品合约
|
|
|
const selectedGoods = ref<TableQuote>(props.selectedRow);
|
|
const selectedGoods = ref<TableQuote>(props.selectedRow);
|
|
|
// 选中的价格类型
|
|
// 选中的价格类型
|
|
@@ -104,8 +112,16 @@ export default defineComponent({
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
priceType: 2,
|
|
priceType: 2,
|
|
|
|
|
+ priceName: '对手价',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ priceType: 3,
|
|
|
priceName: '限价',
|
|
priceName: '限价',
|
|
|
},
|
|
},
|
|
|
|
|
+ {
|
|
|
|
|
+ priceType: 4,
|
|
|
|
|
+ priceName: '超价',
|
|
|
|
|
+ },
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
// 选择商品合约
|
|
// 选择商品合约
|
|
@@ -114,12 +130,34 @@ export default defineComponent({
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 选择价格类型
|
|
// 选择价格类型
|
|
|
- function priceModeChange(value: number) {
|
|
|
|
|
- if (value === 1) {
|
|
|
|
|
|
|
+ function priceModeChange(priceType: number) {
|
|
|
|
|
+ // 除了市价,其它价格类型都属于限价
|
|
|
|
|
+ if (priceType === 1) {
|
|
|
formData.PriceMode = PriceType.market;
|
|
formData.PriceMode = PriceType.market;
|
|
|
} else {
|
|
} else {
|
|
|
formData.PriceMode = PriceType.limit;
|
|
formData.PriceMode = PriceType.limit;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ const { last } = selectedGoods.value;
|
|
|
|
|
+ switch (priceType) {
|
|
|
|
|
+ // 最新价
|
|
|
|
|
+ case 1: {
|
|
|
|
|
+ formData.OrderPrice = last;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ // 市价
|
|
|
|
|
+ case 2: {
|
|
|
|
|
+ }
|
|
|
|
|
+ // 对手价
|
|
|
|
|
+ case 3: {
|
|
|
|
|
+ }
|
|
|
|
|
+ // 限价
|
|
|
|
|
+ case 4: {
|
|
|
|
|
+ }
|
|
|
|
|
+ // 超价
|
|
|
|
|
+ case 5: {
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function submit(submitType: 'buy' | 'sell' | 'close') {
|
|
function submit(submitType: 'buy' | 'sell' | 'close') {
|
|
@@ -140,12 +178,6 @@ export default defineComponent({
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- if (formData.PriceMode === PriceType.limit) {
|
|
|
|
|
- const { last } = selectedGoods.value;
|
|
|
|
|
- formData.OrderPrice = last;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
// 表单验证
|
|
// 表单验证
|
|
|
validateAction(formRef, formData).then((res) => {
|
|
validateAction(formRef, formData).then((res) => {
|
|
|
requestResultLoadingAndInfo(channelOrderReq, res, loading, ['成功', '失败:']).then(() => {
|
|
requestResultLoadingAndInfo(channelOrderReq, res, loading, ['成功', '失败:']).then(() => {
|
|
@@ -162,6 +194,8 @@ export default defineComponent({
|
|
|
rules,
|
|
rules,
|
|
|
formRef,
|
|
formRef,
|
|
|
formData,
|
|
formData,
|
|
|
|
|
+ buyPrice,
|
|
|
|
|
+ sellPrice,
|
|
|
selectedGoods,
|
|
selectedGoods,
|
|
|
goodsChange,
|
|
goodsChange,
|
|
|
priceModeList,
|
|
priceModeList,
|