|
|
@@ -30,7 +30,7 @@
|
|
|
import { shallowRef, computed, onMounted } from 'vue'
|
|
|
import { handleNumberValue, formatDecimal } from '@/filters'
|
|
|
import { BuyOrSell, getBuyOrSellName } from '@/constants/order'
|
|
|
-import { usePositionStore, useUserStore, useFuturesStore, i18n } from '@/stores'
|
|
|
+import { usePositionStore, useUserStore, useFuturesStore, useDeliveryRelationStore, i18n } from '@/stores'
|
|
|
import AppTable from '@pc/components/base/table/index.vue'
|
|
|
import AppAuthOperation from '@pc/components/modules/auth-operation/index.vue'
|
|
|
|
|
|
@@ -42,6 +42,7 @@ const { global: { t } } = i18n
|
|
|
const userStore = useUserStore()
|
|
|
const positionStore = usePositionStore()
|
|
|
const futuresStore = useFuturesStore()
|
|
|
+const deliveryRelationStore = useDeliveryRelationStore()
|
|
|
|
|
|
const positionList = computed(() => positionStore.getPositionListByTradeMode(50, 16))
|
|
|
const goodsList = computed(() => futuresStore.goodsList.filter((a) => positionList.value.some((b) => b.goodsid === a.goodsid)))
|
|
|
@@ -62,24 +63,27 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
|
|
|
const handleOperateButtons = (row: Model.TradePositionRsp) => {
|
|
|
const buttons = ['bottom_goods_position_transfer']
|
|
|
- switch (row.trademode) {
|
|
|
- case 16: {
|
|
|
- buttons.push('bottom_goods_position_delivery16')
|
|
|
- break;
|
|
|
- }
|
|
|
- case 50: {
|
|
|
- // #5741
|
|
|
- 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)
|
|
|
-
|
|
|
- if (isProvider || row.buyorsell === BuyOrSell.Buy || market?.isdeliverysellercanapply === 1) {
|
|
|
- buttons.push('bottom_goods_position_delivery50')
|
|
|
+ // #6084
|
|
|
+ if (row.trademode === 16) {
|
|
|
+ const item = deliveryRelationStore.getDeliveryRelationByGoodsId(row.goodsid)
|
|
|
+ if (item && [1, 4].includes(item.deliverymode)) {
|
|
|
+ if (item.deliverymode === 1) {
|
|
|
+ buttons.push('bottom_goods_position_delivery16')
|
|
|
+ return buttons
|
|
|
}
|
|
|
- break;
|
|
|
+ } else {
|
|
|
+ return buttons
|
|
|
}
|
|
|
}
|
|
|
+ // #5741
|
|
|
+ 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)
|
|
|
+
|
|
|
+ if (isProvider || row.buyorsell === BuyOrSell.Buy || market?.isdeliverysellercanapply === 1) {
|
|
|
+ buttons.push('bottom_goods_position_delivery50')
|
|
|
+ }
|
|
|
return buttons
|
|
|
}
|
|
|
|