fix: #EQD-6812 国联民生-TRS簿记页面增加续做按钮(自动新建一个除日期外要素相同的合约)-交易费用后付字段未填充

This commit is contained in:
马冰冰
2026-07-28 16:48:50 +08:00
parent a575de7bbe
commit d836d192fe
3 changed files with 20 additions and 12 deletions
+1 -3
View File
@@ -465,9 +465,7 @@ namespace YLErp.Modules.AppModule
.ToHashSet();
var nextIndex = adminDb.DictionaryItems
.Where(item => item.DictId == marginTemplateDictionary.Id)
.Select(item => item.IndexNum)
.DefaultIfEmpty(-1)
.Max();
.Max(item => (int?)item.IndexNum) ?? -1;
foreach (var templateName in YLErp.Modules.SwapModule.SwapMarginTemplateConfigService.InitialTemplateNames)
{
if (existingNames.Contains(templateName))
@@ -186,7 +186,6 @@ namespace YLErp.Web.Controllers
renewPosition.InterestAmount = 0;
renewPosition.InterestFeePending = 0;
renewPosition.PosiDividendIncome = 0;
renewPosition.PosiTradingFeePending = 0;
renewPosition.InterestSwapInterval = null;
renewPosition.Obervation = null;
return renewPosition;
@@ -684,13 +684,7 @@ const vue = new Vue({
}
},
setUnderlyingCode(data, item) {
var underlyingCode = item.UnderlyingCode;
if (underlyingCode != data.Code) {
this.getSpotPrice(data.Code, this.trade.TradeDate, item);
} else {
item.PosiGrossPrice = item.PosiGrossPrice;
item.PosiNetNoFeePrice = item.PosiNetNoFeePrice;
}
if (!data || !data.Code) return;
item.CountRatio = data.CountRatio;
item.ContractSize = data.ContractSize;
item.UnderlyingInstrumentType = data.InstrumentType;
@@ -704,11 +698,13 @@ const vue = new Vue({
item.underlying.Price = data.Price;
item.underlying.UnderlyingInstrumentType = data.InstrumentType;
item.underlying.QuoteUnitString = data.QuoteUnitString;
this.trade.UnderlyingCode = underlyingCode;
this.trade.UnderlyingCode = data.Code;
// 债券标的:标记该浮动腿可启用净价/全价/收益率互算
this.$set(item, 'isBond', tradeHelper.IsBond(data.InstrumentType));
// 切换标的时清空债券三字段互算的手动/源标志(D1 修复:避免旧债券手填状态污染新债券)
SwapCalc.clearBondCalcFlags(item);
// Refresh the initial price even when the user re-selects the same underlying.
this.getSpotPrice(item.UnderlyingCode, this.trade.TradeDate, item);
//this.initMarginRate();
},
setFloatRateUnderlyingCode(data, item) {
@@ -745,8 +741,13 @@ const vue = new Vue({
},
getSpotPrice(underlyingCode, StartDate, item) {
var thisObj = this;
if (!underlyingCode) return;
main.post("/pricing/AjaxGetUnderlyingPrice", { underlyingCode: underlyingCode, tradeDate: StartDate })
.done(function (resp) {
if (!resp || !resp.success || !resp.obj) {
main.message("未获取到标的价格");
return;
}
// 行情接口(AjaxGetUnderlyingPrice)对债券返回的 price/netPrice 本就是【存储态小数】(1.0 代表 100 元),
// 与 PosiGrossPrice/PosiNetNoFeePrice 模型字段同量纲(见 PricingController: EodPrice 直接返回、
// 非 EodPrice 分支 ×bondPriceMultiple=0.01)。故此处仅做精度格式化,**不可**再 bondCalcPriceToStorage(÷100)
@@ -1465,6 +1466,16 @@ const vue = new Vue({
//}
},
// A renewal opens as a new trade, so the underlying autocomplete only restores
// its code and does not emit change. Fetch the initial price explicitly.
refreshInitialUnderlyingPrices() {
if (!page.isAdd) return;
this.paySwapList.forEach(item => {
if (item.UnderlyingCode) {
this.getSpotPrice(item.UnderlyingCode, this.trade.TradeDate, item);
}
});
},
//利息端添加行
addGetSwapRate() {
var InterestMode = 9;