diff --git a/YLErpWeb/Views/SwapTrade2/TradeEdit.cshtml b/YLErpWeb/Views/SwapTrade2/TradeEdit.cshtml index 4133bbc4..a6ee5d02 100644 --- a/YLErpWeb/Views/SwapTrade2/TradeEdit.cshtml +++ b/YLErpWeb/Views/SwapTrade2/TradeEdit.cshtml @@ -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("已方"); diff --git a/YLErpWeb/wwwroot/Scripts/app/swaptrade/swapTradeEdit.js b/YLErpWeb/wwwroot/Scripts/app/swaptrade/swapTradeEdit.js index e71b9f5a..bd63138b 100644 --- a/YLErpWeb/wwwroot/Scripts/app/swaptrade/swapTradeEdit.js +++ b/YLErpWeb/wwwroot/Scripts/app/swaptrade/swapTradeEdit.js @@ -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(); }