|
|
@@ -3,7 +3,7 @@
|
|
|
<app-modal direction="right" height="100%" v-model:show="showModal" :refresh="refresh">
|
|
|
<app-view class="g-form">
|
|
|
<template #header>
|
|
|
- <app-navbar title="转让" @back="closed" />
|
|
|
+ <app-navbar title="挂牌" @back="closed" />
|
|
|
</template>
|
|
|
<component :is="Price" v-bind="{ goodsCode }" />
|
|
|
<component :is="Forex" v-bind="{ goodsCode, showMore: false }" @price-click="onPriceClick" />
|
|
|
@@ -59,7 +59,7 @@ import { fullloading, dialog } from '@/utils/vant'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
|
import { queryMineTradePositionExs } from '@/services/api/transfer'
|
|
|
import { useOrder } from '@/business/trade'
|
|
|
-import { useAccountStore, useFuturesStore } from '@/stores'
|
|
|
+import { useAccountStore, useFuturesStore, usePositionStore } from '@/stores'
|
|
|
import AppModal from '@/components/base/modal/index.vue'
|
|
|
import { BuyOrSell } from '@/constants/order'
|
|
|
import { EPriceMode, EValidType, EListingSelectType, EBuildType, EDelistingType } from '@/constants/client'
|
|
|
@@ -81,6 +81,7 @@ const props = defineProps({
|
|
|
const { formData, formSubmit } = useOrder()
|
|
|
const accountStore = useAccountStore()
|
|
|
const futuresStore = useFuturesStore()
|
|
|
+const positionStore = usePositionStore()
|
|
|
const formRef = shallowRef<FormInstance>()
|
|
|
const refresh = shallowRef(false) // 是否刷新父组件数据
|
|
|
const showModal = shallowRef(true)
|
|
|
@@ -129,8 +130,13 @@ const formRules: { [key in keyof Proto.OrderReq]?: FieldRule[] } = {
|
|
|
|
|
|
// 可用数量
|
|
|
const enableqty = computed(() => {
|
|
|
- const [firstItem] = positionList.value
|
|
|
- return firstItem ? firstItem.buycurpositionqty - firstItem.buyfrozenqty : 0
|
|
|
+ if (quote.value?.trademode === 16) {
|
|
|
+ const item = positionStore.positionList.find((e) => e.trademode === 16 && e.goodsid === quote.value?.goodsid)
|
|
|
+ return item?.enableqty ?? 0
|
|
|
+ } else {
|
|
|
+ const [firstItem] = positionList.value
|
|
|
+ return firstItem ? firstItem.buycurpositionqty - firstItem.buyfrozenqty : 0
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
const onPriceClick = (buyorsell: BuyOrSell, value: number) => {
|