refactor(tradeEdit): use统一格式化方法处理名义金额

This commit is contained in:
zheng.zhang
2026-06-26 16:05:04 +08:00
committed by 嬴政 时
parent c76976e141
commit 2e21d799dc
@@ -606,15 +606,15 @@ var vue = new Vue({
},
//变更交易手数
changeLots() {
this.trade.Notional = this.trade.Lots * this.viewState.underlying.ContractSize;
this.trade.Notional = consFormat.notional(this.trade.Lots * this.viewState.underlying.ContractSize);
this.trade.OriginalNotional = this.trade.Notional;
this.trade.TradeAmount = this.trade.Notional / this.viewState.underlying.CountRatio;
this.trade.TradeAmount = consFormat.notional(this.trade.Lots * this.viewState.underlying.ContractSize / this.viewState.underlying.CountRatio);
this.resetTradePrice(true);
},
//变更交易数量
changeTradeAmount() {
this.trade.Lots = this.trade.TradeAmount * this.viewState.underlying.CountRatio / this.viewState.underlying.ContractSize;
this.trade.Notional = this.trade.Lots * this.viewState.underlying.ContractSize;
this.trade.Lots = _.round(this.trade.TradeAmount * this.viewState.underlying.CountRatio / this.viewState.underlying.ContractSize, InputFormatLots.precision);
this.trade.Notional = consFormat.notional(this.trade.TradeAmount * this.viewState.underlying.CountRatio);
this.trade.OriginalNotional = this.trade.Notional;
this.resetTradePrice(true);
},
@@ -711,9 +711,9 @@ var vue = new Vue({
let SpotPrice1 = parseFloat(this.trade.SpotPrice1 || 0);
let SpotPrice2 = parseFloat(this.trade.SpotPrice2 || 0);
if (SpotPrice1 > SpotPrice2) {
this.trade.StockEqvNotional = this.trade.SpotPrice1 * this.trade.Notional;
this.trade.StockEqvNotional = consFormat.StockEqvNotional(this.trade.SpotPrice1 * this.trade.Notional);
} else {
this.trade.StockEqvNotional = this.trade.SpotPrice2 * this.trade.Notional;
this.trade.StockEqvNotional = consFormat.StockEqvNotional(this.trade.SpotPrice2 * this.trade.Notional);
}
}
},