|
@@ -59,7 +59,6 @@ import { fullloading, dialog } from '@/utils/vant'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
import { useRequest } from '@/hooks/request'
|
|
|
import { queryMineTradePositionExs } from '@/services/api/transfer'
|
|
import { queryMineTradePositionExs } from '@/services/api/transfer'
|
|
|
import { useOrder } from '@/business/trade'
|
|
import { useOrder } from '@/business/trade'
|
|
|
-import { usePosition } from '@/business/position'
|
|
|
|
|
import { useAccountStore, useFuturesStore } from '@/stores'
|
|
import { useAccountStore, useFuturesStore } from '@/stores'
|
|
|
import AppModal from '@/components/base/modal/index.vue'
|
|
import AppModal from '@/components/base/modal/index.vue'
|
|
|
import { BuyOrSell } from '@/constants/order'
|
|
import { BuyOrSell } from '@/constants/order'
|
|
@@ -82,7 +81,6 @@ const props = defineProps({
|
|
|
const { formData, formSubmit } = useOrder()
|
|
const { formData, formSubmit } = useOrder()
|
|
|
const accountStore = useAccountStore()
|
|
const accountStore = useAccountStore()
|
|
|
const futuresStore = useFuturesStore()
|
|
const futuresStore = useFuturesStore()
|
|
|
-const { positionList } = usePosition(16)
|
|
|
|
|
const formRef = shallowRef<FormInstance>()
|
|
const formRef = shallowRef<FormInstance>()
|
|
|
const refresh = shallowRef(false) // 是否刷新父组件数据
|
|
const refresh = shallowRef(false) // 是否刷新父组件数据
|
|
|
const showModal = shallowRef(true)
|
|
const showModal = shallowRef(true)
|
|
@@ -131,13 +129,8 @@ const formRules: { [key in keyof Proto.OrderReq]?: FieldRule[] } = {
|
|
|
|
|
|
|
|
// 可用数量
|
|
// 可用数量
|
|
|
const enableqty = computed(() => {
|
|
const enableqty = computed(() => {
|
|
|
- if (quote.value?.trademode === 16) {
|
|
|
|
|
- const item = positionList.value.find((e) => e.goodsid === quote.value?.goodsid)
|
|
|
|
|
- return item?.enableqty ?? 0
|
|
|
|
|
- } else {
|
|
|
|
|
- const [firstItem] = dataList.value
|
|
|
|
|
- return firstItem ? firstItem.buycurpositionqty - firstItem.buyfrozenqty : 0
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ const [firstItem] = dataList.value
|
|
|
|
|
+ return firstItem ? firstItem.buycurpositionqty - firstItem.buyfrozenqty : 0
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const onPriceClick = (buyorsell: BuyOrSell, value: number) => {
|
|
const onPriceClick = (buyorsell: BuyOrSell, value: number) => {
|