From c76976e1419be1c6ce15e8af392541c6fcb9ebcd Mon Sep 17 00:00:00 2001 From: "zheng.zhang" Date: Wed, 17 Jun 2026 16:32:55 +0800 Subject: [PATCH] =?UTF-8?q?feat(swaptrade):=20=E6=96=B0=E5=A2=9E=E5=90=8D?= =?UTF-8?q?=E4=B9=89=E6=9C=AC=E9=87=91=E6=95=B0=E5=80=BC=E7=9A=84=E5=9B=9B?= =?UTF-8?q?=E8=88=8D=E4=BA=94=E5=85=A5=E6=A0=BC=E5=BC=8F=E5=8C=96=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YLErpWeb/Views/SwapTrade2/TradeEdit.cshtml | 22 ++++++++++++++++++- .../Scripts/app/swaptrade/swapTradeEdit.js | 2 +- 2 files changed, 22 insertions(+), 2 deletions(-) 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(); }