285 lines
16 KiB
Plaintext
285 lines
16 KiB
Plaintext
@using Newtonsoft.Json
|
|
@model trade_cash
|
|
@{
|
|
ViewBag.Title = "交易 | 交易平仓";
|
|
Layout = "~/Views/Shared/_InfoLayout.cshtml";
|
|
trade trade = ViewBag.trade;
|
|
trade pairTrade = ViewBag.PairTrade;
|
|
//是否平仓复核提交
|
|
bool isReCheckConfirm = trade.TradeStatus == ConsTrade.平仓待复核;
|
|
bool isShowReCheckClose = ViewBag.IsShowReCheckClose;
|
|
bool isShowApplySwap = ViewBag.IsShowApplySwap;
|
|
bool isUseApproval = ViewBag.isUseApproval;
|
|
}
|
|
@section CSS{
|
|
<style type="text/css">
|
|
.btn { border: none; height: auto; }
|
|
|
|
p { font-weight: bold; margin-left: 150px; font-size: 14px; margin-bottom: unset; }
|
|
|
|
.modal-dialog { max-width: 800px; }
|
|
</style>
|
|
}
|
|
@section JS
|
|
{
|
|
<script src="~/Scripts/app/tradeHelper.js?v=@HtmlUtil.JsVersion"></script>
|
|
<script>
|
|
var model = @Json.Serialize(Model);
|
|
model.trade_cash_swap.GetFinalPriceType = "System";
|
|
model.trade_cash_swap.PayFinalPriceType = "System";
|
|
model.ValueDate = moment(model.ValueDate).format("YYYY-MM-DD");
|
|
model.HappenedDate = model.HappenedDate != null ? moment(model.HappenedDate).format("YYYY-MM-DD") : null;
|
|
model.UnwindVol = main.toNumberExcludingNaNEx(model.UnwindVol * 100);
|
|
model.Strike = main.toNumberExcludingNaNEx(model.Strike);
|
|
var underlying = @Html.Raw(JsonConvert.SerializeObject(ViewBag.underlying));
|
|
var isSwap = @ViewBag.IsSwap;
|
|
var trade_swap = @Json.Serialize(ViewBag.TradeSwap);
|
|
var variety = @Json.Serialize(ViewBag.variety);
|
|
var pairTrade = @Html.JsonSerialize(pairTrade);
|
|
var trade = @Html.JsonSerialize(trade);
|
|
var g_isShowReCheckClose = "@isShowReCheckClose" == "True";
|
|
var g_isShowApplySwap = "@isShowApplySwap" == "True";
|
|
var g_isUseApproval = "@isUseApproval" == "True";
|
|
var valueDate = "@(valuedateBLL.ValueDate <= trade.ExerciseDate ? valuedateBLL.ValueDate.ToString("yyyy-MM-dd") : trade.ExerciseDate?.ToString("yyyy-MM-dd"))"
|
|
var sysvalueDate = "@(valuedateBLL.ValueDate.ToString("yyyy-MM-dd"))"
|
|
var systemValueDate = moment(valueDate);
|
|
var startDate = "@Model.StartDate.ToString("yyyy-MM-dd")";
|
|
var minDate = "@ViewBag.MinDate.ToString("yyyy-MM-dd")"
|
|
var exerciseDate = "@trade.ExerciseDate.Value.ToString("yyyy-MM-dd")";
|
|
function initUnwindDate() {
|
|
main.setTradeDatePicker(model.HappenedDate ?? model.ValueDate, "#unwindDate", null, vue.setUnwindDate);
|
|
$("#unwindDate").datepicker("option", "minDate", minDate);
|
|
if (trade.SettlementFlag != 1) {
|
|
$("#unwindDate").datepicker("option", "maxDate", valueDate);
|
|
} else {
|
|
$("#unwindDate").datepicker("option", "maxDate", sysvalueDate);
|
|
}
|
|
$("#startDate").val(startDate);
|
|
}
|
|
$(document).ready(function () {
|
|
initUnwindDate();
|
|
});
|
|
let fmt6 = main.numberFormat(6, { trimTailZeros: true });
|
|
trade_swap.GetSwapRate = fmt6(trade_swap.GetSwapRate);
|
|
trade_swap.PaySwapRate = fmt6(trade_swap.PaySwapRate);
|
|
</script>
|
|
<script src="~/Scripts/app/trade/tradeSwapUnwind.js?v=@(HtmlUtil.JsVersion)"></script>
|
|
}
|
|
<div class="pb-3">
|
|
<div id="vueDiv" class="yc-panel">
|
|
<div id="commomArea" class="row" style="@(ViewBag.IsSwap == 1 ? " height:15rem" : "height:21rem" )">
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">成交名义本金</label>
|
|
<input class="text-box" v-model="tradeCash.OriginalStockEqvNotional" readonly="readonly" type="text" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">持仓名义本金</label>
|
|
<input class="text-box" v-model="tradeCash.StockEqvNotional" readonly="readonly" type="text" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">成交数量</label>
|
|
<input class="text-box" v-model="tradeCash.TradeOriginalAmount" readonly="readonly" type="text" />
|
|
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">持仓数量</label>
|
|
<input class="text-box" v-model="tradeCash.TradeAmount" readonly="readonly" type="text" />
|
|
</div>
|
|
@if (ViewBag.IsSwap != 1)
|
|
{
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">平仓方式</label>
|
|
<select style="height: 30px;" v-model="tradeCash.UnwindMethod">
|
|
<option value="0">名义本金</option>
|
|
<option value="1">数量</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">平仓类型</label>
|
|
<select style="height: 30px;" v-model="tradeCash.UnwindType" v-bind:disabled="tradeCash.ValueDate > trade.ExerciseDate" v-on:change="changeUnwindType()">
|
|
<option value="全部平仓">全部平仓</option>
|
|
<option value="部分平仓">部分平仓</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group col-md-6" v-show="tradeCash.UnwindMethod==1">
|
|
<label class="formlabel">平仓数量</label>
|
|
<input class="text-box" v-model="tradeCash.UnwindTradeAmount" v-bind:disabled="tradeCash.UnwindType=='全部平仓'" v-on:change="changeUnwindNum()" type="text" />
|
|
</div>
|
|
<div class="form-group col-md-6" v-show="tradeCash.UnwindMethod!=1">
|
|
<label class="formlabel">平仓比例</label>
|
|
<input class="text-box" v-model="tradeCash.UnwindPercentRate" v-bind:disabled="tradeCash.UnwindType=='全部平仓'" v-on:change="changeUnwindPercentRate()" type="text" />%
|
|
</div>
|
|
<div class="form-group col-md-6" v-show="tradeCash.UnwindMethod!=1">
|
|
<label class="formlabel">平仓名义本金</label>
|
|
<input class="text-box" v-model="tradeCash.UnwindStockEqvNotional" v-bind:disabled="tradeCash.UnwindType=='全部平仓'" v-on:change="changeUnwindStockEqvNotional()" type="text" />¥
|
|
</div>
|
|
@*<div class="form-group col-md-6">
|
|
<label class="formlabel">平仓费用</label>
|
|
<input class="text-box" v-model="tradeCash.ExtraAmount" v-on:change="DoAmountSum()" type="text" />
|
|
</div>*@
|
|
}
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">起始日期</label>
|
|
<input class="text-box" id="startDate" readonly="readonly" type="text" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
@if (ViewBag.IsSwap != 1)
|
|
{
|
|
<label class="formlabel">平仓日期</label>
|
|
}
|
|
else
|
|
{
|
|
<label class="formlabel">互换日期</label>
|
|
}
|
|
<input v-if="tradeCash.HappenedDate" class="text-box" id="unwindDate" onchange="vue.setUnwindDate($(this).val())" v-model="tradeCash.HappenedDate" type="text" />
|
|
<input v-else class="text-box" id="unwindDate" onchange="vue.setUnwindDate($(this).val())" v-model="tradeCash.ValueDate" type="text" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">年化天数</label>
|
|
<input class="text-box" v-model="trade_swap.AnnualDays" readonly="readonly" type="text" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">平仓总额</label>
|
|
<input class="text-box" v-model="tradeCash.Amount" readonly="readonly" type="text" />
|
|
</div>
|
|
|
|
@if (ViewBag.IsSwap != 1)
|
|
{
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">返还预付金</label>
|
|
<input class="text-box" v-model="tradeCash.AdvanceMoney" type="text" />
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">返还预付金</label>
|
|
<input class="text-box" v-model="tradeCash.AdvanceMoney" type="text" readonly="readonly" />
|
|
</div>
|
|
}
|
|
</div>
|
|
<div class="clearfix"></div>
|
|
<hr />
|
|
<div id="diffArea" class="row" style="height: 35rem ">
|
|
<div class="form-group col-md-6">
|
|
<p>收取</p>
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<p>支付</p>
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">标的代码</label>
|
|
<input class="text-box" v-model="trade_swap.GetUnderlyingCode" readonly="readonly" type="text" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">标的代码</label>
|
|
<input class="text-box" v-model="trade_swap.PayUnderlyingCode" readonly="readonly" type="text" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">多头空头</label>
|
|
<input class="text-box" v-model="trade_swap.GetLongShort" readonly="readonly" type="text" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">多头空头</label>
|
|
<input class="text-box" v-model="trade_swap.PayLongShort" readonly="readonly" type="text" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">年化利率</label>
|
|
<input class="text-box" v-model="trade_swap.GetSwapRate" readonly="readonly" type="text" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">年化利率</label>
|
|
<input class="text-box" v-model="trade_swap.PaySwapRate" readonly="readonly" type="text" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">基准价格</label>
|
|
<input class="text-box" v-model="trade_swap.GetSpotPrice" readonly="readonly" type="text" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">基准价格</label>
|
|
<input class="text-box" v-model="trade_swap.PaySpotPrice" readonly="readonly" type="text" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">标的价格</label>
|
|
<input class="text-box" v-model="tradeCash.trade_cash_swap.GetFinalPrice" v-on:blur="changeGetUnderlyingPrice()" type="number" min="0" />
|
|
<template v-if="tradeCash.FinalPriceType=='User'">
|
|
<span class="glyphicon glyphicon-user" title="使用用户输入的标的价格"></span>
|
|
</template>
|
|
<template v-else>
|
|
<span class="glyphicon glyphicon-tags" title="使用系统中的标的价格"></span>
|
|
</template>
|
|
<a href="javascript:void(0)" v-on:click="refreshGetUnderlyingPrice()">
|
|
<span title="使用系统标的价格" class="glyphicon glyphicon-refresh"></span>
|
|
</a>
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">标的价格</label>
|
|
<input class="text-box" v-model="tradeCash.trade_cash_swap.PayFinalPrice" v-on:blur="changePayUnderlyingPrice()" type="number" min="0" />
|
|
<template v-if="tradeCash.FinalPriceType=='User'">
|
|
<span class="glyphicon glyphicon-user" title="使用用户输入的标的价格"></span>
|
|
</template>
|
|
<template v-else>
|
|
<span class="glyphicon glyphicon-tags" title="使用系统中的标的价格"></span>
|
|
</template>
|
|
<a href="javascript:void(0)" v-on:click="refreshPayUnderlyingPrice()">
|
|
<span title="使用系统标的价格" class="glyphicon glyphicon-refresh"></span>
|
|
</a>
|
|
</div>
|
|
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">手续费</label>
|
|
<input class="text-box" v-model="tradeCash.trade_cash_swap.GetCostFee" v-on:change="DoAmountSum()" v-bind:disabled="trade_swap.IsGetFloatingProfit" type="text" :value="0" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">手续费</label>
|
|
<input class="text-box" v-model="tradeCash.trade_cash_swap.PayCostFee" v-on:change="DoAmountSum()" v-bind:disabled="trade_swap.IsPayFloatingProfit" type="text" :value="0" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">利息金额</label>
|
|
<input class="text-box" v-model="tradeCash.trade_cash_swap.GetExtraAmount" v-on:change="DoAmountSum()" type="text" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">利息金额</label>
|
|
<input class="text-box" v-model="tradeCash.trade_cash_swap.PayExtraAmount" v-on:change="DoAmountSum()" type="text" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">收益金额</label>
|
|
<input class="text-box" v-model="tradeCash.trade_cash_swap.GetInitialAmount" v-on:change="DoAmountSum()" readonly="readonly" type="text" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">收益金额</label>
|
|
<input class="text-box" v-model="tradeCash.trade_cash_swap.PayInitialAmount" v-on:change="DoAmountSum()" readonly="readonly" type="text" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">互换总额</label>
|
|
<input class="text-box" v-model="tradeCash.trade_cash_swap.GetAmount" readonly="readonly" type="text" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">互换总额</label>
|
|
<input class="text-box" v-model="tradeCash.trade_cash_swap.PayAmount" readonly="readonly" type="text" />
|
|
</div>
|
|
</div>
|
|
<div class="clearfix"></div>
|
|
<hr />
|
|
<div class="form-group text-center">
|
|
@if (isUseApproval)
|
|
{
|
|
<input type="button" class="btn btn-primary" value="审批通过" v-on:click="submitApproval('pass')" style="margin-left: 45px;" />
|
|
<input type="button" class="btn btn-primary" value="拒绝" v-on:click="submitApproval('reject')" />
|
|
}
|
|
else
|
|
{
|
|
if (ViewBag.IsSwap == 1)
|
|
{
|
|
<input type="button" class="btn btn-primary" :value="getSwapText()" v-on:click="swapTrade" />
|
|
}
|
|
else
|
|
{
|
|
<input type="button" class="btn btn-primary" :value="getSumbitText()" v-on:click="unwindSwapTrade" style="margin-left: 45px;" />
|
|
}
|
|
}
|
|
<input type="button" class="btn btn-primary" value="取消" v-on:click="closeCurrentWindow" />
|
|
</div>
|
|
</div>
|
|
</div>
|