Files
zszq-trs/YLErpWeb/Views/SwapTrade2/SwapIncome.cshtml
T
tengyufan 43981e245b #EQD-6718 国联民生-收益互换隐藏收支方向,默认我方收取浮动收益
fix:国联民生收益互换隐藏收支方向,默认我方收取浮动收益

- 新增可配置开关 Erp.SwapFloatingIncomeReceiveOnlyMode,默认关闭,支持在普通模式与网厅适配模式之间切换
- 网厅适配模式下,新增及续做收益互换默认浮动端为我方收取,并隐藏新增、平仓、收益结算及查看页面的浮动端收支方向
- 普通模式保持原有展示和编辑逻辑,历史交易不修改原有浮动端收支方向
- 日终持仓风险_互换将浮动收支方向和标的多空合并为交易方向,并同步影响导出
- 交易方向映射收取+B为多头、收取+S为空头、支付+B为空头、支付+S为多头
- 新增交易方向映射专项前端单测
2026-07-30 14:46:07 +08:00

205 lines
11 KiB
Plaintext

@model UnwindData
@{
ViewBag.Title = "交易 | 收益结算";
Layout = "~/Views/Shared/_InfoLayout.cshtml";
bool isUseApproval = ViewBag.isUseApproval;
bool isShowReCheckClose = ViewBag.IsShowReCheckClose;
bool hideFloatingIncomeDirection = PS.Config.ErpElement.SwapFloatingIncomeReceiveOnlyMode;
}
@section CSS{
<link rel="stylesheet" href="~/Style/Css/unwindSwapTrade.css?v=@(HtmlUtil.JsVersion)" />
}
@section JS
{
<script>
function formatDateText(value) {
return value ? value.toString().substr(0, 10) : "";
}
var model = @Json.Serialize(Model);
model.StartDate = formatDateText(model.StartDate);
model.ValueDate = formatDateText(model.ValueDate);
model.PayDate = formatDateText(model.PayDate);
model.MaxIncomeValueDate = formatDateText(model.MaxIncomeValueDate);
if (model.ValueDate && model.MaxIncomeValueDate && model.ValueDate > model.MaxIncomeValueDate) {
model.ValueDate = model.MaxIncomeValueDate;
}
var isUseApproval = "@isUseApproval"=="True";
var g_isShowReCheckClose = "@isShowReCheckClose" == "True";
</script>
<script src="~/front/calendar?v=@(HtmlUtil.JsVersion)"></script>
<script src="~/Scripts/fast/fastVue.components.js?v=@HtmlUtil.JsVersion"></script>
<script src="~/Scripts/app/tradeHelper.js?v=@HtmlUtil.JsVersion"></script>
<script src="~/front/swappriceprecision?v=@HtmlUtil.JsVersion"></script>
<script src="~/Scripts/app/swaptrade/swapPricePrecisionHelper.js?v=@HtmlUtil.JsVersion"></script>
<script src="~/Scripts/app/swaptrade/swapCalc.js?v=@HtmlUtil.JsVersion"></script>
<script src="~/Scripts/app/swaptrade/incomeSwapTrade.js?v=@HtmlUtil.JsVersion"></script>
}
<div class="pb-3" id="vueDiv">
<div class="yc-panel">
<div class="row no-gutters" style="display:block">
<div style="margin: 5px 0 0 12px">
<table class="table table-bordered" id="baseTable">
<tbody>
<tr>
<td>成交名义本金</td>
<td>{{deal.NotionalValue}}</td>
<td>持仓名义本金</td>
<td>{{deal.PosiNotionalValue}}</td>
</tr>
<tr>
<td>成交数量</td>
<td> {{deal.NotionalQty}}</td>
<td>持仓数量</td>
<td> {{deal.PositionQty2}}</td>
</tr>
<tr>
<td>起始日期</td>
<td> {{deal.StartDate}}</td>
<td>收益结算日期</td>
<td> <vue-datepicker ref="incomeValueDatePicker" :maxdate="maxUnwindDate" :mindate="minStartDate" :noholiday="true" v-model="deal.ValueDate" v-on:input="setValueDate" /></td>
</tr>
<tr>
<td>支付日期</td>
<td> <vue-datepicker :mindate="minStartDate" :holiday="1" v-model="deal.PayDate" /></td>
<td>年化天数</td>
<td> {{deal.AnnualDays}}</td>
</tr>
<tr>
<td>平仓总额</td>
<td> {{deal.SwapCloseAmount}}</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="yc-panel">
<div class="row no-gutters" style="display:block;">
<div class="titleDiv">
<div class="titleHead"></div>
<div class="titleLabel"><label>预付金</label></div>
</div>
<div style="margin: 5px 0 0 12px">
<table class="table table-bordered ratetable" style="width:750px;">
<tbody>
<tr>
<td width="116px">收支方向</td>
<td>利息金额</td>
<td>其他费用</td>
<td>预付金平仓盈亏</td>
</tr>
<tr v-for="item in marginList">
<td :class="item.InterestDirection==1?'swapget':'swappay'">{{item.InterestDirection==1?"收取":"支付"}}</td>
<td>
<vue-number-input v-model="item.InterestAmount" v-bind:format="inputFormatEqvNotional" v-on:input="changeInterestAmount(item)"></vue-number-input>
</td>
<td>
<vue-number-input v-model="item.InterestFee" v-bind:format="inputFormatEqvNotional" v-on:input="changeInterestAmount(item)"></vue-number-input>
</td>
<td>{{item.InterestClosePnL}}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="row no-gutters" style="display:block">
<div class="titleDiv">
<div class="titleHead"></div>
<div class="titleLabel"><label>利息端</label></div>
</div>
<div style="margin: 5px 0 0 12px">
<table class="table table-bordered ratetable" style="width:750px;">
<tbody>
<tr>
<td width="116px">收支方向</td>
<td>利息金额</td>
<td>其他费用</td>
<td>利息端平仓盈亏</td>
</tr>
<tr v-for="item in interestList">
<td :class="item.InterestDirection==1?'swapget':'swappay'">{{item.InterestDirection==1?"收取":"支付"}}</td>
<td>
<vue-number-input v-model="item.InterestAmount" v-bind:format="inputFormatEqvNotional" v-on:input="changeInterestAmount(item)"></vue-number-input>
</td>
<td>
<vue-number-input v-model="item.InterestFee" v-bind:format="inputFormatEqvNotional" v-on:input="changeInterestAmount(item)"></vue-number-input>
</td>
<td>{{item.InterestClosePnL}}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="row no-gutters" style="display:block">
<div class="titleDiv">
<div class="titleHead"></div>
<div class="titleLabel"><label>浮动端</label></div>
</div>
<div style="margin: 5px 0 0 12px">
<table class="table table-bordered ratetable" id="floatTable">
<tbody>
<tr>
@if (!hideFloatingIncomeDirection)
{
<td width="116px">收支方向</td>
}
<td>多空方向</td>
<td>标的代码</td>
<td v-if="deal.StructureType!='普通收益互换'">期初标的交割全价%</td>
<td v-if="deal.StructureType!='普通收益互换'">期初标的交割净价%</td>
<td v-else>期初标的价格</td>
<td v-if="deal.StructureType!='普通收益互换'">期末标的交割全价%</td>
<td v-else>期末标的价格</td>
<td>数量</td>
<td>交易费用(平仓)</td>
<td>分红收益</td>
<td>浮动端平仓盈亏</td>
</tr>
<tr>
@if (!hideFloatingIncomeDirection)
{
<td :class="floatPosition.PayDirection==1?'swapget':'swappay'">{{floatPosition.PayDirection==1?"收取":"支付"}}</td>
}
<td>
{{floatPosition.PositionType==1?"多头":"空头"}}
</td>
<td>
{{floatPosition.UnderlyingCode}}
</td>
<td>{{priceFormat(floatPosition.PosiGrossPrice)}}</td>
<!-- 期初标的交割净价: TradingAmountNetAvg 字段名为"成交净价(期末语义)",但此处后端 InitIncome 实际装入的是期初净价(position.PosiNetNoFeePrice),值是期初值 -->
<td v-if="deal.StructureType!='普通收益互换'">{{priceFormat(floatPosition.TradingAmountNetAvg > 0 ? floatPosition.TradingAmountNetAvg : floatPosition.PosiNetPrice)}}</td>
<td>
<vue-swap-price-input v-model="floatPosition.TradingAmountAvg" v-bind:format="getDeliveryPriceInputFormat()" v-on:input="changeUnderlyingPrice" style="width:107px;"></vue-swap-price-input>
<a href="javascript:void(0)" v-on:click="refreshUnderlyingPrice()">
<span title="使用系统标的价格" class="glyphicon glyphicon-refresh"></span>
</a>
</td>
<td>{{floatPosition.Quantity}}</td>
<td>
<vue-number-input v-model="floatPosition.TradingFee" v-bind:format="inputFormatEqvNotional" v-on:input="changeTradingFee"></vue-number-input>
<div class="bubble-box" style="margin-left:6px;">我方{{floatPosition.PayDirection==1?"支付":"收取"}}交易费用</div>
</td>
<td> <vue-number-input v-model="floatPosition.DividendIn" v-bind:format="inputFormatDividend" v-on:input="changeTradingFee"></vue-number-input></td>
<td style="font-size:18px;">{{floatPosition.FloatPnlSum}}</td>
</tr>
</tbody>
</table>
</div>
<div>
@if (isUseApproval)
{
<button class="btn btn-default swapclose" type="button" v-on:click="submitApproval('reject');">拒绝</button>
<button class="btn btn-primary swapsave" type="button" v-on:click="submitApproval('pass')">审批通过</button>
}else{
<button class="btn btn-default swapclose" type="button" onclick="layer.closeMe();">取消</button>
<button class="btn btn-primary swapsave" type="button" v-on:click="incomeTrade">{{getSumbitText()}}</button>
}
</div>
<div class="clearfix"></div>
</div>
</div>
</div>