|
@@ -44,14 +44,17 @@
|
|
|
</ul>
|
|
</ul>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="g-order-list__btnbar" v-if="item.enableqty">
|
|
<div class="g-order-list__btnbar" v-if="item.enableqty">
|
|
|
- <Button size="small" @click="showComponent('close', item)" round>{{ $t('operation.transfer') }}</Button>
|
|
|
|
|
- <Button size="small" @click="showComponent(item.trademode === 16 ? 'delivery16' : 'delivery50', item)"
|
|
|
|
|
- round v-if="showDelivery(item)">{{ $t('operation.delivery') }}</Button>
|
|
|
|
|
|
|
+ <Button size="small" @click="showCloseComponent(item)" round>
|
|
|
|
|
+ {{ $t('operation.transfer') }}
|
|
|
|
|
+ </Button>
|
|
|
|
|
+ <Button size="small" @click="showDeliveryComponent(item)" round v-if="showDelivery(item)">
|
|
|
|
|
+ {{ $t('operation.delivery') }}
|
|
|
|
|
+ </Button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <component ref="componentRef" v-bind="{ selectedRow }" :is="componentMap.get(componentId)" @closed="closeComponent"
|
|
|
|
|
- v-if="componentId" />
|
|
|
|
|
|
|
+ <component ref="componentRef" v-bind="{ selectedRow }" :is="componentMap.get(componentId)"
|
|
|
|
|
+ @closed="closeComponent" v-if="componentId" />
|
|
|
</app-pull-refresh>
|
|
</app-pull-refresh>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -62,7 +65,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, useFuturesStore } from '@/stores'
|
|
|
|
|
|
|
+import { useGlobalStore, useUserStore, usePositionStore, useFuturesStore, useDeliveryRelationStore } 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'))],
|
|
@@ -74,6 +77,7 @@ const globalStore = useGlobalStore()
|
|
|
const userStore = useUserStore()
|
|
const userStore = useUserStore()
|
|
|
const positionStore = usePositionStore()
|
|
const positionStore = usePositionStore()
|
|
|
const futuresStore = useFuturesStore()
|
|
const futuresStore = useFuturesStore()
|
|
|
|
|
+const deliveryRelationStore = useDeliveryRelationStore()
|
|
|
const selectedRow = shallowRef<Model.TradePositionRsp>()
|
|
const selectedRow = shallowRef<Model.TradePositionRsp>()
|
|
|
const pullRefreshRef = shallowRef()
|
|
const pullRefreshRef = shallowRef()
|
|
|
|
|
|
|
@@ -86,6 +90,15 @@ const { componentRef, componentId, openComponent, closeComponent } = useComponen
|
|
|
|
|
|
|
|
const showDelivery = (row: Model.TradePositionRsp) => {
|
|
const showDelivery = (row: Model.TradePositionRsp) => {
|
|
|
if (globalStore.hasSystemModule('delivery')) {
|
|
if (globalStore.hasSystemModule('delivery')) {
|
|
|
|
|
+ // #6084
|
|
|
|
|
+ if (row.trademode === 16) {
|
|
|
|
|
+ const item = deliveryRelationStore.getDeliveryRelationByGoodsId(row.goodsid)
|
|
|
|
|
+ if (item && [1, 4].includes(item.deliverymode)) {
|
|
|
|
|
+ if (item.deliverymode === 1) return true
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
// #5741
|
|
// #5741
|
|
|
const { markets, userInfo } = userStore.userData
|
|
const { markets, userInfo } = userStore.userData
|
|
|
const market = markets.find((e) => e.marketid === row.marketid)
|
|
const market = markets.find((e) => e.marketid === row.marketid)
|
|
@@ -97,13 +110,24 @@ const showDelivery = (row: Model.TradePositionRsp) => {
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// 持仓列表刷新
|
|
|
|
|
-const onRefresh = () => {
|
|
|
|
|
- positionStore.getTradePosition()
|
|
|
|
|
|
|
+const showCloseComponent = (row: Model.TradePositionRsp) => {
|
|
|
|
|
+ selectedRow.value = row
|
|
|
|
|
+ openComponent('close')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const showComponent = (componentName: string, row: Model.TradePositionRsp) => {
|
|
|
|
|
|
|
+const showDeliveryComponent = (row: Model.TradePositionRsp) => {
|
|
|
|
|
+ const item = deliveryRelationStore.getDeliveryRelationByGoodsId(row.goodsid)
|
|
|
selectedRow.value = row
|
|
selectedRow.value = row
|
|
|
- openComponent(componentName)
|
|
|
|
|
|
|
+ // #6084
|
|
|
|
|
+ if (row.trademode === 16 && item?.deliverymode === 1) {
|
|
|
|
|
+ openComponent('delivery16')
|
|
|
|
|
+ } else {
|
|
|
|
|
+ openComponent('delivery50')
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 持仓列表刷新
|
|
|
|
|
+const onRefresh = () => {
|
|
|
|
|
+ positionStore.getTradePosition()
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|