|
|
@@ -2,12 +2,13 @@ import { BuyOrSell } from "@/common/constants/enumCommon";
|
|
|
import { EnumRouterName } from "@/common/constants/enumRouterName";
|
|
|
import { queryResultLoadingAndInfo } from "@/common/methods/request/resultInfo";
|
|
|
import { getAccountTypeList, getCanUseMoney } from "@/services/bus/account";
|
|
|
+import { getGoodsAgreeunitByGoodsCode, getQuoteDayInfoByCodeFindPrice } from "@/services/bus/goods";
|
|
|
import { getRules } from '@/services/bus/rules';
|
|
|
import { AccountListItem } from "@/services/dataCenter/interafce/account";
|
|
|
import { queryHoldLB, queryWrPosition } from '@/services/go/wrtrade';
|
|
|
import { QueryWrPositionReq, WrFAProductDetail, WrHoldLB, WrOrderQuote, WrOrderQuoteDetail, WrPosition } from "@/services/go/wrtrade/interface";
|
|
|
import { reactive, Ref, ref, UnwrapRef } from "vue";
|
|
|
-import { getGoodsPrice, handleIs } from "../../setup";
|
|
|
+import { handleIs } from "../../setup";
|
|
|
import { ListingForm, Wrhold } from "./interface";
|
|
|
|
|
|
export const selecedFinance = ref<WrFAProductDetail>()
|
|
|
@@ -104,11 +105,11 @@ export function handleNumAndMoney(enumName: EnumRouterName, buyOrSell: BuyOrSell
|
|
|
const canUseMoney = Number(getCanUseMoney(getSelectedAccount() as AccountListItem))
|
|
|
if (!isBuy()) {
|
|
|
if (isFloat()) {
|
|
|
- const goodsPrice = getGoodsPrice()
|
|
|
+ const goodsPrice = getQuoteDayInfoByCodeFindPrice(parantSelectedRow.goodscode);
|
|
|
// 估算总价=挂牌基差+期货合约价;
|
|
|
- if (goodsPrice.value && goodsPrice.value !== '--') { // 有实时行情价格
|
|
|
+ if (goodsPrice && goodsPrice !== '--') { // 有实时行情价格
|
|
|
// 估算总价
|
|
|
- const predictTotal = pricemove + (goodsPrice.value as number);
|
|
|
+ const predictTotal = pricemove + (goodsPrice as number);
|
|
|
// 买方履约保证金比例*估算总价
|
|
|
const marginMoney = marginMethod() ? (buymarginvalue * predictTotal) : (buymarginvalue + predictTotal)
|
|
|
// 浮动价 摘买 最大数量=min{可用资金/(买方履约保证金比例*估算总价),挂牌数量}
|
|
|
@@ -145,12 +146,13 @@ export function handleNumAndMoney(enumName: EnumRouterName, buyOrSell: BuyOrSell
|
|
|
function getMoney() {
|
|
|
let result = 0
|
|
|
if (isFloat()) {
|
|
|
- const goodsPrice = getGoodsPrice()
|
|
|
- if (goodsPrice.value && goodsPrice.value !== '--') { // 有实时行情价格
|
|
|
+ const goodsPrice = getQuoteDayInfoByCodeFindPrice(parantSelectedRow.goodscode);
|
|
|
+ const agreeunit = getGoodsAgreeunitByGoodsCode(parantSelectedRow.goodscode);
|
|
|
+ if (goodsPrice && goodsPrice !== '--') { // 有实时行情价格
|
|
|
// 估算总价=挂牌基差+期货合约价;
|
|
|
- const predictTotal = pricemove + (goodsPrice.value as number);
|
|
|
+ const predictTotal = pricemove + (goodsPrice as number);
|
|
|
// 估算总额=估算总价*摘牌数量;
|
|
|
- result = predictTotal * formState.num
|
|
|
+ result = predictTotal * formState.num * agreeunit
|
|
|
}
|
|
|
} else {
|
|
|
// 摘牌金额=挂牌价格*摘牌数量
|