203 lines
11 KiB
Plaintext
203 lines
11 KiB
Plaintext
@model YLErp.Modules.TradeModule.ForwardModule.PrepareForwardUnwindResult
|
|
@{
|
|
ViewBag.Title = "交易 | 交易平仓";
|
|
Layout = "~/Views/Shared/_InfoLayout.cshtml";
|
|
var trade = Model.Trade;
|
|
//是否平仓复核提交
|
|
bool isReCheckConfirm = trade.TradeStatus == ConsTrade.平仓待复核;
|
|
bool isShowReCheckClose = ViewBag.IsShowReCheckClose;
|
|
bool isUseApproval = ViewBag.isUseApproval;
|
|
}
|
|
@section CSS{
|
|
<style type="text/css">
|
|
.btn { border: none }
|
|
</style>
|
|
}
|
|
@section JS
|
|
{
|
|
<script>
|
|
//otcformat禁止千分位分组
|
|
window.otcformat.options.disableGrouping = true;
|
|
var model = @Json.Serialize(Model.TradeCash);
|
|
var otcTradeForward = @Json.Serialize(Model.OtcTradeForward);
|
|
model.FinalPriceType = "System";
|
|
model.ValueDate = moment(model.ValueDate).format("YYYY-MM-DD");
|
|
model.FinalPrice = otcformat.trading.umprice(model.FinalPrice);
|
|
var variety = @Json.Serialize(Model.Variety);
|
|
var g_isReCheckConfirm = "@isReCheckConfirm" == "True";
|
|
var g_isShowReCheckClose = "@isShowReCheckClose" == "True";
|
|
var g_isUseApproval = "@isUseApproval" == "True";
|
|
var systemValueDate = "@valuedateBLL.ValueDate.ToString("yyyy-MM-dd")";
|
|
var tradeDate = "@trade.TradeDate.Value.ToString("yyyy-MM-dd")";
|
|
var strikePrice = @trade.Strike;
|
|
var holidayMargin = @Model.HolidayMargin;
|
|
var lastMarginRecord = @Json.Serialize(Model.LastMarginRecord);
|
|
var maxUnwindDate = "@(Model.MaxUnwindDate.ToString("yyyy-MM-dd"))";
|
|
var exerciseDate = "@trade.ExerciseDate.OtcFormatDate()";
|
|
|
|
function initUnwindDate() {
|
|
main.setTradeDatePicker(model.ValueDate, "#unwindDate", null, vue.setUnwindDate);
|
|
$("#unwindDate").datepicker("option", "minDate", tradeDate);
|
|
$("#unwindDate").datepicker("option", "maxDate", '@(Model.MaxUnwindDate.OtcFormatDate())');
|
|
}
|
|
|
|
$(document).ready(function () {
|
|
initUnwindDate();
|
|
});
|
|
</script>
|
|
<script src="~/Scripts/app/trade/forwardTradeUnwind.js?v=@(HtmlUtil.JsVersion)"></script>
|
|
}
|
|
@if (!isReCheckConfirm || isUseApproval)
|
|
{
|
|
<div id="vueDiv" class="row" style="margin-top: 20px">
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">平仓类型</label>
|
|
<select v-model="tradeCash.UnwindType">
|
|
<option value="全部平仓">全部平仓</option>
|
|
<option value="部分平仓">部分平仓</option>
|
|
</select>
|
|
</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="doubleFormat(tradeCash).TradeAmount" readonly="readonly" type="text" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">平仓日期</label>
|
|
<input 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 id="FinalPrice" class="text-box" v-model="tradeCash.FinalPrice" v-on:blur="changeUnderlyingPrice();" 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="refreshUnderlyingPrice()">
|
|
<span title="使用系统标的价格" class="glyphicon glyphicon-refresh"></span>
|
|
</a>
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
@if (trade.StructureType == "掉期")
|
|
{
|
|
<label class="formlabel">掉期收益</label>
|
|
}
|
|
else
|
|
{
|
|
<label class="formlabel">远期收益</label>
|
|
}
|
|
<input class="text-box" v-model="ForwardProfit" readonly="readonly" type="number" min="0" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">每手平仓费用</label>
|
|
<input id="UnwindPrice" class="text-box" v-model="tradeCash.UnwindPrice" v-on:change="computeUnwindTotalFee();" type="number" />¥ 元/手
|
|
<span class="required"><label v-if="tradeCash.UnwindPrice!=0">我方{{tradeCash.UnwindPrice > 0 ? "收取"+tradeCash.UnwindPrice:"支付"+tradeCash.UnwindPrice*-1}} 元/手</label></span>
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">平仓数量</label>
|
|
<input id="UnwindTradeAmount" class="text-box" v-model="doubleFormat(tradeCash).UnwindTradeAmount" v-bind:readonly="tradeCash.UnwindType==='全部平仓'" v-on:change="changeUnwindTradeAmount();" type="number" min="0" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">预付金成本</label>
|
|
<input class="text-box" v-model="tradeCash.ExtraAmount" value="0" readonly="readonly" type="number" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">平仓总费用</label>
|
|
<input class="text-box" v-model="UnwindFee" v-on:change="computeUnwindPrice()" type="number" />¥
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">标的代码</label>
|
|
<input class="text-box" v-model="tradeCash.UnderlyingCode" readonly="readonly" type="text" />
|
|
</div>
|
|
<div>
|
|
<label style="margin-left: 50px; font-weight: 800;font-size:13px">说明:平仓的总费用=远期收益+每手平仓费用×平仓手数-开仓时已补偿的远期价值×平仓比例+预付金成本 </label>
|
|
</div>
|
|
<div class="clearfix"></div>
|
|
<div class="text-center" style="margin-top: 30px">
|
|
@if (ViewBag.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
|
|
{
|
|
<input type="button" class="btn btn-primary" :value="getSumbitText()" v-on:click="submit" style="margin-left: 45px;" />
|
|
<input type="button" class="btn btn-primary" value="取消" v-on:click="closeLayer(true)" />
|
|
}
|
|
</div>
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
<div id="vueDiv" class="row" style="margin-top: 20px">
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">平仓类型</label>
|
|
<select v-model="tradeCash.UnwindType" disabled>
|
|
<option value="全部平仓">全部平仓</option>
|
|
<option value="部分平仓">部分平仓</option>
|
|
</select>
|
|
</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="doubleFormat(tradeCash).TradeAmount" readonly="readonly" type="text" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">平仓日期</label>
|
|
<input 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 id="FinalPrice" class="text-box" v-model="tradeCash.FinalPrice" v-on:blur="changeUnderlyingPrice();computeForwardProfit();" 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>
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">远期收益</label>
|
|
<input class="text-box" v-model="ForwardProfit" readonly="readonly" type="number" min="0" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">每手平仓费用</label>
|
|
<input id="UnwindPrice" class="text-box" v-model="UnwindPriceCheck" type="number" v-on:change="computeUnwindTotalFee();" />¥ 元/手
|
|
<span class="required"><label v-if="UnwindPriceCheck!=0">我方{{UnwindPriceCheck > 0 ? "收取"+UnwindPriceCheck:"支付"+UnwindPriceCheck*-1}} 元/手</label></span>
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">平仓数量</label>
|
|
<input id="UnwindTradeAmount" class="text-box" v-model="doubleFormat(tradeCash).UnwindTradeAmount" readonly="readonly" v-on:change="changeUnwindTradeAmount();computeForwardProfit();" type="number" min="0" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">预付金成本</label>
|
|
<input class="text-box" v-model="tradeCash.ExtraAmount" value="0" readonly="readonly" type="number" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">平仓总费用</label>
|
|
<input class="text-box" v-model="AmountCheck" v-on:change="computeUnwindPrice()" type="number" />¥
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">标的代码</label>
|
|
<input class="text-box" v-model="tradeCash.UnderlyingCode" readonly="readonly" type="text" />
|
|
</div>
|
|
<div>
|
|
<label style="margin-left: 50px; font-weight: 800;font-size:13px"> 说明:平仓的总费用=远期收益+每手平仓费用×平仓手数-开仓时已补偿的远期价值×平仓比例+预付金成本 </label>
|
|
</div>
|
|
<div class="clearfix"></div>
|
|
<div class="text-center" style="margin-top: 30px">
|
|
<input type="button" class="btn btn-primary" value="复核" v-on:click="review" style="margin-left: 45px;" />
|
|
<input type="button" class="btn btn-primary" value="拒绝" v-on:click="reject" />
|
|
<input type="button" class="btn btn-primary" value="取消" v-on:click="closeLayer(true)" />
|
|
</div>
|
|
</div>
|
|
}
|