|
@@ -62,7 +62,7 @@ import { useComponent } from '@/hooks/component'
|
|
|
import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
|
|
import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
|
|
|
import { getBuyOrSellName, BuyOrSell } from '@/constants/order'
|
|
import { getBuyOrSellName, BuyOrSell } from '@/constants/order'
|
|
|
import { formatDecimal, handleNumberValue } from '@/filters'
|
|
import { formatDecimal, handleNumberValue } from '@/filters'
|
|
|
-import { useGlobalStore, useUserStore, usePositionStore } from '@/stores'
|
|
|
|
|
|
|
+import { useGlobalStore, useUserStore, usePositionStore, useFuturesStore } from '@/stores'
|
|
|
|
|
|
|
|
const componentMap = new Map<string, unknown>([
|
|
const componentMap = new Map<string, unknown>([
|
|
|
['close', defineAsyncComponent(() => import('../close/Index.vue'))],
|
|
['close', defineAsyncComponent(() => import('../close/Index.vue'))],
|
|
@@ -73,10 +73,12 @@ const componentMap = new Map<string, unknown>([
|
|
|
const globalStore = useGlobalStore()
|
|
const globalStore = useGlobalStore()
|
|
|
const userStore = useUserStore()
|
|
const userStore = useUserStore()
|
|
|
const positionStore = usePositionStore()
|
|
const positionStore = usePositionStore()
|
|
|
|
|
+const futuresStore = useFuturesStore()
|
|
|
const selectedRow = shallowRef<Model.TradePositionRsp>()
|
|
const selectedRow = shallowRef<Model.TradePositionRsp>()
|
|
|
const pullRefreshRef = shallowRef()
|
|
const pullRefreshRef = shallowRef()
|
|
|
|
|
|
|
|
const positionList = computed(() => positionStore.getPositionListByTradeMode(50, 16))
|
|
const positionList = computed(() => positionStore.getPositionListByTradeMode(50, 16))
|
|
|
|
|
+const goodsList = computed(() => futuresStore.goodsList.filter((a) => positionList.value.some((b) => b.goodsid === a.goodsid)))
|
|
|
|
|
|
|
|
const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
|
|
const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
|
|
|
pullRefreshRef.value?.refresh()
|
|
pullRefreshRef.value?.refresh()
|
|
@@ -85,8 +87,12 @@ const { componentRef, componentId, openComponent, closeComponent } = useComponen
|
|
|
const showDelivery = (row: Model.TradePositionRsp) => {
|
|
const showDelivery = (row: Model.TradePositionRsp) => {
|
|
|
if (globalStore.hasSystemModule('delivery')) {
|
|
if (globalStore.hasSystemModule('delivery')) {
|
|
|
// #5741
|
|
// #5741
|
|
|
- const market = userStore.userData.markets.find((e) => e.marketid === row.marketid)
|
|
|
|
|
- return row.buyorsell === BuyOrSell.Buy || market?.isdeliverysellercanapply === 1
|
|
|
|
|
|
|
+ const { markets, userInfo } = userStore.userData
|
|
|
|
|
+ const market = markets.find((e) => e.marketid === row.marketid)
|
|
|
|
|
+ // 是否供应商
|
|
|
|
|
+ const isProvider = goodsList.value.some((e) => e.goodsid === row.goodsid && e.provideruserid === userInfo.userid)
|
|
|
|
|
+
|
|
|
|
|
+ return isProvider || row.buyorsell === BuyOrSell.Buy || market?.isdeliverysellercanapply === 1
|
|
|
}
|
|
}
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|