|
|
@@ -68,12 +68,14 @@ import { BuyOrSell, getBuyOrSellList } from '@/constants/order'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
|
import { queryMineTradePositionExs } from '@/services/api/transfer'
|
|
|
import { useOrder } from '@/business/trade'
|
|
|
+import { usePosition } from '@/business/position'
|
|
|
import { useFuturesStore, useSettingStore } from '@/stores'
|
|
|
import Forex from '@pc/components/modules/quote/forex/index.vue'
|
|
|
import Icon from '@pc/components/base/icon/index.vue'
|
|
|
|
|
|
const settingStore = useSettingStore()
|
|
|
const futuresStore = useFuturesStore()
|
|
|
+const { getOrderQty, positionList: ll } = usePosition(16)
|
|
|
const { selectedGoodsId, selectedGoods, marketGoodsList } = futuresStore.$toRefs()
|
|
|
const { formData, loading, formSubmit } = useOrder()
|
|
|
const formRef = shallowRef<FormInstance>()
|
|
|
@@ -97,8 +99,14 @@ const { dataList: positionList, run: getMineTradePositionExs } = useRequest(quer
|
|
|
|
|
|
// 可用数量
|
|
|
const enableqty = computed(() => {
|
|
|
- const [firstItem] = positionList.value
|
|
|
- return firstItem ? firstItem.buycurpositionqty - firstItem.buyfrozenqty : 0
|
|
|
+ console.log(ll.value, selectedGoods.value)
|
|
|
+ if (selectedGoods.value?.trademode === 16) {
|
|
|
+
|
|
|
+ return getOrderQty(BuyOrSell.Buy, selectedGoodsId.value)
|
|
|
+ } else {
|
|
|
+ const [firstItem] = positionList.value
|
|
|
+ return firstItem ? firstItem.buycurpositionqty - firstItem.buyfrozenqty : 0
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
// 价格步长
|
|
|
@@ -165,8 +173,8 @@ const onSubmit = () => {
|
|
|
formRef.value?.validate((valid) => {
|
|
|
if (valid) {
|
|
|
ElMessageBox.confirm(
|
|
|
- '*若存在价格匹配的反方向委托订单,系统将会自动撤销。',
|
|
|
- '是否立即挂牌?'
|
|
|
+ '是否立即挂牌?',
|
|
|
+ '提示'
|
|
|
).then(() => {
|
|
|
const { marketid = 0, goodsid = 0 } = selectedGoods.value ?? {}
|
|
|
formData.MarketID = marketid
|