From 63d9decd1735a400f447fa82a1d868c06c8c5d5b Mon Sep 17 00:00:00 2001 From: hjhan Date: Wed, 22 Jul 2026 15:04:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E5=AF=B9=E5=80=BA=E5=88=B8?= =?UTF-8?q?=E9=A6=96=E6=AC=A1=E8=AF=BB=E5=8F=96=E6=8E=A5=E5=8F=A3=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E7=9A=84=20price=20/=20netPrice=20=E6=9C=AC=E6=9D=A5?= =?UTF-8?q?=E5=B0=B1=E6=98=AF=E5=AD=98=E5=82=A8=E6=80=81=E5=B0=8F=E6=95=B0?= =?UTF-8?q?=20=EF=BC=88EodPrice=20=E7=9B=B4=E6=8E=A5=E8=BF=94=E5=9B=9E=20D?= =?UTF-8?q?B=20=E5=80=BC=EF=BC=9B=E9=9D=9E=20EodPrice=20=E5=88=86=E6=94=AF?= =?UTF-8?q?=20=C3=97bondPriceMultiple=3D0.01?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scripts/app/swaptrade/swapTradeEdit.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/YLErpWeb/wwwroot/Scripts/app/swaptrade/swapTradeEdit.js b/YLErpWeb/wwwroot/Scripts/app/swaptrade/swapTradeEdit.js index b172c293..9e35ef44 100644 --- a/YLErpWeb/wwwroot/Scripts/app/swaptrade/swapTradeEdit.js +++ b/YLErpWeb/wwwroot/Scripts/app/swaptrade/swapTradeEdit.js @@ -718,15 +718,13 @@ const vue = new Vue({ var thisObj = this; main.post("/pricing/AjaxGetUnderlyingPrice", { underlyingCode: underlyingCode, tradeDate: StartDate }) .done(function (resp) { - if (item.isBond) { - // 债券行情返回的是【展示态/每百元百分比】(如 100),而 PosiNetNoFeePrice/PosiGrossPrice - // 模型字段存【存储态小数】(如 1.0)。非债券标的保持原 umprice 格式化即可。 - item.PosiNetNoFeePrice = SwapCalc.bondCalcPriceToStorage(resp.obj.netPrice); - item.PosiGrossPrice = SwapCalc.bondCalcPriceToStorage(resp.obj.price); - } else { - item.PosiNetNoFeePrice = otcformat.trading.umprice(resp.obj.netPrice); - item.PosiGrossPrice = otcformat.trading.umprice(resp.obj.price); - } + // 行情接口(AjaxGetUnderlyingPrice)对债券返回的 price/netPrice 本就是【存储态小数】(1.0 代表 100 元), + // 与 PosiGrossPrice/PosiNetNoFeePrice 模型字段同量纲(见 PricingController: EodPrice 直接返回、 + // 非 EodPrice 分支 ×bondPriceMultiple=0.01)。故此处仅做精度格式化,**不可**再 bondCalcPriceToStorage(÷100), + // 否则默认价 1.0 被除成 0.01,界面 percent:true 再 ×100 显示为 1("被自动除以100"bug)。 + // 计算器(/Bond/CalcBond)返回的才是展示态,其 ÷100 落库逻辑在 calcBondForItem 内处理。 + item.PosiNetNoFeePrice = otcformat.trading.umprice(resp.obj.netPrice); + item.PosiGrossPrice = otcformat.trading.umprice(resp.obj.price); thisObj.calcNotional(); }); },