From ca68178bf8febefaebb48b36d64ed552ff2a9aa0 Mon Sep 17 00:00:00 2001 From: hjhan Date: Thu, 25 Jun 2026 14:24:30 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=92=E6=8D=A2?= =?UTF-8?q?=E6=94=B6=E7=9B=8A=E7=BB=93=E7=AE=97=E6=9C=9F=E5=88=9D=E5=87=80?= =?UTF-8?q?=E4=BB=B7=E6=98=BE=E7=A4=BA0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 期初净价列取TradingAmountNetAvg字段,后端InitIncome赋值为 position.PosiNetNoFeePrice(可空)。部分交易录入时未填该字段(值为0), 导致期初净价显示为0(如trade 1892/1859)。 改为:TradingAmountNetAvg为0时回退使用PosiNetPrice(期初净价,始终有值)。 仅前端兜底,不改动后端及平仓页。 --- YLErpWeb/Views/SwapTrade2/SwapIncome.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/YLErpWeb/Views/SwapTrade2/SwapIncome.cshtml b/YLErpWeb/Views/SwapTrade2/SwapIncome.cshtml index d86d8631..17e8aeb2 100644 --- a/YLErpWeb/Views/SwapTrade2/SwapIncome.cshtml +++ b/YLErpWeb/Views/SwapTrade2/SwapIncome.cshtml @@ -152,7 +152,7 @@ {{floatPosition.UnderlyingCode}} {{priceFormat(floatPosition.PosiGrossPrice)}} - {{priceFormat(floatPosition.TradingAmountNetAvg)}} + {{priceFormat(floatPosition.TradingAmountNetAvg > 0 ? floatPosition.TradingAmountNetAvg : floatPosition.PosiNetPrice)}} {{floatPosition.TradingAmountAvg}} From 276c1c2961fba0f56f33b9bfd63f84225f6e96ce Mon Sep 17 00:00:00 2001 From: hjhan Date: Thu, 25 Jun 2026 14:31:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=92=E6=8D=A2?= =?UTF-8?q?=E6=94=B6=E7=9B=8A=E7=BB=93=E7=AE=97=E6=9C=9F=E6=9C=AB=E4=BB=B7?= =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E7=BC=96=E8=BE=91=E5=8F=8A=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E7=BC=BA=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ab09cbc9为支持自动互换期间付息,误将期末标的价格改为纯文本不可编辑, 并删除了changeUnderlyingPrice/refreshUnderlyingPrice方法。开发误解了需求: 自动互换默认填上次互换价是后端逻辑,手动互换时期末价应可编辑+刷新(与平仓页一致)。 对齐平仓页(SwapUnwind)恢复: - incomeSwapTrade.js: 恢复changeUnderlyingPrice、refreshUnderlyingPrice方法 - SwapIncome.cshtml: 期末价列恢复vue-number-input输入框+刷新图标 - SwapDealService.cs/InitIncome: 补充注释说明TradingAmountNetAvg字段 虽名为期末语义但此处装入期初净价,避免后续混淆 --- YLErpDAL/Modules/SwapModule/SwapDealService.cs | 1 + YLErpWeb/Views/SwapTrade2/SwapIncome.cshtml | 6 +++++- .../Scripts/app/swaptrade/incomeSwapTrade.js | 14 +++++++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/YLErpDAL/Modules/SwapModule/SwapDealService.cs b/YLErpDAL/Modules/SwapModule/SwapDealService.cs index afd9aa15..10a1af7d 100644 --- a/YLErpDAL/Modules/SwapModule/SwapDealService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapDealService.cs @@ -276,6 +276,7 @@ namespace YLErp.Modules.SwapModule floatEvent.PayDirection = position.PosiDirection; floatEvent.PosiGrossPrice = position.PosiGrossPrice; floatEvent.PosiNetPrice = position.PosiNetPrice; + // 注意:TradingAmountNetAvg 字段名为"成交净价(期末语义)",但收益结算/平仓初始化时装入的是期初净价(PosiNetNoFeePrice),前端展示期初净价时取此字段 floatEvent.TradingAmountNetAvg = position.PosiNetNoFeePrice; floatEvent.TradingAmountNetFeeAvg = position.PosiNetFeePrice; floatEvent.PositionType = position.PositionType; diff --git a/YLErpWeb/Views/SwapTrade2/SwapIncome.cshtml b/YLErpWeb/Views/SwapTrade2/SwapIncome.cshtml index 17e8aeb2..ca19bcc7 100644 --- a/YLErpWeb/Views/SwapTrade2/SwapIncome.cshtml +++ b/YLErpWeb/Views/SwapTrade2/SwapIncome.cshtml @@ -152,9 +152,13 @@ {{floatPosition.UnderlyingCode}} {{priceFormat(floatPosition.PosiGrossPrice)}} + {{priceFormat(floatPosition.TradingAmountNetAvg > 0 ? floatPosition.TradingAmountNetAvg : floatPosition.PosiNetPrice)}} - {{floatPosition.TradingAmountAvg}} + + + + {{floatPosition.Quantity}} diff --git a/YLErpWeb/wwwroot/Scripts/app/swaptrade/incomeSwapTrade.js b/YLErpWeb/wwwroot/Scripts/app/swaptrade/incomeSwapTrade.js index 2293b45b..311f90ef 100644 --- a/YLErpWeb/wwwroot/Scripts/app/swaptrade/incomeSwapTrade.js +++ b/YLErpWeb/wwwroot/Scripts/app/swaptrade/incomeSwapTrade.js @@ -97,11 +97,23 @@ const vue = new Vue({ } if (!isUseApproval) { this.getInterestList(); - //this.refreshUnderlyingPrice(); } else { this.dataFormat(); } }, + changeUnderlyingPrice() {//修改标的价格 + this.calcFloatClosePnl(); + }, + refreshUnderlyingPrice() {//刷新标的价格 + var thisObj = this; + main.post("/underlying_manager/GetUnderlyingPriceByCode", + { code: thisObj.floatPosition.UnderlyingCode, valuedate: thisObj.deal.ValueDate }) + .done(function (res) { + res.obj = res.obj * thisObj.multiplier; + thisObj.floatPosition.TradingAmountAvg = otcformat.trading.tradeSinglePrice(res.obj); + thisObj.calcFloatClosePnl(); + }); + }, changeTradingFee() {//修改交易费用 this.calcFloatClosePnl(); },