|
|
@@ -1,12 +1,18 @@
|
|
|
import { isOemByEnum, OemType } from '@/common/config/projectName';
|
|
|
+import { TradeMode } from '@/common/constants/enumCommon';
|
|
|
import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
|
|
|
+import { queryTableList } from '@/common/setup/table';
|
|
|
import { hasSystemParam } from '@/hooks/system';
|
|
|
import { useHolderprice, useProfitloss } from '@/services/bus/holdPosition';
|
|
|
-import { getMarketTradePropertyByGoodsId } from '@/services/bus/market';
|
|
|
+import { getMarketIdsByTradeMode, getMarketTradePropertyByGoodsId } from '@/services/bus/market';
|
|
|
+import { getUserAccountType } from '@/services/bus/user';
|
|
|
import { AccountListItem } from '@/services/dataCenter/interafce/account';
|
|
|
import { queryTradePosition } from '@/services/go/ermcp/order';
|
|
|
import { QueryTradePositionRsp } from '@/services/go/ermcp/order/interface';
|
|
|
import { Taaccount } from '@/services/go/TaAccount/interface';
|
|
|
+import { queryQuoteGoodsList } from '@/services/go/Tjmd';
|
|
|
+import { QueryQuoteGoodsListReq, QueryQuoteGoodsListRsp } from '@/services/go/Tjmd/interface';
|
|
|
+import { findGoodsCode } from '@/views/order/swap_the_order/components/swap_commodity_contract_summary/setup';
|
|
|
import { ref, Ref } from 'vue';
|
|
|
|
|
|
export const tableColumns = () => {
|
|
|
@@ -142,7 +148,20 @@ export const useHazardRates = () => {
|
|
|
holdsList.value = res;
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
+ // 交割商品
|
|
|
+ const swapList = ref<QueryQuoteGoodsListRsp[]>([]);
|
|
|
+ function getSwapList() {
|
|
|
+ const { queryTable } = queryTableList<QueryQuoteGoodsListRsp>();
|
|
|
+ // 组装 参数
|
|
|
+ const marketids = getMarketIdsByTradeMode(TradeMode.DiaoQi)
|
|
|
+ const param: QueryQuoteGoodsListReq = {
|
|
|
+ usertype: getUserAccountType(),
|
|
|
+ }
|
|
|
+ if (marketids) {
|
|
|
+ param.marketids = marketids
|
|
|
+ }
|
|
|
+ queryTable(queryQuoteGoodsList, param).then(res => swapList.value = res)
|
|
|
+ }
|
|
|
// 获取报价小数位
|
|
|
function getDecimalplace() {
|
|
|
return holdsList.value.length > 0 ? holdsList.value[0].decimalplace : 2
|
|
|
@@ -160,7 +179,8 @@ export const useHazardRates = () => {
|
|
|
let temp = 0
|
|
|
if (tradeproperty === 1) {
|
|
|
// 资金 只算 收益权
|
|
|
- const profitloos = useProfitloss(current)
|
|
|
+ const goodscode = findGoodsCode(current.goodsid, current.goodscode, swapList.value)
|
|
|
+ const profitloos = useProfitloss(current, goodscode)
|
|
|
temp = profitloos === '--' ? 0 : Number(profitloos)
|
|
|
}
|
|
|
return acc + temp
|
|
|
@@ -247,6 +267,6 @@ export const useHazardRates = () => {
|
|
|
return result.toFixed(decimalplace)
|
|
|
}
|
|
|
|
|
|
- return { handleProfitloss, hazardRates, netWorth, canUseMoney, getHoldsList, handleHoldPrice }
|
|
|
+ return { handleProfitloss,getSwapList, hazardRates, netWorth, canUseMoney, getHoldsList, handleHoldPrice }
|
|
|
}
|
|
|
|