Merge branch 'glms/feature/1.4.2' of https://gitee.glmszq.com/gsty/onederiv/trs into glms/feature/1.4.2

This commit is contained in:
尹峰
2026-06-26 17:19:15 +08:00
7 changed files with 28 additions and 8 deletions
+21 -1
View File
@@ -1,4 +1,5 @@
@using YLErp.Web.Models.JsModels;
@using YLErp.Commons;
@model trade
@{
ViewBag.Title = "交易信息 | 编辑";
@@ -30,6 +31,24 @@
{
agencys.Add(item.Key);
}
var otcFormatConfig = new
{
StockEqvNotional = new
{
precision = OtcFormatHelper.FormatModel.trading.StockEqvNotional.precision,
minDecimals = OtcFormatHelper.FormatModel.trading.StockEqvNotional.minDecimals,
maxDecimals = OtcFormatHelper.FormatModel.trading.StockEqvNotional.maxDecimals
},
// 如果需要其他格式,可以继续添加
notional = new
{
precision = OtcFormatHelper.FormatModel.trading.notional.precision
},
tradePrice = new
{
precision = OtcFormatHelper.FormatModel.trading.tradePrice.precision
}
};
var pageObj = new
{
isAdd,
@@ -56,7 +75,8 @@
securitiesEnvironment = PS.Config.ErpElement.SecuritiesEnvironment,
tradingPlaceMap = places,
clearingAgencyMap = agencys,
timeUnits = GlobalData.AllTimeUnits()
timeUnits = GlobalData.AllTimeUnits(),
otcFormatConfig = otcFormatConfig
};
//pageObj.clearingAgencyMap.Remove("甲方");
//pageObj.clearingAgencyMap.Remove("已方");
@@ -234,7 +234,7 @@ const vue = new Vue({
if (this.paySwapList.length > 0) {
var item = this.paySwapList[0];
var notional = item.PosiGrossPrice * item.ContractSize;
item.PosiQuantity = notional == 0 ? 0 : this.trade.StockEqvNotional / notional;
item.PosiQuantity = notional == 0 ? 0 : _.round(this.trade.StockEqvNotional / notional, page.otcFormatConfig.StockEqvNotional.precision);
this.calcNotional();
}
@@ -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);
}
}
},