feat(swaptrade): 新增名义本金数值的四舍五入格式化处理

This commit is contained in:
zheng.zhang
2026-06-26 16:04:59 +08:00
committed by 嬴政 时
parent a4237cc178
commit c76976e141
2 changed files with 22 additions and 2 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();
}