- 配置开启时,查看交易、审批查看、交易平仓、收益结算和平仓详情按浮动收支方向与原多空方向组合展示多空方向 - 兼容历史支付数据:支付多头展示为空头,支付空头展示为多头,收取方向保持原多空展示 - 新增浮动端方向组合及相关页面覆盖专项测试
1177 lines
80 KiB
Plaintext
1177 lines
80 KiB
Plaintext
@using YLErp.Enums;
|
|
@using System.Globalization;
|
|
@model TradeViewModel
|
|
|
|
@{
|
|
ViewBag.Title = "交易信息|查看";
|
|
Layout = "~/Views/Shared/_InfoLayout.cshtml";
|
|
var trade = Model.Trade;
|
|
var salesNames = String.Join(",", Model.SalesCommission.Select(n => n.SalesmanName).ToArray());
|
|
trade.TradeUnit = PS.Config.IsUseDisplayNotional ? (trade.QuoteUnit == "500千克" ? "半吨" : "吨") : trade.TradeUnit;
|
|
var pageObj = new
|
|
{
|
|
Trade = trade,
|
|
ClosePrice = Model.ClosePrice ?? 0,
|
|
ConfirmInfo = "确认删除此交易?如果属于结构化交易则删除整个交易",
|
|
IsGenerateAmendDoc = PS.Config.TradeElement.IsGenerateAmendDoc,
|
|
NeedSendChangeEmail = PS.Config.TradeElement.IsAmendableAfterConfirm && PS.Config.TradeElement.IsGenerateAmendDoc,
|
|
buttonStr = YLErp.PS.Config.Company == CompanyEnum.天风 ? "交易录入" : "交易特批",
|
|
};
|
|
bool hasPosition = false;//是否有持仓
|
|
bool singleTrade = trade.StructureType != ClientMarginTypeEnum.多空组合.ToString();
|
|
hasPosition = trade.swap_positions.Any(x => !x.IsInitial);
|
|
var swap_deals = trade.swap_Events.Where(x => x.EventType == (int)SwapEventTypeEnum.互换 || x.EventType == (int)SwapEventTypeEnum.自动互换).ToList();//单标的/多空组合互换 互换记录
|
|
var closeSwapDeals = trade.swap_Events.Where(x => x.EventType == (int)SwapEventTypeEnum.平仓).ToList();//单标的互换 平仓记录
|
|
bool isBond = trade.StructureType == "普通债券类收益互换";
|
|
string spotPriceTitle = isBond ? "期初标的交割全价%" : "期初标的价格";
|
|
string netSportPriceTitle = isBond ? "期初标的交割净价%" : string.Empty;
|
|
string initYtmTitle = isBond ? "期初标的成交收益率%" : string.Empty;
|
|
string endSpotPriceTitle = isBond ? "期末标的交割全价%" : "期末标的价格";
|
|
var positions = trade.swap_positions.Where(x=>x.PosiDirection>0&&x.IsInitial).ToList();
|
|
var realPositions = trade.swap_positions.Where(x => x.PosiDirection > 0 && !x.IsInitial).ToList();
|
|
var sr = trade.trade_extend.ExtendObj.SettlementRules;
|
|
bool hideFloatingIncomeDirection = PS.Config.ErpElement.SwapFloatingIncomeReceiveOnlyMode;
|
|
string FloatingPositionTypeText(int posiDirection, int positionType)
|
|
{
|
|
if (hideFloatingIncomeDirection)
|
|
{
|
|
return posiDirection == positionType ? "多头" : "空头";
|
|
}
|
|
|
|
return positionType == (int)PositionTypeFlag.Long ? "多头" : "空头";
|
|
}
|
|
string SwapPriceData(decimal? value) => value?.ToString(CultureInfo.InvariantCulture) ?? string.Empty;
|
|
string SwapCommonData(object value) => value == null ? string.Empty : Convert.ToString(value, CultureInfo.InvariantCulture);
|
|
}
|
|
@section CSS{
|
|
<link href="~/Style/Css/swapTradeView.css?@HtmlUtil.JsVersion" rel="stylesheet" />
|
|
<style>
|
|
.modal-dialog {
|
|
max-width: 800px;
|
|
}
|
|
</style>
|
|
}
|
|
|
|
@section JS{
|
|
<script type="text/javascript">
|
|
var page = @Json.Serialize(pageObj);
|
|
</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/swapTradeView.js?v=@HtmlUtil.JsVersion"></script>
|
|
}
|
|
|
|
@Html.Partial("~/Views/SwapTrade2/header.cshtml", Model)
|
|
|
|
<div class="ui-corner-all">
|
|
<div id="optionVueDiv">
|
|
<div class="tabbable">
|
|
<ul id="myTab" class="nav nav-tabs nav-main">
|
|
<li class="nav-item">
|
|
<a class="nav-link active" href="#baseInfo" data-toggle="tab">成交</a>
|
|
</li>
|
|
@if (hasPosition)
|
|
{
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="#positionInfo" data-toggle="tab">持仓</a>
|
|
</li>
|
|
}
|
|
|
|
@if (closeSwapDeals.Count > 0)//单标的平仓
|
|
{
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="#terminationInfo" data-toggle="tab">提前终止</a>
|
|
</li>
|
|
}
|
|
|
|
@if (swap_deals.Count > 0)
|
|
{
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="#swapInfo" data-toggle="tab">互换</a>
|
|
</li>
|
|
}
|
|
|
|
@if (trade.ClientCashInCashOutList.Count > 0)
|
|
{
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="#ClientCashinCashout" data-toggle="tab">资金记录</a>
|
|
</li>
|
|
}
|
|
|
|
</ul>
|
|
</div>
|
|
<div class="tab-content">
|
|
<div id="baseInfo" class="tab-pane in active">
|
|
<div class="row no-gutters">
|
|
<div class="col-auto" style="width:350px;">
|
|
<div class="titleDiv">
|
|
<div class="titleHead"></div>
|
|
<div class="titleLabel"><label>基本信息</label></div>
|
|
</div>
|
|
<div class="yc-panel">
|
|
<table class="table table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td>产品结构</td>
|
|
<td class="color-bule">@trade.StructureType</td>
|
|
</tr>
|
|
<tr>
|
|
<td>簿记账户</td>
|
|
<td class="color-bule">@trade.AssetBookName</td>
|
|
</tr>
|
|
<tr>
|
|
<td>交易对手方</td>
|
|
<td class="color-bule">@trade.ClientName</td>
|
|
</tr>
|
|
<tr>
|
|
<td>交易员</td>
|
|
<td class="color-bule">@trade.TraderName</td>
|
|
</tr>
|
|
<tr>
|
|
<td>成交日期</td>
|
|
<td class="color-bule">@trade.TradeDate.OtcFormatDate()</td>
|
|
</tr>
|
|
<tr>
|
|
<td>开始日期</td>
|
|
<td class="color-bule">@trade.StartDate.OtcFormatDate()</td>
|
|
</tr>
|
|
<tr>
|
|
<td>到期日期</td>
|
|
<td class="color-bule">@trade.ExerciseDate.OtcFormatDate()</td>
|
|
</tr>
|
|
<tr>
|
|
<td>名义本金</td>
|
|
<td class="color-bule"><span class="js-swap-common" data-value="@SwapCommonData(trade.OriginalStockEqvNotional)" data-kind="amount"></span></td>
|
|
</tr>
|
|
@*<tr>
|
|
<td>初始预付金</td>
|
|
<td class="color-bule">
|
|
@if (trade.trade_Initial_Margin != null)
|
|
{
|
|
var direction = trade.trade_Initial_Margin.Direction;
|
|
var directionStr = direction == 2 ? "支付" : "收取";
|
|
var btnClass = "swapget";
|
|
if (direction == 2)
|
|
{
|
|
btnClass = "swappay";
|
|
}
|
|
if (trade.trade_Initial_Margin.MarginType == 0)
|
|
{
|
|
@trade.trade_Initial_Margin.MarginValue.OtcFormatPercent()
|
|
}
|
|
else
|
|
{
|
|
@trade.trade_Initial_Margin.MarginValue.OtcFormatMoney(true)
|
|
}
|
|
<input type="button" class="@btnClass" style="width: 50px; height: 24px; font-size: 12px; color: #027DB4;border-width:0.1px; " disabled value="@directionStr" />
|
|
}
|
|
|
|
</td>
|
|
</tr>*@
|
|
<tr>
|
|
<td>交易编号</td>
|
|
<td class="color-bule">@trade.TradeNumber</td>
|
|
</tr>
|
|
@*@if (AppHelper.UseFutureVersion("销售提成", "V2"))
|
|
{
|
|
<tr>
|
|
<td>@(PS.Config.ErpElement.SaleMode == YLErp.Configuration.Enums.SaleMode.SaleMen ?"销售员":"客户经理")</td>
|
|
<td class="color-bule">@salesNames</td>
|
|
</tr>
|
|
<tr>
|
|
<td>销售提成</td>
|
|
<td class="color-bule">@(Model.SalesCommission.FirstOrDefault()?.CommissionString())</td>
|
|
</tr>
|
|
}*@
|
|
|
|
<tr>
|
|
<td>流水簿记模式</td>
|
|
<td class="color-bule">@((FlowBookModeEnum)trade.trade_extend?.ExtendObj?.FlowBookMode)</td>
|
|
</tr>
|
|
@{
|
|
trade.MetaDic.TryGetValue(YLErp.DBModels.Consts.ConsTradeMetaKey.ClearingAgency, out var clearingAgency);
|
|
trade.MetaDic.TryGetValue(YLErp.DBModels.Consts.ConsTradeMetaKey.TradingPlace, out var tradingPlace);
|
|
trade.MetaDic.TryGetValue(YLErp.DBModels.Consts.ConsTradeMetaKey.MainProtocolCode, out var mainProtocolCode);
|
|
trade.MetaDic.TryGetValue(YLErp.DBModels.Consts.ConsTradeMetaKey.SupProtocolCode, out var supProtocolCode);
|
|
<tr>
|
|
<td>交易场所</td>
|
|
<td class="color-bule">@tradingPlace</td>
|
|
</tr>
|
|
<tr>
|
|
<td>清算机构</td>
|
|
<td class="color-bule">@clearingAgency</td>
|
|
</tr>
|
|
<tr>
|
|
<td>主协议编号</td>
|
|
<td class="color-bule">@mainProtocolCode</td>
|
|
</tr>
|
|
<tr>
|
|
<td>补充协议编号</td>
|
|
<td class="color-bule">@supProtocolCode</td>
|
|
</tr>
|
|
}
|
|
<tr>
|
|
<td>交易对手方角色</td>
|
|
<td class="color-bule">@trade.OpponentRole</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="titleDiv">
|
|
<div class="titleHead"></div>
|
|
<div class="titleLabel"><label>收益选项</label></div>
|
|
</div>
|
|
<div class="yc-panel">
|
|
<table class="table table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td>年化天数</td>
|
|
<td class="color-bule">@trade.trade_extend.ExtendObj.AnnualDays</td>
|
|
</tr>
|
|
<tr>
|
|
<td>计息方式</td>
|
|
<td class="color-bule">@(TradeViewModel.GetSwapRateCalcModeDesc(trade.trade_extend.ExtendObj.InterestCalcMode))</td>
|
|
</tr>
|
|
@* <tr>
|
|
<td>是否开仓时收取开仓费</td>
|
|
<td class="color-bule"> @(trade.trade_extend.ExtendObj.NeedOpenFee ? "是" : "否")</td>
|
|
</tr>
|
|
<tr>
|
|
<td>收费基本单位</td>
|
|
<td class="color-bule"> @(trade.trade_extend.ExtendObj.OpenFeeType == 0 ? "按手数收费" : "按份数收费")</td>
|
|
</tr>*@
|
|
<tr>
|
|
<td>结算规则</td>
|
|
<td class="color-bule"> @(trade.trade_extend.ExtendObj.SettlementRules == 0 ? "T+0" : "T+1")</td>
|
|
</tr>
|
|
<tr>
|
|
<td>派息金额支付日</td>
|
|
<td class="color-bule">@(trade.trade_extend.ExtendObj.DividendPayDate == 0 ? "到期结算日" : "派息日+" + (trade.trade_extend.ExtendObj.DividendPayDate - 1))</td>
|
|
</tr>
|
|
<tr>
|
|
<td>保证金模板</td>
|
|
<td class="color-bule">@trade.MarginTemplateName</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="col">
|
|
<div class="row no-gutters swaprow">
|
|
<div class="titleDiv">
|
|
<div class="titleHead"></div>
|
|
<div class="titleLabel"><label>预付金</label></div>
|
|
</div>
|
|
<div class="yc-panel">
|
|
<table class="table table-bordered ">
|
|
<tbody>
|
|
<tr>
|
|
<th>收支方向</th>
|
|
<th>资金类别</th>
|
|
<th>发生日期</th>
|
|
<th>金额</th>
|
|
<th>币种</th>
|
|
<th>预付金返息率</th>
|
|
<th>利率是否年化</th>
|
|
<th>结算规则</th>
|
|
</tr>
|
|
@if (trade.swap_positions != null)
|
|
{
|
|
foreach (var item in trade.swap_positions.Where(x => (x.InterestMode == 5 || x.InterestMode == 6) && x.IsInitial))
|
|
{
|
|
var bgclass = item.InterestDirection == (int)SwapDirectionEnum.收取 ? "swapget" : "swappay";
|
|
<tr class="color-bule">
|
|
<td class="@bgclass" style="width:116px !important;">@((SwapDirectionEnum)item.InterestDirection)</td>
|
|
<td>@((InterestModeEnum)item.InterestMode)</td>
|
|
<td>@item.HappenDate.OtcFormatDate()</td>
|
|
<td><span class="js-swap-common" data-value="@SwapCommonData(item.InterestPrincipalFix)" data-kind="amount"></span></td>
|
|
<td>@item.Currency</td>
|
|
<td><span class="js-swap-common" data-value="@SwapCommonData(item.InterestRateDefault)" data-kind="rate"></span></td>
|
|
<td>@(item.IsAnnualized ? "是" : "否")</td>
|
|
<td>
|
|
<button class="btn btn-sm btn-outline-danger" type="button" onclick="showSwapRate('@(item.InterestSwapInterval)', true)" style="height:22px;">查看</button>
|
|
</td>
|
|
</tr>
|
|
}
|
|
}
|
|
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="row no-gutters swaprow">
|
|
<div class="titleDiv">
|
|
<div class="titleHead"></div>
|
|
<div class="titleLabel"><label>利息端</label></div>
|
|
</div>
|
|
<div class="yc-panel">
|
|
<table class="table table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<th>收支方向</th>
|
|
<th>计息基本类型</th>
|
|
<th>计息基数</th>
|
|
<th>利率</th>
|
|
<th>利率是否年化</th>
|
|
<th>计息方式</th>
|
|
<th>重置频率(天)</th>
|
|
<th>利率准则</th>
|
|
<th>类别</th>
|
|
<th>结算规则</th>
|
|
</tr>
|
|
@if (trade.swap_positions != null)
|
|
{
|
|
foreach (var item in trade.swap_positions.Where(x => ConsTrade.InterestModels.Contains(x.InterestMode) && x.IsInitial))
|
|
{
|
|
decimal? interestPrice = null;
|
|
if (item.InterestMode == (int)InterestModeEnum.合约名义本金规模)
|
|
{
|
|
interestPrice = Convert.ToDecimal(trade.OriginalStockEqvNotional.Value);
|
|
}
|
|
else if (item.InterestMode == (int)InterestModeEnum.标的期初全价)
|
|
{
|
|
interestPrice = Convert.ToDecimal(trade.OriginalStockEqvNotional.Value);
|
|
}
|
|
else if (item.InterestMode == (int)InterestModeEnum.固定值)
|
|
{
|
|
interestPrice = item.InterestPrincipalFix;
|
|
}
|
|
@* else if (item.InterestMode == (int)InterestModeEnum.多头存续名义本金)
|
|
{
|
|
interestPrice = positions.Where(w => w.PositionType == (int)PositionTypeFlag.Long).Sum(s => s.PosiNotionalValue);
|
|
}
|
|
else if (item.InterestMode == (int)InterestModeEnum.空头存续名义本金)
|
|
{
|
|
interestPrice = positions.Where(w => w.PositionType == (int)PositionTypeFlag.Short).Sum(s => s.PosiNotionalValue);
|
|
}*@
|
|
var bgclass = item.InterestDirection == (int)SwapDirectionEnum.收取 ? "swapget" : "swappay";
|
|
var sign = item.InterestRateDefault < 0 ? "" : "+";
|
|
<tr class="color-bule">
|
|
<td class="@bgclass" style="width:116px !important;">@((SwapDirectionEnum)item.InterestDirection)</td>
|
|
<td>@((InterestModeEnum)item.InterestMode)</td>
|
|
<td><span class="js-swap-common" data-value="@SwapCommonData(interestPrice)" data-kind="amount"></span></td>
|
|
<td>
|
|
@(string.IsNullOrEmpty(item.FloatRateUnderlyingCode) ? "无" : item.FloatRateUnderlyingCode)
|
|
@sign
|
|
<span class="js-swap-common" data-value="@SwapCommonData(item.InterestRateDefault)" data-kind="rate"></span>
|
|
</td>
|
|
<td>@(item.IsAnnualized ? "是" : "否")</td>
|
|
<td>
|
|
@((InterestTypeEnum)item.InterestType)
|
|
</td>
|
|
<td>@item.interest_rest_days</td>
|
|
<td>@((item.interest_rule != null) ? (SwapInterestRule)item.interest_rule : "")</td>
|
|
<td>@(string.IsNullOrEmpty(item.category_tag) ? "互换利率" : item.category_tag)</td>
|
|
<td>
|
|
<button class="btn btn-sm btn-outline-danger" type="button" onclick="showSwapRate('@(item.InterestSwapInterval)', false)" style="height:22px;">查看</button>
|
|
</td>
|
|
</tr>
|
|
}
|
|
}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="row no-gutters swaprow">
|
|
@if (singleTrade || !hideFloatingIncomeDirection)
|
|
{
|
|
<div class="titleDiv">
|
|
<div class="titleHead"></div>
|
|
<div class="titleLabel"><label>浮动收益端</label></div>
|
|
</div>
|
|
}
|
|
@if (trade.swap_positions != null)
|
|
{
|
|
var paySwapPositions = trade.swap_positions.Where(x => !string.IsNullOrEmpty(x.UnderlyingCode) && x.IsInitial&&x.PosiStartDate==trade.StartDate).ToList();
|
|
if (paySwapPositions.Count > 0)
|
|
{
|
|
<div class="yc-panel">
|
|
<table class="table table-bordered">
|
|
<tbody>
|
|
<tr class="swapflowtr">
|
|
@if (!hideFloatingIncomeDirection)
|
|
{
|
|
<td>收支方向</td>
|
|
}
|
|
<td>多空方向</td>
|
|
<td>标的代码</td>
|
|
<td>@spotPriceTitle</td>
|
|
@if (isBond)
|
|
{
|
|
<td>@netSportPriceTitle</td>
|
|
<td>@initYtmTitle</td>
|
|
}
|
|
<td>数量</td>
|
|
<td>基础费率</td>
|
|
<td>交易费用后付</td>
|
|
</tr>
|
|
@foreach (var item in paySwapPositions)
|
|
{
|
|
var bgclass = item.PosiDirection == (int)SwapDirectionEnum.收取 ? "swapget" : "swappay";
|
|
var multiplier = ConsGlobal.InstrumentType.IsBond(item.UnderlyingInstrumentType) ? 100 : 1;
|
|
<tr class="swapflowtr color-bule">
|
|
@if (!hideFloatingIncomeDirection)
|
|
{
|
|
<td class="@bgclass" style="width:116px !important;">@((SwapDirectionEnum)item.PosiDirection)</td>
|
|
}
|
|
<td>@FloatingPositionTypeText(item.PosiDirection, item.PositionType)</td>
|
|
<td>@item.UnderlyingCode</td>
|
|
<td>
|
|
<span class="js-swap-price" data-value="@SwapPriceData(item.PosiGrossPrice * multiplier)" data-instrument-type="@item.UnderlyingInstrumentType" data-field="grossPrice"></span>
|
|
</td>
|
|
@if (isBond)
|
|
{
|
|
<td>
|
|
<span class="js-swap-price" data-value="@SwapPriceData((item.PosiNetNoFeePrice ?? 0) * multiplier)" data-instrument-type="@item.UnderlyingInstrumentType" data-field="netPrice"></span>
|
|
</td>
|
|
<td>
|
|
<span class="js-swap-price" data-value="@SwapPriceData(item.InitYtm * multiplier)" data-instrument-type="@item.UnderlyingInstrumentType" data-field="yield"></span>
|
|
</td>
|
|
}
|
|
<td>
|
|
<span class="js-swap-common" data-value="@SwapCommonData(item.PosiQuantity)" data-kind="quantity" data-instrument-type="@item.UnderlyingInstrumentType"></span>
|
|
</td>
|
|
<td>
|
|
@if (item.PosiFeeType == 0)
|
|
{
|
|
@(item.PosiTradingFeeUnit.ToString("0.0000") + "%")
|
|
}
|
|
else
|
|
{
|
|
@item.PosiTradingFeeUnit.ToString("0.000000")
|
|
}
|
|
</td>
|
|
<td>
|
|
<span class="js-swap-common" data-value="@SwapCommonData(item.PosiTradingFeePending)" data-kind="amount"></span>
|
|
</td>
|
|
</tr>
|
|
}
|
|
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
}
|
|
else if (!hideFloatingIncomeDirection)
|
|
{
|
|
<div class="yc-panel" style="width:116px">
|
|
<table class="table table-bordered">
|
|
<tbody>
|
|
<tr class="swapflowtr">
|
|
<td>收支方向</td>
|
|
</tr>
|
|
@{
|
|
var posiDirection = trade.trade_extend.ExtendObj.Direction;
|
|
var bgclass = posiDirection == (int)SwapDirectionEnum.收取 ? "swapget" : "swappay";
|
|
<tr class="swapflowtr color-bule">
|
|
<td class="@bgclass" style="width:116px !important;">@((SwapDirectionEnum)posiDirection)</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
}
|
|
}
|
|
</div>
|
|
<div class="row no-gutters swaprow">
|
|
<div class="titleDiv">
|
|
<div class="titleHead"></div>
|
|
<div class="titleLabel"><label>交易备注</label></div>
|
|
</div>
|
|
<div class="yc-panel">
|
|
<div style="width:80%">
|
|
<textarea value="@trade.Comments" class='text-box text-left' rows='3' id='Comments' disabled style="background-color:#fff">@trade.Comments</textarea>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="positionInfo" class="tab-pane">
|
|
<div class="row no-gutters" style="display:block;">
|
|
<div class="titleDiv">
|
|
<div class="titleHead"></div>
|
|
<div class="titleLabel"><label>预付金</label></div>
|
|
</div>
|
|
<div class="yc-panel">
|
|
<table class="table table-bordered" style="width:77%;">
|
|
<tbody>
|
|
<tr>
|
|
<th>收支方向</th>
|
|
<th>资金类别</th>
|
|
<th>发生日期</th>
|
|
<th>金额</th>
|
|
<th>币种</th>
|
|
<th>预付金返息率</th>
|
|
<th>利率是否年化</th>
|
|
<th>结算规则</th>
|
|
</tr>
|
|
@foreach (var item in trade.swap_positions.Where(x => (x.InterestMode == 5 || x.InterestMode == 6) && !x.IsInitial))
|
|
{
|
|
var bgclass = item.InterestDirection == (int)SwapDirectionEnum.收取 ? "swapget" : "swappay";
|
|
<tr class="color-bule">
|
|
<td class="@bgclass" style="width:116px !important;">@((SwapDirectionEnum)item.InterestDirection)</td>
|
|
<td>@((InterestModeEnum)item.InterestMode)</td>
|
|
<td>@item.HappenDate.OtcFormatDate()</td>
|
|
<td><span class="js-swap-common" data-value="@SwapCommonData(item.InterestPrincipalFix)" data-kind="amount"></span></td>
|
|
<td>@item.Currency</td>
|
|
<td><span class="js-swap-common" data-value="@SwapCommonData(item.InterestRateDefault)" data-kind="rate"></span></td>
|
|
<td>@(item.IsAnnualized ? "是" : "否")</td>
|
|
<td><button class="btn btn-sm btn-outline-danger" type="button" onclick="showSwapRate('@(item.InterestSwapInterval)')" style="height:22px;">查看</button></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 class="yc-panel">
|
|
<table class="table table-bordered" style="width:77%;">
|
|
<tbody>
|
|
<tr>
|
|
<th>收支方向</th>
|
|
<th>计息基本类型</th>
|
|
<th>计息基数</th>
|
|
<th>利率</th>
|
|
<th>利率是否年化</th>
|
|
<th>计息方式</th>
|
|
<th>重置频率(天)</th>
|
|
<th>利率准则</th>
|
|
<th>类别</th>
|
|
<th>结算规则</th>
|
|
</tr>
|
|
@{
|
|
foreach (var item in trade.swap_positions.Where(x => ConsTrade.InterestModels.Contains(x.InterestMode) && !x.IsInitial))
|
|
{
|
|
decimal? interestPrice = null;
|
|
if (item.InterestMode == (int)InterestModeEnum.合约名义本金规模)
|
|
{
|
|
interestPrice = Convert.ToDecimal(trade.StockEqvNotional);
|
|
}
|
|
else if (item.InterestMode == (int)InterestModeEnum.标的期初全价)
|
|
{
|
|
interestPrice = Convert.ToDecimal(trade.StockEqvNotional);
|
|
}
|
|
else if (item.InterestMode == (int)InterestModeEnum.固定值)
|
|
{
|
|
interestPrice = item.InterestPrincipalFix;
|
|
}
|
|
//else if (item.InterestMode == (int)InterestModeEnum.多头存续名义本金)
|
|
//{
|
|
// interestPrice = realPositions.Where(w => w.PositionType == (int)PositionTypeFlag.Long).Sum(s => s.PosiNotionalValue);
|
|
//}
|
|
//else if (item.InterestMode == (int)InterestModeEnum.空头存续名义本金)
|
|
//{
|
|
// interestPrice = realPositions.Where(w => w.PositionType == (int)PositionTypeFlag.Short).Sum(s => s.PosiNotionalValue);
|
|
//}
|
|
var bgclass = item.InterestDirection == (int)SwapDirectionEnum.收取 ? "swapget" : "swappay";
|
|
var sign = item.InterestRateDefault < 0 ? "" : "+";
|
|
<tr class="color-bule">
|
|
<td class="@bgclass" style="width:116px !important;">@((SwapDirectionEnum)item.InterestDirection)</td>
|
|
<td>@((InterestModeEnum)item.InterestMode)</td>
|
|
<td><span class="js-swap-common" data-value="@SwapCommonData(interestPrice)" data-kind="amount"></span></td>
|
|
<td>
|
|
@(string.IsNullOrEmpty(item.FloatRateUnderlyingCode) ? "无" : item.FloatRateUnderlyingCode)
|
|
@sign
|
|
<span class="js-swap-common" data-value="@SwapCommonData(item.InterestRateDefault)" data-kind="rate"></span>
|
|
</td>
|
|
<td>@(item.IsAnnualized ? "是" : "否")</td>
|
|
<td>@(item.InterestType == 0 ? "单利" : "复利")</td>
|
|
<td>@item.interest_rest_days</td>
|
|
<td>@((item.interest_rule != null) ? (SwapInterestRule)item.interest_rule : "")</td>
|
|
<td>@(string.IsNullOrEmpty(item.category_tag) ? "互换利率" : item.category_tag)</td>
|
|
<td><button class="btn btn-sm btn-outline-danger" type="button" onclick="showSwapRate('@(item.InterestSwapInterval)')" style="height:22px;">查看</button></td>
|
|
</tr>
|
|
}
|
|
}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="row no-gutters" style="display:block;">
|
|
@if (singleTrade || realPositions.Any(x => !string.IsNullOrEmpty(x.UnderlyingCode)) || !hideFloatingIncomeDirection)
|
|
{
|
|
<div class="titleDiv">
|
|
<div class="titleHead"></div>
|
|
<div class="titleLabel"><label>浮动收益端</label></div>
|
|
</div>
|
|
}
|
|
@if (trade.swap_positions != null)
|
|
{
|
|
var paySwapPositions = trade.swap_positions.Where(x => !string.IsNullOrEmpty(x.UnderlyingCode) && !x.IsInitial).ToList();
|
|
if (paySwapPositions.Count > 0)
|
|
{
|
|
<div class="yc-panel">
|
|
<table class="table table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
@if (!hideFloatingIncomeDirection)
|
|
{
|
|
<td>收支方向</td>
|
|
}
|
|
<td>多空方向</td>
|
|
<td>标的代码</td>
|
|
<td>@spotPriceTitle</td>
|
|
@if (isBond)
|
|
{
|
|
<td>@netSportPriceTitle</td>
|
|
}
|
|
<td>数量</td>
|
|
<td>持仓名义本金</td>
|
|
<td>交易费用后付</td>
|
|
<td>起始日期</td>
|
|
<td>到期日期</td>
|
|
</tr>
|
|
@foreach (var item in paySwapPositions)
|
|
{
|
|
var bgclass = item.PosiDirection == 1 ? "swapget" : "swappay";
|
|
var multiplier = ConsGlobal.InstrumentType.IsBond(item.UnderlyingInstrumentType) ? 100 : 1;
|
|
<tr class="swapflowtr color-bule">
|
|
@if (!hideFloatingIncomeDirection)
|
|
{
|
|
<td class="@bgclass" style="width:116px !important;">
|
|
@((SwapDirectionEnum)item.PosiDirection)
|
|
</td>
|
|
}
|
|
<td>
|
|
@FloatingPositionTypeText(item.PosiDirection, item.PositionType)
|
|
</td>
|
|
<td>@item.UnderlyingCode</td>
|
|
<td>
|
|
<span class="js-swap-price" data-value="@SwapPriceData(item.PosiGrossPrice * multiplier)" data-instrument-type="@item.UnderlyingInstrumentType" data-field="grossPrice"></span>
|
|
</td>
|
|
@if (isBond)
|
|
{
|
|
<td>
|
|
<span class="js-swap-price" data-value="@SwapPriceData((item.PosiNetNoFeePrice ?? 0) * multiplier)" data-instrument-type="@item.UnderlyingInstrumentType" data-field="netPrice"></span>
|
|
</td>
|
|
}
|
|
<td>
|
|
<span class="js-swap-common" data-value="@SwapCommonData(item.PosiQuantity)" data-kind="quantity" data-instrument-type="@item.UnderlyingInstrumentType"></span>
|
|
</td>
|
|
<td><span class="js-swap-common" data-value="@SwapCommonData(item.PosiNotionalValue)" data-kind="amount"></span></td>
|
|
<td><span class="js-swap-common" data-value="@SwapCommonData(item.PosiTradingFeePending)" data-kind="amount"></span></td>
|
|
<td>@item.PosiStartDate.OtcFormatDate()</td>
|
|
<td>@item.PosiMatuirityDate.OtcFormatDate()</td>
|
|
</tr>
|
|
}
|
|
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
}
|
|
else if (!hideFloatingIncomeDirection)
|
|
{
|
|
<div class="yc-panel" style="width:116px">
|
|
<table class="table table-bordered">
|
|
<tbody>
|
|
<tr class="swapflowtr">
|
|
<td>收支方向</td>
|
|
</tr>
|
|
@{
|
|
var posiDirection = trade.trade_extend.ExtendObj.Direction;
|
|
var bgclass = posiDirection == (int)SwapDirectionEnum.收取 ? "swapget" : "swappay";
|
|
<tr class="swapflowtr color-bule">
|
|
<td class="@bgclass" style="width:116px !important;">@((SwapDirectionEnum)posiDirection)</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
}
|
|
|
|
}
|
|
</div>
|
|
</div>
|
|
@if (singleTrade && closeSwapDeals.Count > 0)
|
|
{
|
|
var index = 1;
|
|
|
|
<div id="terminationInfo" class="tab-pane">
|
|
@foreach (var deal in closeSwapDeals)
|
|
{
|
|
var tc = deal.unwindData;
|
|
if (tc.FlowEvents.Count == 0)
|
|
{
|
|
continue;
|
|
}
|
|
var closeFloat = tc.FlowEvents.First(x => !string.IsNullOrEmpty(x.UnderlyingCode));
|
|
var DealInterests = tc.FlowEvents.Where(x => string.IsNullOrEmpty(x.UnderlyingCode)).ToList();
|
|
var fbgclass = closeFloat.PayDirection == (int)SwapDirectionEnum.收取 ? "swapget" : "swappay";
|
|
var multiplier = ConsGlobal.InstrumentType.IsBond(closeFloat.UnderlyingInstrumentType) ? 100 : 1;
|
|
var unwindDate = tc.UnwindDate.HasValue ? tc.UnwindDate.Value : tc.ValueDate;
|
|
<table class="table table-bordered">
|
|
<tr>
|
|
<td class="tdRight">提前终止序号</td>
|
|
<td class="color-bule">@(index++)</td>
|
|
<td class="tdRight"></td>
|
|
<td></td>
|
|
</tr>
|
|
<tr>
|
|
@if (tc.CloseType == 1)
|
|
{
|
|
<td class="tdRight">平仓数量</td>
|
|
<td class="color-bule"><span class="js-swap-common" data-value="@SwapCommonData(PS.Config.IsUseDisplayNotional ? tc.CloseQty * (trade.CountRatio ?? 1) : tc.CloseQty)" data-kind="quantity" data-instrument-type="@trade.UnderlyingInstrumentType"></span></td>
|
|
}
|
|
else
|
|
{
|
|
<td class="tdRight">平仓比例</td>
|
|
<td class="color-bule">@(tc.ClosePercent.OtcFormatPercent(4))</td>
|
|
<td class="tdRight">平仓名义本金</td>
|
|
<td class="color-bule"><span class="js-swap-common" data-value="@SwapCommonData(tc.CloseNotionalValue)" data-kind="amount"></span></td>
|
|
}
|
|
|
|
</tr>
|
|
<tr>
|
|
<td class="tdRight">起始日期</td>
|
|
<td class="color-bule">@(tc.StartDate.OtcFormatDate())</td>
|
|
<td class="tdRight">事件日期</td>
|
|
<td class="color-bule">@(tc.ValueDate.OtcFormatDate())</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="tdRight">平仓日期</td>
|
|
<td class="color-bule">@(unwindDate.OtcFormatDate())</td>
|
|
<td class="tdRight">支付日期</td>
|
|
<td class="color-bule">@(tc.PayDate.OtcFormatDate())</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="tdRight">实现盈亏</td>
|
|
<td class="color-bule"><span class="js-swap-common" data-value="@SwapCommonData(tc.SwapRealizedPnL)" data-kind="amount"></span></td>
|
|
<td class="tdRight">平仓总额</td>
|
|
<td class="color-bule"><span class="js-swap-common" data-value="@SwapCommonData(tc.SwapCloseAmount)" data-kind="amount"></span></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td colspan="4">
|
|
<div class="row no-gutters" style="display:block;">
|
|
<div class="titleDiv">
|
|
<div class="titleHead"></div>
|
|
<div class="titleLabel"><label>预付金</label></div>
|
|
</div>
|
|
<div class="yc-panel">
|
|
<table class="table table-bordered" style="width: 850px">
|
|
<tbody>
|
|
<tr>
|
|
<td>收支方向</td>
|
|
<td>资金类别</td>
|
|
<td>应返还本金</td>
|
|
<td>利息金额</td>
|
|
<td>预付金平仓盈亏</td>
|
|
</tr>
|
|
@foreach (var item in DealInterests.Where(x => x.InterestMode == 5 || x.InterestMode == 6))
|
|
{
|
|
var bgclass = item.InterestDirection == (int)SwapDirectionEnum.收取 ? "swapget" : "swappay";
|
|
<tr class="color-bule">
|
|
<td class="@bgclass" style="width:116px !important;">@((SwapDirectionEnum)item.InterestDirection)</td>
|
|
<td>@(item.InterestModeStr)</td>
|
|
<td><span class="js-swap-common" data-value="@SwapCommonData(item.InterestPrincipal)" data-kind="amount"></span></td>
|
|
<td><span class="js-swap-common" data-value="@SwapCommonData(item.InterestAmount)" data-kind="amount"></span></td>
|
|
<td><span class="js-swap-common" data-value="@SwapCommonData(item.InterestClosePnL)" data-kind="amount"></span></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 class="yc-panel">
|
|
<table class="table table-bordered" style="width: 850px">
|
|
<tbody>
|
|
<tr>
|
|
<td>收支方向</td>
|
|
@*<td>计息基准</td>
|
|
<td>计息开始日</td>
|
|
<td>计息结束日</td>
|
|
<td>利率(年化)</td>*@
|
|
<td>其他费用</td>
|
|
<td>利息金额</td>
|
|
<td>利息端平仓盈亏</td>
|
|
</tr>
|
|
@foreach (var item in DealInterests.Where(x => ConsTrade.InterestModels.Contains(x.InterestMode)))
|
|
{
|
|
var bgclass = item.InterestDirection == (int)SwapDirectionEnum.收取 ? "swapget" : "swappay";
|
|
<tr class="color-bule">
|
|
<td class="@bgclass" style="width:116px !important;">@((SwapDirectionEnum)item.InterestDirection)</td>
|
|
@*<td>@(item.Principal.OtcFormatMoney(true))</td>
|
|
<td>@(item.InterestStartDate.OtcFormatDate())</td>
|
|
<td>@(item.InterestEndDate.OtcFormatDate())</td>
|
|
<td>@(item.Rate.OtcFormatPercent())</td>*@
|
|
<td><span class="js-swap-common" data-value="@SwapCommonData(item.InterestFee)" data-kind="amount"></span></td>
|
|
<td><span class="js-swap-common" data-value="@SwapCommonData(item.InterestAmount)" data-kind="amount"></span></td>
|
|
<td><span class="js-swap-common" data-value="@SwapCommonData(item.InterestClosePnL)" data-kind="amount"></span></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 class="yc-panel">
|
|
<table class="table table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
@if (!hideFloatingIncomeDirection)
|
|
{
|
|
<td>收支方向</td>
|
|
}
|
|
<td>多空方向</td>
|
|
<td>标的代码</td>
|
|
@if (isBond)
|
|
{
|
|
<td>期初标的交割全价%</td>
|
|
<td>期末标的交割全价%</td>
|
|
}
|
|
else
|
|
{
|
|
<td>期初标的价格</td>
|
|
<td>期末标的价格</td>
|
|
}
|
|
<td>数量</td>
|
|
<td>交易费用</td>
|
|
<td>交易费用(待结算)</td>
|
|
<td>分红收益</td>
|
|
<td>浮动端平仓盈亏</td>
|
|
</tr>
|
|
<tr class="color-bule">
|
|
@if (!hideFloatingIncomeDirection)
|
|
{
|
|
<td class="@fbgclass" style="width:116px !important;">@((SwapDirectionEnum)closeFloat.PayDirection)</td>
|
|
}
|
|
<td>@FloatingPositionTypeText(closeFloat.PayDirection, closeFloat.PositionType)</td>
|
|
<td>@closeFloat.UnderlyingCode</td>
|
|
@if (isBond)
|
|
{
|
|
<td><span class="js-swap-price" data-value="@SwapPriceData(closeFloat.PosiGrossPrice * multiplier)" data-instrument-type="@closeFloat.UnderlyingInstrumentType" data-field="grossPrice"></span></td>
|
|
<td><span class="js-swap-price" data-value="@SwapPriceData(closeFloat.TradingAmountAvg * multiplier)" data-instrument-type="@closeFloat.UnderlyingInstrumentType" data-field="grossPrice"></span></td>
|
|
}
|
|
else
|
|
{
|
|
<td><span class="js-swap-price" data-value="@SwapPriceData(closeFloat.PosiGrossPrice)" data-instrument-type="@closeFloat.UnderlyingInstrumentType" data-field="grossPrice"></span></td>
|
|
<td><span class="js-swap-price" data-value="@SwapPriceData(closeFloat.TradingAmountAvg)" data-instrument-type="@closeFloat.UnderlyingInstrumentType" data-field="grossPrice"></span></td>
|
|
}
|
|
<td><span class="js-swap-common" data-value="@SwapCommonData(closeFloat.Quantity)" data-kind="quantity" data-instrument-type="@closeFloat.UnderlyingInstrumentType"></span></td>
|
|
<td><span class="js-swap-common" data-value="@SwapCommonData(closeFloat.TradingFee)" data-kind="amount"></span></td>
|
|
<td><span class="js-swap-common" data-value="@SwapCommonData(closeFloat.TradingFeePending)" data-kind="amount"></span></td>
|
|
<td><span class="js-swap-common" data-value="@SwapCommonData(closeFloat.DividendIn)" data-kind="amount"></span></td>
|
|
<td style="font-size:18px;"><span class="js-swap-common" data-value="@SwapCommonData(closeFloat.FloatPnlSum)" data-kind="amount"></span></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
}
|
|
</div>
|
|
}
|
|
|
|
@if (!singleTrade && closeSwapDeals.Count > 0)
|
|
{
|
|
var index = 1;
|
|
<div id="terminationInfo" class="tab-pane">
|
|
@foreach (var eod in trade.eod_swaps)
|
|
{
|
|
<table class="table table-bordered">
|
|
<tr>
|
|
<td class="tdRight">提前终止序号</td>
|
|
<td class="color-bule">@(index++)</td>
|
|
<td class="tdRight"><button class="btn btn-sm btn-outline-danger" type="button" onclick="showCloseDetails('@trade.EncryptId', '@(eod.ValueDate.OtcFormatDate())')" style="height:22px;">查看</button></td>
|
|
<td></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="tdRight">起始日期</td>
|
|
<td class="color-bule">@(eod.CloseStartDate.OtcFormatDate())</td>
|
|
<td class="tdRight">平仓日期</td>
|
|
<td class="color-bule">@(eod.ValueDate.OtcFormatDate())</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="tdRight">平仓总额</td>
|
|
<td class="color-bule"><span class="js-swap-common" data-value="@SwapCommonData(eod.NotionalValue)" data-kind="amount"></span></td>
|
|
<td class="tdRight">实现盈亏</td>
|
|
<td class="color-bule"><span class="js-swap-common" data-value="@SwapCommonData(eod.TdRealizedPnL)" data-kind="amount"></span></td>
|
|
</tr>
|
|
</table>
|
|
}
|
|
</div>
|
|
}
|
|
|
|
@if (swap_deals.Count > 0)
|
|
{
|
|
var index = 1;
|
|
<div id="swapInfo" class="tab-pane">
|
|
@foreach (var deal in swap_deals)
|
|
{
|
|
var tc = deal.unwindData;
|
|
var closeFloat = tc.FlowEvents.FirstOrDefault(x => !string.IsNullOrEmpty(x.UnderlyingCode));
|
|
var DealInterests = tc.FlowEvents.Where(x => string.IsNullOrEmpty(x.UnderlyingCode)).ToList();
|
|
var swapInterests = DealInterests.Where(x => ConsTrade.InterestModels.Contains(x.InterestMode)).ToList();
|
|
var marginInterests = DealInterests.Where(x => x.InterestMode == 5 || x.InterestMode == 6).ToList();
|
|
<table class="table table-bordered">
|
|
<tr>
|
|
<td class="tdRight">互换序号</td>
|
|
<td class="color-bule">@(index++)</td>
|
|
<td class="tdRight">互换名义本金</td>
|
|
<td class="color-bule"><span class="js-swap-common" data-value="@SwapCommonData(tc.PosiNotionalValue)" data-kind="amount"></span></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="tdRight">起始日期</td>
|
|
<td class="color-bule">@(tc.StartDate.OtcFormatDate())</td>
|
|
<td class="tdRight">互换日期</td>
|
|
<td class="color-bule">@(tc.ValueDate.OtcFormatDate())</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="tdRight">支付日期</td>
|
|
<td class="color-bule">@(tc.PayDate?.OtcFormatDate() ?? tc.ValueDate.OtcFormatDate())</td>
|
|
<td></td>
|
|
<td></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="tdRight">平仓总额</td>
|
|
<td class="color-bule"><span class="js-swap-common" data-value="@SwapCommonData(tc.SwapCloseAmount)" data-kind="amount"></span></td>
|
|
<td class="tdRight">实现盈亏</td>
|
|
<td class="color-bule"><span class="js-swap-common" data-value="@SwapCommonData(tc.SwapRealizedPnL)" data-kind="amount"></span></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td colspan="4">
|
|
@if (marginInterests.Count > 0)
|
|
{
|
|
<div class="row no-gutters" style="display:block;">
|
|
<div class="titleDiv">
|
|
<div class="titleHead"></div>
|
|
<div class="titleLabel"><label>预付金</label></div>
|
|
</div>
|
|
<div class="yc-panel">
|
|
<table class="table table-bordered" style="width: 850px">
|
|
<tbody>
|
|
<tr>
|
|
<td>收支方向</td>
|
|
<td>其他费用</td>
|
|
<td>利息金额</td>
|
|
<td>预付金平仓盈亏</td>
|
|
</tr>
|
|
@foreach (var item in marginInterests)
|
|
{
|
|
var bgclass = item.InterestDirection == (int)SwapDirectionEnum.收取 ? "swapget" : "swappay";
|
|
<tr class="color-bule">
|
|
<td class="@bgclass" style="width:116px !important;">@((SwapDirectionEnum)item.InterestDirection)</td>
|
|
<td><span class="js-swap-common" data-value="@SwapCommonData(item.InterestFee)" data-kind="amount"></span></td>
|
|
<td><span class="js-swap-common" data-value="@SwapCommonData(item.InterestAmount)" data-kind="amount"></span></td>
|
|
<td><span class="js-swap-common" data-value="@SwapCommonData(item.InterestClosePnL)" data-kind="amount"></span></td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
}
|
|
|
|
@if (swapInterests.Count > 0)
|
|
{
|
|
<div class="row no-gutters" style="display:block;">
|
|
<div class="titleDiv">
|
|
<div class="titleHead"></div>
|
|
<div class="titleLabel"><label>利息端</label></div>
|
|
</div>
|
|
<div class="yc-panel">
|
|
<table class="table table-bordered" style="width: 850px">
|
|
<tbody>
|
|
<tr>
|
|
<td>收支方向</td>
|
|
<td>其他费用</td>
|
|
<td>利息金额</td>
|
|
<td>利息端平仓盈亏</td>
|
|
</tr>
|
|
@foreach (var item in swapInterests)
|
|
{
|
|
var bgclass = item.InterestDirection == (int)SwapDirectionEnum.收取 ? "swapget" : "swappay";
|
|
<tr class="color-bule">
|
|
<td class="@bgclass" style="width:116px !important;">@((SwapDirectionEnum)item.InterestDirection)</td>
|
|
<td><span class="js-swap-common" data-value="@SwapCommonData(item.InterestFee)" data-kind="amount"></span></td>
|
|
<td><span class="js-swap-common" data-value="@SwapCommonData(item.InterestAmount)" data-kind="amount"></span></td>
|
|
<td><span class="js-swap-common" data-value="@SwapCommonData(item.InterestClosePnL)" data-kind="amount"></span></td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
}
|
|
|
|
@if (singleTrade && closeFloat != null)
|
|
{
|
|
var fbgclass = closeFloat.PayDirection == (int)SwapDirectionEnum.收取 ? "swapget" : "swappay";
|
|
var multiplier = ConsGlobal.InstrumentType.IsBond(closeFloat.UnderlyingInstrumentType) ? 100 : 1;
|
|
<div class="row no-gutters" style="display:block;">
|
|
<div class="titleDiv">
|
|
<div class="titleHead"></div>
|
|
<div class="titleLabel"><label>浮动收益端</label></div>
|
|
</div>
|
|
<div class="yc-panel">
|
|
<table class="table table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
@if (!hideFloatingIncomeDirection)
|
|
{
|
|
<td>收支方向</td>
|
|
}
|
|
<td>多空方向</td>
|
|
<td>标的代码</td>
|
|
@if (isBond)
|
|
{
|
|
<td>@spotPriceTitle</td>
|
|
<td>@netSportPriceTitle</td>
|
|
|
|
}
|
|
else
|
|
{
|
|
<td>标的价格</td>
|
|
}
|
|
<td>@endSpotPriceTitle</td>
|
|
<td>数量</td>
|
|
<td>交易费用</td>
|
|
<td>分红收益</td>
|
|
<td>浮动端平仓盈亏</td>
|
|
</tr>
|
|
<tr class="color-bule">
|
|
@if (!hideFloatingIncomeDirection)
|
|
{
|
|
<td class="@fbgclass" style="width:116px !important;">@((SwapDirectionEnum)closeFloat.PayDirection)</td>
|
|
}
|
|
<td>@FloatingPositionTypeText(closeFloat.PayDirection, closeFloat.PositionType)</td>
|
|
<td>@closeFloat.UnderlyingCode</td>
|
|
@if (isBond)
|
|
{
|
|
<td><span class="js-swap-price" data-value="@SwapPriceData(closeFloat.PosiGrossPrice * multiplier)" data-instrument-type="@closeFloat.UnderlyingInstrumentType" data-field="grossPrice"></span></td>
|
|
<td><span class="js-swap-price" data-value="@SwapPriceData((closeFloat.TradingAmountNetAvg ?? 0) * multiplier)" data-instrument-type="@closeFloat.UnderlyingInstrumentType" data-field="netPrice"></span></td>
|
|
}
|
|
else
|
|
{
|
|
<td><span class="js-swap-price" data-value="@SwapPriceData(closeFloat.TradingAmountAvg * multiplier)" data-instrument-type="@closeFloat.UnderlyingInstrumentType" data-field="grossPrice"></span></td>
|
|
}
|
|
<td><span class="js-swap-price" data-value="@SwapPriceData(closeFloat.TradingAmountAvg * multiplier)" data-instrument-type="@closeFloat.UnderlyingInstrumentType" data-field="grossPrice"></span></td>
|
|
<td><span class="js-swap-common" data-value="@SwapCommonData(closeFloat.PositionQty ?? 0)" data-kind="quantity" data-instrument-type="@closeFloat.UnderlyingInstrumentType"></span></td>
|
|
<td><span class="js-swap-common" data-value="@SwapCommonData(closeFloat.TradingFee)" data-kind="amount"></span></td>
|
|
<td><span class="js-swap-common" data-value="@SwapCommonData(closeFloat.DividendIn)" data-kind="amount"></span></td>
|
|
<td><span class="js-swap-common" data-value="@SwapCommonData(closeFloat.FloatPnlSum)" data-kind="amount"></span></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
}
|
|
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
}
|
|
</div>
|
|
}
|
|
|
|
@if (trade.ClientCashInCashOutList.Count > 0)
|
|
{
|
|
<div id="ClientCashinCashout" class="tab-pane">
|
|
<table class="table table-bordered">
|
|
<tr>
|
|
<td class="tdRight">资金编号</td>
|
|
<td class="tdRight">方向类型</td>
|
|
<td class="tdRight">金额</td>
|
|
<td class="tdRight">资金状态</td>
|
|
<td class="tdRight">操作人</td>
|
|
<td class="tdRight">创建人</td>
|
|
<td class="tdRight">发生时间</td>
|
|
<td width="150" class="tdRight">操作时间</td>
|
|
<td class="tdRight">备注</td>
|
|
</tr>
|
|
<tbody>
|
|
@foreach (var item in trade.ClientCashInCashOutList)
|
|
{
|
|
<tr>
|
|
<td class="tdRight">@item.Number</td>
|
|
<td class="tdRight">@item.TradeDirectionType</td>
|
|
<td class="tdRight">@(item.Money == 0 ? 0 : item.Money * -1)</td>
|
|
<td class="tdRight">@item.State</td>
|
|
<td class="tdRight">@item.OptName</td>
|
|
<td class="tdRight">@item.CreatorName</td>
|
|
<td class="tdRight">@item.HappenDate?.ToString("yyyy-MM-dd")</td>
|
|
<td class="tdRight">@item.OptDate?.ToString("yyyy-MM-dd HH:mm:ss")</td>
|
|
<td class="tdRight">@(item.Comments)</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
}
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal fade" id="swapIntervalModal" data-backdrop="static">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
|
|
<!-- 模态框头部 -->
|
|
<div class="modal-header">
|
|
<h4 class="modal-title">互换观察日</h4>
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
</div>
|
|
|
|
<!-- 模态框主体 -->
|
|
<div class="modal-body" style="height: 500px;overflow-y: scroll;">
|
|
<table class="table table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<td> 观察日期 </td>
|
|
<td v-if="!isMarginLeg"> 结算日期 </td>
|
|
<td> 互换利率</td>
|
|
<td> 是否结算 </td>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
<tr v-for="item in SwapIntervalList">
|
|
<td>{{formatDate(item.Date)}}</td>
|
|
<td v-if="!isMarginLeg">{{formatDate(item.SettlementDate)}}</td>
|
|
<td>
|
|
<span v-if="item.FloatRateCode">{{item.FloatRateCode}}+</span>
|
|
<span>{{item.Rate}}</span>
|
|
</td>
|
|
<td>{{item.Settlement?"是":"否"}}</td>
|
|
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- 模态框底部 -->
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-primary" data-dismiss="modal" v-on:click="closeModal()">关闭</button>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@if (!string.IsNullOrWhiteSpace(Context.Request.Query["abstract"]))
|
|
{
|
|
@await Html.PartialAsync("/Views/trade/_part/TradeAbstractInfo.cshtml", Model.Trade)
|
|
}
|